Fix checking for a compatible radio name.

This commit is contained in:
Serge Vakulenko 2018-09-13 12:30:47 -07:00
parent 1add5d94a2
commit 8be79da3e0
2 changed files with 9 additions and 3 deletions

View File

@ -1373,7 +1373,11 @@ static void md380_parse_parameter(radio_device_t *radio, char *param, char *valu
general_settings_t *gs = GET_SETTINGS();
if (strcasecmp("Radio", param) == 0) {
if (strcasecmp(radio->name, value) != 0) {
// Accept any of compatible identifiers.
if (strcasecmp("TYT MD-380", value) != 0 &&
strcasecmp("Zastone D900", value) != 0 &&
strcasecmp("Zastone DP880", value) != 0 &&
strcasecmp("Radtel RT-27D", value) != 0) {
fprintf(stderr, "Bad value for %s: %s\n", param, value);
exit(-1);
}

View File

@ -1466,9 +1466,11 @@ static void uv380_parse_parameter(radio_device_t *radio, char *param, char *valu
general_settings_t *gs = GET_SETTINGS();
if (strcasecmp("Radio", param) == 0) {
// Accept either MD-2017 or MD-UV380.
// Accept any of compatible identifiers.
if (strcasecmp("TYT MD-2017", value) != 0 &&
strcasecmp("TYT MD-UV380", value) != 0) {
strcasecmp("TYT MD-UV380", value) != 0 &&
strcasecmp("TYT MD-UV390", value) != 0 &&
strcasecmp("TYT MD-9600", value) != 0) {
fprintf(stderr, "Bad value for %s: %s\n", param, value);
exit(-1);
}