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());
}
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());
}
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());
}
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());
}
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());
}
Aggregations