Skip to content

pb_client.service

Talking to the service.

The shape of this API is deliberate. Nothing takes a timeout argument; callers scope cancellation with fail_after or move_on_after instead, so a deadline covers a whole operation rather than one call inside it. Anything producing a continuing stream of events will be an async context manager yielding an async iterator, never a callback registration, so that no work can outlive the block that started it.

Modules

  • stdio -- What a hub says while a program is running on it.

Classes

  • Choice -- The hub that commands act on when none is named.
  • DeviceInfo -- A hub seen while scanning.
  • Downloaded -- Where a program ended up on the hub.
  • HubInfo -- A connected hub.
  • Service -- A connected service.
  • ServiceInfo -- What the service reports about itself.
  • ServiceTooOld -- The running service does not have a feature this client needs.
  • ServiceUnavailable -- No service is running and starting one was not permitted.
  • UnusableAdapter -- A Bluetooth adapter a scan could not use, and why.

Functions

  • connect -- Connect to the service for the duration of the block.
  • open_connection -- Connect to the service, starting one if necessary.

Attributes

  • Listener -- Where a subscriber's notifications are put.