Subversion Repositories Projects

Rev

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