esp32 .uri = "/",
时间: 2023-08-14 15:14:35 浏览: 159
esp32
回答: 在ESP32中,如果你想将URI设置为"/",你可以使用以下代码进行设置:
```c
esp_mqtt_client_config_t mqtt_cfg = {
.uri = "/"
};
esp_mqtt_client_handle_t client = esp_mqtt_client_init(&mqtt_cfg);
esp_mqtt_client_register_event(client, ESP_EVENT_ANY_ID, mqtt_event_handler, client);
esp_mqtt_client_start(client);
```
这样,你就可以将URI设置为"/",并且成功初始化ESP32的MQTT客户端。
#### 引用[.reference_title]
- *1* *2* *3* [esp32c3 问题解决](https://blog.csdn.net/qq_51174802/article/details/122176827)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文