use of jmri.jmrix.ieee802154.IEEE802154Node in project JMRI by JMRI.
the class SerialTrafficControllerTest method testGetNodeFromUserAddressByteTest.
@Test
@Override
public void testGetNodeFromUserAddressByteTest() {
// test the code to get an IEEE802154 node from its User address
// specified as a byte array.
IEEE802154Node node = ((SerialTrafficController) tc).newNode();
((SerialTrafficController) tc).registerNode(node);
node.setNodeAddress(28055);
byte[] uad = { (byte) 0x6D, (byte) 0x97 };
node.setUserAddress(uad);
byte[] gad = { (byte) 0x00, (byte) 0x13, (byte) 0xA2, (byte) 0x00, (byte) 0x40, (byte) 0xA0, (byte) 0x4D, (byte) 0x2D };
node.setGlobalAddress(gad);
IEEE802154Node n = (IEEE802154Node) ((SerialTrafficController) tc).getNodeFromAddress(uad);
Assert.assertNotNull("node not found", n);
}
use of jmri.jmrix.ieee802154.IEEE802154Node in project JMRI by JMRI.
the class SerialTrafficControllerTest method testGetNodeFromUserAddressTest.
@Test
@Override
public void testGetNodeFromUserAddressTest() {
// test the code to get an IEEE802154 node from its User address
// specified as a string.
IEEE802154Node node = ((SerialTrafficController) tc).newNode();
((SerialTrafficController) tc).registerNode(node);
node.setNodeAddress(28055);
byte[] uad = { (byte) 0x6D, (byte) 0x97 };
node.setUserAddress(uad);
node.setPANAddress(uad);
byte[] gad = { (byte) 0x00, (byte) 0x13, (byte) 0xA2, (byte) 0x00, (byte) 0x40, (byte) 0xA0, (byte) 0x4D, (byte) 0x2D };
node.setGlobalAddress(gad);
((SerialTrafficController) tc).registerNode(node);
IEEE802154Node n = (IEEE802154Node) ((SerialTrafficController) tc).getNodeFromAddress("6D 97");
Assert.assertNotNull("node not found", n);
}
use of jmri.jmrix.ieee802154.IEEE802154Node in project JMRI by JMRI.
the class SerialTrafficControllerTest method testGetNodeFromAddressGlobalTest.
@Test
public void testGetNodeFromAddressGlobalTest() {
// test the code to get an IEEE802154 node from its Global address
// specified as a string.
IEEE802154Node node = ((SerialTrafficController) tc).newNode();
node.setNodeAddress(28055);
byte[] uad = { (byte) 0x6D, (byte) 0x97 };
node.setUserAddress(uad);
node.setPANAddress(uad);
byte[] gad = { (byte) 0x00, (byte) 0x13, (byte) 0xA2, (byte) 0x00, (byte) 0x40, (byte) 0xA0, (byte) 0x4D, (byte) 0x2D };
node.setGlobalAddress(gad);
((SerialTrafficController) tc).registerNode(node);
IEEE802154Node n = (IEEE802154Node) ((SerialTrafficController) tc).getNodeFromAddress("00 13 A2 00 40 A0 4D 2D");
Assert.assertNotNull("node not found", n);
}
use of jmri.jmrix.ieee802154.IEEE802154Node in project JMRI by JMRI.
the class XBeeComponentFactoryTest method setUp.
@Before
public void setUp() {
Log4JFixture.setUp();
JUnitUtil.resetInstanceManager();
tc = new XBeeTrafficController() {
@Override
public void setInstance() {
}
@Override
protected jmri.jmrix.AbstractMRReply newReply() {
return null;
}
@Override
public jmri.jmrix.ieee802154.IEEE802154Node newNode() {
return null;
}
};
m = new XBeeConnectionMemo();
m.setSystemPrefix("ABC");
tc.setAdapterMemo(m);
}
use of jmri.jmrix.ieee802154.IEEE802154Node in project JMRI by JMRI.
the class XBeeMenuTest method setUp.
@Before
public void setUp() {
Log4JFixture.setUp();
JUnitUtil.resetInstanceManager();
tc = new XBeeTrafficController() {
@Override
public void setInstance() {
}
@Override
protected jmri.jmrix.AbstractMRReply newReply() {
return null;
}
@Override
public jmri.jmrix.ieee802154.IEEE802154Node newNode() {
return null;
}
};
m = new XBeeConnectionMemo();
m.setSystemPrefix("ABC");
tc.setAdapterMemo(m);
}
Aggregations