BluetoothProfile
interface BluetoothProfile
android.bluetooth.BluetoothProfile |
Public APIs for the Bluetooth Profiles.
Clients should call BluetoothAdapter#getProfileProxy
, to get the Profile Proxy. Each public profile implements this interface.
Summary
Nested classes | |
---|---|
abstract |
An interface for notifying BluetoothProfile IPC clients when they have been connected or disconnected to the service. |
Constants | |
---|---|
static Int |
A2DP profile. |
static Int |
Coordinated Set Identification Profile set coordinator |
static String |
Extra for the connection state intents of the individual profiles. |
static String |
Extra for the connection state intents of the individual profiles. |
static Int |
GATT |
static Int |
GATT_SERVER |
static Int | |
static Int |
Headset and Handsfree profile |
static Int |
Health Profile |
static Int |
Hearing Aid Device |
static Int |
HID Device |
static Int |
LE Audio Device |
static Int | |
static Int |
The profile is in connected state |
static Int |
The profile is in connecting state |
static Int |
The profile is in disconnected state |
static Int |
The profile is in disconnecting state |
Public methods | |
---|---|
abstract MutableList<BluetoothDevice!>! |
Get connected devices for this specific profile. |
abstract Int |
getConnectionState(device: BluetoothDevice!) Get the current connection state of the profile |
abstract MutableList<BluetoothDevice!>! |
getDevicesMatchingConnectionStates(states: IntArray!) Get a list of devices that match any of the given connection states. |
Constants
CSIP_SET_COORDINATOR
static val CSIP_SET_COORDINATOR: Int
Coordinated Set Identification Profile set coordinator
Value: 25
EXTRA_PREVIOUS_STATE
static val EXTRA_PREVIOUS_STATE: String
Extra for the connection state intents of the individual profiles.
This extra represents the previous connection state of the profile of the Bluetooth device.
Value: "android.bluetooth.profile.extra.PREVIOUS_STATE"
EXTRA_STATE
static val EXTRA_STATE: String
Extra for the connection state intents of the individual profiles.
This extra represents the current connection state of the profile of the Bluetooth device.
Value: "android.bluetooth.profile.extra.STATE"
HEALTH
static valHEALTH: Int
Deprecated: Health Device Profile (HDP) and MCAP protocol are no longer used. New apps should use Bluetooth Low Energy based solutions such as BluetoothGatt
, android.bluetooth.BluetoothAdapter#listenUsingL2capChannel()
, or android.bluetooth.BluetoothDevice#createL2capChannel(int)
Health Profile
Value: 3
STATE_CONNECTED
static val STATE_CONNECTED: Int
The profile is in connected state
Value: 2
STATE_CONNECTING
static val STATE_CONNECTING: Int
The profile is in connecting state
Value: 1
STATE_DISCONNECTED
static val STATE_DISCONNECTED: Int
The profile is in disconnected state
Value: 0
STATE_DISCONNECTING
static val STATE_DISCONNECTING: Int
The profile is in disconnecting state
Value: 3
Public methods
getConnectedDevices
abstract fun getConnectedDevices(): MutableList<BluetoothDevice!>!
Get connected devices for this specific profile.
Return the set of devices which are in state STATE_CONNECTED
Return | |
---|---|
MutableList<BluetoothDevice!>! |
List of devices. The list will be empty on error. |
getConnectionState
abstract fun getConnectionState(device: BluetoothDevice!): Int
Get the current connection state of the profile
Parameters | |
---|---|
device |
BluetoothDevice!: Remote bluetooth device. |
Return | |
---|---|
Int |
State of the profile connection. One of STATE_CONNECTED , STATE_CONNECTING , STATE_DISCONNECTED , STATE_DISCONNECTING Value is android.bluetooth.BluetoothProfile#STATE_DISCONNECTED , android.bluetooth.BluetoothProfile#STATE_CONNECTING , android.bluetooth.BluetoothProfile#STATE_CONNECTED , or android.bluetooth.BluetoothProfile#STATE_DISCONNECTING |
getDevicesMatchingConnectionStates
abstract fun getDevicesMatchingConnectionStates(states: IntArray!): MutableList<BluetoothDevice!>!
Get a list of devices that match any of the given connection states.
If none of the devices match any of the given states, an empty list will be returned.
Parameters | |
---|---|
states |
IntArray!: Array of states. States can be one of STATE_CONNECTED , STATE_CONNECTING , STATE_DISCONNECTED , STATE_DISCONNECTING , |
Return | |
---|---|
MutableList<BluetoothDevice!>! |
List of devices. The list will be empty on error. |