bugfix sample topic
This commit is contained in:
parent
adf5ccec18
commit
18addb2c16
|
@ -50,7 +50,7 @@ static int _publish_msg(void *client)
|
||||||
{
|
{
|
||||||
char topicName[128] = {0};
|
char topicName[128] = {0};
|
||||||
int num = 18;
|
int num = 18;
|
||||||
HAL_Snprintf(topicName, 128, "/%s/%s/upload/event", UIOT_MY_PRODUCT_SN, UIOT_MY_DEVICE_SN);
|
HAL_Snprintf(topicName, 128, "/%s/%s/upload", UIOT_MY_PRODUCT_SN, UIOT_MY_DEVICE_SN);
|
||||||
|
|
||||||
PublishParams pub_params = DEFAULT_PUB_PARAMS;
|
PublishParams pub_params = DEFAULT_PUB_PARAMS;
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ static int _publish_msg(void *client)
|
||||||
static int _register_subscribe_topics(void *client)
|
static int _register_subscribe_topics(void *client)
|
||||||
{
|
{
|
||||||
static char topic_name[128] = {0};
|
static char topic_name[128] = {0};
|
||||||
HAL_Snprintf(topic_name, 128, "/%s/%s/upload/event", UIOT_MY_PRODUCT_SN, UIOT_MY_DEVICE_SN);
|
HAL_Snprintf(topic_name, 128, "/%s/%s/set", UIOT_MY_PRODUCT_SN, UIOT_MY_DEVICE_SN);
|
||||||
|
|
||||||
SubscribeParams sub_params = DEFAULT_SUB_PARAMS;
|
SubscribeParams sub_params = DEFAULT_SUB_PARAMS;
|
||||||
sub_params.on_message_handler = on_message_callback;
|
sub_params.on_message_handler = on_message_callback;
|
||||||
|
|
|
@ -155,7 +155,7 @@ static int _setup_connect_init_params(MQTTInitParams* initParams)
|
||||||
static int _publish_msg(void *client)
|
static int _publish_msg(void *client)
|
||||||
{
|
{
|
||||||
char topicName[128] = {0};
|
char topicName[128] = {0};
|
||||||
HAL_Snprintf(topicName, 128, "/%s/%s/upload/event", UIOT_MY_PRODUCT_SN, UIOT_MY_DEVICE_SN);
|
HAL_Snprintf(topicName, 128, "/%s/%s/upload", UIOT_MY_PRODUCT_SN, UIOT_MY_DEVICE_SN);
|
||||||
|
|
||||||
PublishParams pub_params = DEFAULT_PUB_PARAMS;
|
PublishParams pub_params = DEFAULT_PUB_PARAMS;
|
||||||
pub_params.qos = QOS1;
|
pub_params.qos = QOS1;
|
||||||
|
@ -182,7 +182,7 @@ static int _publish_msg(void *client)
|
||||||
static int _register_subscribe_topics(void *client)
|
static int _register_subscribe_topics(void *client)
|
||||||
{
|
{
|
||||||
static char topic_name[128] = {0};
|
static char topic_name[128] = {0};
|
||||||
int size = HAL_Snprintf(topic_name, sizeof(topic_name), "/%s/%s/upload/event", UIOT_MY_PRODUCT_SN, UIOT_MY_DEVICE_SN);
|
int size = HAL_Snprintf(topic_name, sizeof(topic_name), "/%s/%s/set", UIOT_MY_PRODUCT_SN, UIOT_MY_DEVICE_SN);
|
||||||
if (size < 0 || size > sizeof(topic_name) - 1)
|
if (size < 0 || size > sizeof(topic_name) - 1)
|
||||||
{
|
{
|
||||||
HAL_Printf("topic content length not enough! content size:%d buf size:%d\n", size, (int)sizeof(topic_name));
|
HAL_Printf("topic content length not enough! content size:%d buf size:%d\n", size, (int)sizeof(topic_name));
|
||||||
|
|
Loading…
Reference in New Issue