Eric
Eric

Reputation: 703

Use Android as Bluetooth LE Peripheral without Advertising

I want to exchange some data between two android devices using Bluetooth LE (and yes, I know that I'm not intendet exchanging data with BLE, but thats not the point here). So I started researching on that topic and found out that the device used as peripheral needs android 5, while the core device will need android 4.3.

The first step would be starting a BluetoothGattServer on the peripheral, then advertise it and finally start scanning for it with the core device. I understand that advertising was added in android 5 but BluetoothGattServer exists since android 4.3.

So if I would just create the BluetoothDevice object to which the core should connect from a address string (which I got), there is no need for advertising the peripheral. If advertising isn't necessary I could just stick to android 4.3 without the need of a 5.0 device.

But somehow I got a strange feeling about this, like I'm getting something wrong? Any suggestions?

Upvotes: 0

Views: 605

Answers (1)

Guo Xingmin
Guo Xingmin

Reputation: 1013

Advertising is necessary for peripheral since if it was no advertising, the central can not find the device(OK I assume you have the peripheral MAC address) but if central could not receive the advertising will not send out the connect request, hence the connection would not be set up.

I understand that advertising was added in android 5 but BluetoothGattServer exists since android 4.3

I assume you mean that 4.3 can support BLE and advertising/BluetoothGattServer exists on android 5 right?

If you just transfer few bytes, why don't you use SPP or OPP.

Upvotes: 1

Related Questions