Question

Now many lights at home can be controlled by blue-tooth, as you know LBT technology on iOS supports it very well.

But one question is that if there are four rooms available (very near) and each blue-tooth supported light for each room, then during BT service scanning, how to match the device and service?

Is it determined by signal strength? Or do we need to set its name during first connection? Any other great solution?

Anyone who are interested please share, and thanks in advance.

Was it helpful?

Solution

To know which peripheral is the nearest, we may say to we'll use RSSI.
It's a great way to know if they are near of far, BUT it's not accurate. Put a wall between your device and your peripheral, and its distance may seems farer. Let's say it's a tip, by not a real indication. Plus, let's say you are exactly at the same distance between two peripheral (so imagine same RSSI given). Which one is which one?

If the firmware allows it, you may rename your device (a writable characteristic). So in your example, let's say we rename your devices with: Light Living Room, Light Garage, Light Kitchen, etc. So it may help you to identify them when you want to connect. But, that works only if you already connected to them, and only if you can rename them.

If you also work with the firmware side, a good start, could be to name them with a part of a unique word. A solution, could be to name them like this: MainName XxX, where XxX could be for example, the last 4 hex of the communication cheap MAC Address. Of course, you may encounter the time where you find 2 identical XxX, but let's say it's quite rare.
Note, that could also work for Wi-Fi devices. We had a Wi-Fi toy that generates a Wi-Fi network with it's "ProductName XxXx", where XxXx where "unique" (Wi-Fi Chip MAC Address).
Also note, that on the peripheral part, they may have access to their "real" MAC Address, whereas in iOS, it's a mix between a timestamp, a MAC Address of the device/peripheral, and so may be change afterward (every 15 minutes I think), unless you paired with them. So it may be used and not used between 2 iOS devices.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top