2019-07-29 12:59 AM
Hi,
I was wondering if it is possible to send data from client to sever when reading characteristic?
In order to save memory, I am trying to have only 1 profile with 3 characteristics (Read/Write/Notify).
The idea is, when the client wants to read data it will request a read and use 2 bytes data in the read request to indicate to the server which data has to be sent back.
I tried to find the datasheet about read characteristic but I couldn't find anything. If someone can help me out I would really appreciate.
Thanks,
A.
2019-07-30 12:48 AM
Hi Anthony,
It will be simpler to just read that characteristic accordingly.
You may choose to read the characteristic value given its attribute handle,
or to read the characteristic value given its UUID (and the range of attribute handle).
Best Regards,
Winfred
2019-07-30 02:04 AM
Hi @Winfred LU ,
Thanks for your response. Not sure I understood correctly.
Just to make it clear, I want to create one profile and let's say 1 characteristic (Read only, up to 20 bytes). What I was thinking is the content of the response might be different based on the read request.
Is it possible to follow the Figure 4.8:
Read Request(0x0002) -> Read Response ("Example Device")
And Read Request(0x0003) -> Read Response(0x55, "Example Device")
My idea is to use the 0x0002/0x0003 as a bit mask.
What is exactly 0x0002? a UUID?
The whole idea is to save memory on the device.
2019-07-31 01:35 AM
Hi Anthony,
The idea to save memory is good, but not practical.
Image that you have a 20-byte buffer storing the data you need.
How would you expect the buffer to provide you different data?
The only possible solutions would be
or
Best Regards,
Winfred