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

why indication callback not called

I have an issue with indications. I try to send the first chunk of data and wait for indication callback, but my code freeze on while loop. I activated indications on phone side (nRF master control). to my understanding, each time the central successfully receives the frame, on_ble_evt BLE_GATTS_EVT_HVC is called

main loop :

indication_pending = true;
        	do {
    err_code = param_update(&m_param, FLASH_DATA, NULL, steps_store_characteristic_value);//update data on BLE
        							} while (err_code == BLE_ERROR_NO_TX_BUFFERS);
    while (indication_pending);

static void on_ble_evt(ble_evt_t * p_ble_evt)
{
...
	case BLE_GATTS_EVT_HVC:
		indication_pending = false;
		break;
...
}

uint32_t param_update(ble_param_t * m_param, enum CHARACT characteristic, uint32_t value, uint8_t *vsoft_value)
{
	uint32_t err_code = NRF_SUCCESS;
	uint8_t tab_value[4];
	uint8_t vsoft_tab_value[16];
	ble_gatts_hvx_params_t params;
if ((m_param->conn_handle != BLE_CONN_HANDLE_INVALID) {
params.type = BLE_GATT_HVX_INDICATION;
params.handle = m_param->flash_data_char_handles.value_handle;
params.p_data = vsoft_tab_value;
params.p_len = &len;
err_code = sd_ble_gatts_hvx(m_param_digitsole->conn_handle, &params);
..........
Related