receiving numbers bigger than unsigned long
-
Hey there,
I know an arduino is capable of using uint16_t type variables. But how do I get them transfered within the mysensors framework? I know there are way to read int (
message.getint
) and long (message.getlong
) for usage invoid receive()
, but how do I receive an uint64_t number? I couldn't find a documentation about this. But as far as I read the max payload is 25 byte, so it should fit in.Regards,
Anduril
-
You can send custom data structures using:
https://github.com/mysensors/MySensors/blob/development/core/MyMessage.cpp#L230... and pick them up using:
https://github.com/mysensors/MySensors/blob/development/core/MyMessage.cpp#L64
-
Thanks a lot @hek
What do I have to write for length atMyMessage& MyMessage::set(void* value, uint8_t length)
? Is it 8 byte or 64 bit? Is MAX_PAYLOAD defined in byte or bit (or something else)?
-
64bit / 8 = 8 bytes length
-
well yeah thats obvious, my question was more about the specific syntax (but that was not very clear).
Which of the following do I have to use?uint64_t value; send(Mymessage.set(value,8); send(Mymessage.set(value,64); send(Mymessage.set(value,8 byte); ...
-
@Anduril said in receiving numbers bigger than unsigned long:
uint64_t value; send(Mymessage.set(&value, sizeof(value) );
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Radio waking up for no reason.
Development • 4 Jul 2020, 21:09 • Sasquatch 15 Jan 2025, 08:33 -
Counting Incoming and Outgoing Messages from a Gateway
Development • 10 Dec 2024, 21:57 • Trand 14 Dec 2024, 20:23 -
Gateway without a radio
Development • 12 Jan 2025, 23:19 • OldSurferDude 14 Jan 2025, 22:07 -
Home Assistant/MySensors quirks
Development • 16 days ago • OldSurferDude 16 days ago -
MQTT-Help me understand about the MQTT Gateway.
Development • 2 Mar 2025, 01:44 • dpcons 20 days ago