Fix delegating constructor
This commit is contained in:
+14
-9
@@ -24,24 +24,29 @@
|
|||||||
|
|
||||||
|
|
||||||
MyMessage::MyMessage()
|
MyMessage::MyMessage()
|
||||||
: last( 0u )
|
|
||||||
, sender( 0u )
|
|
||||||
, destination( 0u ) // Gateway is default destination
|
|
||||||
, version_length( 0u )
|
|
||||||
, command_ack_payload( 0u )
|
|
||||||
, type( 0u )
|
|
||||||
, sensor( 0u )
|
|
||||||
{
|
{
|
||||||
(void)memset(data, 0u, sizeof(data));
|
clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
MyMessage::MyMessage(uint8_t _sensor, uint8_t _type)
|
MyMessage::MyMessage(uint8_t _sensor, uint8_t _type)
|
||||||
: MyMessage()
|
|
||||||
{
|
{
|
||||||
|
clear();
|
||||||
sensor = _sensor;
|
sensor = _sensor;
|
||||||
type = _type;
|
type = _type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyMessage::clear()
|
||||||
|
{
|
||||||
|
last = 0u;
|
||||||
|
sender = 0u;
|
||||||
|
destination = 0u; // Gateway is default destination
|
||||||
|
version_length = 0u;
|
||||||
|
command_ack_payload = 0u;
|
||||||
|
type = 0u;
|
||||||
|
sensor = 0u;
|
||||||
|
(void)memset(data, 0u, sizeof(data));
|
||||||
|
}
|
||||||
|
|
||||||
bool MyMessage::isAck() const {
|
bool MyMessage::isAck() const {
|
||||||
return miGetAck();
|
return miGetAck();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -282,6 +282,11 @@ public:
|
|||||||
|
|
||||||
char i2h(uint8_t i) const;
|
char i2h(uint8_t i) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear message contents.
|
||||||
|
*/
|
||||||
|
void clear();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If payload is something else than P_STRING you can have the payload value converted
|
* If payload is something else than P_STRING you can have the payload value converted
|
||||||
* into string representation by supplying a buffer with the minimum size of
|
* into string representation by supplying a buffer with the minimum size of
|
||||||
|
|||||||
Reference in New Issue
Block a user