Adding LinkWireless::_setLogger(...) and LinkWirelessMultiboot::_setLogger(...) methods

This commit is contained in:
Rodrigo Alfonso
2025-01-12 06:18:35 -03:00
parent 76cc626d27
commit b93b3ce476
3 changed files with 20 additions and 4 deletions

View File

@@ -186,10 +186,7 @@ void MultibootScene::load() {
#endif
#ifdef LINK_RAW_WIRELESS_ENABLE_LOGGING
// TODO: FIX!
linkWirelessMultiboot->linkRawWireless.logger = [](std::string string) {
log(string);
};
linkWirelessMultiboot->_setLogger([](std::string string) { log(string); });
#endif
log("---");

View File

@@ -754,6 +754,15 @@ class LinkWireless {
? 0
: sessionState.outgoingMessages.peek().packetId;
}
#ifdef LINK_RAW_WIRELESS_ENABLE_LOGGING
/**
* @brief Sets a logger function.
* \warning This is internal API!
*/
void _setLogger(LinkRawWireless::Logger logger) {
linkRawWireless.logger = logger;
}
#endif
/**
* @brief This method is called by the VBLANK interrupt handler.

View File

@@ -210,6 +210,16 @@ class LinkWirelessMultiboot {
return success;
}
#ifdef LINK_RAW_WIRELESS_ENABLE_LOGGING
/**
* @brief Sets a logger function.
* \warning This is internal API!
*/
void _setLogger(LinkRawWireless::Logger logger) {
linkRawWireless.logger = logger;
}
#endif
private:
LinkRawWireless linkRawWireless;
LinkWirelessOpenSDK linkWirelessOpenSDK;