use of jmri.jmrix.can.CanReply in project JMRI by JMRI.
the class GridConnectReplyTest method testTwo.
// :XF00DN;
public void testTwo() {
GridConnectReply g = new GridConnectReply(":XF00DN;");
CanReply r = g.createReply();
Assert.assertEquals("extended", true, r.isExtended());
Assert.assertEquals("rtr", false, r.isRtr());
Assert.assertEquals("header", 0xF00D, r.getHeader());
Assert.assertEquals("num elements", 0, r.getNumDataElements());
}
use of jmri.jmrix.can.CanReply in project JMRI by JMRI.
the class GridConnectReplyTest method testOne.
// :S123N12345678;
public void testOne() {
GridConnectReply g = new GridConnectReply(":S123N12345678;");
CanReply r = g.createReply();
Assert.assertEquals("extended", false, r.isExtended());
Assert.assertEquals("rtr", false, r.isRtr());
Assert.assertEquals("header", 0x123, r.getHeader());
Assert.assertEquals("num elements", 4, r.getNumDataElements());
Assert.assertEquals("el 0", 0x12, r.getElement(0));
Assert.assertEquals("el 1", 0x34, r.getElement(1));
Assert.assertEquals("el 2", 0x56, r.getElement(2));
Assert.assertEquals("el 3", 0x78, r.getElement(3));
}
use of jmri.jmrix.can.CanReply in project JMRI by JMRI.
the class GridConnectReplyTest method testThreeBis.
public void testThreeBis() {
GridConnectReply g = new GridConnectReply(":X000123R12345678;");
CanReply r = g.createReply();
Assert.assertEquals("extended", true, r.isExtended());
Assert.assertEquals("rtr", true, r.isRtr());
Assert.assertEquals("header", 0x123, r.getHeader());
Assert.assertEquals("num elements", 4, r.getNumDataElements());
Assert.assertEquals("el 0", 0x12, r.getElement(0));
Assert.assertEquals("el 1", 0x34, r.getElement(1));
Assert.assertEquals("el 2", 0x56, r.getElement(2));
Assert.assertEquals("el 3", 0x78, r.getElement(3));
}
use of jmri.jmrix.can.CanReply in project JMRI by JMRI.
the class MergReplyTest method testThreeAlt.
public void testThreeAlt() {
MergReply g = new MergReply(":X0000123R12345678;");
CanReply r = g.createReply();
Assert.assertEquals("extended", true, r.isExtended());
Assert.assertEquals("rtr", true, r.isRtr());
Assert.assertEquals("header", 0x123, r.getHeader());
Assert.assertEquals("num elements", 4, r.getNumDataElements());
Assert.assertEquals("el 0", 0x12, r.getElement(0));
Assert.assertEquals("el 1", 0x34, r.getElement(1));
Assert.assertEquals("el 2", 0x56, r.getElement(2));
Assert.assertEquals("el 3", 0x78, r.getElement(3));
}
use of jmri.jmrix.can.CanReply in project JMRI by JMRI.
the class CbusAddressTest method testCbusIdNotParse.
public void testCbusIdNotParse() {
assertTrue(!new CbusAddress("-12").match(new CanReply(new int[] { CbusConstants.CBUS_ACON, 0x00, 0x00, 0x00, 12 })));
assertTrue(!new CbusAddress("-268").match(new CanReply(new int[] { CbusConstants.CBUS_ACOF, 0x00, 0x00, 0x00, 12 })));
}
Aggregations