Hi, I'm using nRF52832 Software Development Kit, PCA10040, S132.
I am trying to test ble_app_blinky_c.
I have problem with received data from peripheral which is my own BLE device.
First of all, I tested blinky central and peripheral with two nordic borad.
When I pressed peripheral button 1, breakpoint stop at "case BLE_GATTC_EVT_HVX:"
void ble_lbs_c_on_ble_evt(ble_evt_t const * p_ble_evt, void * p_context) { if ((p_context == NULL) || (p_ble_evt == NULL)) { return; } ble_lbs_c_t * p_ble_lbs_c = (ble_lbs_c_t *)p_context; switch (p_ble_evt->header.evt_id) { case BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP: on_hvx(p_ble_lbs_c, p_ble_evt); break; case BLE_GATTC_EVT_HVX: on_hvx(p_ble_lbs_c, p_ble_evt); break; case BLE_GAP_EVT_DISCONNECTED: on_disconnected(p_ble_lbs_c, p_ble_evt); break; default: break; } }
In ble_app_blinky_c, I found that the change in the charteristic status of the peripheral was received from on_hvx() of BLE_GATTC_EVT_HVX.
All I want to do is just read the data from the bl device and record it on the terminal.
To do this, can I use BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP?
Is this the right way to add cases above code like this,
Switch (p_ble_evt->header.evt_id)
{
Case BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP:
on_hvx (p_ble_lbs_c, p_ble_evt);
break;
...
or... Should I create a new function in main()?
* I think it might be difficult to understand the intent of my question because I didn't fully understand the example code.
My key problem is that I don't know where the data from my device is located in the example.
(or I don't know how to add the code.)
Best Regards,
Lyrics