S_COMBO/V_COMBO new mode in order to merge multiple sensors value in a single message
The basic structure should be like this:
When type is S_COMBO/V_COMBO, the payload is made with multiple (uint8 variable-type, uint8 data[]) tuple, up to 24 bytes.
For example, if you have a node that's temperature and humidity capable, it would send a message like this:
MyMessage msg(CHILD_ID, V_COMBO);
uint8 msgTemplate[] = { V_TEMP, 0, V_HUM, 0 };
[...]
msgTemplate[1] = readCurTemp(); msgTemplate[3] = readCurHum();
gw.send(msg.set(msgTemplate));
This would require almost no modification to the current software.
The main advantage is saving power, only a single packet is sent (instead of multiple packets for each sensor, plus ACK).
This limits however each type payload to one byte.
Another improvement would be to reuse the existing parsing code by adding a MyMessage.set/get method like this:
inline bool isCombo() const { return type == V_COMBO; }
MyMessage & setCombo(uint8_t pos, uint8_t type, uint8_t value)
{
data[pos*2] = type; data[pos*2+1] = value;
return *this;
}
On the gateway, an additional case should be taken when serializing to/from Ethernet or Serial so it appears not like a combo.