lorawan.cpp code sanitizations

This commit is contained in:
Verkehrsrot 2019-10-10 14:55:51 +02:00
parent 36c178054a
commit 426ab6b260

View File

@ -100,8 +100,8 @@ void lora_setupForNetwork(bool preJoin) {
if (!cfg.adrmode) if (!cfg.adrmode)
LMIC_setDrTxpow(assertDR(cfg.loradr), cfg.txpower); LMIC_setDrTxpow(assertDR(cfg.loradr), cfg.txpower);
// show current devaddr // show current devaddr
ESP_LOGI(TAG, "DEVaddr=%08X", LMIC.devaddr); ESP_LOGI(TAG, "DEVaddr: %08X", LMIC.devaddr);
ESP_LOGI(TAG, "Radio parameters %s / %s / %s", ESP_LOGI(TAG, "Radio parameters: %s / %s / %s",
getSfName(updr2rps(LMIC.datarate)), getSfName(updr2rps(LMIC.datarate)),
getBwName(updr2rps(LMIC.datarate)), getBwName(updr2rps(LMIC.datarate)),
getCrName(updr2rps(LMIC.datarate))); getCrName(updr2rps(LMIC.datarate)));
@ -309,7 +309,7 @@ esp_err_t lora_stack_init() {
&lmicTask, // task handle &lmicTask, // task handle
1); // CPU core 1); // CPU core
// start joining // start join
if (!LMIC_startJoining()) if (!LMIC_startJoining())
ESP_LOGI(TAG, "Already joined"); ESP_LOGI(TAG, "Already joined");
@ -408,11 +408,10 @@ void lmictask(void *pvParameters) {
// setup LMIC stack // setup LMIC stack
os_init(); // initialize lmic run-time environment os_init(); // initialize lmic run-time environment
// os_init_ex(pPinMap);
// register a callback for downlink messages. We aren't trying to write // register a callback for downlink messages and lmic events.
// reentrant code, so pUserData is NULL. LMIC_reset() doesn't affect // We aren't trying to write reentrant code, so pUserData is NULL.
// callbacks, so we can do this first. // LMIC_reset() doesn't affect callbacks, so we can do this first.
LMIC_registerRxMessageCb(myRxCallback, NULL); LMIC_registerRxMessageCb(myRxCallback, NULL);
LMIC_registerEventCb(myEventCallback, NULL); LMIC_registerEventCb(myEventCallback, NULL);
@ -531,7 +530,7 @@ void myEventCallback(void *pUserData, ev_t ev) {
// Log & Display if asked // Log & Display if asked
if (*buff) { if (*buff) {
ESP_LOGI(TAG, "%s", buff); ESP_LOGD(TAG, "%s", buff);
sprintf(lmic_event_msg, buff); sprintf(lmic_event_msg, buff);
} }
} }