aboutsummaryrefslogtreecommitdiff
path: root/src/survive_cal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/survive_cal.c')
-rw-r--r--src/survive_cal.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/survive_cal.c b/src/survive_cal.c
index 2ed1986..2acf51c 100644
--- a/src/survive_cal.c
+++ b/src/survive_cal.c
@@ -15,6 +15,8 @@
#include <sys/stat.h>
#include <sys/types.h>
+#include "survive_config.h"
+
#define PTS_BEFORE_COMMON 32
#define NEEDED_COMMON_POINTS 10
#define NEEDED_TIMES_OF_COMMON 5
@@ -25,8 +27,8 @@ static void reset_calibration( struct SurviveCalData * cd );
void ootx_packet_clbk_d(ootx_decoder_context *ct, ootx_packet* packet)
{
- struct SurviveContext * ctx = (struct SurviveContext*)(ct->user);
- struct SurviveCalData * cd = ctx->calptr;
+ SurviveContext * ctx = (SurviveContext*)(ct->user);
+ SurviveCalData * cd = ctx->calptr;
int id = ct->user1;
SV_INFO( "Got OOTX packet %d %p", id, cd );
@@ -34,7 +36,7 @@ void ootx_packet_clbk_d(ootx_decoder_context *ct, ootx_packet* packet)
lighthouse_info_v6 v6;
init_lighthouse_info_v6(&v6, packet->data);
- struct BaseStationData * b = &ctx->bsd[id];
+ BaseStationData * b = &ctx->bsd[id];
//print_lighthouse_info_v6(&v6);
b->BaseStationID = v6.id;
@@ -49,6 +51,9 @@ void ootx_packet_clbk_d(ootx_decoder_context *ct, ootx_packet* packet)
b->fcalgibmag[0] = v6.fcal_0_gibmag;
b->fcalgibmag[1] = v6.fcal_1_gibmag;
b->OOTXSet = 1;
+
+ config_set_lighthouse(b,id);
+// config_save("config.json");
}
int survive_cal_get_status( struct SurviveContext * ctx, char * description, int description_length )