Merge branch 'bugfix/nocommon' into 'master'

enable and fix warnings on common symbols

Closes IDFGH-3055 and IDF-3013

See merge request espressif/esp-idf!16802
pull/6150/merge
Anton Maklakov 2022-01-28 14:39:51 +00:00
commit 7cdd151612
27 zmienionych plików z 161 dodań i 205 usunięć

Wyświetl plik

@ -195,6 +195,7 @@ if(CONFIG_ESP_SYSTEM_USE_EH_FRAME)
endif() endif()
list(APPEND link_options "-fno-lto") list(APPEND link_options "-fno-lto")
list(APPEND link_options "-Wl,--warn-common")
if(CONFIG_IDF_TARGET_LINUX AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") if(CONFIG_IDF_TARGET_LINUX AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
list(APPEND link_options "-Wl,-dead_strip") list(APPEND link_options "-Wl,-dead_strip")

Wyświetl plik

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -35,12 +35,6 @@
#if (BLUFI_INCLUDED == TRUE) #if (BLUFI_INCLUDED == TRUE)
#if GATT_DYNAMIC_MEMORY == FALSE
tBLUFI_ENV blufi_env;
#else
tBLUFI_ENV *blufi_env_ptr;
#endif
static uint8_t server_if; static uint8_t server_if;
static uint16_t conn_id; static uint16_t conn_id;
static uint8_t blufi_service_uuid128[32] = { static uint8_t blufi_service_uuid128[32] = {

Wyświetl plik

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -18,7 +18,6 @@
//#include "esp_wifi.h" //#include "esp_wifi.h"
#if (BLUFI_INCLUDED == TRUE) #if (BLUFI_INCLUDED == TRUE)
// extern tBLUFI_ENV blufi_env;
void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len) void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
{ {

Wyświetl plik

@ -42,6 +42,7 @@ tBTA_DM_DI_CB bta_dm_di_cb;
tBTA_DM_CB *bta_dm_cb_ptr; tBTA_DM_CB *bta_dm_cb_ptr;
tBTA_DM_SEARCH_CB *bta_dm_search_cb_ptr; tBTA_DM_SEARCH_CB *bta_dm_search_cb_ptr;
tBTA_DM_DI_CB *bta_dm_di_cb_ptr; tBTA_DM_DI_CB *bta_dm_di_cb_ptr;
SemaphoreHandle_t deinit_semaphore;
#endif #endif

Wyświetl plik

@ -1481,7 +1481,7 @@ extern tBTA_DM_DI_CB bta_dm_di_cb;
#else #else
extern tBTA_DM_DI_CB *bta_dm_di_cb_ptr; extern tBTA_DM_DI_CB *bta_dm_di_cb_ptr;
#define bta_dm_di_cb (*bta_dm_di_cb_ptr) #define bta_dm_di_cb (*bta_dm_di_cb_ptr)
SemaphoreHandle_t deinit_semaphore; extern SemaphoreHandle_t deinit_semaphore;
#endif #endif
#if BTA_DYNAMIC_MEMORY == FALSE #if BTA_DYNAMIC_MEMORY == FALSE

Wyświetl plik

@ -112,8 +112,8 @@
#define SBC_DEQUANT_SCALING_FACTOR 1.38019122262781f #define SBC_DEQUANT_SCALING_FACTOR 1.38019122262781f
#endif #endif
const OI_UINT32 dequant_long_scaled[17]; extern const OI_UINT32 dequant_long_scaled[17];
const OI_UINT32 dequant_long_unscaled[17]; extern const OI_UINT32 dequant_long_unscaled[17];
/** Scales x by y bits to the right, adding a rounding factor. /** Scales x by y bits to the right, adding a rounding factor.
*/ */

Wyświetl plik

@ -1,16 +1,8 @@
// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// You may obtain a copy of the License at */
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once #pragma once
@ -30,8 +22,8 @@
} \ } \
} while(0) } while(0)
const char* fatfs_test_hello_str; extern const char* fatfs_test_hello_str;
const char* fatfs_test_hello_str_utf; extern const char* fatfs_test_hello_str_utf;
void test_fatfs_create_file_with_text(const char* name, const char* text); void test_fatfs_create_file_with_text(const char* name, const char* text);

Wyświetl plik

@ -1,19 +1,11 @@
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// You may obtain a copy of the License at */
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once #pragma once
enum _panic_reasons { typedef enum {
PANIC_RSN_NONE = 0, PANIC_RSN_NONE = 0,
PANIC_RSN_INTWDT_CPU0, PANIC_RSN_INTWDT_CPU0,
#if SOC_CPU_NUM > 1 #if SOC_CPU_NUM > 1
@ -24,4 +16,4 @@ enum _panic_reasons {
PANIC_RSN_MEMPROT, PANIC_RSN_MEMPROT,
#endif #endif
PANIC_RSN_COUNT PANIC_RSN_COUNT
} panic_reasons; } panic_reasons_t;

Wyświetl plik

@ -48,7 +48,6 @@ enum {
CFG_TUD_HID * TUD_HID_DESC_LEN CFG_TUD_HID * TUD_HID_DESC_LEN
}; };
bool tusb_desc_set;
void tusb_set_descriptor(tusb_desc_device_t *desc, const char **str_desc); void tusb_set_descriptor(tusb_desc_device_t *desc, const char **str_desc);
tusb_desc_device_t *tusb_get_active_desc(void); tusb_desc_device_t *tusb_get_active_desc(void);
char **tusb_get_active_str_desc(void); char **tusb_get_active_str_desc(void);

Wyświetl plik

@ -171,7 +171,6 @@ void tusb_set_descriptor(tusb_desc_device_t *dev_desc, const char **str_desc)
memcpy(s_str_descriptor, str_desc, memcpy(s_str_descriptor, str_desc,
sizeof(s_str_descriptor[0])*USB_STRING_DESCRIPTOR_ARRAY_SIZE); sizeof(s_str_descriptor[0])*USB_STRING_DESCRIPTOR_ARRAY_SIZE);
} }
tusb_desc_set = true;
} }
tusb_desc_device_t *tusb_get_active_desc(void) tusb_desc_device_t *tusb_get_active_desc(void)
@ -188,5 +187,4 @@ void tusb_clear_descriptor(void)
{ {
memset(&s_descriptor, 0, sizeof(s_descriptor)); memset(&s_descriptor, 0, sizeof(s_descriptor));
memset(&s_str_descriptor, 0, sizeof(s_str_descriptor)); memset(&s_str_descriptor, 0, sizeof(s_str_descriptor));
tusb_desc_set = false;
} }

Wyświetl plik

@ -21,7 +21,7 @@ extern "C" {
// ---------------------------------------------------- MSC SCSI ------------------------------------------------------- // ---------------------------------------------------- MSC SCSI -------------------------------------------------------
const char *MSC_CLIENT_TAG; extern const char *MSC_CLIENT_TAG;
/* /*
Note: The mock MSC SCSI tests requires that USB flash drive be connected. The flash drive should... Note: The mock MSC SCSI tests requires that USB flash drive be connected. The flash drive should...

Wyświetl plik

@ -1,16 +1,8 @@
// Copyright 2019 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// You may obtain a copy of the License at */
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef __ESP_WPA_H__ #ifndef __ESP_WPA_H__
#define __ESP_WPA_H__ #define __ESP_WPA_H__
@ -42,9 +34,10 @@ extern "C" {
* @{ * @{
*/ */
/* Crypto callback functions */ /* Crypto callback functions */
const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; // NOLINT(readability-redundant-declaration)
/* Mesh crypto callback functions */ /* Mesh crypto callback functions */
const mesh_crypto_funcs_t g_wifi_default_mesh_crypto_funcs; extern const mesh_crypto_funcs_t g_wifi_default_mesh_crypto_funcs;
/** /**
* @brief Supplicant initialization * @brief Supplicant initialization

Wyświetl plik

@ -173,7 +173,7 @@ struct scan_info {
int nl_scan_event; int nl_scan_event;
u64 scan_start_tsf; u64 scan_start_tsf;
u8 scan_start_tsf_bssid[ETH_ALEN]; u8 scan_start_tsf_bssid[ETH_ALEN];
} scan_info; };
struct wpa_bss_trans_info { struct wpa_bss_trans_info {
u8 mbo_transition_reason; u8 mbo_transition_reason;

Wyświetl plik

@ -42,6 +42,27 @@
#include "supplicant_opt.h" #include "supplicant_opt.h"
u8 *g_wpa_anonymous_identity;
int g_wpa_anonymous_identity_len;
u8 *g_wpa_username;
int g_wpa_username_len;
const u8 *g_wpa_client_cert;
int g_wpa_client_cert_len;
const u8 *g_wpa_private_key;
int g_wpa_private_key_len;
const u8 *g_wpa_private_key_passwd;
int g_wpa_private_key_passwd_len;
const u8 *g_wpa_ca_cert;
int g_wpa_ca_cert_len;
u8 *g_wpa_password;
int g_wpa_password_len;
u8 *g_wpa_new_password;
int g_wpa_new_password_len;
char *g_wpa_ttls_phase2_type;
char *g_wpa_phase1_options;
u8 *g_wpa_pac_file;
int g_wpa_pac_file_len;
bool g_wpa_suiteb_certification;
void eap_peer_config_deinit(struct eap_sm *sm); void eap_peer_config_deinit(struct eap_sm *sm);
void eap_peer_blob_deinit(struct eap_sm *sm); void eap_peer_blob_deinit(struct eap_sm *sm);

Wyświetl plik

@ -19,33 +19,33 @@ struct eap_method_type {
EapType method; EapType method;
}; };
u8 *g_wpa_anonymous_identity; extern u8 *g_wpa_anonymous_identity;
int g_wpa_anonymous_identity_len; extern int g_wpa_anonymous_identity_len;
u8 *g_wpa_username; extern u8 *g_wpa_username;
int g_wpa_username_len; extern int g_wpa_username_len;
const u8 *g_wpa_client_cert; extern const u8 *g_wpa_client_cert;
int g_wpa_client_cert_len; extern int g_wpa_client_cert_len;
const u8 *g_wpa_private_key; extern const u8 *g_wpa_private_key;
int g_wpa_private_key_len; extern int g_wpa_private_key_len;
const u8 *g_wpa_private_key_passwd; extern const u8 *g_wpa_private_key_passwd;
int g_wpa_private_key_passwd_len; extern int g_wpa_private_key_passwd_len;
const u8 *g_wpa_ca_cert; extern const u8 *g_wpa_ca_cert;
int g_wpa_ca_cert_len; extern int g_wpa_ca_cert_len;
u8 *g_wpa_password; extern u8 *g_wpa_password;
int g_wpa_password_len; extern int g_wpa_password_len;
u8 *g_wpa_new_password; extern u8 *g_wpa_new_password;
int g_wpa_new_password_len; extern int g_wpa_new_password_len;
char *g_wpa_ttls_phase2_type; extern char *g_wpa_ttls_phase2_type;
char *g_wpa_phase1_options; extern char *g_wpa_phase1_options;
u8 *g_wpa_pac_file; extern u8 *g_wpa_pac_file;
int g_wpa_pac_file_len; extern int g_wpa_pac_file_len;
bool g_wpa_suiteb_certification; extern bool g_wpa_suiteb_certification;
const u8 * eap_get_eapKeyData(struct eap_sm *sm, size_t *len); const u8 * eap_get_eapKeyData(struct eap_sm *sm, size_t *len);
void eap_deinit_prev_method(struct eap_sm *sm, const char *txt); void eap_deinit_prev_method(struct eap_sm *sm, const char *txt);

Wyświetl plik

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Unlicense OR CC0-1.0 * SPDX-License-Identifier: Unlicense OR CC0-1.0
*/ */
@ -11,7 +11,7 @@
#include "esp_hf_ag_api.h" #include "esp_hf_ag_api.h"
#include "esp_bt_defs.h" #include "esp_bt_defs.h"
esp_bd_addr_t hf_peer_addr; // Declaration of peer device bdaddr extern esp_bd_addr_t hf_peer_addr; // Declaration of peer device bdaddr
#define BT_HF_TAG "BT_APP_HF" #define BT_HF_TAG "BT_APP_HF"

Wyświetl plik

@ -1,7 +1,7 @@
/* /*
* ESP BLE Mesh Example * ESP BLE Mesh Example
* *
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Unlicense OR CC0-1.0 * SPDX-License-Identifier: Unlicense OR CC0-1.0
*/ */
@ -86,7 +86,7 @@ typedef struct {
uint8_t case_id; uint8_t case_id;
const uint16_t excpet_param_bit; const uint16_t excpet_param_bit;
} auto_tc; } auto_tc;
auto_tc auto_tb[6]; extern auto_tc auto_tb[6];
typedef enum { typedef enum {
@ -113,7 +113,7 @@ struct sync_t {
esp_timer_handle_t sync_timer; esp_timer_handle_t sync_timer;
sync_recv cmd_recv; sync_recv cmd_recv;
}; };
struct sync_t sync_obj; extern struct sync_t sync_obj;
extern SemaphoreHandle_t client_mutex; extern SemaphoreHandle_t client_mutex;
void sync_init(void); void sync_init(void);

Wyświetl plik

@ -7,6 +7,9 @@
#include "esp_ble_mesh_networking_api.h" #include "esp_ble_mesh_networking_api.h"
#include "ble_mesh_adapter.h" #include "ble_mesh_adapter.h"
ble_mesh_performance_statistics_t test_perf_statistics;
ble_mesh_node_statistics_t ble_mesh_node_statistics;
esp_ble_mesh_model_t *ble_mesh_get_model(uint16_t model_id) esp_ble_mesh_model_t *ble_mesh_get_model(uint16_t model_id)
{ {
esp_ble_mesh_model_t *model = NULL; esp_ble_mesh_model_t *model = NULL;

Wyświetl plik

@ -53,7 +53,7 @@ typedef struct {
uint16_t *package_index; uint16_t *package_index;
uint8_t ttl; uint8_t ttl;
} ble_mesh_performance_statistics_t; } ble_mesh_performance_statistics_t;
ble_mesh_performance_statistics_t test_perf_statistics; extern ble_mesh_performance_statistics_t test_perf_statistics;
typedef struct { typedef struct {
uint32_t statistics; uint32_t statistics;
@ -61,7 +61,7 @@ typedef struct {
uint16_t *package_index; uint16_t *package_index;
uint32_t total_package_num; uint32_t total_package_num;
} ble_mesh_node_statistics_t; } ble_mesh_node_statistics_t;
ble_mesh_node_statistics_t ble_mesh_node_statistics; extern ble_mesh_node_statistics_t ble_mesh_node_statistics;
extern SemaphoreHandle_t ble_mesh_node_sema; extern SemaphoreHandle_t ble_mesh_node_sema;

Wyświetl plik

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2017-2022 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -8,6 +8,7 @@
#include "esp_ble_mesh_generic_model_api.h" #include "esp_ble_mesh_generic_model_api.h"
uint8_t dev_uuid[16] = {0xdd, 0xdd}; uint8_t dev_uuid[16] = {0xdd, 0xdd};
ble_mesh_node_config_params ble_mesh_node_prestore_params[NODE_MAX_GROUP_CONFIG];
esp_ble_mesh_prov_t prov = { esp_ble_mesh_prov_t prov = {
#if CONFIG_BLE_MESH_NODE #if CONFIG_BLE_MESH_NODE
@ -66,6 +67,8 @@ esp_ble_mesh_comp_t config_server_comp = {
}; };
// config client model // config client model
esp_ble_mesh_client_t cfg_cli;
esp_ble_mesh_model_t config_client_models[] = { esp_ble_mesh_model_t config_client_models[] = {
ESP_BLE_MESH_MODEL_CFG_SRV(&cfg_srv), ESP_BLE_MESH_MODEL_CFG_SRV(&cfg_srv),
ESP_BLE_MESH_MODEL_CFG_CLI(&cfg_cli), ESP_BLE_MESH_MODEL_CFG_CLI(&cfg_cli),

Wyświetl plik

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2017-2022 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -23,7 +23,7 @@ typedef struct {
uint16_t net_idx; uint16_t net_idx;
uint16_t unicast_addr; uint16_t unicast_addr;
} ble_mesh_node_config_params; } ble_mesh_node_config_params;
ble_mesh_node_config_params ble_mesh_node_prestore_params[NODE_MAX_GROUP_CONFIG]; extern ble_mesh_node_config_params ble_mesh_node_prestore_params[NODE_MAX_GROUP_CONFIG];
extern esp_ble_mesh_prov_t prov; extern esp_ble_mesh_prov_t prov;
@ -39,7 +39,7 @@ extern esp_ble_mesh_elem_t config_server_elements[];
extern esp_ble_mesh_comp_t config_server_comp; extern esp_ble_mesh_comp_t config_server_comp;
// config client model // config client model
esp_ble_mesh_client_t cfg_cli; extern esp_ble_mesh_client_t cfg_cli;
extern esp_ble_mesh_model_t config_client_models[]; extern esp_ble_mesh_model_t config_client_models[];
extern esp_ble_mesh_elem_t config_client_elements[]; extern esp_ble_mesh_elem_t config_client_elements[];

Wyświetl plik

@ -1,16 +1,8 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// You may obtain a copy of the License at */
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "bluedroid_gatts.h" #include "bluedroid_gatts.h"
#include "esp_log.h" #include "esp_log.h"
@ -19,6 +11,7 @@
#if CONFIG_BT_BLE_ENABLED #if CONFIG_BT_BLE_ENABLED
static const char *TAG = "bluedroid_gatts"; static const char *TAG = "bluedroid_gatts";
static prepare_type_env_t a_prepare_write_env;
uint8_t adv_service_uuid128[32] = { uint8_t adv_service_uuid128[32] = {
/* LSB <--------------------------------------------------------------------------------> MSB */ /* LSB <--------------------------------------------------------------------------------> MSB */

Wyświetl plik

@ -1,16 +1,8 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// You may obtain a copy of the License at */
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef H_BLUEDROID_GATTS_ #ifndef H_BLUEDROID_GATTS_
#define H_BLUEDROID_GATTS_ #define H_BLUEDROID_GATTS_
@ -68,8 +60,6 @@ typedef struct {
int prepare_len; int prepare_len;
} prepare_type_env_t; } prepare_type_env_t;
prepare_type_env_t a_prepare_write_env;
void gatts_profile_a_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param); void gatts_profile_a_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param);
void example_write_event_env(esp_gatt_if_t gatts_if, prepare_type_env_t *prepare_write_env, esp_ble_gatts_cb_param_t *param); void example_write_event_env(esp_gatt_if_t gatts_if, prepare_type_env_t *prepare_write_env, esp_ble_gatts_cb_param_t *param);

Wyświetl plik

@ -1,16 +1,8 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// You may obtain a copy of the License at */
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef H_NIMBLE_GATTS_ #ifndef H_NIMBLE_GATTS_
#define H_NIMBLE_GATTS_ #define H_NIMBLE_GATTS_
@ -37,7 +29,6 @@ struct ble_hs_cfg;
struct ble_gatt_register_ctxt; struct ble_gatt_register_ctxt;
int bleprph_gap_event(struct ble_gap_event *event, void *arg); int bleprph_gap_event(struct ble_gap_event *event, void *arg);
uint8_t own_addr_type;
/** GATT server. */ /** GATT server. */
#define GATT_SVR_SVC_ALERT_UUID 0x1811 #define GATT_SVR_SVC_ALERT_UUID 0x1811

Wyświetl plik

@ -1,16 +1,8 @@
// Copyright 2021 Espressif Systems (Shanghai) PTE LTD /*
// * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
// Licensed under the Apache License, Version 2.0 (the "License"); *
// you may not use this file except in compliance with the License. * SPDX-License-Identifier: Apache-2.0
// You may obtain a copy of the License at */
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "sdkconfig.h" #include "sdkconfig.h"
@ -21,6 +13,7 @@
#include "services/gatt/ble_svc_gatt.h" #include "services/gatt/ble_svc_gatt.h"
static const char *TAG = "nimble_gatts"; static const char *TAG = "nimble_gatts";
static uint8_t own_addr_type;
static const ble_uuid128_t gatt_svr_svc_sec_test_uuid = static const ble_uuid128_t gatt_svr_svc_sec_test_uuid =
BLE_UUID128_INIT(0x2d, 0x71, 0xa2, 0x59, 0xb4, 0x58, 0xc8, 0x12, BLE_UUID128_INIT(0x2d, 0x71, 0xa2, 0x59, 0xb4, 0x58, 0xc8, 0x12,

Wyświetl plik

@ -66,19 +66,19 @@ static int s_retry_num = 0;
static const char *TAG_STA = "ftm_station"; static const char *TAG_STA = "ftm_station";
static const char *TAG_AP = "ftm_ap"; static const char *TAG_AP = "ftm_ap";
static EventGroupHandle_t wifi_event_group; static EventGroupHandle_t s_wifi_event_group;
const int CONNECTED_BIT = BIT0; static const int CONNECTED_BIT = BIT0;
const int DISCONNECTED_BIT = BIT1; static const int DISCONNECTED_BIT = BIT1;
static EventGroupHandle_t ftm_event_group; static EventGroupHandle_t s_ftm_event_group;
const int FTM_REPORT_BIT = BIT0; static const int FTM_REPORT_BIT = BIT0;
const int FTM_FAILURE_BIT = BIT1; static const int FTM_FAILURE_BIT = BIT1;
wifi_ftm_report_entry_t *g_ftm_report; static wifi_ftm_report_entry_t *s_ftm_report;
uint8_t g_ftm_report_num_entries; static uint8_t s_ftm_report_num_entries;
static uint32_t g_rtt_est, g_dist_est; static uint32_t s_rtt_est, s_dist_est;
bool g_ap_started; static bool s_ap_started;
uint8_t g_ap_channel; static uint8_t s_ap_channel;
uint8_t g_ap_bssid[ETH_ALEN]; static uint8_t s_ap_bssid[ETH_ALEN];
const int g_report_lvl = const int g_report_lvl =
#ifdef CONFIG_ESP_FTM_REPORT_SHOW_DIAG #ifdef CONFIG_ESP_FTM_REPORT_SHOW_DIAG
@ -107,10 +107,10 @@ static void event_handler(void *arg, esp_event_base_t event_base,
ESP_LOGI(TAG_STA, "Connected to %s (BSSID: "MACSTR", Channel: %d)", event->ssid, ESP_LOGI(TAG_STA, "Connected to %s (BSSID: "MACSTR", Channel: %d)", event->ssid,
MAC2STR(event->bssid), event->channel); MAC2STR(event->bssid), event->channel);
memcpy(g_ap_bssid, event->bssid, ETH_ALEN); memcpy(s_ap_bssid, event->bssid, ETH_ALEN);
g_ap_channel = event->channel; s_ap_channel = event->channel;
xEventGroupClearBits(wifi_event_group, DISCONNECTED_BIT); xEventGroupClearBits(s_wifi_event_group, DISCONNECTED_BIT);
xEventGroupSetBits(wifi_event_group, CONNECTED_BIT); xEventGroupSetBits(s_wifi_event_group, CONNECTED_BIT);
} else if (event_id == WIFI_EVENT_STA_DISCONNECTED) { } else if (event_id == WIFI_EVENT_STA_DISCONNECTED) {
if (s_reconnect && ++s_retry_num < MAX_CONNECT_RETRY_ATTEMPTS) { if (s_reconnect && ++s_retry_num < MAX_CONNECT_RETRY_ATTEMPTS) {
ESP_LOGI(TAG_STA, "sta disconnect, retry attempt %d...", s_retry_num); ESP_LOGI(TAG_STA, "sta disconnect, retry attempt %d...", s_retry_num);
@ -118,26 +118,26 @@ static void event_handler(void *arg, esp_event_base_t event_base,
} else { } else {
ESP_LOGI(TAG_STA, "sta disconnected"); ESP_LOGI(TAG_STA, "sta disconnected");
} }
xEventGroupClearBits(wifi_event_group, CONNECTED_BIT); xEventGroupClearBits(s_wifi_event_group, CONNECTED_BIT);
xEventGroupSetBits(wifi_event_group, DISCONNECTED_BIT); xEventGroupSetBits(s_wifi_event_group, DISCONNECTED_BIT);
} else if (event_id == WIFI_EVENT_FTM_REPORT) { } else if (event_id == WIFI_EVENT_FTM_REPORT) {
wifi_event_ftm_report_t *event = (wifi_event_ftm_report_t *) event_data; wifi_event_ftm_report_t *event = (wifi_event_ftm_report_t *) event_data;
if (event->status == FTM_STATUS_SUCCESS) { if (event->status == FTM_STATUS_SUCCESS) {
g_rtt_est = event->rtt_est; s_rtt_est = event->rtt_est;
g_dist_est = event->dist_est; s_dist_est = event->dist_est;
g_ftm_report = event->ftm_report_data; s_ftm_report = event->ftm_report_data;
g_ftm_report_num_entries = event->ftm_report_num_entries; s_ftm_report_num_entries = event->ftm_report_num_entries;
xEventGroupSetBits(ftm_event_group, FTM_REPORT_BIT); xEventGroupSetBits(s_ftm_event_group, FTM_REPORT_BIT);
} else { } else {
ESP_LOGI(TAG_STA, "FTM procedure with Peer("MACSTR") failed! (Status - %d)", ESP_LOGI(TAG_STA, "FTM procedure with Peer("MACSTR") failed! (Status - %d)",
MAC2STR(event->peer_mac), event->status); MAC2STR(event->peer_mac), event->status);
xEventGroupSetBits(ftm_event_group, FTM_FAILURE_BIT); xEventGroupSetBits(s_ftm_event_group, FTM_FAILURE_BIT);
} }
} else if (event_id == WIFI_EVENT_AP_START) { } else if (event_id == WIFI_EVENT_AP_START) {
g_ap_started = true; s_ap_started = true;
} else if (event_id == WIFI_EVENT_AP_STOP) { } else if (event_id == WIFI_EVENT_AP_STOP) {
g_ap_started = false; s_ap_started = false;
} }
} }
@ -160,22 +160,22 @@ static void ftm_process_report(void)
g_report_lvl & BIT3 ? " RSSI |":""); g_report_lvl & BIT3 ? " RSSI |":"");
ESP_LOGI(TAG_STA, "FTM Report:"); ESP_LOGI(TAG_STA, "FTM Report:");
ESP_LOGI(TAG_STA, "|%s", log); ESP_LOGI(TAG_STA, "|%s", log);
for (i = 0; i < g_ftm_report_num_entries; i++) { for (i = 0; i < s_ftm_report_num_entries; i++) {
char *log_ptr = log; char *log_ptr = log;
bzero(log, 200); bzero(log, 200);
if (g_report_lvl & BIT0) { if (g_report_lvl & BIT0) {
log_ptr += sprintf(log_ptr, "%6d|", g_ftm_report[i].dlog_token); log_ptr += sprintf(log_ptr, "%6d|", s_ftm_report[i].dlog_token);
} }
if (g_report_lvl & BIT1) { if (g_report_lvl & BIT1) {
log_ptr += sprintf(log_ptr, "%7u |", g_ftm_report[i].rtt); log_ptr += sprintf(log_ptr, "%7u |", s_ftm_report[i].rtt);
} }
if (g_report_lvl & BIT2) { if (g_report_lvl & BIT2) {
log_ptr += sprintf(log_ptr, "%14llu |%14llu |%14llu |%14llu |", g_ftm_report[i].t1, log_ptr += sprintf(log_ptr, "%14llu |%14llu |%14llu |%14llu |", s_ftm_report[i].t1,
g_ftm_report[i].t2, g_ftm_report[i].t3, g_ftm_report[i].t4); s_ftm_report[i].t2, s_ftm_report[i].t3, s_ftm_report[i].t4);
} }
if (g_report_lvl & BIT3) { if (g_report_lvl & BIT3) {
log_ptr += sprintf(log_ptr, "%6d |", g_ftm_report[i].rssi); log_ptr += sprintf(log_ptr, "%6d |", s_ftm_report[i].rssi);
} }
ESP_LOGI(TAG_STA, "|%s", log); ESP_LOGI(TAG_STA, "|%s", log);
} }
@ -192,8 +192,8 @@ void initialise_wifi(void)
} }
ESP_ERROR_CHECK(esp_netif_init()); ESP_ERROR_CHECK(esp_netif_init());
wifi_event_group = xEventGroupCreate(); s_wifi_event_group = xEventGroupCreate();
ftm_event_group = xEventGroupCreate(); s_ftm_event_group = xEventGroupCreate();
ESP_ERROR_CHECK( esp_event_loop_create_default() ); ESP_ERROR_CHECK( esp_event_loop_create_default() );
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg)); ESP_ERROR_CHECK(esp_wifi_init(&cfg));
@ -213,7 +213,7 @@ void initialise_wifi(void)
static bool wifi_cmd_sta_join(const char *ssid, const char *pass) static bool wifi_cmd_sta_join(const char *ssid, const char *pass)
{ {
int bits = xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, 0, 1, 0); int bits = xEventGroupWaitBits(s_wifi_event_group, CONNECTED_BIT, 0, 1, 0);
wifi_config_t wifi_config = { 0 }; wifi_config_t wifi_config = { 0 };
@ -224,9 +224,9 @@ static bool wifi_cmd_sta_join(const char *ssid, const char *pass)
if (bits & CONNECTED_BIT) { if (bits & CONNECTED_BIT) {
s_reconnect = false; s_reconnect = false;
xEventGroupClearBits(wifi_event_group, CONNECTED_BIT); xEventGroupClearBits(s_wifi_event_group, CONNECTED_BIT);
ESP_ERROR_CHECK( esp_wifi_disconnect() ); ESP_ERROR_CHECK( esp_wifi_disconnect() );
xEventGroupWaitBits(wifi_event_group, DISCONNECTED_BIT, 0, 1, portTICK_RATE_MS); xEventGroupWaitBits(s_wifi_event_group, DISCONNECTED_BIT, 0, 1, portTICK_RATE_MS);
} }
s_reconnect = true; s_reconnect = true;
@ -235,7 +235,7 @@ static bool wifi_cmd_sta_join(const char *ssid, const char *pass)
ESP_ERROR_CHECK( esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); ESP_ERROR_CHECK( esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) );
ESP_ERROR_CHECK( esp_wifi_connect() ); ESP_ERROR_CHECK( esp_wifi_connect() );
xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, 0, 1, 5000 / portTICK_RATE_MS); xEventGroupWaitBits(s_wifi_event_group, CONNECTED_BIT, 0, 1, 5000 / portTICK_RATE_MS);
return true; return true;
} }
@ -362,7 +362,7 @@ static int wifi_cmd_query(int argc, char **argv)
esp_wifi_get_config(WIFI_IF_AP, &cfg); esp_wifi_get_config(WIFI_IF_AP, &cfg);
ESP_LOGI(TAG_AP, "AP mode, %s %s", cfg.ap.ssid, cfg.ap.password); ESP_LOGI(TAG_AP, "AP mode, %s %s", cfg.ap.ssid, cfg.ap.password);
} else if (WIFI_MODE_STA == mode) { } else if (WIFI_MODE_STA == mode) {
int bits = xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, 0, 1, 0); int bits = xEventGroupWaitBits(s_wifi_event_group, CONNECTED_BIT, 0, 1, 0);
if (bits & CONNECTED_BIT) { if (bits & CONNECTED_BIT) {
esp_wifi_get_config(WIFI_IF_STA, &cfg); esp_wifi_get_config(WIFI_IF_STA, &cfg);
ESP_LOGI(TAG_STA, "sta mode, connected %s", cfg.ap.ssid); ESP_LOGI(TAG_STA, "sta mode, connected %s", cfg.ap.ssid);
@ -436,10 +436,10 @@ static int wifi_cmd_ftm(int argc, char **argv)
if (ftm_args.responder->count != 0) if (ftm_args.responder->count != 0)
goto ftm_responder; goto ftm_responder;
bits = xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, 0, 1, 0); bits = xEventGroupWaitBits(s_wifi_event_group, CONNECTED_BIT, 0, 1, 0);
if (bits & CONNECTED_BIT && !ftm_args.ssid->count) { if (bits & CONNECTED_BIT && !ftm_args.ssid->count) {
memcpy(ftmi_cfg.resp_mac, g_ap_bssid, ETH_ALEN); memcpy(ftmi_cfg.resp_mac, s_ap_bssid, ETH_ALEN);
ftmi_cfg.channel = g_ap_channel; ftmi_cfg.channel = s_ap_channel;
} else if (ftm_args.ssid->count == 1) { } else if (ftm_args.ssid->count == 1) {
ap_record = find_ftm_responder_ap(ftm_args.ssid->sval[0]); ap_record = find_ftm_responder_ap(ftm_args.ssid->sval[0]);
if (ap_record) { if (ap_record) {
@ -481,16 +481,16 @@ static int wifi_cmd_ftm(int argc, char **argv)
return 0; return 0;
} }
bits = xEventGroupWaitBits(ftm_event_group, FTM_REPORT_BIT | FTM_FAILURE_BIT, bits = xEventGroupWaitBits(s_ftm_event_group, FTM_REPORT_BIT | FTM_FAILURE_BIT,
pdTRUE, pdFALSE, portMAX_DELAY); pdTRUE, pdFALSE, portMAX_DELAY);
/* Processing data from FTM session */ /* Processing data from FTM session */
if (bits & FTM_REPORT_BIT) { if (bits & FTM_REPORT_BIT) {
ftm_process_report(); ftm_process_report();
free(g_ftm_report); free(s_ftm_report);
g_ftm_report = NULL; s_ftm_report = NULL;
g_ftm_report_num_entries = 0; 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 - %d nSec, Estimated Distance - %d.%02d meters",
g_rtt_est, g_dist_est / 100, g_dist_est % 100); s_rtt_est, s_dist_est / 100, s_dist_est % 100);
} else { } else {
/* Failure case */ /* Failure case */
} }
@ -505,7 +505,7 @@ ftm_responder:
} }
if (ftm_args.enable->count != 0) { if (ftm_args.enable->count != 0) {
if (!g_ap_started) { if (!s_ap_started) {
ESP_LOGE(TAG_AP, "Start the SoftAP first with 'ap' command"); ESP_LOGE(TAG_AP, "Start the SoftAP first with 'ap' command");
return 0; return 0;
} }
@ -517,7 +517,7 @@ ftm_responder:
} }
if (ftm_args.disable->count != 0) { if (ftm_args.disable->count != 0) {
if (!g_ap_started) { if (!s_ap_started) {
ESP_LOGE(TAG_AP, "Start the SoftAP first with 'ap' command"); ESP_LOGE(TAG_AP, "Start the SoftAP first with 'ap' command");
return 0; return 0;
} }

Wyświetl plik

@ -859,7 +859,6 @@ components/fatfs/src/ffconf.h
components/fatfs/src/ffsystem.c components/fatfs/src/ffsystem.c
components/fatfs/src/ffunicode.c components/fatfs/src/ffunicode.c
components/fatfs/test/test_fatfs_common.c components/fatfs/test/test_fatfs_common.c
components/fatfs/test/test_fatfs_common.h
components/fatfs/test/test_fatfs_rawflash.c components/fatfs/test/test_fatfs_rawflash.c
components/fatfs/test/test_fatfs_spiflash.c components/fatfs/test/test_fatfs_spiflash.c
components/fatfs/test_fatfs_host/main.cpp components/fatfs/test_fatfs_host/main.cpp
@ -1509,7 +1508,6 @@ components/pthread/test/test_pthread.c
components/pthread/test/test_pthread_cond_var.c components/pthread/test/test_pthread_cond_var.c
components/pthread/test/test_pthread_cxx.cpp components/pthread/test/test_pthread_cxx.cpp
components/pthread/test/test_pthread_local_storage.c components/pthread/test/test_pthread_local_storage.c
components/riscv/include/esp_private/panic_reason.h
components/riscv/include/riscv/csr.h components/riscv/include/riscv/csr.h
components/riscv/include/riscv/encoding.h components/riscv/include/riscv/encoding.h
components/riscv/include/riscv/instruction_decode.h components/riscv/include/riscv/instruction_decode.h
@ -2111,7 +2109,6 @@ components/wifi_provisioning/src/wifi_provisioning_priv.h
components/wifi_provisioning/src/wifi_scan.c components/wifi_provisioning/src/wifi_scan.c
components/wpa_supplicant/esp_supplicant/include/esp_dpp.h components/wpa_supplicant/esp_supplicant/include/esp_dpp.h
components/wpa_supplicant/esp_supplicant/include/esp_rrm.h components/wpa_supplicant/esp_supplicant/include/esp_rrm.h
components/wpa_supplicant/esp_supplicant/include/esp_wpa.h
components/wpa_supplicant/esp_supplicant/include/esp_wps.h components/wpa_supplicant/esp_supplicant/include/esp_wps.h
components/wpa_supplicant/esp_supplicant/src/esp_dpp_i.h components/wpa_supplicant/esp_supplicant/src/esp_dpp_i.h
components/wpa_supplicant/esp_supplicant/src/esp_scan_i.h components/wpa_supplicant/esp_supplicant/src/esp_scan_i.h
@ -2789,11 +2786,7 @@ examples/system/light_sleep/main/light_sleep_example_main.c
examples/system/ota/advanced_https_ota/example_test.py examples/system/ota/advanced_https_ota/example_test.py
examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c
examples/system/ota/advanced_https_ota/main/ble_helper/ble_api.c examples/system/ota/advanced_https_ota/main/ble_helper/ble_api.c
examples/system/ota/advanced_https_ota/main/ble_helper/bluedroid_gatts.c
examples/system/ota/advanced_https_ota/main/ble_helper/include/ble_api.h examples/system/ota/advanced_https_ota/main/ble_helper/include/ble_api.h
examples/system/ota/advanced_https_ota/main/ble_helper/include/bluedroid_gatts.h
examples/system/ota/advanced_https_ota/main/ble_helper/include/nimble_gatts.h
examples/system/ota/advanced_https_ota/main/ble_helper/nimble_gatts.c
examples/system/ota/native_ota_example/example_test.py examples/system/ota/native_ota_example/example_test.py
examples/system/ota/native_ota_example/main/native_ota_example.c examples/system/ota/native_ota_example/main/native_ota_example.c
examples/system/ota/otatool/example_test.py examples/system/ota/otatool/example_test.py