summaryrefslogtreecommitdiffstats
path: root/src/SignalMultiplexer.cpp
diff options
context:
space:
mode:
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();
}
+