Skip to content

Commit 2fcfe6d

Browse files
committed
added further output for verbose mode
1 parent 5bcbc71 commit 2fcfe6d

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

sfeIoTNodeLoRaWAN/flxLoRaWANDigi.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,27 +72,32 @@ static void OnSendCallback(void *data)
7272

7373
if (flxIsLoggingVerbose())
7474
{
75-
if (packet->status == 0 && packet->payloadSize > 0)
75+
if (packet->status == 0)
7676
{
77-
flxLog_V_(F("[LoRaWAN]Sent Packet: {"));
77+
flxLog_V_(F("[LoRaWAN][OnSendCallback] "));
7878

79-
for (int i = 0; i < packet->payloadSize; i++)
80-
flxLog_N_(F("0x%02X "), packet->payload[i]);
79+
if (packet->payloadSize > 0)
80+
{
81+
flxLog_N_(F("Packet: {"));
82+
for (int i = 0; i < packet->payloadSize; i++)
83+
flxLog_N_(F("0x%02X "), packet->payload[i]);
84+
flxLog_N_(F("}"));
85+
}
8186

82-
flxLog_N(F("} Ack: %u Port: %u RSSI: %d SNR: %d Downlink Counter: %u"), packet->ack, packet->port,
87+
flxLog_N(F("Ack: %u Port: %u RSSI: %d SNR: %d Downlink Counter: %u"), packet->ack, packet->port,
8388
packet->rssi, packet->snr, packet->counter);
8489
}
85-
else if (packet->status != 0)
90+
else
8691
{
87-
8892
flxLog_W_(F("[LoRaWAN] Data send failed. Frame ID: 0x%X Reason: "), packet->frameId);
93+
8994
switch (packet->status)
9095
{
9196
case 0x01:
9297
flxLog_N(F("ACK Failed"));
9398
break;
9499
case 0x022:
95-
flxLog_N(F("Not Connected)"));
100+
flxLog_N(F("Not Connected"));
96101
break;
97102
default:
98103
flxLog_N_(F("code 0x%X"), packet->status);

0 commit comments

Comments
 (0)