From 186d1cc4781ddddfad8c880189c4ab02ea8d8baf Mon Sep 17 00:00:00 2001 From: 1technophile Date: Sat, 20 May 2017 14:42:15 +0200 Subject: [PATCH] Program size optimization for arduino uno --- OpenMQTTGateway.ino | 6 +++--- User_config.h | 4 ++-- ZgatewayIR.ino | 6 +++--- ZgatewayRF.ino | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/OpenMQTTGateway.ino b/OpenMQTTGateway.ino index ab5c47d..d6c2e22 100644 --- a/OpenMQTTGateway.ino +++ b/OpenMQTTGateway.ino @@ -191,18 +191,18 @@ void loop() #ifdef ZgatewayRF boolean resultRF = RFtoMQTT(); if(resultRF) - trc(F("RF successfully sent by MQTT")); + trc(F("RF sent by MQTT")); #endif #ifdef ZgatewayIR boolean resultIR = IRtoMQTT(); if(resultIR) - trc(F("IR successfully sent by MQTT")); + trc(F("IR sent by MQTT")); delay(100); #endif #ifdef ZgatewayBT boolean resultBT = BTtoMQTT(); if(resultBT) - trc(F("BT successfully sent by MQTT")); + trc(F("BT sent by MQTT")); #endif } diff --git a/User_config.h b/User_config.h index 7821e1b..19f7fdf 100644 --- a/User_config.h +++ b/User_config.h @@ -79,7 +79,7 @@ const byte subnet[] = { 255, 255, 255, 0 }; //ip adress #define subjectRFtoMQTTbits "home/433toMQTT/bits" #define subjectRFtoMQTTlength "home/433toMQTT/length" #define RFprotocolKey "433_" // protocol will be defined if a subject contains RFprotocolKey followed by a value of 1 digit -#define repeatRFwMQTT true // do we repeat a received signal by using mqtt +#define repeatRFwMQTT false // do we repeat a received signal by using mqtt /* RF supported protocols 433_1 @@ -104,7 +104,7 @@ RF supported protocols #define subjectMultiGTWIR "+/IRtoMQTT" #define IRbitsKey "BITS_" // 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 true // do we repeat a received signal by using mqtt +#define repeatIRwMQTT false // do we repeat a received signal by using mqtt #define pubIRunknownPrtcl false // key to avoid mqtt publication of unknown IR protocol (set to true if you want to publish unknown protocol) diff --git a/ZgatewayIR.ino b/ZgatewayIR.ino index e69b631..aaf9304 100644 --- a/ZgatewayIR.ino +++ b/ZgatewayIR.ino @@ -60,7 +60,7 @@ boolean IRtoMQTT(){ if (pubIRunknownPrtcl == false && MQTTprotocol == "-1"){ // don't publish unknown IR protocol trc(F("--------------don't publish the received code unknown protocol--------------")); } else if (!isAduplicate(MQTTvalue) && MQTTvalue!=0) {// conditions to avoid duplications of RF -->MQTT - trc(F("Sending advanced data to MQTT")); + trc(F("Sending adv data to MQTT")); client.publish(subjectIRtoMQTTprotocol,(char *)MQTTprotocol.c_str()); client.publish(subjectIRtoMQTTbits,(char *)MQTTbits.c_str()); trc(F("Sending IR to MQTT")); @@ -68,7 +68,7 @@ boolean IRtoMQTT(){ trc(value); boolean result = client.publish(subjectIRtoMQTT,(char *)value.c_str()); if (repeatIRwMQTT){ - trc(F("Publishing IR signal so as to make the gateway(s) repeat it")); + trc(F("Publishing IR signal so as to repeat it")); client.publish(subjectMQTTtoIR,(char *)value.c_str()); } return result; @@ -231,7 +231,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 boolean result = client.publish(subjectGTWIRtoMQTT, datacallback); if (result){ - trc(F("Signal below sent by IR and acknowledgment published")); + trc(F("Signal sent by IR and ack published")); trc(String(data)); }; } diff --git a/ZgatewayRF.ino b/ZgatewayRF.ino index b2b46a4..fd75d90 100644 --- a/ZgatewayRF.ino +++ b/ZgatewayRF.ino @@ -59,7 +59,7 @@ boolean RFtoMQTT(){ trc(value); boolean result = client.publish(subjectRFtoMQTT,(char *)value.c_str()); if (repeatRFwMQTT){ - trc(F("Publishing IR signal so as to make the gateway(s) repeat it")); + trc(F("Publishing IR signal so as to repeat it")); client.publish(subjectMQTTtoRF,(char *)value.c_str()); } return result; @@ -99,10 +99,10 @@ void MQTTtoRF(char * topicOri, char * datacallback) { mySwitch.send(data, 24); // Acknowledgement to the GTWRF topic boolean result = client.publish(subjectGTWRFtoMQTT, datacallback); - if (result)trc(F("Acknowedgement of reception published")); + if (result)trc(F("Ack of reception published")); } else if ((valuePRT != 0) || (valuePLSL != 0)){ - trc(F("Sending data by RF, user defined parameters")); + trc(F("Sending data by RF, MQTT parameters")); if (valuePRT == 0) valuePRT = 1; if (valuePLSL == 0) valuePLSL = 350; trc(String(valuePRT)); @@ -112,7 +112,7 @@ void MQTTtoRF(char * topicOri, char * datacallback) { // Acknowledgement to the GTWRF topic boolean result = client.publish(subjectGTWRFtoMQTT, datacallback);// 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 (result){ - trc(F("Signal below sent by RF and acknowledgment published")); + trc(F("Signal sent by RF and ack published")); trc(String(data)); }; }