aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2020-03-27 17:26:21 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2020-03-27 17:28:03 +0100
commitfa6a73a2e16e9bf43f827c91bc93fd9f02124cc6 (patch)
treee53c9b32527ced1a785165d2a1ca91ed4e561600
parent89602822e67c710210494275dda5c8f0335a83bd (diff)
Eurosignal: Allow dialing (paging) of Spare Digits
-rw-r--r--docs/eurosignal.html13
-rw-r--r--src/eurosignal/dsp.c10
-rw-r--r--src/eurosignal/eurosignal.c14
3 files changed, 28 insertions, 9 deletions
diff --git a/docs/eurosignal.html b/docs/eurosignal.html
index 081efe9..305d714 100644
--- a/docs/eurosignal.html
+++ b/docs/eurosignal.html
@@ -212,6 +212,19 @@ Then the software will decode the received IDs and display them.
You may also use both -R -T to allow the software to decode while it is encoding.
</p>
+<p>
+You may append a station ID as command line option, so it is pre-selected and must not be typed in.
+You can also use digits like 'A', 'B', 'C', 'D' and 'E' to define Spare digits 1..5.
+I guess that these extension digis were never used, but it is supported by most pagers.
+Using a "Spare 2" as third digit looks like this:
+</p>
+
+<pre>
+
+# src/eurosignal/eurosignal -k B 12B456
+
+</pre>
+
<hr><center>[<a href="index.html">Back to main page</a>]</center><hr>
</td></tr></table></center>
</body>
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;
}