Hi I'm trying to send adc value from peripheral to central. I'm using nrf51822 with softdevice s130_1.0.0 and SDK v10.0.0 .
I'm getting error 3002 which I figured out, it is STK+NRF_ERROR_SOFTDEVICE_NOT_ENABLED. I also call softdevice_handler_isEnabled() function in main which is returning true.
here is my code
uint32_t ble_adc_on_adc_change(ble_adc_t * p_adc, uint16_t adc_state)
{
ble_gatts_hvx_params_t params;
uint16_t len = 2;
uint8_t data[2] = {(uint8_t) (adc_state>>8), (uint8_t) adc_state};
memset(¶ms, 0, sizeof(params));
params.type = BLE_GATT_HVX_NOTIFICATION;
params.handle = p_adc->adc_char_handle.value_handle;
params.p_data = data;
params.p_len = &len;
return sd_ble_gatts_hvx(p_adc->conn_handle, ¶ms);
}
Can any one please let me know how to correct this.