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 <flavio.santes@intel.com>
This commit is contained in:
parent
8619d9d625
commit
bf88fe5118
1 changed files with 6 additions and 3 deletions
|
@ -24,12 +24,12 @@
|
||||||
* @brief mqtt_app MQTT application type
|
* @brief mqtt_app MQTT application type
|
||||||
*/
|
*/
|
||||||
enum mqtt_app {
|
enum mqtt_app {
|
||||||
|
/** Publisher and Subscriber application */
|
||||||
|
MQTT_APP_PUBLISHER_SUBSCRIBER,
|
||||||
/** Publisher only application */
|
/** Publisher only application */
|
||||||
MQTT_APP_PUBLISHER,
|
MQTT_APP_PUBLISHER,
|
||||||
/** Subscriber only application */
|
/** Subscriber only application */
|
||||||
MQTT_APP_SUBSCRIBER,
|
MQTT_APP_SUBSCRIBER,
|
||||||
/** Publisher and Subscriber application */
|
|
||||||
MQTT_APP_PUBLISHER_SUBSCRIBER,
|
|
||||||
/** MQTT Server */
|
/** MQTT Server */
|
||||||
MQTT_APP_SERVER
|
MQTT_APP_SERVER
|
||||||
};
|
};
|
||||||
|
@ -183,7 +183,10 @@ struct mqtt_ctx {
|
||||||
/** Data passed to the #unsubscribe callback */
|
/** Data passed to the #unsubscribe callback */
|
||||||
void *unsubscribe_data;
|
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;
|
uint8_t app_type;
|
||||||
|
|
||||||
/* Clean session is also part of the MQTT CONNECT msg, however app
|
/* Clean session is also part of the MQTT CONNECT msg, however app
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue