Skip to content

change static timer in keepalive func to regular timer #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add stop to timers (countdown)
  • Loading branch information
IdoStern9 committed Feb 26, 2024
commit 8f0790afdb05b801b8b571a10e25f987ff2e409a
3 changes: 3 additions & 0 deletions paho_mqtt_embedded_c/MQTTClient/src/MQTTClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,9 @@ int MQTT::Client<Network, Timer, MAX_MQTT_PACKET_SIZE, b>::disconnect()
if (len > 0)
rc = sendPacket(len, timer); // send the disconnect packet
closeSession();
last_sent.stop();
last_received.stop();
ping_sent.stop();
return rc;
}

Expand Down
6 changes: 6 additions & 0 deletions paho_mqtt_embedded_c/MQTTClient/src/mbed/MQTTmbed.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ class Countdown
return interval_end_ms - t.read_ms();
}

void stop()
{
t.stop();
t.reset();
}

private:
Timer t;
unsigned long interval_end_ms;
Expand Down