How to get the battery level of bluetooth connected devices - ios

iOS 9's battery widget in notification enter shows the battery level of the device itself, and other peripherals connected via bluetooth. (Apple pencil / Apple watch / BT speakers / BT headphones)
how to get those numbers in iOS?

In my opinion the possible method is to use CoreBluetooth and discover the connected devices. Connect to the Apple Watch and subscribe to it's service which shows the battery level of the device. This is a possible way for connected peripherials through bluetooth.

Related

I want to connect to iPhone's BLE through my BLE device

The purpose of this task is to connect to iPhone's BLE through BLE device to access ANCS of iphone. Please note that there is no app installed in iPhone to turn ON BLE of iPhone.
So, If we enable Bluetooth from iPhone setting, will it enable BLE along with BT classic?
Yes, if you enable BLE on an iPhone, you are enabling BT classic as well. The reason for this is that BLE is just a subset of the whole Bluetooth radio, along with BT classic. Since they use the same physical radio and chip, there is no way to enable BLE without turning on BT classic or vice versa. That being said, there is very limited functionality of BT classic on iPhones and most of that is restricted to developers unless you join the MFi program.
For more information on the different Bluetooth subsets, please see this answer:-
Can a Bluetooth LE powered device discover a classic Bluetooth device and vice-versa?
Please note that you will always have to enable Bluetooth manually on an iPhone and there is no way to enable this automatically.
I hope this helps.

How to ignore a bluetooth device for audio

The Problem
I am writing an app that uses a specific bluetooth 3.0 MFi device to receive data from a vehicle. Unfortunately the manufacturer of the device has set the bluetooth profile to headset. This means that when the phone is connected to the device but also connected to the in car bluetooth audio system and making a phone call / listening to music then the iPhone will intermittently switch from the in car bluetooth system to the bluetooth device used to retrieve data from the vehicle.
The question
How can i make iOS ignore a bluetooth device for audio?

Show a battery notification with a BLE device

Is it possible to add another device to the batteries widget?
The device is not an headset, and it will be connected via BLE exclusively.
Is there anything that can be done in my application or on the device itself to support this?
Possibly related:
Bluetooth Design Guidelines (section 5)

Hide BLE devices from Genric BLE scanner apps

Is there any way to hide BLE devices from Generic BLE scanning apps like BleExplr, LightBlue etc?
You can configure your peripheral to use service solicitation. In this mode the central offers services and the peripheral scans for them -refer to page 21 of this document - https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=245130.
Note that even with service solicitation a Bluetooth analyser will be able to receive the service advertisement from the central but apps like LightBlue won't see it.
There is no way to hide BLE devices, The BLExplr and LightBlue are application using as center mode, these apps can find devices as BLE peripheral mode. As the BLE concept, the peripheral devices broadcast and allow to any center mode devices range to see them. Please see this link to get more information

bluetooth low energy on standby mode in iOS?

I have read the docs about the BLE for iOS, and i could see that every device has its UUID instead of mac adress for the BLE.
My question ,in which there is no answer to on the docs, is- when you turn on the bluetooth on the device ( without opening any app) , so the device's bluetooth is on , what does it advertise then, and could I discover that device or get its UUID, while his bluetooth is on,but without any app that is open.
I am pretty sure that when the BLE is on, you can discover that device, or awake him, but I wonder what data can I get from him while its on without an app .
(same for Android.. )
iOS does not advertise any Bluetooth Low Energy services that are visible to another iOS device without an app running. Once an app advertises a service you will see additional services available - device information, time service, battery level.
If you are using different Bluetooth hardware to scan then you may see some advertisements without an app but the reported UUID of an iOS device changes every 15 minutes for privacy reasons - See this answer - Corebluetooth, How to get a unique UUID?

Resources