2 * Copyright (c) 2007, IRTrans GmbH
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of IRTrans GmbH nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY IRTrans GmbH ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL IRTrans GmbH BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #define PROTOCOL_VERSION 209
32 #define MAX_IR_DEVICES 256
35 #define COMMAND_SEND 1
36 #define COMMAND_LRNREM 2
37 #define COMMAND_LRNTIM 3
38 #define COMMAND_LRNCOM 4
39 #define COMMAND_CLOSE 5
40 #define COMMAND_STATUS 6
41 #define COMMAND_RESEND 7
42 #define COMMAND_LRNRAW 8
43 #define COMMAND_LRNRPT 9
44 #define COMMAND_LRNTOG 10
45 #define COMMAND_SETSTAT 11
46 #define COMMAND_LRNLONG 12
47 #define COMMAND_LRNRAWRPT 13
48 #define COMMAND_RELOAD 14
49 #define COMMAND_LCD 15
50 #define COMMAND_LEARNSTAT 16
51 #define COMMAND_TEMP 17
52 #define COMMAND_GETREMOTES 18
53 #define COMMAND_GETCOMMANDS 19
54 #define COMMAND_STORETRANS 20
55 #define COMMAND_LOADTRANS 21
56 #define COMMAND_SAVETRANS 22
57 #define COMMAND_FLASHTRANS 23
58 #define COMMAND_FUNCTIONS 24
59 #define COMMAND_TESTCOM 25
60 #define COMMAND_LONGSEND 26
61 #define COMMAND_SHUTDOWN 27
62 #define COMMAND_SENDCCF 28
63 #define COMMAND_LCDINIT 29
64 #define COMMAND_SETSWITCH 30
65 #define COMMAND_STATUSEX 31
66 #define COMMAND_RESET 32
67 #define COMMAND_DEVICEDATA 33
68 #define COMMAND_STARTCLOCK 34
69 #define COMMAND_LCDSTATUS 35
70 #define COMMAND_FUNCTIONEX 36
71 #define COMMAND_MCE_CHARS 37
72 #define COMMAND_SUSPEND 38
73 #define COMMAND_RESUME 39
74 #define COMMAND_DELETECOM 40
75 #define COMMAND_EMPTY 41
76 #define COMMAND_SETSTAT2 42
77 #define COMMAND_STATUSEXN 43
78 #define COMMAND_BRIGHTNESS 44
79 #define COMMAND_DEFINECHAR 45
80 #define COMMAND_STOREIRDB 46
81 #define COMMAND_FLASHIRDB 47
82 #define COMMAND_SAVEIRDB 48
83 #define COMMAND_LOADIRDB 49
84 #define COMMAND_LED 50
85 #define COMMAND_TRANSFILE 51
86 #define COMMAND_IRDBFILE 52
87 #define COMMAND_LISTBUS 53
88 #define COMMAND_SENDCCFSTR 54
89 #define COMMAND_LEARNDIRECT 55
90 #define COMMAND_TESTCOMEX 56
91 #define COMMAND_SENDCCFSTRS 57
92 #define COMMAND_SETSTATEX 58
93 #define COMMAND_DELETEREM 59
94 #define COMMAND_READ_ANALOG 60
95 #define COMMAND_RS232_SEND 61
96 #define COMMAND_SENDCCFLONG 62
98 #define COMMAND_ASCII 65
101 #define COMMAND_SENDSTRING 's' // 115
103 #define STATUS_MESSAGE 1
104 #define STATUS_TIMING 2
105 #define STATUS_DEVICEMODE 3
106 #define STATUS_RECEIVE 4
107 #define STATUS_LEARN 5
108 #define STATUS_REMOTELIST 6
109 #define STATUS_COMMANDLIST 7
110 #define STATUS_TRANSLATE 8
111 #define STATUS_FUNCTION 9
112 #define STATUS_DEVICEMODEEX 10
113 #define STATUS_DEVICEDATA 11
114 #define STATUS_LCDDATA 12
115 #define STATUS_FUNCTIONEX 13
116 #define STATUS_DEVICEMODEEXN 14
117 #define STATUS_IRDB 15
118 #define STATUS_TRANSLATIONFILE 16
119 #define STATUS_IRDBFILE 17
120 #define STATUS_BUSLIST 18
121 #define STATUS_LEARNDIRECT 19
122 #define STATUS_IRDBFLASH 20
123 #define STATUS_ANALOGINPUT 21
125 #define STATUS_ASCII 65
127 #define FILE_MODE_SAVE 0
128 #define FILE_MODE_SAVEAS 1
129 #define FILE_MODE_OVERWRITE 2
147 uint8_t repeat_pause
;
148 uint16_t pause_len
[TIME_LEN
];
149 uint16_t pulse_len
[TIME_LEN
];
150 uint8_t data
[CODE_LEN
];
160 uint8_t trasmit_freq
;
161 } OLD_NETWORKCOMMAND
;
172 int8_t framebuffer
[200];
181 int32_t protocol_version
;
184 uint8_t trasmit_freq
;
192 int32_t protocol_version
;
193 int8_t hotremote
[80];
194 int8_t hotcommand
[20];
195 int8_t hotremote_2
[80];
196 int8_t hotcommand_2
[20];
202 uint8_t wakeup_mac
[6];
208 // xxx1 xxxx Netmask active Flag
209 // xxx6 xxxx LED select
210 // x7f8 xxxx Bus Select
211 // 38xx xxxx Extended LED select
212 // 8xxx xxxx Extended LED enable
213 // 4xxx xxxx Bus Broadcast
215 // xxxxxxxx xxxxxxxx 11111111 11111111 Netmask (wie bisher genutzt)
216 // xxxxxxxx xxxxxxx1 xxxxxxxx xxxxxxxx Netmask aktiv (wie bisher genutzt)
217 // xxxxxxxx xxxxx11x xxxxxxxx xxxxxxxx LED Auswahl (intern / extern)
218 // xxxxx111 11111xxx xxxxxxxx xxxxxxxx Bus Auswahl (mehrere USB / LAN Module; max: 0-255 = 256 Stück)
219 // 1x111xxx xxxxxxxx xxxxxxxx xxxxxxxx Auswahl mehrer externer LEDs - bis zu 8
220 // x1xxxxxx xxxxxxxx xxxxxxxx xxxxxxxx Broadcast über alle USB / LAN Module
240 int32_t protocol_version
;
253 int32_t protocol_version
;
254 uint16_t ccf_data
[256];
262 int32_t protocol_version
;
263 uint16_t ccf_data
[450];
272 int32_t protocol_version
;
282 int32_t protocol_version
;
285 } CCFSTRINGCOMMAND_SHORT
;
294 int32_t protocol_version
;
297 int8_t framebuffer
[200];
306 int32_t protocol_version
;
310 uint8_t accelerator_timeout
;
311 uint8_t accelerator_repeat
;
312 uint16_t wait_timeout
;
320 uint8_t include_names
;
328 uint8_t extended_mode
;
329 uint8_t extended_mode2
;
331 uint16_t switch_mode
;
343 uint8_t extended_mode
;
344 uint8_t extended_mode2
;
346 uint16_t switch_mode
;
347 uint16_t switch_mode2
;
349 uint8_t extended_mode3
;
350 uint8_t extended_mode4
;
388 ANALOG_INPUTS inputs
;
402 uint32_t target_mask;
403 uint32_t source_mask;
413 int16_t count_buffer
;
415 int16_t count_remaining
;
416 REMOTELINE remotes
[40];
424 int16_t count_buffer
;
426 int16_t count_remaining
;
427 int8_t commands
[200][20];
435 int16_t count_buffer
;
437 int16_t count_remaining
;
438 TRANSLATECOMMAND trdata
[30];
447 int32_t protocol_version
;
468 int32_t protocol_version
;
473 uint8_t default_action
[100];
474 uint8_t err_status
[20];
475 uint8_t ok_status
[20];
476 uint8_t inputmode
[4];
480 uint8_t minledsel
[4];
481 uint8_t maxledsel
[4];
484 int8_t minremote
[4][80];
485 int8_t mincommand
[4][50];
486 int8_t maxremote
[4][80];
487 int8_t maxcommand
[4][50];
497 int16_t count_buffer
;
499 int16_t count_remaining
;
500 IRDBCOMMAND dbdata
[12];
508 int16_t count_buffer
;
510 int16_t count_remaining
;
531 MODELINE stat
[8][16];
542 MODELINEN stat
[8][16];
551 uint16_t statuslevel
;
562 uint16_t statuslevel
;
584 uint16_t command_num
;
599 int16_t num_commands
;
600 int8_t received
[CODE_LEN
];
617 NETWORKLEARNSTAT learnstatus
;
618 int8_t restdata
[sizeof (LCDCOMMAND
)];
627 #define TCP_PORT 21000
628 #define IRTRANS_PORT 21000
629 #define LIRC_PORT 8765
630 #define UDP_PORT 21000
632 #define ALTERNATE_WEB 8080
633 #define XAP_PORT 3639
637 #define CLIENT_COUNT MAXIMUM_WAIT_OBJECTS - 3
641 #define CLIENT_COUNT 64