Hi,
I am creating a Sensor Application for BLE node. I have to create a database type model.
For an example:
Attr. Handle || Attr. Type || Attr. Value ||
----------------------------------------------------------------------
0x0001 || 0x2800 || 0x1800 || -- Shows it's a service
0x0002 || 0x2803 || 0x02 | 0x0003 | 0x2A00|| -- 0x0003 is location of actual value
0x0003 || 0x2A00 || "Device 1" || -- 0x2A00 shows Type of value i.e. "Device Property"
----------------------------------------------------------------------
The Handle will be used to locate the Attr. Value. On getting request for handle 0x0002, I will check the Attr. Value. Firrst byte will be the permissions. Next 2 bytes will be the handle where the value is stored and next 2 bytes are type of the value. So, 0x0002 is kind of Get Method that we use in OOP. A request can be for 0x0002. Not directly 0x0003.
My problem is: How should I model this in a object of Application? I m thinking to use A queue of Packet: Because it will be easy to frag/combine. But problem will be the search. When I need to search for 0x0002, This Packet structure will not be good. Is there any other easy alternative?
Thank you.
Kartik