Can't read Gatt characteristic (gatt error 15)

2019-07-20 09:23发布

问题:

I'm trying to read a characteristic right after gatt connected and services discovered successfully. But receives error 15 (0x0f, GATT_INSUFFICIENT_ENCRYPTION) and then 137 (0x0089) in onCharacteristicRead gatt callback. After this error gatt disconnecting immediately.

My device is Samsung S4, 4.4.2.

回答1:

As far as i know both errors, "GATT_INSUFFICIENT_ENCRYPTION" and "GATT_INSUFFICIENT_AUTHENTICATION" gets occurred when you try to do a GATT operation that requires encryption. This means that you need to pair with the remote BLE device before trying to do any GATT operations, for example reading a characteristic or writing to a characteristic etc.

Have a look at the following SO link to see the different ways to pair with a BLE device.