From a254c421735da0c4a9424dafa855f4194c756ead Mon Sep 17 00:00:00 2001 From: lly Date: Mon, 8 Jun 2020 15:43:59 +0800 Subject: [PATCH] ble_mesh: Move TAG definition to each example Move the TAG definition of each example to the corresponding source file (previously it is defined in the common example intialization header file), which can avoid the redefinition of TAG in some situations. --- .../ble_mesh_fast_provision/fast_prov_client/main/main.c | 2 ++ .../ble_mesh_fast_provision/fast_prov_server/main/main.c | 2 ++ .../esp_ble_mesh/ble_mesh_node/onoff_client/main/main.c | 2 ++ .../esp_ble_mesh/ble_mesh_node/onoff_server/main/main.c | 2 ++ .../bluetooth/esp_ble_mesh/ble_mesh_provisioner/main/main.c | 2 ++ .../ble_mesh_sensor_model/sensor_client/main/main.c | 2 ++ .../ble_mesh_sensor_model/sensor_server/main/main.c | 2 ++ .../ble_mesh_vendor_model/vendor_client/main/main.c | 2 ++ .../ble_mesh_vendor_model/vendor_server/main/main.c | 2 ++ .../bluetooth/esp_ble_mesh/ble_mesh_wifi_coexist/main/main.c | 2 ++ .../common_components/example_init/ble_mesh_example_init.c | 3 ++- .../common_components/example_init/ble_mesh_example_init.h | 2 -- 12 files changed, 22 insertions(+), 3 deletions(-) diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_fast_provision/fast_prov_client/main/main.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_fast_provision/fast_prov_client/main/main.c index 7b590d312..a3dd1df77 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_fast_provision/fast_prov_client/main/main.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_fast_provision/fast_prov_client/main/main.c @@ -31,6 +31,8 @@ #include "ble_mesh_fast_prov_client_model.h" #include "ble_mesh_example_init.h" +#define TAG "EXAMPLE" + #define PROV_OWN_ADDR 0x0001 #define APP_KEY_OCTET 0x12 #define GROUP_ADDRESS 0xC000 diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_fast_provision/fast_prov_server/main/main.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_fast_provision/fast_prov_server/main/main.c index b5fe155ac..26324d939 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_fast_provision/fast_prov_server/main/main.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_fast_provision/fast_prov_server/main/main.c @@ -32,6 +32,8 @@ #include "ble_mesh_fast_prov_server_model.h" #include "ble_mesh_example_init.h" +#define TAG "EXAMPLE" + extern struct _led_state led_state[3]; extern struct k_delayed_work send_self_prov_node_addr_timer; extern bt_mesh_atomic_t fast_prov_cli_flags; diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/main/main.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/main/main.c index 838a260d0..4007893b0 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/main/main.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/main/main.c @@ -23,6 +23,8 @@ #include "ble_mesh_example_init.h" #include "ble_mesh_example_nvs.h" +#define TAG "EXAMPLE" + #define CID_ESP 0x02E5 static uint8_t dev_uuid[16] = { 0xdd, 0xdd }; diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_server/main/main.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_server/main/main.c index 9a8b9fbe6..70d98de01 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_server/main/main.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_server/main/main.c @@ -24,6 +24,8 @@ #include "board.h" #include "ble_mesh_example_init.h" +#define TAG "EXAMPLE" + #define CID_ESP 0x02E5 extern struct _led_state led_state[3]; diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_provisioner/main/main.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_provisioner/main/main.c index 7521adb1c..674685d97 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_provisioner/main/main.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_provisioner/main/main.c @@ -21,6 +21,8 @@ #include "ble_mesh_example_init.h" +#define TAG "EXAMPLE" + #define LED_OFF 0x0 #define LED_ON 0x1 diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_sensor_model/sensor_client/main/main.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_sensor_model/sensor_client/main/main.c index 60e7d9c55..dbf1515f1 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_sensor_model/sensor_client/main/main.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_sensor_model/sensor_client/main/main.c @@ -22,6 +22,8 @@ #include "ble_mesh_example_init.h" #include "board.h" +#define TAG "EXAMPLE" + #define CID_ESP 0x02E5 #define PROV_OWN_ADDR 0x0001 diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_sensor_model/sensor_server/main/main.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_sensor_model/sensor_server/main/main.c index f0f1bfb13..e171ef661 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_sensor_model/sensor_server/main/main.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_sensor_model/sensor_server/main/main.c @@ -23,6 +23,8 @@ #include "ble_mesh_example_init.h" #include "board.h" +#define TAG "EXAMPLE" + #define CID_ESP 0x02E5 /* Sensor Property ID */ diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_client/main/main.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_client/main/main.c index ac6aed44e..ef9afa98d 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_client/main/main.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_client/main/main.c @@ -23,6 +23,8 @@ #include "ble_mesh_example_nvs.h" #include "board.h" +#define TAG "EXAMPLE" + #define CID_ESP 0x02E5 #define PROV_OWN_ADDR 0x0001 diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_server/main/main.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_server/main/main.c index af91c84bd..4d4decff4 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_server/main/main.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_server/main/main.c @@ -24,6 +24,8 @@ #include "board.h" #include "ble_mesh_example_init.h" +#define TAG "EXAMPLE" + #define CID_ESP 0x02E5 #define ESP_BLE_MESH_VND_MODEL_ID_CLIENT 0x0000 diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_wifi_coexist/main/main.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_wifi_coexist/main/main.c index d6b6c1f10..2689ec057 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_wifi_coexist/main/main.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_wifi_coexist/main/main.c @@ -44,6 +44,8 @@ #include "ble_mesh_fast_prov_server_model.h" #include "ble_mesh_example_init.h" +#define TAG "EXAMPLE" + extern struct _led_state led_state[3]; extern struct k_delayed_work send_self_prov_node_addr_timer; extern bt_mesh_atomic_t fast_prov_cli_flags; diff --git a/examples/bluetooth/esp_ble_mesh/common_components/example_init/ble_mesh_example_init.c b/examples/bluetooth/esp_ble_mesh/common_components/example_init/ble_mesh_example_init.c index 472bba570..0f99fc109 100644 --- a/examples/bluetooth/esp_ble_mesh/common_components/example_init/ble_mesh_example_init.c +++ b/examples/bluetooth/esp_ble_mesh/common_components/example_init/ble_mesh_example_init.c @@ -26,7 +26,8 @@ #endif #include "esp_ble_mesh_defs.h" -#include "ble_mesh_example_init.h" + +#define TAG "EXAMPLE_INIT" #ifdef CONFIG_BT_BLUEDROID_ENABLED void ble_mesh_get_dev_uuid(uint8_t *dev_uuid) diff --git a/examples/bluetooth/esp_ble_mesh/common_components/example_init/ble_mesh_example_init.h b/examples/bluetooth/esp_ble_mesh/common_components/example_init/ble_mesh_example_init.h index 4d15a84ec..a0f2229cd 100644 --- a/examples/bluetooth/esp_ble_mesh/common_components/example_init/ble_mesh_example_init.h +++ b/examples/bluetooth/esp_ble_mesh/common_components/example_init/ble_mesh_example_init.h @@ -11,8 +11,6 @@ #include "esp_err.h" -#define TAG "EXAMPLE" - void ble_mesh_get_dev_uuid(uint8_t *dev_uuid); esp_err_t bluetooth_init(void);