diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-12-23 17:56:12 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-12-23 17:56:12 +0100 |
commit | 0f158ac9c63c6770cea423c8486a5ff192b36366 (patch) | |
tree | 7cd646cd32aa7f5fd099ef4923e04899fa29a99f /src/dabOutput | |
parent | e473f5183a1146d76940e9bfe7e3d76bbfe7baca (diff) | |
download | dabmux-0f158ac9c63c6770cea423c8486a5ff192b36366.tar.gz dabmux-0f158ac9c63c6770cea423c8486a5ff192b36366.tar.bz2 dabmux-0f158ac9c63c6770cea423c8486a5ff192b36366.zip |
Create namespace for EDI
Diffstat (limited to 'src/dabOutput')
-rw-r--r-- | src/dabOutput/edi/AFPacket.cpp | 7 | ||||
-rw-r--r-- | src/dabOutput/edi/AFPacket.h | 4 | ||||
-rw-r--r-- | src/dabOutput/edi/PFT.cpp | 4 | ||||
-rw-r--r-- | src/dabOutput/edi/PFT.h | 4 | ||||
-rw-r--r-- | src/dabOutput/edi/TagItems.cpp | 13 | ||||
-rw-r--r-- | src/dabOutput/edi/TagItems.h | 4 | ||||
-rw-r--r-- | src/dabOutput/edi/TagPacket.cpp | 4 | ||||
-rw-r--r-- | src/dabOutput/edi/TagPacket.h | 3 |
8 files changed, 35 insertions, 8 deletions
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 <stdint.h> #include <arpa/inet.h> +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<uint8_t> 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<uint8_t> RSBlock; typedef std::vector<uint8_t> 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 <http://www.gnu.org/licenses/>. */ -#ifndef _AFPACKET_H_ -#define _AFPACKET_H_ - #include "config.h" #include "TagItems.h" #include <vector> @@ -35,6 +34,8 @@ #include <stdint.h> #include <stdexcept> +namespace edi { + std::vector<uint8_t> TagStarPTR::Assemble() { //std::cerr << "TagItem *ptr" << std::endl; @@ -209,5 +210,5 @@ std::vector<uint8_t> 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 <string> #include <stdint.h> +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 <stdint.h> #include <cassert> +namespace edi { + TagPacket::TagPacket(unsigned int alignment) : m_alignment(alignment) { } @@ -73,3 +75,5 @@ std::vector<uint8_t> 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 <list> #include <stdint.h> +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; }; +} + |