Aller au contenu principal

GattError

Sealed Class: GattError

Gatt Error. Called when BluetoothGatt onConnectionStateChange return other than GATT_SUCCESS.

Parameters

  • errorCode - Error code identifier
  • localizedDescription - Human-readable error description

Error Types

BleHciConnectionTimeout

object BleHciConnectionTimeout : GattError

Could not establish a connection in specified period. Maybe when distance for connect is so long or device is currently connected to something else

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 8
  • locailzedDescription: BLE_HCI_CONNECTION_TIMEOUT

BleHciConnFailedToBeEstablished

object BleHciConnFailedToBeEstablished : GattError

The BLE connection failed to be established. This could be due to a variety of reasons, such as the device being out of range, the device being turned off, or a problem with the BLE stack on either device

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 62
  • locailzedDescription: BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED

BleHciConnIntervalUnacceptable

object BleHciConnIntervalUnacceptable : GattError

The connection interval you requested is unacceptable to the BLE device

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 59
  • locailzedDescription: BLE_HCI_CONN_INTERVAL_UNACCEPTABLE

BleHciConnTerminatedDueToMicFailure

object BleHciConnTerminatedDueToMicFailure : GattError

The BLE connection was terminated due to a microphone failure. This could indicate a hardware issue with the microphone or a problem with the audio processing on the device

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 61
  • locailzedDescription: BLE_HCI_CONN_TERMINATED_DUE_TO_MIC_FAILURE

BleHciControllerBusy

object BleHciControllerBusy : GattError

The BLE controller is busy and can't handle your request

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 58
  • locailzedDescription: BLE_HCI_CONTROLLER_BUSY

BleHciDifferentTransactionCollision

object BleHciDifferentTransactionCollision : GattError

A different BLE transaction collided with the current one

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 42
  • locailzedDescription: BLE_HCI_DIFFERENT_TRANSACTION_COLLISION

BleHciDirectedAdvertiserTimeout

object BleHciDirectedAdvertiserTimeout : GattError

The directed advertising procedure timed out before a connection could be established

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 60
  • locailzedDescription: BLE_HCI_DIRECTED_ADVERTISER_TIMEOUT

BleHciInstantPassed

object BleHciInstantPassed : GattError

The instant you specified has already passed

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 40
  • locailzedDescription: BLE_HCI_INSTANT_PASSED

BleHciLocalHostTerminatedConnection

object BleHciLocalHostTerminatedConnection : GattError

Your device terminated the BLE connection

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 22
  • locailzedDescription: BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION

BleHciPairingWithUnitKeyUnsupported

object BleHciPairingWithUnitKeyUnsupported : GattError

The BLE device doesn't support pairing with a unit key

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 41
  • locailzedDescription: BLE_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED

BleHciRemoteDevTerminationDueToLowResources

object BleHciRemoteDevTerminationDueToLowResources : GattError

The BLE device terminated the connection because it's low on resources

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 20
  • locailzedDescription: BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES

BleHciRemoteDevTerminationDueToPowerOff

object BleHciRemoteDevTerminationDueToPowerOff : GattError

The BLE device terminated the connection because it's powering off

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 21
  • locailzedDescription: BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF

BleHciRemoteUserTerminatedConnection

object BleHciRemoteUserTerminatedConnection : GattError

The user on the other end terminated the BLE connection

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 19
  • locailzedDescription: BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION

BleHciStatusCodeCommandDisallowed

object BleHciStatusCodeCommandDisallowed : GattError

The BLE device doesn't allow the command you're trying to send

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 12
  • locailzedDescription: BLE_HCI_STATUS_CODE_COMMAND_DISALLOWED

BleHciStatusCodeInvalidBtleCommandParameters

object BleHciStatusCodeInvalidBtleCommandParameters : GattError

The parameters you're using for the BLE command are invalid

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 18
  • locailzedDescription: BLE_HCI_STATUS_CODE_INVALID_BTLE_COMMAND_PARAMETERS

BleHciStatusCodeInvalidLmpParameters

object BleHciStatusCodeInvalidLmpParameters : GattError

The parameters for the Link Manager Protocol (LMP) are invalid

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 30
  • locailzedDescription: BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS

BleHciStatusCodeLmpPduNotAllowed

object BleHciStatusCodeLmpPduNotAllowed : GattError

The LMP Protocol Data Unit (PDU) isn't allowed

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 36
  • locailzedDescription: BLE_HCI_STATUS_CODE_LMP_PDU_NOT_ALLOWED

BleHciStatusCodeLmpResponseTimeout

object BleHciStatusCodeLmpResponseTimeout : GattError

The LMP response timed out

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 34
  • locailzedDescription: BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT

BleHciStatusCodeUnspecifiedError

object BleHciStatusCodeUnspecifiedError : GattError

An unspecified error occurred with the BLE connection

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 31
  • locailzedDescription: BLE_HCI_STATUS_CODE_UNSPECIFIED_ERROR

BleHciUnsupportedRemoteFeature

object BleHciUnsupportedRemoteFeature : GattError

The BLE device doesn't support a feature that your device needs

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 26
  • locailzedDescription: BLE_HCI_UNSUPPORTED_REMOTE_FEATURE

Error

class Error(status: Int) : GattError

GATT error did not recover

GattAuthFail

object GattAuthFail : GattError

Authentication failed when attempting to connect to the BLE device. This could be due to an incorrect password or pairing key

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 137
  • locailzedDescription: GATT_AUTH_FAIL

GATTBusy

object GATTBusy : GattError

The BLE device is busy and cannot handle the request at this time. This could be due to the device processing other requests or performing other tasks

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 132
  • locailzedDescription: GATT_BUSY

GattConnectionCongested

object GattConnectionCongested : GattError

The BLE connection is congested. This could be due to too many devices being connected to the device or too much data being transferred

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 143
  • locailzedDescription: GATT_CONNECTION_CONGESTED

GattConnectionTimeout

object GattConnectionTimeout : GattError

The BLE connection timed out. This could be due to the device being out of range or the device being turned off

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 147
  • locailzedDescription: GATT_CONNECTION_TIMEOUT

GATTDbFull

object GATTDbFull : GattError

The BLE device's database is full. This could prevent the device from storing new data or updating existing data

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 131
  • locailzedDescription: GATT_DB_FULL

GATTError

object GATTError : GattError

A generic GATT error occurred. This is a catch-all error that could indicate a variety of problems

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 133
  • locailzedDescription: GATT_ERROR

GattFailure

object GattFailure : GattError

A generic GATT failure occurred. This is a catch-all error that could indicate a variety of problems

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 257
  • locailzedDescription: GATT_FAILURE

GattIllegalParameter

object GattIllegalParameter : GattError

An illegal parameter was passed to the GATT function. This could be due to an incorrect value being passed or a parameter being missing

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 135
  • locailzedDescription: GATT_ILLEGAL_PARAMETER

GattInsufficientAuthentication

object GattInsufficientAuthentication : GattError

Insufficient authentication for a given operation

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 5
  • locailzedDescription: GATT_INSUFFICIENT_AUTHENTICATION

GattInsufficientEncryption

object GattInsufficientEncryption : GattError

The connection to the BLE device isn't secure enough

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 15
  • locailzedDescription: GATT_INSUFFICIENT_ENCRYPTION

GATTInternalError

object GATTInternalError : GattError

An internal error occurred on the BLE device. This is a generic error that could indicate a variety of problems

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 129
  • locailzedDescription: GATT_INTERNAL_ERROR

GattInvalidAttributeLength

object GattInvalidAttributeLength : GattError

The data you're trying to send or receive is the wrong length

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 13
  • locailzedDescription: GATT_INVALID_ATTRIBUTE_LENGTH

GattInvalidOffset

object GattInvalidOffset : GattError

A read or write operation was requested with an invalid offset

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 7
  • locailzedDescription: GATT_INVALID_OFFSET

GATTNoRessources

object GATTNoRessources : GattError

The BLE device does not have enough resources to complete the request. This could be due to the device being low on memory or processing power

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 128
  • locailzedDescription: GATT_NO_RESSOURCES

GattReadNotPermitted

object GattReadNotPermitted : GattError

GATT read operation is not permitted

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 2
  • locailzedDescription: GATT_READ_NOT_PERMITTED

GattRequestNotSupported

object GattRequestNotSupported : GattError

The given request is not supported

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 6
  • locailzedDescription: GATT_REQUEST_NOT_SUPPORTED

GattWriteNotPermitted

object GattWriteNotPermitted : GattError

GATT write operation is not permitted

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 3
  • locailzedDescription: GATT_WRITE_NOT_PERMITTED

GATTWrongState

object GATTWrongState : GattError

The BLE device is in the wrong state to complete the request. This could be due to the device not being connected or not being in the correct mode

Properties

  • errorCode: Int
  • localizedDescription: String

Parameters

  • errorCode: 130
  • locailzedDescription: GATT_WRONG_STATE

See Also