MySensors Library & Examples  2.3.2-62-ge298769
Public Member Functions | List of all members

Detailed Description

A collection of APIs that convert a MyMessage object to a message group.

Definition at line 97 of file MyMultiMessage.h.

#include <MyMultiMessage.h>

+ Collaboration diagram for MyMultiMessage:

Public Member Functions

 MyMultiMessage (MyMessage *msg)
 
bool set (uint8_t messageType, uint8_t sensorId, uint8_t value)
 Set payload to unsigned 8-bit integer value. More...
 
bool set (uint8_t messageType, uint8_t sensorId, uint16_t value)
 Set payload to unsigned 16-bit integer value. More...
 
bool set (uint8_t messageType, uint8_t sensorId, int16_t value)
 Set payload to signed 16-bit integer value. More...
 
bool set (uint8_t messageType, uint8_t sensorId, uint32_t value)
 Set payload to unsigned 32-bit integer value. More...
 
bool set (uint8_t messageType, uint8_t sensorId, int32_t value)
 Set payload to signed 32-bit integer value. More...
 
bool set (uint8_t messageType, uint8_t sensorId, float value, uint8_t decimals)
 Set payload to decimal number. More...
 
void reset ()
 Reset the message contents, so that in can be reused after send()
 
bool setBattery (uint8_t value)
 Set battery level. More...
 
bool getNext (MyMessage &m)
 get next message from the blob More...
 

Constructor & Destructor Documentation

◆ MyMultiMessage()

MyMultiMessage::MyMultiMessage ( MyMessage msg)
explicit

Constructor

Parameters
msgA MyMessage pointer, the type should be V_MULTI_MESSAGE

Member Function Documentation

◆ getNext()

bool MyMultiMessage::getNext ( MyMessage m)

get next message from the blob

Parameters
mMyMessage reference

◆ set() [1/6]

bool MyMultiMessage::set ( uint8_t  messageType,
uint8_t  sensorId,
float  value,
uint8_t  decimals 
)

Set payload to decimal number.

Parameters
messageType
sensorId
valuefloat
decimalsnumber of decimals to include
Returns
false if the message won't fit, true if the message was added successfuly

◆ set() [2/6]

bool MyMultiMessage::set ( uint8_t  messageType,
uint8_t  sensorId,
int16_t  value 
)

Set payload to signed 16-bit integer value.

Parameters
messageType
sensorId
value(–32768 to 32767)
Returns
false if the message won't fit, true if the message was added successfuly

◆ set() [3/6]

bool MyMultiMessage::set ( uint8_t  messageType,
uint8_t  sensorId,
int32_t  value 
)

Set payload to signed 32-bit integer value.

Parameters
messageType
sensorId
value(–2147483648 to 2147483647)
Returns
false if the message won't fit, true if the message was added successfuly

◆ set() [4/6]

bool MyMultiMessage::set ( uint8_t  messageType,
uint8_t  sensorId,
uint16_t  value 
)

Set payload to unsigned 16-bit integer value.

Parameters
messageType
sensorId
value(0 to 65535)
Returns
false if the message won't fit, true if the message was added successfuly

◆ set() [5/6]

bool MyMultiMessage::set ( uint8_t  messageType,
uint8_t  sensorId,
uint32_t  value 
)

Set payload to unsigned 32-bit integer value.

Parameters
messageType
sensorId
value(0 to 4294967295)
Returns
false if the message won't fit, true if the message was added successfuly

◆ set() [6/6]

bool MyMultiMessage::set ( uint8_t  messageType,
uint8_t  sensorId,
uint8_t  value 
)

Set payload to unsigned 8-bit integer value.

Parameters
messageType
sensorId
value(0 to 255)
Returns
false if the message won't fit, true if the message was added successfuly

◆ setBattery()

bool MyMultiMessage::setBattery ( uint8_t  value)

Set battery level.

Parameters
valuebattery level

The documentation for this class was generated from the following file: