summaryrefslogtreecommitdiffstats
path: root/src/ParserCmdline.cpp
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/ParserCmdline.cpp
parenta95438527f2db7a1535ce679edde004b982dba60 (diff)
downloaddabmux-0ebce6201e7501b43adc95a394117d1060b3a65e.tar.gz
dabmux-0ebce6201e7501b43adc95a394117d1060b3a65e.tar.bz2
dabmux-0ebce6201e7501b43adc95a394117d1060b3a65e.zip
Refactor protection handling for better readability
Diffstat (limited to 'src/ParserCmdline.cpp')
-rw-r--r--src/ParserCmdline.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/ParserCmdline.cpp b/src/ParserCmdline.cpp
index 98140de..9768d20 100644
--- a/src/ParserCmdline.cpp
+++ b/src/ParserCmdline.cpp
@@ -400,14 +400,14 @@ bool parse_cmdline(char **argv,
(*subchannel)->startAddress = 0;
if (c == 'A') {
- protection->form = 0;
+ protection->form = UEP;
protection->level = 2;
- protection->shortForm.tableSwitch = 0;
- protection->shortForm.tableIndex = 0;
+ protection->uep.tableSwitch = 0;
+ protection->uep.tableIndex = 0;
} else {
+ protection->form = EEP;
protection->level = 2;
- protection->form = 1;
- protection->longForm.option = 0;
+ protection->eep.profile = EEP_A;
}
break;
case 'L':
@@ -590,17 +590,18 @@ bool parse_cmdline(char **argv,
goto EXIT;
}
level = strtoul(optarg, NULL, 0) - 1;
- if (protection->form == 0) {
+ if (protection->form == UEP) {
if ((level < 0) || (level > 4)) {
etiLog.log(error,
- "protection level must be between "
+ "UEP protection level must be between "
"1 to 5 inclusively (current = %i)\n", level);
goto EXIT;
}
- } else {
+ }
+ else if (protection->form == EEP) {
if ((level < 0) || (level > 3)) {
etiLog.log(error,
- "protection level must be between "
+ "EEP protection level must be between "
"1 to 4 inclusively (current = %i)\n", level);
goto EXIT;
}