diff options
Diffstat (limited to 'src/dabOutput')
-rw-r--r-- | src/dabOutput/dabOutput.h | 40 | ||||
-rw-r--r-- | src/dabOutput/dabOutputFifo.cpp | 1 | ||||
-rw-r--r-- | src/dabOutput/dabOutputFile.cpp | 1 | ||||
-rw-r--r-- | src/dabOutput/edi/AFPacket.h | 2 | ||||
-rw-r--r-- | src/dabOutput/edi/PFT.h | 8 |
5 files changed, 51 insertions, 1 deletions
diff --git a/src/dabOutput/dabOutput.h b/src/dabOutput/dabOutput.h index 18f3848..f6980fe 100644 --- a/src/dabOutput/dabOutput.h +++ b/src/dabOutput/dabOutput.h @@ -78,6 +78,8 @@ class DabOutput virtual int Close() = 0; virtual ~DabOutput() {} + + virtual std::string get_info() = 0; }; // ----- used in File and Fifo outputs @@ -111,7 +113,12 @@ class DabOutputFile : public DabOutput int Write(void* buffer, int size); int Close(); + std::string get_info() { + return "file://" + filename_; + } + protected: + std::string filename_; int file_; EtiFileType type_; unsigned long nbFrames_; @@ -126,6 +133,11 @@ class DabOutputFifo : public DabOutputFile ~DabOutputFifo() {} int Write(void* buffer, int size); + + std::string get_info() { + return "fifo://" + filename_; + } + }; // -------------- RAW socket ----------- @@ -162,7 +174,12 @@ class DabOutputRaw : public DabOutput int Open(const char* name); int Write(void* buffer, int size); int Close(); + + std::string get_info() { + return "raw://" + filename_; + } private: + std::string filename_; #ifdef _WIN32 HANDLE socket_; #else @@ -197,7 +214,11 @@ class DabOutputUdp : public DabOutput int Write(void* buffer, int size); int Close() { return 0; } + std::string get_info() { + return "udp://" + uri_; + } private: + std::string uri_; UdpSocket* socket_; UdpPacket* packet_; }; @@ -230,9 +251,14 @@ class DabOutputTcp : public DabOutput int Write(void* buffer, int size); int Close(); + std::string get_info() { + return "tcp://" + uri_; + } + TcpServer* server; TcpSocket* client; private: + std::string uri_; pthread_t thread_; }; @@ -252,7 +278,12 @@ class DabOutputSimul : public DabOutput int Open(const char* name); int Write(void* buffer, int size); int Close() { return 0; } + + std::string get_info() { + return "simul://" + name_; + } private: + std::string name_; #ifdef _WIN32 DWORD startTime_; #else @@ -304,6 +335,7 @@ class DabOutputZMQ : public DabOutput { public: DabOutputZMQ() : + endpoint_(""), zmq_proto_(""), zmq_context_(1), zmq_pub_sock_(zmq_context_, ZMQ_PUB), zmq_message_ix(0) @@ -312,6 +344,7 @@ class DabOutputZMQ : public DabOutput } DabOutputZMQ(std::string zmq_proto) : + endpoint_(""), zmq_proto_(zmq_proto), zmq_context_(1), zmq_pub_sock_(zmq_context_, ZMQ_PUB), zmq_message_ix(0) @@ -323,7 +356,11 @@ class DabOutputZMQ : public DabOutput zmq_pub_sock_.close(); } - int Open(const char* name); + std::string get_info() { + return "zmq: " + zmq_proto_ + "://" + endpoint_; + } + + int Open(const char* endpoint); int Write(void* buffer, int size); int Close(); private: @@ -334,6 +371,7 @@ class DabOutputZMQ : public DabOutput /* Forbid copy constructor */ } + std::string endpoint_; std::string zmq_proto_; zmq::context_t zmq_context_; // handle for the zmq context zmq::socket_t zmq_pub_sock_; // handle for the zmq publisher socket diff --git a/src/dabOutput/dabOutputFifo.cpp b/src/dabOutput/dabOutputFifo.cpp index de9579e..6b1c016 100644 --- a/src/dabOutput/dabOutputFifo.cpp +++ b/src/dabOutput/dabOutputFifo.cpp @@ -59,6 +59,7 @@ int DabOutputFifo::Write(void* buffer, int size) if (write(this->file_, padding, 6144 - size) == -1) goto FIFO_WRITE_ERROR; break; + case ETI_FILE_TYPE_NONE: default: etiLog.log(error, "File type is not supported.\n"); return -1; diff --git a/src/dabOutput/dabOutputFile.cpp b/src/dabOutput/dabOutputFile.cpp index f26ddfd..d7fd5c7 100644 --- a/src/dabOutput/dabOutputFile.cpp +++ b/src/dabOutput/dabOutputFile.cpp @@ -112,6 +112,7 @@ int DabOutputFile::Write(void* buffer, int size) memset(padding, 0x55, 6144 - size); if (write(this->file_, padding, 6144 - size) == -1) goto FILE_WRITE_ERROR; break; + case ETI_FILE_TYPE_NONE: default: etiLog.log(error, "File type is not supported.\n"); return -1; diff --git a/src/dabOutput/edi/AFPacket.h b/src/dabOutput/edi/AFPacket.h index 5f62456..9b189b8 100644 --- a/src/dabOutput/edi/AFPacket.h +++ b/src/dabOutput/edi/AFPacket.h @@ -39,6 +39,8 @@ typedef std::vector<uint8_t> AFPacket; class AFPacketiser { public: + AFPacketiser() : + m_verbose(false) {}; AFPacketiser(bool verbose) : m_verbose(verbose) {}; diff --git a/src/dabOutput/edi/PFT.h b/src/dabOutput/edi/PFT.h index 4aae817..9c6f7bd 100644 --- a/src/dabOutput/edi/PFT.h +++ b/src/dabOutput/edi/PFT.h @@ -49,6 +49,14 @@ class PFT public: static const int ParityBytes = 48; + PFT() : + m_k(207), + m_m(3), + m_dest_port(12000), + m_pseq(0), + m_verbose(false) + { } + PFT(unsigned int RSDataWordLength, unsigned int NumRecoverableFragments, const edi_configuration_t &conf) : |