From 55a66f6408042abfd102f92fd0072a000d8e0235 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sat, 15 Aug 2015 11:53:55 +0200 Subject: Add cluster handling for announcements --- src/fig/FIG0.cpp | 9 +++++---- src/fig/FIG0.h | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) (limited to 'src/fig') diff --git a/src/fig/FIG0.cpp b/src/fig/FIG0.cpp index 7cb3dde..9f89109 100644 --- a/src/fig/FIG0.cpp +++ b/src/fig/FIG0.cpp @@ -953,8 +953,7 @@ FillStatus FIG0_18::fill(uint8_t *buf, size_t max_size) continue; } - // TODO support more than one cluster - const int numclusters = 1; + const ssize_t numclusters = (*service)->clusters.size(); if (remaining < (int)sizeof(FIGtype0_18) + numclusters) { break; @@ -982,8 +981,10 @@ FillStatus FIG0_18::fill(uint8_t *buf, size_t max_size) programme->Rfa = 0; programme->NumClusters = numclusters; buf += sizeof(FIGtype0_18); - buf[0] = 0x1; // TODO support not only cluster 1 - buf += numclusters; + + for (uint8_t cluster : (*service)->clusters) { + *(buf++) = cluster; + } fig0->Length += sizeof(FIGtype0_18) + numclusters; remaining -= sizeof(FIGtype0_18) + numclusters; diff --git a/src/fig/FIG0.h b/src/fig/FIG0.h index 0c11ced..9015b00 100644 --- a/src/fig/FIG0.h +++ b/src/fig/FIG0.h @@ -214,6 +214,23 @@ class FIG0_18 : public IFIG std::vector >::iterator service; }; +// FIG type 0/19 +class FIG0_19 : public IFIG +{ + public: + FIG0_19(FIGRuntimeInformation* rti); + virtual FillStatus fill(uint8_t *buf, size_t max_size); + virtual FIG_rate repetition_rate(void) { return FIG_rate::A; } + + virtual const int figtype(void) const { return 0; } + virtual const int figextension(void) const { return 19; } + + private: + FIGRuntimeInformation *m_rti; + bool m_initialised; + std::vector >::iterator service; +}; + } // namespace FIC #endif // __FIG0_H_ -- cgit v1.2.3