Skip to content

Commit 4739e4d

Browse files
committed
Fix build. Shorten output window.
1 parent 4334ba7 commit 4739e4d

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

ClientSource/Connection/MessageLogger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void MessageLogger::on_recv(const BotBaseMessage& message){
8484
SerialLogger::SerialLogger(Logger& logger, bool log_everything)
8585
: MessageLogger(log_everything)
8686
, m_logger(logger)
87-
, m_history(1000)
87+
, m_history(200)
8888
{}
8989
void SerialLogger::log(const char* msg, Color color){
9090
if (ok_to_log()){

ClientSource/Libraries/MessageConverter.cpp

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -341,18 +341,6 @@ int register_message_converters_framework_requests(){
341341
}
342342
);
343343
#if 0
344-
register_message_converter(
345-
PABB_MSG_COMMAND_END_PROGRAM_CALLBACK,
346-
[](const std::string& body){
347-
std::ostringstream ss;
348-
ss << "end_program_callback() - ";
349-
if (body.size() != sizeof(pabb_end_program_callback)){ ss << "(invalid size)" << std::endl; return ss.str(); }
350-
const auto* params = (const pabb_end_program_callback*)body.c_str();
351-
ss << "seqnum = " << (uint64_t)params->seqnum;
352-
return ss.str();
353-
}
354-
);
355-
#endif
356344
register_message_converter(
357345
PABB_MSG_COMMAND_SET_LED_STATE,
358346
[](const std::string& body){
@@ -365,6 +353,7 @@ int register_message_converters_framework_requests(){
365353
return ss.str();
366354
}
367355
);
356+
#endif
368357
return 0;
369358
}
370359
int register_message_converters_custom_info(){
@@ -375,14 +364,14 @@ int register_message_converters_custom_info(){
375364
ss << "PABB_MSG_INFO_I32 - ";
376365
if (body.size() != sizeof(pabb_MsgInfoI32)){ ss << "(invalid size)" << std::endl; return ss.str(); }
377366
const auto* params = (const pabb_MsgInfoI32*)body.c_str();
378-
switch (params->tag){
379-
case PABB_MSG_INFO_I32_TAG_SCHEDULE_THROTTLED:
380-
ss << "Command schedule throttled by: " << params->data;
381-
break;
382-
default:
367+
// switch (params->tag){
368+
// case PABB_MSG_INFO_I32_TAG_SCHEDULE_THROTTLED:
369+
// ss << "Command schedule throttled by: " << params->data;
370+
// break;
371+
// default:
383372
ss << "tag = " << (unsigned)params->tag;
384373
ss << ", data = " << params->data;
385-
}
374+
// }
386375
return ss.str();
387376
}
388377
);
@@ -418,14 +407,30 @@ int register_message_converters_custom_info(){
418407
std::ostringstream ss;
419408
ss << "PABB_MSG_INFO_I32_LABEL - ";
420409
if (body.size() < sizeof(uint32_t)){
421-
ss << "(invalid size)" << std::endl; return ss.str();
410+
ss << "(invalid size)" << std::endl;
411+
return ss.str();
422412
}
423413
const auto* params = (const pabb_MsgInfoI32Label*)body.c_str();
424414
ss << std::string(body.data() + sizeof(uint32_t), body.size() - sizeof(uint32_t));
425415
ss << ": " << params->value;
426416
return ss.str();
427417
}
428418
);
419+
register_message_converter(
420+
PABB_MSG_INFO_H32_LABEL,
421+
[](const std::string& body){
422+
std::ostringstream ss;
423+
ss << "PABB_MSG_INFO_I32_LABEL - ";
424+
if (body.size() < sizeof(uint32_t)){
425+
ss << "(invalid size)" << std::endl;
426+
return ss.str();
427+
}
428+
const auto* params = (const pabb_MsgInfoI32Label*)body.c_str();
429+
ss << std::string(body.data() + sizeof(uint32_t), body.size() - sizeof(uint32_t));
430+
ss << ": 0x" << std::hex << params->value;
431+
return ss.str();
432+
}
433+
);
429434
return 0;
430435
}
431436

0 commit comments

Comments
 (0)