Skip to content

Commit

Permalink
Merge pull request #445 from openxc/modem_configuration
Browse files Browse the repository at this point in the history
Change the json.cpp to correctly send modem_configuration command.  A…
  • Loading branch information
jstoke53 committed Mar 24, 2020
2 parents 0e1daee + ea028cc commit b738b6b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/payload/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,19 +448,19 @@ static void deserializeModemConfiguration(cJSON* root, openxc_ControlCommand* co
// set up the struct for a modem configuration message
command->type = openxc_ControlCommand_Type_MODEM_CONFIGURATION;
openxc_ModemConfigurationCommand* modemConfigurationCommand = &command->modem_configuration_command;

// Keeping if statement commented out, was used for a depricated way to deserialize Modem Configuration.
// parse server command
cJSON* server = cJSON_GetObjectItem(root, "server");
if(server != NULL) {
cJSON* host = cJSON_GetObjectItem(server, "host");
// cJSON* server = cJSON_GetObjectItem(root, "server");
// if(server != NULL) {
cJSON* host = cJSON_GetObjectItem(root, "host");
if(host != NULL) {
strcpy(modemConfigurationCommand->serverConnectSettings.host, host->valuestring);
}
cJSON* port = cJSON_GetObjectItem(server, "port");
cJSON* port = cJSON_GetObjectItem(root, "port");
if(port != NULL) {
modemConfigurationCommand->serverConnectSettings.port = port->valueint;
}
}
// }
}

static void deserializeRTCConfiguration(cJSON* root, openxc_ControlCommand* command) {
Expand Down
4 changes: 4 additions & 0 deletions src/platform/pic32/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ void openxc::util::log::initialize() {
Serial.begin(115200);
#elif defined(CROSSCHASM_C5_BT)
return; //Serial.begin(115200);
#elif defined(CROSSCHASM_C5_CELLULAR)
Serial.begin(115200);
#else
Serial2.begin(115200);
#endif
Expand All @@ -26,6 +28,8 @@ void openxc::util::log::debugUart(const char* message) {
Serial.print(message);
#elif defined(CROSSCHASM_C5_BT)
return;//Serial.print(message);
#elif defined(CROSSCHASM_C5_CELLULAR)
Serial.print(message);
#else
Serial2.print(message);
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/platform/pic32/usb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void openxc::interface::usb::processSendQueue(UsbDevice* usbDevice) {
UsbEndpoint* endpoint = &usbDevice->endpoints[i];

// Don't touch usbDevice->sendBuffer if there's still a pending transfer
if(!waitForHandle(usbDevice, endpoint)) {
if(waitForHandle(usbDevice, endpoint)) {
return;
}

Expand Down

0 comments on commit b738b6b

Please sign in to comment.