Skip to content

Commit bf1c8f8

Browse files
Slightly modify the print callbacks' messages
Now that these callbacks can also be called directly, printing "XXXResponse received" can be confusing, since it might not necessarily be printing a response that was just received.
1 parent 7cf91b5 commit bf1c8f8

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Printers.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void printErrorCb(XBeeResponse& r, uintptr_t data) {
9090

9191
void printRawResponseCb(XBeeResponse& response, uintptr_t data) {
9292
Print *p = (Print*)data;
93-
p->print("Response received: ");
93+
p->print("Response: ");
9494
// Reconstruct the original packet
9595
uint8_t header[] = {START_BYTE, response.getMsbLength(), response.getLsbLength(), response.getApiId()};
9696
printHex(*p, header, sizeof(header), F(" "), NULL);
@@ -114,7 +114,7 @@ static void printField(Print* p, const __FlashStringHelper *prefix, T data) {
114114

115115
void printResponseCb(ZBTxStatusResponse& status, uintptr_t data) {
116116
Print *p = (Print*)data;
117-
p->println(F("ZBTxStatusResponse received:"));
117+
p->println(F("ZBTxStatusResponse:"));
118118
printField(p, F(" FrameId: 0x"), status.getFrameId());
119119
printField(p, F(" To: 0x"), status.getRemoteAddress());
120120
printField(p, F(" Delivery status: 0x"), status.getDeliveryStatus());
@@ -123,7 +123,7 @@ void printResponseCb(ZBTxStatusResponse& status, uintptr_t data) {
123123

124124
void printResponseCb(ZBRxResponse& rx, uintptr_t data) {
125125
Print *p = (Print*)data;
126-
p->println(F("ZBRxResponse received:"));
126+
p->println(F("ZBRxResponse:"));
127127
printField(p, F(" From: 0x"), rx.getRemoteAddress64());
128128
printField(p, F(" From: 0x"), rx.getRemoteAddress16());
129129
printField(p, F(" Receive options: 0x"), rx.getOption());
@@ -137,7 +137,7 @@ void printResponseCb(ZBRxResponse& rx, uintptr_t data) {
137137

138138
void printResponseCb(ZBExplicitRxResponse& rx, uintptr_t data) {
139139
Print *p = (Print*)data;
140-
p->println(F("ZBExplicitRxResponse received:"));
140+
p->println(F("ZBExplicitRxResponse:"));
141141
printField(p, F(" From: 0x"), rx.getRemoteAddress64());
142142
printField(p, F(" From: 0x"), rx.getRemoteAddress16());
143143
printField(p, F(" Receive options: 0x"), rx.getOption());
@@ -155,7 +155,7 @@ void printResponseCb(ZBExplicitRxResponse& rx, uintptr_t data) {
155155

156156
void printResponseCb(ZBRxIoSampleResponse& rx, uintptr_t data) {
157157
Print *p = (Print*)data;
158-
p->println(F("ZBRxIoSampleResponse received:"));
158+
p->println(F("ZBRxIoSampleResponse:"));
159159
printField(p, F(" From: 0x"), rx.getRemoteAddress64());
160160
printField(p, F(" From: 0x"), rx.getRemoteAddress16());
161161
printField(p, F(" Receive options: 0x"), rx.getOption());
@@ -181,14 +181,14 @@ void printResponseCb(ZBRxIoSampleResponse& rx, uintptr_t data) {
181181

182182
void printResponseCb(TxStatusResponse& status, uintptr_t data) {
183183
Print *p = (Print*)data;
184-
p->println(F("TxStatusResponse received:"));
184+
p->println(F("TxStatusResponse:"));
185185
printField(p, F(" FrameId: 0x"), status.getFrameId());
186186
printField(p, F(" Status: 0x"), status.getStatus());
187187
}
188188

189189
void printResponseCb(Rx16Response& rx, uintptr_t data) {
190190
Print *p = (Print*)data;
191-
p->println("Rx16Response received:");
191+
p->println("Rx16Response:");
192192
printField(p, F(" From: 0x"), rx.getRemoteAddress16());
193193
printField(p, F(" Rssi: 0x"), rx.getRssi());
194194
printField(p, F(" Receive options: 0x"), rx.getOption());
@@ -202,7 +202,7 @@ void printResponseCb(Rx16Response& rx, uintptr_t data) {
202202

203203
void printResponseCb(Rx64Response& rx, uintptr_t data) {
204204
Print *p = (Print*)data;
205-
p->println("Rx64Response received:");
205+
p->println("Rx64Response:");
206206
printField(p, F(" From: 0x"), rx.getRemoteAddress64());
207207
printField(p, F(" Rssi: 0x"), rx.getRssi());
208208
printField(p, F(" Receive options: 0x"), rx.getOption());
@@ -247,7 +247,7 @@ static void printSamples(Print* p, RxIoSampleBaseResponse& rx) {
247247

248248
void printResponseCb(Rx16IoSampleResponse& rx, uintptr_t data) {
249249
Print *p = (Print*)data;
250-
p->println("Rx16IoSampleResponse received:");
250+
p->println("Rx16IoSampleResponse:");
251251
printField(p, F(" From: 0x"), rx.getRemoteAddress16());
252252
printField(p, F(" Rssi: 0x"), rx.getRssi());
253253
printField(p, F(" Receive options: 0x"), rx.getOption());
@@ -257,7 +257,7 @@ void printResponseCb(Rx16IoSampleResponse& rx, uintptr_t data) {
257257

258258
void printResponseCb(Rx64IoSampleResponse& rx, uintptr_t data) {
259259
Print *p = (Print*)data;
260-
p->println("Rx64IoSampleResponse received:");
260+
p->println("Rx64IoSampleResponse:");
261261
printField(p, F(" From: 0x"), rx.getRemoteAddress64());
262262
printField(p, F(" Rssi: 0x"), rx.getRssi());
263263
printField(p, F(" Receive options: 0x"), rx.getOption());
@@ -267,13 +267,13 @@ void printResponseCb(Rx64IoSampleResponse& rx, uintptr_t data) {
267267

268268
void printResponseCb(ModemStatusResponse& status, uintptr_t data) {
269269
Print *p = (Print*)data;
270-
p->println("ModemStatusResponse received:");
270+
p->println("ModemStatusResponse:");
271271
printField(p, F(" Status: 0x"), status.getStatus());
272272
}
273273

274274
void printResponseCb(AtCommandResponse& at, uintptr_t data) {
275275
Print *p = (Print*)data;
276-
p->println("AtCommandResponse received:");
276+
p->println("AtCommandResponse:");
277277
p->print(F(" Command: "));
278278
p->write(at.getCommand(), 2);
279279
p->println();
@@ -287,7 +287,7 @@ void printResponseCb(AtCommandResponse& at, uintptr_t data) {
287287

288288
void printResponseCb(RemoteAtCommandResponse& at, uintptr_t data) {
289289
Print *p = (Print*)data;
290-
p->println("AtRemoteCommandResponse received:");
290+
p->println("AtRemoteCommandResponse:");
291291
printField(p, F(" To: 0x"), at.getRemoteAddress64());
292292
printField(p, F(" To: 0x"), at.getRemoteAddress16());
293293
p->print(F(" Command: "));

0 commit comments

Comments
 (0)