コード例 #1
0
        public static IPacketReader GetReader(ApiTypeValue apiType)
        {
            IPacketReader reader;
            switch(apiType)
            {
                case ApiTypeValue.Disabled:
                case ApiTypeValue.Enabled:
                    reader = new PacketReader();
                    break;
                case ApiTypeValue.EnabledWithEscape:
                    reader = new EscapedPacketReader();
                    break;
                default:
                    throw new XBeeException("Invalid API Type");
            }

            return reader;
        }
コード例 #2
0
ファイル: PacketReaderFactory.cs プロジェクト: gagmax981/XBee
        public static IPacketReader GetReader(ApiTypeValue apiType)
        {
            IPacketReader reader;

            switch (apiType)
            {
            case ApiTypeValue.Disabled:
            case ApiTypeValue.Enabled:
                reader = new PacketReader();
                break;

            case ApiTypeValue.EnabledWithEscape:
                reader = new EscapedPacketReader();
                break;

            default:
                throw new XBeeException("Invalid API Type");
            }

            return(reader);
        }