From 43329943c9b42716629edd710e159224df6f0e7c Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Sat, 16 Mar 2019 17:15:26 +0100 Subject: [PATCH] Finally, support multiple topics at once using an array and array_size field --- include/lib/protocols/mqtt.h | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/include/lib/protocols/mqtt.h b/include/lib/protocols/mqtt.h index b91abb4..d17b20c 100644 --- a/include/lib/protocols/mqtt.h +++ b/include/lib/protocols/mqtt.h @@ -24,11 +24,6 @@ * For protocol defiition, refer to * http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html * - * This implementation has a limitation on the subscription mechanism : the protocol allows for - * multiple subscriptions / unsubscriptions using a single subscribe packet, which is not supported - * by this code for code simplicity, memory usage limitation, and packets size limitation. - * All other features of the protocol should be fully supported. - * * This code is the implementation of the MQTT protocol part of the communication. * The MQTT protocol requires a lossless, ordered transport protocol layer with an address mechanism * which is not part of the code found in mqtt.c and mqtt.h, making it possible to use any underlying @@ -237,20 +232,7 @@ int mqtt_check_publish_response_pkt(struct mqtt_publish_response_pkt* pkt, uint8 /***************************************************************************** */ -/* subsribe and suback packets */ - -/* NOTE : I choose not to implement the possibility to send multiple subscriptions at once here in order - * to avoid unnecessary complexity of code and dynamic allocation of memory. - * It could be implemented using the following structure and the inclusion of "lib/list.h" : - * struct mqtt_sub_request { - * struct list_head list; - * char* topic; - * uint8_t qos; - * }; - * and then replace topic and qos fields in struct mqtt_subscribe_pkt with a pointer to a struct list_head - * which should then point to the "list" field of the first topic. - * struct mqtt_subscribe_response_pkt should also be adapted for multiple subscription support. - */ +/* subsribe, unsubsribe, suback and unsuback packets */ #define MQTT_SUBSCRIBE_FLAG (0x01 << 1) -- 2.43.0