@Test public void testGetReadPumpCommand() throws Exception { byte[] output = new byte[] { 0x01, 0x00, (byte) 0xA7, 0x01, 0x66, 0x54, 0x55, (byte) 0x80, 0x00, 0x00, 0x02, 0x01, 0x00, (byte) 0x8D, 0x5B, 0x00 }; byte[] serial = new byte[] { 0x66,0x54,0x55 }; byte[] generated = Commands.getReadPumpCommand(serial); assertArrayEquals(generated, output); }
public static byte[] getReadPumpCommand(final byte[] serial) { byte[] data = new byte[]{ 0x01, 0x00, (byte) 0xA7, 0x01, 0x00, 0x00, 0x00, (byte) 0x80, 0x00, 0x00, 0x02, 0x01, 0x00, (byte) 0x8D, 0x00, 0x00 }; data[4] = serial[0]; data[5] = serial[1]; data[6] = serial[2]; data[14] = CRC.computeCRC(data, 14); return data; }
Commands { public static byte[] getReadPumpCommand(final byte[] serial) { byte[] data = new byte[]{ 0x01, 0x00, (byte) 0xA7, 0x01, 0x00, 0x00, 0x00, (byte) 0x80, 0x00, 0x00, 0x02, 0x01, 0x00, (byte) 0x8D, 0x00, 0x00 }; data[4] = serial[0]; data[5] = serial[1]; data[6] = serial[2]; data[14] = CRC.computeCRC(data, 14); return data; } }
Commands { public static byte[] getReadPumpCommand(final byte[] serial) { byte[] data = new byte[]{ 0x01, 0x00, (byte) 0xA7, 0x01, 0x00, 0x00, 0x00, (byte) 0x80, 0x00, 0x00, 0x02, 0x01, 0x00, (byte) 0x8D, 0x00, 0x00 }; data[4] = serial[0]; data[5] = serial[1]; data[6] = serial[2]; data[14] = CRC.computeCRC(data, 14); return data; }  }
Commands { public static byte[] getReadPumpCommand(final byte[] serial) { byte[] data = new byte[]{ 0x01, 0x00, (byte) 0xA7, 0x01, 0x00, 0x00, 0x00, (byte) 0x80, 0x00, 0x00, 0x02, 0x01, 0x00, (byte) 0x8D, 0x00, 0x00 }; data[4] = serial[0]; data[5] = serial[1]; data[6] = serial[2]; data[14] = CRC.computeCRC(data, 14); return data; }  static byte[] getReadPumpCommand(final byte[] serial); static byte[] setSuspendCommand(final byte[] serial); }
Commands { public static byte[] getReadPumpCommand(final byte[] serial) { byte[] data = new byte[]{ 0x01, 0x00, (byte) 0xA7, 0x01, 0x00, 0x00, 0x00, (byte) 0x80, 0x00, 0x00, 0x02, 0x01, 0x00, (byte) 0x8D, 0x00, 0x00 }; data[4] = serial[0]; data[5] = serial[1]; data[6] = serial[2]; data[14] = CRC.computeCRC(data, 14); return data; }  static byte[] getReadPumpCommand(final byte[] serial); static byte[] setSuspendCommand(final byte[] serial);  }