Stay organized with collections
Save and categorize content based on your preferences.
BluetoothStatusCodes
class BluetoothStatusCodes
A class with constants representing possible return values for Bluetooth APIs. General return values occupy the range 0 to 199. Profile-specific return values occupy the range 200-999. API-specific return values start at 1000. The exception to this is the "UNKNOWN" error code which occupies the max integer value.
Summary
Constants |
static Int |
Error code indicating that the API call was initiated by neither the system nor the active user.
|
static Int |
Error code indicating that Bluetooth is not enabled.
|
static Int |
Error code indicating that the Bluetooth Device specified is not bonded.
|
static Int |
A GATT writeCharacteristic request is not permitted on the remote device.
|
static Int |
A GATT writeCharacteristic request is issued to a busy remote device.
|
static Int |
Error code indicating that the caller does not have the android.Manifest.permission#BLUETOOTH_CONNECT permission.
|
static Int |
Error code indicating that the profile service is not bound.
|
static Int |
Indicates that an unknown error has occurred.
|
static Int |
Indicates that the feature status is not configured yet.
|
static Int |
Indicates that the feature is not supported.
|
static Int |
Indicates that the feature is supported.
|
static Int |
Indicates that the API call was successful.
|
Constants
ERROR_BLUETOOTH_NOT_ALLOWED
static val ERROR_BLUETOOTH_NOT_ALLOWED: Int
Error code indicating that the API call was initiated by neither the system nor the active user.
Value: 2
ERROR_BLUETOOTH_NOT_ENABLED
static val ERROR_BLUETOOTH_NOT_ENABLED: Int
Error code indicating that Bluetooth is not enabled.
Value: 1
ERROR_DEVICE_NOT_BONDED
static val ERROR_DEVICE_NOT_BONDED: Int
Error code indicating that the Bluetooth Device specified is not bonded.
Value: 3
ERROR_GATT_WRITE_NOT_ALLOWED
static val ERROR_GATT_WRITE_NOT_ALLOWED: Int
A GATT writeCharacteristic request is not permitted on the remote device.
Value: 200
ERROR_GATT_WRITE_REQUEST_BUSY
static val ERROR_GATT_WRITE_REQUEST_BUSY: Int
A GATT writeCharacteristic request is issued to a busy remote device.
Value: 201
ERROR_PROFILE_SERVICE_NOT_BOUND
static val ERROR_PROFILE_SERVICE_NOT_BOUND: Int
Error code indicating that the profile service is not bound. You can bind a profile service by calling BluetoothAdapter.getProfileProxy
.
Value: 9
ERROR_UNKNOWN
static val ERROR_UNKNOWN: Int
Indicates that an unknown error has occurred.
Value: 2147483647
static val FEATURE_NOT_CONFIGURED: Int
Indicates that the feature status is not configured yet.
Value: 30
FEATURE_NOT_SUPPORTED
static val FEATURE_NOT_SUPPORTED: Int
Indicates that the feature is not supported.
Value: 11
FEATURE_SUPPORTED
static val FEATURE_SUPPORTED: Int
Indicates that the feature is supported.
Value: 10
SUCCESS
static val SUCCESS: Int
Indicates that the API call was successful.
Value: 0
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# BluetoothStatusCodes\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBluetoothStatusCodes\n====================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/bluetooth/BluetoothStatusCodes \"View this page in Java\") \n\n```\nclass BluetoothStatusCodes\n```\n\n|---|---------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.bluetooth.BluetoothStatusCodes](#) |\n\nA class with constants representing possible return values for Bluetooth APIs. General return values occupy the range 0 to 199. Profile-specific return values occupy the range 200-999. API-specific return values start at 1000. The exception to this is the \"UNKNOWN\" error code which occupies the max integer value.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_BLUETOOTH_NOT_ALLOWED](#ERROR_BLUETOOTH_NOT_ALLOWED:kotlin.Int) Error code indicating that the API call was initiated by neither the system nor the active user. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_BLUETOOTH_NOT_ENABLED](#ERROR_BLUETOOTH_NOT_ENABLED:kotlin.Int) Error code indicating that Bluetooth is not enabled. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_DEVICE_NOT_BONDED](#ERROR_DEVICE_NOT_BONDED:kotlin.Int) Error code indicating that the Bluetooth Device specified is not bonded. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_GATT_WRITE_NOT_ALLOWED](#ERROR_GATT_WRITE_NOT_ALLOWED:kotlin.Int) A GATT writeCharacteristic request is not permitted on the remote device. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_GATT_WRITE_REQUEST_BUSY](#ERROR_GATT_WRITE_REQUEST_BUSY:kotlin.Int) A GATT writeCharacteristic request is issued to a busy remote device. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION](#ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION:kotlin.Int) Error code indicating that the caller does not have the [android.Manifest.permission#BLUETOOTH_CONNECT](../Manifest.permission.html#BLUETOOTH_CONNECT:kotlin.String) permission. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_PROFILE_SERVICE_NOT_BOUND](#ERROR_PROFILE_SERVICE_NOT_BOUND:kotlin.Int) Error code indicating that the profile service is not bound. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_UNKNOWN](#ERROR_UNKNOWN:kotlin.Int) Indicates that an unknown error has occurred. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [FEATURE_NOT_CONFIGURED](#FEATURE_NOT_CONFIGURED:kotlin.Int) Indicates that the feature status is not configured yet. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [FEATURE_NOT_SUPPORTED](#FEATURE_NOT_SUPPORTED:kotlin.Int) Indicates that the feature is not supported. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [FEATURE_SUPPORTED](#FEATURE_SUPPORTED:kotlin.Int) Indicates that the feature is supported. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SUCCESS](#SUCCESS:kotlin.Int) Indicates that the API call was successful. |\n\nConstants\n---------\n\n### ERROR_BLUETOOTH_NOT_ALLOWED\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_BLUETOOTH_NOT_ALLOWED: Int\n```\n\nError code indicating that the API call was initiated by neither the system nor the active user. \n\n Value: 2\n\n### ERROR_BLUETOOTH_NOT_ENABLED\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_BLUETOOTH_NOT_ENABLED: Int\n```\n\nError code indicating that Bluetooth is not enabled. \n\n Value: 1\n\n### ERROR_DEVICE_NOT_BONDED\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_DEVICE_NOT_BONDED: Int\n```\n\nError code indicating that the Bluetooth Device specified is not bonded. \n\n Value: 3\n\n### ERROR_GATT_WRITE_NOT_ALLOWED\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_GATT_WRITE_NOT_ALLOWED: Int\n```\n\nA GATT writeCharacteristic request is not permitted on the remote device. \n\n Value: 200\n\n### ERROR_GATT_WRITE_REQUEST_BUSY\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_GATT_WRITE_REQUEST_BUSY: Int\n```\n\nA GATT writeCharacteristic request is issued to a busy remote device. \n\n Value: 201\n\n### ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION: Int\n```\n\nError code indicating that the caller does not have the [android.Manifest.permission#BLUETOOTH_CONNECT](../Manifest.permission.html#BLUETOOTH_CONNECT:kotlin.String) permission. \n\n Value: 6\n\n### ERROR_PROFILE_SERVICE_NOT_BOUND\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_PROFILE_SERVICE_NOT_BOUND: Int\n```\n\nError code indicating that the profile service is not bound. You can bind a profile service by calling [BluetoothAdapter.getProfileProxy](/reference/kotlin/android/bluetooth/BluetoothAdapter#getProfileProxy(android.content.Context,%20android.bluetooth.BluetoothProfile.ServiceListener,%20kotlin.Int)). \n\n Value: 9\n\n### ERROR_UNKNOWN\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_UNKNOWN: Int\n```\n\nIndicates that an unknown error has occurred. \n\n Value: 2147483647\n\n### FEATURE_NOT_CONFIGURED\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val FEATURE_NOT_CONFIGURED: Int\n```\n\nIndicates that the feature status is not configured yet. \n\n Value: 30\n\n### FEATURE_NOT_SUPPORTED\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val FEATURE_NOT_SUPPORTED: Int\n```\n\nIndicates that the feature is not supported. \n\n Value: 11\n\n### FEATURE_SUPPORTED\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val FEATURE_SUPPORTED: Int\n```\n\nIndicates that the feature is supported. \n\n Value: 10\n\n### SUCCESS\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val SUCCESS: Int\n```\n\nIndicates that the API call was successful. \n\n Value: 0"]]