Meshcore.Packets (Meshcore v0.1.0)

Copy Markdown View Source

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).

Summary

Functions

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

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

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

Binary request type code.

Command code sent to the device.

Control data type code.

Response / push packet code.

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

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

Functions

adv_type(name)

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

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

adv_type_name(code)

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

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

anon_req_type(name)

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

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

binary_req_type(name)

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

Binary request type code.

command(name)

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

Command code sent to the device.

control_type(name)

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

Control data type code.

packet_type(name)

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

Response / push packet code.

packet_type_name(code)

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

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

txt_type(name)

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

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