forked from glywood/cec-fix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lan.hpp
75 lines (66 loc) · 1.56 KB
/
lan.hpp
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
#ifndef LAN_H
#define LAN_H
/**
* Set the global projector host.
*
* @param char host The IPv4 (or IPv6) address of the projector.
*
* @return void
*/
void setHost(char * host);
void setHost(const char * host);
/**
* Send the NULL command for testing purposes.
*
* @return int 0 if the command was sent successfully. A negative integer
* if an error was encountered.
*/
int sendNull();
/**
* Send the Power On command.
*
* @return int 0 if the command was sent successfully. A negative integer
* if an error was encountered.
*/
int sendOn();
/**
* Send the Power Off/Standby command.
*
* @return int 0 if the command was sent successfully. A negative integer
* if an error was encountered.
*/
int sendOff();
/**
* Whether the host is POWER_ON or WARMING mode.
*
* @return bool
*/
bool isOn();
/**
* Whether the host is in STANDBY or COOLING mode.
*
* @return bool [return description]
*/
bool isOff();
/**
* Get the power status of the host.
*
* @return int 0: STANDBY
* 1: POWER_ON
* 2: COOLING
* 3: WARMING
* 4: EMERGENCY
* -1: Unknown status
*/
int queryPowerStatus();
/**
* Same as queryPowerStatus but caches the result for 10 seconds.
*
* This prevents many rapid calls for the power status from overloading
* the projector's maximum connection count (which appears quite low,
* empirically).
*
* @return int @see queryPowerStatus
*/
int queryPowerStatusCached();
#endif