How link layer handles wrong characteristic handle??
02/32/2018 | 11:59 AM
when we are trying to read value by using a wrong characteristic handle the compiler has to generate a "Error code". But we are receiving a positive response from the compiler. How we can handle this issue in bgm111 module??
Bluetooth Low Energy
Do you read from the local GATT database or from a remote GATT database?
If the latter, is the BGM111 the server or the client?
We read from Remote GATT database. BGM111 is server in one side and the other side one more BGM111 board as a client.
For reference I am providing the flow what is happening in the board.
Reading the characterisctic value with wrong characteristic handle
if I’m providing wrong characteristic handle of value 0x35 and correct connection handle(01), then I’m expecting negative event response but getting positive event response
command sent (0x20030907012300),
I’m reading below events from remote gatt server.
Event response for Gatt read characteristics value
So it seems to me, that you sent decimal 35, because 0x0023 = 35 decimal. Isn't that possible?
My bad...it is typo error...I sent decimal 35 (hex 23). This characteristic handle is not available in remote gatt server. So I'm expecting negative response from remote gatt server. But I received positive response.
But if I use 0x6E or 0x64, I am getting 0x0401 (invalid_handle) from remote gatt server.
Ahh, OK, I see.
Well, the GATT database consists of a lot of entries. Beside the characteristic values it also contains declarations and descriptors. All of these are referenced with handles. Apparently when you read a characteristic, it is not actually checked if the handle points to a characteristic value, and you can also read the declaration and descriptor entries. Handle 0x23 e.g. points to such an entry, while 0x64 points to no entry.
I don't see this as a big issue, but I will report it to R&D.