View Source BlueHeron.Peripheral (blue_heron v0.5.3)

Handles management of advertising and GATT server

Summary

Functions

Register a new service in the GATT.

Returns a specification to start this module under a supervisor.

Delete a service by it's ID.

Exchange MTU with a connected central.

Send a notification to a connected central.

Functions

add_service(service)

@spec add_service(BlueHeron.GATT.Service.t()) :: :ok

Register a new service in the GATT.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

delete_service(service_id)

@spec delete_service(BlueHeron.GATT.Service.id()) :: :ok

Delete a service by it's ID.

exchange_mtu(server_mtu)

@spec exchange_mtu(non_neg_integer()) :: :ok | {:error, term()}

Exchange MTU with a connected central.

notify(service_id, charateristic_id, data)

@spec notify(
  BlueHeron.GATT.Service.id(),
  BlueHeron.GATT.Characteristic.id(),
  binary()
) ::
  :ok | {:error, term()}

Send a notification to a connected central.