Subversion Repositories Projects

Rev

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