zephyr/subsys
Flavio Santes 76e479974a net/mqtt: Allow an MQTT publisher app to receive msgs
Changes applied by this patch:

- Add the mqtt_publisher_parser routine
- Add the MQTT_PACKET_TYPE macro to get the MQTT msg packet type
  (required by mqtt_publisher_parser)
- Add the mqtt_linearize_buffer (required by mqtt_publisher_parser)
- Add the mqtt_recv callback for reception
- Modify the mqtt_init routine to install the reception callback

The mqtt_publisher_parser routine is a callback used internally
to execute the appropriate mqtt_rx routine. Only the following
messages are handled by this routine:

MQTT_CONNACK, MQTT_PUBACK, MQTT_PUBREC, MQTT_PUBCOMP and MQTT_PINGRESP.

On error, it executes the ctx->malformed cb, if defined.

This commit also introduces the mqtt_linearize_buffer routine that
will be used to linearize an IP stack fragmented buffer. This patch
makes use of the net_nbuf_linear_copy routine to linearize the
incoming buffer. mqtt_rx_xxxx routines are also updated to handle
linear buffers (no fragmentation).

Currently, all the network protocol routines assume that the input
buffer is not fragmented. Future versions will remove that assumption
and the mqtt_linearize_buffer routine will be removed as well.

Public MQTT API is not affected by this patch.

Change-Id: I02fece67052ffbc7cb393d5ca545c503da463c4b
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-06 09:11:45 +01:00
..
bluetooth Bluetooth: Fix potential race condition in bt_pub_key_gen() 2017-01-05 14:48:01 +02:00
debug kernel: replace all remaining nanokernel occurances 2016-12-25 14:34:43 -05:00
fs shell: move shell to its own subsystem 2016-12-25 19:35:11 +00:00
logging logging: move event_logger to subsys/logging 2016-12-25 14:34:43 -05:00
net net/mqtt: Allow an MQTT publisher app to receive msgs 2017-01-06 09:11:45 +01:00
shell shell: move shell to its own subsystem 2016-12-25 19:35:11 +00:00
usb arch/arc, usb, ztest: Add the ARG_UNUSED macro 2016-12-21 12:54:54 +00:00
Kconfig shell: move shell to its own subsystem 2016-12-25 19:35:11 +00:00
Makefile shell: move shell to its own subsystem 2016-12-25 19:35:11 +00:00