enable direct raw forwarding of IR signal

direct raw forward false by default
This commit is contained in:
1technophile committed 2017-12-02 11:16:43 +01:00
1 parent 3c2267d2f0
commit 0844cbefa9
2 files changed
+16 -1

No files matched your search

+14 -1
View File
@@ -72,7 +72,20 @@ boolean IRtoMQTT(){
if ( i < results.rawlen-1 ) rawCode = rawCode + ","; // ',' not needed on last one
}
trc(rawCode);
// if needed we directly resend the raw code
if (RawDirectForward){
uint16_t rawsend[results.rawlen];
for (uint16_t i = 1; i < results.rawlen; i++) {
#ifdef ESP8266
if (i % 100 == 0) yield(); // Preemptive yield every 100th entry to feed the WDT.
#endif
rawsend[i] = results.rawbuf[i];
}
irsend.sendRaw(rawsend, results.rawlen, RawFrequency);
trc(F("raw signal redirected"));
}
irrecv.resume(); // Receive the next value
if (pubIRunknownPrtcl == false && MQTTprotocol == "-1"){ // don't publish unknown IR protocol
trc(F("--no pub. unknown protocol--"));
} else if (!isAduplicate(MQTTvalue) && MQTTvalue!=0) {// conditions to avoid duplications of RF -->MQTT
@@ -156,7 +169,7 @@ void MQTTtoIR(char * topicOri, char * datacallback) {
j++;
}
}
irsend.sendRaw(Raw, j, 38); // frequency hardcoded as a first approach for test purposes
irsend.sendRaw(Raw, j, RawFrequency);
signalSent = true;
}
#endif
+2
View File
@@ -37,6 +37,8 @@
#define IRbitsKey "IRBITS_" // bits will be defined if a subject contains IRbitsKey followed by a value of 2 digits
#define IRRptKey "RPT_" // repeats will be defined if a subject contains IRRptKey followed by a value of 1 digit
#define repeatIRwMQTT false // do we repeat a received signal by using mqtt
#define RawDirectForward false // direct repeat of IR signal with raw data
#define RawFrequency 38 // raw frequency sending
#define pubIRunknownPrtcl false // key to avoid mqtt publication of unknown IR protocol (set to true if you want to publish unknown protocol)
#define PanasonicAddress 0x4004 // Panasonic address (Pre data)