First pass of JSON output to the DFM06/DFM09 demod. Only have a DFM09 to test with...

pull/67/head
Mark Jessop 2018-05-09 21:55:31 +09:30
rodzic 5e79afa914
commit 87e32f0464
2 zmienionych plików z 14 dodań i 1 usunięć

Wyświetl plik

@ -10,13 +10,14 @@ gcc rs_detect.c -lm -o rs_detect
echo "Building reset_usb (will result in error under OSX)"
gcc reset_usb.c -o reset_usb
echo "Building RS92/RS41 Demodulators"
echo "Building RS92/RS41/DFM Demodulators"
cd ../demod/
gcc -c demod.c
gcc -c demod_dft.c
#gcc rs92dm.c demod.o -lm -o rs92ecc -I../ecc/ -I../rs92
gcc rs92dm_dft.c demod_dft.o -lm -o rs92ecc -I../ecc/ -I../rs92
gcc rs41dm_dft.c demod_dft.o -lm -o rs41ecc -I../ecc/ -I../rs41
gcc dfm09dm_dft.c demod_dft.o -lm -o dfm09ecc -I../ecc/ -I../dfm
# Copy all necessary files into this directory.
echo "Copying files into auto_rx directory."
@ -25,5 +26,6 @@ cp ../scan/rs_detect .
cp ../scan/reset_usb .
cp ../demod/rs92ecc .
cp ../demod/rs41ecc .
cp ../demod/dfm09ecc .
echo "Done!"

Wyświetl plik

@ -46,6 +46,8 @@ gpx_t gpx;
char dat_str[9][13+1];
// Buffer to store sonde ID
char sonde_id[] = "DFMxx-xxxxxx";
int option_verbose = 0, // ausfuehrliche Anzeige
option_raw = 0, // rohe Frames
@ -488,15 +490,24 @@ void print_gpx() {
{
if ((gpx.sonde_typ & 0xFF) == 6) {
printf(" (ID%1d:%06X) ", gpx.sonde_typ & 0xF, gpx.SN6);
sprintf(sonde_id, "DFM06-%06X", gpx.SN6);
}
if ((gpx.sonde_typ & 0xFF) == 9) {
printf(" (ID%1d:%06u) ", gpx.sonde_typ & 0xF, gpx.SN9);
sprintf(sonde_id, "DFM09-%06u", gpx.SN9);
}
gpx.sonde_typ ^= SNbit;
}
}
printf("\n");
// Print JSON blob
// Get temperature
float t = get_Temp(gpx.meas24);
printf("\n{ \"frame\": %d, \"id\": \"%s\", \"datetime\": \"%04d-%02d-%02dT%02d:%02d:%06.3fZ\", \"lat\": %.5f, \"lon\": %.5f, \"alt\": %.5f, \"vel_h\": %.5f, \"heading\": %.5f, \"vel_v\": %.5f, \"temp\":%.1f }\n", gpx.frnr, sonde_id, gpx.jahr, gpx.monat, gpx.tag, gpx.std, gpx.min, gpx.sek, gpx.lat, gpx.lon, gpx.alt, gpx.horiV, gpx.dir, gpx.vertV, t );
}
}