IRRemote ESP8266 Lib update and add new protocols (#641)
This commit is contained in:
1 parent
9bba730e84
commit
3bee160b48
3 files changed
+130
-7
No files matched your search
+118
-6
@@ -46,7 +46,7 @@ IRrecv irrecv(IR_RECEIVER_GPIO);
|
|||||||
IRsend irsend; //connect IR emitter pin to D9 on arduino, you need to comment #define IR_USE_TIMER2 and uncomment #define IR_USE_TIMER1 on library IRremote.h so as to free pin D3 for RF RECEIVER PIN
|
IRsend irsend; //connect IR emitter pin to D9 on arduino, you need to comment #define IR_USE_TIMER2 and uncomment #define IR_USE_TIMER1 on library IRremote.h so as to free pin D3 for RF RECEIVER PIN
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
// IR protocol bits definition for Arduino (for ESP9266 they are defined in IRRemoteESP8266.h)
|
// IR protocol bits definition for Arduino (for ESP8266 they are defined in IRRemoteESP8266.h)
|
||||||
# ifndef NEC_BITS
|
# ifndef NEC_BITS
|
||||||
# define NEC_BITS 32U
|
# define NEC_BITS 32U
|
||||||
# endif
|
# endif
|
||||||
@@ -65,6 +65,9 @@ IRsend irsend; //connect IR emitter pin to D9 on arduino, you need to comment #d
|
|||||||
# ifndef DISH_BITS
|
# ifndef DISH_BITS
|
||||||
# define DISH_BITS 16U
|
# define DISH_BITS 16U
|
||||||
# endif
|
# endif
|
||||||
|
# ifndef SONY_20_BITS
|
||||||
|
# define SONY_20_BITS 20
|
||||||
|
# endif
|
||||||
# ifndef SONY_12_BITS
|
# ifndef SONY_12_BITS
|
||||||
# define SONY_12_BITS 12U
|
# define SONY_12_BITS 12U
|
||||||
# endif
|
# endif
|
||||||
@@ -252,7 +255,7 @@ void MQTTtoIR(char* topicOri, JsonObject& IRdata) {
|
|||||||
signalSent = true;
|
signalSent = true;
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
} else if (protocol_name && (strcmp(protocol_name, "NEC") != 1)) {
|
} else if (protocol_name && (strcmp(protocol_name, "NEC") != 0)) {
|
||||||
Log.trace(F("Using Identified Protocol: %s bits: %d repeat: %d" CR), protocol_name, valueBITS, valueRPT);
|
Log.trace(F("Using Identified Protocol: %s bits: %d repeat: %d" CR), protocol_name, valueBITS, valueRPT);
|
||||||
signalSent = sendIdentifiedProtocol(protocol_name, data, hex, valueBITS, valueRPT);
|
signalSent = sendIdentifiedProtocol(protocol_name, data, hex, valueBITS, valueRPT);
|
||||||
} else {
|
} else {
|
||||||
@@ -324,11 +327,13 @@ bool sendIdentifiedProtocol(const char* protocol_name, unsigned long long data,
|
|||||||
# ifdef IR_SONY
|
# ifdef IR_SONY
|
||||||
if (strcmp(protocol_name, "SONY") == 0) {
|
if (strcmp(protocol_name, "SONY") == 0) {
|
||||||
Log.notice(F("Sending IR signal with %s" CR), protocol_name);
|
Log.notice(F("Sending IR signal with %s" CR), protocol_name);
|
||||||
if (valueBITS == 0)
|
|
||||||
valueBITS = SONY_12_BITS;
|
|
||||||
# if defined(ESP8266) || defined(ESP32)
|
# if defined(ESP8266) || defined(ESP32)
|
||||||
|
if (valueBITS == 0)
|
||||||
|
valueBITS = SONY_20_BITS;
|
||||||
irsend.sendSony(data, valueBITS, valueRPT);
|
irsend.sendSony(data, valueBITS, valueRPT);
|
||||||
# else
|
# else
|
||||||
|
if (valueBITS == 0)
|
||||||
|
valueBITS = SONY_12_BITS;
|
||||||
for (int i = 0; i <= valueRPT; i++)
|
for (int i = 0; i <= valueRPT; i++)
|
||||||
irsend.sendSony(data, valueBITS);
|
irsend.sendSony(data, valueBITS);
|
||||||
# endif
|
# endif
|
||||||
@@ -1012,7 +1017,6 @@ bool sendIdentifiedProtocol(const char* protocol_name, unsigned long long data,
|
|||||||
# endif
|
# endif
|
||||||
# ifdef IR_HITACHI_AC424
|
# ifdef IR_HITACHI_AC424
|
||||||
if (strcmp(protocol_name, "HITACHI_AC424") == 0) {
|
if (strcmp(protocol_name, "HITACHI_AC424") == 0) {
|
||||||
Log.notice(F("Sending IR signal with %s" CR), protocol_name);
|
|
||||||
Log.notice(F("Sending IR signal with %s" CR), protocol_name);
|
Log.notice(F("Sending IR signal with %s" CR), protocol_name);
|
||||||
if (valueBITS == 0)
|
if (valueBITS == 0)
|
||||||
valueBITS = kHitachiAc424StateLength;
|
valueBITS = kHitachiAc424StateLength;
|
||||||
@@ -1022,7 +1026,115 @@ bool sendIdentifiedProtocol(const char* protocol_name, unsigned long long data,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
Log.trace(F("At the end" CR));
|
# ifdef IR_SONY_38K
|
||||||
|
if (strcmp(protocol_name, "SONY_38K") == 0) {
|
||||||
|
Log.notice(F("Sending IR signal with %s" CR), protocol_name);
|
||||||
|
if (valueRPT == repeatIRwNumber)
|
||||||
|
valueRPT = std::max(valueRPT, (uint16_t)(kSonyMinRepeat + 1));
|
||||||
|
if (valueBITS == 0)
|
||||||
|
valueBITS = kSony20Bits;
|
||||||
|
irsend.sendSony38(data, valueBITS, valueRPT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
# ifdef IR_EPSON
|
||||||
|
if (strcmp(protocol_name, "EPSON") == 0) {
|
||||||
|
Log.notice(F("Sending IR signal with %s" CR), protocol_name);
|
||||||
|
if (valueRPT == repeatIRwNumber)
|
||||||
|
valueRPT = std::max(valueRPT, kEpsonMinRepeat);
|
||||||
|
if (valueBITS == 0)
|
||||||
|
valueBITS = kEpsonBits;
|
||||||
|
irsend.sendEpson(data, valueBITS, valueRPT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
# ifdef IR_SYMPHONY
|
||||||
|
if (strcmp(protocol_name, "SYMPHONY") == 0) {
|
||||||
|
Log.notice(F("Sending IR signal with %s" CR), protocol_name);
|
||||||
|
if (valueRPT == repeatIRwNumber)
|
||||||
|
valueRPT = std::max(valueRPT, kSymphonyDefaultRepeat);
|
||||||
|
if (valueBITS == 0)
|
||||||
|
valueBITS = kSymphonyBits;
|
||||||
|
irsend.sendSymphony(data, valueBITS, valueRPT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
# ifdef IR_HITACHI_AC3
|
||||||
|
if (strcmp(protocol_name, "HITACHI_AC3") == 0) {
|
||||||
|
Log.notice(F("Sending IR signal with %s" CR), protocol_name);
|
||||||
|
if (valueRPT == repeatIRwNumber)
|
||||||
|
valueRPT = std::max(valueRPT, kHitachiAcDefaultRepeat);
|
||||||
|
if (valueBITS == 0)
|
||||||
|
Log.error(F("For this protocol you should have a BIT number as there is no default one defined" CR));
|
||||||
|
irsend.sendHitachiAc3(dataarray, valueBITS, valueRPT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
# ifdef IR_DAIKIN64
|
||||||
|
if (strcmp(protocol_name, "DAIKIN64") == 0) {
|
||||||
|
Log.notice(F("Sending IR signal with %s" CR), protocol_name);
|
||||||
|
if (valueRPT == repeatIRwNumber)
|
||||||
|
valueRPT = std::max(valueRPT, kDaikin64DefaultRepeat);
|
||||||
|
if (valueBITS == 0)
|
||||||
|
valueBITS = kDaikin64Bits;
|
||||||
|
irsend.sendDaikin64(data, valueBITS, valueRPT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
# ifdef IR_AIRWELL
|
||||||
|
if (strcmp(protocol_name, "AIRWELL") == 0) {
|
||||||
|
Log.notice(F("Sending IR signal with %s" CR), protocol_name);
|
||||||
|
if (valueRPT == repeatIRwNumber)
|
||||||
|
valueRPT = std::max(valueRPT, kAirwellMinRepeats);
|
||||||
|
if (valueBITS == 0)
|
||||||
|
valueBITS = kAirwellBits;
|
||||||
|
irsend.sendAirwell(data, valueBITS, valueRPT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
# ifdef IR_DELONGHI_AC
|
||||||
|
if (strcmp(protocol_name, "DELONGHI_AC") == 0) {
|
||||||
|
Log.notice(F("Sending IR signal with %s" CR), protocol_name);
|
||||||
|
if (valueRPT == repeatIRwNumber)
|
||||||
|
valueRPT = std::max(valueRPT, kDelonghiAcDefaultRepeat);
|
||||||
|
if (valueBITS == 0)
|
||||||
|
valueBITS = kDelonghiAcBits;
|
||||||
|
irsend.sendDelonghiAc(data, valueBITS, valueRPT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
# ifdef IR_DOSHISHA
|
||||||
|
if (strcmp(protocol_name, "DOSHISHA") == 0) {
|
||||||
|
Log.notice(F("Sending IR signal with %s" CR), protocol_name);
|
||||||
|
if (valueBITS == 0)
|
||||||
|
valueBITS = kDoshishaBits;
|
||||||
|
irsend.sendDoshisha(data, valueBITS, valueRPT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
# ifdef IR_CARRIER_AC40
|
||||||
|
if (strcmp(protocol_name, "CARRIER_AC40") == 0) {
|
||||||
|
Log.notice(F("Sending IR signal with %s" CR), protocol_name);
|
||||||
|
if (valueRPT == repeatIRwNumber)
|
||||||
|
valueRPT = std::max(valueRPT, kCarrierAc40MinRepeat);
|
||||||
|
if (valueBITS == 0)
|
||||||
|
valueBITS = kCarrierAc40Bits;
|
||||||
|
irsend.sendCarrierAC40(data, valueBITS, valueRPT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
# ifdef IR_CARRIER_AC64
|
||||||
|
if (strcmp(protocol_name, "CARRIER_AC64") == 0) {
|
||||||
|
Log.notice(F("Sending IR signal with %s" CR), protocol_name);
|
||||||
|
if (valueRPT == repeatIRwNumber)
|
||||||
|
valueRPT = std::max(valueRPT, kCarrierAc64MinRepeat);
|
||||||
|
if (valueBITS == 0)
|
||||||
|
valueBITS = kCarrierAc64Bits;
|
||||||
|
irsend.sendCarrierAC64(data, valueBITS, valueRPT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
Log.warning(F("Unknown IR protocol" CR));
|
||||||
return false;
|
return false;
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,6 +120,17 @@ extern void MQTTtoIR(char* topicOri, JsonObject& RFdata);
|
|||||||
# define IR_MITSUBISHI136
|
# define IR_MITSUBISHI136
|
||||||
# define IR_MITSUBISHI112
|
# define IR_MITSUBISHI112
|
||||||
# define IR_HITACHI_AC424
|
# define IR_HITACHI_AC424
|
||||||
|
# define IR_SONY_38K
|
||||||
|
# define IR_EPSON
|
||||||
|
# define IR_SYMPHONY
|
||||||
|
# define IR_HITACHI_AC3
|
||||||
|
# define IR_DAIKIN64
|
||||||
|
# define IR_AIRWELL
|
||||||
|
# define IR_DELONGHI_AC
|
||||||
|
# define IR_DOSHISHA
|
||||||
|
# define IR_MULTIBRACKETS
|
||||||
|
# define IR_CARRIER_AC40
|
||||||
|
# define IR_CARRIER_AC64
|
||||||
#elif __AVR_ATmega2560__
|
#elif __AVR_ATmega2560__
|
||||||
# define IR_COOLIX
|
# define IR_COOLIX
|
||||||
# define IR_Whynter
|
# define IR_Whynter
|
||||||
|
|||||||
+1
-1
@@ -70,7 +70,7 @@ pubsubclient = PubSubClient@2.8
|
|||||||
rc-switch = 1technophile/rc-switch#90adb34
|
rc-switch = 1technophile/rc-switch#90adb34
|
||||||
newremoteswitch = 1technophile/NewRemoteSwitch#8eb980e
|
newremoteswitch = 1technophile/NewRemoteSwitch#8eb980e
|
||||||
ble = eos1d3/ESP32_BLE#9d6c1ed
|
ble = eos1d3/ESP32_BLE#9d6c1ed
|
||||||
irremoteesp = IRremoteESP8266@2.7.0
|
irremoteesp = IRremoteESP8266@2.7.7
|
||||||
irremote = IRremote
|
irremote = IRremote
|
||||||
lora = sandeepmistry/arduino-LoRa#f4a1d27
|
lora = sandeepmistry/arduino-LoRa#f4a1d27
|
||||||
esppilight = ESPiLight@0.16.2
|
esppilight = ESPiLight@0.16.2
|
||||||
|
|||||||
Reference in new issue
Block a user