Eurosignal: Allow dialing (paging) of Spare Digits
This commit is contained in:
@@ -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 },
|
||||
};
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user