GD-77: fix grouplists.

This commit is contained in:
Serge Vakulenko 2018-10-04 20:05:33 -07:00
parent 562c383225
commit 49118eb5cc

11
gd77.c
View File

@ -230,8 +230,8 @@ typedef struct {
// Bytes 0-15 // Bytes 0-15
uint8_t name[16]; // Group List Name uint8_t name[16]; // Group List Name
// Bytes 16-47 // Bytes 16-79
uint16_t member[16]; // Contacts uint16_t member[32]; // Contacts
} grouplist_t; } grouplist_t;
// //
@ -646,8 +646,7 @@ static int grouplist_append(int index, int cnum)
grouplist_t *gl = &gt->grouplist[index]; grouplist_t *gl = &gt->grouplist[index];
int i; int i;
//TODO: 32 contacts per RX group list in GD-77. for (i=0; i<32; i++) {
for (i=0; i<16; i++) {
if (gl->member[i] == cnum) if (gl->member[i] == cnum)
return 1; return 1;
if (gl->member[i] == 0) { if (gl->member[i] == 0) {
@ -1378,7 +1377,7 @@ static void gd77_print_config(radio_device_t *radio, FILE *out, int verbose)
print_ascii(out, gl->name, 16, 1); print_ascii(out, gl->name, 16, 1);
fprintf(out, " "); fprintf(out, " ");
if (gl->member[0]) { if (gl->member[0]) {
print_chanlist(out, gl->member, 16, 0); print_chanlist(out, gl->member, 32, 0);
} else { } else {
fprintf(out, "-"); fprintf(out, "-");
} }
@ -2321,7 +2320,7 @@ static int gd77_verify_config(radio_device_t *radio)
continue; continue;
ngrouplists++; ngrouplists++;
for (k=0; k<16; k++) { for (k=0; k<32; k++) {
int cnum = gl->member[k]; int cnum = gl->member[k];
if (cnum != 0) { if (cnum != 0) {