summaryrefslogtreecommitdiffstats
path: root/src/MuxElements.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-08-01 12:07:51 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-08-01 12:07:51 +0200
commit0ebce6201e7501b43adc95a394117d1060b3a65e (patch)
tree947ff3ab2f0abf941d3baa2bb62b05625fe00d30 /src/MuxElements.h
parenta95438527f2db7a1535ce679edde004b982dba60 (diff)
downloaddabmux-0ebce6201e7501b43adc95a394117d1060b3a65e.tar.gz
dabmux-0ebce6201e7501b43adc95a394117d1060b3a65e.tar.bz2
dabmux-0ebce6201e7501b43adc95a394117d1060b3a65e.zip
Refactor protection handling for better readability
Diffstat (limited to 'src/MuxElements.h')
-rw-r--r--src/MuxElements.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/MuxElements.h b/src/MuxElements.h
index 0f9fa18..f1097c0 100644
--- a/src/MuxElements.h
+++ b/src/MuxElements.h
@@ -124,23 +124,39 @@ class dabEnsemble : public RemoteControllable {
};
-struct dabProtectionShort {
+struct dabProtectionUEP {
unsigned char tableSwitch;
unsigned char tableIndex;
};
+enum dab_protection_eep_profile {
+ EEP_A,
+ EEP_B
+};
+
+struct dabProtectionEEP {
+ dab_protection_eep_profile profile;
-struct dabProtectionLong {
- unsigned char option;
+ // option is a 3-bit field where 000 and 001 are used to
+ // select EEP profile A and B.
+ // Other values are for future use, see
+ // EN 300 401 Clause 6.2.1 "Basic sub-channel organisation"
+ uint8_t GetOption(void) const {
+ return (this->profile == EEP_A) ? 0 : 1;
+ }
};
+enum dab_protection_form_t {
+ UEP, // implies FIG0/1 Short form
+ EEP // Long form
+};
struct dabProtection {
unsigned char level;
- unsigned char form;
+ dab_protection_form_t form;
union {
- dabProtectionShort shortForm;
- dabProtectionLong longForm;
+ dabProtectionUEP uep;
+ dabProtectionEEP eep;
};
};