# `Espex.BluetoothProxy.Service`
[🔗](https://github.com/bbangert/espex/blob/main/lib/espex/bluetooth_proxy/service.ex#L1)

A GATT service streamed from a `Espex.BluetoothProxy` adapter.

Adapters build these in response to `c: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.

# `t`

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

# `new`

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

Build a service from keyword options.

# `to_proto`

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

Convert to the wire `Proto.BluetoothGATTService`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
