aboutsummaryrefslogtreecommitdiffstats
path: root/src/SignalMultiplexer.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-05-27 20:43:48 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-05-30 17:36:31 +0200
commit09312c200b78c6b441b577911743f75921fef5b3 (patch)
tree170b0a46b29b0e5efea500b9544d9b513b6f7668 /src/SignalMultiplexer.cpp
parent405de3ecd5624a350668406f5476905e5e8a1286 (diff)
downloaddabmod-09312c200b78c6b441b577911743f75921fef5b3.tar.gz
dabmod-09312c200b78c6b441b577911743f75921fef5b3.tar.bz2
dabmod-09312c200b78c6b441b577911743f75921fef5b3.zip
Add and enable TII insertion for testing
Diffstat (limited to 'src/SignalMultiplexer.cpp')
-rw-r--r--src/SignalMultiplexer.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/SignalMultiplexer.cpp b/src/SignalMultiplexer.cpp
index c5be552..8edcdc2 100644
--- a/src/SignalMultiplexer.cpp
+++ b/src/SignalMultiplexer.cpp
@@ -46,6 +46,7 @@ SignalMultiplexer::~SignalMultiplexer()
// dataIn[0] -> null symbol
// dataIn[1] -> MSC symbols
+// dataIn[2] -> (optional) TII symbol
int SignalMultiplexer::process(std::vector<Buffer*> dataIn, Buffer* dataOut)
{
#ifdef DEBUG
@@ -60,10 +61,17 @@ int SignalMultiplexer::process(std::vector<Buffer*> dataIn, Buffer* dataOut)
fprintf(stderr, ", dataOut: %p, sizeOut: %zu)\n", dataOut, dataOut->getLength());
#endif
- assert(dataIn.size() == 2);
+ assert(dataIn.size() == 2 or dataIn.size() == 3);
- *dataOut = *dataIn[0];
- *dataOut += *dataIn[1];
+ if (dataIn.size() == 2) {
+ *dataOut = *dataIn[0];
+ *dataOut += *dataIn[1];
+ }
+ else if (dataIn.size() == 3) {
+ *dataOut = *dataIn[2];
+ *dataOut += *dataIn[1];
+ }
return dataOut->getLength();
}
+