Пример #1
0
        /**
         * Creates a new remote XBee device with the provided 64-bit address,
         * 16-bit address, node identifier and the XBee device that is using this
         * data reader as the connection interface for the remote device.
         *
         * The new XBee device will be a {@code RemoteDigiMeshDevice},
         * a {@code RemoteDigiPointDevice}, a {@code RemoteRaw802Device} or a
         * {@code RemoteZigBeeDevice} depending on the protocol of the local XBee
         * device. If the protocol cannot be determined or is unknown a
         * {@code RemoteXBeeDevice} will be created instead.
         *
         * @param addr64 The 64-bit address of the new remote device. It cannot be
         *               {@code null}.
         * @param addr16 The 16-bit address of the new remote device. It may be
         *               {@code null}.
         * @param ni The node identifier of the new remote device. It may be
         *           {@code null}.
         *
         * @return a new remote XBee device with the given parameters.
         */
        private RemoteXBeeDevice createRemoteXBeeDevice(XBee64BitAddress addr64,
                                                        XBee16BitAddress addr16, String ni)
        {
            RemoteXBeeDevice device = null;

            switch (xbeeDevice.XBeeProtocol)
            {
            case XBeeProtocol.ZIGBEE:
                device = new RemoteZigBeeDevice(xbeeDevice, addr64, addr16, ni);
                break;

            case XBeeProtocol.DIGI_MESH:
                device = new RemoteDigiMeshDevice(xbeeDevice, addr64, ni);
                break;

            case XBeeProtocol.DIGI_POINT:
                device = new RemoteDigiPointDevice(xbeeDevice, addr64, ni);
                break;

            case XBeeProtocol.RAW_802_15_4:
                device = new RemoteRaw802Device(xbeeDevice, addr64, addr16, ni);
                break;

            default:
                device = new RemoteXBeeDevice(xbeeDevice, addr64, addr16, ni);
                break;
            }

            return(device);
        }
Пример #2
0
        /**
         * Creates a new remote XBee device with the provided 64-bit address,
         * 16-bit address, node identifier and the XBee device that is using this
         * data reader as the connection interface for the remote device.
         *
         * The new XBee device will be a {@code RemoteDigiMeshDevice},
         * a {@code RemoteDigiPointDevice}, a {@code RemoteRaw802Device} or a
         * {@code RemoteZigBeeDevice} depending on the protocol of the local XBee
         * device. If the protocol cannot be determined or is unknown a
         * {@code RemoteXBeeDevice} will be created instead.
         *
         * @param addr64 The 64-bit address of the new remote device. It cannot be
         *               {@code null}.
         * @param addr16 The 16-bit address of the new remote device. It may be
         *               {@code null}.
         * @param ni The node identifier of the new remote device. It may be
         *           {@code null}.
         *
         * @return a new remote XBee device with the given parameters.
         */
        private RemoteXBeeDevice createRemoteXBeeDevice(XBee64BitAddress addr64,
            XBee16BitAddress addr16, String ni)
        {
            RemoteXBeeDevice device = null;

            switch (xbeeDevice.XBeeProtocol)
            {
                case XBeeProtocol.ZIGBEE:
                    device = new RemoteZigBeeDevice(xbeeDevice, addr64, addr16, ni);
                    break;
                case XBeeProtocol.DIGI_MESH:
                    device = new RemoteDigiMeshDevice(xbeeDevice, addr64, ni);
                    break;
                case XBeeProtocol.DIGI_POINT:
                    device = new RemoteDigiPointDevice(xbeeDevice, addr64, ni);
                    break;
                case XBeeProtocol.RAW_802_15_4:
                    device = new RemoteRaw802Device(xbeeDevice, addr64, addr16, ni);
                    break;
                default:
                    device = new RemoteXBeeDevice(xbeeDevice, addr64, addr16, ni);
                    break;
            }

            return device;
        }