From bf88fe5118368321a3dce31c55336b29554e358c Mon Sep 17 00:00:00 2001 From: Flavio Santes Date: Thu, 15 Dec 2016 22:43:13 -0600 Subject: [PATCH] net/mqtt: Add the reception callback The reception cb: internal use only cb that will be set according to the application profile: PUBLISHER, SUBSCRIBER, PUBLISHER & SUBSCRIBER or SERVER. Change-Id: Ib36b0686deb9220e507f9e468aae1b1191c35d31 Signed-off-by: Flavio Santes --- include/net/mqtt.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/net/mqtt.h b/include/net/mqtt.h index 5b682bd62f6..3fb4c2ae424 100644 --- a/include/net/mqtt.h +++ b/include/net/mqtt.h @@ -24,12 +24,12 @@ * @brief mqtt_app MQTT application type */ enum mqtt_app { + /** Publisher and Subscriber application */ + MQTT_APP_PUBLISHER_SUBSCRIBER, /** Publisher only application */ MQTT_APP_PUBLISHER, /** Subscriber only application */ MQTT_APP_SUBSCRIBER, - /** Publisher and Subscriber application */ - MQTT_APP_PUBLISHER_SUBSCRIBER, /** MQTT Server */ MQTT_APP_SERVER }; @@ -183,7 +183,10 @@ struct mqtt_ctx { /** Data passed to the #unsubscribe callback */ void *unsubscribe_data; - /** Application type */ + /* Internal use only */ + int (*rcv)(struct mqtt_ctx *, struct net_buf *); + + /** Application type, see: enum mqtt_app */ uint8_t app_type; /* Clean session is also part of the MQTT CONNECT msg, however app