use of jmri.jmrix.ieee802154.IEEE802154Node in project JMRI by JMRI.
the class NodeConfigFrame method initAddressBoxes.
// Initilize the drop down box for the address lists.
protected void initAddressBoxes() {
IEEE802154Node current = null;
nodeAddrField.removeAllItems();
nodeAddr64Field.removeAllItems();
for (int i = 0; i < itc.getNumNodes(); i++) {
current = (IEEE802154Node) itc.getNode(i);
nodeAddrField.insertItemAt(jmri.util.StringUtil.hexStringFromBytes(current.getUserAddress()), i);
nodeAddr64Field.insertItemAt(jmri.util.StringUtil.hexStringFromBytes(current.getGlobalAddress()), i);
}
nodeAddrField.insertItemAt("", 0);
nodeAddrField.setEditable(true);
nodeAddr64Field.insertItemAt("", 0);
}
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);
}
use of jmri.jmrix.ieee802154.IEEE802154Node in project JMRI by JMRI.
the class SerialTrafficControllerTest method testGetNodeFromUserAddressIntTest.
@Test
@Override
public void testGetNodeFromUserAddressIntTest() {
// test the code to get an IEEE802154 node from its User address
// specified as an integer array.
IEEE802154Node node = ((SerialTrafficController) tc).newNode();
((SerialTrafficController) tc).registerNode(node);
node.setNodeAddress(28055);
byte[] uad = { (byte) 0x6D, (byte) 0x97 };
int[] iad = { 0x6D, 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(iad);
Assert.assertNotNull("node not found", n);
}
use of jmri.jmrix.ieee802154.IEEE802154Node in project JMRI by JMRI.
the class NodeConfigActionTest method testDefaultCtor.
@Test
public void testDefaultCtor() {
Assume.assumeFalse(GraphicsEnvironment.isHeadless());
IEEE802154SystemConnectionMemo memo = new IEEE802154SystemConnectionMemo();
IEEE802154TrafficController tc = new IEEE802154TrafficController() {
@Override
public void setInstance() {
}
@Override
protected jmri.jmrix.AbstractMRReply newReply() {
return null;
}
@Override
public jmri.jmrix.ieee802154.IEEE802154Node newNode() {
return null;
}
};
InstanceManager.setDefault(IEEE802154SystemConnectionMemo.class, memo);
NodeConfigAction action = new NodeConfigAction();
Assert.assertNotNull("exists", action);
}
Aggregations