Merge pull request #12049 from Sizurka/fix-asymcute-reconnect

asymcute: Reset keepalive counter on connection ACK
This commit is contained in:
benpicco 2019-09-12 15:55:11 +02:00 committed by GitHub
commit bf2aaa1a5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -325,6 +325,7 @@ static void _on_connack(asymcute_con_t *con, const uint8_t *data, size_t len)
if (data[2] == MQTTSN_ACCEPTED) {
con->state = CONNECTED;
/* start keep alive timer */
con->keepalive_retry_cnt = ASYMCUTE_N_RETRY;
event_timeout_set(&con->keepalive_timer, KEEPALIVE_TO);
ret = ASYMCUTE_CONNECTED;
}