This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Trouble to read, write and activate notification

Hello comunnity,

I am trying to read, write and activite notification from my server using a central device. The problem is when I use more than 2 times, I got an error of NRF_ERROR_INVALID_DATA But When i do it separetly the code works. Screenshoot

I attached a picture of my output, First I read the Hz, then I write a new HZ, after this I read again the HZ and the end I activate some notifications. Eventhought, after each sentence I put a delay and it's having the same problem

Why is this behavior?

Regards, David Caraveo

Parents
  • Hi,

    What functions are returning the 0x11 error code?

  • Hi Sigurd, the funcions that I am using are the followin: Activating the notifications: err_code = sd_ble_gattc_write(m_conn_handle[conn_nummber], &write_params); Reading: err_code = sd_ble_gattc_read(m_conn_handle[conn_nummber],FREQUUID,0);

    Set the Freque. err_code = sd_ble_gattc_write(m_conn_handle[conn_nummber], & write_params_SR);

    uint8_t p_value[2] = {0x01, 0x01}; /*/ uint8_t sample_rate = 0x64; /*/

    static ble_gattc_write_params_t const write_params = { .write_op = BLE_GATT_OP_WRITE_REQ, .handle = QUATERNIOSUUID, .offset = 0, .len = 2, .p_value = (uint8_t *)&p_value };

    static ble_gattc_write_params_t write_params_SR = { .write_op = BLE_GATT_OP_WRITE_REQ, .handle = FREQUUID, .offset = 0, .len = sizeof(sample_rate), .p_value = (uint8_t *)&sample_rate };

Reply
  • Hi Sigurd, the funcions that I am using are the followin: Activating the notifications: err_code = sd_ble_gattc_write(m_conn_handle[conn_nummber], &write_params); Reading: err_code = sd_ble_gattc_read(m_conn_handle[conn_nummber],FREQUUID,0);

    Set the Freque. err_code = sd_ble_gattc_write(m_conn_handle[conn_nummber], & write_params_SR);

    uint8_t p_value[2] = {0x01, 0x01}; /*/ uint8_t sample_rate = 0x64; /*/

    static ble_gattc_write_params_t const write_params = { .write_op = BLE_GATT_OP_WRITE_REQ, .handle = QUATERNIOSUUID, .offset = 0, .len = 2, .p_value = (uint8_t *)&p_value };

    static ble_gattc_write_params_t write_params_SR = { .write_op = BLE_GATT_OP_WRITE_REQ, .handle = FREQUUID, .offset = 0, .len = sizeof(sample_rate), .p_value = (uint8_t *)&sample_rate };

Children
No Data
Related