Thursday, 20 May 2021

Accessing GATT Error codes instead of int

How via android I can access to GATT error codes

Instead of doing this:

override fun onConnectionStateChange(gatt: BluetoothGatt?, status: Int, newState: Int) {
            super.onConnectionStateChange(gatt, status, newState)

             if (status == 133) {
               //Do something
            }
        }

I wish to do simething like this:

override fun onConnectionStateChange(gatt: BluetoothGatt?, status: Int, newState: Int) {
            super.onConnectionStateChange(gatt, status, newState)

             if (status == <WhatGoesHere?>.GATT_ERROR) {
               //Do something
            }
        }


from Accessing GATT Error codes instead of int

No comments:

Post a Comment