Eurosignal: Allow dialing (paging) of Spare Digits

This commit is contained in:
Andreas Eversberg 2020-03-27 17:26:21 +01:00
parent 89602822e6
commit fa6a73a2e1
3 changed files with 28 additions and 9 deletions

View File

@ -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>

View File

@ -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 },
};

View File

@ -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;
}