diff --git a/components/bt/CMakeLists.txt b/components/bt/CMakeLists.txt index 5c19866e8d..57bba0b881 100644 --- a/components/bt/CMakeLists.txt +++ b/components/bt/CMakeLists.txt @@ -673,6 +673,13 @@ if(CONFIG_BT_ENABLED) target_link_libraries(${COMPONENT_LIB} PRIVATE nimblelib) endif() + + set_source_files_properties( + "host/bluedroid/bta/gatt/bta_gattc_act.c" + "host/bluedroid/bta/gatt/bta_gattc_cache.c" + "host/bluedroid/btc/profile/std/gatt/btc_gatt_util.c" + "host/bluedroid/btc/profile/std/gatt/btc_gatts.c" + PROPERTIES COMPILE_FLAGS -Wno-address-of-packed-member) endif() if(CONFIG_BT_NIMBLE_MESH) diff --git a/components/bt/esp_ble_mesh/mesh_core/crypto.h b/components/bt/esp_ble_mesh/mesh_core/crypto.h index e8b3450728..f07ce2e638 100644 --- a/components/bt/esp_ble_mesh/mesh_core/crypto.h +++ b/components/bt/esp_ble_mesh/mesh_core/crypto.h @@ -77,7 +77,7 @@ static inline int bt_mesh_beacon_key(const uint8_t net_key[16], } int bt_mesh_beacon_auth(const uint8_t beacon_key[16], uint8_t flags, - const uint8_t net_id[16], uint32_t iv_index, + const uint8_t net_id[8], uint32_t iv_index, uint8_t auth[8]); static inline int bt_mesh_app_id(const uint8_t app_key[16], uint8_t app_id[1]) diff --git a/components/bt/host/bluedroid/bta/dm/bta_dm_act.c b/components/bt/host/bluedroid/bta/dm/bta_dm_act.c index ceddfded1f..598d4d596d 100644 --- a/components/bt/host/bluedroid/bta/dm/bta_dm_act.c +++ b/components/bt/host/bluedroid/bta/dm/bta_dm_act.c @@ -66,7 +66,7 @@ static UINT8 bta_dm_pin_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_ static UINT8 bta_dm_new_link_key_cback(BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, LINK_KEY key, UINT8 key_type, BOOLEAN sc_support); static UINT8 bta_dm_authentication_complete_cback(BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, int result); #endif ///SMP_INCLUDED == TRUE -static void bta_dm_local_name_cback(BD_ADDR bd_addr); +static void bta_dm_local_name_cback(const BD_ADDR bd_addr); static BOOLEAN bta_dm_check_av(UINT16 event); static void bta_dm_bl_change_cback (tBTM_BL_EVENT_DATA *p_data); @@ -3265,10 +3265,10 @@ static UINT8 bta_dm_sp_cback (tBTM_SP_EVT event, tBTM_SP_EVT_DATA *p_data) ** Returns void ** *******************************************************************************/ -static void bta_dm_local_name_cback(UINT8 *p_name) +static void bta_dm_local_name_cback(const BD_ADDR bd_addr) { tBTA_DM_SEC sec_event; - UNUSED(p_name); + UNUSED(bd_addr); sec_event.enable.status = BTA_SUCCESS; diff --git a/components/bt/host/bluedroid/bta/hf_ag/bta_ag_cmd.c b/components/bt/host/bluedroid/bta/hf_ag/bta_ag_cmd.c index 24ef3656b7..a7bc33cb23 100644 --- a/components/bt/host/bluedroid/bta/hf_ag/bta_ag_cmd.c +++ b/components/bt/host/bluedroid/bta/hf_ag/bta_ag_cmd.c @@ -612,7 +612,7 @@ static UINT8 bta_ag_parse_chld(tBTA_AG_SCB *p_scb, char *p_s) INT16 idx = -1; UNUSED(p_scb); - if (!isdigit(p_s[0])) { + if (!isdigit((unsigned char)p_s[0])) { return BTA_AG_INVALID_CHLD; } diff --git a/components/bt/host/bluedroid/stack/btm/btm_acl.c b/components/bt/host/bluedroid/stack/btm/btm_acl.c index 1dce5c3550..1fe596ada3 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_acl.c +++ b/components/bt/host/bluedroid/stack/btm/btm_acl.c @@ -237,7 +237,7 @@ BOOLEAN btm_ble_get_acl_remote_addr(tBTM_SEC_DEV_REC *p_dev_rec, BD_ADDR conn_ad ** Returns void ** *******************************************************************************/ -void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, BD_NAME bdn, +void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, UINT8 bdn[BTM_MAX_REM_BD_NAME_LEN], UINT16 hci_handle, UINT8 link_role, tBT_TRANSPORT transport) { tBTM_SEC_DEV_REC *p_dev_rec = NULL; diff --git a/components/bt/host/bluedroid/stack/btm/btm_ble.c b/components/bt/host/bluedroid/stack/btm/btm_ble.c index a207fad77c..6cac0fd793 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_ble.c +++ b/components/bt/host/bluedroid/stack/btm/btm_ble.c @@ -1557,7 +1557,7 @@ void btm_ble_ltk_request(UINT16 handle, UINT8 rand[8], UINT16 ediv) { tBTM_CB *p_cb = &btm_cb; tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev_by_handle (handle); - BT_OCTET8 dummy_stk = {0}; + BT_OCTET16 dummy_stk = {0}; BTM_TRACE_DEBUG ("btm_ble_ltk_request"); diff --git a/components/bt/host/bluedroid/stack/btm/btm_devctl.c b/components/bt/host/bluedroid/stack/btm/btm_devctl.c index 04af26e926..e75535a931 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_devctl.c +++ b/components/bt/host/bluedroid/stack/btm/btm_devctl.c @@ -266,7 +266,7 @@ void btm_dev_timeout (TIMER_LIST_ENT *p_tle) ** Returns void ** *******************************************************************************/ -static void btm_decode_ext_features_page (UINT8 page_number, const UINT8 *p_features) +static void btm_decode_ext_features_page (UINT8 page_number, const BD_FEATURES p_features) { BTM_TRACE_DEBUG ("btm_decode_ext_features_page page: %d", page_number); switch (page_number) { diff --git a/components/bt/host/bluedroid/stack/btm/include/btm_int.h b/components/bt/host/bluedroid/stack/btm/include/btm_int.h index d1498a38a2..3cc0bbfd5a 100644 --- a/components/bt/host/bluedroid/stack/btm/include/btm_int.h +++ b/components/bt/host/bluedroid/stack/btm/include/btm_int.h @@ -1023,7 +1023,7 @@ BOOLEAN btm_lookup_eir(BD_ADDR_PTR p_rem_addr); */ void btm_acl_free(void); void btm_acl_init (void); -void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, BD_NAME bdn, +void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, UINT8 bdn[BTM_MAX_REM_BD_NAME_LEN], UINT16 hci_handle, UINT8 link_role, tBT_TRANSPORT transport); void btm_acl_removed (BD_ADDR bda, tBT_TRANSPORT transport); void btm_acl_device_down (void); diff --git a/components/bt/host/bluedroid/stack/hcic/hcicmds.c b/components/bt/host/bluedroid/stack/hcic/hcicmds.c index 3b52804408..8ca8db0742 100644 --- a/components/bt/host/bluedroid/stack/hcic/hcicmds.c +++ b/components/bt/host/bluedroid/stack/hcic/hcicmds.c @@ -1054,7 +1054,7 @@ BOOLEAN btsnd_hcic_delete_stored_key (BD_ADDR bd_addr, BOOLEAN delete_all_flag) return (TRUE); } -BOOLEAN btsnd_hcic_change_name (BD_NAME name) +BOOLEAN btsnd_hcic_change_name (const UINT8 *name) { BT_HDR *p; UINT8 *pp; diff --git a/components/bt/host/bluedroid/stack/include/stack/hcimsgs.h b/components/bt/host/bluedroid/stack/include/stack/hcimsgs.h index 8f85582869..3a03c22dd4 100644 --- a/components/bt/host/bluedroid/stack/include/stack/hcimsgs.h +++ b/components/bt/host/bluedroid/stack/include/stack/hcimsgs.h @@ -498,7 +498,7 @@ BOOLEAN btsnd_hcic_delete_stored_key (BD_ADDR bd_addr, BOOLEAN delete_all_flag); /* Delete Stored Key */ /* Change Local Name */ -BOOLEAN btsnd_hcic_change_name(BD_NAME name); +BOOLEAN btsnd_hcic_change_name (const UINT8 *name); #define HCIC_PARAM_SIZE_CHANGE_NAME BD_NAME_LEN 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 4cb43545dc..c3b9225f4e 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 @@ -159,9 +159,15 @@ static void example_change_led_state(uint8_t onoff) /* When the node receives the first Generic OnOff Get/Set/Set Unack message, it will * start the timer used to disable fast provisioning functionality. */ +#pragma GCC diagnostic push +#if __GNUC__ >= 9 +#pragma GCC diagnostic ignored "-Waddress-of-packed-member" +#endif if (!bt_mesh_atomic_test_and_set_bit(fast_prov_server.srv_flags, DISABLE_FAST_PROV_START)) { k_delayed_work_submit(&fast_prov_server.disable_fast_prov_timer, DISABLE_FAST_PROV_TIMEOUT); } +#pragma GCC diagnostic pop + } static void node_prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index) @@ -231,12 +237,17 @@ static void provisioner_prov_complete(int node_idx, const uint8_t uuid[16], uint } if (fast_prov_server.node_addr_cnt != FAST_PROV_NODE_COUNT_MIN && fast_prov_server.node_addr_cnt <= fast_prov_server.max_node_num) { +#pragma GCC diagnostic push +#if __GNUC__ >= 9 +#pragma GCC diagnostic ignored "-Waddress-of-packed-member" +#endif if (bt_mesh_atomic_test_and_clear_bit(fast_prov_server.srv_flags, GATT_PROXY_ENABLE_START)) { k_delayed_work_cancel(&fast_prov_server.gatt_proxy_enable_timer); } if (!bt_mesh_atomic_test_and_set_bit(fast_prov_server.srv_flags, GATT_PROXY_ENABLE_START)) { k_delayed_work_submit(&fast_prov_server.gatt_proxy_enable_timer, GATT_PROXY_ENABLE_TIMEOUT); } +#pragma GCC diagnostic pop } } else { /* When a device is provisioned, the non-primary Provisioner shall reset the timer @@ -250,6 +261,10 @@ static void provisioner_prov_complete(int node_idx, const uint8_t uuid[16], uint } } +#pragma GCC diagnostic push +#if __GNUC__ >= 9 +#pragma GCC diagnostic ignored "-Waddress-of-packed-member" +#endif if (bt_mesh_atomic_test_bit(fast_prov_server.srv_flags, DISABLE_FAST_PROV_START)) { /* When a device is provisioned, and the stop_prov flag of the Provisioner has been * set, the Provisioner shall reset the timer which is used to stop the provisioner @@ -258,6 +273,7 @@ static void provisioner_prov_complete(int node_idx, const uint8_t uuid[16], uint k_delayed_work_cancel(&fast_prov_server.disable_fast_prov_timer); k_delayed_work_submit(&fast_prov_server.disable_fast_prov_timer, DISABLE_FAST_PROV_TIMEOUT); } +#pragma GCC diagnostic pop /* The Provisioner will send Config AppKey Add to the node. */ example_msg_common_info_t info = { 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 e51c60f8e1..e31cbc4936 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 @@ -171,9 +171,14 @@ static void example_change_led_state(uint8_t onoff) /* When the node receives the first Generic OnOff Get/Set/Set Unack message, it will * start the timer used to disable fast provisioning functionality. */ +#pragma GCC diagnostic push +#if __GNUC__ >= 9 +#pragma GCC diagnostic ignored "-Waddress-of-packed-member" +#endif if (!bt_mesh_atomic_test_and_set_bit(fast_prov_server.srv_flags, DISABLE_FAST_PROV_START)) { k_delayed_work_submit(&fast_prov_server.disable_fast_prov_timer, DISABLE_FAST_PROV_TIMEOUT); } +#pragma GCC diagnostic pop } static void node_prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index) @@ -241,6 +246,10 @@ static void provisioner_prov_complete(int node_idx, const uint8_t uuid[16], uint ESP_LOGE(TAG, "%s: Failed to store node address 0x%04x", __func__, unicast_addr); return; } +#pragma GCC diagnostic push +#if __GNUC__ >= 9 +#pragma GCC diagnostic ignored "-Waddress-of-packed-member" +#endif if (fast_prov_server.node_addr_cnt != FAST_PROV_NODE_COUNT_MIN && fast_prov_server.node_addr_cnt <= fast_prov_server.max_node_num) { if (bt_mesh_atomic_test_and_clear_bit(fast_prov_server.srv_flags, GATT_PROXY_ENABLE_START)) { @@ -250,6 +259,7 @@ static void provisioner_prov_complete(int node_idx, const uint8_t uuid[16], uint k_delayed_work_submit(&fast_prov_server.gatt_proxy_enable_timer, GATT_PROXY_ENABLE_TIMEOUT); } } +#pragma GCC diagnostic pop } else { /* When a device is provisioned, the non-primary Provisioner shall reset the timer * which is used to send node addresses to the primary Provisioner. @@ -262,6 +272,10 @@ static void provisioner_prov_complete(int node_idx, const uint8_t uuid[16], uint } } +#pragma GCC diagnostic push +#if __GNUC__ >= 9 +#pragma GCC diagnostic ignored "-Waddress-of-packed-member" +#endif if (bt_mesh_atomic_test_bit(fast_prov_server.srv_flags, DISABLE_FAST_PROV_START)) { /* When a device is provisioned, and the stop_prov flag of the Provisioner has been * set, the Provisioner shall reset the timer which is used to stop the provisioner @@ -270,6 +284,7 @@ static void provisioner_prov_complete(int node_idx, const uint8_t uuid[16], uint k_delayed_work_cancel(&fast_prov_server.disable_fast_prov_timer); k_delayed_work_submit(&fast_prov_server.disable_fast_prov_timer, DISABLE_FAST_PROV_TIMEOUT); } +#pragma GCC diagnostic pop /* The Provisioner will send Config AppKey Add to the node. */ example_msg_common_info_t info = { diff --git a/examples/bluetooth/esp_ble_mesh/common_components/fast_provisioning/CMakeLists.txt b/examples/bluetooth/esp_ble_mesh/common_components/fast_provisioning/CMakeLists.txt index 5da0b85853..7908d0c82f 100644 --- a/examples/bluetooth/esp_ble_mesh/common_components/fast_provisioning/CMakeLists.txt +++ b/examples/bluetooth/esp_ble_mesh/common_components/fast_provisioning/CMakeLists.txt @@ -5,3 +5,7 @@ set(srcs "ble_mesh_fast_prov_client_model.c" idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "." REQUIRES bt) + +set_source_files_properties( + "ble_mesh_fast_prov_server_model.c" + PROPERTIES COMPILE_FLAGS -Wno-address-of-packed-member)