Search documentation of bb

# BB.Sensor.Server (bb v0.17.0)

Copy Markdown View Source

Wrapper GenServer for sensor callback modules.

This module manages the lifecycle of user-defined sensor modules, handling:

- Parameter reference resolution at startup
- Subscription to parameter changes
- Delegation of GenServer callbacks to user module
- Optional safety registration (only if sensor implements `disarm/1`)

User modules implement the `BB.Sensor` behaviour and define callbacks. This server wraps them, providing the actual GenServer implementation.

## Summary

### Types

t()

### Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

## Types

# t()

    @type t() :: %BB.Sensor.Server{
      bb: %{robot: module(), path: [atom()]},
      callback_module: module(),
      param_subscriptions: %{required([atom()]) => atom()},
      raw_opts: keyword(),
      resolved_opts: keyword(),
      user_state: term()
    }

## Functions

# child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See `Supervisor`.