Simple byte and string based inter-device communication via BLE.
Author(s): Nicholas H.Tollervey for Adafruit Industries
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
- adafruit_ble_radio.AD_DURATION = 0.5¶
Amount of time to advertise a message (in seconds).
- adafruit_ble_radio.MAX_LENGTH = 248¶
Maximum length of a message (in bytes).
- class adafruit_ble_radio.Radio(**args)¶
Represents a connection through which one can send or receive strings and bytes. The radio can be tuned to a specific channel upon initialisation or via the
Set configuration values for the radio.
channel (int) – The channel (0-255) the radio is listening / broadcasting on.
Returns a message received on the channel on which the radio is listening.
A string representation of the received message, or else None.
Returns a tuple containing three values representing a message received on the channel on which the radio is listening. If no message was received then
The three values in the tuple represent:
the bytes received.
the RSSI (signal strength: 0 = max, -255 = min).
a microsecond timestamp: the value returned by time.monotonic() when the message was received.
A tuple representation of the received message, or else None.
Send a message string on the channel to which the radio is broadcasting.
message (str) – The message string to broadcast.