Skip to content

Commit d2504a9

Browse files
committed
Create Models.cs
1 parent d110733 commit d2504a9

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

src/Shiny.BluetoothLE/Models.cs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
namespace Shiny.BluetoothLE;
2+
3+
4+
public record ScanConfig(
5+
/// <summary>
6+
/// Filters scan to peripherals that advertise specified service UUIDs
7+
/// iOS - you must set this to initiate a background scan
8+
/// </summary>
9+
params string[] ServiceUuids
10+
);
11+
12+
13+
public record ScanResult(
14+
IPeripheral Peripheral,
15+
int Rssi,
16+
IAdvertisementData AdvertisementData
17+
);
18+
19+
20+
public record BleServiceInfo(string Uuid);
21+
22+
23+
public record BleCharacteristicInfo(
24+
BleServiceInfo Service,
25+
string Uuid,
26+
bool IsNotifying,
27+
CharacteristicProperties Properties
28+
);
29+
30+
31+
public record BleDescriptorInfo(
32+
BleCharacteristicInfo Characteristic,
33+
string Uuid
34+
);
35+
36+
37+
public record BleCharacteristicResult(
38+
BleCharacteristicInfo Characteristic,
39+
BleCharacteristicEvent Event,
40+
byte[]? Data
41+
);
42+
43+
44+
public enum BleCharacteristicEvent
45+
{
46+
Read,
47+
Write,
48+
WriteWithoutResponse,
49+
Notification
50+
}
51+
52+
53+
public record BleDescriptorResult(
54+
BleDescriptorInfo Descriptor,
55+
byte[]? Data
56+
);

0 commit comments

Comments
 (0)