aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2021-05-25 15:15:29 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2021-05-25 15:15:29 +0200
commit5bbf58b0252a840934a464746fc3275959a37a02 (patch)
tree666a6701e3e5f4277eadd4ad825eee6fc6073cc5
parentae6c0d5c568a57a66cdf0c40053891c517a49019 (diff)
downloadODR-EDI2EDI-5bbf58b0252a840934a464746fc3275959a37a02.tar.gz
ODR-EDI2EDI-5bbf58b0252a840934a464746fc3275959a37a02.tar.bz2
ODR-EDI2EDI-5bbf58b0252a840934a464746fc3275959a37a02.zip
Carry SEQ and PSEQ through
-rw-r--r--src/EDISender.cpp14
-rw-r--r--src/EDISender.h1
-rw-r--r--src/main.cpp1
3 files changed, 16 insertions, 0 deletions
diff --git a/src/EDISender.cpp b/src/EDISender.cpp
index 6774aee..30c7289 100644
--- a/src/EDISender.cpp
+++ b/src/EDISender.cpp
@@ -104,6 +104,20 @@ void EDISender::send_tagpacket(tagpacket_t& tp)
if (edi_sender and edi_conf.enabled()) {
edi::TagPacket edi_tagpacket(0);
+
+ if (tp.seq.seq_valid) {
+ edi_sender->override_af_sequence(tp.seq.seq);
+ }
+
+ if (tp.seq.pseq_valid) {
+ edi_sender->override_pft_sequence(tp.seq.pseq);
+ }
+ else if (tp.seq.seq_valid) {
+ // If the source isn't using PFT, set PSEQ = SEQ so that multihoming
+ // with several EDI2EDI instances could work.
+ edi_sender->override_pft_sequence(tp.seq.seq);
+ }
+
edi_tagpacket.raw_tagpacket = move(tp.tagpacket);
edi_sender->write(edi_tagpacket);
}
diff --git a/src/EDISender.h b/src/EDISender.h
index 98525ed..f5a14b2 100644
--- a/src/EDISender.h
+++ b/src/EDISender.h
@@ -44,6 +44,7 @@ struct tagpacket_t {
std::vector<uint8_t> tagpacket;
EdiDecoder::frame_timestamp_t timestamp;
std::chrono::steady_clock::time_point received_at;
+ EdiDecoder::seq_info_t seq;
};
class EDISender {
diff --git a/src/main.cpp b/src/main.cpp
index f29290f..6714052 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -116,6 +116,7 @@ class Main : public EdiDecoder::ETIDataCollector {
virtual void assemble(EdiDecoder::ReceivedTagPacket&& tag_data) override
{
tagpacket_t tp;
+ tp.seq = tag_data.seq;
tp.dlfc = dlfc;
tp.tagpacket = move(tag_data.tagpacket);
tp.received_at = std::chrono::steady_clock::now();