From ee7aae13524f67a4cc6e7f7404cbcae4693dbc25 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 14 Aug 2017 15:35:28 +0200 Subject: Set EDI destination defaults and add error checking --- src/dabOutput/dabOutput.h | 4 ++-- src/zmq2edi/zmq2edi.cpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dabOutput/dabOutput.h b/src/dabOutput/dabOutput.h index 4142b25..5ea93db 100644 --- a/src/dabOutput/dabOutput.h +++ b/src/dabOutput/dabOutput.h @@ -53,8 +53,8 @@ struct edi_destination_t { std::string dest_addr; std::string source_addr; - unsigned int source_port; - unsigned int ttl; + unsigned int source_port = 0; + unsigned int ttl = 10; std::shared_ptr socket; }; diff --git a/src/zmq2edi/zmq2edi.cpp b/src/zmq2edi/zmq2edi.cpp index 2d1963b..a1269a9 100644 --- a/src/zmq2edi/zmq2edi.cpp +++ b/src/zmq2edi/zmq2edi.cpp @@ -222,6 +222,11 @@ int start(int argc, char **argv) return 1; } + if (edi_destination.dest_addr.empty() or edi_conf.dest_port == 0) { + etiLog.level(error) << "No EDI output defined"; + return 1; + } + edi_conf.destinations.push_back(edi_destination); etiLog.level(info) << "Setting up EDI Sender with delay " << delay_ms << " ms"; -- cgit v1.2.3