# `NestGen2.Backplate`
[🔗](https://github.com/integration-technology/nest_gen2_sdk/blob/v0.6.6/lib/nest_gen2/backplate.ex#L1)

The link to the backplate (or desk stand) microcontroller on `/dev/ttyO2`.

Always runs the keep-alive: every 30 s it repeats the stock client's `0x83`,
`0xa2`, `0xa3` exchange, without which the backplate power-cycles the head unit
about 36 minutes after it last heard from it. Each time the link opens it
wakes the backplate the way Nest's own client does (a serial BREAK, then
answering its hello), and does so again if the backplate falls silent, which
it does after a reset or a power loss. Decoded readings are published as
`:motion`, `:climate` and `:battery` events and are available through
`NestGen2.Motion`, `NestGen2.Climate` and `NestGen2.Battery`.

The protocol is described in `docs/backplate.md`.

`status/0`, `subscribe_raw/0` and `send_raw/2` are for decoding messages the SDK
does not cover yet, and may change between minor versions.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `send_raw`

```elixir
@spec send_raw(0..65535, binary()) :: :ok
```

Sends a command frame to the backplate.

# `start_link`

# `status`

```elixir
@spec status() :: %{
  connected: boolean(),
  frames_received: non_neg_integer(),
  last_frame_at: DateTime.t() | nil,
  restarts: non_neg_integer()
}
```

# `subscribe_raw`

```elixir
@spec subscribe_raw() :: :ok
```

Subscribes the caller to every frame as `{:nest_gen2_backplate, cmd, payload}`.

---

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