public LPD433MHzCodeSequence GetSequence(IntertechnoSystemCode systemCode, IntertechnoUnitCode unitCode, RemoteSwitchCommand 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(); }
private LPD433MHzCodeSequence GetSequenceB(IntertechnoUnitCode unitCode, RemoteSwitchCommand command) { switch (unitCode) { case IntertechnoUnitCode.Unit1: { return command == RemoteSwitchCommand.TurnOn ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4194325U, LENGTH, REPEATS)) : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4194324U, LENGTH, REPEATS)); } case IntertechnoUnitCode.Unit2: { return command == RemoteSwitchCommand.TurnOn ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4210709U, LENGTH, REPEATS)) : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4210708U, LENGTH, REPEATS)); } case IntertechnoUnitCode.Unit3: { return command == RemoteSwitchCommand.TurnOn ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4198421U, LENGTH, REPEATS)) : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(4198420U, LENGTH, REPEATS)); } default: { throw new NotSupportedException(); } } }
public LPD433MHzCodeSequence GetSequence(BrennenstuhlSystemCode systemCode, BrennenstuhlUnitCode unitCode, RemoteSwitchCommand 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 uint SetCommand(uint code, RemoteSwitchCommand command) { switch (command) { case RemoteSwitchCommand.TurnOn: { code |= 0x11; break; } case RemoteSwitchCommand.TurnOff: { code |= 0x14; break; } default: { throw new NotSupportedException(); } } return code; }
private LPD433MHzCodeSequence GetSequenceD(IntertechnoUnitCode unitCode, RemoteSwitchCommand command) { switch (unitCode) { case IntertechnoUnitCode.Unit1: { return command == RemoteSwitchCommand.TurnOn ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5242901U, LENGTH, REPEATS)) : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5242900U, LENGTH, REPEATS)); } case IntertechnoUnitCode.Unit2: { return command == RemoteSwitchCommand.TurnOn ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5259285U, LENGTH, REPEATS)) : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(5259284U, LENGTH, REPEATS)); } case IntertechnoUnitCode.Unit3: { return command == RemoteSwitchCommand.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, RemoteSwitchCommand command) { switch (unitCode) { case IntertechnoUnitCode.Unit1: { return command == RemoteSwitchCommand.TurnOn ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1048597U, LENGTH, REPEATS)) : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1048596U, LENGTH, REPEATS)); } case IntertechnoUnitCode.Unit2: { return command == RemoteSwitchCommand.TurnOn ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1064981U, LENGTH, REPEATS)) : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1064980U, LENGTH, REPEATS)); } case IntertechnoUnitCode.Unit3: { return command == RemoteSwitchCommand.TurnOn ? new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1052693U, LENGTH, REPEATS)) : new LPD433MHzCodeSequence().WithCode(new LPD433MHzCode(1052692U, LENGTH, REPEATS)); } default: { throw new NotSupportedException(); } } }