想問一下有沒有MQTT SUBSCRIBE topic 之後接收MESSAGE的例子?
我只找到
Code:
Select all
case MQTT_EVENT_DATA:
{
ESP_LOGI(TAG, "MQTT_EVENT_DATA, topic: %.*s, data: %.*s",
event->topic_len, event->topic, event->data_len, event->data);
mesh_mqtt_data_t *item = mesh_mqtt_parse_data(event->topic, event->topic_len, event->data, event->data_len);
if (item == NULL)
{
break;
}
if (xQueueSend(g_mesh_mqtt.queue, &item, 0) != pdPASS)
{
ESP_LOGI(TAG,"Send receive queue failed");
MDF_FREE(item->addrs_list);
MDF_FREE(item->data);
MDF_FREE(item);
}
break;
}
但好像不太是接收message的。