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

A GATT characteristic inside a `Espex.BluetoothProxy.Service`.

Built by `Espex.BluetoothProxy` adapters and passed inside service
trees during `c:Espex.BluetoothProxy.gatt_get_services/1` streaming.
Espex converts to the wire `BluetoothGATTCharacteristic` at the send
boundary.

## UUID encoding

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

## `properties`

The `:properties` field is the standard BLE characteristic-properties
bitfield (e.g. `0x02 = READ`, `0x08 = WRITE`, `0x10 = NOTIFY`).
Espex passes the value through untouched; adapters should set it
from whatever their underlying BLE stack reports.

# `t`

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

# `new`

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

Build a characteristic from keyword options.

# `to_proto`

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

Convert to the wire `Proto.BluetoothGATTCharacteristic`.

---

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