Class BluetoothGattService
Definition
- Assembly:
- Tizen.Network.Bluetooth.dll
The Bluetooth GATT service.
public class BluetoothGattService
- Inheritance
-
objectBluetoothGattService
Constructors
View SourceBluetoothGattService(string, BluetoothGattServiceType)
The constructor.
Declaration
public BluetoothGattService(string uuid, BluetoothGattServiceType type)
Parameters
| Type | Name | Description |
|---|---|---|
| string | uuid | The UUID of the service. |
| BluetoothGattServiceType | type | The type of service. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | Thrown when the create GATT service procedure fails. |
Properties
View SourceUuid
Specification name from the UUID.
Declaration
public string Uuid { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
View SourceAddCharacteristic(BluetoothGattCharacteristic)
Adds a characteristic to this service.
Declaration
public void AddCharacteristic(BluetoothGattCharacteristic characteristic)
Parameters
| Type | Name | Description |
|---|---|---|
| BluetoothGattCharacteristic | characteristic | The characteristic to be added. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | Thrown when the add GATT characteristic procedure fails. |
AddService(BluetoothGattService)
Includes a service to this service.
Declaration
public void AddService(BluetoothGattService service)
Parameters
| Type | Name | Description |
|---|---|---|
| BluetoothGattService | service | The service to be included. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | Thrown when the add GATT service procedure fails. |
GetCharacteristic(string)
Gets the characteristic with the given UUID that belongs to this service.
Declaration
public BluetoothGattCharacteristic GetCharacteristic(string uuid)
Parameters
| Type | Name | Description |
|---|---|---|
| string | uuid | The UUID for the characteristic to get. |
Returns
| Type | Description |
|---|---|
| BluetoothGattCharacteristic | The characteristic with a given UUID if it exists, null otherwise. |
GetCharacteristics()
Gets list of the characteristic that belongs to this service.
Declaration
public IEnumerable<BluetoothGattCharacteristic> GetCharacteristics()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<T><BluetoothGattCharacteristic> | The list of the characteristic that belongs to this service. |
GetGattClient()
Gets the client instance which the specified service belongs to.
Declaration
public BluetoothGattClient GetGattClient()
Returns
| Type | Description |
|---|---|
| BluetoothGattClient | The client instance which the specified service belongs to. |
GetGattServer()
Gets the server instance which the specified service belongs to.
Declaration
public BluetoothGattServer GetGattServer()
Returns
| Type | Description |
|---|---|
| BluetoothGattServer | The server instance which the specified service belongs to. |
GetIncludeService(string)
Gets the included service.
Declaration
public BluetoothGattService GetIncludeService(string uuid)
Parameters
| Type | Name | Description |
|---|---|---|
| string | uuid | The UUID for the service to get. |
Returns
| Type | Description |
|---|---|
| BluetoothGattService | The service with a given UUID if it exists, null otherwise. |
GetIncludeServices()
Gets the included service list of this service.
Declaration
public IEnumerable<BluetoothGattService> GetIncludeServices()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<T><BluetoothGattService> | The included service list of this service. |