Deviceinfo without scanning - linux

Can we know the bdaddress and rssi of all nearby ble devices without continuous lescanning? As the continuous lescan will consume more power and also we would not be able to properly make connection to a device while active scanning is going on in background.
The lescan background process also gets killed when we are disconnected from the connected state with any ble device
Also with how many peripherals can a central device be connected to simultanoeusly with bluez-4.101 stack?

Yes you are right you cannot make connection while you are scanning for Low Energy devices and number of devices that can be connected to the central device is entirely dependent on the Software Stack you are using for BLE.
Like in CC2540 you can connect 3 devices at a time.
For RSSI and bluetooth address you refer function le_advertising_report according to bluez-4.101 stack.

Related

BLE packet drops when Bluetooth and BLE are simultaneously in use

I am using BLE v4.1 for my application where I am able to transfer 200 packets of length 20 bytes each from peripheral to central side.
I want to transfer data via BLE and play some music while the data is being transferred. The music file is available locally and will be played on earphones(can be wired or wireless BlueTooth earphones)
I am facing an issue of packet drops around 15-20% when I am playing audio through wireless earphones while data is being transferred via BLE and audio is played on phone Bluetooth earphones(tried on Android and iOS, both) simultaneously.
With wired earphones connected; there is no issue, I can transfer data via BLE and play audio smoothly without any issue but things are different with wireless Bluetooth earphones case. I tried it with different Android phones(Android 11, different manufacturers) and different BlueTooth earphones, the issue still exists.
What could be a cause for the same and how can I debug it?
Bluetooth and Bluetooth Low Energy has only one radio that can only do one thing at a time. The connection events are scheduled and cannot overlap. This means the throughput is shared among all connected devices. You will get a higher throughput per device with only one connection than with two connections.
You will have to experiment with connection interval and connection event length to find parameters that seems to work, and test with multiple Bluetooth controllers (phones), since all have different scheduling algorithms.

What is bluetooth le multi advertising?

I couldn't find a clear explanation what is Bluetooth le multi advertising.
For example, in Specification of the Bluetooth System, I see only
description of BLE advertising but not multi advertising.
What the difference between BLE advertising and multi advertising?
Thanks
LE Multi advertising refers to a specific offload (non bluetooth specification) feature that has been implemented in the Android releases by Google, starting from the L release.
What multi advertising means is, that your Android phone or a device with Android stack, can enable multiple advertisement trains at the same time. For instance, one specific app can set certain advertisement data (example supported services etc.), advertisement parameters and enable advertisement, and so can N number of other apps, on the same device.
At the hardware level (or physical layer), these advertisement trains are interleaved between the three advertisement channels (37, 38, 39) and thus your phone behaves as multiple peripheral devices at the same time. All these advertisement trains also have a separate Random private address, so they are seen distinctly by the remote scanner.
Bluetooth Smart has two ways of communicating. The first one is using advertisements, where a BLE peripheral device broadcasts packets to every device around it. The receiving device can then act on this information or connect to receive more information. The second way to communicate is to receive packets using a connection, where both the peripheral and central send packets. We will focus on advertisement for several reasons:
You can’t create a connection between two devices without using advertisements. Defining the data and format of advertisement packets is usually the first thing you work on when developing a BLE device.
A large number of BLE products sleep most of the time, waking up only to advertise and connect when needed. This means advertisements have a big impact on power consumption.
Users want responsive products, and the advertising interval is critical in quick connections.
Advertising is by design unidirectional. A Central device can’t send any data to the Peripheral device without a connection. But a single peripheral can advertise to multiple masters in the area.
ref:http://www.argenox.com/bluetooth-low-energy-ble-v4-0-development/library/a-ble-advertising-primer/

BLE peripheral: scanning while connected

Is it possible to make a peripheral scan for advertisments while connected to a central? It seems like it is either scanning for advertisments or have your peripheral connected but I need to do both. The peripheral should be able to report RSSI measurements from advertisements it picks up.
I'm using 'bleno' for the peripheral and 'noble' for the scanning on a linux box (bluez)
The answer to this differs depending on the version of Bluetooth that your device is on.
For Bluetooth v4.0:
A peripheral cannot scan at all, whether in a connection or not. The peripheral can only send out adverts or accept incoming connections. For more information you can have a look at this document, page 18:-
http://chapters.comsoc.org/vancouver/BTLER3.pdf
For Bluetooth v4.1 onwards:
A device can be in central and peripheral role at the same time. By implication, this means that if a peripheral is connected to a central device, it can still scan for devices in it's "central mode". More information can be found in this link, page 5:-
http://www.ietf.org/proceedings/89/slides/slides-89-6lo-4.pdf
So in conclusion, if your device is BT v4.1 or newer, then this is dependant on the chip manufacturer, and if it is v4.0, then no, because the Bluetooth specification does not allow it.

Can a Bluetooth LE device stop advertising and still be connected to and share data?

I'm writing (and copying) some Bluetooth LE scanner software to find and connect to a heart rate monitor. I used to be able to find this device by using scanForPeripheralsWithServices method to perform a generic scan by setting services to nil. But in the recent few days, I noticed that my same Bluetooth LE device (my heart rate monitor) can no longer be scanned (perhaps it is not advertising the same way it used to?) but my iPhone can still pair with it under settings and can connect to it with commercial apps such as "Polar Beat" and "Strava". So what changed? Can a Bluetooth LE device stop advertising and still be connected to (paired with) and share data as a peripheral?
The strange thing is that your device doesn't advertise.
However, it's normal that your iPhone can connect to it because the smartphone executed "bonding" procedure in the past. Bonding is another security procedure than simple pairing. With Bonding, heart rate device and smartphone exchanges keys and store them in a non volatile memory so that they can connect quickly.
With simple pairing the keys are temporary and advertising is needed.

how many bluetooth pairing can be made?

I have an android phone and I want it to communicate with 10 bluetooth modules, not simultaneously. I know that a master device can have 7 slaves for bluetooth connection. does it mean "pairing"?
The question is can I have my phone paired with 10 bluetooth devices? Then send them data seperately?
There is no set limit on the number of pairings possible for a device, except for any limitations made by the platform or bluetooth software stack (eg. limited storage).
does it mean "pairing"?
Bluetooth pairing and connecting are two separate operations.
When two Bluetooth devices pair, they will exchange Bluetooth addresses and encryption keys. If pairing is successful, it allows the devices to connect to each other at a later time.
When two bluetooth devices connect, the profiles are established (a2dp if a speaker, hfp if headset, etc), and they can communicate.
Sometimes there is confusion between pairing and connecting since most smartphones automatically connect after detecting a successful pairing.
Pairing is just done once, typically when you buy a Bluetooth product. Connection is done whenever you use the product.
The question is can I have my phone paired with 10 bluetooth devices?
Then send them data seperately?
As mentioned in the other answer, the maximum number of paired devices is platform dependent, it varies from product to product, but there is no set limit. The maximum number of connected devices (that you could send/receive data concurrently to) is 7 according to the Bluetooth specification.

Resources