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

How do I calculate a characteristic value in real-time ?

When my mobile phone reads my characteristic, I would like the characteristic to be calculated at the same time, and not before. i.e. like a video game that does not render the world until the camera looks at it. Is that possible? How do I implement it? 

Currently I have a read-only characteristic but it doesn't seem like my application code can react in time to give the mobile phone a value. I think the nRF can only get notification AFTER the value has been read, but not during. Is this correct? 

I can think of this workaround: 

  • Make my characteristic a read/write, have the mobile phone write 1 to the nRF as a request, then have the nRF send a Notification back with the data. 

Is there a better way?

Related