Ejemplo n.º 1
0
        public static XBeeNode CreateDevice(HardwareVersion hardwareVersion, ushort firmwareVersion,
                                            NodeAddress address, XBeeControllerBase controller)
        {
            var series   = GetSeries(hardwareVersion);
            var protocol = GetProtocol(hardwareVersion, firmwareVersion);

            switch (series)
            {
            case DeviceSeries.Series1:
                return(new XBeeSeries1(controller, hardwareVersion, firmwareVersion, protocol, address));

            case DeviceSeries.Series2:
                return(new XBeeSeries2(controller, hardwareVersion, firmwareVersion, protocol, address));

            case DeviceSeries.Pro900:
                return(new XBeePro900HP(controller, hardwareVersion, firmwareVersion, protocol, address));

            case DeviceSeries.Cellular:
                return(new XBeeCellular(controller, hardwareVersion, firmwareVersion, protocol, address));

            default:
                throw new InvalidOperationException();
            }
        }