diff --git a/demod/mod/rs41mod.c b/demod/mod/rs41mod.c index 8d0309c..ecee72a 100644 --- a/demod/mod/rs41mod.c +++ b/demod/mod/rs41mod.c @@ -151,7 +151,8 @@ typedef struct { ui16_t conf_bt; // burst timer (sec) ui16_t conf_cd; // kill countdown (sec) (kt or bt) ui8_t conf_bk; // burst kill - char rstyp[9]; // RS41-SG, RS41-SGP + char rstyp[10]; // RS41-SG, RS41-SGP, RS41-SGPE + char rstmp[10]; // RS41-SG, RS41-SGP, RS41-SGPE char rsm[10]; // RSM421 int aux; char xdata[XDATA_LEN+16]; // xdata: aux_str1#aux_str2 ... @@ -343,7 +344,8 @@ GPS chip: ublox UBX-G6010-ST #define pos_Calfreq 0x055 // 2 byte, calfr 0x00 #define pos_Calburst 0x05E // 1 byte, calfr 0x02 // ? #define pos_Caltimer 0x05A // 2 byte, calfr 0x02 ? -#define pos_CalRSTyp 0x05B // 8 byte, calfr 0x21 (+2 byte in 0x22?) +#define pos_CalRSTyp 0x05B // 8 byte, calfr 0x21 (+2 byte in 0x22) +#define pos_CalRSTyp2 0x053 // 1+1 byte, calfr 0x22 // weitere chars in calfr 0x22/0x23; weitere ID (RSM) #define pos_CalRSM 0x055 // 6 byte, calfr 0x22 @@ -468,7 +470,8 @@ static int get_SondeID(gpx_t *gpx, int crc, int ofs) { //for (i = 0; i < 51; i++) gpx->calfrchk[i] = 0; memset(gpx->calfrchk, 0, 51); // 0x00..0x32 // reset conf data - memset(gpx->rstyp, 0, 9); + memset(gpx->rstyp, 0, 10); + memset(gpx->rstmp, 0, 10); memset(gpx->rsm, 0, 10); gpx->calconf_complete = 0; gpx->calconf_sent = 0; @@ -1551,8 +1554,6 @@ static int get_Calconf(gpx_t *gpx, int out, int ofs) { ui8_t calfr = 0; ui16_t fw = 0; int freq = 0, f0 = 0, f1 = 0; - char sondetyp[9]; - char rsmtyp[10]; int err = 0; gpx->calconf_subfrm = gpx->frame+pos_CalData+ofs; @@ -1621,14 +1622,13 @@ static int get_Calconf(gpx_t *gpx, int out, int ofs) { } if (calfr == 0x21) { // ... eventuell noch 2 bytes in 0x22 - for (i = 0; i < 9; i++) sondetyp[i] = 0; + memset(gpx->rstmp, 0, 10); for (i = 0; i < 8; i++) { byte = gpx->frame[pos_CalRSTyp+ofs + i]; - if ((byte >= 0x20) && (byte < 0x7F)) sondetyp[i] = byte; - else if (byte == 0x00) sondetyp[i] = '\0'; + if ((byte >= 0x20) && (byte < 0x7F)) gpx->rstmp[i] = byte; + else if (byte == 0x00) gpx->rstmp[i] = '\0'; } - if (out && gpx->option.vbs) fprintf(stdout, ": %s ", sondetyp); - strcpy(gpx->rstyp, sondetyp); + if (out && gpx->option.vbs == 3) { // Stationsdruck QFE float qfe1 = 0.0, qfe2 = 0.0; memcpy(&qfe1, gpx->frame+pos_CalData+1, 4); @@ -1642,14 +1642,21 @@ static int get_Calconf(gpx_t *gpx, int out, int ofs) { } if (calfr == 0x22) { - for (i = 0; i < 10; i++) rsmtyp[i] = 0; + // CalRSTyp-part2 + byte = gpx->frame[pos_CalRSTyp2+ofs + 0]; // gpx->frame[pos_CalRSTyp2+ofs + 1] = 0x00 + if ((byte >= 0x20) && (byte < 0x7F)) gpx->rstmp[8] = byte; + else if (byte == 0x00) gpx->rstmp[8] = '\0'; + strcpy(gpx->rstyp, gpx->rstmp); + memset(gpx->rstmp, 0, 10); + if (out && gpx->option.vbs && *gpx->rstyp) fprintf(stdout, ": %s ", gpx->rstyp); + + memset(gpx->rsm, 0, 10); for (i = 0; i < 8; i++) { byte = gpx->frame[pos_CalRSM+ofs + i]; - if ((byte >= 0x20) && (byte < 0x7F)) rsmtyp[i] = byte; - else /*if (byte == 0x00)*/ rsmtyp[i] = '\0'; + if ((byte >= 0x20) && (byte < 0x7F)) gpx->rsm[i] = byte; + else /*if (byte == 0x00)*/ gpx->rsm[i] = '\0'; } - if (out && gpx->option.vbs) fprintf(stdout, ": %s ", rsmtyp); - strcpy(gpx->rsm, rsmtyp); + if (out && gpx->option.vbs) fprintf(stdout, ": %s ", gpx->rsm); } }