module documentation

BLE UART Chat - Send and receive messages over BLE UART service

Function bluetooth_callback Handle Bluetooth connection and scan events.
Function on_data_received Store an incoming chat message.
Function run Run the app and handle chat state input.
Function start Start the UART Chat app and show the mode menu.
Function stop Stop the app and clean up the BLE connection.
Constant STATE_CHAT Undocumented
Constant STATE_CONNECTING Undocumented
Constant STATE_DEVICE_LIST Undocumented
Constant STATE_MODE_SELECT Undocumented
Constant STATE_PERIPHERAL_WAIT Undocumented
Constant STATE_SCANNING Undocumented
Constant STATE_TYPING Undocumented
Function __addr_to_str Convert address bytes to a colon-separated string.
Variable _addresses Undocumented
Variable _bluetooth Undocumented
Variable _last_update Undocumented
Variable _loading Undocumented
Variable _menu Undocumented
Variable _messages Undocumented
Variable _mode Undocumented
Variable _scanned_devices Undocumented
Variable _selected_device Undocumented
def bluetooth_callback(event, data):

Handle Bluetooth connection and scan events.

Parameters
event:intBluetooth event code.
data:tupleEvent payload.
def on_data_received(data):

Store an incoming chat message.

Parameters
data:bytesRaw data received over BLE.
def run(view_manager):

Run the app and handle chat state input.

Parameters
view_manager:ViewManagerThe view manager instance for display and storage access.
def start(view_manager) -> bool:

Start the UART Chat app and show the mode menu.

Parameters
view_manager:ViewManagerThe view manager instance for display and storage access.
Returns
boolTrue if the app started, False on failure.
def stop(view_manager):

Stop the app and clean up the BLE connection.

Parameters
view_manager:ViewManagerThe view manager instance for display and storage access.
STATE_CHAT =

Undocumented

Value
const(4)
STATE_CONNECTING =

Undocumented

Value
const(3)
STATE_DEVICE_LIST =

Undocumented

Value
const(2)
STATE_MODE_SELECT =

Undocumented

Value
const(0)
STATE_PERIPHERAL_WAIT =

Undocumented

Value
const(6)
STATE_SCANNING =

Undocumented

Value
const(1)
STATE_TYPING =

Undocumented

Value
const(5)
def __addr_to_str(addr) -> str:

Convert address bytes to a colon-separated string.

Parameters
addr:bytesThe device address bytes.
Returns
strThe formatted address string.
_addresses: list =

Undocumented

_bluetooth =

Undocumented

_last_update: int =

Undocumented

_loading =

Undocumented

_menu =

Undocumented

_messages: list =

Undocumented

_mode =

Undocumented

_scanned_devices: list =

Undocumented

_selected_device =

Undocumented