Bleak SIG Bluetooth Low Energy Characteristics Specification Formatter
Project description
bleak_sigspec
Bleak SIG Bluetooth Characteristic Specification Formatter
This package enables characteristic metadata parsing and automatic formatting (bytes unpacking) into the proper characteristic values.
To install
pip install bleak_sigspec
or to get the latest version
pip install https://github.com/Carglglz/bleak_sigspec.git
Compatibility with +200 GATT characteristics following GATT Specifications
Usage example
service_explorer.py
in bleak examples:
char --> Temperature Characteristic
from bleak_sigspec.utils import get_char_value
[...]
37
bytes_value = bytes(await client.read_gatt_char(char.uuid))
formatted_value = get_char_value(bytes_value, char)
[...]
43
log.info(
"Characteristic Name: {0}, Bytes Value: {1}, Formatted
Value: {2}".format(char.description, bytes_value, formatted_value))
$ python3 service_explorer.py
[...]
Characteristic Name: Temperature, Bytes Value: b'Z\x16', Formatted Value: {'Temperature': {'Quantity': 'thermodynamic temperature',
'Unit': 'degree celsius',
'Symbol': '°C',
'Value': 57.22}}
See more at bleak_sigspec documentation
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bleak_sigspec-0.0.1.tar.gz
(216.3 kB
view hashes)
Built Distribution
bleak_sigspec-0.0.1-py3-none-any.whl
(401.5 kB
view hashes)
Close
Hashes for bleak_sigspec-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 225f2e9f857d30ab27cdd8c00d9d910b12b8c1762db86a9cf1a4268c2c92179e |
|
MD5 | d6021342b12e00907e18d84a0306f33c |
|
BLAKE2b-256 | 225c8c2cdd0e15e52d50836bb50174b5918e3348a0fad357166def21d17db682 |