mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-21 21:25:40 -05:00
M17 - Check Caps and Special CSD Values;
This commit is contained in:
@@ -2982,6 +2982,13 @@ main (int argc, char **argv)
|
||||
//read in values
|
||||
//string in format of M17:can:src_csd:dst_csd
|
||||
|
||||
//check and capatalize any letters in the CSD
|
||||
for (int i = 0; state.m17dat[i]!='\0'; i++)
|
||||
{
|
||||
if(state.m17dat[i] >= 'a' && state.m17dat[i] <= 'z')
|
||||
state.m17dat[i] = state.m17dat[i] -32;
|
||||
}
|
||||
|
||||
fprintf (stderr, "M17 User Data: ");
|
||||
char * curr;
|
||||
|
||||
|
||||
12
src/m17.c
12
src/m17.c
@@ -1307,6 +1307,12 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state)
|
||||
|
||||
if (state->str50b[0] != 0)
|
||||
sprintf (d40, "%s", state->str50b);
|
||||
|
||||
//if special values, then assign them
|
||||
if (strcmp (d40, "BROADCAST") == 0)
|
||||
dst = 0xFFFFFFFFFFFF;
|
||||
if (strcmp (d40, "ALL") == 0)
|
||||
dst = 0xFFFFFFFFFFFF;
|
||||
//end
|
||||
|
||||
int i, j, k, x; //basic utility counters
|
||||
@@ -2300,6 +2306,12 @@ void encodeM17PKT(dsd_opts * opts, dsd_state * state)
|
||||
// s40[10] = '\0';
|
||||
// d40[10] = '\0';
|
||||
|
||||
//if special values, then assign them
|
||||
if (strcmp (d40, "BROADCAST") == 0)
|
||||
dst = 0xFFFFFFFFFFFF;
|
||||
if (strcmp (d40, "ALL") == 0)
|
||||
dst = 0xFFFFFFFFFFFF;
|
||||
|
||||
//debug
|
||||
// fprintf (stderr, " SRC: %s; DST: %s; SRC_D: %llX; DST_D: %llX; SLEN %d; DLEN: %d;", s40, d40, src, dst, strlen(s40), strlen(d40) );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user