Skip to content

Commit dc4cc7b

Browse files
Print status codes in hexadecimal
Since the documentation lists them in hex, this makes it easier to look them up.
1 parent c5ade97 commit dc4cc7b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Printers.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,25 @@ void printHex(Print& p, const uint8_t* buf, size_t len, const __FlashStringHelpe
2525
void printErrorCb(uint8_t code, uintptr_t data) {
2626
Print *p = (Print*)data;
2727
if (!p) return;
28-
p->print(F("Error reading API packet. Error code: "));
29-
p->println(code);
28+
p->print(F("Error reading API packet. Error code: 0x"));
29+
p->println(code, HEX);
3030
}
3131

3232
void printErrorCb(ZBTxStatusResponse& r, uintptr_t data) {
3333
Print *p = (Print*)data;
3434
if (!p) return;
3535
if (!r.isSuccess()) {
36-
p->print(F("Error sending Zigbee packet. Delivery status: "));
37-
p->println(r.getDeliveryStatus());
36+
p->print(F("Error sending Zigbee packet. Delivery status: 0x"));
37+
p->println(r.getDeliveryStatus(), HEX);
3838
}
3939
}
4040

4141
void printErrorCb(TxStatusResponse& r, uintptr_t data) {
4242
Print *p = (Print*)data;
4343
if (!p) return;
4444
if (!r.isSuccess()) {
45-
p->print(F("Error sending packet. Delivery status: "));
46-
p->println(r.getStatus());
45+
p->print(F("Error sending packet. Delivery status: 0x"));
46+
p->println(r.getStatus(), HEX);
4747
}
4848
}
4949

@@ -53,8 +53,8 @@ void printErrorCb(AtCommandResponse& r, uintptr_t data) {
5353
if (!r.isOk()) {
5454
p->print(F("Error sending "));
5555
p->write(r.getCommand(), 2);
56-
p->print(F(" command. Status: "));
57-
p->println(r.getStatus());
56+
p->print(F(" command. Status: 0x"));
57+
p->println(r.getStatus(), HEX);
5858
}
5959
}
6060

@@ -64,8 +64,8 @@ void printErrorCb(RemoteAtCommandResponse& r, uintptr_t data) {
6464
if (!r.isOk()) {
6565
p->print(F("Error sending remote "));
6666
p->write(r.getCommand(), 2);
67-
p->print(F(" command. Status: "));
68-
p->println(r.getStatus());
67+
p->print(F(" command. Status: 0x"));
68+
p->println(r.getStatus(), HEX);
6969
}
7070
}
7171

0 commit comments

Comments
 (0)