@Test public void testEx2() { ProtocolMonitor<Object> monitor = this.protocol.createMonitor("abc"); Assert.assertEquals("IdleState", monitor.getStateInfo()); monitor.read((byte) 0x41); Assert.assertEquals("RunningState", monitor.getStateInfo()); monitor.read((byte) 0x42); Assert.assertEquals("RunningState", monitor.getStateInfo()); monitor.read((byte) 0x43); Assert.assertEquals("RunningState", monitor.getStateInfo()); monitor.read((byte) 0x44); Assert.assertEquals("RunningState", monitor.getStateInfo()); monitor.read((byte) 0x8a); Assert.assertEquals("RunningState", monitor.getStateInfo()); monitor.read((byte) 0x8a); Assert.assertEquals("IdleState", monitor.getStateInfo()); monitor.read((byte) 0x8a); Assert.assertEquals("RunningState", monitor.getStateInfo()); monitor.read((byte) 0x8a); Assert.assertEquals("RunningState", monitor.getStateInfo()); monitor.read((byte) 0x46); Assert.assertEquals("RunningState", monitor.getStateInfo()); monitor.read((byte) 0x8a); Assert.assertEquals("RunningState", monitor.getStateInfo()); monitor.read((byte) 0x8a); Assert.assertEquals("RunningState", monitor.getStateInfo()); monitor.read((byte) 0x47); Assert.assertEquals("RunningState", monitor.getStateInfo()); monitor.read((byte) 0x48); Assert.assertEquals("RunningState", monitor.getStateInfo()); monitor.read((byte) 0xa8); Assert.assertEquals("RunningState", monitor.getStateInfo()); monitor.read((byte) 0xa8); Assert.assertEquals("IdleState", monitor.getStateInfo()); }
@Override public ProtocolMonitor<T> createMonitor(String name) { return new MultiProtocolMonitor<T>(name, this); }
MultiProtocol extends AbstractProtocol<T> { @Override public ProtocolMonitor<T> createMonitor(String name) { return new MultiProtocolMonitor<T>(name, this); } }
MultiProtocol extends AbstractProtocol<T> { @Override public ProtocolMonitor<T> createMonitor(String name) { return new MultiProtocolMonitor<T>(name, this); } MultiProtocol(final List<Protocol<MultiProtocolMonitor<T>>> protocols); }
MultiProtocol extends AbstractProtocol<T> { @Override public ProtocolMonitor<T> createMonitor(String name) { return new MultiProtocolMonitor<T>(name, this); } MultiProtocol(final List<Protocol<MultiProtocolMonitor<T>>> protocols); @Override ProtocolMonitor<T> createMonitor(String name); }
MultiProtocol extends AbstractProtocol<T> { @Override public ProtocolMonitor<T> createMonitor(String name) { return new MultiProtocolMonitor<T>(name, this); } MultiProtocol(final List<Protocol<MultiProtocolMonitor<T>>> protocols); @Override ProtocolMonitor<T> createMonitor(String name);  }