From 0f158ac9c63c6770cea423c8486a5ff192b36366 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 23 Dec 2016 17:56:12 +0100 Subject: Create namespace for EDI --- src/dabOutput/edi/AFPacket.cpp | 7 +++++-- src/dabOutput/edi/AFPacket.h | 4 ++++ src/dabOutput/edi/PFT.cpp | 4 ++++ src/dabOutput/edi/PFT.h | 4 ++++ src/dabOutput/edi/TagItems.cpp | 13 +++++++------ src/dabOutput/edi/TagItems.h | 4 ++++ src/dabOutput/edi/TagPacket.cpp | 4 ++++ src/dabOutput/edi/TagPacket.h | 3 +++ 8 files changed, 35 insertions(+), 8 deletions(-) (limited to 'src/dabOutput') diff --git a/src/dabOutput/edi/AFPacket.cpp b/src/dabOutput/edi/AFPacket.cpp index 509c3a6..a58a980 100644 --- a/src/dabOutput/edi/AFPacket.cpp +++ b/src/dabOutput/edi/AFPacket.cpp @@ -37,11 +37,13 @@ #include #include +namespace edi { + // Header PT field. AF packet contains TAG payload -#define AFHEADER_PT_TAG 'T' +const uint8_t AFHEADER_PT_TAG = 'T'; // AF Packet Major (3 bits) and Minor (4 bits) version -#define AFHEADER_VERSION 0x10 // MAJ=1, MIN=0 +const uint8_t AFHEADER_VERSION = 0x10; // MAJ=1, MIN=0 AFPacket AFPacketiser::Assemble(TagPacket tag_packet) { @@ -91,3 +93,4 @@ AFPacket AFPacketiser::Assemble(TagPacket tag_packet) return packet; } +} diff --git a/src/dabOutput/edi/AFPacket.h b/src/dabOutput/edi/AFPacket.h index a6fd603..0ffd13f 100644 --- a/src/dabOutput/edi/AFPacket.h +++ b/src/dabOutput/edi/AFPacket.h @@ -34,6 +34,8 @@ #include "TagItems.h" #include "TagPacket.h" +namespace edi { + typedef std::vector AFPacket; // ETSI TS 102 821, 6.1 AF packet structure @@ -55,3 +57,5 @@ class AFPacketiser bool m_verbose; }; +} + diff --git a/src/dabOutput/edi/PFT.cpp b/src/dabOutput/edi/PFT.cpp index 62b9f98..511a6ae 100644 --- a/src/dabOutput/edi/PFT.cpp +++ b/src/dabOutput/edi/PFT.cpp @@ -43,6 +43,8 @@ #include "crc.h" #include "ReedSolomon.h" +namespace edi { + using namespace std; // An integer division that rounds up, i.e. ceil(a/b) @@ -293,3 +295,5 @@ std::vector< PFTFragment > PFT::Assemble(AFPacket af_packet) return pft_fragments; } +} + diff --git a/src/dabOutput/edi/PFT.h b/src/dabOutput/edi/PFT.h index 5e2685e..05afdb1 100644 --- a/src/dabOutput/edi/PFT.h +++ b/src/dabOutput/edi/PFT.h @@ -42,6 +42,8 @@ #include "ReedSolomon.h" #include "dabOutput/dabOutput.h" +namespace edi { + typedef std::vector RSBlock; typedef std::vector PFTFragment; @@ -105,3 +107,5 @@ class PFT }; +} + diff --git a/src/dabOutput/edi/TagItems.cpp b/src/dabOutput/edi/TagItems.cpp index 54e996b..75a4ecf 100644 --- a/src/dabOutput/edi/TagItems.cpp +++ b/src/dabOutput/edi/TagItems.cpp @@ -1,6 +1,8 @@ /* - Copyright (C) 2016 Matthias P. Braendli - http://mpb.li + Copyright (C) 2016 + Matthias P. Braendli, matthias.braendli@mpb.li + + http://www.opendigitalradio.org EDI output. This defines a few TAG items as defined ETSI TS 102 821 and @@ -24,9 +26,6 @@ along with ODR-DabMux. If not, see . */ -#ifndef _AFPACKET_H_ -#define _AFPACKET_H_ - #include "config.h" #include "TagItems.h" #include @@ -35,6 +34,8 @@ #include #include +namespace edi { + std::vector TagStarPTR::Assemble() { //std::cerr << "TagItem *ptr" << std::endl; @@ -209,5 +210,5 @@ std::vector TagStarDMY::Assemble() return packet; } -#endif +} diff --git a/src/dabOutput/edi/TagItems.h b/src/dabOutput/edi/TagItems.h index 959a9a4..5a4ac6c 100644 --- a/src/dabOutput/edi/TagItems.h +++ b/src/dabOutput/edi/TagItems.h @@ -35,6 +35,8 @@ #include #include +namespace edi { + class TagItem { public: @@ -153,3 +155,5 @@ class TagStarDMY : public TagItem uint32_t length_; }; +} + diff --git a/src/dabOutput/edi/TagPacket.cpp b/src/dabOutput/edi/TagPacket.cpp index 332a130..b16dc33 100644 --- a/src/dabOutput/edi/TagPacket.cpp +++ b/src/dabOutput/edi/TagPacket.cpp @@ -35,6 +35,8 @@ #include #include +namespace edi { + TagPacket::TagPacket(unsigned int alignment) : m_alignment(alignment) { } @@ -73,3 +75,5 @@ std::vector TagPacket::Assemble() return packet; } +} + diff --git a/src/dabOutput/edi/TagPacket.h b/src/dabOutput/edi/TagPacket.h index 41d922c..a861cbb 100644 --- a/src/dabOutput/edi/TagPacket.h +++ b/src/dabOutput/edi/TagPacket.h @@ -33,6 +33,7 @@ #include #include +namespace edi { // A TagPacket is nothing else than a list of tag items, with an // Assemble function that puts the bytestream together and adds @@ -51,3 +52,5 @@ class TagPacket unsigned int m_alignment; }; +} + -- cgit v1.2.3