-
Notifications
You must be signed in to change notification settings - Fork 1
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 #15 from MuonPi/feature/i2c
feature/i2c
- Loading branch information
Showing
64 changed files
with
2,879 additions
and
3,076 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
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
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 |
---|---|---|
@@ -1,33 +1,43 @@ | ||
#include <iostream> | ||
#include <muonpi/configuration.h> | ||
#include <muonpi/log.h> | ||
|
||
#include <iostream> | ||
|
||
auto main(int argc, const char* argv[]) -> int | ||
{ | ||
muonpi::log::system::setup(muonpi::log::Level::Info, [](int c){exit(c);}, std::cerr); | ||
auto main(int argc, const char* argv[]) -> int { | ||
muonpi::log::system::setup( | ||
muonpi::log::Level::Info, | ||
[](int c) { exit(c); }, | ||
std::cerr); | ||
|
||
muonpi::config config{}; | ||
muonpi::config config {}; | ||
|
||
auto cmd_options = config.setup("Commandline options"); | ||
cmd_options.add_option("test,t", "This is just a test!"); | ||
cmd_options.add_option("var,v", boost::program_options::value<std::string>(), "This is also just a test!"); | ||
cmd_options.add_option("int,i", boost::program_options::value<int>()->required(), "This is also just a test!"); | ||
cmd_options.add_option("var,v", | ||
boost::program_options::value<std::string>(), | ||
"This is also just a test!"); | ||
cmd_options.add_option("int,i", | ||
boost::program_options::value<int>()->required(), | ||
"This is also just a test!"); | ||
cmd_options.commit(argc, argv); | ||
|
||
std::cout<<cmd_options; | ||
|
||
std::cout << cmd_options; | ||
|
||
auto file_options = config.setup("Commandline options"); | ||
file_options.add_option("ftest", boost::program_options::value<std::string>(), "This is just a test!"); | ||
file_options.add_option("fvar", boost::program_options::value<std::string>(), "This is also just a test!"); | ||
file_options.add_option("fint", boost::program_options::value<int>()->required(), "This is also just a test!"); | ||
file_options.add_option("ftest", | ||
boost::program_options::value<std::string>(), | ||
"This is just a test!"); | ||
file_options.add_option("fvar", | ||
boost::program_options::value<std::string>(), | ||
"This is also just a test!"); | ||
file_options.add_option("fint", | ||
boost::program_options::value<int>()->required(), | ||
"This is also just a test!"); | ||
file_options.commit("example.cfg"); | ||
|
||
std::cout<<file_options; | ||
std::cout << file_options; | ||
|
||
if (config.is_set("var")) { | ||
std::cout<<"option var: "<<config.get<std::string>("var")<<'\n'; | ||
std::cout << "option var: " << config.get<std::string>("var") << '\n'; | ||
} | ||
std::cout<<"option int: "<<config.get<int>("int")<<'\n'; | ||
std::cout << "option int: " << config.get<int>("int") << '\n'; | ||
} |
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 |
---|---|---|
@@ -1,18 +1,15 @@ | ||
#include <iostream> | ||
#include <muonpi/http_request.h> | ||
#include <muonpi/log.h> | ||
|
||
#include <iostream> | ||
|
||
auto main() -> int | ||
{ | ||
auto main() -> int { | ||
muonpi::log::system::setup(muonpi::log::Level::Info); | ||
|
||
muonpi::http::destination_t config {}; | ||
config.host = "localhost"; | ||
config.port = 8000; | ||
config.host = "localhost"; | ||
config.port = 8000; | ||
config.target = "/hello"; | ||
config.method = muonpi::http::http_verb::get; | ||
|
||
|
||
std::cout << muonpi::http::http_request(config, "hello.") << '\n'; | ||
} |
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
Oops, something went wrong.