code size decrease

This commit is contained in:
1technophile committed 2017-06-02 23:44:53 +02:00
1 parent 9481bcd868
commit 77aff42a27
2 files changed
+5 -5

No files matched your search

+4 -4
View File
@@ -51,7 +51,7 @@ boolean IRtoMQTT(){
decode_results results; decode_results results;
if (irrecv.decode(&results)){ if (irrecv.decode(&results)){
trc(F("Receiving IR signal")); trc(F("Receiving IR"));
unsigned long MQTTvalue = 0; unsigned long MQTTvalue = 0;
String MQTTprotocol; String MQTTprotocol;
String MQTTbits; String MQTTbits;
@@ -67,7 +67,7 @@ boolean IRtoMQTT(){
trc(rawCode); trc(rawCode);
irrecv.resume(); // Receive the next value irrecv.resume(); // Receive the next value
if (pubIRunknownPrtcl == false && MQTTprotocol == "-1"){ // don't publish unknown IR protocol if (pubIRunknownPrtcl == false && MQTTprotocol == "-1"){ // don't publish unknown IR protocol
trc(F("--------------don't publish the received code unknown protocol--------------")); trc(F("---don't publish the received code unknown protocol---"));
} else if (!isAduplicate(MQTTvalue) && MQTTvalue!=0) {// conditions to avoid duplications of RF -->MQTT } else if (!isAduplicate(MQTTvalue) && MQTTvalue!=0) {// conditions to avoid duplications of RF -->MQTT
trc(F("Sending adv data to MQTT")); trc(F("Sending adv data to MQTT"));
client.publish(subjectIRtoMQTTprotocol,(char *)MQTTprotocol.c_str()); client.publish(subjectIRtoMQTTprotocol,(char *)MQTTprotocol.c_str());
@@ -78,7 +78,7 @@ boolean IRtoMQTT(){
trc(value); trc(value);
boolean result = client.publish(subjectIRtoMQTT,(char *)value.c_str()); boolean result = client.publish(subjectIRtoMQTT,(char *)value.c_str());
if (repeatIRwMQTT){ if (repeatIRwMQTT){
trc(F("Publishing IR signal so as to repeat it")); trc(F("Publishing IR so as to repeat it"));
client.publish(subjectMQTTtoIR,(char *)value.c_str()); client.publish(subjectMQTTtoIR,(char *)value.c_str());
} }
return result; return result;
@@ -241,7 +241,7 @@ void MQTTtoIR(char * topicOri, char * datacallback) {
if (signalSent){ // we acknowledge the sending by publishing the value to an acknowledgement topic, for the moment even if it is a signal repetition we acknowledge also if (signalSent){ // we acknowledge the sending by publishing the value to an acknowledgement topic, for the moment even if it is a signal repetition we acknowledge also
boolean result = client.publish(subjectGTWIRtoMQTT, datacallback); boolean result = client.publish(subjectGTWIRtoMQTT, datacallback);
if (result){ if (result){
trc(F("Signal sent by IR and ack published")); trc(F("Signal sent by IR ack published"));
trc(String(data)); trc(String(data));
}; };
} }
+1 -1
View File
@@ -43,7 +43,7 @@ void setupRF(){
boolean RFtoMQTT(){ boolean RFtoMQTT(){
if (mySwitch.available()){ if (mySwitch.available()){
trc(F("Receiving 433Mhz signal")); trc(F("Receiving 433Mhz"));
unsigned long MQTTvalue = 0; unsigned long MQTTvalue = 0;
String MQTTprotocol; String MQTTprotocol;
String MQTTbits; String MQTTbits;