I am using ota_demo_core_mqtt.c
from 2021. Can you tell me whether the message size parameter of prvMqttPublish()
expects the null terminator of the string be included in the count or not? (This older function seems similar to prvMQTTPublish()
in the latest version of ota_demo_core_mqtt.c
.)
Hi @IoT4Me
Both the usTopicLen
and ulMsgSize
in this function prvMqttPublish()
do not include the null terminator of the string, in their respective counts. We can directly use strlen
for these API parameters such as :
prvMQTTPublish(topicstring, strlen(topicstring), messagestring, strlen(messagestring), 1)