Android & Gatt Status 133

How to avoid the most common headache when writing and Android Bluetooth app.

One of the most frustrating statuses when working with Bluetooth on Android is Gatt Status "133".

It is probably the most common error I get asked about when helping teams troubleshoot their Android apps.

Status 133 is given the very helpful and descriptive error type of "GATT_ERROR"  

🙂

While not the official description, most often this status is given when the Android Bluetooth stack was not given enough time to complete an operation.

Each call to the Android Bluetooth APIs needs to complete before the next call is made.

This means connecting, setting the MTU, connection intervals, reading, writing, and registering for notifications/indications needs to happen serially.

So you will need to factor this into the code design. Take advantage of the Android Bluetooth call backs and consider using a command queue to make sure read/writes happen one at a time.