private Lpd433MhzCode GetCodeC(IntertechnoUnitCode unitCode, RemoteSocketCommand command)
        {
            switch (unitCode)
            {
            case IntertechnoUnitCode.Unit1:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new Lpd433MhzCode(1048597U, Length, Protocol, Repeats)
                            : new Lpd433MhzCode(1048596U, Length, Protocol, Repeats));
            }

            case IntertechnoUnitCode.Unit2:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new Lpd433MhzCode(1064981U, Length, Protocol, Repeats)
                            : new Lpd433MhzCode(1064980U, Length, Protocol, Repeats));
            }

            case IntertechnoUnitCode.Unit3:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new Lpd433MhzCode(1052693U, Length, Protocol, Repeats)
                            : new Lpd433MhzCode(1052692U, Length, Protocol, Repeats));
            }

            default:
            {
                throw new NotSupportedException();
            }
            }
        }
        private LPD433MHzCodeSequence GetSequenceB(IntertechnoUnitCode unitCode, RemoteSocketCommand command)
        {
            switch (unitCode)
            {
            case IntertechnoUnitCode.Unit1:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4194325U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4194324U, LENGTH, REPEATS)));
            }

            case IntertechnoUnitCode.Unit2:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4210709U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4210708U, LENGTH, REPEATS)));
            }

            case IntertechnoUnitCode.Unit3:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4198421U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4198420U, LENGTH, REPEATS)));
            }

            default:
            {
                throw new NotSupportedException();
            }
            }
        }
        private LPD433MHzCodeSequence GetSequenceB(IntertechnoUnitCode unitCode, RemoteSocketCommand command)
        {
            switch (unitCode)
            {
                case IntertechnoUnitCode.Unit1:
                    {
                        return command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4194325U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4194324U, LENGTH, REPEATS));
                    }

                case IntertechnoUnitCode.Unit2:
                    {
                        return command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4210709U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4210708U, LENGTH, REPEATS));
                    }

                case IntertechnoUnitCode.Unit3:
                    {
                        return command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4198421U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4198420U, LENGTH, REPEATS));
                    }

                default:
                    {
                        throw new NotSupportedException();
                    }
            }
        }
        private LPD433MHzCodeSequence GetSequenceD(IntertechnoUnitCode unitCode, RemoteSocketCommand command)
        {
            switch (unitCode)
            {
            case IntertechnoUnitCode.Unit1:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5242901U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5242900U, LENGTH, REPEATS)));
            }

            case IntertechnoUnitCode.Unit2:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5259285U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5259284U, LENGTH, REPEATS)));
            }

            case IntertechnoUnitCode.Unit3:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5246997U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5246996U, LENGTH, REPEATS)));
            }

            default:
            {
                throw new NotSupportedException();
            }
            }
        }
        private LPD433MHzCodeSequence GetSequenceC(IntertechnoUnitCode unitCode, RemoteSocketCommand command)
        {
            switch (unitCode)
            {
            case IntertechnoUnitCode.Unit1:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1048597U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1048596U, LENGTH, REPEATS)));
            }

            case IntertechnoUnitCode.Unit2:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1064981U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1064980U, LENGTH, REPEATS)));
            }

            case IntertechnoUnitCode.Unit3:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1052693U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1052692U, LENGTH, REPEATS)));
            }

            default:
            {
                throw new NotSupportedException();
            }
            }
        }
        private Lpd433MhzCode GetCodeB(IntertechnoUnitCode unitCode, RemoteSocketCommand command)
        {
            switch (unitCode)
            {
            case IntertechnoUnitCode.Unit1:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new Lpd433MhzCode(4194325U, Length, Protocol, Repeats)
                            : new Lpd433MhzCode(4194324U, Length, Protocol, Repeats));
            }

            case IntertechnoUnitCode.Unit2:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new Lpd433MhzCode(4210709U, Length, Protocol, Repeats)
                            : new Lpd433MhzCode(4210708U, Length, Protocol, Repeats));
            }

            case IntertechnoUnitCode.Unit3:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new Lpd433MhzCode(4198421U, Length, Protocol, Repeats)
                            : new Lpd433MhzCode(4198420U, Length, Protocol, Repeats));
            }

            default:
            {
                throw new NotSupportedException();
            }
            }
        }
        private Lpd433MhzCode GetCodeD(IntertechnoUnitCode unitCode, RemoteSocketCommand command)
        {
            switch (unitCode)
            {
            case IntertechnoUnitCode.Unit1:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new Lpd433MhzCode(5242901U, Length, Protocol, Repeats)
                            : new Lpd433MhzCode(5242900U, Length, Protocol, Repeats));
            }

            case IntertechnoUnitCode.Unit2:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new Lpd433MhzCode(5259285U, Length, Protocol, Repeats)
                            : new Lpd433MhzCode(5259284U, Length, Protocol, Repeats));
            }

            case IntertechnoUnitCode.Unit3:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new Lpd433MhzCode(5246997U, Length, Protocol, Repeats)
                            : new Lpd433MhzCode(5246996U, Length, Protocol, Repeats));
            }

            default:
            {
                throw new NotSupportedException();
            }
            }
        }
        public LPD433MHzCodeSequence GetSequence(IntertechnoSystemCode systemCode, IntertechnoUnitCode unitCode, RemoteSocketCommand command)
        {
            switch (systemCode)
            {
                case IntertechnoSystemCode.A:
                {
                    return GetSequenceA(unitCode, command);
                }

                case IntertechnoSystemCode.B:
                {
                    return GetSequenceB(unitCode, command);
                }

                case IntertechnoSystemCode.C:
                {
                    return GetSequenceC(unitCode, command);
                }

                case IntertechnoSystemCode.D:
                {
                    return GetSequenceD(unitCode, command);
                }
            }

            throw new NotSupportedException();
        }
示例#9
0
        public DipswitchCode(DipswitchSystemCode system, DipswitchUnitCode unit, RemoteSocketCommand command)
        {
            System  = system;
            Unit    = unit;
            Command = command;

            _code = GetCode(this);
        }
示例#10
0
        private static Lpd433MhzCode GetCodeA(IntertechnoUnitCode unitCode, RemoteSocketCommand command)
        {
            switch (unitCode)
            {
            case IntertechnoUnitCode.Unit1:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new Lpd433MhzCode {
                        Value = 21U, Length = Length, Protocol = Protocol, Repeats = Repeats
                    }
                            : new Lpd433MhzCode {
                        Value = 20U, Length = Length, Protocol = Protocol, Repeats = Repeats
                    });
            }

            case IntertechnoUnitCode.Unit2:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new Lpd433MhzCode {
                        Value = 16405U, Length = Length, Protocol = Protocol, Repeats = Repeats
                    }
                            : new Lpd433MhzCode {
                        Value = 16404U, Length = Length, Protocol = Protocol, Repeats = Repeats
                    });
            }

            case IntertechnoUnitCode.Unit3:
            {
                return(command == RemoteSocketCommand.TurnOn
                            ? new Lpd433MhzCode {
                        Value = 4117U, Length = Length, Protocol = Protocol, Repeats = Repeats
                    }
                            : new Lpd433MhzCode {
                        Value = 4116U, Length = Length, Protocol = Protocol, Repeats = Repeats
                    });
            }

            default:
            {
                throw new NotSupportedException();
            }
            }
        }
        public LPD433MHzCodeSequence GetSequence(BrennenstuhlSystemCode systemCode, BrennenstuhlUnitCode unitCode, RemoteSocketCommand command)
        {
            // Examples:
            // System Code = 11111
            //00000000|00000000000|0010101|010001 = 1361 A ON
            //00000000|00000000000|0010101|010100 = 1364 A OFF
            //00000000|00000000000|1000101|010001 = 4433 B ON
            //00000000|00000000000|1000101|010100 = 4436 B OFF
            //00000000|00000000000|1010001|010001 = 5201 C ON
            //00000000|00000000000|1010001|010100 = 5204 C OFF
            //00000000|00000000000|1010100|010001 = 5393 D ON
            //00000000|00000000000|1010100|010100 = 5396 D OFF
            // System Code = 00000
            //00000000|01010101010|0010101|010001 = 5588305 A ON
            //00000000|01010101010|0010101|010100 = 5588308 A OFF
            //00000000|01010101010|1000101|010001 = 5591377 B ON
            //00000000|01010101010|1000101|010100 = 5591380 B OFF
            //00000000|01010101010|1010001|010001 = 5592145 C ON
            //00000000|01010101010|1010001|010100 = 5592148 C OFF
            //00000000|01010101010|1010100|010001 = 5592337 D ON
            //00000000|01010101010|1010100|010100 = 5592340 D OFF
            // System Code = 10101
            //00000000|00010001000|0010101|010001 = 1115473 A ON
            //00000000|00010001000|0010101|010100 = 1115476 A OFF
            //00000000|00010001000|1000101|010001 = 1118545 B ON
            //00000000|00010001000|1000101|010100 = 1118548 B OFF
            //00000000|00010001000|1010001|010001 = 1119313 C ON
            //00000000|00010001000|1010001|010100 = 1119316 C OFF
            //00000000|00010001000|1010100|010001 = 1119505 D ON
            //00000000|00010001000|1010100|010100 = 1119508 D OFF

            uint code = 0U;
            code = SetSystemCode(code, systemCode);
            code = SetUnitCode(code, unitCode);
            code = SetCommand(code, command);

            return new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(code, 24, 3));
        }
示例#12
0
        private static uint SetCommand(uint code, RemoteSocketCommand command)
        {
            switch (command)
            {
            case RemoteSocketCommand.TurnOn:
            {
                code |= 0x11;
                break;
            }

            case RemoteSocketCommand.TurnOff:
            {
                code |= 0x14;
                break;
            }

            default:
            {
                throw new NotSupportedException();
            }
            }

            return(code);
        }
        private uint SetCommand(uint code, RemoteSocketCommand command)
        {
            switch (command)
            {
                case RemoteSocketCommand.TurnOn:
                    {
                        code |= 0x11;
                        break;
                    }

                case RemoteSocketCommand.TurnOff:
                    {
                        code |= 0x14;
                        break;
                    }

                default:
                    {
                        throw new NotSupportedException();
                    }
            }

            return code;
        }
示例#14
0
        public static Lpd433MhzCode GetCode(DipswitchSystemCode systemCode, DipswitchUnitCode unitCode, RemoteSocketCommand command)
        {
            // Examples:
            // System Code = 11111
            //00000000|00000000000|0010101|010001 = 1361 A ON
            //00000000|00000000000|0010101|010100 = 1364 A OFF
            //00000000|00000000000|1000101|010001 = 4433 B ON
            //00000000|00000000000|1000101|010100 = 4436 B OFF
            //00000000|00000000000|1010001|010001 = 5201 C ON
            //00000000|00000000000|1010001|010100 = 5204 C OFF
            //00000000|00000000000|1010100|010001 = 5393 D ON
            //00000000|00000000000|1010100|010100 = 5396 D OFF
            // System Code = 00000
            //00000000|01010101010|0010101|010001 = 5588305 A ON
            //00000000|01010101010|0010101|010100 = 5588308 A OFF
            //00000000|01010101010|1000101|010001 = 5591377 B ON
            //00000000|01010101010|1000101|010100 = 5591380 B OFF
            //00000000|01010101010|1010001|010001 = 5592145 C ON
            //00000000|01010101010|1010001|010100 = 5592148 C OFF
            //00000000|01010101010|1010100|010001 = 5592337 D ON
            //00000000|01010101010|1010100|010100 = 5592340 D OFF
            // System Code = 10101
            //00000000|00010001000|0010101|010001 = 1115473 A ON
            //00000000|00010001000|0010101|010100 = 1115476 A OFF
            //00000000|00010001000|1000101|010001 = 1118545 B ON
            //00000000|00010001000|1000101|010100 = 1118548 B OFF
            //00000000|00010001000|1010001|010001 = 1119313 C ON
            //00000000|00010001000|1010001|010100 = 1119316 C OFF
            //00000000|00010001000|1010100|010001 = 1119505 D ON
            //00000000|00010001000|1010100|010100 = 1119508 D OFF

            var code = 0U;

            code = SetSystemCode(code, systemCode);
            code = SetUnitCode(code, unitCode);
            code = SetCommand(code, command);

            return(new Lpd433MhzCode
            {
                Value = code,
                Length = 24,
                Protocol = 1,
                Repeats = 3
            });
        }
        public LPD433MHzCodeSequence GetSequence(IntertechnoSystemCode systemCode, IntertechnoUnitCode unitCode, RemoteSocketCommand command)
        {
            switch (systemCode)
            {
            case IntertechnoSystemCode.A:
            {
                return(GetSequenceA(unitCode, command));
            }

            case IntertechnoSystemCode.B:
            {
                return(GetSequenceB(unitCode, command));
            }

            case IntertechnoSystemCode.C:
            {
                return(GetSequenceC(unitCode, command));
            }

            case IntertechnoSystemCode.D:
            {
                return(GetSequenceD(unitCode, command));
            }
            }

            throw new NotSupportedException();
        }
示例#16
0
        public static Lpd433MhzCode GetCode(IntertechnoSystemCode systemCode, IntertechnoUnitCode unitCode, RemoteSocketCommand command)
        {
            switch (systemCode)
            {
            case IntertechnoSystemCode.A:
            {
                return(GetCodeA(unitCode, command));
            }

            case IntertechnoSystemCode.B:
            {
                return(GetCodeB(unitCode, command));
            }

            case IntertechnoSystemCode.C:
            {
                return(GetCodeC(unitCode, command));
            }

            case IntertechnoSystemCode.D:
            {
                return(GetCodeD(unitCode, command));
            }
            }

            throw new NotSupportedException();
        }
示例#17
0
        public LPD433MHzCodeSequence GetSequence(BrennenstuhlSystemCode systemCode, BrennenstuhlUnitCode unitCode, RemoteSocketCommand command)
        {
            // Examples:
            // System Code = 11111
            //00000000|00000000000|0010101|010001 = 1361 A ON
            //00000000|00000000000|0010101|010100 = 1364 A OFF
            //00000000|00000000000|1000101|010001 = 4433 B ON
            //00000000|00000000000|1000101|010100 = 4436 B OFF
            //00000000|00000000000|1010001|010001 = 5201 C ON
            //00000000|00000000000|1010001|010100 = 5204 C OFF
            //00000000|00000000000|1010100|010001 = 5393 D ON
            //00000000|00000000000|1010100|010100 = 5396 D OFF
            // System Code = 00000
            //00000000|01010101010|0010101|010001 = 5588305 A ON
            //00000000|01010101010|0010101|010100 = 5588308 A OFF
            //00000000|01010101010|1000101|010001 = 5591377 B ON
            //00000000|01010101010|1000101|010100 = 5591380 B OFF
            //00000000|01010101010|1010001|010001 = 5592145 C ON
            //00000000|01010101010|1010001|010100 = 5592148 C OFF
            //00000000|01010101010|1010100|010001 = 5592337 D ON
            //00000000|01010101010|1010100|010100 = 5592340 D OFF
            // System Code = 10101
            //00000000|00010001000|0010101|010001 = 1115473 A ON
            //00000000|00010001000|0010101|010100 = 1115476 A OFF
            //00000000|00010001000|1000101|010001 = 1118545 B ON
            //00000000|00010001000|1000101|010100 = 1118548 B OFF
            //00000000|00010001000|1010001|010001 = 1119313 C ON
            //00000000|00010001000|1010001|010100 = 1119316 C OFF
            //00000000|00010001000|1010100|010001 = 1119505 D ON
            //00000000|00010001000|1010100|010100 = 1119508 D OFF

            uint code = 0U;

            code = SetSystemCode(code, systemCode);
            code = SetUnitCode(code, unitCode);
            code = SetCommand(code, command);

            return(new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(code, 24, 3)));
        }
        private LPD433MHzCodeSequence GetSequenceD(IntertechnoUnitCode unitCode, RemoteSocketCommand command)
        {
            switch (unitCode)
            {
                case IntertechnoUnitCode.Unit1:
                    {
                        return command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5242901U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5242900U, LENGTH, REPEATS));
                    }

                case IntertechnoUnitCode.Unit2:
                    {
                        return command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5259285U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5259284U, LENGTH, REPEATS));
                    }

                case IntertechnoUnitCode.Unit3:
                    {
                        return command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5246997U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5246996U, LENGTH, REPEATS));
                    }

                default:
                    {
                        throw new NotSupportedException();
                    }
            }
        }
        private LPD433MHzCodeSequence GetSequenceC(IntertechnoUnitCode unitCode, RemoteSocketCommand command)
        {
            switch (unitCode)
            {
                case IntertechnoUnitCode.Unit1:
                    {
                        return command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1048597U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1048596U, LENGTH, REPEATS));
                    }

                case IntertechnoUnitCode.Unit2:
                    {
                        return command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1064981U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1064980U, LENGTH, REPEATS));
                    }

                case IntertechnoUnitCode.Unit3:
                    {
                        return command == RemoteSocketCommand.TurnOn
                            ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1052693U, LENGTH, REPEATS))
                            : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1052692U, LENGTH, REPEATS));
                    }

                default:
                    {
                        throw new NotSupportedException();
                    }
            }
        }