BLE: what's the deal with handle and uuid?
Posted: 14:49, 16 Jan 2015
Hi there,
I am just starting out developing an app which connects over BLE with an in-car odbii-device. I've gone through the documentation about the plugin and built a small prototype which connects successfully to the device. Now, I have the following question: why is the handle of a service or characteristic used in the interaction-methods instead of the uuid?
For example:
The handle seems to change after each connection while the uuid stays the same? What's the idea behind this?
The uuid seems to me something that can be cached after first connection while for a characteristic's handle to be obtanined I need to go through the sequence of connecting -> reading services -> reading characteristics.
Or am I missing something here?
I am just starting out developing an app which connects over BLE with an in-car odbii-device. I've gone through the documentation about the plugin and built a small prototype which connects successfully to the device. Now, I have the following question: why is the handle of a service or characteristic used in the interaction-methods instead of the uuid?
For example:
Code: Select all
evothings.ble.readCharacteristic(
deviceHandle,
characteristic.handle,
function(data)
{
console.log('BLE characteristic data: ' + evothings.ble.fromUtf8(data));
},
function(errorCode)
{
console.log('BLE readCharacteristic error: ' + errorCode);
});
The handle seems to change after each connection while the uuid stays the same? What's the idea behind this?
The uuid seems to me something that can be cached after first connection while for a characteristic's handle to be obtanined I need to go through the sequence of connecting -> reading services -> reading characteristics.
Or am I missing something here?