Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
462 views
in Technique[技术] by (71.8m points)

bluetooth - How to pair two BLE devices using secure passkey method in android?

I need to pair two BLE devices(one device is android phone [central app - discovers services] and other devices BLE [peripherals - advertise the services] support hardware) with secure passkey method in android. I googled it but no luck, I got no references about secure pairing in BLE android.

I have developed an Android Application in phone - connection, bonding is working fine but not able to find out how to do PASSKEY pairing.

I have found some links in internet regards this but in BLUETOOTH not in BLE devices. Any suggestions?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is all handled by the Bluetooth stack when you bond.

Per the Bluetooth specification, the security level chosen will always be the highest one supported by both devices. So just make sure the peripheral supports the desired level and Android will use that (since Android supports all security levels). There is no API in Android to select a lower level.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...