You are here

Enable client to set server device Custom Characterstic valid range | Cypress Semiconductor

Enable client to set server device Custom Characterstic valid range

Summary: 1 Reply, Latest post by vojislav.mokric_1616151 on 13 May 2016 07:17 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.

I need an advice on how to give client device (mobile phone) possibility to set the temperature range on the server device (CY8CKIT-042-BLE)

So, I'm having my server device measuring temperature on every 10 sec and reporting changes to client via notifications. What I want is to raise an alarm in case of temperature exceeding temperature range... But I want that client can change that range based on his needs... 

If I have Custom Service "Device Sensing" and among others "Room Temperature" as its Custom Characteristic, what would be the best approach to add writable "Room Temperature Range" feature? Should it be another Custom Characteristic within the "Device Sensing" Service, or something else?

I see there is a an "Valid Range" option for Custom Descriptor which can be added to "Room Temperature" Custom Characteristic. But when I add it, and when I want to write something to it via CySmart App, my device freezes...

Is this good approach, or there is a smarter one?


Okay, I figured this out.

I added "Valid Range" Custom Descriptor to my "Room Temperature" characteristic. Within the CYBLE_EVT_GATTS_WRITE_REQ event case of my BLE handler, I looked for the appropriate custom description handle and did my work here.

At the end I called CyBle_GattsWriteRsp and it all worked well.


Log in to post new comments.