Meshcore.Transport.BLE (Meshcore v0.1.0)

Copy Markdown View Source

Bluetooth Low Energy transport (Nordic UART service).

There is no mature cross-platform BLE stack on the BEAM, so this transport contains the MeshCore-specific logic – serialised writes with a hard timeout, optional PIN pairing, "tear the link down on a stalled write" – and delegates the radio work to a pluggable Meshcore.Transport.BLE.Adapter.

Options:

  • :adapter (required) – module implementing Meshcore.Transport.BLE.Adapter
  • :address – BLE address (or part of the advertised name) to connect to; when nil or not an address the adapter scans for a MeshCore* device
  • :pin – PIN to pair with after connecting
  • :write_timeout – milliseconds before a write is considered stalled (default 10_000)
  • :adapter_opts – extra keyword options passed to the adapter

The Nordic UART UUIDs are exposed as uart_service_uuid/0, uart_rx_char_uuid/0 (write) and uart_tx_char_uuid/0 (notify).

Summary

Functions

Returns a specification to start this module under a supervisor.

RX characteristic UUID (the host writes commands here).

Nordic UART service UUID.

TX characteristic UUID (the device notifies frames here).

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

uart_rx_char_uuid()

RX characteristic UUID (the host writes commands here).

uart_service_uuid()

Nordic UART service UUID.

uart_tx_char_uuid()

TX characteristic UUID (the device notifies frames here).