Rev 1601 | Rev 1631 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1601 | Rev 1611 | ||
---|---|---|---|
Line 14... | Line 14... | ||
14 | import dongfang.mkt.frames.ConfirmFrame; |
14 | import dongfang.mkt.frames.ConfirmFrame; |
15 | import dongfang.mkt.frames.DebugResponseFrame; |
15 | import dongfang.mkt.frames.DebugResponseFrame; |
16 | import dongfang.mkt.frames.MotorTestResponseFrame; |
16 | import dongfang.mkt.frames.MotorTestResponseFrame; |
17 | import dongfang.mkt.frames.OSDDataResponseFrame; |
17 | import dongfang.mkt.frames.OSDDataResponseFrame; |
18 | import dongfang.mkt.frames.ReadExternalControlResponseFrame; |
18 | import dongfang.mkt.frames.ReadExternalControlResponseFrame; |
- | 19 | import dongfang.mkt.frames.ReadIMUConfigurationResponseFrame; |
|
19 | import dongfang.mkt.frames.ResponseFrame; |
20 | import dongfang.mkt.frames.ResponseFrame; |
20 | import dongfang.mkt.frames.SetCompassHeadingResponseFrame; |
21 | import dongfang.mkt.frames.SetCompassHeadingResponseFrame; |
21 | import dongfang.mkt.frames.UniversalReadParamSetResponseFrame; |
22 | import dongfang.mkt.frames.ReadParamSetResponseFrame; |
- | 23 | import dongfang.mkt.frames.WriteIMUConfigurationResponseFrame; |
|
22 | import dongfang.mkt.frames.UniversalWriteParamSetResponseFrame; |
24 | import dongfang.mkt.frames.WriteParamSetResponseFrame; |
23 | import dongfang.mkt.frames.VariablesResponseFrame; |
25 | import dongfang.mkt.frames.VariablesResponseFrame; |
24 | import dongfang.mkt.frames.VersionResponseFrame; |
26 | import dongfang.mkt.frames.VersionResponseFrame; |
Line 25... | Line 27... | ||
25 | 27 | ||
26 | public class MKInputStream extends InputStream { |
28 | public class MKInputStream extends InputStream { |
Line 223... | Line 225... | ||
223 | //f.setMaxItem(getDataInputStream().readByte()); |
225 | //f.setMaxItem(getDataInputStream().readByte()); |
224 | f.setText(base64InputStream.readChars(20)); |
226 | f.setText(base64InputStream.readChars(20)); |
225 | result = f; |
227 | result = f; |
226 | break; |
228 | break; |
227 | } |
229 | } |
- | 230 | case 'I': { |
|
- | 231 | ReadIMUConfigurationResponseFrame f = new ReadIMUConfigurationResponseFrame(address); |
|
- | 232 | f.setConfigurationVersion(base64InputStream.readByte()); |
|
- | 233 | int length = base64InputStream.readByte(); |
|
- | 234 | f.setConfigurationSetLength(length); |
|
- | 235 | f.setData(base64InputStream.readBytes(length)); |
|
- | 236 | result = f; |
|
- | 237 | break; |
|
- | 238 | } |
|
- | 239 | case 'J': { |
|
- | 240 | WriteIMUConfigurationResponseFrame f = new WriteIMUConfigurationResponseFrame(address); |
|
- | 241 | f.setWasAccepted(base64InputStream.readByte()==1); |
|
- | 242 | result = f; |
|
- | 243 | break; |
|
- | 244 | } |
|
228 | case 'k' : { |
245 | case 'k' : { |
229 | CompassHeadingResponseFrame f = new CompassHeadingResponseFrame(address); |
246 | CompassHeadingResponseFrame f = new CompassHeadingResponseFrame(address); |
230 | base64InputStream.readSignedWords(2); |
247 | base64InputStream.readSignedWords(2); |
231 | base64InputStream.readBytes(2); |
248 | base64InputStream.readBytes(2); |
232 | base64InputStream.readByte(); |
249 | base64InputStream.readByte(); |
Line 312... | Line 329... | ||
312 | f.setCapacityUsed(base64InputStream.readWord()); |
329 | f.setCapacityUsed(base64InputStream.readWord()); |
313 | result = f; |
330 | result = f; |
314 | break; |
331 | break; |
315 | } |
332 | } |
316 | case 'S': { |
333 | case 'S': { |
317 | UniversalWriteParamSetResponseFrame f = new UniversalWriteParamSetResponseFrame(address); |
334 | WriteParamSetResponseFrame f = new WriteParamSetResponseFrame(address); |
318 | f.setParameterSetNumber(base64InputStream.readByte()); |
335 | f.setParameterSetNumber(base64InputStream.readByte()); |
319 | result = f; |
336 | result = f; |
320 | break; |
337 | break; |
321 | } |
338 | } |
322 | case 'T': { |
339 | case 'T': { |
Line 368... | Line 385... | ||
368 | base64InputStream.readBytes(8); |
385 | base64InputStream.readBytes(8); |
369 | result = f; |
386 | result = f; |
370 | break; |
387 | break; |
371 | } |
388 | } |
372 | case 'Q': |
389 | case 'Q': |
373 | UniversalReadParamSetResponseFrame f = new UniversalReadParamSetResponseFrame(address); |
390 | ReadParamSetResponseFrame f = new ReadParamSetResponseFrame(address); |
374 | f.setConfigurationSetNumber(base64InputStream.readByte()); |
391 | f.setConfigurationSetNumber(base64InputStream.readByte()); |
375 | f.setConfigurationVersion(base64InputStream.readByte()); |
392 | f.setConfigurationVersion(base64InputStream.readByte()); |
376 | int length = base64InputStream.readByte(); |
393 | int length = base64InputStream.readByte(); |
377 | f.setConfigurationSetLength(length); |
394 | f.setConfigurationSetLength(length); |
378 | f.setData(base64InputStream.readBytes(length)); |
395 | f.setData(base64InputStream.readBytes(length)); |