Definition
- Namespace:
- Tizen.Network.Bluetooth
- Assembly:
- Tizen.Network.Bluetooth.dll
This class is used to handle the remote Bluetooth device. This class lets you create a connection or query information about it, such as the name, address, class and service UUIDs.
To get a BluetoothDevice, use BluetoothAdapter.StartDiscovery() to create one representing a device.
public class BluetoothDevice
- Inheritance
-
Properties
Declaration
public string Address { get; }
Property Value
Declaration
public BluetoothAppearanceType AppearanceType { get; }
Property Value
Declaration
public BluetoothClass Class { get; }
Property Value
View Source
IsAuthorized
The authorization state of the device.
Declaration
public bool IsAuthorized { get; }
Property Value
View Source
IsConnected
The connection state of the device.
Declaration
public bool IsConnected { get; }
Property Value
Declaration
public bool IsPaired { get; }
Property Value
Declaration
public string ManufacturerData { get; set; }
Property Value
View Source
ManufacturerDataLength
The length of the manufacturer data.
Declaration
public int ManufacturerDataLength { get; set; }
Property Value
Declaration
public string Name { get; set; }
Property Value
View Source
The strength indicator of received signal of the device.
Declaration
Property Value
Declaration
public int ServiceCount { get; set; }
Property Value
View Source
ServiceUuidList
The service UUID list of the device.
Declaration
public IEnumerable<string> ServiceUuidList { get; set; }
Property Value
| Type |
Description |
| System.Collections.Generic.IEnumerable<T><string> |
|
Methods
View Source
CancelBonding()
Cancels the bonding process.
Declaration
public void CancelBonding()
Exceptions
| Type |
Condition |
| System.InvalidOperationException |
Thrown when the BT/BTLE is not enabled
or when the cancel bonding procedure to remote device fails.
|
View Source
CreateBond()
Creates a bond with the remote Bluetooth device.
Declaration
Exceptions
| Type |
Condition |
| System.InvalidOperationException |
Thrown when the BT/BTLE is not enabled
or when the create bonding process to the remote device fails.
|
View Source
CreateSocket(string)
Creates the client socket.
Declaration
public IBluetoothClientSocket CreateSocket(string serviceUuid)
Parameters
| Type |
Name |
Description |
| string |
serviceUuid |
The UUID of the service.
|
Returns
Declaration
public void DestroyBond()
Exceptions
| Type |
Condition |
| System.InvalidOperationException |
Thrown when the BT/BTLE is not enabled
or when the destroy bonding procedure fails.
|
View Source
GetConnectedProfiles()
Gets the connected profiles.
Declaration
public IEnumerable<BluetoothProfileType> GetConnectedProfiles()
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<T><BluetoothProfileType> |
The connected Bluetooth profiles.
|
Exceptions
| Type |
Condition |
| System.InvalidOperationException |
Thrown when the BT/BTLE is not enabled
or when there is no BT connection.
|
View Source
GetMaskFromUuid(string[])
Gets the mask from the UUID.
Declaration
public BluetoothServiceClassType GetMaskFromUuid(string[] uuids)
Parameters
| Type |
Name |
Description |
| string[] |
uuids |
The UUID list of the device.
|
Returns
Exceptions
| Type |
Condition |
| System.InvalidOperationException |
Thrown when the BT/BTLE is not enabled
or when the get Mask from UUID fails.
|
View Source
GetProfile<T>()
Returns the instance of the Bluetooth profile type.
Declaration
public T GetProfile<T>() where T : BluetoothProfile
Returns
| Type |
Description |
| T |
The profile instance.
|
Type Parameters
View Source
IsProfileConnected(BluetoothProfileType)
Determines if profile is connected to the specified remote device.
Declaration
public bool IsProfileConnected(BluetoothProfileType profileType)
Parameters
Returns
| Type |
Description |
| bool |
true if profile is connected, otherwise false.
|
Exceptions
| Type |
Condition |
| System.InvalidOperationException |
Thrown when the BT/BTLE is not enabled
or when there is no BT connection.
|
View Source
SetAlias(string)
Sets an alias for the bonded device.
Declaration
public void SetAlias(string aliasName)
Parameters
| Type |
Name |
Description |
| string |
aliasName |
The alias name of the remote device.
|
Exceptions
| Type |
Condition |
| System.InvalidOperationException |
Thrown when the BT/BTLE is not enabled
or when the set alias name to remote device fails.
|
View Source
SetAuthorization(BluetoothAuthorizationType)
Sets the authorization of a bonded device.
Declaration
public void SetAuthorization(BluetoothAuthorizationType authorizationState)
Parameters
Exceptions
| Type |
Condition |
| System.InvalidOperationException |
Thrown when the BT/BTLE is not enabled
or when the set authorization to remote device fails.
|
View Source
StartServiceSearch()
Starts the search for services supported by the specified device.
Declaration
public void StartServiceSearch()
Exceptions
| Type |
Condition |
| System.InvalidOperationException |
Thrown when the BT/BTLE is not enabled
or when the remote device service search fails.
|
Events
View Source
AuthorizationChanged
The AuthorizationChanged event is raised when the authorization of the device is changed.
Declaration
public event EventHandler<AuthorizationChangedEventArgs> AuthorizationChanged
Event Type
View Source
BondCreated
The BondCreated event is raised when the process of creating the bond is finished.
Declaration
public event EventHandler<BondCreatedEventArgs> BondCreated
Event Type
View Source
BondDestroyed
The BondDestroyed event is raised when the bond is destroyed.
Declaration
public event EventHandler<BondDestroyedEventArgs> BondDestroyed
Event Type
View Source
ConnectionStateChanged
The ConnectionStateChanged event is raised when the connection state is changed.
Declaration
public event EventHandler<DeviceConnectionStateChangedEventArgs> ConnectionStateChanged
Event Type
View Source
ServiceSearched
The ServiceSearched event is raised when the process of service searched is finished.
Declaration
public event EventHandler<ServiceSearchedEventArgs> ServiceSearched
Event Type