lager.ble

BLE async helpers

Module Contents

Classes

Client

BLE Client class

Central

BLE Central object

Functions

do_nothing(handle, data)

notify_handler(evt, messages, callback, max_messages, ...)

waiter(event, timeout)

lager.ble.do_nothing(handle: int, data: bytearray)
lager.ble.notify_handler(evt, messages, callback, max_messages, handle, data)
async lager.ble.waiter(event, timeout)
class lager.ble.Client(_client, *, loop)

BLE Client class

__enter__()
__exit__(exc_type, exc_val, exc_tb)
read_gatt_char(char_specifier)

read_gatt_char wrapper

write_gatt_char(char_specifier, data)

write_gatt_char wrapper

start_notify(char_specifier, callback=do_nothing, max_messages=None, timeout=None)

start_notify wrapper

stop_notify(char_specifier)

stop_notify wrapper

connect(*args, **kwargs)

connect wrapper

pair(*args, **kwargs)

pair wrapper

disconnect(*args, **kwargs)

disconnect wrapper

sleep(timeout)

sleep wrapper

get_services(*args, **kwargs)

get_services wrapper

has_characteristic(uuid)

check if uuid exists as a characteristic

class lager.ble.Central(*, loop=None)

BLE Central object

scan(scan_time=5.0, name=None, address=None)

Scan for devices. If name or address are provided, remove devices that do not match.

connect(address, *args, **kwargs)

connect to address

pair(address, *args, **kwargs)

pair to address