How to Update Fields in Custom Characteristics

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I Have defined a Custom service "Acc", with custom characteristic "Data". This characteristic has 3 fields X,Y,Z (Readings from Accelerometer uint16).

I'm unable to figure out how to put the Readings I get into these fields. I'm looking for the specific API or set of API's that do this.

Also I also want to display the fields on my phone. What will be the best way to do that?

PFA Screenshot of this

Regards,

Viraj

0 Likes
1 Solution
Anonymous
Not applicable

If you want the data to be persistent on the sending/server side, then you will want to write it to the GATT database on the server with: CyBle_GattsWriteAttributeValue(&handle_value_pair, 0, &cyBle_connHandle, CYBLE_GATT_DB_PEER_INITIATED);

otherwise, like hima​ said, it would be simplest to not track any data on the accelerometer/server sending the data, but rather to send the data as notifications, and then track/store it on the phone. (Assuming you are constantly receiving the accelerometer data)

As far as phone application/display...you're on your own for that I don't know anything about phone development

View solution in original post

0 Likes
2 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

You can send these details as notifications. You can look at any custom profile example.

(Eg: Project #047: PSoC 4 BLE - Accelerometer Controlled Car | Cypress Semiconductor )

Thanks,

Hima

0 Likes
Anonymous
Not applicable

If you want the data to be persistent on the sending/server side, then you will want to write it to the GATT database on the server with: CyBle_GattsWriteAttributeValue(&handle_value_pair, 0, &cyBle_connHandle, CYBLE_GATT_DB_PEER_INITIATED);

otherwise, like hima​ said, it would be simplest to not track any data on the accelerometer/server sending the data, but rather to send the data as notifications, and then track/store it on the phone. (Assuming you are constantly receiving the accelerometer data)

As far as phone application/display...you're on your own for that I don't know anything about phone development

0 Likes