本文整理了Java中com.digi.xbee.api.XBeeNetwork
类的一些代码示例,展示了XBeeNetwork
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XBeeNetwork
类的具体详情如下:
包路径:com.digi.xbee.api.XBeeNetwork
类名称:XBeeNetwork
[英]This class represents an XBee Network.
The network allows the discovery of remote devices in the same network as the local one and stores them.
[中]这个类代表一个XBee网络。
该网络允许在与本地设备相同的网络中发现远程设备并将其存储。
代码示例来源:origin: digidotcom/XBeeJavaLibrary
RemoteXBeeDevice remoteDevice = xbeeNetwork.discoverDevice(REMOTE_NODE_IDENTIFIER);
if (remoteDevice == null) {
System.out.println("Couldn't find the remote XBee device with '" + REMOTE_NODE_IDENTIFIER + "' Node Identifier.");
代码示例来源:origin: digidotcom/XBeeJavaLibrary
/**
* Returns the network associated with this XBee device.
*
* @return The XBee network of the device.
*
* @throws InterfaceNotOpenException if this device connection is not open.
*
* @see XBeeNetwork
*/
public XBeeNetwork getNetwork() {
if (!isOpen())
throw new InterfaceNotOpenException();
if (network == null)
network = new XBeeNetwork(this);
return network;
}
代码示例来源:origin: digidotcom/XBeeJavaLibrary
myXBeeNetwork.setDiscoveryTimeout(15000);
myXBeeNetwork.addDiscoveryListener(new MyDiscoveryListener());
myXBeeNetwork.startDiscoveryProcess();
代码示例来源:origin: digidotcom/XBeeJavaLibrary
addr16 = receivePacket.get16bitSourceAddress();
if (!addr64.equals(XBee64BitAddress.UNKNOWN_ADDRESS))
remoteDevice = network.getDevice(addr64);
else if (!addr16.equals(XBee16BitAddress.UNKNOWN_ADDRESS))
remoteDevice = network.getDevice(addr16);
break;
case RX_64:
RX64Packet rx64Packet = (RX64Packet)apiPacket;
addr64 = rx64Packet.get64bitSourceAddress();
remoteDevice = network.getDevice(addr64);
break;
case RX_16:
addr64 = XBee64BitAddress.UNKNOWN_ADDRESS;
addr16 = rx16Packet.get16bitSourceAddress();
remoteDevice = network.getDevice(addr16);
break;
case RX_IPV6:
addr64 = ioSamplePacket.get64bitSourceAddress();
addr16 = ioSamplePacket.get16bitSourceAddress();
remoteDevice = network.getDevice(addr64);
break;
case IPV6_IO_DATA_SAMPLE_RX_INDICATOR:
RX64IOPacket rx64IOPacket = (RX64IOPacket)apiPacket;
addr64 = rx64IOPacket.get64bitSourceAddress();
remoteDevice = network.getDevice(addr64);
break;
代码示例来源:origin: digidotcom/XBeeJavaLibrary
continue;
RemoteXBeeDevice d = addRemoteDevice(toAdd);
if (d != null)
addedList.add(d);
代码示例来源:origin: digidotcom/XBeeJavaLibrary
XBee16BitAddress addr16 = get16BitAddress(remoteDevice);
if (addr16 != null && !addr16.equals(XBee16BitAddress.UNKNOWN_ADDRESS)) {
XBee16BitAddress a = get16BitAddress(d);
if (a != null && a.equals(addr16)) {
remotesBy64BitAddr.remove(d.get64BitAddress());
代码示例来源:origin: digidotcom/XBeeJavaLibrary
RemoteXBeeDevice remoteDevice = getNetwork().getDevice(explicitDataPacket.get64BitSourceAddress());
if (remoteDevice == null) {
if (remoteXBeeDevice != null)
else
remoteDevice = new RemoteXBeeDevice(this, explicitDataPacket.get64BitSourceAddress());
getNetwork().addRemoteDevice(remoteDevice);
代码示例来源:origin: digidotcom/XBeeJavaLibrary
/**
* Notifies the given discovery listeners that a device was discovered.
*
* @param listeners The discovery listeners to be notified.
* @param device The remote device discovered.
*/
private void notifyDeviceDiscovered(List<IDiscoveryListener> listeners, RemoteXBeeDevice device) {
if (listeners == null) {
synchronized (deviceList) {
deviceList.add(device);
}
return;
}
XBeeNetwork network = xbeeDevice.getNetwork();
RemoteXBeeDevice addedDev = network.addRemoteDevice(device);
if (addedDev != null) {
for (IDiscoveryListener listener : listeners)
listener.deviceDiscovered(addedDev);
} else {
String error = "Error adding device '" + device + "' to the network.";
notifyDiscoveryError(listeners, error);
}
}
代码示例来源:origin: digidotcom/XBeeJavaLibrary
XBee16BitAddress a = get16BitAddress(d);
if (a != null && a.equals(address)) {
devInNetwork = d;
代码示例来源:origin: digidotcom/XBeeJavaLibrary
RemoteXBeeDevice remoteDevice = xbeeNetwork.discoverDevice(REMOTE_NODE_IDENTIFIER);
if (remoteDevice == null) {
System.out.println("Couldn't find the remote XBee device with '" + REMOTE_NODE_IDENTIFIER + "' Node Identifier.");
代码示例来源:origin: digidotcom/XBeeJavaLibrary
for (String id : ids) {
if (nID.equals(id)) {
RemoteXBeeDevice rDevice = network.addRemoteDevice(d);
if (rDevice != null && !foundDevices.contains(rDevice))
foundDevices.add(rDevice);
代码示例来源:origin: digidotcom/XBeeJavaLibrary
XBee16BitAddress addr16 = get16BitAddress(remoteDevice);
XBee16BitAddress a = get16BitAddress(d);
if (a != null && a.equals(addr16)) {
devInNetwork = d;
代码示例来源:origin: digidotcom/XBeeJavaLibrary
RemoteXBeeDevice remoteDevice = xbeeNetwork.discoverDevice(REMOTE_NODE_IDENTIFIER);
if (remoteDevice == null) {
System.out.println("Couldn't find the remote XBee device with '" + REMOTE_NODE_IDENTIFIER + "' Node Identifier.");
代码示例来源:origin: digidotcom/XBeeJavaLibrary
rDevice = deviceList.get(0);
if (rDevice != null)
rDevice = network.addRemoteDevice(rDevice);
代码示例来源:origin: digidotcom/XBeeJavaLibrary
RemoteXBeeDevice remoteDevice = xbeeNetwork.discoverDevice(REMOTE_NODE_IDENTIFIER);
if (remoteDevice == null) {
System.out.println("Couldn't find the remote XBee device with '" + REMOTE_NODE_IDENTIFIER + "' Node Identifier.");
代码示例来源:origin: digidotcom/XBeeJavaLibrary
remoteDevice = getNetwork().addRemoteDevice(remoteXBeeDevice);
代码示例来源:origin: digidotcom/XBeeJavaLibrary
RemoteXBeeDevice remoteDevice = xbeeNetwork.discoverDevice(REMOTE_NODE_IDENTIFIER);
if (remoteDevice == null) {
System.out.println("Couldn't find the remote XBee device with '" + REMOTE_NODE_IDENTIFIER + "' Node Identifier.");
代码示例来源:origin: digidotcom/XBeeJavaLibrary
RemoteXBeeDevice remoteDevice = xbeeNetwork.discoverDevice(REMOTE_NODE_IDENTIFIER);
if (remoteDevice == null) {
System.out.println("Couldn't find the remote XBee device with '" + REMOTE_NODE_IDENTIFIER + "' Node Identifier.");
代码示例来源:origin: digidotcom/XBeeJavaLibrary
RemoteXBeeDevice remoteDevice = xbeeNetwork.discoverDevice(REMOTE_NODE_IDENTIFIER);
if (remoteDevice == null) {
System.out.println("Couldn't find the remote XBee device with '" + REMOTE_NODE_IDENTIFIER + "' Node Identifier.");
内容来源于网络,如有侵权,请联系作者删除!