I am making a bluetooth BLE aplication and i want to create serveral characteristics under the same service, some of those are for Notify, some are for Read and some for Write.
I had made the Notify ones and they work as i want. I have a function that its called via a timer that indicates when the data is ready and that function sends the notify data.
The problem its when i want to read or write... since there are several characteristics and i am trying to diferenciate from the handler. I cant find how to make this. I dont know what to compare... what to write inside the "if" statment.
I had started from the "gatt_server_service_table" example.
I have asked google and chatGPT but no success.
Can you help me?
Search for "-----------------------------> HERE IS THE PROBLEM <----------------------------------" in the codebox
Full Database Description
- /* Full Database Description - Used to add attributes into the database */
- static const esp_gatts_attr_db_t gatt_db[HRS_IDX_NB] =
- {
- // Service Declaration
- [IDX_SVC] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&primary_service_uuid, ESP_GATT_PERM_READ,
- sizeof(uint16_t), sizeof(GATTS_SERVICE_UUID_TEST), (uint8_t *)&GATTS_SERVICE_UUID_TEST}},
- /* Characteristic Declaration */
- [IDX_CHAR_A] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
- CHAR_DECLARATION_SIZE, CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read_write_notify}},
- /* Characteristic Value */
- [IDX_CHAR_VAL_A] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&GATTS_CHAR_UUID_TEST_A, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- GATTS_DEMO_CHAR_VAL_LEN_MAX, sizeof(char_value), (uint8_t *)char_value}},
- /* Client Characteristic Configuration Descriptor */
- [IDX_CHAR_CFG_A] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_client_config_uuid, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- sizeof(uint16_t), sizeof(heart_measurement_ccc), (uint8_t *)heart_measurement_ccc}},
- /* Characteristic Declaration */
- [IDX_CHAR_B] =
- {{ESP_GATT_RSP_BY_APP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
- CHAR_DECLARATION_SIZE, CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read}},
- /* Characteristic Value */
- [IDX_CHAR_VAL_B] =
- {{ESP_GATT_RSP_BY_APP}, {ESP_UUID_LEN_16, (uint8_t *)&GATTS_CHAR_UUID_TEST_B, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- GATTS_DEMO_CHAR_VAL_LEN_MAX, sizeof(char_value), (uint8_t *)char_value}},
- /* Descripción para Característica B */
- [IDX_CHAR_DESCR_B] =
- {{ESP_GATT_RSP_BY_APP}, {ESP_UUID_LEN_16, (uint8_t *)&descr_uuid, ESP_GATT_PERM_READ,
- strlen(CHAR_DESCRIP_B), strlen(CHAR_DESCRIP_B), (uint8_t *)CHAR_DESCRIP_B}},
- /* Characteristic Declaration */
- [IDX_CHAR_C] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
- CHAR_DECLARATION_SIZE, CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_write}},
- /* Characteristic Value */
- [IDX_CHAR_VAL_C] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&GATTS_CHAR_UUID_TEST_C, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- GATTS_DEMO_CHAR_VAL_LEN_MAX, sizeof(char_value), (uint8_t *)char_value}},
- /* Descripción para Característica C */
- [IDX_CHAR_DESCR_C] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&descr_uuid, ESP_GATT_PERM_READ,
- strlen(CHAR_DESCRIP_C), strlen(CHAR_DESCRIP_C), (uint8_t *)CHAR_DESCRIP_C}},
- /* Agregado por Jose */
- /* Characteristic Declaration */
- [IDX_CHAR_D] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
- CHAR_DECLARATION_SIZE, CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read_notify}},
- /* Characteristic Value */
- [IDX_CHAR_VAL_D] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&GATTS_CHAR_UUID_TEST_D, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- GATTS_DEMO_CHAR_VAL_LEN_MAX, sizeof(char_value), (uint8_t *)char_value}},
- /* Client Characteristic Configuration Descriptor */
- [IDX_CHAR_CFG_D] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_client_config_uuid, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- sizeof(uint16_t), sizeof(heart_measurement_ccc), (uint8_t *)heart_measurement_ccc}},
- /* Descripción para Característica E */
- [IDX_CHAR_DESCR_D] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&descr_uuid, ESP_GATT_PERM_READ,
- strlen(CHAR_DESCRIP_D), strlen(CHAR_DESCRIP_D), (uint8_t *)CHAR_DESCRIP_D}},
- /* Characteristic Declaration */
- [IDX_CHAR_E] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
- CHAR_DECLARATION_SIZE, CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read_notify}},
- /* Characteristic Value */
- [IDX_CHAR_VAL_E] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&GATTS_CHAR_UUID_TEST_E, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- GATTS_DEMO_CHAR_VAL_LEN_MAX, sizeof(char_value), (uint8_t *)char_value}},
- /* Client Characteristic Configuration Descriptor */
- [IDX_CHAR_CFG_E] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_client_config_uuid, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- sizeof(uint16_t), sizeof(heart_measurement_ccc), (uint8_t *)heart_measurement_ccc}},
- /* Descripción para Característica E */
- [IDX_CHAR_DESCR_E] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&descr_uuid, ESP_GATT_PERM_READ,
- strlen(CHAR_DESCRIP_E), strlen(CHAR_DESCRIP_E), (uint8_t *)CHAR_DESCRIP_E}},
- //CARACTERISTICAS DE ESCRITURA
- /* Characteristic Declaration */
- [IDX_CHAR_0] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
- CHAR_DECLARATION_SIZE, CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read_notify}},
- /* Characteristic Value */
- [IDX_CHAR_VAL_0] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&GATTS_CHAR_UUID_TEST_0, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- GATTS_DEMO_CHAR_VAL_LEN_MAX, sizeof(char_value), (uint8_t *)char_value}},
- /* Client Characteristic Configuration Descriptor */
- [IDX_CHAR_CFG_0] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_client_config_uuid, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- sizeof(uint16_t), sizeof(heart_measurement_ccc), (uint8_t *)heart_measurement_ccc}},
- /* Descripción para Característica E */
- [IDX_CHAR_DESCR_0] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&descr_uuid, ESP_GATT_PERM_READ,
- strlen(CHAR_DESCRIP_0), strlen(CHAR_DESCRIP_0), (uint8_t *)CHAR_DESCRIP_0}},
- [IDX_CHAR_1] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
- CHAR_DECLARATION_SIZE, CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read_notify}},
- /* Characteristic Value */
- [IDX_CHAR_VAL_1] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&GATTS_CHAR_UUID_TEST_1, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- GATTS_DEMO_CHAR_VAL_LEN_MAX, sizeof(char_value), (uint8_t *)char_value}},
- /* Client Characteristic Configuration Descriptor */
- [IDX_CHAR_CFG_1] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_client_config_uuid, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- sizeof(uint16_t), sizeof(heart_measurement_ccc), (uint8_t *)heart_measurement_ccc}},
- /* Descripción para Característica E */
- [IDX_CHAR_DESCR_1] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&descr_uuid, ESP_GATT_PERM_READ,
- strlen(CHAR_DESCRIP_1), strlen(CHAR_DESCRIP_1), (uint8_t *)CHAR_DESCRIP_1}},
- [IDX_CHAR_2] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_declaration_uuid, ESP_GATT_PERM_READ,
- CHAR_DECLARATION_SIZE, CHAR_DECLARATION_SIZE, (uint8_t *)&char_prop_read_notify}},
- /* Characteristic Value */
- [IDX_CHAR_VAL_2] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&GATTS_CHAR_UUID_TEST_2, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- GATTS_DEMO_CHAR_VAL_LEN_MAX, sizeof(char_value), (uint8_t *)char_value}},
- /* Client Characteristic Configuration Descriptor */
- [IDX_CHAR_CFG_2] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&character_client_config_uuid, ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
- sizeof(uint16_t), sizeof(heart_measurement_ccc), (uint8_t *)heart_measurement_ccc}},
- /* Descripción para Característica E */
- [IDX_CHAR_DESCR_2] =
- {{ESP_GATT_AUTO_RSP}, {ESP_UUID_LEN_16, (uint8_t *)&descr_uuid, ESP_GATT_PERM_READ,
- strlen(CHAR_DESCRIP_2), strlen(CHAR_DESCRIP_2), (uint8_t *)CHAR_DESCRIP_2}},
- };
- static void gatts_profile_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param)
- {
- switch (event) {
- case ESP_GATTS_REG_EVT:{
- esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(SAMPLE_DEVICE_NAME);
- if (set_dev_name_ret){
- ESP_LOGE(GATTS_TABLE_TAG, "set device name failed, error code = %x", set_dev_name_ret);
- }
- #ifdef CONFIG_SET_RAW_ADV_DATA
- esp_err_t raw_adv_ret = esp_ble_gap_config_adv_data_raw(raw_adv_data, sizeof(raw_adv_data));
- if (raw_adv_ret){
- ESP_LOGE(GATTS_TABLE_TAG, "config raw adv data failed, error code = %x ", raw_adv_ret);
- }
- adv_config_done |= ADV_CONFIG_FLAG;
- esp_err_t raw_scan_ret = esp_ble_gap_config_scan_rsp_data_raw(raw_scan_rsp_data, sizeof(raw_scan_rsp_data));
- if (raw_scan_ret){
- ESP_LOGE(GATTS_TABLE_TAG, "config raw scan rsp data failed, error code = %x", raw_scan_ret);
- }
- adv_config_done |= SCAN_RSP_CONFIG_FLAG;
- #else
- //config adv data
- esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
- if (ret){
- ESP_LOGE(GATTS_TABLE_TAG, "config adv data failed, error code = %x", ret);
- }
- adv_config_done |= ADV_CONFIG_FLAG;
- //config scan response data
- ret = esp_ble_gap_config_adv_data(&scan_rsp_data);
- if (ret){
- ESP_LOGE(GATTS_TABLE_TAG, "config scan response data failed, error code = %x", ret);
- }
- adv_config_done |= SCAN_RSP_CONFIG_FLAG;
- #endif
- esp_err_t create_attr_ret = esp_ble_gatts_create_attr_tab(gatt_db, gatts_if, HRS_IDX_NB, SVC_INST_ID);
- if (create_attr_ret){
- ESP_LOGE(GATTS_TABLE_TAG, "create attr table failed, error code = %x", create_attr_ret);
- }
- }
- break;
- case ESP_GATTS_READ_EVT:
- ESP_LOGI(GATTS_TABLE_TAG, "ESP_GATTS_READ_EVT");
- esp_gatt_rsp_t rsp;
- memset(&rsp, 0, sizeof(esp_gatt_rsp_t));
- rsp.attr_value.handle = param->read.handle;
- if (-----------------------------> HERE IS THE PROBLEM <----------------------------------){
- if ( getWifiConnStatus() != WIFI_STATUS_OFF ) {
- rsp.attr_value.len = 6;
- uint64_t productUID = getUniqueID(); //TODO Modificar esto para que lea el UID desde la memoria y no desde la MAC, por si mañana cambia
- //ESP_LOGI(GATTS_TABLE_TAG, "MAC = %lld", productUID);
- for (uint8_t i = 0 ; i < 6 ; i++){
- rsp.attr_value.value[i] = ((uint8_t)(productUID>>(8*i)) & 0xFF);
- //ESP_LOGI(GATTS_TABLE_TAG, "Byte = %d", rsp.attr_value.value[i]);
- }
- }
- }
- esp_ble_gatts_send_response(gatts_if, param->read.conn_id, param->read.trans_id,
- ESP_GATT_OK, &rsp);
- break;
- case ESP_GATTS_WRITE_EVT:
- if (!param->write.is_prep){
- // the data length of gattc write must be less than GATTS_DEMO_CHAR_VAL_LEN_MAX.
- ESP_LOGI(GATTS_TABLE_TAG, "GATT_WRITE_EVT, handle = %d, value len = %d, value :", param->write.handle, param->write.len);
- esp_log_buffer_hex(GATTS_TABLE_TAG, param->write.value, param->write.len);
- //Habilitacion de notificaciones de caracteristicas
- if (heart_rate_handle_table[IDX_CHAR_CFG_A] == param->write.handle && param->write.len == 2){
- uint16_t descr_value = param->write.value[1]<<8 | param->write.value[0];
- if (descr_value == 0x0001){
- ESP_LOGI(GATTS_TABLE_TAG, "notify enable");
- heart_rate_profile_tab[PROFILE_APP_IDX].conn_id = param->write.conn_id;
- }else if (descr_value == 0x0002){
- ESP_LOGI(GATTS_TABLE_TAG, "indicate enable");
- uint8_t indicate_data[15];
- for (int i = 0; i < sizeof(indicate_data); ++i)
- {
- indicate_data[i] = i % 0xff;
- }
- //the size of indicate_data[] need less than MTU size
- esp_ble_gatts_send_indicate(gatts_if, param->write.conn_id, heart_rate_handle_table[IDX_CHAR_VAL_A],
- sizeof(indicate_data), indicate_data, true);
- }
- else if (descr_value == 0x0000){
- ESP_LOGI(GATTS_TABLE_TAG, "notify/indicate disable ");
- //setBTMotorSpeedNotifStatus(NOTIF_DISABLED);
- }else{
- ESP_LOGE(GATTS_TABLE_TAG, "unknown descr value");
- esp_log_buffer_hex(GATTS_TABLE_TAG, param->write.value, param->write.len);
- }
- }
- //Velocidad del Motor
- if (heart_rate_handle_table[IDX_CHAR_CFG_D] == param->write.handle && param->write.len == 2){
- uint16_t descr_value = param->write.value[1]<<8 | param->write.value[0];
- if (descr_value == 0x0001){
- ESP_LOGI(GATTS_TABLE_TAG, "notify enable");
- heart_rate_profile_tab[PROFILE_APP_IDX].conn_id = param->write.conn_id;
- setBTMotorSpeedNotifStatus(NOTIF_ENABLED); //Agregado por Jose
- }else if (descr_value == 0x0002){
- ESP_LOGI(GATTS_TABLE_TAG, "indicate enable");
- uint8_t indicate_data[15];
- for (int i = 0; i < sizeof(indicate_data); ++i)
- {
- indicate_data[i] = i % 0xff;
- }
- //the size of indicate_data[] need less than MTU size
- esp_ble_gatts_send_indicate(gatts_if, param->write.conn_id, heart_rate_handle_table[IDX_CHAR_VAL_A],
- sizeof(indicate_data), indicate_data, true);
- }
- else if (descr_value == 0x0000){
- ESP_LOGI(GATTS_TABLE_TAG, "notify/indicate disable ");
- xTimerStop(notify_timer_handle, 0);
- setBTMotorSpeedNotifStatus(NOTIF_DISABLED); //Agregado por Jose
- }else{
- ESP_LOGE(GATTS_TABLE_TAG, "unknown descr value");
- esp_log_buffer_hex(GATTS_TABLE_TAG, param->write.value, param->write.len);
- }
- }
- //Potencia del Motor
- if (heart_rate_handle_table[IDX_CHAR_CFG_E] == param->write.handle && param->write.len == 2){
- uint16_t descr_value = param->write.value[1]<<8 | param->write.value[0];
- if (descr_value == 0x0001){
- ESP_LOGI(GATTS_TABLE_TAG, "notify enable");
- heart_rate_profile_tab[PROFILE_APP_IDX].conn_id = param->write.conn_id;
- setBTMotorPowerNotifStatus(NOTIF_ENABLED); //Agregado por Jose
- }else if (descr_value == 0x0002){
- ESP_LOGI(GATTS_TABLE_TAG, "indicate enable");
- uint8_t indicate_data[15];
- for (int i = 0; i < sizeof(indicate_data); ++i)
- {
- indicate_data[i] = i % 0xff;
- }
- //the size of indicate_data[] need less than MTU size
- esp_ble_gatts_send_indicate(gatts_if, param->write.conn_id, heart_rate_handle_table[IDX_CHAR_VAL_A],
- sizeof(indicate_data), indicate_data, true);
- }
- else if (descr_value == 0x0000){
- ESP_LOGI(GATTS_TABLE_TAG, "notify/indicate disable ");
- xTimerStop(notify_timer_handle, 0);
- setBTMotorPowerNotifStatus(NOTIF_DISABLED); //Agregado por Jose
- }else{
- ESP_LOGE(GATTS_TABLE_TAG, "unknown descr value");
- esp_log_buffer_hex(GATTS_TABLE_TAG, param->write.value, param->write.len);
- }
- }
- /* send response when param->write.need_rsp is true*/
- if (param->write.need_rsp){
- esp_ble_gatts_send_response(gatts_if, param->write.conn_id, param->write.trans_id, ESP_GATT_OK, NULL);
- }
- }else{
- /* handle prepare write */
- example_prepare_write_event_env(gatts_if, &prepare_write_env, param);
- }
- break;
- case ESP_GATTS_EXEC_WRITE_EVT:
- // the length of gattc prepare write data must be less than GATTS_DEMO_CHAR_VAL_LEN_MAX.
- ESP_LOGI(GATTS_TABLE_TAG, "ESP_GATTS_EXEC_WRITE_EVT");
- example_exec_write_event_env(&prepare_write_env, param);
- break;
- case ESP_GATTS_MTU_EVT:
- ESP_LOGI(GATTS_TABLE_TAG, "ESP_GATTS_MTU_EVT, MTU %d", param->mtu.mtu);
- break;
- case ESP_GATTS_CONF_EVT:
- //ESP_LOGI(GATTS_TABLE_TAG, "ESP_GATTS_CONF_EVT, status = %d, attr_handle %d", param->conf.status, param->conf.handle);
- break;
- case ESP_GATTS_START_EVT:
- ESP_LOGI(GATTS_TABLE_TAG, "SERVICE_START_EVT, status %d, service_handle %d", param->start.status, param->start.service_handle);
- break;
- case ESP_GATTS_CONNECT_EVT:
- ESP_LOGI(GATTS_TABLE_TAG, "ESP_GATTS_CONNECT_EVT, conn_id = %d", param->connect.conn_id);
- //Agregada por Jose
- setBTStatus(BT_CONNECTED);
- esp_log_buffer_hex(GATTS_TABLE_TAG, param->connect.remote_bda, 6);
- esp_ble_conn_update_params_t conn_params = {0};
- memcpy(conn_params.bda, param->connect.remote_bda, sizeof(esp_bd_addr_t));
- /* For the iOS system, please refer to Apple official documents about the BLE connection parameters restrictions. */
- conn_params.latency = 0;
- conn_params.max_int = 0x20; // max_int = 0x20*1.25ms = 40ms
- conn_params.min_int = 0x10; // min_int = 0x10*1.25ms = 20ms
- conn_params.timeout = 400; // timeout = 400*10ms = 4000ms
- //start sent the update connection parameters to the peer device.
- esp_ble_gap_update_conn_params(&conn_params);
- break;
- case ESP_GATTS_DISCONNECT_EVT:
- ESP_LOGI(GATTS_TABLE_TAG, "ESP_GATTS_DISCONNECT_EVT, reason = 0x%x", param->disconnect.reason);
- setBTStatus(BT_DISCONNECTED); //Agregada por Jose
- esp_ble_gap_start_advertising(&adv_params);
- break;
- case ESP_GATTS_CREAT_ATTR_TAB_EVT:{
- 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 {
- ESP_LOGI(GATTS_TABLE_TAG, "create attribute table successfully, the number handle = %d\n",param->add_attr_tab.num_handle);
- memcpy(heart_rate_handle_table, param->add_attr_tab.handles, sizeof(heart_rate_handle_table));
- esp_ble_gatts_start_service(heart_rate_handle_table[IDX_SVC]);
- }
- break;
- }
- case ESP_GATTS_STOP_EVT:
- case ESP_GATTS_OPEN_EVT:
- case ESP_GATTS_CANCEL_OPEN_EVT:
- case ESP_GATTS_CLOSE_EVT:
- case ESP_GATTS_LISTEN_EVT:
- case ESP_GATTS_CONGEST_EVT:
- case ESP_GATTS_UNREG_EVT:
- case ESP_GATTS_DELETE_EVT:
- default:
- break;
- }
- }