net/mqtt: Add the mqtt_rx_publish routine

The mqtt_rx_publish is used to process incoming MQTT PUBLISH
messages. This routine performes the following steps:

- take ownership of the rx buffer containing the MQTT PUBLISH msg,
- call the MQTT parser routine, and
- determine, based on the incoming message's MQTT QoS,
  the next action.

Change-Id: I3cc011cf0c280205161d0484f12a2cfa79fdf44a
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
This commit is contained in:
Flavio Santes 2016-12-15 23:17:12 -06:00 committed by Tomasz Bursztyka
commit d490ff27ad
2 changed files with 44 additions and 0 deletions

View file

@ -403,4 +403,14 @@ int mqtt_rx_suback(struct mqtt_ctx *ctx, struct net_buf *rx);
*/
int mqtt_rx_unsuback(struct mqtt_ctx *ctx, struct net_buf *rx);
/**
* @brief mqtt_rx_publish Parses the MQTT PUBLISH message
* @param [in] ctx MQTT context structure
* @param [in] rx RX buffer from the IP stack
* @return 0 on success
* @return -EINVAL on error
* @return -ENOMEM if no data buffer is available
*/
int mqtt_rx_publish(struct mqtt_ctx *ctx, struct net_buf *rx);
#endif