From d0deb99668e917117fd5642e8a4dff1db85ab46b Mon Sep 17 00:00:00 2001 From: FUJIURA Toyonori Date: Sun, 20 Mar 2022 22:08:20 +0900 Subject: [PATCH] Change logger and correct corrupt source. --- src/TaskBeacon.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/TaskBeacon.cpp b/src/TaskBeacon.cpp index 43ab41c..5e48d72 100644 --- a/src/TaskBeacon.cpp +++ b/src/TaskBeacon.cpp @@ -20,7 +20,7 @@ bool BeaconTask::setup(System &system) { if (system.getBoardConfig()->GpsRx != 0) { ss.begin(9600, SERIAL_8N1, system.getBoardConfig()->GpsTx, system.getBoardConfig()->GpsRx); } else { - logPrintlnD("NO GPS found."); + system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, getName(), "NO GPS found."); gpsok = false; } } @@ -44,12 +44,11 @@ bool BeaconTask::loop(System &system) { } setBeacon(system); -} -uint32_t diff = _beacon_timer.getTriggerTimeInSec(); -_stateInfo = "beacon " + String(uint32_t(diff / 600)) + String(uint32_t(diff / 60) % 10) + ":" + String(uint32_t(diff / 10) % 6) + String(uint32_t(diff % 10)); + uint32_t diff = _beacon_timer.getTriggerTimeInSec(); + _stateInfo = "beacon " + String(uint32_t(diff / 600)) + String(uint32_t(diff / 60) % 10) + ":" + String(uint32_t(diff / 10) % 6) + String(uint32_t(diff % 10)); -return true; + return true; } String create_lat_aprs(double lat) { @@ -96,8 +95,7 @@ void BeaconTask::setBeacon(System &system) { } _beaconMsg->getBody()->setData(String("=") + create_lat_aprs(lat) + "L" + create_long_aprs(lng) + "&" + system.getUserConfig()->beacon.message); - logPrintD("[" + timeString() + "] "); - logPrintlnD(_beaconMsg->encode()); + system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, getName(), "[%s]%s", timeString(), _beaconMsg->encode()); if (system.getUserConfig()->aprs_is.active) _toAprsIs.addElement(_beaconMsg);