Hi I am also struggling to add multiple characteristics.
Code: Select all
case ESP_GATTS_CREATE_EVT:
ESP_LOGI(GATTS_TAG, "CREATE_SERVICE_EVT, status %d, service_handle %d\n", param->create.status, param->create.service_handle);
gl_profile_tab[PROFILE_A_APP_ID].service_handle = param->create.service_handle;
gl_profile_tab[PROFILE_A_APP_ID].char_uuid.len = ESP_UUID_LEN_16;
gl_profile_tab[PROFILE_A_APP_ID].char_uuid.uuid.uuid16 = GATTS_CHAR_UUID_TEST_A;
esp_ble_gatts_start_service(gl_profile_tab[PROFILE_A_APP_ID].service_handle);
esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
ESP_GATT_CHAR_PROP_BIT_READ | ESP_GATT_CHAR_PROP_BIT_NOTIFY,
&gatts_demo_char1_val, NULL);
esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE,
ESP_GATT_CHAR_PROP_BIT_WRITE,
&gatts_demo_char2_val, NULL);
right now I modified gatts demo app like this and I gett following thing . and does not show other char in bleScanner android app.
Code: Select all
(532) GATTS_DEMO: REGISTER_APP_EVT, status 0, app_id 0
I (532) GATTS_DEMO: CREATE_SERVICE_EVT, status 0, service_handle 40
I (542) GATTS_DEMO: SERVICE_START_EVT, status 0, service_handle 40
I (542) GATTS_DEMO: ADD_CHAR_EVT, status 0, attr_handle 42, service_handle 40
I (552) GATTS_DEMO: the gatts demo char length = 3
I (552) GATTS_DEMO: prf_char[0] =11
I (562) GATTS_DEMO: prf_char[1] =22
I (562) GATTS_DEMO: prf_char[2] =33
I (562) GATTS_DEMO: ADD_CHAR_EVT, status 133, attr_handle 0, service_handle 40 <---- -why status 133 here? what does it mean
I (572) GATTS_DEMO: the gatts demo char length = 0 <---- this means its not added
I (582) GATTS_DEMO: ADD_DESCR_EVT, status 0, attr_handle 43, service_handle 40
I (592) GATTS_DEMO: ADD_DESCR_EVT, status 133, attr_handle 0, service_handle 40
Thanks.