Skip to content

Commit

Permalink
Merge branch 'bugfix/remove_-Wno-formate_in_wifi_example' into 'master'
Browse files Browse the repository at this point in the history
esp_wifi: Remove -Wno-format compile option for FTM example, iperf example, roaming example

See merge request espressif/esp-idf!21778
  • Loading branch information
jack0c committed Dec 26, 2022
2 parents b223baf + 66465ad commit a00bde9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion examples/wifi/ftm/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
idf_component_register(SRCS "ftm_main.c"
INCLUDE_DIRS ".")
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
6 changes: 3 additions & 3 deletions examples/wifi/ftm/main/ftm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include <errno.h>
#include <string.h>
#include <inttypes.h>
#include <stdio.h>
#include <string.h>
#include "nvs_flash.h"
#include "cmd_system.h"
#include "argtable3/argtable3.h"
Expand Down Expand Up @@ -170,7 +170,7 @@ static void ftm_process_report(void)
log_ptr += sprintf(log_ptr, "%6d|", s_ftm_report[i].dlog_token);
}
if (g_report_lvl & BIT1) {
log_ptr += sprintf(log_ptr, "%7u |", s_ftm_report[i].rtt);
log_ptr += sprintf(log_ptr, "%7" PRIu32 " |", s_ftm_report[i].rtt);
}
if (g_report_lvl & BIT2) {
log_ptr += sprintf(log_ptr, "%14llu |%14llu |%14llu |%14llu |", s_ftm_report[i].t1,
Expand Down Expand Up @@ -491,7 +491,7 @@ static int wifi_cmd_ftm(int argc, char **argv)
free(s_ftm_report);
s_ftm_report = NULL;
s_ftm_report_num_entries = 0;
ESP_LOGI(TAG_STA, "Estimated RTT - %d nSec, Estimated Distance - %d.%02d meters",
ESP_LOGI(TAG_STA, "Estimated RTT - %" PRId32 " nSec, Estimated Distance - %" PRId32 ".%02" PRId32 " meters",
s_rtt_est, s_dist_est / 100, s_dist_est % 100);
} else {
/* Failure case */
Expand Down
2 changes: 0 additions & 2 deletions examples/wifi/iperf/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
idf_component_register(SRCS "cmd_wifi.c"
"iperf_example_main.c"
INCLUDE_DIRS ".")

target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
5 changes: 4 additions & 1 deletion examples/wifi/iperf/main/cmd_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include "esp_log.h"
#include "esp_console.h"
#include "argtable3/argtable3.h"
Expand Down Expand Up @@ -420,7 +421,9 @@ static int wifi_cmd_iperf(int argc, char **argv)
}


ESP_LOGI(TAG, "mode=%s-%s sip=%d.%d.%d.%d:%d, dip=%d.%d.%d.%d:%d, interval=%d, time=%d",
ESP_LOGI(TAG, "mode=%s-%s sip=%" PRId32 ".%" PRId32 ".%" PRId32 ".%" PRId32 ":%d,\
dip=%" PRId32 ".%" PRId32 ".%" PRId32 ".%" PRId32 ":%d,\
interval=%" PRId32 ", time=%" PRId32 "",
cfg.flag & IPERF_FLAG_TCP ? "tcp" : "udp",
cfg.flag & IPERF_FLAG_SERVER ? "server" : "client",
cfg.source_ip4 & 0xFF, (cfg.source_ip4 >> 8) & 0xFF, (cfg.source_ip4 >> 16) & 0xFF,
Expand Down
1 change: 0 additions & 1 deletion examples/wifi/roaming/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Embed CA, certificate & key directly into binary
idf_component_register(SRCS "roaming_example.c"
INCLUDE_DIRS ".")
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
5 changes: 3 additions & 2 deletions examples/wifi/roaming/main/roaming_example.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <inttypes.h>
#include <stdlib.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
Expand Down Expand Up @@ -172,7 +173,7 @@ static char * get_btm_neighbor_list(uint8_t *report, size_t report_len)
}

ESP_LOGI(TAG, "RMM neigbor report bssid=" MACSTR
" info=0x%x op_class=%u chan=%u phy_type=%u%s%s%s%s",
" info=0x%" PRIx32 " op_class=%u chan=%u phy_type=%u%s%s%s%s",
MAC2STR(nr), WPA_GET_LE32(nr + ETH_ALEN),
nr[ETH_ALEN + 4], nr[ETH_ALEN + 5],
nr[ETH_ALEN + 6],
Expand All @@ -186,7 +187,7 @@ static char * get_btm_neighbor_list(uint8_t *report, size_t report_len)
/* , */
len += snprintf(buf + len, MAX_NEIGHBOR_LEN - len, ",");
/* bssid info */
len += snprintf(buf + len, MAX_NEIGHBOR_LEN - len, "0x%04x", WPA_GET_LE32(nr + ETH_ALEN));
len += snprintf(buf + len, MAX_NEIGHBOR_LEN - len, "0x%04" PRIx32 "", WPA_GET_LE32(nr + ETH_ALEN));
len += snprintf(buf + len, MAX_NEIGHBOR_LEN - len, ",");
/* operating class */
len += snprintf(buf + len, MAX_NEIGHBOR_LEN - len, "%u", nr[ETH_ALEN + 4]);
Expand Down

0 comments on commit a00bde9

Please sign in to comment.