Subversion Repositories Projects

Rev

Rev 440 | Rev 449 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 440 Rev 442
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
        KopterData * data;
18
 
20
        sRxData rxData;
19
        sRxData rxData;
21
    public:
-
 
-
 
20
    public:
22
 
21
        KopterData * data;
23
        Handler(Communication * com, KopterData * data);
22
        Handler(Communication * com, KopterData * data);
24
        //FlightCtrl commands
23
        //FlightCtrl commands
25
        void get_flightctrl_settings(int index);
24
        void get_flightctrl_settings(int index);
26
        void set_flightctrl_settings(char * tx_data);
25
        void set_flightctrl_settings(char * tx_data);
27
        void motor_test(sMotor motor);
26
        void motor_test(sMotorData motor);
28
        void reset_motor();
27
        void reset_motor();
29
        void read_motor_mixer();
28
        void read_motor_mixer();
30
        void write_motor_mixer(char * tx_data, int length);
29
        void write_motor_mixer(char * tx_data, int length);
31
        int get_motor_config(char * tx_data);
30
        int get_motor_config(char * tx_data);
32
 
31
 
33
        //NaviCtrl commands
32
        //NaviCtrl commands
34
        void set_navictrl_debug(int speed);
33
        void set_navictrl_debug(int speed);
35
        void stop_navictrl_debug();
34
        void stop_navictrl_debug();
36
        void send_waypoint(Waypoint_t desired_pos);
35
        void send_waypoint(Waypoint_t desired_pos);
37
        void add_waypoint(Waypoint_t wp);
36
        void add_waypoint(Waypoint_t wp);
38
        void delete_waypoints();
37
        void delete_waypoints();
39
 
38
 
40
        //switch between MK modules/components
39
        //switch between MK modules/components
41
        void switch_navictrl();
40
        void switch_navictrl();
42
        void switch_flightctrl();
41
        void switch_flightctrl();
43
        void switch_mk3mag();
42
        void switch_mk3mag();
44
 
43
 
45
        //commands for MK3MAG
44
        //commands for MK3MAG
46
 
45
 
47
        //commands for all modules/components
46
        //commands for all modules/components
48
        void set_all_debug(int speed);
47
        void set_all_debug(int speed);
49
        void stop_all_debug();
48
        void stop_all_debug();
50
        void get_analog();
49
        void get_analog();
51
        void show_lcd();
50
        void show_lcd();
52
        void lcd_up();
51
        void lcd_up();
53
        void lcd_down();
52
        void lcd_down();
54
        void get_version();
53
        void get_version();
55
        void get_ppm_channels();
54
        void get_ppm_channels();
56
 
55
 
57
        void receive_data(sRxData rx);
56
        void receive_data(sRxData rx);
58
};
57
};
59
 
58
 
60
#endif
59
#endif