Skip to content

Commit e0fc757

Browse files
committed
[LoRaWAN] Improve logging
1 parent e8a4d79 commit e0fc757

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/protocols/LoRaWAN/LoRaWAN.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,7 @@ int16_t LoRaWANNode::transmitUplink(const LoRaWANChannel_t* chnl, uint8_t* in, u
14511451

14521452
// set the timestamp so that we can measure when to start receiving
14531453
this->tUplinkEnd = mod->hal->millis();
1454-
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Uplink sent <-- Rx Delay start");
1454+
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Uplink sent (ToA = %d ms)", toa);
14551455

14561456
// increase Time on Air of the uplink sequence
14571457
this->lastToA += toa;
@@ -1532,14 +1532,14 @@ int16_t LoRaWANNode::receiveClassA(uint8_t dir, const LoRaWANChannel_t* dlChanne
15321532
state = this->phyLayer->launchMode();
15331533
RadioLibTime_t tOpen = mod->hal->millis();
15341534
RADIOLIB_ASSERT(state);
1535-
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Opened Rx%d window (%d ms timeout)... <-- Rx Delay end ", window, (int)(timeoutUs / 1000 + 2));
1535+
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Rx%d window open (%lu + %lu ms)", window, timeoutUs / 1000UL, this->scanGuard);
15361536

15371537
// sleep for the duration of the padded Rx window
15381538
this->sleepDelay(timeoutUs / 1000, false);
15391539

15401540
// wait for the DIO interrupt to fire (RxDone or RxTimeout)
15411541
// use a small additional delay in case the RxTimeout interrupt is slow to fire
1542-
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Closing Rx%d window", window);
1542+
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Rx%d window closing", window);
15431543
while(!downlinkAction && mod->hal->millis() - tOpen <= timeoutUs / 1000 + this->scanGuard) {
15441544
mod->hal->yield();
15451545
}
@@ -3187,8 +3187,8 @@ int16_t LoRaWANNode::setPhyProperties(const LoRaWANChannel_t* chnl, uint8_t dir,
31873187
state = this->phyLayer->setDataRate(*dr, this->band->dataRates[chnl->dr].modem);
31883188
RADIOLIB_ASSERT(state);
31893189

3190-
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("");
3191-
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("PHY: Frequency = %7.3f MHz, TX = %d dBm", chnl->freq / 10000.0, pwr);
3190+
RADIOLIB_DEBUG_PROTOCOL_PRINTLN_NOTAG("");
3191+
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Frequency = %7.3f MHz, TX = %d dBm", chnl->freq / 10000.0, pwr);
31923192
state = this->phyLayer->setFrequency(chnl->freq / 10000.0);
31933193
RADIOLIB_ASSERT(state);
31943194

@@ -3215,7 +3215,7 @@ int16_t LoRaWANNode::setPhyProperties(const LoRaWANChannel_t* chnl, uint8_t dir,
32153215
syncWord[1] = (uint8_t)(RADIOLIB_LORAWAN_GFSK_SYNC_WORD >> 8);
32163216
syncWord[2] = (uint8_t)RADIOLIB_LORAWAN_GFSK_SYNC_WORD;
32173217
syncWordLen = 3;
3218-
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("FSK: BR = %4.1f, FD = %4.1f kHz",
3218+
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("[FSK] BR = %4.1f, FD = %4.1f kHz",
32193219
(double)dr->fsk.bitRate, (double)dr->fsk.freqDev);
32203220
} break;
32213221

@@ -3231,7 +3231,7 @@ int16_t LoRaWANNode::setPhyProperties(const LoRaWANChannel_t* chnl, uint8_t dir,
32313231

32323232
syncWord[0] = RADIOLIB_LORAWAN_LORA_SYNC_WORD;
32333233
syncWordLen = 1;
3234-
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("LoRa: SF = %d, BW = %5.1f kHz, CR = 4/%d, IQ: %c",
3234+
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("[LoRa] SF = %d, BW = %5.1f kHz, CR = 4/%d, IQ: %c",
32353235
dr->lora.spreadingFactor, (double)dr->lora.bandwidth, dr->lora.codingRate, dir ? 'D' : 'U');
32363236
} break;
32373237

@@ -3241,7 +3241,7 @@ int16_t LoRaWANNode::setPhyProperties(const LoRaWANChannel_t* chnl, uint8_t dir,
32413241
syncWord[2] = (uint8_t)(RADIOLIB_LORAWAN_LR_FHSS_SYNC_WORD >> 8);
32423242
syncWord[3] = (uint8_t)RADIOLIB_LORAWAN_LR_FHSS_SYNC_WORD;
32433243
syncWordLen = 4;
3244-
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("LR-FHSS: BW = 0x%02x, CR = 0x%02x kHz, grid = %c",
3244+
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("[LR-FHSS] BW = 0x%02x, CR = 0x%02x kHz, grid = %c",
32453245
dr->lrFhss.bw, dr->lrFhss.cr, dr->lrFhss.narrowGrid ? 'N' : 'W');
32463246
} break;
32473247

0 commit comments

Comments
 (0)