Ver código fonte

Nimble: Fixed compilation issues in nimble examples after removing "-Wno-format" option

Rahul Tank 3 anos atrás
pai
commit
00ce75784a

+ 0 - 1
examples/bluetooth/blufi/main/CMakeLists.txt

@@ -2,4 +2,3 @@ idf_component_register(SRCS "blufi_example_main.c"
                             "blufi_security.c"
                             "blufi_init.c"
                     INCLUDE_DIRS ".")
-target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

+ 1 - 1
examples/bluetooth/blufi/main/blufi_example_main.c

@@ -423,7 +423,7 @@ static void example_event_callback(esp_blufi_cb_event_t event, esp_blufi_cb_para
         break;
     }
     case ESP_BLUFI_EVENT_RECV_CUSTOM_DATA:
-        BLUFI_INFO("Recv Custom Data %d\n", param->custom_data.data_len);
+        BLUFI_INFO("Recv Custom Data %" PRIu32 "\n", param->custom_data.data_len);
         esp_log_buffer_hex("Custom Data", param->custom_data.data, param->custom_data.data_len);
         break;
 	case ESP_BLUFI_EVENT_RECV_USERNAME:

+ 0 - 1
examples/bluetooth/nimble/blemesh/main/CMakeLists.txt

@@ -1,3 +1,2 @@
 idf_component_register(SRCS "app_mesh.c"
                     INCLUDE_DIRS ".")
-target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

+ 1 - 1
examples/bluetooth/nimble/blemesh/main/app_mesh.c

@@ -361,7 +361,7 @@ static const struct bt_mesh_comp comp = {
 
 static int output_number(bt_mesh_output_action_t action, uint32_t number)
 {
-    ESP_LOGI(tag, "OOB Number: %u\n", number);
+    ESP_LOGI(tag, "OOB Number: %" PRIu32 "\n", number);
 
     return 0;
 }

+ 0 - 1
examples/bluetooth/nimble/bleprph/main/CMakeLists.txt

@@ -3,4 +3,3 @@ set(srcs "main.c"
 
 idf_component_register(SRCS "${srcs}"
                        INCLUDE_DIRS ".")
-target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

+ 2 - 2
examples/bluetooth/nimble/bleprph/main/main.c

@@ -349,11 +349,11 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
         if (event->passkey.params.action == BLE_SM_IOACT_DISP) {
             pkey.action = event->passkey.params.action;
             pkey.passkey = 123456; // This is the passkey to be entered on peer
-            ESP_LOGI(tag, "Enter passkey %d on the peer side", pkey.passkey);
+            ESP_LOGI(tag, "Enter passkey %" PRIu32 "on the peer side", pkey.passkey);
             rc = ble_sm_inject_io(event->passkey.conn_handle, &pkey);
             ESP_LOGI(tag, "ble_sm_inject_io result: %d\n", rc);
         } else if (event->passkey.params.action == BLE_SM_IOACT_NUMCMP) {
-            ESP_LOGI(tag, "Passkey on device's display: %d", event->passkey.params.numcmp);
+            ESP_LOGI(tag, "Passkey on device's display: %" PRIu32 , event->passkey.params.numcmp);
             ESP_LOGI(tag, "Accept or reject the passkey through console in this format -> key Y or key N");
             pkey.action = event->passkey.params.action;
             if (scli_receive_key(&key)) {

+ 0 - 1
examples/bluetooth/nimble/bleprph_wifi_coex/main/CMakeLists.txt

@@ -1,3 +1,2 @@
 idf_component_register(SRCS "main.c" "gatt_svr.c"
                     INCLUDE_DIRS ".")
-target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

+ 2 - 2
examples/bluetooth/nimble/bleprph_wifi_coex/main/main.c

@@ -167,7 +167,7 @@ static void cmd_ping_on_ping_success(esp_ping_handle_t hdl, void *args)
     esp_ping_get_profile(hdl, ESP_PING_PROF_IPADDR, &target_addr, sizeof(target_addr));
     esp_ping_get_profile(hdl, ESP_PING_PROF_SIZE, &recv_len, sizeof(recv_len));
     esp_ping_get_profile(hdl, ESP_PING_PROF_TIMEGAP, &elapsed_time, sizeof(elapsed_time));
-    printf("%d bytes from %s icmp_seq=%d ttl=%d time=%d ms\n",
+    printf("%" PRIu32 "bytes from %s icmp_seq=%d ttl=%d time=%" PRIu32 "ms\n",
            recv_len, inet_ntoa(target_addr.u_addr.ip4), seqno, ttl, elapsed_time);
 }
 
@@ -197,7 +197,7 @@ static void cmd_ping_on_ping_end(esp_ping_handle_t hdl, void *args)
     } else {
         printf("\n--- %s ping statistics ---\n", inet6_ntoa(*ip_2_ip6(&target_addr)));
     }
-    printf("%d packets transmitted, %d received, %d%% packet loss, time %dms\n",
+    printf("%" PRIu32 "packets transmitted, %" PRIu32 " received, %" PRIu32 "%% packet loss, time %" PRIu32 "ms\n",
            transmitted, received, loss, total_time_ms);
     // delete the ping sessions, so that we clean up all resources and can create a new ping session
     // we don't have to call delete function in the callback, instead we can call delete function from other tasks

+ 0 - 1
examples/bluetooth/nimble/throughput_app/blecent_throughput/components/cmd_system/CMakeLists.txt

@@ -2,4 +2,3 @@ idf_component_register(SRCS "cmd_system.c"
                     INCLUDE_DIRS "."
                     PRIV_REQUIRES driver
                     REQUIRES console spi_flash)
-target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

+ 3 - 3
examples/bluetooth/nimble/throughput_app/blecent_throughput/components/cmd_system/cmd_system.c

@@ -63,7 +63,7 @@ static int get_version(int argc, char **argv)
     printf("Chip info:\r\n");
     printf("\tmodel:%s\r\n", info.model == CHIP_ESP32 ? "ESP32" : "Unknow");
     printf("\tcores:%d\r\n", info.cores);
-    printf("\tfeature:%s%s%s%s%d%s\r\n",
+    printf("\tfeature:%s%s%s%s%" PRIu32 "%s\r\n",
            info.features & CHIP_FEATURE_WIFI_BGN ? "/802.11bgn" : "",
            info.features & CHIP_FEATURE_BLE ? "/BLE" : "",
            info.features & CHIP_FEATURE_BT ? "/BT" : "",
@@ -107,7 +107,7 @@ static void register_restart(void)
 
 static int free_mem(int argc, char **argv)
 {
-    printf("%d\n", esp_get_free_heap_size());
+    printf("%" PRIu32 "\n", esp_get_free_heap_size());
     return 0;
 }
 
@@ -126,7 +126,7 @@ static void register_free(void)
 static int heap_size(int argc, char **argv)
 {
     uint32_t heap_size = heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT);
-    ESP_LOGI(TAG, "min heap size: %u", heap_size);
+    ESP_LOGI(TAG, "min heap size: %" PRIu32 , heap_size);
     return 0;
 }