Skip to content

Commit

Permalink
Merge pull request #573 from darksidelemm/testing
Browse files Browse the repository at this point in the history
LMS6-403 subtypes
  • Loading branch information
darksidelemm authored Sep 12, 2021
2 parents 4712e39 + 18ac41e commit 960575e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 21 deletions.
2 changes: 1 addition & 1 deletion auto_rx/autorx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# MINOR - New sonde type support, other fairly big changes that may result in telemetry or config file incompatability issus.
# PATCH - Small changes, or minor feature additions.

__version__ = "1.5.6-beta4"
__version__ = "1.5.6-beta5"


# Global Variables
Expand Down
6 changes: 2 additions & 4 deletions auto_rx/autorx/sondehub.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,8 @@ def reformat_data(self, telemetry):

elif telemetry["type"] == "LMS6":
_output["manufacturer"] = "Lockheed Martin"
if "LMSX" in telemetry["id"]:
_output["type"] = "LMSX-400"
else:
_output["type"] = "LMS6-400"
_output["type"] = "LMS6-403"
_output["subtype"] = telemetry["subtype"]
_output["serial"] = telemetry["id"].split("-")[1]

elif telemetry["type"] == "MK2LMS":
Expand Down
4 changes: 2 additions & 2 deletions auto_rx/autorx/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def short_type_lookup(type_name):
elif type_name.startswith("M20"):
return "Meteomodem M20"
elif type_name == "LMS6":
return "Lockheed Martin LMS6-400"
return "Lockheed Martin LMS6-403"
elif type_name == "MK2LMS":
return "Lockheed Martin LMS6-1680"
elif type_name == "IMET":
Expand Down Expand Up @@ -210,7 +210,7 @@ def short_short_type_lookup(type_name):
elif type_name.startswith("M20"):
return "M20"
elif type_name == "LMS6":
return "LMS6-400"
return "LMS6-403"
elif type_name == "MK2LMS":
return "LMS6-1680"
elif type_name == "IMET":
Expand Down
40 changes: 26 additions & 14 deletions demod/mod/lms6Xmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,8 @@ static int get_GPSlat(gpx_t *gpx) {
for (i = 0; i < 4; i++) {
gpslat |= gpslat_bytes[i] << (8*(3-i));
}
if (gpx->typ == 6) lat = gpslat / B60B60;
else /*typ==10*/ lat = gpslat / 1e7;
if ((gpx->typ & 0xFF) == 6) lat = gpslat / B60B60;
else /* gpx->typ == 10 */ lat = gpslat / 1e7;

gpx->lat = lat;

Expand All @@ -597,8 +597,8 @@ static int get_GPSlon(gpx_t *gpx) {
gpslon |= gpslon_bytes[i] << (8*(3-i));
}

if (gpx->typ == 6) lon = gpslon / B60B60;
else /*typ==10*/ lon = gpslon / 1e7;
if ((gpx->typ & 0xFF) == 6) lon = gpslon / B60B60;
else /* gpx->typ == 10 */ lon = gpslon / 1e7;

gpx->lon = lon;

Expand All @@ -618,8 +618,8 @@ static int get_GPSalt(gpx_t *gpx) {
gpsheight |= gpsheight_bytes[i] << (8*(3-i));
}

if (gpx->typ == 6) alt = gpsheight / 1000.0;
else /*typ==10*/ alt = gpsheight / 100.0;
if ((gpx->typ & 0xFF) == 6) alt = gpsheight / 1000.0;
else /* gpx->typ == 10 */ alt = gpsheight / 100.0;

gpx->alt = alt;

Expand Down Expand Up @@ -726,7 +726,7 @@ static void print_frame(gpx_t *gpx, int crc_err, int len) {
get_GPSlat(gpx);
get_GPSlon(gpx);
err2 = get_GPSalt(gpx);
if (gpx->typ == 6)
if ((gpx->typ & 0xFF) == 6)
{
err1 = get_GPStime(gpx, crc_err);
get_GPSvel24(gpx);
Expand Down Expand Up @@ -764,15 +764,17 @@ static void print_frame(gpx_t *gpx, int crc_err, int len) {
if (crc_err==0) { // CRC-OK
// UTC oder GPS?
char *ver_jsn = NULL;
char sntyp[] = "LMS6-";
if (gpx->typ == 10) sntyp[3] = 'X';
char sntyp[] = "LMS6-";
char subtyp[] = "LMS6-403\0\0";
if (gpx->typ == 10) { sntyp[3] = 'X'; subtyp[3] = 'X'; }
else if (gpx->typ == 0x0206) strcpy(subtyp, "LMS6-403-2");
printf("{ \"type\": \"%s\"", "LMS");
printf(", \"frame\": %d, \"id\": \"%s%d\", \"datetime\": \"", gpx->frnr, sntyp, gpx->sn );
//if (gpx->week > 0) printf("%04d-%02d-%02dT", gpx->jahr, gpx->monat, gpx->tag );
printf("%02d:%02d:%06.3fZ\", \"lat\": %.5f, \"lon\": %.5f, \"alt\": %.5f, \"vel_h\": %.5f, \"heading\": %.5f, \"vel_v\": %.5f",
gpx->std, gpx->min, gpx->sek, gpx->lat, gpx->lon, gpx->alt, gpx->vH, gpx->vD, gpx->vV );
printf(", \"gpstow\": %d", gpx->gpstow );
printf(", \"subtype\": \"%c\"", sntyp[3]); // "6":LMS6-403, "X":lms6X, "MK2A":LMS6-1680/Mk2a
printf(", \"subtype\": \"%s\"", subtyp); // "LMS6-403", "LMS6-403-2", "LMSX-403"; "MK2A":LMS6-1680/Mk2a
if (gpx->jsn_freq > 0) {
printf(", \"freq\": %d", gpx->jsn_freq);
}
Expand Down Expand Up @@ -802,6 +804,8 @@ static int frmsync_6(gpx_t *gpx, ui8_t block_bytes[], int blk_pos) {
if (sf6_00 == 4 || sf6_05 == 4) {
gpx->sf6 = 4;
gpx->frm_pos = 0;
gpx->typ = 6;
if (sf6_05 == 4) gpx->typ |= 0x0200;
break;
}
blk_pos++;
Expand Down Expand Up @@ -871,7 +875,7 @@ static void proc_frame(gpx_t *gpx, int len) {

blk_pos = SYNC_LEN;

if (gpx->typ == 6)
if ((gpx->typ & 0xFF) == 6)
{
if (gpx->option.ecc) {
for (j = 0; j < rs_N; j++) rs_cw[rs_N-1-j] = block_bytes[SYNC_LEN+j];
Expand Down Expand Up @@ -934,7 +938,11 @@ static void proc_frame(gpx_t *gpx, int len) {
if (sf6_00 == 4 || sf6_05 == 4) {
gpx->sf6 = 4;
gpx->frm_pos = 0;
if (gpx->auto_detect) { gpx->typ = 6; gpx->reset_dsp = 1; }
if (gpx->auto_detect) {
gpx->reset_dsp = 1;
gpx->typ = 6;
if (sf6_05 == 4) gpx->typ |= 0x0200;
}
break;
}
blk_pos++;
Expand All @@ -944,7 +952,11 @@ static void proc_frame(gpx_t *gpx, int len) {
// LMS6: frm_rate = 4800.0 * FRAME_LEN/BLOCK_LEN = 4800*300/260 = 5538
// LMSX: delta_mp = 4797.8 (longer timesync-frames possible)
if (gpx->frm_rate > 5000.0 || gpx->frm_rate < 4000.0) { // lms6-blocklen = 260/300 sr, sync wird ueberlesen ...
if (gpx->auto_detect) { gpx->typ = 6; gpx->reset_dsp = 1; }
if (gpx->auto_detect) {
gpx->reset_dsp = 1;
gpx->typ = 6;
//if (sf6_05 == 4) gpx->typ |= 0x0200;
}
}
}
else
Expand Down Expand Up @@ -1419,7 +1431,7 @@ int main(int argc, char **argv) {

bitofs = bitofsX + shift;
}
if (gpx->typ == 6) {
if ((gpx->typ & 0xFF) == 6) {
// set lms6
rawbitblock_len = RAWBITBLOCK_LEN_6;
dsp.br = (float)BAUD_RATE6;
Expand Down

0 comments on commit 960575e

Please sign in to comment.