private static byte[] prepareData(AddressData decoderAddress, byte acknowledge) { ByteArrayOutputStream out = new ByteArrayOutputStream(); // write decoder address decoderAddress.writeToStream(out); // data out.write(acknowledge); return out.toByteArray(); }
private static byte[] prepareData(AddressData decoderAddress, byte acknowledge) { ByteArrayOutputStream out = new ByteArrayOutputStream(); // write decoder address decoderAddress.writeToStream(out); // no ADDR_XL and ADDR_XH out.write((byte) 0); out.write((byte) 0); // no MID out.write((byte) 0); // data out.write(acknowledge); return out.toByteArray(); }
private static byte[] prepareDynamicStateData( int detectorNumber, AddressData addressData, byte dynNumber, byte dynValue) { ByteArrayOutputStream out = new ByteArrayOutputStream(); out.write(ByteUtils.getLowByte(detectorNumber)); addressData.writeToStream(out); out.write(dynNumber); out.write(dynValue); return out.toByteArray(); }
private static byte[] prepareAddressData(int detectorNumber, List<AddressData> addresses) { ByteArrayOutputStream out = new ByteArrayOutputStream(); out.write(ByteUtils.getLowByte(detectorNumber)); if (addresses.size() > 0) { for (AddressData addressData : addresses) { addressData.writeToStream(out); } } else { out.write((byte) 0); out.write((byte) 0); } return out.toByteArray(); }
private static byte[] prepareData( int opCode, AddressData decoderAddress, SpeedStepsEnum speedSteps, int speed, byte[] functions) { ByteArrayOutputStream out = new ByteArrayOutputStream(); out.write(ByteUtils.getLowByte(opCode)); // write decoder address decoderAddress.writeToStream(out); // data out.write(speedSteps.getType()); out.write((byte) 1); // output active out.write(ByteUtils.getLowByte(speed)); out.write(functions, 0, functions.length); return out.toByteArray(); }
ByteArrayOutputStream out = new ByteArrayOutputStream(); decoderAddress.writeToStream(out);
public void writeToStream(ByteArrayOutputStream out) { getUniqueId().writeToStream(out); getAddress().writeToStream(out); }
public void writeToStream(ByteArrayOutputStream out) { getUniqueId().writeToStream(out); getAddress().writeToStream(out); }
public void writeToStream(ByteArrayOutputStream out) { getUniqueId().writeToStream(out); getAddress().writeToStream(out); }
decoderAddress.writeToStream(out);