add send raw function for IR

#46 #9
This commit is contained in:
1technophile committed 2017-05-16 21:40:25 +02:00
1 parent 411550d8ce
commit e909f16b74
2 files changed
+27 -2

No files matched your search

+23
View File
@@ -115,6 +115,29 @@ void MQTTtoIR(char * topicOri, char * datacallback) {
irsend.sendGC(GC, j);
signalSent = true;
}
#endif
#ifdef IR_Raw
else if(strstr(topicOri, "IR_Raw") != NULL){ // sending GC data from https://irdb.globalcache.com
trc("IR_Raw");
//buffer allocation from char datacallback
unsigned int GC[count+1];
String value = "";
int j = 0;
for(int i = 0; i < s; i++)
{
if (datacallback[i] != ',') {
value = value + String(datacallback[i]);
}
if ((datacallback[i] == ',') || (i == s - 1))
{
GC[j]= value.toInt();
value = "";
j++;
}
}
irsend.sendRaw(GC, j, 38); // frequency hardcoded as a first approach for test puroposes
signalSent = true;
}
#endif
//We look into the subject to see if a special Bits number is defined