Skip to content

Commit a67d75a

Browse files
committed
need to test this
1 parent 98a7c15 commit a67d75a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/utils/logger.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#include "logger.hpp"
2+
#include "comms/comms_layer.hpp"
3+
#include "comms/data/logging_data.hpp"
4+
#include "comms/data/sendable.hpp"
25

36
/// @brief internal buffer with 4kb capacity
47
/// @note will need to change size if we every print more than 4096 characters per loop
@@ -20,6 +23,10 @@ size_t Logger::write(const uint8_t* buffer, size_t size, LogDestination destinat
2023
if (destination == LogDestination::Serial) {
2124
// print to serial monitor
2225
Serial.print(print_statement);
26+
} else if (destination == LogDestination::Comms) {
27+
Comms::Sendable<Comms::LoggingData> logging_sendable;
28+
logging_sendable.data.deserialize(print_statement, size);
29+
logging_sendable.send_to_comms();
2330
}
2431

2532
// sets cursor to current place in memory

0 commit comments

Comments
 (0)