From 45bd7bcde9713247ae5447d589a1bcb72085e584 Mon Sep 17 00:00:00 2001 From: Yuhan Wei Date: Fri, 30 Aug 2024 11:38:25 +0800 Subject: [PATCH] fix(ble): Increased the length of addr_str in ble_get_started nimble examples --- .../ble_get_started/nimble/NimBLE_Beacon/main/src/gap.c | 2 +- .../ble_get_started/nimble/NimBLE_Connection/main/src/gap.c | 4 ++-- .../ble_get_started/nimble/NimBLE_GATT_Server/main/src/gap.c | 2 +- .../ble_get_started/nimble/NimBLE_Security/main/src/gap.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/bluetooth/ble_get_started/nimble/NimBLE_Beacon/main/src/gap.c b/examples/bluetooth/ble_get_started/nimble/NimBLE_Beacon/main/src/gap.c index a213439bbd..71e03ba7c2 100644 --- a/examples/bluetooth/ble_get_started/nimble/NimBLE_Beacon/main/src/gap.c +++ b/examples/bluetooth/ble_get_started/nimble/NimBLE_Beacon/main/src/gap.c @@ -92,7 +92,7 @@ static void start_advertising(void) { void adv_init(void) { /* Local variables */ int rc = 0; - char addr_str[12] = {0}; + char addr_str[18] = {0}; /* Make sure we have proper BT identity address set */ rc = ble_hs_util_ensure_addr(0); diff --git a/examples/bluetooth/ble_get_started/nimble/NimBLE_Connection/main/src/gap.c b/examples/bluetooth/ble_get_started/nimble/NimBLE_Connection/main/src/gap.c index 76eedff759..8788b66f26 100644 --- a/examples/bluetooth/ble_get_started/nimble/NimBLE_Connection/main/src/gap.c +++ b/examples/bluetooth/ble_get_started/nimble/NimBLE_Connection/main/src/gap.c @@ -27,7 +27,7 @@ inline static void format_addr(char *addr_str, uint8_t addr[]) { static void print_conn_desc(struct ble_gap_conn_desc *desc) { /* Local variables */ - char addr_str[12] = {0}; + char addr_str[18] = {0}; /* Connection handle */ ESP_LOGI(TAG, "connection handle: %d", desc->conn_handle); @@ -218,7 +218,7 @@ static int gap_event_handler(struct ble_gap_event *event, void *arg) { void adv_init(void) { /* Local variables */ int rc = 0; - char addr_str[12] = {0}; + char addr_str[18] = {0}; /* Make sure we have proper BT identity address set */ rc = ble_hs_util_ensure_addr(0); diff --git a/examples/bluetooth/ble_get_started/nimble/NimBLE_GATT_Server/main/src/gap.c b/examples/bluetooth/ble_get_started/nimble/NimBLE_GATT_Server/main/src/gap.c index b9def39876..2d59d0224b 100644 --- a/examples/bluetooth/ble_get_started/nimble/NimBLE_GATT_Server/main/src/gap.c +++ b/examples/bluetooth/ble_get_started/nimble/NimBLE_GATT_Server/main/src/gap.c @@ -27,7 +27,7 @@ inline static void format_addr(char *addr_str, uint8_t addr[]) { static void print_conn_desc(struct ble_gap_conn_desc *desc) { /* Local variables */ - char addr_str[12] = {0}; + char addr_str[18] = {0}; /* Connection handle */ ESP_LOGI(TAG, "connection handle: %d", desc->conn_handle); diff --git a/examples/bluetooth/ble_get_started/nimble/NimBLE_Security/main/src/gap.c b/examples/bluetooth/ble_get_started/nimble/NimBLE_Security/main/src/gap.c index 94f8221a6d..64ec81dffd 100644 --- a/examples/bluetooth/ble_get_started/nimble/NimBLE_Security/main/src/gap.c +++ b/examples/bluetooth/ble_get_started/nimble/NimBLE_Security/main/src/gap.c @@ -28,7 +28,7 @@ inline static void format_addr(char *addr_str, uint8_t addr[]) { static void print_conn_desc(struct ble_gap_conn_desc *desc) { /* Local variables */ - char addr_str[12] = {0}; + char addr_str[18] = {0}; /* Connection handle */ ESP_LOGI(TAG, "connection handle: %d", desc->conn_handle);