Rev 1688 | Rev 1690 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1688 | Rev 1689 | ||
---|---|---|---|
Line 262... | Line 262... | ||
262 | break; |
262 | break; |
263 | } |
263 | } |
264 | case 'M': { |
264 | case 'M': { |
265 | WriteMotorMixerResponseFrame f = new WriteMotorMixerResponseFrame(address); |
265 | WriteMotorMixerResponseFrame f = new WriteMotorMixerResponseFrame(address); |
266 | f.setWasAccepted(base64InputStream.readByte() != 0); |
266 | f.setWasAccepted(base64InputStream.readByte() != 0); |
- | 267 | result = f; |
|
- | 268 | break; |
|
267 | } |
269 | } |
268 | case 'N': { |
270 | case 'N': { |
269 | int numMotors = 12; |
271 | int numMotors = 12; |
270 | ReadMotorMixerResponseFrame f = new ReadMotorMixerResponseFrame(); |
272 | ReadMotorMixerResponseFrame f = new ReadMotorMixerResponseFrame(); |
271 | f.setConfigurationVersion(base64InputStream.readByte()); |
273 | f.setConfigurationVersion(base64InputStream.readByte()); |
272 | int length = base64InputStream.readByte(); |
274 | int length = base64InputStream.readByte(); |
273 | f.setDataLength(length); |
275 | f.setDataLength(length); |
274 | int testLength = 0; |
276 | int testLength = 12; // the name is first! |
- | 277 | char[] name = base64InputStream.readChars(12); |
|
- | 278 | f.setName(name); |
|
275 | int[][] matrix = new int[numMotors][]; |
279 | int[][] matrix = new int[numMotors][]; |
276 | for(int i=0; i<numMotors; i++) { |
280 | for(int i=0; i<numMotors; i++) { |
277 | int[] row = new int[4]; |
281 | int[] row = new int[5]; |
- | 282 | matrix[i] = row; |
|
278 | for(int j=0; j<4; j++) { |
283 | for(int j=0; j<5; j++) { |
279 | matrix[i][j] = base64InputStream.readByte(); |
284 | row[j] = base64InputStream.readSignedByte(); |
280 | testLength++; |
285 | testLength++; |
281 | } |
286 | } |
282 | } |
287 | } |
Line 283... | Line 288... | ||
283 | 288 | ||
284 | if (length != testLength) |
289 | if (length != testLength) |
285 | throw new IOException("Length of motor mixer data was not as expected."); |
290 | throw new IOException("Length of motor mixer data was not as expected (" + testLength + " vs. " + length + ")."); |
286 | /* |
291 | /* |
287 | int[] opposite = new int[numMotors]; |
292 | int[] opposite = new int[numMotors]; |
288 | for(int i=0; i<numMotors; i++) { |
293 | for(int i=0; i<numMotors; i++) { |
289 | opposite[i] = base64InputStream.readByte(); |
294 | opposite[i] = base64InputStream.readByte(); |
290 | } |
295 | } |
291 | */ |
- | |
292 | 296 | */ |
|
293 | f.setMatrix(matrix); |
- | |
294 | 297 | f.setMatrix(matrix); |
|
- | 298 | result = f; |
|
295 | result = f; |
299 | break; |
296 | } |
300 | } |
297 | case 'O': { |
301 | case 'O': { |
298 | OSDDataResponseFrame f = new OSDDataResponseFrame(address); |
302 | OSDDataResponseFrame f = new OSDDataResponseFrame(address); |