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

concurrent characteristic

I have nrf51822 with latest sd130.

I need to implement central what connects to smartphone. Phone has two characteristics with HVX. First char is sending one byte after 80 ms. Second char is sending bigger data after 100 ms. Second char data processing takes 400ms and I do it in read response. When I am processing second char data is the first char data coming in concurrently or is the second char blocking until I return read response?

Parents
  • I add my code flow to understand better

    I register ble event handler softdevice_ble_evt_handler_set(ble_evt_dispatch);

    in central side after discovery I configure read characteristics to get HVX notification. Character A Character B

    Now when when HWX is triggered I got event to ble_evt_dispatch event id is BLE_GATTC_EVT_HVX

    In my case I get it from Character A after every 80 ms and from CHaracter B after every 100 ms.

    Now when Character A HWX comes in I set only one boolean in BLE_GATTC_EVT_HVX event. When Character B HWX comes in I start to read data because I get more than 100 bytes in. I do it so that in BLE_GATTC_EVT_HVX event I call sd_ble_gattc_read. Then I get event BLE_GATTC_EVT_READ_RSP and inside that event I call again sd_ble_gattc_read and get again BLE_GATTC_EVT_READ_RSP. I do it until when all data is readed. After reading I process the data and that takes 400 ms. I call data processing function directly from BLE_GATTC_EVT_READ_RSP event.

    Question is: when I call data processing function directly inside BLE_GATTC_EVT_READ_RSP then is Character A HVX coming in parallel?

Reply
  • I add my code flow to understand better

    I register ble event handler softdevice_ble_evt_handler_set(ble_evt_dispatch);

    in central side after discovery I configure read characteristics to get HVX notification. Character A Character B

    Now when when HWX is triggered I got event to ble_evt_dispatch event id is BLE_GATTC_EVT_HVX

    In my case I get it from Character A after every 80 ms and from CHaracter B after every 100 ms.

    Now when Character A HWX comes in I set only one boolean in BLE_GATTC_EVT_HVX event. When Character B HWX comes in I start to read data because I get more than 100 bytes in. I do it so that in BLE_GATTC_EVT_HVX event I call sd_ble_gattc_read. Then I get event BLE_GATTC_EVT_READ_RSP and inside that event I call again sd_ble_gattc_read and get again BLE_GATTC_EVT_READ_RSP. I do it until when all data is readed. After reading I process the data and that takes 400 ms. I call data processing function directly from BLE_GATTC_EVT_READ_RSP event.

    Question is: when I call data processing function directly inside BLE_GATTC_EVT_READ_RSP then is Character A HVX coming in parallel?

Children
No Data
Related