Skip to content

Commit dd1867f

Browse files
committed
Put SBB3 debugging prints behind settings.
1 parent 4a39ec6 commit dd1867f

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

SerialPrograms/Source/CommonFramework/Globals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace PokemonAutomation{
2626
const bool IS_BETA_VERSION = true;
2727
const int PROGRAM_VERSION_MAJOR = 0;
2828
const int PROGRAM_VERSION_MINOR = 54;
29-
const int PROGRAM_VERSION_PATCH = 23;
29+
const int PROGRAM_VERSION_PATCH = 25;
3030

3131
const std::string PROGRAM_VERSION_BASE =
3232
"v" + std::to_string(PROGRAM_VERSION_MAJOR) +

SerialPrograms/Source/NintendoSwitch/Controllers/SysbotBase/SysbotBase_Connection.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
//using std::endl;
1818

1919

20-
2120
namespace PokemonAutomation{
2221
namespace SysbotBase{
2322

@@ -173,6 +172,10 @@ void TcpSysbotBase_Connection::on_connect_finished(const std::string& error_mess
173172
write_data("configure echoCommands 0\r\n");
174173
write_data("getVersion\r\n");
175174

175+
if (NintendoSwitch::ConsoleSettings::instance().ENABLE_SBB3_LOGGING){
176+
write_data("configure enableLogs 1\r\n");
177+
}
178+
176179
// m_thread = std::thread(&TcpSysbotBase_Connection::thread_loop, this);
177180

178181
// set_status_line0(m_version);
@@ -211,7 +214,9 @@ void TcpSysbotBase_Connection::on_receive_data(const void* data, size_t bytes){
211214
}catch (...){}
212215
}
213216
void TcpSysbotBase_Connection::process_message(const std::string& message, WallClock timestamp){
214-
// cout << "sys-botbase Response: " << message << endl;
217+
if (GlobalSettings::instance().LOG_EVERYTHING){
218+
m_logger.log("Received: " + message, COLOR_DARKGREEN);
219+
}
215220

216221
m_listeners.run_method_unique(&Listener::on_message, message);
217222

SerialPrograms/Source/NintendoSwitch/NintendoSwitch_Settings.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ ConsoleSettings::ConsoleSettings()
108108
"<b>Enable sys-botbase 3 Pings:</b><br>"
109109
"Use sys-botbase's ping command for latency measurement instead of \"getVersion\".",
110110
LockMode::UNLOCK_WHILE_RUNNING,
111+
true
112+
)
113+
, ENABLE_SBB3_LOGGING(
114+
"<b>Enable sys-botbase 3 Logging:</b><br>"
115+
"Tell sys-botbase 3 to log its activity to its own log.",
116+
LockMode::UNLOCK_WHILE_RUNNING,
111117
false
112118
)
113119
, SWITCH1_DIGIT_ENTRY(false)
@@ -126,6 +132,7 @@ ConsoleSettings::ConsoleSettings()
126132
PA_ADD_OPTION(TIMING_OPTIONS);
127133
if (PreloadSettings::instance().DEVELOPER_MODE){
128134
PA_ADD_OPTION(ENABLE_SBB3_PINGS);
135+
PA_ADD_OPTION(ENABLE_SBB3_LOGGING);
129136
PA_ADD_OPTION(SWITCH1_DIGIT_ENTRY);
130137
PA_ADD_OPTION(SWITCH1_KEYBOARD_ENTRY);
131138
PA_ADD_OPTION(SWITCH2_DIGIT_ENTRY);

SerialPrograms/Source/NintendoSwitch/NintendoSwitch_Settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class ConsoleSettings : public BatchOption{
5252
TimingOptions TIMING_OPTIONS;
5353

5454
BooleanCheckBoxOption ENABLE_SBB3_PINGS;
55+
BooleanCheckBoxOption ENABLE_SBB3_LOGGING;
5556

5657
DigitEntryTimingsOption SWITCH1_DIGIT_ENTRY;
5758
KeyboardEntryTimingsOption SWITCH1_KEYBOARD_ENTRY;

0 commit comments

Comments
 (0)