This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

indication issue

Hi all,

someone can please explain to me how works the indication?

How can i read the value of cccd in the APP?My problem is understand if the APP is ready to receive the indication. i would like read the cccd value berfore to send my logs.

Thanks, Anna

Parents
  • You need to be more specific. What is it that you want explained?

    You second question seems to be answered here.

  • if i understand correctly the sd_ble_gatts_value_get() allows me to understand if the app is available to receive the indication, but if i use it the value of ccd is always 0. Maybe, i wrong pass the parameter in the function. This is my code:

    void DataLog_SVC_SendEvent(uint8_t typeLog, uint8_t craving, uint32_t timestamp,uint8_t crc) {

    ble_data_log_service_user_log_t data; ble_gatts_value_t gatts_value; ble_data_log_service_evt_type_t evt_type;

    uint32_t err_code;

    data.flags=typeLog;

    data.craving = craving;

    data.time = timestamp;

    data.crc_8 = crc;

    err_code = sd_ble_gatts_value_get(m_datalog.conn_handle,m_datalog.user_log_handles.cccd_handle,&gatts_value);

    // ble_srv_is_indication_enabled(m_datalog.user_log_handles.cccd_handle);

    err_code = ble_data_log_service_user_log_send(&m_datalog,&data);

    // APP_ERROR_CHECK(err_code); }

Reply
  • if i understand correctly the sd_ble_gatts_value_get() allows me to understand if the app is available to receive the indication, but if i use it the value of ccd is always 0. Maybe, i wrong pass the parameter in the function. This is my code:

    void DataLog_SVC_SendEvent(uint8_t typeLog, uint8_t craving, uint32_t timestamp,uint8_t crc) {

    ble_data_log_service_user_log_t data; ble_gatts_value_t gatts_value; ble_data_log_service_evt_type_t evt_type;

    uint32_t err_code;

    data.flags=typeLog;

    data.craving = craving;

    data.time = timestamp;

    data.crc_8 = crc;

    err_code = sd_ble_gatts_value_get(m_datalog.conn_handle,m_datalog.user_log_handles.cccd_handle,&gatts_value);

    // ble_srv_is_indication_enabled(m_datalog.user_log_handles.cccd_handle);

    err_code = ble_data_log_service_user_log_send(&m_datalog,&data);

    // APP_ERROR_CHECK(err_code); }

Children
No Data
Related