Skip to content

Commit 7382e19

Browse files
committed
decrease code size again
1 parent 77aff42 commit 7382e19

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

OpenMQTTGateway.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ boolean reconnect() {
7676
#else
7777
if (client.connect(Gateway_Name, will_Topic, will_QoS, will_Retain, will_Message)) {
7878
#endif
79-
trc(F("connected to MQTT broker"));
79+
trc(F("connected to broker"));
8080
// Once connected, publish an announcement...
8181
client.publish(will_Topic,Gateway_AnnouncementMsg,will_Retain);
8282
//Subscribing to topic
@@ -86,7 +86,7 @@ boolean reconnect() {
8686
} else {
8787
trc(F("failed, rc="));
8888
trc(String(client.state()));
89-
trc(F(" try again in 5 seconds"));
89+
trc(F("try again in 5s"));
9090
// Wait 5 seconds before retrying
9191
delay(5000);
9292
}
@@ -217,14 +217,14 @@ void storeValue(long MQTTvalue){
217217
unsigned long now = millis();
218218
// find oldest value of the buffer
219219
int o = getMin();
220-
trc(F("Minimum index: "));
220+
trc(F("Min index: "));
221221
trc(String(o));
222222
// replace it by the new one
223223
ReceivedSignal[o][0] = MQTTvalue;
224224
ReceivedSignal[o][1] = now;
225-
trc(F("store this code :"));
225+
trc(F("store code :"));
226226
trc(String(ReceivedSignal[o][0])+"/"+String(ReceivedSignal[o][1]));
227-
trc(F("Col: value/timestamp"));
227+
trc(F("Col: val/timestamp"));
228228
for (int i = 0; i < array_size; i++)
229229
{
230230
trc(String(i) + ":" + String(ReceivedSignal[i][0])+"/"+String(ReceivedSignal[i][1]));
@@ -251,7 +251,7 @@ for (int i = 0; i < array_size;i++){
251251
if (ReceivedSignal[i][0] == value){
252252
unsigned long now = millis();
253253
if (now - ReceivedSignal[i][1] < time_avoid_duplicate){ // change
254-
trc(F("--------------don't publish the received code duplicate--------------"));
254+
trc(F("---don't publish the code duplicate---"));
255255
return true;
256256
}
257257
}

ZgatewayIR.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ boolean IRtoMQTT(){
6767
trc(rawCode);
6868
irrecv.resume(); // Receive the next value
6969
if (pubIRunknownPrtcl == false && MQTTprotocol == "-1"){ // don't publish unknown IR protocol
70-
trc(F("---don't publish the received code unknown protocol---"));
70+
trc(F("---don't publish the code unknown protocol---"));
7171
} else if (!isAduplicate(MQTTvalue) && MQTTvalue!=0) {// conditions to avoid duplications of RF -->MQTT
7272
trc(F("Sending adv data to MQTT"));
7373
client.publish(subjectIRtoMQTTprotocol,(char *)MQTTprotocol.c_str());
7474
client.publish(subjectIRtoMQTTbits,(char *)MQTTbits.c_str());
7575
client.publish(subjectIRtoMQTTRaw,(char *)rawCode.c_str());
76-
trc(F("Sending IR to MQTT"));
76+
trc(F("Sending IRtoMQTT"));
7777
String value = String(MQTTvalue);
7878
trc(value);
7979
boolean result = client.publish(subjectIRtoMQTT,(char *)value.c_str());

ZgatewayRF.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ boolean RFtoMQTT(){
5858
client.publish(subjectRFtoMQTTprotocol,(char *)MQTTprotocol.c_str());
5959
client.publish(subjectRFtoMQTTbits,(char *)MQTTbits.c_str());
6060
client.publish(subjectRFtoMQTTlength,(char *)MQTTlength.c_str());
61-
trc(F("Sending RF to MQTT"));
61+
trc(F("Sending RFtoMQTT"));
6262
String value = String(MQTTvalue);
6363
trc(value);
6464
boolean result = client.publish(subjectRFtoMQTT,(char *)value.c_str());
@@ -106,15 +106,15 @@ void MQTTtoRF(char * topicOri, char * datacallback) {
106106
}
107107

108108
if ((topic == subjectMQTTtoRF) && (valuePRT == 0) && (valuePLSL == 0) && (valueBITS == 0)){
109-
trc(F("Sending data by RF, default parameters"));
109+
trc(F("MQTTtoRF default parameters"));
110110
mySwitch.setProtocol(1,350);
111111
mySwitch.send(data, 24);
112112
// Acknowledgement to the GTWRF topic
113113
boolean result = client.publish(subjectGTWRFtoMQTT, datacallback);
114-
if (result)trc(F("Ack of reception published"));
114+
if (result)trc(F("Ack published"));
115115

116116
} else if ((valuePRT != 0) || (valuePLSL != 0)|| (valueBITS != 0)){
117-
trc(F("Sending data by RF, MQTT parameters"));
117+
trc(F("MQTTtoRF user parameters"));
118118
if (valuePRT == 0) valuePRT = 1;
119119
if (valuePLSL == 0) valuePLSL = 350;
120120
if (valueBITS == 0) valueBITS = 24;
@@ -126,7 +126,7 @@ void MQTTtoRF(char * topicOri, char * datacallback) {
126126
// Acknowledgement to the GTWRF topic
127127
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
128128
if (result){
129-
trc(F("Signal sent by RF and ack published"));
129+
trc(F("MQTTtoRF OK and ack published"));
130130
trc(String(data));
131131
};
132132
}

0 commit comments

Comments
 (0)