Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
listening on UDP
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berger <[email protected]>
  • Loading branch information
chrberger committed May 3, 2019
1 parent cf78206 commit a2343d5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/opendlv-device-gps-nmea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,10 @@ int32_t main(int32_t argc, char **argv) {
const std::string NMEA_ADDRESS(commandlineArguments["nmea_ip"]);
const uint16_t NMEA_PORT(std::stoi(commandlineArguments["nmea_port"]));

cluon::TCPConnection fromDevice{NMEA_ADDRESS, NMEA_PORT,
[&decoder = nmeaDecoder](std::string &&d, std::chrono::system_clock::time_point &&tp) noexcept {
cluon::UDPReceiver fromDevice{NMEA_ADDRESS, NMEA_PORT,
[&decoder = nmeaDecoder](std::string &&d, std::string &&/*from*/, std::chrono::system_clock::time_point &&tp) noexcept {
decoder.decode(d, std::move(tp));
},
[&argv](){ std::cerr << "[" << argv[0] << "] Connection lost." << std::endl; exit(1); }
}
};

// Just sleep as this microservice is data driven.
Expand Down

0 comments on commit a2343d5

Please sign in to comment.