Skip to content
Snippets Groups Projects
Commit 590fbdbd authored by Hoop77's avatar Hoop77
Browse files

-

parent b2417f04
No related merge requests found
......@@ -49,6 +49,8 @@ private:
std::function<void()> cruiseControllerNotify =
[this] { cruiseControllerThread.notify(); };
platoonProtocol::VehicleId readVehicleId();
platoonProtocol::Vehicle::VehicleEndpoints readVehicleEndpoints();
};
}
#endif
......@@ -18,7 +18,8 @@ namespace car
// TODO: ConfigReader!
platoonProtocol::VehicleId readVehicleId() {
platoonProtocol::VehicleId MainNode::readVehicleId()
{
// open config file
std::string userHome = getenv("HOME");
std::ifstream configFile;
......@@ -55,10 +56,12 @@ platoonProtocol::VehicleId readVehicleId() {
configFile.close();
messageOStream.write("vehicleId", vehicleId);
return vehicleId;
}
platoonProtocol::Vehicle::VehicleEndpoints readVehicleEndpoints() {
platoonProtocol::Vehicle::VehicleEndpoints MainNode::readVehicleEndpoints()
{
// open config file
std::string userHome = getenv("HOME");
std::ifstream configFile;
......@@ -91,6 +94,13 @@ platoonProtocol::Vehicle::VehicleEndpoints readVehicleEndpoints() {
configFile.close();
for (const auto & endpoint : endpoints)
{
messageOStream << MessageOStream::key << "VehicleEndpoint"
<< MessageOStream::value << endpoint.getVehicleId() << " " << endpoint.getHost()
<< MessageOStream::flush;
}
return endpoints;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment