Vikash Sharma
Vikash Sharma

Reputation: 62

Create a bluetooth LE application

I'm trying to create an application in which I want to connect a Bluetooth Low Energy device with my android application by either scanning the bar code of the device or the 6 digit code of that device.

Any suggestions or code (github also) are welcomed.

Thanks in advance

Upvotes: 0

Views: 267

Answers (1)

Emil
Emil

Reputation: 18442

For discovering a device with a particular Bluetooth Device Address, just follow the BLE Scan documentation and use a filter with the address. Use a separate Android barcode scanner library to scan the barcode. About static passkey in BLE pairing, the security is not so good, read https://devzone.nordicsemi.com/f/nordic-q-a/35856/questions-about-lesc-mitm-and-passkey/138216#138216 and especially make sure you don't use LE Secure Connections. If you still want to go on (using BLE Legacy Pairing), again use some barcode scanning library to get the passkey and follow instructions how to pragmatically enter the code when pairing, such as this one: Programmatically pairing with a BLE device on Android 4.4+. If the passkey is instead printed and the user should enter it manually, Android OS will automatically show a pop-up where the user can enter the passkey.

Upvotes: 1

Related Questions