Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions examples/common/DefaultCentralSystemEventsHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ bool DefaultCentralSystemEventsHandler::ChargePointRequestHandler::signCertifica
std::stringstream sign_cert_cmd_line;
sign_cert_cmd_line << "openssl x509 -req -sha256 -days 3650 -in " << csr_filename << " -CA " << ca_cert_path << " -CAkey "
<< ca_cert_key_path << " -CAcreateserial -out " << certificate_filename;
int err = WEXITSTATUS(system(sign_cert_cmd_line.str().c_str()));
int system_ret = system(sign_cert_cmd_line.str().c_str());
int err = WEXITSTATUS(system_ret);
cout << "Command line : " << sign_cert_cmd_line.str() << " => " << err << endl;

// Check if the certificate has been generated
Expand All @@ -433,7 +434,8 @@ bool DefaultCentralSystemEventsHandler::ChargePointRequestHandler::signCertifica
std::string bundle_filename = certificate_filename + ".bundle";
std::stringstream generate_bundle_cmd_line;
generate_bundle_cmd_line << "cat " << certificate_filename << " " << ca_cert_path << " > " << bundle_filename;
err = WEXITSTATUS(system(generate_bundle_cmd_line.str().c_str()));
int bundle_ret = system(generate_bundle_cmd_line.str().c_str());
err = WEXITSTATUS(bundle_ret);
cout << "Command line : " << generate_bundle_cmd_line.str() << " => " << err << endl;
if (std::filesystem::exists(bundle_filename))
{
Expand Down Expand Up @@ -611,7 +613,8 @@ bool DefaultCentralSystemEventsHandler::ChargePointRequestHandler::iso15118SignC
std::stringstream sign_cert_cmd_line;
sign_cert_cmd_line << "openssl x509 -req -sha256 -days 3650 -in " << csr_filename << " -CA " << ca_cert_path << " -CAkey "
<< ca_cert_key_path << " -CAcreateserial -out " << certificate_filename;
int err = WEXITSTATUS(system(sign_cert_cmd_line.str().c_str()));
int system_ret = system(sign_cert_cmd_line.str().c_str());
int err = WEXITSTATUS(system_ret);
cout << "Command line : " << sign_cert_cmd_line.str() << " => " << err << endl;

// Check if the certificate has been generated
Expand All @@ -621,7 +624,8 @@ bool DefaultCentralSystemEventsHandler::ChargePointRequestHandler::iso15118SignC
std::string bundle_filename = certificate_filename + ".bundle";
std::stringstream generate_bundle_cmd_line;
generate_bundle_cmd_line << "cat " << certificate_filename << " " << ca_cert_path << " > " << bundle_filename;
err = WEXITSTATUS(system(generate_bundle_cmd_line.str().c_str()));
int bundle_ret = system(generate_bundle_cmd_line.str().c_str());
err = WEXITSTATUS(bundle_ret);
cout << "Command line : " << generate_bundle_cmd_line.str() << " => " << err << endl;
if (std::filesystem::exists(bundle_filename))
{
Expand Down
12 changes: 8 additions & 4 deletions examples/common/DefaultChargePointEventsHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ std::string DefaultChargePointEventsHandler::getDiagnostics(const ocpp::types::O

std::stringstream ss;
ss << "zip " << diag_file << " " << m_config.stackConfig().databasePath();
int err = WEXITSTATUS(system(ss.str().c_str()));
int sys_ret = system(ss.str().c_str());
int err = WEXITSTATUS(sys_ret);
cout << "Command line : " << ss.str() << " => " << err << endl;

return diag_file;
Expand Down Expand Up @@ -295,7 +296,8 @@ bool DefaultChargePointEventsHandler::uploadFile(const std::string& file, const
{
std::stringstream ss;
ss << "curl --silent " << params << " -T " << file << " " << connection_url;
int err = WEXITSTATUS(system(ss.str().c_str()));
int sys_ret = system(ss.str().c_str());
int err = WEXITSTATUS(sys_ret);
cout << "Command line : " << ss.str() << endl;
ret = (err == 0);
}
Expand Down Expand Up @@ -339,7 +341,8 @@ bool DefaultChargePointEventsHandler::downloadFile(const std::string& url, const
{
std::stringstream ss;
ss << "curl --silent " << params << " -o " << file << " " << connection_url;
int err = WEXITSTATUS(system(ss.str().c_str()));
int sys_ret = system(ss.str().c_str());
int err = WEXITSTATUS(sys_ret);
cout << "Command line : " << ss.str() << endl;
ret = (err == 0);
}
Expand Down Expand Up @@ -627,7 +630,8 @@ std::string DefaultChargePointEventsHandler::getLog(ocpp::types::LogEnumType

std::stringstream ss;
ss << "zip " << log_file << " " << m_config.stackConfig().databasePath();
int err = WEXITSTATUS(system(ss.str().c_str()));
int sys_ret = system(ss.str().c_str());
int err = WEXITSTATUS(sys_ret);
cout << "Command line : " << ss.str() << " => " << err << endl;
}

Expand Down