Espex.BluetoothProxy.Service (espex v0.3.0)

Copy Markdown View Source

A GATT service streamed from a Espex.BluetoothProxy adapter.

Adapters build these in response to Espex.BluetoothProxy.gatt_get_services/1 and send them one-at-a-time as:

send(subscriber, {:espex_ble_gatt_service, address, service})

Espex wraps each service in a single BluetoothGATTGetServicesResponse and forwards it to the client. After the last service, the adapter emits {:espex_ble_gatt_services_done, address} to signal completion.

UUID encoding

See Espex.BluetoothProxy.encode_uuid/1 for the shared UUID rules.

Summary

Functions

Build a service from keyword options.

Convert to the wire Proto.BluetoothGATTService.

Types

t()

@type t() :: %Espex.BluetoothProxy.Service{
  characteristics: [Espex.BluetoothProxy.Characteristic.t()],
  handle: non_neg_integer(),
  uuid: Espex.BluetoothProxy.uuid()
}

Functions

new(opts)

@spec new(keyword()) :: t()

Build a service from keyword options.

to_proto(service)

@spec to_proto(t()) :: Espex.Proto.BluetoothGATTService.t()

Convert to the wire Proto.BluetoothGATTService.