I have to test Ble devices with an App on iOS and Android, the scenario is having multiple device sending signals and it is difficult to figure out which device is connecting to what phone.
Is there a better way to test and what are some of best tools for checking the status of ble devices like signal strength and other characteristics.
I've been using LightBlue Explorer to poke at BLE devices to see characteristics and values. It can also emulate devices once it's seen a real one.
I ultimately ended up writing my own Device Simulator on iOS. This lets me generate a controlled BLE service/characteristic, with full control of the device name, advertised broadcast name, and characteristic values.
Related
When connection to a custom BLE device from an app (android and ios) I have two options
a) first pair the device on the phone (like a headset or other devices) and then use it from the app to read and write data
b) without pairing on the phone, go inside the app, search for a device with a specific name or address, and just connect to it and read and write data.
when is one preferred over the other one ?
Its just when it needs to interact in the background or am I missing something?
The devices you see in your phones Bluetooth settings are Bluetooth Classic devices. There are some devices using both BLE and Bluetooth Classic which show up in the settings too, but the settings page is only for the Bluetooth Classic part of the device. Headphones for example are streaming music trough the Bluetooth Classic profile A2DP but might offer BLE services for additional features.
You always have to use a special app to communicate with the BLE part of a device. This could be an app provided by a manufacturer or a generic BLE scanner app such as nRF Connect.
As alexander.cpp already told you in his answer pairing (the exchange of keys) and bonding (saving of said keys) is not required for the communication with BLE devices and only needed if the device requires a secured connection.
Bonding (technically correct term for BLE, often called Pairing in non-technical speech) is mostly for security, we can send sensitive information because the receiver is verified and data is transferred in encrypted form.
Prefer to use bonding if the data is sensitive (means users feel uncomfortable if somebody they don't know receive their data). For example, I consider "current temperature = 25" as NOT sensitive. For detailed explanation, find "Bonding with a BLE device" in BLE guide by PunchThrough.
Also this is a good answer to a similar question: https://stackoverflow.com/a/42916081/10380092.
Your second question about background - no, bonding is not related to interaction in background.
I'm developing an Android app that manages multiple Bluetooth LE devices such as speakers, lighting devices, various sensors.
For user convenience, these devices have to be 'grouped' together and only accessible through a single Bluetooth connection.
Is programming some kind of custom intermediary hardware to serve as an interface required in this case or are there some better solutions?
It is possible to group bluetooth device by the profiles they implement https://en.wikipedia.org/wiki/List_of_Bluetooth_profiles . In Android the profile of a bluetooth device can possibly be determined like in In Android, how to get the profile of a connected bluetooth device?
I am looking for a way to scan a device I own and discover "what it can do".
In other words, I'd like to know if a device is able to describe the way you have to communicate with it in order to build some application around it.
In my case it is a simple Christmas light that I'd like to play with but this could be used in different situations.
For classic bluetooth (BR/EDR):
When scanning for bluetooth devices (Inquiry), the bluetooth device will send an inquiry response (if it wants to be discovered) and maybe also an extended inquiry response (EIR). This EIR may already contain a list of services, the devices supports. This is a very fast way to get a picture of a remote device.
Moreover, the service discovery protocol (SDP) gives more information on a device. This takes some more steps. In SDP two devices can exchange their capabilites in kind of ping pong process.
For BLE:
After connecting a BLE device usually a service discovery takes place. The BLE peripheral (e.g. headset or a light) reports its capabilities to the central (e.g. smart phone). Some of these services have predefines functionalities. Additionally, it is free to the manufacturer to add custom services.
We have multiple devices (same kind) advertising at the same time. But in iOS, all the advertising packets are treated as one device.
Understand the reason: iOS filtered out the BLE address for privacy reasons.
Without BLE address the advertising packets from the difference devices are exactly the same.
My question is: is it possible to use iOS core bluetooth to tell there are multiple devices are advertising?
Thanks
I'm attempting to use a classic bluetooth chip to possibly send out signals to another device with a classic bluetooth chip.
Now would it be possible to create a beacon with classic bluetooth?
You certainly can. A Bluetooth LE beacon typically sends out regular advertisements with a unique identifier that can be picked up by a receiving device (typically a mobile phone) doing a Bluetooth LE scan. Since you can also send out advertisements and do scans with classic Bluetooth, you could build the same thing with this technology.
The main disadvantage is that classic Bluetooth uses much more power, both for transmitting the beacon signal and more importantly for doing the scans. So if you are using mobile phones to detect the beacons the battery drain will be much higher than if using Bluetooth LE.