1

my problem is connect phone to phone and send/receive message each other via bluetooth. using cordova plugins for bluetooth (BLE), successfully scan other device such as bluetooth bracelet but not scanned any smartphone. I tried a lot of cordova plugin but not give any result. What can I do for my problem?

Thanks

1 Answer 1

0

Short Answer

Your bracelet is running a GATT server which advertises bluetooth packets, and you're phone is not. There aren't any PhoneGap plugins that allow your phone to run a GATT server. You'll need to create your own PhoneGap plugin.

Long Answer

If you want to exchange bluetooth data between two phones, both phones need to support bluetooth low energy, so that the second phone can run a GATT server. In bluetooth low energy, the phone that's scanning is known as the central device, and the phone that's advertising is known as the peripheral device.

As of today (Nov 15, 2015), only the newest phones and operating systems support the ability for a phone to act as a peripheral device (i.e. run a GATT server and advertise packets).

  • iPhone 4S or newer, running iOS 6 or newer
  • Nexus 5X and Nexus 6 - running Android L (also known as 5.0 or Lollipop) or newer

Currently, all the PhoneGap plugins available on PhoneGap.com, GitHub, and NPM will only run a phone as a central device.

If you want to connect to a second phone, you'll need to create or extend an existing PhoneGap plugin to run the second phone in peripheral mode.

To get started, you can look at the CBPeripheralManager class under the iOS developer documentation (https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBPeripheralManager_Class/index.html), or the BluetoothServerSocket class under the Android developer documentation (https://developer.android.com/guide/topics/connectivity/bluetooth.html#ConnectingDevices).

To learn more about how iOS and Android bluetooth frameworks you can also watch the following videos: https://developer.apple.com/videos/play/wwdc2013-703/ https://developer.apple.com/videos/play/wwdc2012-705/ https://developer.apple.com/videos/play/wwdc2012-703/ https://www.youtube.com/watch?v=vUbFB1Qypg8 https://www.youtube.com/watch?v=qx55Sa8UZAQ

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.