BlueHeron.GATT.Characteristic (blue_heron v0.4.1) View Source

Struct that represents a GATT characteristic.

Link to this section Summary

Functions

Create a characteristic with fields taken from the map args.

Link to this section Types

Link to this section Functions

Specs

new(args :: map()) :: t()

Create a characteristic with fields taken from the map args.

The following fields are required:

  • id: A user-defined term to identify the characteristic. Must be unique within the device profile. Can be any Erlang term.
  • type: The characteristic type UUID. Can be a 2- or 16-byte byte UUID. Integer.
  • properties: The characteristic property flags. Integer.

Example:

iex> BlueHeron.GATT.Characteristic.new(%{
...>   id: :fancy_key,
...>   type: 0x2e0f8e717a7d4690998377626bc6b657,
...>   properties: 0b00000010,
...>   permissions: [:write]
...> })
%BlueHeron.GATT.Characteristic{id: :fancy_key, type: 0x2e0f8e717a7d4690998377626bc6b657, properties: 2, permissions: [:write]}