uint16_t uuid = 0;
future_t *future_p;
esp_ble_gatts_cb_param_t param;
+ param.add_attr_tab.status = ESP_GATT_OK;
+ param.add_attr_tab.num_handle = max_nb_attr;
+
+ // To add a large attribute table, need to enlarge BTC_TASK_QUEUE_NUM
+ if (max_nb_attr > BTC_TASK_QUEUE_NUM){
+ param.add_attr_tab.status = ESP_GATT_NO_RESOURCES;
+ }
+
+ if (param.add_attr_tab.status != ESP_GATT_OK){
+ btc_gatts_cb_to_app(ESP_GATTS_CREAT_ATTR_TAB_EVT, gatts_if, ¶m);
+ return;
+ }
+
//set the attribute table create service flag to true
btc_creat_tab_env.is_tab_creat_svc = true;
}
- param.add_attr_tab.status = ESP_GATT_OK;
- param.add_attr_tab.num_handle = max_nb_attr;
param.add_attr_tab.handles = btc_creat_tab_env.handles;
memcpy(¶m.add_attr_tab.svc_uuid, &btc_creat_tab_env.svc_uuid, sizeof(esp_bt_uuid_t));
#endif
btif_dm_proc_io_req(bd_addr, p_io_cap, p_oob_data, p_auth_req, is_orig);
#else
- LOG_ERROR("bta_dm_co_io_req: func not ported\n");
+ BTIF_TRACE_DEBUG("bta_dm_co_io_req: func not ported\n");
#endif /* #if (defined(BTIF_INCLUDED) && BTIF_INCLUDED == TRUE) */
BTIF_TRACE_DEBUG("bta_dm_co_io_req *p_oob_data = %d", *p_oob_data);
BTIF_TRACE_DEBUG("bta_dm_co_io_req *p_io_cap = %d", *p_io_cap);
#if (defined(BTIF_INCLUDED) && BTIF_INCLUDED == TRUE)
btif_dm_proc_io_rsp(bd_addr, io_cap, oob_data, auth_req);
#else
- LOG_ERROR("bta_dm_co_io_rsp: func not ported\n");
+ BTIF_TRACE_DEBUG("bta_dm_co_io_rsp: func not ported\n");
#endif /* #if (defined(BTIF_INCLUDED) && BTIF_INCLUDED == TRUE) */
}
btif_dm_proc_loc_oob(valid, c, r);
#endif
#else
- LOG_ERROR("bta_dm_co_loc_oob: func not ported\n");
+ BTIF_TRACE_DEBUG("bta_dm_co_loc_oob: func not ported\n");
#endif /* #if (defined(BTIF_INCLUDED) && BTIF_INCLUDED == TRUE) */
}
#if (defined(BTIF_INCLUDED) && BTIF_INCLUDED == TRUE)
result = btif_dm_proc_rmt_oob(bd_addr, p_c, p_r);
#else
- LOG_ERROR("bta_dm_rmt_oob: func not ported\n");
+ BTIF_TRACE_DEBUG("bta_dm_rmt_oob: func not ported\n");
#endif /* #if (defined(BTIF_INCLUDED) && BTIF_INCLUDED == TRUE) */
#endif
{
UNUSED(bd_addr);
#if (SMP_INCLUDED == TRUE)
- BTIF_TRACE_ERROR("##################################");
- BTIF_TRACE_ERROR("bta_dm_co_le_io_key_req: only setting max size to 16");
- BTIF_TRACE_ERROR("##################################");
+ BTIF_TRACE_DEBUG("##################################");
+ BTIF_TRACE_DEBUG("bta_dm_co_le_io_key_req: only setting max size to 16");
+ BTIF_TRACE_DEBUG("##################################");
*p_max_key_size = 16;
*p_init_key = *p_resp_key =
(BTA_LE_KEY_PENC | BTA_LE_KEY_PID | BTA_LE_KEY_PCSRK | BTA_LE_KEY_LENC | BTA_LE_KEY_LID | BTA_LE_KEY_LCSRK);
#endif ///defined(BTIF_INCLUDED) && BTIF_INCLUDED == TRUE
#if (SMP_INCLUDED == TRUE)
btc_dm_get_ble_local_keys( p_key_mask, er, p_id_keys);
- LOG_WARN("bta_dm_co_ble_load_local_keys: func not ported\n");
+ BTIF_TRACE_DEBUG("bta_dm_co_ble_load_local_keys: func not ported\n");
#endif ///SMP_INCLUDED == TRUE
}
}
//Now Test Case Not Supported BTU
- LOG_ERROR("Startup BTU\n");
BTU_StartUp();
}
STREAM_TO_UINT8 (role, p);
STREAM_TO_UINT8 (bda_type, p);
STREAM_TO_BDADDR (bda, p);
- BTM_TRACE_ERROR("status = %d, handle = %d, role = %d, bda_type = %d",status,handle,role,bda_type);
+ BTM_TRACE_DEBUG("status = %d, handle = %d, role = %d, bda_type = %d",status,handle,role,bda_type);
if (status == 0) {
#if (BLE_PRIVACY_SPT == TRUE )
peer_addr_type = bda_type;
p_cb_data->p_pad = p;
if (mask != 0) {
- BTM_TRACE_ERROR("Partial data write into ADV");
+ BTM_TRACE_DEBUG("Partial data write into ADV");
}
p_cb_data->data_mask &= ~mask;
case HCI_BLE_EVENT:
STREAM_TO_UINT8 (ble_sub_code, p);
- HCI_TRACE_ERROR("BLE HCI(id=%d) event = 0x%02x)", hci_evt_code, ble_sub_code);
+ HCI_TRACE_DEBUG("BLE HCI(id=%d) event = 0x%02x)", hci_evt_code, ble_sub_code);
switch (ble_sub_code) {
case HCI_BLE_ADV_PKT_RPT_EVT: /* result of inquiry */
GATT_StartIf(gatt_cb.gatt_if);
service_handle = GATTS_CreateService (gatt_cb.gatt_if , &uuid, 0, GATTP_MAX_ATTR_NUM, TRUE);
- GATT_TRACE_ERROR ("GATTS_CreateService: handle of service handle%x", service_handle);
+ GATT_TRACE_DEBUG ("GATTS_CreateService: handle of service handle%x", service_handle);
/* add Service Changed characteristic
*/
{
BT_HDR *p;
UINT8 *pp;
- HCI_TRACE_ERROR("####################adv_type = %d",adv_type);
if ((p = HCI_GET_CMD_BUF(HCIC_PARAM_SIZE_BLE_WRITE_ADV_PARAMS)) == NULL) {
return (FALSE);
}
*******************************************************************************/
BOOLEAN L2CA_RegisterFixedChannel (UINT16 fixed_cid, tL2CAP_FIXED_CHNL_REG *p_freg)
{
- L2CAP_TRACE_ERROR ("L2CA_RegisterFixedChannel() CID: 0x%04x, %p", fixed_cid,p_freg);
+ L2CAP_TRACE_DEBUG ("L2CA_RegisterFixedChannel() CID: 0x%04x, %p", fixed_cid,p_freg);
if ( (fixed_cid < L2CAP_FIRST_FIXED_CHNL) || (fixed_cid > L2CAP_LAST_FIXED_CHNL) ) {
L2CAP_TRACE_ERROR ("L2CA_RegisterFixedChannel() Invalid CID: 0x%04x", fixed_cid);
num_lm_ble_bufs = L2C_DEF_NUM_BLE_BUF_SHARED;
l2cb.num_lm_acl_bufs -= L2C_DEF_NUM_BLE_BUF_SHARED;
}
- L2CAP_TRACE_ERROR("#####################################num_lm_ble_bufs = %d",num_lm_ble_bufs);
+ L2CAP_TRACE_DEBUG("#####################################num_lm_ble_bufs = %d",num_lm_ble_bufs);
l2cb.num_lm_ble_bufs = l2cb.controller_le_xmit_window = num_lm_ble_bufs;
}
#ifdef CONFIG_SET_RAW_ADV_DATA
static uint8_t raw_adv_data[] = {
- 0x02, 0x01, 0x06, 0x0f, 0x09, 0x45, 0x53, 0x50, 0x5f, 0x47, 0x41, 0x54, 0x54, 0x53, 0x5f, 0x44,
- 0x45, 0x4d, 0x4f, 0x02, 0x0a, 0xeb, 0x03, 0x03, 0xab, 0xcd
+ 0x02, 0x01, 0x06,
+ 0x02, 0x0a, 0xeb, 0x03, 0x03, 0xab, 0xcd
};
static uint8_t raw_scan_rsp_data[] = {
- 0x02, 0x01, 0x06, 0x0f, 0x09, 0x45, 0x53, 0x50, 0x5f, 0x47, 0x41, 0x54, 0x54, 0x53, 0x5f, 0x44,
- 0x45, 0x4d, 0x4f, 0x02, 0x0a, 0xeb, 0x03, 0x03, 0xab, 0xcd
+ 0x0f, 0x09, 0x45, 0x53, 0x50, 0x5f, 0x47, 0x41, 0x54, 0x54, 0x53, 0x5f, 0x44,
+ 0x45, 0x4d, 0x4f
};
#else
static uint8_t test_service_uuid128[32] = {
if (param->adv_start_cmpl.status != ESP_BT_STATUS_SUCCESS) {
ESP_LOGE(GATTS_TAG, "Advertising start failed\n");
}
+ break;
case ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT:
if (param->adv_stop_cmpl.status != ESP_BT_STATUS_SUCCESS) {
ESP_LOGE(GATTS_TAG, "Advertising stop failed\n");
case ESP_GATTS_CONGEST_EVT:
break;
case ESP_GATTS_CREAT_ATTR_TAB_EVT:{
- ESP_LOGE(GATTS_TABLE_TAG, "The number handle =%x\n",param->add_attr_tab.num_handle);
- if(param->add_attr_tab.num_handle == HRS_IDX_NB){
- memcpy(heart_rate_handle_table, param->add_attr_tab.handles,
- sizeof(heart_rate_handle_table));
- esp_ble_gatts_start_service(heart_rate_handle_table[HRS_IDX_SVC]);
- }
+ ESP_LOGI(GATTS_TABLE_TAG, "The number handle =%x\n",param->add_attr_tab.num_handle);
+ if (param->add_attr_tab.status != ESP_GATT_OK){
+ ESP_LOGE(GATTS_TABLE_TAG, "Create attribute table failed, error code=0x%x", param->add_attr_tab.status);
+ }
+ else if (param->add_attr_tab.num_handle != HRS_IDX_NB){
+ ESP_LOGE(GATTS_TABLE_TAG, "Create attribute table abnormally, num_handle (%d) \
+ doesn't equal to HRS_IDX_NB(%d)", param->add_attr_tab.num_handle, HRS_IDX_NB);
+ }
+ else {
+ memcpy(heart_rate_handle_table, param->add_attr_tab.handles, sizeof(heart_rate_handle_table));
+ esp_ble_gatts_start_service(heart_rate_handle_table[HRS_IDX_SVC]);
+ }
+ break;
+ }
- break;
- }
-
default:
break;
}