aboutsummaryrefslogtreecommitdiffstats
path: root/src/eurosignal
diff options
context:
space:
mode:
Diffstat (limited to 'src/eurosignal')
-rw-r--r--src/eurosignal/dsp.c10
-rw-r--r--src/eurosignal/eurosignal.c14
2 files changed, 15 insertions, 9 deletions
diff --git a/src/eurosignal/dsp.c b/src/eurosignal/dsp.c
index 7119935..119fc21 100644
--- a/src/eurosignal/dsp.c
+++ b/src/eurosignal/dsp.c
@@ -66,11 +66,11 @@ static struct dsp_digits {
{ '7', "Digit 7", 554.0, 0 },
{ '8', "Digit 8", 510.7, 0 },
{ '9', "Digit 9", 470.8, 0 },
- { 'A', "Digit 10", 433.9, 0 },
- { 'B', "Digit 11", 400.0, 0 },
- { 'C', "Digit 12", 368.7, 0 },
- { 'D', "Digit 13", 339.9, 0 },
- { 'E', "Digit 14", 313.3, 0 },
+ { 'A', "Spare 1", 433.9, 0 },
+ { 'B', "Spare 2", 400.0, 0 },
+ { 'C', "Spare 3", 368.7, 0 },
+ { 'D', "Spare 4", 339.9, 0 },
+ { 'E', "Spare 5", 313.3, 0 },
{ '\0', NULL, 0.0, 0 },
};
diff --git a/src/eurosignal/eurosignal.c b/src/eurosignal/eurosignal.c
index 21a2730..661f6dc 100644
--- a/src/eurosignal/eurosignal.c
+++ b/src/eurosignal/eurosignal.c
@@ -422,9 +422,13 @@ void euro_get_id(euro_t *euro, char *id)
}
encode:
- /* return station ID with repeat digit */
- for (i = 1; i < 6; i++) {
- if (id[i - 1] == id[i])
+ /* return station ID (upper case) with repeat digit, when required */
+ for (i = 0; i < 6; i++) {
+ /* to upper case */
+ if (id[i] >= 'a' && id[i] <= 'z')
+ id[i] = id[i] - 'a' + 'A';
+ /* repeat digit */
+ if (i && id[i - 1] == id[i])
id[i] = 'R';
}
}
@@ -687,7 +691,9 @@ inval:
return -CAUSE_INVALNUMBER;
}
for (i = 0; i < 6; i++) {
- if (dialing[i] < '0' || dialing[i] > '9')
+ if (!(dialing[i] >= '0' && dialing[i] <= '9')
+ && !(dialing[i] >= 'a' && dialing[i] <= 'e')
+ && !(dialing[i] >= 'A' && dialing[i] <= 'E'))
goto inval;
}