I need to read each second my sensor . esp32 is ble client. i want to use timer each second that read ble charac. I don't use notification to save batterie, as i know i have to read each second.
All example use notification.
I call in timer :
Code: Select all
esp_gatt_status_t status = esp_ble_gattc_read_by_type(
gl_profile_tab[GATTC_PROFILE_A_APP_ID].gattc_if, //on lance la lecture, on a recupere la data dans l'event de succes de lecture dans gatt handler
gl_profile_tab[GATTC_PROFILE_A_APP_ID].conn_id,
gl_profile_tab[GATTC_PROFILE_A_APP_ID].service_start_handle,
gl_profile_tab[GATTC_PROFILE_A_APP_ID].service_end_handle,
&filter_service_av,
ESP_GATT_AUTH_REQ_SIGNED_NO_MITM);
It raise well read event in ble client handler but after going out from the handler, it crash with
Guru Meditation Error: Core 0 panic'ed (StoreProhibited) error
I can rea dmy sensor if instead of esp_ble_gattc_read_by_type, i try to discover service to generate ESP_GATTC_SEARCH_CMPL_EVT and then call: esp_ble_gattc_get_char_by_uuid and just after esp_ble_gattc_read_char
Should i call directly esp_ble_gattc_read_char in timer ?
But how to know whitch handle to call ?
Thanks a lot for your help !