From 229df65cfc65ac65394c060ce9860cd94ea3fbd0 Mon Sep 17 00:00:00 2001 From: Tian Hao Date: Wed, 16 Nov 2016 00:34:48 +0800 Subject: [PATCH] component/bt : cleanup id/uuid define 1. which named uuid is esp_bt_uuid_t type 2. which named id is xxx_id_t type, such as service_id_t char_id_t, include inst & uuid 3. share include directory --- components/bt/bluedroid/api/esp_gattc_api.c | 46 +++++------ components/bt/bluedroid/api/esp_gatts_api.c | 4 +- .../bt/bluedroid/api/include/esp_gattc_api.h | 10 +-- .../bt/bluedroid/api/include/esp_gatts_api.h | 10 +-- .../btc/profile/std/gatt/btc_gattc.c | 80 +++++++++---------- .../btc/profile/std/gatt/btc_gatts.c | 2 +- .../profile/std/include/{avct => }/avct_api.h | 0 .../profile/std/include/{avdt => }/avdt_api.h | 0 .../std/include/{avdt => }/avdt_defs.h | 0 .../std/include/{avdt => }/avdtc_api.h | 0 .../profile/std/include/{avrc => }/avrc_api.h | 0 .../std/include/{avrc => }/avrc_defs.h | 0 .../profile/std/include/{sdp => }/bt_sdp.h | 0 .../std/include/{gap => }/btc_gap_ble.h | 0 .../std/include/{gap => }/btc_gap_bt.h | 0 .../std/include/{gatt => }/btc_gattc.h | 0 .../std/include/{gatt => }/btc_gatts.h | 0 .../profile/std/include/{dis => }/dis_api.h | 0 .../std/include/{hid_le => }/hid_le_prf.h | 0 .../profile/std/include/{dis => }/srvc_api.h | 0 components/bt/component.mk | 5 +- 21 files changed, 77 insertions(+), 80 deletions(-) rename components/bt/bluedroid/btc/profile/std/include/{avct => }/avct_api.h (100%) rename components/bt/bluedroid/btc/profile/std/include/{avdt => }/avdt_api.h (100%) rename components/bt/bluedroid/btc/profile/std/include/{avdt => }/avdt_defs.h (100%) rename components/bt/bluedroid/btc/profile/std/include/{avdt => }/avdtc_api.h (100%) rename components/bt/bluedroid/btc/profile/std/include/{avrc => }/avrc_api.h (100%) rename components/bt/bluedroid/btc/profile/std/include/{avrc => }/avrc_defs.h (100%) rename components/bt/bluedroid/btc/profile/std/include/{sdp => }/bt_sdp.h (100%) rename components/bt/bluedroid/btc/profile/std/include/{gap => }/btc_gap_ble.h (100%) rename components/bt/bluedroid/btc/profile/std/include/{gap => }/btc_gap_bt.h (100%) rename components/bt/bluedroid/btc/profile/std/include/{gatt => }/btc_gattc.h (100%) rename components/bt/bluedroid/btc/profile/std/include/{gatt => }/btc_gatts.h (100%) rename components/bt/bluedroid/btc/profile/std/include/{dis => }/dis_api.h (100%) rename components/bt/bluedroid/btc/profile/std/include/{hid_le => }/hid_le_prf.h (100%) rename components/bt/bluedroid/btc/profile/std/include/{dis => }/srvc_api.h (100%) diff --git a/components/bt/bluedroid/api/esp_gattc_api.c b/components/bt/bluedroid/api/esp_gattc_api.c index 3e73f8439d..033ebba6dc 100644 --- a/components/bt/bluedroid/api/esp_gattc_api.c +++ b/components/bt/bluedroid/api/esp_gattc_api.c @@ -234,9 +234,9 @@ esp_err_t esp_ble_gattc_get_characteristic(uint16_t conn_id, msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_GATTC; arg.conn_id = conn_id; - memcpy(&arg.service_uuid, srvc_id, sizeof(esp_gatt_srvc_id_t)); + memcpy(&arg.service_id, srvc_id, sizeof(esp_gatt_srvc_id_t)); if (start_char_id) { - memcpy(&arg.char_uuid, start_char_id, sizeof(esp_gatt_id_t)); + memcpy(&arg.char_id, start_char_id, sizeof(esp_gatt_id_t)); msg.act = BTC_GATTC_ACT_GET_NEXT_CHAR; } else { msg.act = BTC_GATTC_ACT_GET_FIRST_CHAR; @@ -273,10 +273,10 @@ esp_err_t esp_ble_gattc_get_descriptor(uint16_t conn_id, msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_GATTC; arg.conn_id = conn_id; - memcpy(&arg.service_uuid, srvc_id, sizeof(esp_gatt_srvc_id_t)); - memcpy(&arg.char_uuid, char_id, sizeof(esp_gatt_id_t)); + memcpy(&arg.service_id, srvc_id, sizeof(esp_gatt_srvc_id_t)); + memcpy(&arg.char_id, char_id, sizeof(esp_gatt_id_t)); if (start_descr_id) { - memcpy(&arg.descr_uuid, start_descr_id, sizeof(esp_gatt_id_t)); + memcpy(&arg.descr_id, start_descr_id, sizeof(esp_gatt_id_t)); msg.act = BTC_GATTC_ACT_GET_NEXT_DESCR; } else { msg.act = BTC_GATTC_ACT_GET_FIRST_DESCR; @@ -312,9 +312,9 @@ esp_err_t esp_ble_gattc_get_included_service(uint16_t conn_id, msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_GATTC; arg.conn_id = conn_id; - memcpy(&arg.service_uuid, srvc_id, sizeof(esp_gatt_srvc_id_t)); + memcpy(&arg.service_id, srvc_id, sizeof(esp_gatt_srvc_id_t)); if (start_incl_srvc_id) { - memcpy(&arg.start_service_uuid, start_incl_srvc_id, sizeof(esp_gatt_srvc_id_t)); + memcpy(&arg.start_service_id, start_incl_srvc_id, sizeof(esp_gatt_srvc_id_t)); msg.act = BTC_GATTC_ACT_GET_NEXT_INCL_SERVICE; } else { msg.act = BTC_GATTC_ACT_GET_FIRST_INCL_SERVICE; @@ -348,8 +348,8 @@ esp_err_t esp_ble_gattc_read_char (uint16_t conn_id, esp_gatt_srvc_id_t *srvc_id msg.pid = BTC_PID_GATTC; msg.act = BTC_GATTC_ACT_READ_CHAR; arg.conn_id = conn_id; - memcpy(&arg.service_uuid, srvc_id, sizeof(esp_gatt_srvc_id_t)); - memcpy(&arg.char_uuid, char_id, sizeof(esp_gatt_id_t)); + memcpy(&arg.service_id, srvc_id, sizeof(esp_gatt_srvc_id_t)); + memcpy(&arg.char_id, char_id, sizeof(esp_gatt_id_t)); arg.auth_req = auth_req; return (btc_transfer_context(&msg, &arg, sizeof(esp_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL); } @@ -381,9 +381,9 @@ esp_err_t esp_ble_gattc_read_char_descr (uint16_t conn_id, msg.pid = BTC_PID_GATTC; msg.act = BTC_GATTC_ACT_READ_CHAR_DESCR; arg.conn_id = conn_id; - memcpy(&arg.service_uuid, srvc_id, sizeof(esp_gatt_srvc_id_t)); - memcpy(&arg.char_uuid, char_id, sizeof(esp_gatt_id_t)); - memcpy(&arg.descr_uuid, descr_id, sizeof(esp_gatt_id_t)); + memcpy(&arg.service_id, srvc_id, sizeof(esp_gatt_srvc_id_t)); + memcpy(&arg.char_id, char_id, sizeof(esp_gatt_id_t)); + memcpy(&arg.descr_id, descr_id, sizeof(esp_gatt_id_t)); arg.auth_req = auth_req; return (btc_transfer_context(&msg, &arg, sizeof(esp_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL); } @@ -417,8 +417,8 @@ esp_err_t esp_ble_gattc_write_char( uint16_t conn_id, msg.pid = BTC_PID_GATTC; msg.act = BTC_GATTC_ACT_WRITE_CHAR; arg.conn_id = (uint16_t) conn_id; - memcpy(&arg.service_uuid, srvc_id, sizeof(esp_gatt_srvc_id_t)); - memcpy(&arg.char_uuid, char_id, sizeof(esp_gatt_id_t)); + memcpy(&arg.service_id, srvc_id, sizeof(esp_gatt_srvc_id_t)); + memcpy(&arg.char_id, char_id, sizeof(esp_gatt_id_t)); arg.len = len > ESP_GATT_MAX_ATTR_LEN ? ESP_GATT_MAX_ATTR_LEN : len; memcpy(arg.value, value, arg.len); arg.auth_req = auth_req; @@ -455,9 +455,9 @@ esp_err_t esp_ble_gattc_write_char_descr (uint16_t conn_id, msg.pid = BTC_PID_GATTC; msg.act = BTC_GATTC_ACT_WRITE_CHAR_DESCR; arg.conn_id = (uint16_t) conn_id; - memcpy(&arg.service_uuid, srvc_id, sizeof(esp_gatt_srvc_id_t)); - memcpy(&arg.char_uuid, char_id, sizeof(esp_gatt_id_t)); - memcpy(&arg.descr_uuid, descr_id, sizeof(esp_gatt_id_t)); + memcpy(&arg.service_id, srvc_id, sizeof(esp_gatt_srvc_id_t)); + memcpy(&arg.char_id, char_id, sizeof(esp_gatt_id_t)); + memcpy(&arg.descr_id, descr_id, sizeof(esp_gatt_id_t)); arg.len = len > ESP_GATT_MAX_ATTR_LEN ? ESP_GATT_MAX_ATTR_LEN : len; memcpy(arg.value, value, arg.len); arg.auth_req = auth_req; @@ -495,8 +495,8 @@ esp_err_t esp_ble_gattc_prepare_write(uint16_t conn_id, msg.pid = BTC_PID_GATTC; msg.act = BTC_GATTC_ACT_PREPARE_WRITE; arg.conn_id = conn_id; - memcpy(&arg.service_uuid, srvc_id, sizeof(esp_gatt_srvc_id_t)); - memcpy(&arg.char_uuid, char_id, sizeof(esp_gatt_id_t)); + memcpy(&arg.service_id, srvc_id, sizeof(esp_gatt_srvc_id_t)); + memcpy(&arg.char_id, char_id, sizeof(esp_gatt_id_t)); arg.offset = offset; arg.len = len > ESP_GATT_MAX_ATTR_LEN ? ESP_GATT_MAX_ATTR_LEN : len; // length check ? memcpy(arg.value, data, arg.len); @@ -560,8 +560,8 @@ esp_gatt_status_t esp_ble_gattc_register_for_notify (esp_gatt_if_t gatt_if, msg.act = BTC_GATTC_ACT_REG_FOR_NOTIFY; arg.gatt_if = gatt_if; memcpy(&arg.remote_bda, &server_bda, sizeof(esp_bd_addr_t)); - memcpy(&arg.service_uuid, srvc_id, sizeof(esp_gatt_srvc_id_t)); - memcpy(&arg.char_uuid, char_id, sizeof(esp_gatt_id_t)); + memcpy(&arg.service_id, srvc_id, sizeof(esp_gatt_srvc_id_t)); + memcpy(&arg.char_id, char_id, sizeof(esp_gatt_id_t)); return (btc_transfer_context(&msg, &arg, sizeof(esp_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL); } @@ -594,8 +594,8 @@ esp_gatt_status_t esp_ble_gattc_unregister_for_notify (esp_gatt_if_t gatt_if, msg.act = BTC_GATTC_ACT_UNREG_FOR_NOTIFY; arg.gatt_if = gatt_if; memcpy(&arg.remote_bda, &server_bda, sizeof(esp_bd_addr_t)); - memcpy(&arg.service_uuid, srvc_id, sizeof(esp_gatt_srvc_id_t)); - memcpy(&arg.char_uuid, char_id, sizeof(esp_gatt_id_t)); + memcpy(&arg.service_id, srvc_id, sizeof(esp_gatt_srvc_id_t)); + memcpy(&arg.char_id, char_id, sizeof(esp_gatt_id_t)); return (btc_transfer_context(&msg, &arg, sizeof(esp_ble_gattc_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL); } diff --git a/components/bt/bluedroid/api/esp_gatts_api.c b/components/bt/bluedroid/api/esp_gatts_api.c index a8602678a2..50de8f056f 100644 --- a/components/bt/bluedroid/api/esp_gatts_api.c +++ b/components/bt/bluedroid/api/esp_gatts_api.c @@ -57,7 +57,7 @@ esp_err_t esp_ble_gatts_app_unregister(esp_gatt_if_t gatt_if) } esp_err_t esp_ble_gatts_create_service(esp_gatt_if_t gatt_if, - esp_gatt_srvc_id_t *service_uuid, uint16_t num_handle) + esp_gatt_srvc_id_t *service_id, uint16_t num_handle) { btc_msg_t msg; esp_ble_gatts_args_t arg; @@ -67,7 +67,7 @@ esp_err_t esp_ble_gatts_create_service(esp_gatt_if_t gatt_if, msg.act = BTC_GATTS_ACT_CREATE_SERVICE; arg.gatt_if = gatt_if; arg.num_handle = num_handle; - memcpy(&arg.service_uuid, service_uuid, sizeof(esp_gatt_srvc_id_t)); + memcpy(&arg.service_id, service_id, sizeof(esp_gatt_srvc_id_t)); return (btc_transfer_context(&msg, &arg, sizeof(esp_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL); } diff --git a/components/bt/bluedroid/api/include/esp_gattc_api.h b/components/bt/bluedroid/api/include/esp_gattc_api.h index 4515b97d18..9e5eaac623 100644 --- a/components/bt/bluedroid/api/include/esp_gattc_api.h +++ b/components/bt/bluedroid/api/include/esp_gattc_api.h @@ -60,10 +60,10 @@ typedef struct { uint16_t len; uint16_t offset; esp_gatt_if_t gatt_if; /* internal is server_if or client_if */ - esp_gatt_srvc_id_t service_uuid; - esp_gatt_srvc_id_t start_service_uuid; - esp_gatt_id_t char_uuid; - esp_gatt_id_t descr_uuid; + esp_gatt_srvc_id_t service_id; + esp_gatt_srvc_id_t start_service_id; + esp_gatt_id_t char_id; + esp_gatt_id_t descr_id; esp_gatt_auth_req_t auth_req; esp_bd_addr_t remote_bda; esp_bt_uuid_t uuid; @@ -116,7 +116,7 @@ typedef union { /* ESP_GATTC_SEARCH_RES_EVT */ struct gattc_search_res_evt_param { uint16_t conn_id; - esp_gatt_srvc_id_t service_uuid; + esp_gatt_srvc_id_t service_id; } search_res; /* ESP_GATTC_READ_CHAR_EVT, ESP_GATTC_READ_DESCR_EVT */ diff --git a/components/bt/bluedroid/api/include/esp_gatts_api.h b/components/bt/bluedroid/api/include/esp_gatts_api.h index de96765070..8213112834 100644 --- a/components/bt/bluedroid/api/include/esp_gatts_api.h +++ b/components/bt/bluedroid/api/include/esp_gatts_api.h @@ -36,8 +36,8 @@ /* esp_ble_gatts_args_t */ typedef struct { esp_gatt_if_t gatt_if; /* internal is server_if or client_if */ - esp_gatt_srvc_id_t service_uuid; - esp_gatt_id_t char_uuid; + esp_gatt_srvc_id_t service_id; + esp_gatt_id_t char_id; esp_gatt_id_t descr_uuid; esp_bt_uuid_t uuid; esp_gatt_rsp_t rsp; @@ -113,7 +113,7 @@ typedef union { int status; uint16_t gatt_if; uint16_t service_handle; //handle - esp_gatt_srvc_id_t service_id; //uuid + esp_gatt_srvc_id_t service_id; //id } create; // param for ESP_GATTS_ADD_INCL_SRVC_EVT struct gatts_add_incl_srvc_evt_param { @@ -240,14 +240,14 @@ esp_err_t esp_ble_gatts_app_unregister(esp_gatt_if_t gatt_if); ** service and characteristics/descriptors into the service. ** ** @param[in] gatt_if: gatt interface ID -** @param[in] service_uuid: service UUID. +** @param[in] service_id: service ID. ** @param[in] num_handle: numble of handle requessted for this service. ** ** @return ESP_OK - success, other - failed ** *******************************************************************************/ esp_err_t esp_ble_gatts_create_service(esp_gatt_if_t gatt_if, - esp_gatt_srvc_id_t *service_uuid, uint16_t num_handle); + esp_gatt_srvc_id_t *service_id, uint16_t num_handle); diff --git a/components/bt/bluedroid/btc/profile/std/gatt/btc_gattc.c b/components/bt/bluedroid/btc/profile/std/gatt/btc_gattc.c index b575bb8c54..c7508885d3 100644 --- a/components/bt/bluedroid/btc/profile/std/gatt/btc_gattc.c +++ b/components/bt/bluedroid/btc/profile/std/gatt/btc_gattc.c @@ -107,7 +107,7 @@ static void btc_gattc_get_first_char(esp_ble_gattc_args_t *arg) esp_ble_gattc_cb_param_t param; - btc_to_bta_srvc_id(&srvc_id, &arg->service_uuid); + btc_to_bta_srvc_id(&srvc_id, &arg->service_id); status = BTA_GATTC_GetFirstChar(arg->conn_id, &srvc_id, NULL, &out_char_id, &out_char_prop); if (status == 0) { @@ -117,7 +117,7 @@ static void btc_gattc_get_first_char(esp_ble_gattc_args_t *arg) memset(¶m, 0, sizeof(esp_ble_gattc_cb_param_t)); param.get_char.conn_id = arg->conn_id; param.get_char.status = status; - memcpy(¶m.get_char.srvc_id, &arg->service_uuid, sizeof(esp_gatt_srvc_id_t)); + memcpy(¶m.get_char.srvc_id, &arg->service_id, sizeof(esp_gatt_srvc_id_t)); memcpy(¶m.get_char.char_id, &char_id, sizeof(esp_gatt_id_t)); param.get_char.char_prop = out_char_prop; BTC_GATTC_CB_TO_APP(ESP_GATTC_GET_CHAR_EVT, ¶m); @@ -131,8 +131,8 @@ static void btc_gattc_get_next_char(esp_ble_gattc_args_t *arg) tBTA_GATTC_CHAR_ID out_char_id; tBTA_GATT_CHAR_PROP out_char_prop; esp_ble_gattc_cb_param_t param; - btc_to_bta_srvc_id(&in_char_id.srvc_id, &arg->service_uuid); - btc_to_bta_gatt_id(&in_char_id.char_id, &arg->char_uuid); + btc_to_bta_srvc_id(&in_char_id.srvc_id, &arg->service_id); + btc_to_bta_gatt_id(&in_char_id.char_id, &arg->char_id); status = BTA_GATTC_GetNextChar(arg->conn_id, &in_char_id, NULL, &out_char_id, &out_char_prop); @@ -144,7 +144,7 @@ static void btc_gattc_get_next_char(esp_ble_gattc_args_t *arg) memset(¶m, 0, sizeof(esp_ble_gattc_cb_param_t)); param.get_char.conn_id = arg->conn_id; param.get_char.status = status; - memcpy(¶m.get_char.srvc_id, &arg->service_uuid, sizeof(esp_gatt_srvc_id_t)); + memcpy(¶m.get_char.srvc_id, &arg->service_id, sizeof(esp_gatt_srvc_id_t)); memcpy(¶m.get_char.char_id, &char_id, sizeof(esp_gatt_id_t)); param.get_char.char_prop = out_char_prop; BTC_GATTC_CB_TO_APP(ESP_GATTC_GET_CHAR_EVT, ¶m); @@ -158,8 +158,8 @@ static void btc_gattc_get_first_descr(esp_ble_gattc_args_t *arg) tBTA_GATTC_CHAR_DESCR_ID out_char_descr_id; esp_ble_gattc_cb_param_t param; - btc_to_bta_srvc_id(&in_char_id.srvc_id, &arg->service_uuid); - btc_to_bta_gatt_id(&in_char_id.char_id, &arg->char_uuid); + btc_to_bta_srvc_id(&in_char_id.srvc_id, &arg->service_id); + btc_to_bta_gatt_id(&in_char_id.char_id, &arg->char_id); status = BTA_GATTC_GetFirstCharDescr(arg->conn_id, &in_char_id, NULL, &out_char_descr_id); @@ -171,8 +171,8 @@ static void btc_gattc_get_first_descr(esp_ble_gattc_args_t *arg) memset(¶m, 0, sizeof(esp_ble_gattc_cb_param_t)); param.get_descr.conn_id = arg->conn_id; param.get_descr.status = status; - memcpy(¶m.get_descr.srvc_id, &arg->service_uuid, sizeof(esp_gatt_srvc_id_t)); - memcpy(¶m.get_descr.char_id, &arg->char_uuid, sizeof(esp_gatt_id_t)); + memcpy(¶m.get_descr.srvc_id, &arg->service_id, sizeof(esp_gatt_srvc_id_t)); + memcpy(¶m.get_descr.char_id, &arg->char_id, sizeof(esp_gatt_id_t)); memcpy(¶m.get_descr.descr_id, &descr_id, sizeof(esp_gatt_id_t)); BTC_GATTC_CB_TO_APP(ESP_GATTC_GET_DESCR_EVT, ¶m); } @@ -185,9 +185,9 @@ static void btc_gattc_get_next_descr(esp_ble_gattc_args_t *arg) tBTA_GATTC_CHAR_DESCR_ID out_char_descr_id; esp_ble_gattc_cb_param_t param; - btc_to_bta_srvc_id(&in_char_descr_id.char_id.srvc_id, &arg->service_uuid); - btc_to_bta_gatt_id(&in_char_descr_id.char_id.char_id, &arg->char_uuid); - btc_to_bta_gatt_id(&in_char_descr_id.descr_id, &arg->descr_uuid); + btc_to_bta_srvc_id(&in_char_descr_id.char_id.srvc_id, &arg->service_id); + btc_to_bta_gatt_id(&in_char_descr_id.char_id.char_id, &arg->char_id); + btc_to_bta_gatt_id(&in_char_descr_id.descr_id, &arg->descr_id); status = BTA_GATTC_GetNextCharDescr(arg->conn_id, &in_char_descr_id , NULL, &out_char_descr_id); @@ -198,8 +198,8 @@ static void btc_gattc_get_next_descr(esp_ble_gattc_args_t *arg) memset(¶m, 0, sizeof(esp_ble_gattc_cb_param_t)); param.get_descr.conn_id = arg->conn_id; param.get_descr.status = status; - memcpy(¶m.get_descr.srvc_id, &arg->service_uuid, sizeof(esp_gatt_srvc_id_t)); - memcpy(¶m.get_descr.char_id, &arg->char_uuid, sizeof(esp_gatt_id_t)); + memcpy(¶m.get_descr.srvc_id, &arg->service_id, sizeof(esp_gatt_srvc_id_t)); + memcpy(¶m.get_descr.char_id, &arg->char_id, sizeof(esp_gatt_id_t)); memcpy(¶m.get_descr.descr_id, &descr_id, sizeof(esp_gatt_id_t)); BTC_GATTC_CB_TO_APP(ESP_GATTC_GET_DESCR_EVT, ¶m); } @@ -212,7 +212,7 @@ static void btc_gattc_get_first_incl_service(esp_ble_gattc_args_t *arg) tBTA_GATTC_INCL_SVC_ID out_incl_svc_id; esp_ble_gattc_cb_param_t param; - btc_to_bta_srvc_id(&srvc_id, &arg->service_uuid); + btc_to_bta_srvc_id(&srvc_id, &arg->service_id); status = BTA_GATTC_GetFirstIncludedService(arg->conn_id, &srvc_id, NULL, &out_incl_svc_id); @@ -222,7 +222,7 @@ static void btc_gattc_get_first_incl_service(esp_ble_gattc_args_t *arg) memset(¶m, 0, sizeof(esp_ble_gattc_cb_param_t)); param.get_incl_srvc.conn_id = arg->conn_id; param.get_incl_srvc.status = status; - memcpy(¶m.get_incl_srvc.srvc_id, &arg->service_uuid, sizeof(esp_gatt_srvc_id_t)); + memcpy(¶m.get_incl_srvc.srvc_id, &arg->service_id, sizeof(esp_gatt_srvc_id_t)); memcpy(¶m.get_incl_srvc.incl_srvc_id, &incl_srvc_id, sizeof(esp_gatt_srvc_id_t)); BTC_GATTC_CB_TO_APP(ESP_GATTC_GET_INCL_SRVC_EVT, ¶m); } @@ -235,8 +235,8 @@ static void btc_gattc_get_next_incl_service(esp_ble_gattc_args_t *arg) tBTA_GATTC_INCL_SVC_ID out_incl_svc_id; esp_ble_gattc_cb_param_t param; - btc_to_bta_srvc_id(&in_incl_svc_id.srvc_id, &arg->service_uuid); - btc_to_bta_srvc_id(&in_incl_svc_id.incl_svc_id, &arg->start_service_uuid); + btc_to_bta_srvc_id(&in_incl_svc_id.srvc_id, &arg->service_id); + btc_to_bta_srvc_id(&in_incl_svc_id.incl_svc_id, &arg->start_service_id); status = BTA_GATTC_GetNextIncludedService(arg->conn_id, &in_incl_svc_id, NULL, &out_incl_svc_id); @@ -246,7 +246,7 @@ static void btc_gattc_get_next_incl_service(esp_ble_gattc_args_t *arg) memset(¶m, 0, sizeof(esp_ble_gattc_cb_param_t)); param.get_incl_srvc.conn_id = arg->conn_id; param.get_incl_srvc.status = status; - memcpy(¶m.get_incl_srvc.srvc_id, &arg->service_uuid, sizeof(esp_gatt_srvc_id_t)); + memcpy(¶m.get_incl_srvc.srvc_id, &arg->service_id, sizeof(esp_gatt_srvc_id_t)); memcpy(¶m.get_incl_srvc.incl_srvc_id, &incl_srvc_id, sizeof(esp_gatt_srvc_id_t)); BTC_GATTC_CB_TO_APP(ESP_GATTC_GET_INCL_SRVC_EVT, ¶m); } @@ -254,17 +254,17 @@ static void btc_gattc_get_next_incl_service(esp_ble_gattc_args_t *arg) static void btc_gattc_read_char(esp_ble_gattc_args_t *arg) { tBTA_GATTC_CHAR_ID in_char_id; - btc_to_bta_srvc_id(&in_char_id.srvc_id, &arg->service_uuid); - btc_to_bta_gatt_id(&in_char_id.char_id, &arg->char_uuid); + btc_to_bta_srvc_id(&in_char_id.srvc_id, &arg->service_id); + btc_to_bta_gatt_id(&in_char_id.char_id, &arg->char_id); BTA_GATTC_ReadCharacteristic(arg->conn_id, &in_char_id, arg->auth_req); } static void btc_gattc_read_char_descr(esp_ble_gattc_args_t *arg) { tBTA_GATTC_CHAR_DESCR_ID in_char_descr_id; - btc_to_bta_srvc_id(&in_char_descr_id.char_id.srvc_id, &arg->service_uuid); - btc_to_bta_gatt_id(&in_char_descr_id.char_id.char_id, &arg->char_uuid); - btc_to_bta_gatt_id(&in_char_descr_id.descr_id, &arg->descr_uuid); + btc_to_bta_srvc_id(&in_char_descr_id.char_id.srvc_id, &arg->service_id); + btc_to_bta_gatt_id(&in_char_descr_id.char_id.char_id, &arg->char_id); + btc_to_bta_gatt_id(&in_char_descr_id.descr_id, &arg->descr_id); BTA_GATTC_ReadCharDescr(arg->conn_id, &in_char_descr_id, arg->auth_req); } @@ -275,8 +275,8 @@ static void btc_gattc_write_char(esp_ble_gattc_args_t *arg) tBTA_GATTC_CHAR_ID in_char_id; tBTA_GATTC_WRITE_TYPE write_type = BTA_GATTC_TYPE_WRITE; - btc_to_bta_srvc_id(&in_char_id.srvc_id, &arg->service_uuid); - btc_to_bta_gatt_id(&in_char_id.char_id, &arg->char_uuid); + btc_to_bta_srvc_id(&in_char_id.srvc_id, &arg->service_id); + btc_to_bta_gatt_id(&in_char_id.char_id, &arg->char_id); BTA_GATTC_WriteCharValue(arg->conn_id, &in_char_id, write_type, @@ -291,9 +291,9 @@ static void btc_gattc_write_char_descr(esp_ble_gattc_args_t *arg) tBTA_GATTC_CHAR_DESCR_ID in_char_descr_id; tBTA_GATT_UNFMT descr_val; tBTA_GATTC_WRITE_TYPE write_type = BTA_GATTC_TYPE_WRITE; - btc_to_bta_srvc_id(&in_char_descr_id.char_id.srvc_id, &arg->service_uuid); - btc_to_bta_gatt_id(&in_char_descr_id.char_id.char_id, &arg->char_uuid); - btc_to_bta_gatt_id(&in_char_descr_id.descr_id, &arg->descr_uuid); + btc_to_bta_srvc_id(&in_char_descr_id.char_id.srvc_id, &arg->service_id); + btc_to_bta_gatt_id(&in_char_descr_id.char_id.char_id, &arg->char_id); + btc_to_bta_gatt_id(&in_char_descr_id.descr_id, &arg->descr_id); descr_val.len = arg->len; descr_val.p_value = arg->value; @@ -306,8 +306,8 @@ static void btc_gattc_write_char_descr(esp_ble_gattc_args_t *arg) static void btc_gattc_prepare_write(esp_ble_gattc_args_t *arg) { tBTA_GATTC_CHAR_ID in_char_id; - btc_to_bta_srvc_id(&in_char_id.srvc_id, &arg->service_uuid); - btc_to_bta_gatt_id(&in_char_id.char_id, &arg->char_uuid); + btc_to_bta_srvc_id(&in_char_id.srvc_id, &arg->service_id); + btc_to_bta_gatt_id(&in_char_id.char_id, &arg->char_id); BTA_GATTC_PrepareWrite(arg->conn_id, &in_char_id, arg->offset, arg->len, arg->value, arg->auth_req); @@ -324,8 +324,8 @@ static void btc_gattc_reg_for_notify(esp_ble_gattc_args_t *arg) tBTA_GATTC_CHAR_ID in_char_id; esp_ble_gattc_cb_param_t param; - btc_to_bta_srvc_id(&in_char_id.srvc_id, &arg->service_uuid); - btc_to_bta_gatt_id(&in_char_id.char_id, &arg->char_uuid); + btc_to_bta_srvc_id(&in_char_id.srvc_id, &arg->service_id); + btc_to_bta_gatt_id(&in_char_id.char_id, &arg->char_id); status = BTA_GATTC_RegisterForNotifications(arg->gatt_if, arg->remote_bda, &in_char_id); @@ -334,8 +334,8 @@ static void btc_gattc_reg_for_notify(esp_ble_gattc_args_t *arg) param.reg_for_notif.conn_id = arg->conn_id; param.reg_for_notif.status = status; param.reg_for_notif.registered = true; - memcpy(¶m.reg_for_notif.srvc_id, &arg->service_uuid, sizeof(esp_gatt_srvc_id_t)); - memcpy(¶m.reg_for_notif.char_id, &arg->service_uuid, sizeof(esp_gatt_id_t)); + memcpy(¶m.reg_for_notif.srvc_id, &arg->service_id, sizeof(esp_gatt_srvc_id_t)); + memcpy(¶m.reg_for_notif.char_id, &arg->service_id, sizeof(esp_gatt_id_t)); BTC_GATTC_CB_TO_APP(ESP_GATTC_REG_FOR_NOTIF_EVT, ¶m); } @@ -345,8 +345,8 @@ static void btc_gattc_unreg_for_notify(esp_ble_gattc_args_t *arg) tBTA_GATTC_CHAR_ID in_char_id; esp_ble_gattc_cb_param_t param; - btc_to_bta_srvc_id(&in_char_id.srvc_id, &arg->service_uuid); - btc_to_bta_gatt_id(&in_char_id.char_id, &arg->char_uuid); + btc_to_bta_srvc_id(&in_char_id.srvc_id, &arg->service_id); + btc_to_bta_gatt_id(&in_char_id.char_id, &arg->char_id); status = BTA_GATTC_DeregisterForNotifications(arg->gatt_if, arg->remote_bda, &in_char_id); @@ -355,8 +355,8 @@ static void btc_gattc_unreg_for_notify(esp_ble_gattc_args_t *arg) param.reg_for_notif.conn_id = arg->conn_id; param.reg_for_notif.status = status; param.reg_for_notif.registered = false; - memcpy(¶m.reg_for_notif.srvc_id, &arg->service_uuid, sizeof(esp_gatt_srvc_id_t)); - memcpy(¶m.reg_for_notif.char_id, &arg->service_uuid, sizeof(esp_gatt_id_t)); + memcpy(¶m.reg_for_notif.srvc_id, &arg->service_id, sizeof(esp_gatt_srvc_id_t)); + memcpy(¶m.reg_for_notif.char_id, &arg->service_id, sizeof(esp_gatt_id_t)); BTC_GATTC_CB_TO_APP(ESP_GATTC_REG_FOR_NOTIF_EVT, ¶m); } @@ -488,7 +488,7 @@ void btc_gattc_cb_handler(btc_msg_t *msg) case BTA_GATTC_SEARCH_RES_EVT: { tBTA_GATTC_SRVC_RES *srvc_res = &arg->srvc_res; param.search_res.conn_id = srvc_res->conn_id; - memcpy(¶m.search_res.service_uuid, &srvc_res->service_uuid, sizeof(esp_gatt_srvc_id_t)); + memcpy(¶m.search_res.service_id, &srvc_res->service_uuid, sizeof(esp_gatt_srvc_id_t)); BTC_GATTC_CB_TO_APP(ESP_GATTC_SEARCH_RES_EVT, ¶m); break; } diff --git a/components/bt/bluedroid/btc/profile/std/gatt/btc_gatts.c b/components/bt/bluedroid/btc/profile/std/gatt/btc_gatts.c index 16b82a373e..309d2643f8 100644 --- a/components/bt/bluedroid/btc/profile/std/gatt/btc_gatts.c +++ b/components/bt/bluedroid/btc/profile/std/gatt/btc_gatts.c @@ -118,7 +118,7 @@ void btc_gatts_call_handler(btc_msg_t *msg) break; case BTC_GATTS_ACT_CREATE_SERVICE: { tBTA_GATT_SRVC_ID srvc_id; - btc_to_bta_srvc_id(&srvc_id, &arg->service_uuid); + btc_to_bta_srvc_id(&srvc_id, &arg->service_id); BTA_GATTS_CreateService(arg->gatt_if, &srvc_id.id.uuid, srvc_id.id.inst_id, arg->num_handle, srvc_id.is_primary); diff --git a/components/bt/bluedroid/btc/profile/std/include/avct/avct_api.h b/components/bt/bluedroid/btc/profile/std/include/avct_api.h similarity index 100% rename from components/bt/bluedroid/btc/profile/std/include/avct/avct_api.h rename to components/bt/bluedroid/btc/profile/std/include/avct_api.h diff --git a/components/bt/bluedroid/btc/profile/std/include/avdt/avdt_api.h b/components/bt/bluedroid/btc/profile/std/include/avdt_api.h similarity index 100% rename from components/bt/bluedroid/btc/profile/std/include/avdt/avdt_api.h rename to components/bt/bluedroid/btc/profile/std/include/avdt_api.h diff --git a/components/bt/bluedroid/btc/profile/std/include/avdt/avdt_defs.h b/components/bt/bluedroid/btc/profile/std/include/avdt_defs.h similarity index 100% rename from components/bt/bluedroid/btc/profile/std/include/avdt/avdt_defs.h rename to components/bt/bluedroid/btc/profile/std/include/avdt_defs.h diff --git a/components/bt/bluedroid/btc/profile/std/include/avdt/avdtc_api.h b/components/bt/bluedroid/btc/profile/std/include/avdtc_api.h similarity index 100% rename from components/bt/bluedroid/btc/profile/std/include/avdt/avdtc_api.h rename to components/bt/bluedroid/btc/profile/std/include/avdtc_api.h diff --git a/components/bt/bluedroid/btc/profile/std/include/avrc/avrc_api.h b/components/bt/bluedroid/btc/profile/std/include/avrc_api.h similarity index 100% rename from components/bt/bluedroid/btc/profile/std/include/avrc/avrc_api.h rename to components/bt/bluedroid/btc/profile/std/include/avrc_api.h diff --git a/components/bt/bluedroid/btc/profile/std/include/avrc/avrc_defs.h b/components/bt/bluedroid/btc/profile/std/include/avrc_defs.h similarity index 100% rename from components/bt/bluedroid/btc/profile/std/include/avrc/avrc_defs.h rename to components/bt/bluedroid/btc/profile/std/include/avrc_defs.h diff --git a/components/bt/bluedroid/btc/profile/std/include/sdp/bt_sdp.h b/components/bt/bluedroid/btc/profile/std/include/bt_sdp.h similarity index 100% rename from components/bt/bluedroid/btc/profile/std/include/sdp/bt_sdp.h rename to components/bt/bluedroid/btc/profile/std/include/bt_sdp.h diff --git a/components/bt/bluedroid/btc/profile/std/include/gap/btc_gap_ble.h b/components/bt/bluedroid/btc/profile/std/include/btc_gap_ble.h similarity index 100% rename from components/bt/bluedroid/btc/profile/std/include/gap/btc_gap_ble.h rename to components/bt/bluedroid/btc/profile/std/include/btc_gap_ble.h diff --git a/components/bt/bluedroid/btc/profile/std/include/gap/btc_gap_bt.h b/components/bt/bluedroid/btc/profile/std/include/btc_gap_bt.h similarity index 100% rename from components/bt/bluedroid/btc/profile/std/include/gap/btc_gap_bt.h rename to components/bt/bluedroid/btc/profile/std/include/btc_gap_bt.h diff --git a/components/bt/bluedroid/btc/profile/std/include/gatt/btc_gattc.h b/components/bt/bluedroid/btc/profile/std/include/btc_gattc.h similarity index 100% rename from components/bt/bluedroid/btc/profile/std/include/gatt/btc_gattc.h rename to components/bt/bluedroid/btc/profile/std/include/btc_gattc.h diff --git a/components/bt/bluedroid/btc/profile/std/include/gatt/btc_gatts.h b/components/bt/bluedroid/btc/profile/std/include/btc_gatts.h similarity index 100% rename from components/bt/bluedroid/btc/profile/std/include/gatt/btc_gatts.h rename to components/bt/bluedroid/btc/profile/std/include/btc_gatts.h diff --git a/components/bt/bluedroid/btc/profile/std/include/dis/dis_api.h b/components/bt/bluedroid/btc/profile/std/include/dis_api.h similarity index 100% rename from components/bt/bluedroid/btc/profile/std/include/dis/dis_api.h rename to components/bt/bluedroid/btc/profile/std/include/dis_api.h diff --git a/components/bt/bluedroid/btc/profile/std/include/hid_le/hid_le_prf.h b/components/bt/bluedroid/btc/profile/std/include/hid_le_prf.h similarity index 100% rename from components/bt/bluedroid/btc/profile/std/include/hid_le/hid_le_prf.h rename to components/bt/bluedroid/btc/profile/std/include/hid_le_prf.h diff --git a/components/bt/bluedroid/btc/profile/std/include/dis/srvc_api.h b/components/bt/bluedroid/btc/profile/std/include/srvc_api.h similarity index 100% rename from components/bt/bluedroid/btc/profile/std/include/dis/srvc_api.h rename to components/bt/bluedroid/btc/profile/std/include/srvc_api.h diff --git a/components/bt/component.mk b/components/bt/component.mk index cb8d919dfc..c06a10a03e 100644 --- a/components/bt/component.mk +++ b/components/bt/component.mk @@ -15,9 +15,7 @@ COMPONENT_ADD_INCLUDEDIRS := bluedroid/bta/include \ bluedroid/btc/profile/std/gatt/include \ bluedroid/btc/profile/std/gap/include \ bluedroid/btc/profile/std/sdp/include \ - bluedroid/btc/profile/std/include/gatt \ - bluedroid/btc/profile/std/include/gap \ - bluedroid/btc/profile/std/include/sdp \ + bluedroid/btc/profile/std/include \ bluedroid/btc/include \ bluedroid/stack/btm/include \ bluedroid/stack/btu/include \ @@ -56,7 +54,6 @@ COMPONENT_SRCDIRS := bluedroid/bta/dm \ bluedroid/btc/core \ bluedroid/btc/profile/esp/blufi \ bluedroid/btc/profile/std/gap \ - bluedroid/btc/profile/std/gap \ bluedroid/btc/profile/std/gatt \ bluedroid/btc/profile \ bluedroid/stack/btm \ -- 2.40.0