blatann.examples.centeral_uart_service module

This example implements Nordic’s custom UART service and demonstrates how to configure the MTU size. It is configured to use an MTU size based on the Data Length Extensions feature of BLE for maximum throughput. This is compatible with the peripheral_uart_service example.

This is a simple example which just echos back any data that the client sends to it.

blatann.examples.centeral_uart_service.on_connect(peer, event_args)

Event callback for when a central device connects to us

Parameters
blatann.examples.centeral_uart_service.on_disconnect(peer, event_args)

Event callback for when the client disconnects from us (or when we disconnect from the client)

Parameters
blatann.examples.centeral_uart_service.on_mtu_size_update(peer, event_args)

Callback for when the peer’s MTU size has been updated/negotiated

Parameters

peer (blatann.peer.Client) – The peer the MTU was updated on

blatann.examples.centeral_uart_service.on_data_rx(service, data)

Called whenever data is received on the RX line of the Nordic UART Service

Parameters
blatann.examples.centeral_uart_service.main(serial_port)