summaryrefslogtreecommitdiffstats
path: root/src/fig/FIG.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-18 22:20:11 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-18 22:20:11 +0200
commit43aebb09438ff589a7be141a5af0aec2c27eaa95 (patch)
treea01cf8fc060407dc665b456aa0bb5514b0d3a5aa /src/fig/FIG.h
parentba8a05f29b819eb99d9cc9e69f8da7003e2c79c1 (diff)
downloaddabmux-43aebb09438ff589a7be141a5af0aec2c27eaa95.tar.gz
dabmux-43aebb09438ff589a7be141a5af0aec2c27eaa95.tar.bz2
dabmux-43aebb09438ff589a7be141a5af0aec2c27eaa95.zip
Add FIG0/2, fib0 scheduler
Diffstat (limited to 'src/fig/FIG.h')
-rw-r--r--src/fig/FIG.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/fig/FIG.h b/src/fig/FIG.h
index 70b9316..90dd872 100644
--- a/src/fig/FIG.h
+++ b/src/fig/FIG.h
@@ -52,12 +52,36 @@ enum class FIG_rate {
E, // all in two minutes
};
+/* Helper function to calculate the deadline for the next transmission, in milliseconds */
+inline int rate_increment_ms(FIG_rate rate)
+{
+ switch (rate) {
+ case FIG_rate::FIG0_0: return 0; // Is a special case
+ case FIG_rate::A: return 100;
+ case FIG_rate::B: return 1000;
+ case FIG_rate::C: return 10000;
+ case FIG_rate::D: return 30000;
+ case FIG_rate::E: return 120000;
+ }
+}
+
class IFIG
{
public:
virtual size_t fill(uint8_t *buf, size_t max_size) = 0;
virtual FIG_rate repetition_rate(void) = 0;
+
+ virtual const int figtype(void) const = 0;
+ virtual const int figextension(void) const = 0;
+
+ virtual const std::string name(void) const
+ {
+ std::stringstream ss;
+ ss << figtype() << "/" << figextension();
+ return ss.str();
+ }
+
};
#endif // __FIG_H_