The mqttc demo under example path can not support mbedtls api.
Because of the MQTT-C source code already contains many types of
link examples, so we added the corresponding makefile to
support mbedtls mqttc connections publisher and posix mqttc
connections publisher and subscriber.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This patch will force wait for MQTT ACK (connection) and also
fix the issue caused by "strlen(mqtt_cfg.msg) + 1" that will
include the "\0" in the payload. It's forbidded by MQTT spec.
Some MQTT servers will ignore it, others like TagoIO will refuse
the packet.
commit 36d4bfa774 set a hostname to work
around getaddrinfo failing. getaddrinfo returns a non-zero value on
error, and there should be an early return after the error message is
printed.