Class BluetoothAudio
Definition
- Namespace:
- Tizen.Network.Bluetooth
- Assembly:
- Tizen.Network.Bluetooth.dll
- API Level:
- 3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
This class is used to handle the connection with other Bluetooth audio devices like headset, hands-free, and headphone.
C#Copypublic class BluetoothAudio : BluetoothProfile
- Inheritance
Methods
Connect(BluetoothAudioProfileType)
Connects the remote device with the given audio profile.
Declaration
C#Copypublic void Connect(BluetoothAudioProfileType profileType)
Parameters
Type | Name | Description |
---|---|---|
BluetoothAudioProfileType | profileType | The type of the audio profile. |
Remarks
The device must be bonded with the remote device by CreateBond(). If connection request succeeds, the AudioConnectionStateChanged event will be invoked.
If audio profile type is All and this request succeeds, then the AudioConnectionStateChanged event will be called twice when HspHfp
and AdvancedAudioDistribution is connected.
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when the Bluetooth is not supported. |
System.InvalidOperationException | Thrown when the Bluetooth is not enabled or when the connection attempt fails. |
API Level: 3
Disconnect(BluetoothAudioProfileType)
Disconnects the remote device with the given audio profile.
Declaration
C#Copypublic void Disconnect(BluetoothAudioProfileType type)
Parameters
Type | Name | Description |
---|---|---|
BluetoothAudioProfileType | type | The type of the audio profile. |
Remarks
The device must be connected by Connect(). If the disconnection request succeeds, the AudioConnectionStateChanged event will be invoked.
If audio profile type is All and this request succeeds, then the AudioConnectionStateChanged event will be called twice when HspHfp
and AdvancedAudioDistribution is disconnected.
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when the Bluetooth is not supported. |
System.InvalidOperationException | Thrown when the Bluetooth is not enabled or when Disconnection attempt fails. |
API Level: 3
Events
AudioConnectionStateChanged
The AudioConnectionStateChanged event is called when the audio connection state is changed.
Declaration
C#Copypublic event EventHandler<AudioConnectionStateChangedEventArgs> AudioConnectionStateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<AudioConnectionStateChangedEventArgs> |