Search in sources :

Example 31 with CanMessage

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

the class GridConnectMessageTest method testThree.

public void testThree() {
    CanMessage m = new CanMessage(0x123);
    m.setExtended(true);
    m.setRtr(true);
    m.setNumDataElements(4);
    m.setElement(0, 0x12);
    m.setElement(1, 0x34);
    m.setElement(2, 0x56);
    m.setElement(3, 0x78);
    GridConnectMessage g = new GridConnectMessage(m);
    Assert.assertEquals("standard format 2 byte", ":X00000123R12345678;", g.toString());
}
Also used : CanMessage(jmri.jmrix.can.CanMessage)

Example 32 with CanMessage

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

the class GridConnectDoubledMessageTest method testTwo.

@Test
public // !XF00DN;
void testTwo() {
    CanMessage m = new CanMessage(0xF00D);
    m.setExtended(true);
    m.setRtr(false);
    m.setNumDataElements(0);
    GridConnectDoubledMessage g = new GridConnectDoubledMessage(m);
    Assert.assertEquals("standard format 2 byte", "!X0000F00DN;", g.toString());
}
Also used : CanMessage(jmri.jmrix.can.CanMessage) Test(org.junit.Test)

Example 33 with CanMessage

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

the class GridConnectDoubledMessageTest method testThree.

@Test
public void testThree() {
    CanMessage m = new CanMessage(0x123);
    m.setExtended(true);
    m.setRtr(true);
    m.setNumDataElements(4);
    m.setElement(0, 0x12);
    m.setElement(1, 0x34);
    m.setElement(2, 0x56);
    m.setElement(3, 0x78);
    GridConnectDoubledMessage g = new GridConnectDoubledMessage(m);
    Assert.assertEquals("standard format 2 byte", "!X00000123R12345678;", g.toString());
}
Also used : CanMessage(jmri.jmrix.can.CanMessage) Test(org.junit.Test)

Example 34 with CanMessage

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

the class MergMessageTest method testOne.

// :S123N12345678;
public void testOne() {
    CanMessage m = new CanMessage(0x123);
    m.setExtended(false);
    m.setRtr(false);
    m.setNumDataElements(4);
    m.setElement(0, 0x12);
    m.setElement(1, 0x34);
    m.setElement(2, 0x56);
    m.setElement(3, 0x78);
    MergMessage g = new MergMessage(m);
    Assert.assertEquals("standard format 2 byte", ":S2460N12345678;", g.toString());
}
Also used : CanMessage(jmri.jmrix.can.CanMessage)

Example 35 with CanMessage

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

the class MergMessageTest method testTwo.

// :XF00DN;
public void testTwo() {
    CanMessage m = new CanMessage(0xF00D);
    m.setExtended(true);
    m.setRtr(false);
    m.setNumDataElements(0);
    MergMessage g = new MergMessage(m);
    Assert.assertEquals("extended format 4 byte", ":X0008F00DN;", g.toString());
}
Also used : CanMessage(jmri.jmrix.can.CanMessage)

Aggregations

CanMessage (jmri.jmrix.can.CanMessage)63 Test (org.junit.Test)4 CanReply (jmri.jmrix.can.CanReply)3 CanListener (jmri.jmrix.can.CanListener)2 CbusAddress (jmri.jmrix.can.cbus.CbusAddress)2 DccLocoAddress (jmri.DccLocoAddress)1 AbstractMRMessage (jmri.jmrix.AbstractMRMessage)1 CanSystemConnectionMemo (jmri.jmrix.can.CanSystemConnectionMemo)1 TestTrafficController (jmri.jmrix.can.TestTrafficController)1 TrafficControllerScaffold (jmri.jmrix.can.TrafficControllerScaffold)1 GridConnectMessage (jmri.jmrix.can.adapters.gridconnect.GridConnectMessage)1 GridConnectReply (jmri.jmrix.can.adapters.gridconnect.GridConnectReply)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 Hub (org.openlcb.hub.Hub)1