Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UV380: add ContactsCSV setting #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion uv380.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@ typedef struct {
uint8_t _unused66_0 : 2,
keypad_tones : 1,
intro_picture : 1,
_unused66_4 : 4;
_unused66_4 : 2,
contacts_csv : 1,
_unused66_7 : 1;

// Byte 67
uint8_t _unused67;
Expand Down Expand Up @@ -781,6 +783,13 @@ static void print_chanlist(FILE *out, uint16_t *unsorted, int nchan)
fprintf(out, "-%d", last);
}

static void print_contactscsv(FILE *out, int verbose) {
general_settings_t *gs = GET_SETTINGS();
if(verbose)
fprintf(out, "\n# Whether to show contact details from CSV.\n");
fprintf(out, "ContactsCSV: %i\n", gs->contacts_csv == 0 ? 1 : 0);
}

static void print_id(FILE *out, int verbose)
{
general_settings_t *gs = GET_SETTINGS();
Expand Down Expand Up @@ -1356,6 +1365,7 @@ static void uv380_print_config(radio_device_t *radio, FILE *out, int verbose)
// General settings.
print_id(out, verbose);
print_intro(out, verbose);
print_contactscsv(out, verbose);
}

//
Expand Down Expand Up @@ -1495,6 +1505,10 @@ static void uv380_parse_parameter(radio_device_t *radio, char *param, char *valu
utf8_decode(gs->intro_line2, value, 10);
return;
}
if (strcasecmp ("ContactsCSV", param) == 0) {
gs->contacts_csv = !(*value == '1');
return;
}
fprintf(stderr, "Unknown parameter: %s = %s\n", param, value);
exit(-1);
}
Expand Down