diff --git a/sys/include/net/asymcute.h b/sys/include/net/asymcute.h index d468fb1b9c..65e806b2b4 100644 --- a/sys/include/net/asymcute.h +++ b/sys/include/net/asymcute.h @@ -95,15 +95,6 @@ extern "C" { #define ASYMCUTE_LISTENER_STACKSIZE (THREAD_STACKSIZE_DEFAULT) #endif -#ifndef ASYMCUTE_ID_MAXLEN -/** - * @brief Maximum client ID length - * - * @note Must be less than (256 - 8) and less than (ASYMCUTE_BUFSIZE - 8) - */ -#define ASYMCUTE_ID_MAXLEN (32U) -#endif - #ifndef ASYMCUTE_TOPIC_MAXLEN /** * @brief Maximum topic length @@ -273,7 +264,7 @@ struct asymcute_con { uint8_t keepalive_retry_cnt; /**< keep alive transmission counter */ uint8_t state; /**< connection state */ uint8_t rxbuf[ASYMCUTE_BUFSIZE]; /**< connection specific receive buf */ - char cli_id[ASYMCUTE_ID_MAXLEN + 1];/**< buffer to store client ID */ + char cli_id[MQTTSN_CLI_ID_MAXLEN + 1]; /**< buffer to store client ID */ }; /** diff --git a/sys/net/application_layer/asymcute/asymcute.c b/sys/net/application_layer/asymcute/asymcute.c index b3379820e8..10dbf2e515 100644 --- a/sys/net/application_layer/asymcute/asymcute.c +++ b/sys/net/application_layer/asymcute/asymcute.c @@ -712,7 +712,7 @@ int asymcute_connect(asymcute_con_t *con, asymcute_req_t *req, return ASYMCUTE_NOTSUP; } /* make sure the client ID will fit into the dedicated buffer */ - if (id_len > ASYMCUTE_ID_MAXLEN) { + if ((id_len < MQTTSN_CLI_ID_MINLEN) || (id_len > MQTTSN_CLI_ID_MAXLEN)) { return ASYMCUTE_OVERFLOW; } /* check if the context is not already connected to any gateway */