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

How to read a characteristic value?

HI,

I get confused using the ble terms hence i'll try to articulate my query as much as possible. I'm using  the nRF52832 board and all i  have one service with one characteristic,

the characteristic has read,write and notify properties. I have implemented the write and notify option perfectly but have trouble with the read property of the characteristic.

What I want to do is to  connect my device(nRF52832) to nRF connect app and use the read option to get data from device(nRF52832). 

For example: using notify, after every notification interval i'm incrementing a variable by 1, now i stop the notification using nRF connect when the variable value is 5, when i hit read on the app, it should show the same updated count(count=5).

Ps: I have created a custom service with one characteristic.

Again sorry for not using the BLE terminologies here but i have tried my best to articulate my issue without it.

Parents
  • Hi ovrebekk thanks for the reply,

    Yes after disabling the notification from the app when i do a read request, it shows me the value that i had used while initializing the characteristic.

    for ex:

    value=2;

     add_char_params.p_value=&value;

    i increment the "value" for every notification interval. After stopping the notification interval when i hit read, i get the output as 2 only.

Reply
  • Hi ovrebekk thanks for the reply,

    Yes after disabling the notification from the app when i do a read request, it shows me the value that i had used while initializing the characteristic.

    for ex:

    value=2;

     add_char_params.p_value=&value;

    i increment the "value" for every notification interval. After stopping the notification interval when i hit read, i get the output as 2 only.

Children
Related