Subversion Repositories Projects

Rev

Rev 1573 | Rev 1688 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1573 Rev 1611
Line 13... Line 13...
13
import dongfang.mkt.frames.ExternalControlRequestFrame;
13
import dongfang.mkt.frames.ExternalControlRequestFrame;
14
import dongfang.mkt.frames.LoopbackTestRequestFrame;
14
import dongfang.mkt.frames.LoopbackTestRequestFrame;
15
import dongfang.mkt.frames.MotorTestRequestFrame;
15
import dongfang.mkt.frames.MotorTestRequestFrame;
16
import dongfang.mkt.frames.OSDDataRequestFrame;
16
import dongfang.mkt.frames.OSDDataRequestFrame;
17
import dongfang.mkt.frames.ReadExternalControlRequestFrame;
17
import dongfang.mkt.frames.ReadExternalControlRequestFrame;
-
 
18
import dongfang.mkt.frames.ReadIMUConfigurationRequestFrame;
-
 
19
import dongfang.mkt.frames.ReadParamSetRequestFrame;
18
import dongfang.mkt.frames.RequestFrame;
20
import dongfang.mkt.frames.RequestFrame;
19
import dongfang.mkt.frames.ResetRequestFrame;
21
import dongfang.mkt.frames.ResetRequestFrame;
20
import dongfang.mkt.frames.SetCompassHeadingRequestFrame;
22
import dongfang.mkt.frames.SetCompassHeadingRequestFrame;
21
import dongfang.mkt.frames.SingleDisplayRequestFrame;
23
import dongfang.mkt.frames.SingleDisplayRequestFrame;
22
import dongfang.mkt.frames.UniversalReadParamSetRequestFrame;
-
 
23
import dongfang.mkt.frames.UniversalWriteParamSetRequestFrame;
-
 
24
import dongfang.mkt.frames.VariablesRequestFrame;
24
import dongfang.mkt.frames.VariablesRequestFrame;
25
import dongfang.mkt.frames.VersionRequestFrame;
25
import dongfang.mkt.frames.VersionRequestFrame;
-
 
26
import dongfang.mkt.frames.WriteIMUConfigurationRequestFrame;
-
 
27
import dongfang.mkt.frames.WriteParamSetRequestFrame;
Line 26... Line 28...
26
 
28
 
27
public class MKOutputStream extends OutputStream implements RequestFrameVisitor {
29
public class MKOutputStream extends OutputStream implements RequestFrameVisitor {
28
        public class MKDataOutputStream {
30
        public class MKDataOutputStream {
29
                int[] inbuf = new int[3];
31
                int[] inbuf = new int[3];
Line 189... Line 191...
189
                base64OutputStream.writeByte(f.getByte());
191
                base64OutputStream.writeByte(f.getByte());
190
                base64OutputStream.writeWord(f.getWord());
192
                base64OutputStream.writeWord(f.getWord());
191
                base64OutputStream.writeChars(f.getChararray());
193
                base64OutputStream.writeChars(f.getChararray());
192
        }
194
        }
Line 193... Line 195...
193
       
195
       
194
        public void visit(UniversalReadParamSetRequestFrame f) throws IOException {
196
        public void visit(ReadParamSetRequestFrame f) throws IOException {
195
                writeByte('q');
197
                writeByte('q');
196
                base64OutputStream.writeByte(f.getConfigurationSetNumber());
198
                base64OutputStream.writeByte(f.getConfigurationSetNumber());
Line 197... Line 199...
197
        }
199
        }
198
 
200
 
199
        public void visit(UniversalWriteParamSetRequestFrame f) throws IOException {
201
        public void visit(WriteParamSetRequestFrame f) throws IOException {
200
                writeByte('s');
202
                writeByte('s');
201
                base64OutputStream.writeByte(f.getConfigurationSetNumber());
203
                base64OutputStream.writeByte(f.getConfigurationSetNumber());
202
                base64OutputStream.writeByte(f.getConfigurationVersionNumber());
204
                base64OutputStream.writeByte(f.getConfigurationVersionNumber());
Line 215... Line 217...
215
 
217
 
216
        public void visit(OSDDataRequestFrame f) throws IOException {
218
        public void visit(OSDDataRequestFrame f) throws IOException {
217
                writeByte('o');
219
                writeByte('o');
218
                base64OutputStream.writeByte(f.getAutoSendInterval());
220
                base64OutputStream.writeByte(f.getAutoSendInterval());
-
 
221
        }
-
 
222
 
-
 
223
        public void visit(ReadIMUConfigurationRequestFrame f) throws IOException {
-
 
224
                writeByte('i');
-
 
225
        }
-
 
226
 
-
 
227
        public void visit(WriteIMUConfigurationRequestFrame f) throws IOException {
-
 
228
                writeByte('j');
-
 
229
                base64OutputStream.writeByte(f.getConfigurationVersionNumber());
-
 
230
                base64OutputStream.writeByte(f.getDataLength());
-
 
231
                base64OutputStream.writeBytes(f.getData());
219
        }
232
        }