bgapi_py
A library for using Bluetooth Low Energy modules created by BlueGiga. This module is pure python usable from Windows, Ubuntu, and any platform with a serial port and the ability to run Python (like Raspberry Pi and Beaglebone Black). Examples are provided for both client and server functionality. Note that if you want to develop your own device GATT profile, it requires a module firmware update.
bgapi.py has two important components:
BlueGigaAPI wraps the serial connection, it can be used synchronously by calling the polling function, or it can be used asynchronously by starting the daemon thread.
BlueGigaCallbacks is a base class for callbacks from responses and events received from the module. Inherit this class and override the functions you need to trigger your code or get your data.
cmd_def.py eliminates the need for magic numbers in method parameters, use it for more readable code.
- bgmodule.py wraps the API in an additional layer of abstraction. It attempts to
eliminate the need to understand the BlueGiga API, so that only an understanding of BLE is required.
Example Code
The test folder demonstrates high level Bluetooth Smart operations. It provides examples of Apple’s iBeacon and Google’s prototype Physical Web. Testing of this library is limited to what you see in these examples. Many BGAPI commands cannot be tested, especially hardware operations like GPIO and I2C. Two BLE112 devices are needed for all tests.
Metadata
Release files for bgapi2 0.8
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 | |
|---|---|---|---|---|
| bgapi2-0.8.tar.gz | 22.5 kB | Without provenance | Details |
Release files / bgapi2-0.8.tar.gz
| Download URL | bgapi2-0.8.tar.gz |
|---|---|
| Size | 22.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54196e4bce97f3b8dc06a8fc6a46e830ee171418cb747b3ff41f14920d10ffac
|
|
BLAKE2b-256 checksum How to use checksums |
653f89a4448384bc8ade8054576dc139dcd34ea5e8fd1fde38472ccdbd10d307
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Security for bgapi2 0.8
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.