Anything with Error 133 gives useless information. First, are the other two devices pairable (require security/encryption) or is it just the custom device? If it is the former I have found that on Android 5+ there is a bug where one is allowed to try to read or write characteristics that require encryption to be established before that happens. Android provides no API to let the application know when encryption has been established after one receives a connection indication. It seems like pre-5.0 Android prevented the application from doing any reads/writes before encryption was established. However, in 5.0+ that is no longer true. So if your app tries to do something right after the connection indication (besides service discovery) and encryption is not established, an error will result. I do not believe I got treated to an 'insufficient security' error in that case.
As a work around I introduced a hack sleep after the connection indication for 5.0+. Its a big-time sucky way to do something because it will be device dependent and who knows how long it takes on device x? However, it did solve the problem in my case for peer device X on Android device N. Its just a guess unfortunately. On Thursday, October 8, 2015 at 6:31:04 AM UTC-4, Wenshan wrote: > > Hello everyone, > > On Samsung Age Plus (API Level 22), the official sample BluetoothLeGatt > can't connect to a customized Bluetooth device that requires encrypted > handshake, while some other devices such as `HTC One M7 API Level 21` and > `Huawei Mate 7 API Level 19` are fine. > > These two lines from logcat might be useful: > > `onClientConnectionState() - status=34 clientIf=6 device=FC:58:FA:A1:11:A9` > `onClientConnectionState() - status=133 clientIf=6 > device=FC:58:FA:A1:11:A9` > > From > https://github.com/rosterloh/AndroidBuddi/blob/c8e09068b4cdddfefcfad35eb1c1c3538aa81f3d/BlueBand/src/main/java/com/buddi/client/ble/error/GattError.java > : > > # 0x22H is 34D, 0085H is 133D > ``` > case 0x22: > return "GATT CONN LMP TIMEOUT"; > ... > case 0x0085: > return "GATT ERROR"; > ``` > > Have been Googling for a long time but still have no clue, any idea is > welcome. > > More detailed log: http://dpaste.com/02F7MN8 > > Please let me know if more information is required. > > > Thanks, > Wenshan > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/de22e4ad-b8d1-4a19-bcba-2549172a56df%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

