MQTT library (clone of https://os.mbed.com/teams/mqtt/code/MQTT/)
Dependencies: FP MQTTPacket
Dependents: NuMaker-mbed-AWS-IoT-example NuMaker-mbed-OS-6-AWS-IoT-example
Diff: MQTTmbed.h
- Revision:
- 65:1b626554f238
- Parent:
- 64:1d9e7bec2a54
--- a/MQTTmbed.h Thu Sep 01 15:33:35 2022 +0800 +++ b/MQTTmbed.h Wed Sep 07 13:40:01 2022 +0800 @@ -19,8 +19,7 @@ bool expired() { - //return t.read_ms() >= interval_end_ms; - return chrono::duration_cast<chrono::milliseconds>(t.elapsed_time()).count() >= interval_end_ms; + return (t.elapsed_time()).count()/1000 >= interval_end_ms; } void countdown_ms(unsigned long ms) @@ -38,8 +37,7 @@ int left_ms() { - //return interval_end_ms - t.read_ms(); - return interval_end_ms - chrono::duration_cast<chrono::milliseconds>(t.elapsed_time()).count(); + return interval_end_ms - (t.elapsed_time()).count()/1000; } private: