/
BluetoothRemoteGATTServer.cs
47 lines (39 loc) · 1.35 KB
/
BluetoothRemoteGATTServer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//-----------------------------------------------------------------------
// <copyright file="BluetoothRemoteGATTServer.cs" company="In The Hand Ltd">
// Copyright (c) 2018-19 In The Hand Ltd, All rights reserved.
// This source code is licensed under the MIT License - see License.txt
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace InTheHand.Bluetooth.GenericAttributeProfile
{
public sealed partial class BluetoothRemoteGATTServer
{
internal BluetoothRemoteGATTServer(BluetoothDevice device)
{
Device = device;
}
public BluetoothDevice Device { get; private set; }
public bool Connected { get { return GetConnected(); } }
public Task Connect()
{
return DoConnect();
}
public void Disconnect()
{
DoDisconnect();
Device.OnGattServerDisconnected();
}
public Task<BluetoothRemoteGATTService> GetPrimaryService(Guid? service)
{
return DoGetPrimaryService(service);
}
public Task<List<BluetoothRemoteGATTService>> GetPrimaryServices(Guid? service = null)
{
return DoGetPrimaryServices(service);
}
}
}