Search in sources :

Example 6 with CanReply

use of jmri.jmrix.can.CanReply in project JMRI by JMRI.

the class MergReplyTest method testOne.

// :S1260N12345678;
public void testOne() {
    MergReply g = new MergReply(":S1260N12345678;");
    CanReply r = g.createReply();
    Assert.assertEquals("extended", false, r.isExtended());
    Assert.assertEquals("rtr", false, r.isRtr());
    Assert.assertEquals("header", unMungeStdHeader(0x1260), 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));
}
Also used : CanReply(jmri.jmrix.can.CanReply)

Example 7 with CanReply

use of jmri.jmrix.can.CanReply in project JMRI by JMRI.

the class MergReplyTest method testThreeBis.

public void testThreeBis() {
    MergReply g = new MergReply(":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));
}
Also used : CanReply(jmri.jmrix.can.CanReply)

Example 8 with CanReply

use of jmri.jmrix.can.CanReply in project JMRI by JMRI.

the class GridConnectReplyTest method testThree.

public void testThree() {
    GridConnectReply g = new GridConnectReply(":X123R12345678;");
    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));
}
Also used : CanReply(jmri.jmrix.can.CanReply)

Example 9 with CanReply

use of jmri.jmrix.can.CanReply in project JMRI by JMRI.

the class GridConnectReplyTest method testFour.

public void testFour() {
    GridConnectReply g = new GridConnectReply(":X1FFFFFFFR63;");
    CanReply r = g.createReply();
    Assert.assertEquals("extended", true, r.isExtended());
    Assert.assertEquals("rtr", true, r.isRtr());
    Assert.assertEquals("header", 0x1FFFFFFF, r.getHeader());
    Assert.assertEquals("num elements", 1, r.getNumDataElements());
    Assert.assertEquals("el 1", 0x63, r.getElement(0));
}
Also used : CanReply(jmri.jmrix.can.CanReply)

Example 10 with CanReply

use of jmri.jmrix.can.CanReply in project JMRI by JMRI.

the class GridConnectReplyTest method testNotNegative.

public void testNotNegative() {
    // remnant of Arduino CAN2USBino startup message
    GridConnectReply g = new GridConnectReply(": 1;");
    CanReply r = g.createReply();
    Assert.assertEquals("extended", false, r.isExtended());
    Assert.assertEquals("rtr", false, r.isRtr());
    Assert.assertEquals("header", 0x0, r.getHeader());
    Assert.assertEquals("num elements", 0, r.getNumDataElements());
}
Also used : CanReply(jmri.jmrix.can.CanReply)

Aggregations

CanReply (jmri.jmrix.can.CanReply)28 CanMessage (jmri.jmrix.can.CanMessage)3 CanListener (jmri.jmrix.can.CanListener)2 TrafficControllerScaffold (jmri.jmrix.can.TrafficControllerScaffold)2 AbstractMRReply (jmri.jmrix.AbstractMRReply)1 CanSystemConnectionMemo (jmri.jmrix.can.CanSystemConnectionMemo)1 Test (org.junit.Test)1 LoaderClient (org.openlcb.LoaderClient)1 OlcbInterface (org.openlcb.OlcbInterface)1 AliasMap (org.openlcb.can.AliasMap)1 CanInterface (org.openlcb.can.CanInterface)1 MessageBuilder (org.openlcb.can.MessageBuilder)1