integrate V2.X.X of irremote esp8266 library (#72)

* Compatibility with IRRemoteESP8266 V2
This commit is contained in:
Florian authored and GitHub committed 2017-07-11 20:38:30 +02:00
1 parent 916f46c34d
commit 97a68a247e
6 files changed
+11 -10

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ install:
- wget https://github.com/z3t0/Arduino-IRremote/archive/2.1.0.zip -O /tmp/IRremote.zip
- unzip /tmp/IRremote.zip -d /usr/local/share/arduino/libraries
- rm -rf /usr/local/share/arduino/libraries/RobotIRremote
- wget https://github.com/markszabo/IRremoteESP8266/archive/v1.2.0.zip -O /tmp/IRremoteESP8266.zip
- wget https://github.com/markszabo/IRremoteESP8266/archive/v2.1.1.zip -O /tmp/IRremoteESP8266.zip
- unzip /tmp/IRremoteESP8266.zip -d /usr/local/share/arduino/libraries
- git clone https://github.com/ekstrand/ESP8266wifi /usr/local/share/arduino/libraries/ESP8266wifi
- wget https://github.com/knolleary/pubsubclient/archive/v2.6.zip -O /tmp/pubsubclient.zip
+6 -5
View File
@@ -29,6 +29,8 @@
#ifdef ESP8266
#include <IRremoteESP8266.h>
#include <IRsend.h> // Needed if you want to send IR commands.
#include <IRrecv.h> // Needed if you want to receive IR commands.
IRrecv irrecv(IR_RECEIVER_PIN);
IRsend irsend(IR_EMITTER_PIN);
#else
@@ -92,7 +94,7 @@ void MQTTtoIR(char * topicOri, char * datacallback) {
// IR DATA ANALYSIS
//send received MQTT value by IR signal
boolean signalSent = false;
unsigned long data = 0;
uint64_t data = 0;
String strcallback = String(datacallback);
trc(String(datacallback));
int s = strcallback.length();
@@ -111,7 +113,7 @@ void MQTTtoIR(char * topicOri, char * datacallback) {
else if(strstr(topicOri, "IR_GC") != NULL){ // sending GC data from https://irdb.globalcache.com
trc("IR_GC");
//buffer allocation from char datacallback
unsigned int GC[count+1];
uint16_t GC[count+1];
String value = "";
int j = 0;
for(int i = 0; i < s; i++)
@@ -134,7 +136,7 @@ void MQTTtoIR(char * topicOri, char * datacallback) {
else if(strstr(topicOri, "IR_Raw") != NULL){ // sending Raw data
trc("IR_Raw");
//buffer allocation from char datacallback
unsigned int Raw[count+1];
uint16_t Raw[count+1];
String value = "";
int j = 0;
for(int i = 0; i < s; i++)
@@ -157,7 +159,7 @@ void MQTTtoIR(char * topicOri, char * datacallback) {
//We look into the subject to see if a special Bits number is defined
String topic = topicOri;
int valueRPT = 0;
int valueBITS = 0;
unsigned int valueBITS = 0;
int pos = topic.lastIndexOf(IRbitsKey);
if (pos != -1){
pos = pos + +strlen(IRbitsKey);
@@ -255,7 +257,6 @@ void MQTTtoIR(char * topicOri, char * datacallback) {
boolean result = client.publish(subjectGTWIRtoMQTT, datacallback);
if (result){
trc(F("MQTTtoIR OK ack published"));
trc(String(data));
};
}
irrecv.enableIRIn(); // ReStart the IR receiver (if not restarted it is not able to receive data)