Rev 399 | Rev 442 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 399 | Rev 440 | ||
---|---|---|---|
1 | #ifndef HANDLER_H |
1 | #ifndef HANDLER_H |
2 | #define HANDLER_H |
2 | #define HANDLER_H |
3 | #include <string> |
3 | #include <string> |
4 | #include "Parser.h" |
4 | #include "Parser.h" |
5 | #include "Communication.h" |
5 | #include "Communication.h" |
6 | #include "Kopter.h" |
6 | #include "Kopter.h" |
7 | #include "../Parameter_Positions.h" |
7 | #include "../Parameter_Positions.h" |
8 | #include "../typedefs.h" |
8 | #include "../typedefs.h" |
9 | 9 | ||
10 | /** |
10 | /** |
11 | * The Handler handels commands that are send from/to the Mikrokopter |
11 | * The Handler handels commands that are send from/to the Mikrokopter |
12 | * and parses them using the Parser-class. |
12 | * and parses them using the Parser-class. |
13 | */ |
13 | */ |
14 | 14 | ||
15 | class Handler { |
15 | class Handler { |
16 | private: |
16 | private: |
17 | Communication * com; |
17 | Communication * com; |
18 | - | ||
19 | // current LCD page |
- | |
20 | int lcd_cur; |
- | |
21 | //max count of LCD pages |
- | |
22 | int lcd_max; |
18 | |
23 | //buffer to send data |
19 | KopterData * data; |
24 | //char tx_data[150]; |
20 | sRxData rxData; |
- | 21 | public: |
|
25 | public: |
22 | |
26 | Handler(Communication * com); |
23 | Handler(Communication * com, KopterData * data); |
27 | //FlightCtrl commands |
24 | //FlightCtrl commands |
28 | void get_flightctrl_settings(int index); |
25 | void get_flightctrl_settings(int index); |
29 | void set_flightctrl_settings(char * tx_data); |
26 | void set_flightctrl_settings(char * tx_data); |
30 | void motor_test(sMotor motor); |
27 | void motor_test(sMotor motor); |
- | 28 | void reset_motor(); |
|
31 | void read_mixer(); |
29 | void read_motor_mixer(); |
32 | void write_mixer(char * tx_data, int length); |
30 | void write_motor_mixer(char * tx_data, int length); |
33 | void get_motor_config(); |
31 | int get_motor_config(char * tx_data); |
34 | 32 | ||
35 | //NaviCtrl commands |
33 | //NaviCtrl commands |
36 | void set_navictrl_debug(int speed); |
34 | void set_navictrl_debug(int speed); |
37 | void stop_navictrl_debug(); |
35 | void stop_navictrl_debug(); |
38 | void send_waypoint(Waypoint_t desired_pos); |
36 | void send_waypoint(Waypoint_t desired_pos); |
39 | void add_waypoint(Waypoint_t wp); |
37 | void add_waypoint(Waypoint_t wp); |
40 | void delete_waypoints(); |
38 | void delete_waypoints(); |
41 | 39 | ||
42 | //switch between MK modules/components |
40 | //switch between MK modules/components |
43 | void switch_navictrl(); |
41 | void switch_navictrl(); |
44 | void switch_flightctrl(); |
42 | void switch_flightctrl(); |
45 | void switch_mk3mag(); |
43 | void switch_mk3mag(); |
46 | 44 | ||
47 | //commands for MK3MAG |
45 | //commands for MK3MAG |
48 | 46 | ||
49 | //commands for all modules/components |
47 | //commands for all modules/components |
50 | void set_all_debug(int speed); |
48 | void set_all_debug(int speed); |
51 | void stop_all_debug(); |
49 | void stop_all_debug(); |
52 | void get_analog(); |
50 | void get_analog(); |
53 | void show_lcd(); |
51 | void show_lcd(); |
54 | void lcd_up(); |
52 | void lcd_up(); |
55 | void lcd_down(); |
53 | void lcd_down(); |
56 | void get_version(); |
54 | void get_version(); |
57 | void get_ppm_channels(); |
55 | void get_ppm_channels(); |
58 | 56 | ||
59 | void receive_data(sRxData rx); |
57 | void receive_data(sRxData rx); |
60 | - | ||
61 | }; |
58 | }; |
62 | 59 | ||
63 | #endif |
60 | #endif |