aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DabMux.cpp20
-rw-r--r--src/dabOutput/edi/TagItems.h9
2 files changed, 18 insertions, 11 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp
index 468ba1e..8472cfb 100644
--- a/src/DabMux.cpp
+++ b/src/DabMux.cpp
@@ -108,6 +108,7 @@ typedef DWORD32 uint32_t;
#include "dabOutput/dabOutput.h"
+#include "dabOutput/edi/TagItems.h"
#include "crc.h"
#include "UdpSocket.h"
#include "InetAddress.h"
@@ -284,7 +285,7 @@ int main(int argc, char *argv[])
BaseRemoteController* rc = NULL;
- unsigned int currentFrame;
+ unsigned long currentFrame;
int returnCode = 0;
int result;
int cur;
@@ -639,6 +640,9 @@ int main(int argc, char *argv[])
if ((limit > 0) && (currentFrame >= limit)) {
break;
}
+ // For EDI, save ETI(LI) Management data into a TAG Item DETI/*{{{*/
+ TagDETI tagDETI;
+ tagDETI.atstf = 0; // TODO add ATST support/*}}}*/
date = getDabTime();
// Initialise the ETI frame
@@ -651,7 +655,7 @@ int main(int argc, char *argv[])
// See ETS 300 799 Clause 6
eti_SYNC *etiSync = (eti_SYNC *) etiFrame;
- etiSync->ERR = 0xFF; // ETS 300 799, 5.2, no error
+ etiSync->ERR = tagDETI.stat = 0xFF; // ETS 300 799, 5.2, no error
//****** Field FSYNC *****//
// See ETS 300 799, 6.2.1.2
@@ -670,11 +674,11 @@ int main(int argc, char *argv[])
//****** FCT ******//
// Incremente for each frame, overflows at 249
- fc->FCT = currentFrame % 250;
+ fc->FCT = tagDETI.fct = currentFrame % 250;
//****** FICF ******//
// Fast Information Channel Flag, 1 bit, =1 if FIC present
- fc->FICF = 1;
+ fc->FICF = tagDETI.ficf = 1;
//****** NST ******//
/* Number of audio of data sub-channels, 7 bits, 0-64.
@@ -687,11 +691,11 @@ int main(int argc, char *argv[])
/* Frame Phase, 3 bit counter, tells the COFDM generator
* when to insert the TII. Is also used by the MNSC.
*/
- fc->FP = currentFrame & 0x7;
+ fc->FP = tagDETI.fp = currentFrame & 0x7;
//****** MID ******//
//Mode Identity, 2 bits, 01 ModeI, 10 modeII, 11 ModeIII, 00 ModeIV
- fc->MID = ensemble->mode; //mode 2 needs 3 FIB, 3*32octets = 96octets
+ fc->MID = tagDETI.mid = ensemble->mode; //mode 2 needs 3 FIB, 3*32octets = 96octets
//****** FL ******//
/* Frame Length, 11 bits, nb of words(4 bytes) in STC, EOH and MST
@@ -785,6 +789,7 @@ int main(int argc, char *argv[])
break;
}
+ tagDETI.mnsc = eoh->MNSC;
//CRC Cyclic Redundancy Checksum du FC, STC et MNSC, 2 octets
nbBytesCRC = 4 + ((fc->NST) * 4) + 2;
@@ -1804,7 +1809,8 @@ int main(int argc, char *argv[])
result = (*subchannel)->input->readFrame(
&etiFrame[index], sizeSubchannel);
if (result < 0) {
- etiLog.log(info, "Subchannel %d read failed at ETI frame number: %i\n", (*subchannel)->id, currentFrame);
+ etiLog.log(info, "Subchannel %d read failed at ETI frame number: %d\n",
+ (*subchannel)->id, currentFrame);
}
index += sizeSubchannel;
}
diff --git a/src/dabOutput/edi/TagItems.h b/src/dabOutput/edi/TagItems.h
index c0e863a..6ae3bc6 100644
--- a/src/dabOutput/edi/TagItems.h
+++ b/src/dabOutput/edi/TagItems.h
@@ -58,7 +58,8 @@ class TagDETI : public TagItem
rfudf = 0;
ficf = 0;
- dflc = 0; // counter
+ rfa = 0; //shall be zero
+ rfu = 0; //mnsc is valid
}
std::vector<uint8_t> Assemble();
@@ -69,7 +70,9 @@ class TagDETI : public TagItem
uint8_t fp;
uint8_t rfa;
uint8_t rfu;
- uint8_t mnsc;
+ uint16_t mnsc;
+ uint8_t fcth;
+ uint8_t fct;
// ATST (optional)
bool atstf; // presence of atst data
@@ -86,8 +89,6 @@ class TagDETI : public TagItem
bool rfudf;
uint32_t rfud;
- private:
- uint32_t dflc; //modulo 5000 counter for each eti frame
};