Subversion Repositories Projects

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1537 - 1
package dongfang.mkt.frames;
2
 
3
public abstract class Frame {
4
        public static final byte FC_ADDRESS = 1;
5
        public static final byte NC_ADDRESS = 2;
6
        public static final byte MK3MAG_ADDRESS = 3;
7
 
8
        /* General / several targets */
9
 
10
        public enum REQUEST_IDS {
11
                ANALOG_DEBUG_LABEL('a'),
12
                EXTERNAL_CONTROL('b'),
13
                DISPLAY1('h'),
14
                DISPLAY2('l'),
15
                VERSION('v'),
16
                ANALOG_DEBUG('d'),
17
                RESET('R'),
18
                COMPASSHEADING('K'),
19
                MOTORTEST('t'),
20
                READPARAMETERSET('q'),
21
                WRITEPARAMETERSET('s'),
22
                RCCHANNELS('p'),
23
                DDATAINTERVAL('c'),
24
                READMIXERTABLE('n'),
25
                WRITEMIXERTABLE('m'),
26
                CHANGEPARAMETERSET('f'),
27
                NC_TESTLINK('z'),
28
                NC_ERRORTEXT('e'),
29
                NC_SET_WAYPOINT('w'),
30
                NC_GET_WAYPOINT('x'),
31
                GET_OSDDATA('o'),
32
                REDIRECT_UART('u'),
33
                SET3DDATA_INTERVAL('c'),
34
                MK3MAGHEADING ('w');
35
 
36
                private final char id;
37
                REQUEST_IDS(char id) { this.id = id; }
38
                public char getId() {return id;}
39
        }
40
 
41
        public static enum RESPONSE_IDS {
42
                ANALOG_DEBUG_LABEL('A'),
43
                EXTERNAL_CONTROL('B'),
44
                DISPLAY1('H'),
45
                DISPLAY2('L'),
46
                VERSION('V'),
47
                ANALOG_DEBUG('D'),
48
                /* FC specific */
49
                COMPASSHEADING('w'),
50
                MOTORTEST('T'),
51
                READPARAMETERSET('Q'),
52
                WRITEPARAMETERSET('S'),
53
                RCCHANNELS('P'),
54
                THREEDDATAINTERVAL('C'),
55
                READMIXERTABLE('N'),
56
                WRITEMIXERTABLE('M'),
57
                CHANGEPARAMETERSET('F'),
58
                REQUEST_SETVARIABLE('y'),
59
                /* NC specific */
60
                NC_TESTLINK('Z'),
61
                NC_ERRORTEXT('E'),
62
                REQUEST_NC_SET_TARGETPOSITION('s'),
63
                NC_SET_WAYPOINT('W'),
64
                NC_GET_WAYPOINT('X'),
65
                GET_OSDDATA('O'),
66
                SET3DDATA_INTERVAL('C'),
67
                /* Mk3Mag specific */
68
                MK3MAGHEADING('K');
69
 
70
                private final char id;
71
                RESPONSE_IDS(char id) { this.id = id; }
72
                public char getId() { return id; }
73
        }
74
 
75
        /*
76
        public ResponseFrame getResponseFrameInstance(RESPONSE_IDS id) {
77
                switch (id) {
78
                case ANALOG_DEBUG_LABEL:        return new AnalogDebugLabelResponseFrame();
79
                case EXTERNAL_CONTROL:          return new ExternalControlResponseFrame();
80
                case DISPLAY1:                          return new Display1ResponseFrame();
81
                case DISPLAY2:                          return new Display2ResponseFrame();
82
                case VERSION:                           return new VersionResponseFrame();
83
                }
84
        }
85
        */
86
 
87
        protected final int address;
88
 
89
        protected Frame(int address) {
90
                this.address = address;
91
        }
92
 
93
        public int getAddress() {
94
                return address;
95
        }
96
}