MySensors Library & Examples
2.3.2
|
Here you can find all message types used by the MySensors protocol as well as macros for parsing and manipulating messages.
Classes | |
class | MyMessage |
MyMessage is used to create, manipulate, send and read MySensors messages. More... | |
Macros | |
#define | V2_MYS_HEADER_PROTOCOL_VERSION (2u) |
Protocol version. | |
#define | V2_MYS_HEADER_SIZE (7u) |
Header size. | |
#define | V2_MYS_HEADER_MAX_MESSAGE_SIZE (32u) |
Max payload size. | |
#define | V2_MYS_HEADER_VSL_VERSION_POS (0) |
bitfield position version | |
#define | V2_MYS_HEADER_VSL_VERSION_SIZE (2u) |
size version field | |
#define | V2_MYS_HEADER_VSL_SIGNED_POS (2u) |
bitfield position signed field | |
#define | V2_MYS_HEADER_VSL_SIGNED_SIZE (1u) |
size signed field | |
#define | V2_MYS_HEADER_VSL_LENGTH_POS (3u) |
bitfield position length field | |
#define | V2_MYS_HEADER_VSL_LENGTH_SIZE (5u) |
size length field | |
#define | V2_MYS_HEADER_CEP_COMMAND_POS (0) |
bitfield position command field | |
#define | V2_MYS_HEADER_CEP_COMMAND_SIZE (3u) |
size command field | |
#define | V2_MYS_HEADER_CEP_ECHOREQUEST_POS (3u) |
bitfield position echo request field | |
#define | V2_MYS_HEADER_CEP_ECHOREQUEST_SIZE (1u) |
size echo request field | |
#define | V2_MYS_HEADER_CEP_ECHO_POS (4u) |
bitfield position echo field | |
#define | V2_MYS_HEADER_CEP_ECHO_SIZE (1u) |
size echo field | |
#define | V2_MYS_HEADER_CEP_PAYLOADTYPE_POS (5u) |
bitfield position payload type field | |
#define | V2_MYS_HEADER_CEP_PAYLOADTYPE_SIZE (3u) |
size payload type field | |
#define | MAX_MESSAGE_SIZE V2_MYS_HEADER_MAX_MESSAGE_SIZE |
The maximum size of a message (including header) | |
#define | HEADER_SIZE V2_MYS_HEADER_SIZE |
The size of the header. | |
#define | MAX_PAYLOAD_SIZE (MAX_MESSAGE_SIZE - HEADER_SIZE) |
The maximum size of a payload depends on MAX_MESSAGE_SIZE and HEADER_SIZE. | |
#define | MAX_PAYLOAD MAX_PAYLOAD_SIZE |
#define | BIT(n) ( 1<<(n) ) |
Bit indexing macro. | |
#define | BIT_MASK(len) ( BIT(len)-1 ) |
Create a bitmask of length 'len'. | |
#define | BF_MASK(start, len) ( BIT_MASK(len)<<(start) ) |
Create a bitfield mask of length starting at bit 'start'. | |
#define | BF_PREP(x, start, len) ( ((x)&BIT_MASK(len)) << (start) ) |
Prepare a bitmask for insertion or combining. | |
#define | BF_GET(y, start, len) ( ((y)>>(start)) & BIT_MASK(len) ) |
Extract a bitfield of length 'len' starting at bit 'start' from 'y'. | |
#define | BF_SET(y, x, start, len) ( y= ((y) &~ BF_MASK(start, len)) | BF_PREP(x, start, len) ) |
Insert a new bitfield value 'x' into 'y'. | |
#define | mSetVersion(_message, _version) _message.setVersion(_version) |
#define | mGetVersion(_message) _message.getVersion() |
#define | mSetSigned(_message, _signed) _message.setSigned(_signed) |
#define | mGetSigned(_message) _message.getSigned() |
#define | mSetLength(_message, _length) _message.setLength(_length) |
#define | mGetLength(_message) _message.getLength() |
#define | mSetCommand(_message, _command) _message.setCommand(_command) |
#define | mGetCommand(_message) _message.getCommand() |
#define | mSetRequestEcho(_message, _requestEcho) _message.setRequestEcho(_requestEcho) |
#define | mGetRequestEcho(_message) _message.getRequestEcho() |
#define | mSetEcho(_message, _echo) _message.setEcho(_echo) |
#define | mGetEcho(_message) _message.getEcho() |
#define | mSetPayloadType(_message, _payloadType) _message.setPayloadType(_payloadType) |
#define | mGetPayloadType(_message) _message.getPayloadType() |
Functions | |
class MyMessage | __attribute__ ((packed)) |
Doxygen will complain without this comment. | |
#define MAX_PAYLOAD MAX_PAYLOAD_SIZE |
Definition at line 64 of file MyMessage.h.
#define mGetCommand | ( | _message | ) | _message.getCommand() |
Definition at line 274 of file MyMessage.h.
#define mGetEcho | ( | _message | ) | _message.getEcho() |
Definition at line 280 of file MyMessage.h.
#define mGetLength | ( | _message | ) | _message.getLength() |
Definition at line 271 of file MyMessage.h.
#define mGetPayloadType | ( | _message | ) | _message.getPayloadType() |
Definition at line 283 of file MyMessage.h.
#define mGetRequestEcho | ( | _message | ) | _message.getRequestEcho() |
Definition at line 277 of file MyMessage.h.
#define mGetSigned | ( | _message | ) | _message.getSigned() |
Definition at line 268 of file MyMessage.h.
#define mGetVersion | ( | _message | ) | _message.getVersion() |
Definition at line 265 of file MyMessage.h.
#define mSetCommand | ( | _message, | |
_command | |||
) | _message.setCommand(_command) |
Definition at line 273 of file MyMessage.h.
#define mSetEcho | ( | _message, | |
_echo | |||
) | _message.setEcho(_echo) |
Definition at line 279 of file MyMessage.h.
#define mSetLength | ( | _message, | |
_length | |||
) | _message.setLength(_length) |
Definition at line 270 of file MyMessage.h.
#define mSetPayloadType | ( | _message, | |
_payloadType | |||
) | _message.setPayloadType(_payloadType) |
Definition at line 282 of file MyMessage.h.
#define mSetRequestEcho | ( | _message, | |
_requestEcho | |||
) | _message.setRequestEcho(_requestEcho) |
Definition at line 276 of file MyMessage.h.
#define mSetSigned | ( | _message, | |
_signed | |||
) | _message.setSigned(_signed) |
Definition at line 267 of file MyMessage.h.
#define mSetVersion | ( | _message, | |
_version | |||
) | _message.setVersion(_version) |
Definition at line 264 of file MyMessage.h.
enum mysensors_command_t |
The command field (message-type) defines the overall properties of a message.
Enumerator | |
---|---|
C_PRESENTATION | Sent by a node when they present attached sensors. This is usually done in presentation() at startup. |
C_SET | This message is sent from or to a sensor when a sensor value should be updated. |
C_REQ | Requests a variable value (usually from an actuator destined for controller). |
C_INTERNAL | Internal MySensors messages (also include common messages provided/generated by the library). |
C_STREAM | For firmware and other larger chunks of data that need to be divided into pieces. |
C_RESERVED_5 | C_RESERVED_5. |
C_RESERVED_6 | C_RESERVED_6. |
C_INVALID_7 | C_INVALID_7. |
Definition at line 67 of file MyMessage.h.
enum mysensors_internal_t |
Type of internal messages (for internal messages)
Definition at line 190 of file MyMessage.h.
enum mysensors_payload_t |
Type of payload.
Definition at line 240 of file MyMessage.h.
enum mysensors_stream_t |
Type of data stream (for streamed message)
Definition at line 228 of file MyMessage.h.