nuttx-apps/examples/mqttc
xuxin19 32b417a8f7 cmake:refine cmake build for apps/examples
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-17 01:15:17 +08:00
..
CMakeLists.txt cmake:refine cmake build for apps/examples 2023-08-17 01:15:17 +08:00
Kconfig examples/mqttc/Kconfig: Fix Kconfig style 2023-05-18 00:38:54 +08:00
Make.defs
Makefile apps/examples/mqttc/Makefile: Add missing Apache Foundation copyright header 2023-04-03 16:14:35 +03:00
mqttc_pub.c examples/mqttc: Check for MQTT ACK and avoid passing '\0' 2023-05-15 19:20:28 +03:00
README.md

This is a simple MQTT publisher example using MQTT-C

By default it publishes to the "test" topic and exits. Default behaviour including, host, port, topic, message and loop count can be changed through different arguments.

To test: From the host start an MQTT broker and subscribe to the "test" topic. Here mosquitto is used:

mosquitto&
mosquitto_sub -t test

Make sure that mosquitto is not configured in local mode only.

From the nsh:

Launch the built-in app mqttc_pub specifying the host:

mqttc_pub -h HOST

The target will publish the message "test".