Android Bluetooth LE Chat example - bluetooth

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.

Related

Apple External Accessory Protocol over iAP2 over Bluetooth low energe 4.0

We are developing a product that communicate with iPhone use Apple External Accessory Protocol over iAP2 over Bluetooth low energe 4.0 but we find that we can not connect it through the BPA 100 bluetooth Analyzer wit ATS,so is the BPA 100 bluetooth a Analyzer support capture the Bluetooth low energe 4.0 datas? And this prodcut is it OK for MFi certification?
MFi license is not required for the BLE connection. Apple providing the way you can create own BLE device and define properties with BLE Device Identifier. This is a very easy process to make a connection with the BLE Device. You can multiple articles on the internet. How to make a connection with BLE Device with the help of the Core Bluetooth framework.
Yes, We have to buy an MFi license. I want to develop own accessory, Which we can connect with iOS device thru cable or Bluetooth over IAP2 protocol. IAP2 Make connection with iOS then to Application and we can share maximum supported data over Bluetooth or cable connection. But BLE we can exchange maximum limit data. BLE connection consumes less data energy and exchange limit data compare to IPA2.

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.

is it possible for iBeacon to act as just normal BLE data transmission module after connection?

i know that iBeacon use only advertising channel. which means there is no need connection.
im trying to make my own beacon module which send and receive data.
im curious about what makes the packet in iBeacon format(prefix /UUID / minor/ major/ TX) in communication ?
is it firmware?
let's assume that
when i make my iPhone act as iBeacon , it will send the advertising packet. which means it sends data in iBeacon format. but after turn off the app for iBeacon, i try to use my iphone
to send some files to laptop via Bluetooth low energy mode as usual.
then it will send data in bluetooth standard format. is this right?
given that situation, my iphone can be both iBeacon and just normal phone capable of bluetooth low energy.
i think also the beacon module can be like that. how about the product recently released? like estimote, redbearlab and so on. after connection, do they receive data?
Every iBeacon product works a little differently, but it is common for a product to be connectable for configuration purposes over Bluetooth LE.
Radius Networks' RadBeacon, for example, has firmware that sends out its advertisement as needed to be a standard iBeacon. The same firmware will allow a connection over Bluetooth LE, exchanging data with an external client (the RadBeacon app for iOS). This connectability is outside standard iBeacon functionality, using proprietary techniques that are still part of the larger Bluetooth LE standard.
Your understanding is therefore correct.
Full disclosure: I am Chief Engineer at Radius Networks.

Get device handle of a Bluetooth Low Energy device

I have a Bluetooth Low Energy device to which I need send some values from the PC.I need to connect this device to the Windows 8 PC and should be communicate with it from my application (Visual C++, win 32 application). I already know the hardware ID and friendly name of the device.
Is there any API to establish connection to the device using this ID/ friendly name, and give a device handle so that I can use GATT APIs to send values to the device. http://msdn.microsoft.com/en-us/library/windows/hardware/hh450825(v=vs.85).aspx
http://code.msdn.microsoft.com/windowshardware/Bluetooth-Generic-4f4ea968
Bluetooth low energy is considered Network.Proximity just as NFC.

Resources