Problems of finding some devices with Bluetooth Low Energy - bluetooth

I'm trying to implement Bluetooth Low Energy . The fact is, I can find some devices around me, so the scanning seems working, but there are some devices which I can't find ... such as a motorola, which has Android API 19, so since BLE is enabled since API 18, shouldn't it work ?
So my question is, are there some devices not compatible with BLE ? (I can found some devices but not all)

What do you mean by "device"? Motorola what? Phone? Watch? Light bulb?
If your phone can search for and find some ble enabled devices then it got both hw and sw support.
The other "device" must be ble advertising for your phone to hear it during scanning.
A Motorola phone with android api19 can only scan, not advertise. Some android 5 devices can do ble advertise, so they can be scanned by android api19 devices but not the other way round.

Related

Bluetooth Android and Bluetooth iOS

When I press a button on a device that is connected to iOS or Android via Bluetooth, it should perform some task in an app(app installed on iOS or Android). I am not sure which Bluetooth profile will be best for my job. I think HID profile, but will it work with iOS ? Any suggestions or comments are welcome.
iOS devices can't use standard Bluetooth connection with Android. In this case you should use BLE (Bluetooth Low Energy). This means you should use GATT profile for Android. There is an important issue here: all iOS devices can BLE peripheral or central but for Android some devices only can peripheral.

Android Things and Bluetooth

As far as I read about the dev boards, every SoC is capable to use Bluetooth.
I didn't tested it yet, but can I use Android Things with a Bluetooth connection? My question is, how can I enable Bluetooth without an input device? If I want to enable Bluetooth on my phone (with code), I had to confirm it, but this can't be possible on Android Things.
Update: Since the release of Android Things developer preview 3, Bluetooth and BLE are now available.
Old Answer
No. You can not use Bluetooth with the current version of AndroidThings (developer preview 1).
It is said in the known issues part of the release notes that Bluetooth is currently disabled (and so is USB).
It is supposed to be included at some point, but at the moment if you try to get a BluetoothAdapter it does return null.
Android Things will use the latest version of Bluetooth called Bluetooth Low Energy and the only similarity between the two is that they have Bluetooth in the name!
Can I use Android Things with a Bluetooth connection?
Yes, well a Bluetooth Low Energy connection
https://www.link-labs.com/bluetooth-vs-bluetooth-low-energy/
In summary, Bluetooth and Bluetooth Low Energy (BLE) are used for very different purposes. Bluetooth can handle a lot of data, but consumes battery life quickly and costs a lot more. BLE is used for applications that do not need to exchange large amounts of data, and can therefore run on battery power for years at a cheaper cost. It all depends on what you’re trying to accomplish.
Everything you need to know about BLE is written here:
https://developer.android.com/guide/topics/connectivity/bluetooth-le.html
how can I enable Bluetooth without an input device?
You do not pair BLE devices like you used to with the older Bluetooth (but you can use Bonding). Check this out:
Android Bluetooth Low Energy Pairing
https://stackoverflow.com/a/20093695/413127
But as stated by #shalafi Android Things doesn't currently support Bluetooth

smartwatch that advertises bluetooth LE

I'm planning to replace the Beacon tag of my Bluetooth (BLE)-based localization System with a smartwatch. Therefore, the smartwatch has to be able to advertise bluetooth signals. However I can't find any information about smartwatches using BLE advertising methods. I actually don't want to use an additional smartphone which would be able to advertise. I already found that the iWatch and the Moto 360 are probably not able to advertise.
Does anyone know if there's (or will be) a smartwatch available that is able to advertise BLE signals?
Thanks a lot!
el Baum
Ok, this is not possible for Sony Smartwatch atleast. This is because in order to be able to broadcast a BLE advertisement of your choosing, any given Android device has to be able to support BluetoothAdapter.isMultipleAdvertisementSupported(). Unfortunately, this feature is not available on most Android Wear devices.
If your Android device does support multiple advertisement, then you can create an advertisement packet and use the BluetoothLeAdvertiser object to start advertising.

Can a Bluetooth LE powered device discover a classic Bluetooth device and vice-versa?

I'm wondering if Bluetooth 4.0 (low-energy) mobile phones could discover classic Bluetooth devices (3.0 and lower), and vice-versa. All I am interested in is discovering the "friendly names".
EDIT: As I have understood the replies of this post, Bluetooth 4.0 can discover classic Bluetooth devices but not the other way around. Then my follow-up question is, can a Bluetooth 4.0 device in LE mode discover classic Bluetooth devices?
The answer depends on if you mean Bluetooth v4.0 device, or BLE device, the two are not the same.
Bluetooth v4.0 = Classic Bluetooth + Bluetooth High Speed + Bluetooth Low Energy
Therefore, Bluetooth Low Energy is only a subset of Bluetooth v4.0. If your question is regarding Bluetooth v4.0 phones (generally phones are not BLE only), then the answer is Yes, Bluetooth v4.0 mobile phones can theoretically discover Bluetooth v3.0 devices and lower.
Hate to be blunt, but nope not possible (although it would be handy). 4.0 is 4.0 alone. Check out the Bluetooth Core Spec for more info
No a BLE can not discover a classic bluetooth device nor a classic bluetooth device can discover a BLE.
A device with BT V4 will discover both.
And A BT V4 will be discovered by BLE if it is advertising as BLE.
I also had same question, so I did little experiment.
I may contribute to this topic from my experiment that I did with old mobile(Nokia C5-00), New mobile(Samsung galaxy grand prime) and two bluegiga ble113 chips.
I swithched on bluetooth of all the devices and started scanning for near by devices I observed the following:
Observation1: Samsung galaxy grand prime (BT version 4 +Ble): It was showing both bluegiga ble113 chips, and Nokia C5-00 on the list.
Observation2: Nokia C5-00 (Earlier version of BT): It was showing only Samsung galaxy grand prime in the list.
Observation3: ble113: Out of the two ble113 chips one was in advertising mode and other in scanning mode at first the scanner chip was discovering only other BLE113 advertiser chip, but when I started advertising from Samsung galaxy grand prime phone using BLEBroadcast app the ble scanner chip started discovering the Samsung galaxy grand prime phone also.
Its perhaps late but just to clarify. The question in the title sounds like its asking about the interoperability of the two different Bluetooth modes, but the details of the question drift toward whether or not the mobile phone supports these two capabilities.
As far as the interoperability is concerned, as pointed out by VSingh, Classic Bluetooth discovery and Bluetooth Low Energy discovery work in opposite ways.
In classic, the endpoint [eg your Android] SEARCHING for devices TRANSMITS inquiry packets. Devices in discoverable mode, LISTEN for these packets and respond accordingly.
In Bluetooth Low energy, the endpoint [eg your Android] SEARCHING for devices LISTENS (scans) for advertisement packets. BTLE devices that are discoverable TRANSMIT these advertisement packets.
If the radio on your mobile device can do both of these things, then you can discover both classic and low energy devices.

Android Bluetooth LE Chat example

I am trying to read serial data over Bluetooth LE but can't find any code examples for this type of bluetooth and api19. Does any one have an example?
There is no profile defined for serial data communication over Bluetooth Low Energy till now. For this one can use the Bluetooth classic only.
In any case, Android devices can not broadcast for advertising packets. They can only scan the advertising packets. Hence, these devices will be in Central mode only. But can act as either server or client.
For Bluetooth chat related app example one can refer Android SDK as,
sdk/samples/android-19/legacy/BluetoothChat
The above example is based on Bluetooth classic based on RFCOMM channel for serial communication.
Android 5.0 let mobile to be peripheral. So chat will be possible:
https://developer.android.com/about/versions/android-5.0.html
Bluetooth Classic got the SPP profile. This is not how Bluetooth Low Energy works.
In BLE you have 1 or more Services each with 1 or more Characteristics which are basically just bytes in a predefined format which by default can be max 23 bytes.
To send data from one device to another one must be the Master and the other must be Slave.
Android API19 does not support the Slave (Peripheral) role, it seems Google still doesn't understand the importance of Bluetooth Low Energy. It's so much more than just Pulse-readers.
You can send from an Android API19 phone to e.g. an iPhone which can be Slave/Peripheral.
You cannot send from an Android API19 phone to another API19 phone. For this you must use Bluetooth Classic SPP profile.

Resources