Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Andrew S on May 14, 2019, 10:35:30 AM
-
Is there a way to generate a Globally-Unique ID on the Do-more? I want to send data using MQTT with QoS=1 but to ensure that data isn't processed twice I need to send a GUID as part of the data. I could use date/time but this doesn't necessarily ensure uniqueness (especially when strange things happen like a clock time change).
Is there a better way to ensure I don't duplicate data when sending over MQTT? when only QoS=0 and QoS=1 are available?
Thanks, Andrew.
-
Is there a way to generate a Globally-Unique ID on the Do-more? I want to send data using MQTT with QoS=1 but to ensure that data isn't processed twice I need to send a GUID as part of the data. I could use date/time but this doesn't necessarily ensure uniqueness (especially when strange things happen like a clock time change).
Is there a better way to ensure I don't duplicate data when sending over MQTT? when only QoS=0 and QoS=1 are available?
Thanks, Andrew.
The microsecond or millisecond tick counters are pretty reliable for that. They reset when the hardware is power cycled, but freerun otherwise. TICKus() or TICKms() from the MATH box.
-
Sounds good. Thanks.
Andrew.