Rev 1611 | Rev 1689 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1611 | Rev 1688 | ||
---|---|---|---|
Line 14... | Line 14... | ||
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; |
18 | import dongfang.mkt.frames.ReadIMUConfigurationRequestFrame; |
- | 19 | import dongfang.mkt.frames.ReadMotorMixerRequestFrame; |
|
19 | import dongfang.mkt.frames.ReadParamSetRequestFrame; |
20 | import dongfang.mkt.frames.ReadParamSetRequestFrame; |
- | 21 | import dongfang.mkt.frames.ReadVariablesRequestFrame; |
|
20 | import dongfang.mkt.frames.RequestFrame; |
22 | import dongfang.mkt.frames.RequestFrame; |
21 | import dongfang.mkt.frames.ResetRequestFrame; |
23 | import dongfang.mkt.frames.ResetRequestFrame; |
22 | import dongfang.mkt.frames.SetCompassHeadingRequestFrame; |
24 | import dongfang.mkt.frames.SetCompassHeadingRequestFrame; |
23 | import dongfang.mkt.frames.SingleDisplayRequestFrame; |
25 | import dongfang.mkt.frames.SingleDisplayRequestFrame; |
24 | import dongfang.mkt.frames.VariablesRequestFrame; |
- | |
25 | import dongfang.mkt.frames.VersionRequestFrame; |
26 | import dongfang.mkt.frames.VersionRequestFrame; |
26 | import dongfang.mkt.frames.WriteIMUConfigurationRequestFrame; |
27 | import dongfang.mkt.frames.WriteIMUConfigurationRequestFrame; |
- | 28 | import dongfang.mkt.frames.WriteMotorMixerRequestFrame; |
|
27 | import dongfang.mkt.frames.WriteParamSetRequestFrame; |
29 | import dongfang.mkt.frames.WriteParamSetRequestFrame; |
Line 28... | Line 30... | ||
28 | 30 | ||
29 | public class MKOutputStream extends OutputStream implements RequestFrameVisitor { |
31 | public class MKOutputStream extends OutputStream implements RequestFrameVisitor { |
30 | public class MKDataOutputStream { |
32 | public class MKDataOutputStream { |
Line 160... | Line 162... | ||
160 | public void visit(AllDisplaysRequestFrame f) throws IOException { |
162 | public void visit(AllDisplaysRequestFrame f) throws IOException { |
161 | writeByte('h'); |
163 | writeByte('h'); |
162 | base64OutputStream.writeByte(f.getPageOrder().getRemoteKeys()); |
164 | base64OutputStream.writeByte(f.getPageOrder().getRemoteKeys()); |
163 | // mdo.writeByte(f.getAutoSendInterval()); |
165 | // mdo.writeByte(f.getAutoSendInterval()); |
164 | } |
166 | } |
- | 167 | ||
- | 168 | public void visit(ReadMotorMixerRequestFrame f) throws IOException { |
|
- | 169 | writeByte('n'); |
|
- | 170 | } |
|
- | 171 | ||
- | 172 | public void visit(WriteMotorMixerRequestFrame f) throws IOException { |
|
- | 173 | writeByte('m'); |
|
- | 174 | writeByte(f.getConfigurationVersion()); |
|
- | 175 | writeByte(f.getDataLength()); |
|
- | 176 | for(int i=0; i<f.getMatrix().length; i++) { |
|
- | 177 | int[] row = f.getMatrix()[i]; |
|
- | 178 | for(int j=0; j<row.length; j++) { |
|
- | 179 | base64OutputStream.writeByte(row[j]); |
|
- | 180 | } |
|
- | 181 | } |
|
- | 182 | /* |
|
- | 183 | for(int i=0; i<f.getOppositeMotors().length; i++) { |
|
- | 184 | base64OutputStream.writeByte(f.getOppositeMotors()[i]); |
|
- | 185 | } |
|
- | 186 | */ |
|
- | 187 | } |
|
Line 165... | Line 188... | ||
165 | 188 | ||
166 | public void visit(VariablesRequestFrame f) throws IOException { |
189 | public void visit(ReadVariablesRequestFrame f) throws IOException { |
167 | writeByte('x'); |
190 | writeByte('x'); |
Line 168... | Line 191... | ||
168 | } |
191 | } |
169 | 192 |