Rev 483 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 483 | Rev 505 | ||
---|---|---|---|
1 | 1 | ||
2 | 2 | ||
3 | #include <stdio.h> |
3 | #include <stdio.h> |
4 | #include <termios.h> |
4 | #include <termios.h> |
5 | #include <sys/socket.h> |
5 | #include <sys/socket.h> |
6 | #include <sys/types.h> |
6 | #include <sys/types.h> |
7 | #include <netinet/in.h> |
7 | #include <netinet/in.h> |
8 | #include <unistd.h> |
8 | #include <unistd.h> |
9 | #include <inttypes.h> |
9 | #include <inttypes.h> |
10 | #include "bluetooth_handler.h" |
10 | #include "bluetooth_handler.h" |
11 | #include "statistics.h" |
11 | #include "statistics.h" |
12 | 12 | ||
13 | struct ExternControl_s |
13 | struct ExternControl_s |
14 | { |
14 | { |
15 | unsigned char Digital[2]; // (noch unbenutzt) |
15 | unsigned char Digital[2]; // (noch unbenutzt) |
16 | unsigned char RemoteTasten; //(gab es schon für das virtuelle Display) |
16 | unsigned char RemoteTasten; //(gab es schon für das virtuelle Display) |
17 | signed char Nick; |
17 | signed char Nick; |
18 | signed char Roll; |
18 | signed char Roll; |
19 | signed char Gier; |
19 | signed char Gier; |
20 | unsigned char Gas; //(es wird das Stick-Gas auf diesen Wert begrenzt; --> StickGas ist das Maximum) |
20 | unsigned char Gas; //(es wird das Stick-Gas auf diesen Wert begrenzt; --> StickGas ist das Maximum) |
21 | signed char Higt; //(Hoehenregler) |
21 | signed char Higt; //(Hoehenregler) |
22 | unsigned char free; // (unbenutzt) |
22 | unsigned char free; // (unbenutzt) |
23 | unsigned char Frame; // (Bestätigung) |
23 | unsigned char Frame; // (Bestätigung) |
24 | unsigned char Config; |
24 | unsigned char Config; |
25 | }; |
25 | }; |
- | 26 | ||
- | 27 | struct ExternEvent_s |
|
- | 28 | { |
|
- | 29 | unsigned char key; |
|
- | 30 | unsigned char value[4]; |
|
- | 31 | ||
- | 32 | }; |
|
26 | 33 | ||
27 | struct str_DebugOut |
34 | struct str_DebugOut |
28 | { |
35 | { |
29 | unsigned char Digital[2]; |
36 | unsigned char Digital[2]; |
30 | //# signed int |
37 | //# signed int |
31 | 38 | ||
32 | uint16_t Analog[32]; // Debugwert// |
39 | uint16_t Analog[32]; // Debugwert// |
33 | }; |
40 | }; |
34 | 41 | ||
35 | struct str_DebugOut DebugOut; |
42 | struct str_DebugOut DebugOut; |
36 | 43 | ||
37 | 44 | ||
38 | struct ExternControl_s ExternControl; |
45 | struct ExternControl_s ExternControl; |
- | 46 | struct ExternEvent_s ExternEvent; |
|
39 | 47 | ||
40 | extern int mk_socket; |
48 | extern int mk_socket; |
41 | 49 | ||
42 | //int connect_mk_bluetooth(char dest[18]); |
50 | //int connect_mk_bluetooth(char dest[18]); |
43 | int connect_mk_localhost_socket(int port); |
51 | int connect_mk_localhost_socket(int port); |
44 | int connect_mk_bluetooth(char dest[18]); |
52 | int connect_mk_bluetooth(char dest[18]); |
45 | int connect_mk_tty(char* tty_filename); |
53 | int connect_mk_tty(char* tty_filename); |
46 | 54 | ||
47 | void SendOutData(unsigned char cmd,unsigned char modul, unsigned char *snd, unsigned char len); |
55 | void SendOutData(unsigned char cmd,unsigned char modul, unsigned char *snd, unsigned char len); |
48 | int read_from_mk(); |
56 | int read_from_mk(); |
49 | 57 | ||
50 | 58 | ||
51 | #define MAX_BUFF_LEN 150 |
59 | #define MAX_BUFF_LEN 150 |
52 | 60 | ||
53 | extern unsigned char RxBuffer[MAX_BUFF_LEN ]; |
61 | extern unsigned char RxBuffer[MAX_BUFF_LEN ]; |
54 | extern char PrintableRxBuffer[MAX_BUFF_LEN ]; |
62 | extern char PrintableRxBuffer[MAX_BUFF_LEN ]; |
55 | extern int rx_last_length; |
63 | extern int rx_last_length; |
56 | 64 |