diff --git a/src/ascii_cmd.c b/src/ascii_cmd.c index 4567275..35b7c36 100644 --- a/src/ascii_cmd.c +++ b/src/ascii_cmd.c @@ -72,6 +72,16 @@ static void handle_ertp(char *arg, RDSModulator* mod, char* output) { } } +static void handle_linkage(char *arg, RDSModulator* mod, char* output) { + if(arg[0] == '\0') { + mod->enc->data[mod->enc->program].eon_linkage = 0; + return; + } + + mod->enc->data[mod->enc->program].eon_linkage = atoi(arg); + strcpy(output, "+\0"); +} + static void handle_lps(char *arg, RDSModulator* mod, char* output) { arg[LPS_LENGTH * 2] = 0; set_rds_lps(mod->enc, arg); @@ -495,6 +505,7 @@ static const command_handler_t commands_eq5[] = { {"DPTY", handle_dpty, 4}, {"SLCD", handle_slcd, 4}, {"ERTP", handle_ertp, 4}, + {"LINK", handle_link, 4}, }; static const command_handler_t commands_eq2[] = { diff --git a/src/rds.c b/src/rds.c index 5a12a09..dcd9676 100644 --- a/src/rds.c +++ b/src/rds.c @@ -365,12 +365,14 @@ static void get_rds_lps_group(RDSEncoder* enc, RDSGroup *group) { static void get_rds_ecc_group(RDSEncoder* enc, RDSGroup *group) { group->b |= 1 << 12; - group->c = enc->data[enc->program].ecc; + group->c = enc->state[enc->program].eon_linkage << 15; + group->c |= enc->data[enc->program].ecc; } static void get_rds_slcdata_group(RDSEncoder* enc, RDSGroup *group) { group->b |= 1 << 12; - group->c = 0x6000; + group->c = enc->state[enc->program].eon_linkage << 15; + group->c |= 0x6000; group->c |= enc->data[enc->program].slc_data; } diff --git a/src/rds.h b/src/rds.h index 58c5f93..a02d522 100644 --- a/src/rds.h +++ b/src/rds.h @@ -166,6 +166,8 @@ typedef struct { uint8_t af_state : 6; uint8_t af_oda_state : 6; + uint8_t eon_linkage : 1; + uint16_t last_stream0_group[3]; } RDSState;