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 characteristic metadata
Python 3.7.6 (v3.7.6:43364a7ae0, Dec 18 2019, 14:18:50)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from bleak_sigspec.utils import get_xml_char
>>> temp = get_xml_char('Temperature')
>>> temp
Characteristic Metadata:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- NAME: Temperature
- UUID: 2A6E
- ABSTRACT: None
- SUMMARY: None
- FIELDS:
- Temperature:
- InformativeText: Unit is in degrees Celsius with a resolution of 0.01 degrees Celsius
- Requirement: Mandatory
- Format: sint16
- Ctype: h
- Unit_id: org.bluetooth.unit.thermodynamic_temperature.degree_celsius
- Quantity: thermodynamic temperature
- Unit: degree celsius
- Symbol: °C
- DecimalExponent: -2
- TYPE: org.bluetooth.characteristic.temperature
- INFO TEXT: Unit is in degrees Celsius with a resolution of 0.01 degrees Celsius
- DESCRIPTION: None
- NOTE: None
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
>>>
Documentation
See the documentation at https://bleak-sigspec.readthedocs.io
Metadata
Release files for bleak-sigspec 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bleak_sigspec-0.0.4.tar.gz | 218.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bleak_sigspec-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 622.7 kB
Release files / bleak_sigspec-0.0.4.tar.gz
| Download URL | bleak_sigspec-0.0.4.tar.gz |
|---|---|
| Size | 218.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e5e9372aa135756bbf52c5a4982aaa6e62ef21e00aeb87f4752ef05288a05f4
|
|
BLAKE2b-256 checksum How to use checksums |
24dc5f327a82961dad70c5968ee3d2f77b7dce3ded914cd04f77cd62d51c683b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.4
|
Release files / bleak_sigspec-0.0.4-py3-none-any.whl
| Download URL | bleak_sigspec-0.0.4-py3-none-any.whl |
|---|---|
| Size | 404.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a7b68909773a05429ceaaeaf10964a24d2df53dd40f17c35a0f96071ac927c7
|
|
BLAKE2b-256 checksum How to use checksums |
1b938fb4e26e189459b66979d9c4fe656d2849dcd42fa71d66ea59939569fd90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.4
|
Security for bleak-sigspec 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.