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