clausbroch / node-red-contrib-noble-bluetooth

A Node-RED module based on noble for interaction with Bluetooth Low Energy (BLE) devices.
MIT License
8 stars 15 forks source link

Why not connect on MAC #2

Closed Travelbacon closed 4 years ago

Travelbacon commented 4 years ago

What is the reason to scan UUID instead of connect to address? You have to be 100% sure that a UUID is only used on one device. Making it impossible to read out battery level for one specific device.

clausbroch commented 4 years ago

The reason for scanning for service UUIDs is that is makes it sharable for general purposes. E.g. as the example shows how to connect to a pulse belt. Connecting to a specific MAC address requires the flow to be modified for each individual device.

If you only want to connect to a specific device no matter which services it supports, then you can just leave the UUID empty and have it scan for all devices. Then check the address output from the scanner node and only connect to the device if it matches your specific MAC address.

Travelbacon commented 4 years ago

Ah. That explains. I was not clear what the purpose of the node was.

clausbroch commented 4 years ago

I'll make sure to update the description i the next release to explain this better