some adaptions
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "output/OutputRequestHandlerFactory.h"
|
||||
#include "input/InputSocketHandlerFactory.h"
|
||||
#include "DriverFactory.h"
|
||||
#include "utility/Colors.h"
|
||||
|
||||
#include <Poco/Net/SocketAddress.h>
|
||||
#include <Poco/Net/ServerSocket.h>
|
||||
@@ -18,6 +19,8 @@
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
std::cout << FGRN("Starting FlippR-Server ... ") << std::endl;
|
||||
|
||||
flippR_driver::networking::FlippRServer app;
|
||||
return app.run(argc, argv);
|
||||
}
|
||||
@@ -50,22 +53,28 @@ void FlippRServer::parse_server_config_file()
|
||||
{
|
||||
std::ifstream config;
|
||||
|
||||
Parser parser;
|
||||
Object::Ptr json;
|
||||
|
||||
try
|
||||
{
|
||||
config.open("server_config.json");
|
||||
json = parser.parse(config).extract<Object::Ptr>();
|
||||
}
|
||||
catch(const std::exception e)
|
||||
{
|
||||
logger().information("No config file specified.");
|
||||
logger().information(FCYN("server_config.json not specified!"));
|
||||
return;
|
||||
}
|
||||
Parser parser;
|
||||
Object::Ptr json = parser.parse(config).extract<Object::Ptr>();
|
||||
|
||||
logger().information(FCYN("Parsing server_config.json..."));
|
||||
|
||||
for(auto &config_json : json->getNames())
|
||||
{
|
||||
handle_config_file(config_json, json->get(config_json));
|
||||
}
|
||||
|
||||
config.close();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,7 +115,6 @@ void FlippRServer::initialize_output_driver()
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
//todo linking errors
|
||||
this->output_driver = flippR_driver::get_OutputDriver(output_pin_config_stream,
|
||||
lamp_config_stream,
|
||||
solenoid_config_stream,
|
||||
@@ -130,8 +138,6 @@ void FlippRServer::initialize_input_driver()
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
//todo linking errors
|
||||
this->input_driver = flippR_driver::get_InputDriver(input_config_stream, matrix_config_stream);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user