mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
wifi_mesh: Remove-Wno-format compile option for mesh examples
This commit is contained in:
parent
885e501d99
commit
d1abf90854
@ -1,4 +1,3 @@
|
|||||||
idf_component_register(SRCS "mesh_light.c"
|
idf_component_register(SRCS "mesh_light.c"
|
||||||
"mesh_main.c"
|
"mesh_main.c"
|
||||||
INCLUDE_DIRS "." "include")
|
INCLUDE_DIRS "." "include")
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
CONDITIONS OF ANY KIND, either express or implied.
|
CONDITIONS OF ANY KIND, either express or implied.
|
||||||
*/
|
*/
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
#include "esp_wifi.h"
|
#include "esp_wifi.h"
|
||||||
#include "esp_mac.h"
|
#include "esp_mac.h"
|
||||||
#include "esp_event.h"
|
#include "esp_event.h"
|
||||||
@ -104,13 +105,13 @@ void esp_mesh_p2p_tx_main(void *arg)
|
|||||||
err = esp_mesh_send(&route_table[i], &data, MESH_DATA_P2P, NULL, 0);
|
err = esp_mesh_send(&route_table[i], &data, MESH_DATA_P2P, NULL, 0);
|
||||||
if (err) {
|
if (err) {
|
||||||
ESP_LOGE(MESH_TAG,
|
ESP_LOGE(MESH_TAG,
|
||||||
"[ROOT-2-UNICAST:%d][L:%d]parent:"MACSTR" to "MACSTR", heap:%d[err:0x%x, proto:%d, tos:%d]",
|
"[ROOT-2-UNICAST:%d][L:%d]parent:"MACSTR" to "MACSTR", heap:%" PRId32 "[err:0x%x, proto:%d, tos:%d]",
|
||||||
send_count, mesh_layer, MAC2STR(mesh_parent_addr.addr),
|
send_count, mesh_layer, MAC2STR(mesh_parent_addr.addr),
|
||||||
MAC2STR(route_table[i].addr), esp_get_minimum_free_heap_size(),
|
MAC2STR(route_table[i].addr), esp_get_minimum_free_heap_size(),
|
||||||
err, data.proto, data.tos);
|
err, data.proto, data.tos);
|
||||||
} else if (!(send_count % 100)) {
|
} else if (!(send_count % 100)) {
|
||||||
ESP_LOGW(MESH_TAG,
|
ESP_LOGW(MESH_TAG,
|
||||||
"[ROOT-2-UNICAST:%d][L:%d][rtableSize:%d]parent:"MACSTR" to "MACSTR", heap:%d[err:0x%x, proto:%d, tos:%d]",
|
"[ROOT-2-UNICAST:%d][L:%d][rtableSize:%d]parent:"MACSTR" to "MACSTR", heap:%" PRId32 "[err:0x%x, proto:%d, tos:%d]",
|
||||||
send_count, mesh_layer,
|
send_count, mesh_layer,
|
||||||
esp_mesh_get_routing_table_size(),
|
esp_mesh_get_routing_table_size(),
|
||||||
MAC2STR(mesh_parent_addr.addr),
|
MAC2STR(mesh_parent_addr.addr),
|
||||||
@ -155,7 +156,7 @@ void esp_mesh_p2p_rx_main(void *arg)
|
|||||||
mesh_light_process(&from, data.data, data.size);
|
mesh_light_process(&from, data.data, data.size);
|
||||||
if (!(recv_count % 1)) {
|
if (!(recv_count % 1)) {
|
||||||
ESP_LOGW(MESH_TAG,
|
ESP_LOGW(MESH_TAG,
|
||||||
"[#RX:%d/%d][L:%d] parent:"MACSTR", receive from "MACSTR", size:%d, heap:%d, flag:%d[err:0x%x, proto:%d, tos:%d]",
|
"[#RX:%d/%d][L:%d] parent:"MACSTR", receive from "MACSTR", size:%d, heap:%" PRId32 ", flag:%d[err:0x%x, proto:%d, tos:%d]",
|
||||||
recv_count, send_count, mesh_layer,
|
recv_count, send_count, mesh_layer,
|
||||||
MAC2STR(mesh_parent_addr.addr), MAC2STR(from.addr),
|
MAC2STR(mesh_parent_addr.addr), MAC2STR(from.addr),
|
||||||
data.size, esp_get_minimum_free_heap_size(), flag, err, data.proto,
|
data.size, esp_get_minimum_free_heap_size(), flag, err, data.proto,
|
||||||
@ -371,7 +372,7 @@ void mesh_event_handler(void *arg, esp_event_base_t event_base,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ESP_LOGI(MESH_TAG, "unknown id:%d", event_id);
|
ESP_LOGI(MESH_TAG, "unknown id:%" PRId32 "", event_id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -445,7 +446,7 @@ void app_main(void)
|
|||||||
/* set the network active duty cycle. (default:10, -1, MESH_PS_NETWORK_DUTY_APPLIED_ENTIRE) */
|
/* set the network active duty cycle. (default:10, -1, MESH_PS_NETWORK_DUTY_APPLIED_ENTIRE) */
|
||||||
ESP_ERROR_CHECK(esp_mesh_set_network_duty_cycle(CONFIG_MESH_PS_NWK_DUTY, CONFIG_MESH_PS_NWK_DUTY_DURATION, CONFIG_MESH_PS_NWK_DUTY_RULE));
|
ESP_ERROR_CHECK(esp_mesh_set_network_duty_cycle(CONFIG_MESH_PS_NWK_DUTY, CONFIG_MESH_PS_NWK_DUTY_DURATION, CONFIG_MESH_PS_NWK_DUTY_RULE));
|
||||||
#endif
|
#endif
|
||||||
ESP_LOGI(MESH_TAG, "mesh starts successfully, heap:%d, %s<%d>%s, ps:%d\n", esp_get_minimum_free_heap_size(),
|
ESP_LOGI(MESH_TAG, "mesh starts successfully, heap:%" PRId32 ", %s<%d>%s, ps:%d\n", esp_get_minimum_free_heap_size(),
|
||||||
esp_mesh_is_root_fixed() ? "root fixed" : "root not fixed",
|
esp_mesh_is_root_fixed() ? "root fixed" : "root not fixed",
|
||||||
esp_mesh_get_topology(), esp_mesh_get_topology() ? "(chain)":"(tree)", esp_mesh_is_ps_enabled());
|
esp_mesh_get_topology(), esp_mesh_get_topology() ? "(chain)":"(tree)", esp_mesh_is_ps_enabled());
|
||||||
}
|
}
|
||||||
|
@ -2,4 +2,3 @@ idf_component_register(SRCS "mesh_main.c"
|
|||||||
"mesh_netif.c"
|
"mesh_netif.c"
|
||||||
"mqtt_app.c"
|
"mqtt_app.c"
|
||||||
INCLUDE_DIRS "." "include")
|
INCLUDE_DIRS "." "include")
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
CONDITIONS OF ANY KIND, either express or implied.
|
CONDITIONS OF ANY KIND, either express or implied.
|
||||||
*/
|
*/
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <inttypes.h>
|
||||||
#include "esp_wifi.h"
|
#include "esp_wifi.h"
|
||||||
#include "esp_mac.h"
|
#include "esp_mac.h"
|
||||||
#include "esp_event.h"
|
#include "esp_event.h"
|
||||||
@ -360,7 +361,7 @@ void mesh_event_handler(void *arg, esp_event_base_t event_base,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ESP_LOGI(MESH_TAG, "unknown id:%d", event_id);
|
ESP_LOGI(MESH_TAG, "unknown id:%" PRId32 "", event_id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -422,6 +423,6 @@ void app_main(void)
|
|||||||
ESP_ERROR_CHECK(esp_mesh_set_config(&cfg));
|
ESP_ERROR_CHECK(esp_mesh_set_config(&cfg));
|
||||||
/* mesh start */
|
/* mesh start */
|
||||||
ESP_ERROR_CHECK(esp_mesh_start());
|
ESP_ERROR_CHECK(esp_mesh_start());
|
||||||
ESP_LOGI(MESH_TAG, "mesh starts successfully, heap:%d, %s\n", esp_get_free_heap_size(),
|
ESP_LOGI(MESH_TAG, "mesh starts successfully, heap:%" PRId32 ", %s\n", esp_get_free_heap_size(),
|
||||||
esp_mesh_is_root_fixed() ? "root fixed" : "root not fixed");
|
esp_mesh_is_root_fixed() ? "root fixed" : "root not fixed");
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ static esp_err_t mqtt_event_handler_cb(esp_mqtt_event_handle_t event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data) {
|
static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data) {
|
||||||
ESP_LOGD(TAG, "Event dispatched from event loop base=%s, event_id=%d", base, event_id);
|
ESP_LOGD(TAG, "Event dispatched from event loop base=%s, event_id=%" PRId32 "", base, event_id);
|
||||||
mqtt_event_handler_cb(event_data);
|
mqtt_event_handler_cb(event_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
idf_component_register(SRCS "mesh_light.c"
|
idf_component_register(SRCS "mesh_light.c"
|
||||||
"mesh_main.c"
|
"mesh_main.c"
|
||||||
INCLUDE_DIRS "." "include")
|
INCLUDE_DIRS "." "include")
|
||||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
|
||||||
|
@ -269,7 +269,7 @@ void mesh_event_handler(void *arg, esp_event_base_t event_base,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ESP_LOGD(MESH_TAG, "event id:%d", event_id);
|
ESP_LOGD(MESH_TAG, "event id:%" PRId32 "", event_id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -329,5 +329,5 @@ void app_main(void)
|
|||||||
ESP_ERROR_CHECK(esp_mesh_set_config(&cfg));
|
ESP_ERROR_CHECK(esp_mesh_set_config(&cfg));
|
||||||
/* mesh start */
|
/* mesh start */
|
||||||
ESP_ERROR_CHECK(esp_mesh_start());
|
ESP_ERROR_CHECK(esp_mesh_start());
|
||||||
ESP_LOGI(MESH_TAG, "mesh starts successfully, heap:%d\n", esp_get_free_heap_size());
|
ESP_LOGI(MESH_TAG, "mesh starts successfully, heap:%" PRId32 "\n", esp_get_free_heap_size());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user