From 616812867feb62df72dc66aa56f4161c4c1388e5 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 22 Apr 2018 23:10:05 +0200 Subject: [PATCH] Report channel when decoding a NAV message --- .../telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc b/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc index d4980a532..e7379f7e0 100644 --- a/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc +++ b/src/algorithms/telemetry_decoder/libs/gps_l1_ca_subframe_fsm.cc @@ -39,13 +39,16 @@ //************ GPS WORD TO SUBFRAME DECODER STATE MACHINE ********** - struct Ev_gps_word_valid : sc::event { }; + + struct Ev_gps_word_invalid : sc::event { }; + + struct Ev_gps_word_preamble : sc::event { }; @@ -245,16 +248,20 @@ void GpsL1CaSubframeFsm::gps_word_to_subframe(int position) std::memcpy(&d_subframe[position * GPS_WORD_LENGTH], &d_GPS_frame_4bytes, sizeof(char) * GPS_WORD_LENGTH); } + void GpsL1CaSubframeFsm::clear_flag_new_subframe() { d_flag_new_subframe = false; } + + void GpsL1CaSubframeFsm::gps_subframe_to_nav_msg() { //int subframe_ID; // NEW GPS SUBFRAME HAS ARRIVED! d_subframe_ID = d_nav.subframe_decoder(this->d_subframe); //decode the subframe - std::cout << "New GPS NAV message received: subframe " + std::cout << "New GPS NAV message received in channel " << i_channel_ID << ": " + << "subframe " << d_subframe_ID << " from satellite " << Gnss_Satellite(std::string("GPS"), i_satellite_PRN) << std::endl; d_nav.i_satellite_PRN = i_satellite_PRN; @@ -263,6 +270,7 @@ void GpsL1CaSubframeFsm::gps_subframe_to_nav_msg() d_flag_new_subframe = true; } + void GpsL1CaSubframeFsm::Event_gps_word_valid() { this->process_event(Ev_gps_word_valid());