Is it possible to forward read request to application in from PAN 1026 SDK.

Hello,

I am working with PAN 1026 on windows10. I am able to add some custom service/characteristics.

Some of the characteristics have read property. I want to ask that is it possible to forward a read request from SDK to the application. So there i can send read response to that particular read request??

Currently, i saw i example profiles there is always some static values defined and client (mobile phone) get that value when it sends read request to PAN 1026.

I have written a c library and i want to send read response from my lib to SDK whenever a read request comes from SDK.

I will be really thankful for your help.

3replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Some of the characteristics have read property. I want to ask that is it possible to forward a read request from SDK to the application. So there i can send read response to that particular read request??

    Yes.


    Currently, i saw i example profiles there is always some static values defined and client (mobile phone) get that value when it sends read request to PAN 1026.

     

    Sometimes this is a static value (like the device name), but sometimes it is also a dynamic value.

    It is true that the read function will most of the time read from one and only variable, but sometimes this variable may be changed due to some conditions.

    For example, the battery service has the battery level characteristic. The read function will always return the value from the battery level variable. But the contents of the variable may change when the battery level drops.

    I have written a c library and i want to send read response from my lib to SDK whenever a read request comes from SDK.

    That is possible as well. From within the read function you can do whatever you want, also call into your C library code.

    You just need to make sure that if you return then LE_GATT_STATUS_SUCCESS later, the return variables value and length have valid values.

    You don't need to return the same variables here. Whenever the read callback is called, you can even return different values.

    Like
  • Thanks for your reply.
    Which function will be called when a read request comes to PAN??
    Which function i can use to provide a read response to SDK from application?? 

    Like
  • Hi,
    I am able to do it.
    Thanks for your support.

    Like
Like Follow
  • Status Answered
  • 1 yr agoLast active
  • 3Replies
  • 16Views
  • 2 Following