Rev 2060 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 2060 | Rev 2062 | ||
|---|---|---|---|
| Line 24... | Line 24... | ||
| 24 | return $array["results"]; |
24 | return $array["results"]; |
| 25 | } |
25 | } |
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | function |
29 | function SendGenericCommand($command) |
| 30 | { |
30 | { |
| 31 | global $AtomURL; |
31 | global $AtomURL; |
| 32 | global $AtomPort; |
32 | global $AtomPort; |
| 33 | 33 | ||
| 34 | $level2 = 0; |
- | |
| 35 | $buffer = ""; |
34 | $buffer = ""; |
| 36 | 35 | ||
| 37 | try |
36 | try |
| 38 | { |
37 | { |
| 39 | $socket = atomd_initialize($AtomURL, $AtomPort); |
38 | $socket = atomd_initialize($AtomURL, $AtomPort); |
| 40 | 39 | ||
| 41 | atomd_send_command($socket, |
40 | atomd_send_command($socket, $command); |
| 42 | 41 | ||
| 43 | $buffer = atomd_read_command_response($socket); |
42 | $buffer = atomd_read_command_response($socket); |
| 44 | } |
43 | } |
| 45 | catch (Exception $e) |
44 | catch (Exception $e) |
| 46 | { |
45 | { |
| 47 | die($e); |
46 | die($e); |
| 48 | } |
47 | } |
| - | 48 | return $buffer; |
|
| - | 49 | } |
|
| - | 50 | ||
| - | 51 | ||
| - | 52 | ||
| - | 53 | function SetDimmerValue($alias2, $level) |
|
| - | 54 | { |
|
| - | 55 | SendGenericCommand("Dimmer_AbsoluteFade $alias2 255 $level"); |
|
| - | 56 | } |
|
| - | 57 | ||
| - | 58 | ||
| - | 59 | function SetPidTemperature($alias, $temperature) |
|
| - | 60 | { |
|
| - | 61 | SendGenericCommand("PID_setValue $alias $temperature"); |
|
| - | 62 | } |
|
| - | 63 | ||
| - | 64 | ||
| - | 65 | function SetPidParameters($alias, $KP, $KI, $KD, $Time, $Unit) |
|
| - | 66 | { |
|
| - | 67 | SendGenericCommand("PID_setParameters $alias $KP $KI $KD $Time $Unit"); |
|
| 49 | } |
68 | } |
| 50 | 69 | ||
| 51 | ?> |
70 | ?> |
| 52 | 71 | ||