File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -21,16 +21,25 @@ This backend uses `pyBGAPI <https://pypi.org/project/pybgapi/>`_ to handle the p
2121
2222Usage
2323-----
24- This backend cannot be automatically selected based on system type, so must be manually
25- selected, using code such as:
24+ This backend can either be explicitly selected via the ``backend `` kwarg when creating a BleakClient,
25+ or, environment variables can be used.
26+
27+ Environment variables understood:
28+ * BLEAK_BGAPI_XAPI Must be a path to the ``sl_bt.xapi `` file.
29+ If this env var exists, the BGAPI backend will be automatically loaded
30+ * BLEAK_BGAPI_ADAPTER The serial port to use, eg ``/dev/ttyACM1 ``
31+ * BLEAK_BGAPI_BAUDRATE The serial baudrate to use when opening the port, if required.
32+
33+ Alternatively, these can all be provided directly as kwargs, as show below:
2634
2735.. code-block :: python
2836
2937 async with bleak.BleakClient(
3038 " 11:aa:bb:cc:22:33" ,
3139 backend = bleak.backends.bgapi.client.BleakClientBGAPI,
32- bgapi = " /home/karlp /SimplicityStudio/SDKs/gecko-4.2.0/protocol/bluetooth/api/sl_bt.xapi" ,
40+ bgapi = " /home/... /SimplicityStudio/SDKs/gecko-4.2.0/protocol/bluetooth/api/sl_bt.xapi" ,
3341 adapter = " /dev/ttyACM1" ,
42+ baudrate = 921600 ,
3443 ) as client:
3544 logging.info(" Connected to %s " , client)
3645
You can’t perform that action at this time.
0 commit comments