-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #504 from EVerest/jc/enhanced-wifi-setup
enhanced wifi setup
- Loading branch information
Showing
13 changed files
with
1,170 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
!meson.build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright Pionix GmbH and Contributors to EVerest | ||
|
||
#include "RunApplication.hpp" | ||
|
||
#include <boost/process.hpp> | ||
#include <fmt/core.h> | ||
|
||
#include <everest/logging.hpp> | ||
|
||
namespace module { | ||
|
||
CmdOutput run_application(const std::string& name, std::vector<std::string> args) { | ||
// search_path requires basename and not a full path | ||
boost::filesystem::path path = name; | ||
|
||
if (path.is_relative()) { | ||
path = boost::process::search_path(name); | ||
} | ||
|
||
if (path.empty()) { | ||
EVLOG_debug << fmt::format("The application '{}' could not be found", name); | ||
return CmdOutput{"", {}, 1}; | ||
} | ||
|
||
boost::process::ipstream stream; | ||
boost::process::child cmd(path, boost::process::args(args), boost::process::std_out > stream); | ||
std::string output; | ||
std::vector<std::string> split_output; | ||
std::string temp; | ||
while (std::getline(stream, temp)) { | ||
output += temp + "\n"; | ||
split_output.push_back(temp); | ||
} | ||
cmd.wait(); | ||
return CmdOutput{output, split_output, cmd.exit_code()}; | ||
} | ||
|
||
} // namespace module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright Pionix GmbH and Contributors to EVerest | ||
#ifndef RUNAPPLICATION_HPP | ||
#define RUNAPPLICATION_HPP | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
namespace module { | ||
|
||
struct CmdOutput { | ||
std::string output; | ||
std::vector<std::string> split_output; | ||
int exit_code; | ||
}; | ||
|
||
CmdOutput run_application(const std::string& name, std::vector<std::string> args); | ||
|
||
} // namespace module | ||
|
||
#endif // RUNAPPLICATION_HPP |
Oops, something went wrong.