Hi,
从“UM-B-00的文档3', function 'attmdb_add_attribute' is used for adding attribute to one service being created via 'attmdb_add_service' in which parameter#1 can be used for the reference of starting handle value.
So, would it be possible for function 'attmdb_add_attribute' to specify the reference handle value for the newly added attribute?
i.e. I want following arrangement of handle value
0x0100 -> custom 128-bit primary service declaration
0x0110 -> first custom 128-bit characteristics declaration
0x0111 -> value handle of first custom characteristics
0x0120 -> second custom 128-bit characteristics declaration
0x0121 -> value handle of second custom characteristics
....
etc.
Keywords:
Device:
Hi,
You are not directly controlling the 16bit attribute handles. They are automatically assigned as you add attributes. The only guaranteed behavior is that attribute handles are assigned in the order that you add attributes. Can you explain why you would want direct control of the attribute handle assignments? Maybe I can help you achieve your goal in some other way.
Hi,
Cause we would might need to have more direct communication between 2 devices based on GATT, but without (skipping) the discovery procedure.
So, we would prefer to have control on specifying the handle value for each attribute.
It would be great if you can do such favor for me.
Thanks.
As Joacim states, keep track of your database, this is how it is done. If you worry that your attribute database will chage in future releases, make use of the Device Information Service, to keep track of releases. There is nothing you can do as far as specifying the handles yourself.
I suggest you add the attributes as normal and write down the handles that were assigned and simply use those. The handles are assigned deterministically and in order so they won't change until you change your db.
Ok!
Thanks and well noted!