This repository has been archived by the owner on May 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathdefinitions.ts
83 lines (58 loc) · 1.77 KB
/
definitions.ts
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
export interface BluetoothSerialPlugin {
isEnabled(): Promise<BluetoothEnabledResult>;
enable(): Promise<BluetoothEnabledResult>;
scan(): Promise<BluetoothScanResult>;
connect(options: BluetoothConnectOptions): Promise<void>;
connectInsecure(options: BluetoothConnectOptions): Promise<void>;
disconnect(options: BluetoothConnectOptions): Promise<void>;
isConnected(options: BluetoothConnectOptions): Promise<BluetoothConnectResult>;
read(options: BluetoothReadOptions): Promise<BluetoothDataResult>;
readUntil(options: BluetoothReadUntilOptions): Promise<BluetoothDataResult>;
write(options: BluetoothWriteOptions): Promise<void>;
enableNotifications(options: BluetoothEnableNotificationsOptions): Promise<BluetoothEnableNotificationsResult>;
disableNotifications(options: BluetoothDisableNotificationsOptions): Promise<void>;
}
export interface BluetoothEnabledResult {
enabled: boolean;
}
export interface BluetoothScanResult {
devices: BluetoothDevice[];
}
export interface BluetoothConnectResult {
connected: boolean;
}
export interface BluetoothDataResult {
data: string;
}
export interface BluetoothEnableNotificationsResult {
eventName: string;
}
export interface BluetoothDevice {
name: string;
id: string;
address: string;
class: number;
uuid: string;
rssi: number;
}
export interface BluetoothConnectOptions {
address: string;
}
export interface BluetoothReadOptions {
address: string;
}
export interface BluetoothReadUntilOptions {
address: string;
delimiter: string;
}
export interface BluetoothWriteOptions {
address: string;
value: string;
}
export interface BluetoothEnableNotificationsOptions {
address: string;
delimiter: string;
}
export interface BluetoothDisableNotificationsOptions {
address: string;
}