From 67300d5c4fa279eb5144d60874753b10de678f55 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 24 Dec 2013 16:59:09 +0100 Subject: add TagPacket, add to DabMux.cpp. Must fix the goto EXIT now --- src/dabOutput/edi/AFPacket.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/dabOutput/edi/AFPacket.cpp') diff --git a/src/dabOutput/edi/AFPacket.cpp b/src/dabOutput/edi/AFPacket.cpp index cd845d7..1516561 100644 --- a/src/dabOutput/edi/AFPacket.cpp +++ b/src/dabOutput/edi/AFPacket.cpp @@ -26,6 +26,8 @@ #include "config.h" #include "crc.h" #include "AFPacket.h" +#include "TagItems.h" +#include "TagPacket.h" #include #include #include @@ -37,8 +39,10 @@ // AF Packet Major (3 bits) and Minor (4 bits) version #define AFHEADER_VERSION 0x8 // MAJ=1, MIN=0 -std::vector AFPacket::Assemble(char protocol_type, std::vector payload) +std::vector AFPacket::Assemble(TagPacket tag_packet) { + std::vector payload = tag_packet.Assemble(); + header.ar_maj = 1; header.ar_min = 0; header.pt = protocol_type; @@ -60,7 +64,7 @@ std::vector AFPacket::Assemble(char protocol_type, std::vector packet.push_back((have_crc ? 0x80 : 0) | AFHEADER_VERSION); // ar_cf: CRC=1 packet.push_back(AFHEADER_PT_TAG); - // insert payload + // insert payload, must have a length multiple of 8 bytes packet.insert(packet.end(), payload.begin(), payload.end()); // calculate CRC over AF Header and payload -- cgit v1.2.3