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

NRF52832 sd_ble_gattc_read issue

Hello ,

I have configured one  nrf52832 where it sends temperature data over one service's characteristics ( updating the value after every 1 min ) and I am able to see this by connecting it to nrf connect mobile app . I have also configured one more nrf52832 device in central mode , where it connects to my first device ( it discovers the device using service UUID filters and then connects )   it has to read the connected device's temperature via sd_ble_gattc_read () function .

Now the issue is  , during configuration of the characteristics , I have given  add_char_params.p_init_value  as some static value ( 0xab ) .  and from my central device , I am reading the device temperature after every 2 mins ( after 2 min I will connect and read the UUID ) , but I am getting 0xab ( init value only) always ( not able to read the updated value ) .

I have also tried removing the init value configuration , but with this, always I get  0xB1 ( unknown value )  . 

this is how I am reading from my central device :

sd_ble_gattc_read(p_ble_evt->evt.gattc_evt.conn_handle, UUID_TEMP_HANDLE_VAL, 0));

( this im calling whenever the central device connects my second device and discovers the UUID ) 

and in the ble_cental_handler ,

case BLE_GATTC_EVT_READ_RSP:
{
NRF_LOG_INFO("Data : %x :\n",p_ble_evt->evt.gattc_evt.params.read_rsp.data[0]) ; // here I am getting init value always 
NRF_LOG_INFO("len : %x :\n",p_ble_evt->evt.gattc_evt.params.read_rsp.len) ;
NRF_LOG_INFO("handle vlaue : %x :\n",p_ble_evt->evt.gattc_evt.params.read_rsp.handle) ;
NRF_LOG_INFO("offset : %x :\n",p_ble_evt->evt.gattc_evt.params.read_rsp.offset) ;
}

break ;

How do I resolve the issue ??

Parents Reply Children
No Data
Related