-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlants-udp.d.ts
66 lines (66 loc) · 1.53 KB
/
lants-udp.d.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
/// <reference types="node" />
import { lifxMsgType, LifxLanHeader } from "./lants-parser.js";
/**
* Handle incoming message that is not otherwise handled
*/
export interface udpParams {
address?: string;
type: lifxMsgType;
payload?: object;
ack_required?: boolean;
res_required?: boolean;
target?: string;
broadcast?: boolean;
}
/**
* Address info for incoming packet
*/
export interface udpRinfo {
address: string;
family: string;
port: number;
size: number;
}
export interface udpDiscover {
seq: number;
address: string;
buffer: Buffer;
}
/**
* Parsed message including header and payload
*/
export interface udpParsed {
header: LifxLanHeader;
payload: {};
address?: string;
mac?: string;
}
export declare class LifxLanUdp {
static GetUDP(): Promise<LifxLanUdp>;
private constructor();
private _UDP_PORT;
private _udp;
private _requests;
private _sequence;
private _timeout;
private _source_id;
private _netif_list;
destroy(): Promise<void>;
private initPromise;
private initialized;
private initializing;
/**
* Initialize instance. Should only be called once
*/
private init;
request(params: udpParams): Promise<udpParsed | void>;
private _requestUnicast;
private _requestBroadcast;
private _receivePacket;
private _isNetworkInterfaceAddress;
discover(params: {
wait?: number;
}): Promise<udpParsed[]>;
private _sendBroadcast;
}
//# sourceMappingURL=lants-udp.d.ts.map