Skip to content

Commit

Permalink
BugFix parsing network
Browse files Browse the repository at this point in the history
  • Loading branch information
totetmatt committed Oct 8, 2024
1 parent ee6dbac commit e6dcc47
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/platform_common/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,19 @@ namespace Network {
}

const char* mode = network->get<jsonxx::String>("networkMode").c_str();
bool isSenderMode = strcmp(mode, "sender");
bool isGrabberMode = strcmp(mode, "grabber");
bool isSenderMode = strcmp(mode, "sender") == 0;
bool isGrabberMode = strcmp(mode, "grabber") == 0;
if (!isSenderMode && !isGrabberMode) {
LOG("JSON Network Configuration Parsing", "networkMode is neither SENDER or GRABBER, fallback config to OFFLINE");
config.Mode = OFFLINE;
return;
}
if(isSenderMode){
LOG("JSON Network Configuration Parsing", "networkMode is set to SENDER");
config.Mode = SENDER;
}
if(isGrabberMode){
LOG("JSON Network Configuration Parsing", "networkMode is set to GRABBER");
config.Mode = GRABBER;
}

Expand Down

0 comments on commit e6dcc47

Please sign in to comment.