1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-18 11:09:56 +00:00

Indicate with a prefix the private data members for clarity

This commit is contained in:
Carles Fernandez 2020-06-19 02:15:56 +02:00
parent 8abcc2e24b
commit 7ef64860c4
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
8 changed files with 138 additions and 138 deletions

View File

@ -82,8 +82,8 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
// preamble bits to sampled symbols // preamble bits to sampled symbols
d_preamble_samples.reserve(d_samples_per_preamble); d_preamble_samples.reserve(d_samples_per_preamble);
d_frame_length_symbols = GALILEO_INAV_PAGE_PART_SYMBOLS - GALILEO_INAV_PREAMBLE_LENGTH_BITS; d_frame_length_symbols = GALILEO_INAV_PAGE_PART_SYMBOLS - GALILEO_INAV_PREAMBLE_LENGTH_BITS;
CodeLength = GALILEO_INAV_PAGE_PART_SYMBOLS - GALILEO_INAV_PREAMBLE_LENGTH_BITS; d_codelength = GALILEO_INAV_PAGE_PART_SYMBOLS - GALILEO_INAV_PREAMBLE_LENGTH_BITS;
DataLength = (CodeLength / nn) - mm; d_datalength = (d_codelength / d_nn) - d_mm;
d_max_symbols_without_valid_frame = GALILEO_INAV_PAGE_SYMBOLS * 30; // rise alarm 60 seconds without valid tlm d_max_symbols_without_valid_frame = GALILEO_INAV_PAGE_SYMBOLS * 30; // rise alarm 60 seconds without valid tlm
break; break;
@ -99,8 +99,8 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
// preamble bits to sampled symbols // preamble bits to sampled symbols
d_preamble_samples.reserve(d_samples_per_preamble); d_preamble_samples.reserve(d_samples_per_preamble);
d_frame_length_symbols = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS; d_frame_length_symbols = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS;
CodeLength = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS; d_codelength = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS;
DataLength = (CodeLength / nn) - mm; d_datalength = (d_codelength / d_nn) - d_mm;
d_max_symbols_without_valid_frame = GALILEO_FNAV_SYMBOLS_PER_PAGE * 5; // rise alarm 100 seconds without valid tlm d_max_symbols_without_valid_frame = GALILEO_FNAV_SYMBOLS_PER_PAGE * 5; // rise alarm 100 seconds without valid tlm
break; break;
} }
@ -111,8 +111,8 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
d_PRN_code_period_ms = 0U; d_PRN_code_period_ms = 0U;
d_required_symbols = 0U; d_required_symbols = 0U;
d_frame_length_symbols = 0U; d_frame_length_symbols = 0U;
CodeLength = 0; d_codelength = 0;
DataLength = 0; d_datalength = 0;
d_max_symbols_without_valid_frame = 0; d_max_symbols_without_valid_frame = 0;
std::cout << "Galileo unified telemetry decoder error: Unknown frame type " << std::endl; std::cout << "Galileo unified telemetry decoder error: Unknown frame type " << std::endl;
} }
@ -157,26 +157,25 @@ galileo_telemetry_decoder_gs::galileo_telemetry_decoder_gs(
d_flag_parity = false; d_flag_parity = false;
d_TOW_at_current_symbol_ms = 0; d_TOW_at_current_symbol_ms = 0;
d_TOW_at_Preamble_ms = 0; d_TOW_at_Preamble_ms = 0;
delta_t = 0; d_delta_t = 0;
d_CRC_error_counter = 0; d_CRC_error_counter = 0;
flag_even_word_arrived = 0; flag_even_word_arrived = 0;
d_flag_preamble = false; d_flag_preamble = false;
d_channel = 0; d_channel = 0;
flag_TOW_set = false; d_flag_PLL_180_deg_phase_locked = false;
flag_PLL_180_deg_phase_locked = false;
d_symbol_history.set_capacity(d_required_symbols + 1); d_symbol_history.set_capacity(d_required_symbols + 1);
// vars for Viterbi decoder // vars for Viterbi decoder
int32_t max_states = 1U << static_cast<uint32_t>(mm); // 2^mm int32_t max_states = 1U << static_cast<uint32_t>(d_mm); // 2^d_mm
g_encoder[0] = 121; // Polynomial G1 std::array<int32_t, 2> g_encoder{{121, 91}}; // Polynomial G1 and G2
g_encoder[1] = 91; // Polynomial G2 d_out0.reserve(max_states);
out0.reserve(max_states); d_out1.reserve(max_states);
out1.reserve(max_states); d_state0.reserve(max_states);
state0.reserve(max_states); d_state1.reserve(max_states);
state1.reserve(max_states);
// create appropriate transition matrices // create appropriate transition matrices
nsc_transit(out0.data(), state0.data(), 0, g_encoder.data(), KK, nn); nsc_transit(d_out0.data(), d_state0.data(), 0, g_encoder.data(), d_KK, d_nn);
nsc_transit(out1.data(), state1.data(), 1, g_encoder.data(), KK, nn); nsc_transit(d_out1.data(), d_state1.data(), 1, g_encoder.data(), d_KK, d_nn);
} }
@ -198,8 +197,8 @@ galileo_telemetry_decoder_gs::~galileo_telemetry_decoder_gs()
void galileo_telemetry_decoder_gs::viterbi_decoder(float *page_part_symbols, int32_t *page_part_bits) void galileo_telemetry_decoder_gs::viterbi_decoder(float *page_part_symbols, int32_t *page_part_bits)
{ {
Viterbi(page_part_bits, out0.data(), state0.data(), out1.data(), state1.data(), Viterbi(page_part_bits, d_out0.data(), d_state0.data(), d_out1.data(), d_state1.data(),
page_part_symbols, KK, nn, DataLength); page_part_symbols, d_KK, d_nn, d_datalength);
} }
@ -291,8 +290,8 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in
std::shared_ptr<Galileo_Utc_Model> tmp_obj = std::make_shared<Galileo_Utc_Model>(d_inav_nav.get_utc_model()); std::shared_ptr<Galileo_Utc_Model> tmp_obj = std::make_shared<Galileo_Utc_Model>(d_inav_nav.get_utc_model());
std::cout << "New Galileo E1 I/NAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << std::endl; std::cout << "New Galileo E1 I/NAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite << std::endl;
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
delta_t = tmp_obj->A_0G_10 + tmp_obj->A_1G_10 * (static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0 - tmp_obj->t_0G_10 + 604800 * (fmod((d_inav_nav.WN_0 - tmp_obj->WN_0G_10), 64))); d_delta_t = tmp_obj->A_0G_10 + tmp_obj->A_1G_10 * (static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0 - tmp_obj->t_0G_10 + 604800 * (fmod((d_inav_nav.WN_0 - tmp_obj->WN_0G_10), 64)));
DLOG(INFO) << "delta_t=" << delta_t << "[s]"; DLOG(INFO) << "delta_t=" << d_delta_t << "[s]";
} }
if (d_inav_nav.have_new_almanac() == true) if (d_inav_nav.have_new_almanac() == true)
{ {
@ -527,11 +526,11 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
d_CRC_error_counter = 0; d_CRC_error_counter = 0;
if (corr_value < 0) if (corr_value < 0)
{ {
flag_PLL_180_deg_phase_locked = true; d_flag_PLL_180_deg_phase_locked = true;
} }
else else
{ {
flag_PLL_180_deg_phase_locked = false; d_flag_PLL_180_deg_phase_locked = false;
} }
d_stat = 2; d_stat = 2;
} }
@ -556,7 +555,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
case 1: // INAV case 1: // INAV
// NEW Galileo page part is received // NEW Galileo page part is received
// 0. fetch the symbols into an array // 0. fetch the symbols into an array
if (flag_PLL_180_deg_phase_locked == false) // normal PLL lock if (d_flag_PLL_180_deg_phase_locked == false) // normal PLL lock
{ {
for (uint32_t i = 0; i < d_frame_length_symbols; i++) for (uint32_t i = 0; i < d_frame_length_symbols; i++)
{ {
@ -575,7 +574,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
case 2: // FNAV case 2: // FNAV
// NEW Galileo page part is received // NEW Galileo page part is received
// 0. fetch the symbols into an array // 0. fetch the symbols into an array
if (flag_PLL_180_deg_phase_locked == false) // normal PLL lock if (d_flag_PLL_180_deg_phase_locked == false) // normal PLL lock
{ {
for (uint32_t i = 0; i < d_frame_length_symbols; i++) for (uint32_t i = 0; i < d_frame_length_symbols; i++)
{ {
@ -733,7 +732,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
{ {
if (d_inav_nav.flag_GGTO_1 == true and d_inav_nav.flag_GGTO_2 == true and d_inav_nav.flag_GGTO_3 == true and d_inav_nav.flag_GGTO_4 == true) // all GGTO parameters arrived if (d_inav_nav.flag_GGTO_1 == true and d_inav_nav.flag_GGTO_2 == true and d_inav_nav.flag_GGTO_3 == true and d_inav_nav.flag_GGTO_4 == true) // all GGTO parameters arrived
{ {
delta_t = d_inav_nav.A_0G_10 + d_inav_nav.A_1G_10 * (static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0 - d_inav_nav.t_0G_10 + 604800.0 * (fmod((d_inav_nav.WN_0 - d_inav_nav.WN_0G_10), 64.0))); d_delta_t = d_inav_nav.A_0G_10 + d_inav_nav.A_1G_10 * (static_cast<double>(d_TOW_at_current_symbol_ms) / 1000.0 - d_inav_nav.t_0G_10 + 604800.0 * (fmod((d_inav_nav.WN_0 - d_inav_nav.WN_0G_10), 64.0)));
} }
current_symbol.Flag_valid_word = true; current_symbol.Flag_valid_word = true;
@ -755,9 +754,9 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
{ {
current_symbol.TOW_at_current_symbol_ms = d_TOW_at_current_symbol_ms; current_symbol.TOW_at_current_symbol_ms = d_TOW_at_current_symbol_ms;
// todo: Galileo to GPS time conversion should be moved to observable block. // todo: Galileo to GPS time conversion should be moved to observable block.
// current_symbol.TOW_at_current_symbol_ms -= delta_t; // Galileo to GPS TOW // current_symbol.TOW_at_current_symbol_ms -= d_delta_t; // Galileo to GPS TOW
if (flag_PLL_180_deg_phase_locked == true) if (d_flag_PLL_180_deg_phase_locked == true)
{ {
// correct the accumulated phase for the Costas loop phase shift, if required // correct the accumulated phase for the Costas loop phase shift, if required
current_symbol.Carrier_phase_rads += GALILEO_PI; current_symbol.Carrier_phase_rads += GALILEO_PI;

View File

@ -78,67 +78,63 @@ private:
galileo_telemetry_decoder_gs(const Gnss_Satellite &satellite, int frame_type, bool dump); galileo_telemetry_decoder_gs(const Gnss_Satellite &satellite, int frame_type, bool dump);
void viterbi_decoder(float *page_part_symbols, int32_t *page_part_bits); bool d_sent_tlm_failed_msg;
bool d_flag_frame_sync;
bool d_flag_PLL_180_deg_phase_locked;
bool d_flag_parity;
bool d_flag_preamble;
bool d_dump;
void deinterleaver(int32_t rows, int32_t cols, const float *in, float *out); const int32_t d_nn = 2; // Coding rate 1/n
const int32_t d_KK = 7; // Constraint Length
int32_t d_mm = d_KK - 1;
int32_t d_codelength;
int32_t d_datalength;
void decode_INAV_word(float *page_part_symbols, int32_t frame_length); int32_t d_frame_type;
void decode_FNAV_word(float *page_symbols, int32_t frame_length);
int d_frame_type;
int32_t d_bits_per_preamble; int32_t d_bits_per_preamble;
int32_t d_samples_per_preamble; int32_t d_samples_per_preamble;
int32_t d_preamble_period_symbols; int32_t d_preamble_period_symbols;
std::vector<int32_t> d_preamble_samples; int32_t d_CRC_error_counter;
int32_t d_channel;
uint32_t d_PRN_code_period_ms; uint32_t d_PRN_code_period_ms;
uint32_t d_required_symbols; uint32_t d_required_symbols;
uint32_t d_frame_length_symbols; uint32_t d_frame_length_symbols;
std::vector<float> d_page_part_symbols; uint32_t d_stat;
uint32_t d_TOW_at_Preamble_ms;
boost::circular_buffer<float> d_symbol_history; uint32_t d_TOW_at_current_symbol_ms;
uint64_t d_sample_counter; uint64_t d_sample_counter;
uint64_t d_preamble_index; uint64_t d_preamble_index;
uint64_t d_last_valid_preamble; uint64_t d_last_valid_preamble;
uint32_t d_max_symbols_without_valid_frame; uint32_t d_max_symbols_without_valid_frame;
bool d_sent_tlm_failed_msg; double d_delta_t; // GPS-GALILEO time offset
uint32_t d_stat;
bool d_flag_frame_sync;
bool flag_PLL_180_deg_phase_locked;
bool d_flag_parity; // vars for Viterbi decoder
bool d_flag_preamble; std::vector<int32_t> d_out0;
int32_t d_CRC_error_counter; std::vector<int32_t> d_out1;
std::vector<int32_t> d_state0;
std::vector<int32_t> d_state1;
std::vector<int32_t> d_preamble_samples;
std::vector<float> d_page_part_symbols;
std::string d_dump_filename;
std::ofstream d_dump_file;
boost::circular_buffer<float> d_symbol_history;
Gnss_Satellite d_satellite;
// navigation message vars // navigation message vars
Galileo_Navigation_Message d_inav_nav; Galileo_Navigation_Message d_inav_nav;
Galileo_Fnav_Message d_fnav_nav; Galileo_Fnav_Message d_fnav_nav;
bool d_dump; void viterbi_decoder(float *page_part_symbols, int32_t *page_part_bits);
Gnss_Satellite d_satellite; void deinterleaver(int32_t rows, int32_t cols, const float *in, float *out);
int32_t d_channel; void decode_INAV_word(float *page_part_symbols, int32_t frame_length);
void decode_FNAV_word(float *page_symbols, int32_t frame_length);
uint32_t d_TOW_at_Preamble_ms;
uint32_t d_TOW_at_current_symbol_ms;
bool flag_TOW_set;
double delta_t; // GPS-GALILEO time offset
std::string d_dump_filename;
std::ofstream d_dump_file;
// vars for Viterbi decoder
std::vector<int32_t> out0;
std::vector<int32_t> out1;
std::vector<int32_t> state0;
std::vector<int32_t> state1;
std::array<int32_t, 2> g_encoder{};
const int32_t nn = 2; // Coding rate 1/n
const int32_t KK = 7; // Constraint Length
int32_t mm = KK - 1;
int32_t CodeLength;
int32_t DataLength;
}; };
#endif // GNSS_SDR_GALILEO_TELEMETRY_DECODER_GS_H #endif // GNSS_SDR_GALILEO_TELEMETRY_DECODER_GS_H

View File

@ -109,8 +109,8 @@ gps_l1_ca_telemetry_decoder_gs::gps_l1_ca_telemetry_decoder_gs(
d_CRC_error_counter = 0; d_CRC_error_counter = 0;
d_flag_preamble = false; d_flag_preamble = false;
d_channel = 0; d_channel = 0;
flag_TOW_set = false; d_flag_TOW_set = false;
flag_PLL_180_deg_phase_locked = false; d_flag_PLL_180_deg_phase_locked = false;
d_prev_GPS_frame_4bytes = 0; d_prev_GPS_frame_4bytes = 0;
d_symbol_history.set_capacity(d_required_symbols); d_symbol_history.set_capacity(d_required_symbols);
} }
@ -317,7 +317,7 @@ void gps_l1_ca_telemetry_decoder_gs::reset()
gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler gr::thread::scoped_lock lock(d_setlock); // require mutex with work function called by the scheduler
d_last_valid_preamble = d_sample_counter; d_last_valid_preamble = d_sample_counter;
d_sent_tlm_failed_msg = false; d_sent_tlm_failed_msg = false;
flag_TOW_set = false; d_flag_TOW_set = false;
d_symbol_history.clear(); d_symbol_history.clear();
d_stat = 0; d_stat = 0;
DLOG(INFO) << "Telemetry decoder reset for satellite " << d_satellite; DLOG(INFO) << "Telemetry decoder reset for satellite " << d_satellite;
@ -378,7 +378,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
decode_subframe(); decode_subframe();
d_stat = 1; // enter into frame pre-detection status d_stat = 1; // enter into frame pre-detection status
} }
flag_TOW_set = false; d_flag_TOW_set = false;
break; break;
} }
case 1: // possible preamble lock case 1: // possible preamble lock
@ -411,11 +411,11 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
d_preamble_index = d_sample_counter; // record the preamble sample stamp d_preamble_index = d_sample_counter; // record the preamble sample stamp
if (corr_value < 0) if (corr_value < 0)
{ {
flag_PLL_180_deg_phase_locked = true; d_flag_PLL_180_deg_phase_locked = true;
} }
else else
{ {
flag_PLL_180_deg_phase_locked = false; d_flag_PLL_180_deg_phase_locked = false;
} }
decode_subframe(); decode_subframe();
d_stat = 2; d_stat = 2;
@ -425,7 +425,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
if (preamble_diff > d_preamble_period_symbols) if (preamble_diff > d_preamble_period_symbols)
{ {
d_stat = 0; // start again d_stat = 0; // start again
flag_TOW_set = false; d_flag_TOW_set = false;
} }
} }
} }
@ -463,7 +463,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
d_TOW_at_current_symbol_ms = 0; d_TOW_at_current_symbol_ms = 0;
d_TOW_at_Preamble_ms = 0; d_TOW_at_Preamble_ms = 0;
d_CRC_error_counter = 0; d_CRC_error_counter = 0;
flag_TOW_set = false; d_flag_TOW_set = false;
} }
} }
} }
@ -478,7 +478,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
{ {
d_TOW_at_current_symbol_ms = static_cast<uint32_t>(d_nav.d_TOW * 1000.0); d_TOW_at_current_symbol_ms = static_cast<uint32_t>(d_nav.d_TOW * 1000.0);
d_TOW_at_Preamble_ms = static_cast<uint32_t>(d_nav.d_TOW * 1000.0); d_TOW_at_Preamble_ms = static_cast<uint32_t>(d_nav.d_TOW * 1000.0);
flag_TOW_set = true; d_flag_TOW_set = true;
} }
else else
{ {
@ -487,18 +487,18 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
} }
else else
{ {
if (flag_TOW_set == true) if (d_flag_TOW_set == true)
{ {
d_TOW_at_current_symbol_ms += GPS_L1_CA_BIT_PERIOD_MS; d_TOW_at_current_symbol_ms += GPS_L1_CA_BIT_PERIOD_MS;
} }
} }
if (flag_TOW_set == true) if (d_flag_TOW_set == true)
{ {
current_symbol.TOW_at_current_symbol_ms = d_TOW_at_current_symbol_ms; current_symbol.TOW_at_current_symbol_ms = d_TOW_at_current_symbol_ms;
current_symbol.Flag_valid_word = flag_TOW_set; current_symbol.Flag_valid_word = d_flag_TOW_set;
if (flag_PLL_180_deg_phase_locked == true) if (d_flag_PLL_180_deg_phase_locked == true)
{ {
// correct the accumulated phase for the Costas loop phase shift, if required // correct the accumulated phase for the Costas loop phase shift, if required
current_symbol.Carrier_phase_rads += GPS_PI; current_symbol.Carrier_phase_rads += GPS_PI;

View File

@ -72,45 +72,45 @@ private:
bool dump); bool dump);
gps_l1_ca_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); gps_l1_ca_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump);
bool gps_word_parityCheck(uint32_t gpsword);
bool decode_subframe(); bool d_flag_frame_sync;
bool d_flag_parity;
bool d_flag_preamble;
bool d_sent_tlm_failed_msg;
bool d_flag_PLL_180_deg_phase_locked;
bool d_flag_TOW_set;
bool d_dump;
int32_t d_bits_per_preamble; int32_t d_bits_per_preamble;
int32_t d_samples_per_preamble; int32_t d_samples_per_preamble;
int32_t d_preamble_period_symbols; int32_t d_preamble_period_symbols;
std::array<int32_t, GPS_CA_PREAMBLE_LENGTH_BITS> d_preamble_samples{}; int32_t d_CRC_error_counter;
int32_t d_channel;
uint32_t d_required_symbols; uint32_t d_required_symbols;
uint32_t d_frame_length_symbols; uint32_t d_frame_length_symbols;
bool flag_PLL_180_deg_phase_locked;
// navigation message vars
Gps_Navigation_Message d_nav;
uint32_t d_prev_GPS_frame_4bytes; uint32_t d_prev_GPS_frame_4bytes;
uint32_t d_max_symbols_without_valid_frame;
boost::circular_buffer<float> d_symbol_history; uint32_t d_stat;
uint32_t d_TOW_at_Preamble_ms;
uint32_t d_TOW_at_current_symbol_ms;
uint64_t d_sample_counter; uint64_t d_sample_counter;
uint64_t d_preamble_index; uint64_t d_preamble_index;
uint64_t d_last_valid_preamble; uint64_t d_last_valid_preamble;
uint32_t d_max_symbols_without_valid_frame;
bool d_sent_tlm_failed_msg; std::array<int32_t, GPS_CA_PREAMBLE_LENGTH_BITS> d_preamble_samples{};
uint32_t d_stat;
bool d_flag_frame_sync;
bool d_flag_parity;
bool d_flag_preamble;
int32_t d_CRC_error_counter;
Gnss_Satellite d_satellite;
int32_t d_channel;
uint32_t d_TOW_at_Preamble_ms;
uint32_t d_TOW_at_current_symbol_ms;
bool flag_TOW_set;
bool d_dump;
std::string d_dump_filename; std::string d_dump_filename;
std::ofstream d_dump_file; std::ofstream d_dump_file;
boost::circular_buffer<float> d_symbol_history;
Gps_Navigation_Message d_nav;
Gnss_Satellite d_satellite;
bool gps_word_parityCheck(uint32_t gpsword);
bool decode_subframe();
}; };
#endif // GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_GS_H #endif // GNSS_SDR_GPS_L1_CA_TELEMETRY_DECODER_GS_H

View File

@ -74,7 +74,7 @@ gps_l2c_telemetry_decoder_gs::gps_l2c_telemetry_decoder_gs(
cnav_msg_decoder_init(&d_cnav_decoder); cnav_msg_decoder_init(&d_cnav_decoder);
d_sample_counter = 0; d_sample_counter = 0;
flag_PLL_180_deg_phase_locked = false; d_flag_PLL_180_deg_phase_locked = false;
} }
@ -178,11 +178,11 @@ int gps_l2c_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
{ {
if (d_cnav_decoder.part1.invert == true or d_cnav_decoder.part2.invert == true) if (d_cnav_decoder.part1.invert == true or d_cnav_decoder.part2.invert == true)
{ {
flag_PLL_180_deg_phase_locked = true; d_flag_PLL_180_deg_phase_locked = true;
} }
else else
{ {
flag_PLL_180_deg_phase_locked = false; d_flag_PLL_180_deg_phase_locked = false;
} }
std::bitset<GPS_L2_CNAV_DATA_PAGE_BITS> raw_bits; std::bitset<GPS_L2_CNAV_DATA_PAGE_BITS> raw_bits;
// Expand packet bits to bitsets. Notice the reverse order of the bits sequence, required by the CNAV message decoder // Expand packet bits to bitsets. Notice the reverse order of the bits sequence, required by the CNAV message decoder
@ -235,7 +235,7 @@ int gps_l2c_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
} }
} }
if (flag_PLL_180_deg_phase_locked == true) if (d_flag_PLL_180_deg_phase_locked == true)
{ {
// correct the accumulated phase for the Costas loop phase shift, if required // correct the accumulated phase for the Costas loop phase shift, if required
current_synchro_data.Carrier_phase_rads += GPS_L2_PI; current_synchro_data.Carrier_phase_rads += GPS_L2_PI;

View File

@ -76,26 +76,29 @@ private:
gps_l2c_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); gps_l2c_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump);
bool d_dump; bool d_dump;
Gnss_Satellite d_satellite; bool d_sent_tlm_failed_msg;
bool d_flag_PLL_180_deg_phase_locked;
bool d_flag_valid_word;
int32_t d_channel; int32_t d_channel;
int32_t d_state;
int32_t d_crc_error_count;
uint64_t d_sample_counter;
uint64_t d_last_valid_preamble;
uint32_t d_max_symbols_without_valid_frame;
double d_TOW_at_current_symbol;
double d_TOW_at_Preamble;
std::string d_dump_filename; std::string d_dump_filename;
std::ofstream d_dump_file; std::ofstream d_dump_file;
Gnss_Satellite d_satellite;
cnav_msg_decoder_t d_cnav_decoder{}; cnav_msg_decoder_t d_cnav_decoder{};
int32_t d_state;
int32_t d_crc_error_count;
uint64_t d_sample_counter;
bool d_sent_tlm_failed_msg;
uint64_t d_last_valid_preamble;
uint32_t d_max_symbols_without_valid_frame;
bool flag_PLL_180_deg_phase_locked;
double d_TOW_at_current_symbol;
double d_TOW_at_Preamble;
bool d_flag_valid_word;
Gps_CNAV_Navigation_Message d_CNAV_Message; Gps_CNAV_Navigation_Message d_CNAV_Message;
}; };

View File

@ -69,7 +69,7 @@ gps_l5_telemetry_decoder_gs::gps_l5_telemetry_decoder_gs(
cnav_msg_decoder_init(&d_cnav_decoder); cnav_msg_decoder_init(&d_cnav_decoder);
d_sample_counter = 0; d_sample_counter = 0;
flag_PLL_180_deg_phase_locked = false; d_flag_PLL_180_deg_phase_locked = false;
} }
@ -170,11 +170,11 @@ int gps_l5_telemetry_decoder_gs::general_work(int noutput_items __attribute__((u
{ {
if (d_cnav_decoder.part1.invert == true or d_cnav_decoder.part2.invert == true) if (d_cnav_decoder.part1.invert == true or d_cnav_decoder.part2.invert == true)
{ {
flag_PLL_180_deg_phase_locked = true; d_flag_PLL_180_deg_phase_locked = true;
} }
else else
{ {
flag_PLL_180_deg_phase_locked = false; d_flag_PLL_180_deg_phase_locked = false;
} }
std::bitset<GPS_L5_CNAV_DATA_PAGE_BITS> raw_bits; std::bitset<GPS_L5_CNAV_DATA_PAGE_BITS> raw_bits;
// Expand packet bits to bitsets. Notice the reverse order of the bits sequence, required by the CNAV message decoder // Expand packet bits to bitsets. Notice the reverse order of the bits sequence, required by the CNAV message decoder
@ -247,7 +247,7 @@ int gps_l5_telemetry_decoder_gs::general_work(int noutput_items __attribute__((u
if (d_flag_valid_word == true) if (d_flag_valid_word == true)
{ {
if (flag_PLL_180_deg_phase_locked == true) if (d_flag_PLL_180_deg_phase_locked == true)
{ {
// correct the accumulated phase for the Costas loop phase shift, if required // correct the accumulated phase for the Costas loop phase shift, if required
current_synchro_data.Carrier_phase_rads += GPS_L5_PI; current_synchro_data.Carrier_phase_rads += GPS_L5_PI;

View File

@ -75,22 +75,24 @@ private:
gps_l5_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump); gps_l5_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump);
bool d_dump; bool d_dump;
Gnss_Satellite d_satellite; bool d_flag_PLL_180_deg_phase_locked;
bool d_flag_valid_word;
bool d_sent_tlm_failed_msg;
int32_t d_channel; int32_t d_channel;
uint32_t d_TOW_at_current_symbol_ms;
uint32_t d_TOW_at_Preamble_ms;
uint64_t d_sample_counter;
uint64_t d_last_valid_preamble;
uint32_t d_max_symbols_without_valid_frame;
std::string d_dump_filename; std::string d_dump_filename;
std::ofstream d_dump_file; std::ofstream d_dump_file;
cnav_msg_decoder_t d_cnav_decoder{}; cnav_msg_decoder_t d_cnav_decoder{};
bool flag_PLL_180_deg_phase_locked; Gnss_Satellite d_satellite;
uint32_t d_TOW_at_current_symbol_ms;
uint32_t d_TOW_at_Preamble_ms;
bool d_flag_valid_word;
uint64_t d_sample_counter;
bool d_sent_tlm_failed_msg;
uint64_t d_last_valid_preamble;
uint32_t d_max_symbols_without_valid_frame;
Gps_CNAV_Navigation_Message d_CNAV_Message; Gps_CNAV_Navigation_Message d_CNAV_Message;
}; };