# `Meshcore.Packets`
[🔗](https://github.com/nyannus/meshcore_ex/blob/v0.1.0/lib/meshcore/packets.ex#L1)

Protocol constants: command codes, response/push codes and the various
request/advert/text type enumerations of the MeshCore companion protocol.

All lookups work with atoms named like the Python enum members, lower-cased
(`CommandType.SEND_TXT_MSG` is `:send_txt_msg`).

# `adv_type`

```elixir
@spec adv_type(atom()) :: non_neg_integer()
```

Advert/contact type code (`:none | :chat | :repeater | :room | :sensor`).

# `adv_type_name`

```elixir
@spec adv_type_name(non_neg_integer()) :: atom() | nil
```

Reverse lookup of an advert type code, `nil` if unknown.

# `anon_req_type`

```elixir
@spec anon_req_type(atom()) :: non_neg_integer()
```

Anonymous request type code (`:regions | :owner | :basic`).

# `binary_req_type`

```elixir
@spec binary_req_type(atom()) :: non_neg_integer()
```

Binary request type code.

# `command`

```elixir
@spec command(atom()) :: non_neg_integer()
```

Command code sent to the device.

# `control_type`

```elixir
@spec control_type(atom()) :: non_neg_integer()
```

Control data type code.

# `packet_type`

```elixir
@spec packet_type(atom()) :: non_neg_integer()
```

Response / push packet code.

# `packet_type_name`

```elixir
@spec packet_type_name(non_neg_integer()) :: atom() | nil
```

Reverse lookup of a response / push code, `nil` if unknown.

# `txt_type`

```elixir
@spec txt_type(atom()) :: non_neg_integer()
```

Text message type code (`:plain | :cli_data | :signed_plain | :cli_cmd`).

---

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