This is a library for creating and parsing BGAPI packets.
This library is under construction.
This library currently supports Python 3.6 and possibly latter versions.
This library currently supports Silicon Labs Bluetooth Software API version 2.8.1 (non-deprecated only).
In [1]: import bgapi
In [2]: bgapi.system.cmd.reset(0)
Out[2]: b' \x01\x01\x01\x00'
In [1]: import bgapi
In [2]: data = b'\xa0\x12\x01\x00\x02\x00\x08\x00\x01\x00\xc2\x00\x00\x00\x05\x01\x01\x00\x99\x07\x9cx'
In [3]: len(data)
Out[3]: 22
In [4]: packet, offset = bgapi.from_binary(data)
In [5]: offset
Out[5]: 22
In [6]: packet
Out[6]:
{'msg_type': 160,
'min_payload_len': 18,
'msg_class': 1,
'msg_id': 0,
'payload': {'major': 2,
'minor': 8,
'patch': 1,
'build': 194,
'bootloader': 17104896,
'hw': 1,
'hash': 2023491481}}
We are not in PyPI yet.
If you are interested in the latest (possibly unstable) features, you may issue the following command:
pip install --upgrade git+https://github.com/acburigo/python-bgapi.git
This repository is currently maintained by Arthur Crippa Búrigo.
Steps:
- Clone this repo into any folder
- Install the following dependencies:
pip install wheel
- Install the library using the following command:
python3 setup.py sdist bdist_wheel && cd dist/ && pip3 install *.whl && cd ..