diff --git a/sys/include/net/asymcute.h b/sys/include/net/asymcute.h index e5fb733f63..26b9ed582a 100644 --- a/sys/include/net/asymcute.h +++ b/sys/include/net/asymcute.h @@ -145,13 +145,13 @@ extern "C" { #define CONFIG_ASYMCUTE_T_RETRY (10U) /* -> 10 sec */ #endif -#ifndef ASYMCUTE_N_RETRY +#ifndef CONFIG_ASYMCUTE_N_RETRY /** * @brief Number of retransmissions until requests time out * * For the default value, see spec v1.2, section 7.2 -> N_RETRY: 3-5 */ -#define ASYMCUTE_N_RETRY (3U) +#define CONFIG_ASYMCUTE_N_RETRY (3U) #endif /** diff --git a/sys/net/application_layer/asymcute/asymcute.c b/sys/net/application_layer/asymcute/asymcute.c index 4d8ec0a819..a408a02173 100644 --- a/sys/net/application_layer/asymcute/asymcute.c +++ b/sys/net/application_layer/asymcute/asymcute.c @@ -181,7 +181,7 @@ static void _req_send(asymcute_req_t *req, asymcute_con_t *con, /* initialize request */ req->con = con; req->cb = cb; - req->retry_cnt = ASYMCUTE_N_RETRY; + req->retry_cnt = CONFIG_ASYMCUTE_N_RETRY; event_callback_init(&req->to_evt, _on_req_timeout, (void *)req); event_timeout_init(&req->to_timer, &_queue, &req->to_evt.super); /* add request to the pending queue (if non-con request) */ @@ -328,7 +328,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; + con->keepalive_retry_cnt = CONFIG_ASYMCUTE_N_RETRY; event_timeout_set(&con->keepalive_timer, KEEPALIVE_TO); ret = ASYMCUTE_CONNECTED; } @@ -369,9 +369,9 @@ static void _on_pingresp(asymcute_con_t *con) { mutex_lock(&con->lock); /* only handle ping resp message if we are actually waiting for a reply */ - if (con->keepalive_retry_cnt < ASYMCUTE_N_RETRY) { + if (con->keepalive_retry_cnt < CONFIG_ASYMCUTE_N_RETRY) { event_timeout_clear(&con->keepalive_timer); - con->keepalive_retry_cnt = ASYMCUTE_N_RETRY; + con->keepalive_retry_cnt = CONFIG_ASYMCUTE_N_RETRY; event_timeout_set(&con->keepalive_timer, KEEPALIVE_TO); } mutex_unlock(&con->lock); @@ -637,7 +637,7 @@ int asymcute_listener_run(asymcute_con_t *con, char *stack, size_t stacksize, random_bytes((uint8_t *)&con->last_id, 2); event_callback_init(&con->keepalive_evt, _on_keepalive_evt, con); event_timeout_init(&con->keepalive_timer, &_queue, &con->keepalive_evt.super); - con->keepalive_retry_cnt = ASYMCUTE_N_RETRY; + con->keepalive_retry_cnt = CONFIG_ASYMCUTE_N_RETRY; con->state = NOTCON; con->user_cb = callback;