@Test public void test() throws MessageException { SerialErrorMessage msg = new SerialErrorMessage(); msg.decode(new byte[]{1,(byte)0xAE,(byte) 255,1,2,3}); int count = 0; for (Byte b : msg.getOriginalMessage()) { assertEquals(b.byteValue(), ((byte) ++count)); } }
public byte [] getOriginalMessage() { List<Byte> payload = getStandardPayload(); payload = payload.subList(1, payload.size()); byte [] rtn = new byte[payload.size()]; for (int i = 0 ; i< payload.size() ; i++) { rtn[i] = payload.get(i); } return rtn; }
SerialErrorMessage extends StandardMessage { public byte [] getOriginalMessage() { List<Byte> payload = getStandardPayload(); payload = payload.subList(1, payload.size()); byte [] rtn = new byte[payload.size()]; for (int i = 0 ; i< payload.size() ; i++) { rtn[i] = payload.get(i); } return rtn; } }
SerialErrorMessage extends StandardMessage { public byte [] getOriginalMessage() { List<Byte> payload = getStandardPayload(); payload = payload.subList(1, payload.size()); byte [] rtn = new byte[payload.size()]; for (int i = 0 ; i< payload.size() ; i++) { rtn[i] = payload.get(i); } return rtn; } SerialErrorMessage(); }
SerialErrorMessage extends StandardMessage { public byte [] getOriginalMessage() { List<Byte> payload = getStandardPayload(); payload = payload.subList(1, payload.size()); byte [] rtn = new byte[payload.size()]; for (int i = 0 ; i< payload.size() ; i++) { rtn[i] = payload.get(i); } return rtn; } SerialErrorMessage(); @Override void validate(); byte getErrorNumber(); boolean wasSyncByteMissing(); boolean wasChecksumIncorrect(); boolean wasPayloadBloated(); byte [] getOriginalMessage(); }
SerialErrorMessage extends StandardMessage { public byte [] getOriginalMessage() { List<Byte> payload = getStandardPayload(); payload = payload.subList(1, payload.size()); byte [] rtn = new byte[payload.size()]; for (int i = 0 ; i< payload.size() ; i++) { rtn[i] = payload.get(i); } return rtn; } SerialErrorMessage(); @Override void validate(); byte getErrorNumber(); boolean wasSyncByteMissing(); boolean wasChecksumIncorrect(); boolean wasPayloadBloated(); byte [] getOriginalMessage();  }