mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2026-04-30 02:31:26 +00:00
Introduce readability-identifier-naming check
This commit enforces naming style for Classes and global constants: Camel_Snake_Case for Classes UPPER_CASE for global constants CamelCase for abstract classes
This commit is contained in:
@@ -88,8 +88,8 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc(
|
||||
{
|
||||
case 1: // INAV
|
||||
{
|
||||
d_PRN_code_period_ms = static_cast<uint32_t>(GALILEO_E1_CODE_PERIOD_MS);
|
||||
d_samples_per_symbol = Galileo_E1_B_SAMPLES_PER_SYMBOL;
|
||||
d_PRN_code_period_ms = static_cast<uint32_t>(GALILEO_E5A_CODE_PERIOD_MS);
|
||||
d_samples_per_symbol = GALILEO_E1_B_SAMPLES_PER_SYMBOL;
|
||||
d_bits_per_preamble = GALILEO_INAV_PREAMBLE_LENGTH_BITS;
|
||||
// set the preamble
|
||||
d_samples_per_preamble = GALILEO_INAV_PREAMBLE_LENGTH_BITS * d_samples_per_symbol;
|
||||
@@ -105,7 +105,7 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc(
|
||||
}
|
||||
case 2: // FNAV
|
||||
{
|
||||
d_PRN_code_period_ms = static_cast<uint32_t>(GALILEO_E5a_CODE_PERIOD_MS);
|
||||
d_PRN_code_period_ms = static_cast<uint32_t>(GALILEO_E5A_CODE_PERIOD_MS);
|
||||
d_samples_per_symbol = GALILEO_FNAV_CODES_PER_SYMBOL;
|
||||
d_bits_per_preamble = GALILEO_FNAV_PREAMBLE_LENGTH_BITS;
|
||||
// set the preamble
|
||||
@@ -114,13 +114,13 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc(
|
||||
d_required_symbols = static_cast<uint32_t>(GALILEO_FNAV_SYMBOLS_PER_PAGE) * d_samples_per_symbol + d_samples_per_preamble;
|
||||
// preamble bits to sampled symbols
|
||||
d_preamble_samples = static_cast<int32_t *>(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment()));
|
||||
d_secondary_code_samples = static_cast<int32_t *>(volk_gnsssdr_malloc(Galileo_E5a_I_SECONDARY_CODE_LENGTH * sizeof(int32_t), volk_gnsssdr_get_alignment()));
|
||||
d_secondary_code_samples = static_cast<int32_t *>(volk_gnsssdr_malloc(GALILEO_E5A_I_SECONDARY_CODE_LENGTH * sizeof(int32_t), volk_gnsssdr_get_alignment()));
|
||||
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;
|
||||
DataLength = (CodeLength / nn) - mm;
|
||||
for (int32_t i = 0; i < Galileo_E5a_I_SECONDARY_CODE_LENGTH; i++)
|
||||
for (int32_t i = 0; i < GALILEO_E5A_I_SECONDARY_CODE_LENGTH; i++)
|
||||
{
|
||||
if (Galileo_E5a_I_SECONDARY_CODE.at(i) == '1')
|
||||
if (GALILEO_E5A_I_SECONDARY_CODE.at(i) == '1')
|
||||
{
|
||||
d_secondary_code_samples[i] = 1;
|
||||
}
|
||||
@@ -183,7 +183,7 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc(
|
||||
d_preamble_samples[n] = d_secondary_code_samples[m];
|
||||
n++;
|
||||
m++;
|
||||
m = m % Galileo_E5a_I_SECONDARY_CODE_LENGTH;
|
||||
m = m % GALILEO_E5A_I_SECONDARY_CODE_LENGTH;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -193,7 +193,7 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc(
|
||||
d_preamble_samples[n] = -d_secondary_code_samples[m];
|
||||
n++;
|
||||
m++;
|
||||
m = m % Galileo_E5a_I_SECONDARY_CODE_LENGTH;
|
||||
m = m % GALILEO_E5A_I_SECONDARY_CODE_LENGTH;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -563,7 +563,7 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
|
||||
{
|
||||
d_page_part_symbols[i] += static_cast<float>(d_secondary_code_samples[k]) * d_symbol_history.at(i * d_samples_per_symbol + d_samples_per_preamble + m); // because last symbol of the preamble is just received now!
|
||||
k++;
|
||||
k = k % Galileo_E5a_I_SECONDARY_CODE_LENGTH;
|
||||
k = k % GALILEO_E5A_I_SECONDARY_CODE_LENGTH;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -577,7 +577,7 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
|
||||
{
|
||||
d_page_part_symbols[i] -= static_cast<float>(d_secondary_code_samples[k]) * d_symbol_history.at(i * d_samples_per_symbol + d_samples_per_preamble + m); // because last symbol of the preamble is just received now!
|
||||
k++;
|
||||
k = k % Galileo_E5a_I_SECONDARY_CODE_LENGTH;
|
||||
k = k % GALILEO_E5A_I_SECONDARY_CODE_LENGTH;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -634,7 +634,7 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
|
||||
{
|
||||
// TOW_5 refers to the even preamble, but when we decode it we are in the odd part, so 1 second later plus the decoding delay
|
||||
d_TOW_at_Preamble_ms = static_cast<uint32_t>(d_inav_nav.TOW_5 * 1000.0);
|
||||
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>(GALILEO_INAV_PAGE_PART_MS + (d_required_symbols + 1) * GALILEO_E1_CODE_PERIOD_MS);
|
||||
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>(GALILEO_INAV_PAGE_PART_MS + (d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS);
|
||||
d_inav_nav.flag_TOW_5 = false;
|
||||
}
|
||||
|
||||
@@ -642,13 +642,13 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
|
||||
{
|
||||
// TOW_6 refers to the even preamble, but when we decode it we are in the odd part, so 1 second later plus the decoding delay
|
||||
d_TOW_at_Preamble_ms = static_cast<uint32_t>(d_inav_nav.TOW_6 * 1000.0);
|
||||
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>(GALILEO_INAV_PAGE_PART_MS + (d_required_symbols + 1) * GALILEO_E1_CODE_PERIOD_MS);
|
||||
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>(GALILEO_INAV_PAGE_PART_MS + (d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS);
|
||||
d_inav_nav.flag_TOW_6 = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// this page has no timing information
|
||||
d_TOW_at_current_symbol_ms += static_cast<uint32_t>(GALILEO_E1_CODE_PERIOD_MS); // + GALILEO_INAV_PAGE_PART_SYMBOLS*GALILEO_E1_CODE_PERIOD;
|
||||
d_TOW_at_current_symbol_ms += static_cast<uint32_t>(GALILEO_E5A_CODE_PERIOD_MS); // + GALILEO_INAV_PAGE_PART_SYMBOLS*GALILEO_E1_CODE_PERIOD;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -660,7 +660,7 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
|
||||
if (d_fnav_nav.flag_TOW_1 == true)
|
||||
{
|
||||
d_TOW_at_Preamble_ms = static_cast<uint32_t>(d_fnav_nav.FNAV_TOW_1 * 1000.0);
|
||||
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5a_CODE_PERIOD_MS);
|
||||
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS);
|
||||
//d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS);
|
||||
d_fnav_nav.flag_TOW_1 = false;
|
||||
}
|
||||
@@ -668,26 +668,26 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
|
||||
{
|
||||
d_TOW_at_Preamble_ms = static_cast<uint32_t>(d_fnav_nav.FNAV_TOW_2 * 1000.0);
|
||||
//d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS);
|
||||
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5a_CODE_PERIOD_MS);
|
||||
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS);
|
||||
d_fnav_nav.flag_TOW_2 = false;
|
||||
}
|
||||
else if (d_fnav_nav.flag_TOW_3 == true)
|
||||
{
|
||||
d_TOW_at_Preamble_ms = static_cast<uint32_t>(d_fnav_nav.FNAV_TOW_3 * 1000.0);
|
||||
//d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS);
|
||||
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5a_CODE_PERIOD_MS);
|
||||
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS);
|
||||
d_fnav_nav.flag_TOW_3 = false;
|
||||
}
|
||||
else if (d_fnav_nav.flag_TOW_4 == true)
|
||||
{
|
||||
d_TOW_at_Preamble_ms = static_cast<uint32_t>(d_fnav_nav.FNAV_TOW_4 * 1000.0);
|
||||
//d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS);
|
||||
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5a_CODE_PERIOD_MS);
|
||||
d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast<uint32_t>((d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS);
|
||||
d_fnav_nav.flag_TOW_4 = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
d_TOW_at_current_symbol_ms += static_cast<uint32_t>(GALILEO_E5a_CODE_PERIOD_MS);
|
||||
d_TOW_at_current_symbol_ms += static_cast<uint32_t>(GALILEO_E5A_CODE_PERIOD_MS);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -68,9 +68,9 @@ gps_l5_telemetry_decoder_cc::gps_l5_telemetry_decoder_cc(
|
||||
d_TOW_at_Preamble_ms = 0U;
|
||||
// initialize the CNAV frame decoder (libswiftcnav)
|
||||
cnav_msg_decoder_init(&d_cnav_decoder);
|
||||
for (int32_t aux = 0; aux < GPS_L5i_NH_CODE_LENGTH; aux++)
|
||||
for (int32_t aux = 0; aux < GPS_L5I_NH_CODE_LENGTH; aux++)
|
||||
{
|
||||
if (GPS_L5i_NH_CODE[aux] == 0)
|
||||
if (GPS_L5I_NH_CODE[aux] == 0)
|
||||
{
|
||||
bits_NH[aux] = -1.0;
|
||||
}
|
||||
@@ -154,9 +154,9 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u
|
||||
int32_t symbol_value = 0;
|
||||
|
||||
// Search correlation with Neuman-Hofman Code (see IS-GPS-705D)
|
||||
if (sym_hist.size() == GPS_L5i_NH_CODE_LENGTH)
|
||||
if (sym_hist.size() == GPS_L5I_NH_CODE_LENGTH)
|
||||
{
|
||||
for (int32_t i = 0; i < GPS_L5i_NH_CODE_LENGTH; i++)
|
||||
for (int32_t i = 0; i < GPS_L5I_NH_CODE_LENGTH; i++)
|
||||
{
|
||||
if ((bits_NH[i] * sym_hist.at(i)) > 0.0)
|
||||
{
|
||||
@@ -167,7 +167,7 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u
|
||||
corr_NH -= 1;
|
||||
}
|
||||
}
|
||||
if (abs(corr_NH) == GPS_L5i_NH_CODE_LENGTH)
|
||||
if (abs(corr_NH) == GPS_L5I_NH_CODE_LENGTH)
|
||||
{
|
||||
sync_NH = true;
|
||||
if (corr_NH > 0)
|
||||
@@ -241,12 +241,12 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u
|
||||
// delay by the formulae:
|
||||
// \code
|
||||
// symbolTime_ms = msg->tow * 6000 + *pdelay * 10 + (12 * 10); 12 symbols of the encoder's transitory
|
||||
d_TOW_at_current_symbol_ms = msg.tow * 6000 + (delay + 12) * GPS_L5i_SYMBOL_PERIOD_MS;
|
||||
d_TOW_at_current_symbol_ms = msg.tow * 6000 + (delay + 12) * GPS_L5I_SYMBOL_PERIOD_MS;
|
||||
d_flag_valid_word = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
d_TOW_at_current_symbol_ms += GPS_L5i_PERIOD_MS;
|
||||
d_TOW_at_current_symbol_ms += GPS_L5I_PERIOD_MS;
|
||||
if (current_synchro_data.Flag_valid_symbol_output == false)
|
||||
{
|
||||
d_flag_valid_word = false;
|
||||
|
||||
@@ -90,7 +90,7 @@ private:
|
||||
bool d_flag_valid_word;
|
||||
|
||||
Gps_CNAV_Navigation_Message d_CNAV_Message;
|
||||
double bits_NH[GPS_L5i_NH_CODE_LENGTH]{};
|
||||
double bits_NH[GPS_L5I_NH_CODE_LENGTH]{};
|
||||
std::deque<double> sym_hist;
|
||||
bool sync_NH;
|
||||
bool new_sym;
|
||||
|
||||
@@ -64,7 +64,7 @@ sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc(
|
||||
d_dump = dump;
|
||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||
LOG(INFO) << "SBAS L1 TELEMETRY PROCESSING: satellite " << d_satellite;
|
||||
d_block_size = d_samples_per_symbol * d_symbols_per_bit * d_block_size_in_bits;
|
||||
d_block_size = D_SAMPLES_PER_SYMBOL * D_SYMBOLS_PER_BIT * D_BLOCK_SIZE_IN_BITS;
|
||||
d_channel = 0;
|
||||
set_output_multiple(1);
|
||||
}
|
||||
@@ -101,7 +101,7 @@ void sbas_l1_telemetry_decoder_cc::set_channel(int32_t channel)
|
||||
|
||||
|
||||
// ### helper class for sample alignment ###
|
||||
sbas_l1_telemetry_decoder_cc::sample_aligner::sample_aligner()
|
||||
sbas_l1_telemetry_decoder_cc::Sample_Aligner::Sample_Aligner()
|
||||
{
|
||||
d_n_smpls_in_history = 3;
|
||||
d_iir_par = 0.05;
|
||||
@@ -109,10 +109,10 @@ sbas_l1_telemetry_decoder_cc::sample_aligner::sample_aligner()
|
||||
}
|
||||
|
||||
|
||||
sbas_l1_telemetry_decoder_cc::sample_aligner::~sample_aligner() = default;
|
||||
sbas_l1_telemetry_decoder_cc::Sample_Aligner::~Sample_Aligner() = default;
|
||||
|
||||
|
||||
void sbas_l1_telemetry_decoder_cc::sample_aligner::reset()
|
||||
void sbas_l1_telemetry_decoder_cc::Sample_Aligner::reset()
|
||||
{
|
||||
d_past_sample = 0;
|
||||
d_corr_paired = 0;
|
||||
@@ -124,7 +124,7 @@ void sbas_l1_telemetry_decoder_cc::sample_aligner::reset()
|
||||
/*
|
||||
* samples length must be a multiple of two
|
||||
*/
|
||||
bool sbas_l1_telemetry_decoder_cc::sample_aligner::get_symbols(const std::vector<double> &samples, std::vector<double> &symbols)
|
||||
bool sbas_l1_telemetry_decoder_cc::Sample_Aligner::get_symbols(const std::vector<double> &samples, std::vector<double> &symbols)
|
||||
{
|
||||
double smpls[3] = {};
|
||||
double corr_diff;
|
||||
@@ -134,12 +134,12 @@ bool sbas_l1_telemetry_decoder_cc::sample_aligner::get_symbols(const std::vector
|
||||
VLOG(FLOW) << "get_symbols(): "
|
||||
<< "d_past_sample=" << d_past_sample << "\tsamples size=" << samples.size();
|
||||
|
||||
for (uint32_t i_sym = 0; i_sym < samples.size() / sbas_l1_telemetry_decoder_cc::d_samples_per_symbol; i_sym++)
|
||||
for (uint32_t i_sym = 0; i_sym < samples.size() / sbas_l1_telemetry_decoder_cc::D_SAMPLES_PER_SYMBOL; i_sym++)
|
||||
{
|
||||
// get the next samples
|
||||
for (int32_t i = 0; i < d_n_smpls_in_history; i++)
|
||||
{
|
||||
smpls[i] = static_cast<int32_t>(i_sym) * sbas_l1_telemetry_decoder_cc::d_samples_per_symbol + i - 1 == -1 ? d_past_sample : samples[i_sym * sbas_l1_telemetry_decoder_cc::d_samples_per_symbol + i - 1];
|
||||
smpls[i] = static_cast<int32_t>(i_sym) * sbas_l1_telemetry_decoder_cc::D_SAMPLES_PER_SYMBOL + i - 1 == -1 ? d_past_sample : samples[i_sym * sbas_l1_telemetry_decoder_cc::D_SAMPLES_PER_SYMBOL + i - 1];
|
||||
}
|
||||
|
||||
// update the pseudo correlations (IIR method) of the two possible alignments
|
||||
@@ -182,7 +182,7 @@ bool sbas_l1_telemetry_decoder_cc::sample_aligner::get_symbols(const std::vector
|
||||
|
||||
|
||||
// ### helper class for symbol alignment and viterbi decoding ###
|
||||
sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::symbol_aligner_and_decoder()
|
||||
sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::Symbol_Aligner_And_Decoder()
|
||||
{
|
||||
// convolutional code properties
|
||||
d_KK = 7;
|
||||
@@ -197,14 +197,14 @@ sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::symbol_aligner_and_dec
|
||||
}
|
||||
|
||||
|
||||
sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::~symbol_aligner_and_decoder()
|
||||
sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::~Symbol_Aligner_And_Decoder()
|
||||
{
|
||||
delete d_vd1;
|
||||
delete d_vd2;
|
||||
}
|
||||
|
||||
|
||||
void sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::reset()
|
||||
void sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::reset()
|
||||
{
|
||||
d_past_symbol = 0;
|
||||
d_vd1->reset();
|
||||
@@ -212,10 +212,10 @@ void sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::reset()
|
||||
}
|
||||
|
||||
|
||||
bool sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::get_bits(const std::vector<double> &symbols, std::vector<int32_t> &bits)
|
||||
bool sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::get_bits(const std::vector<double> &symbols, std::vector<int32_t> &bits)
|
||||
{
|
||||
const int32_t traceback_depth = 5 * d_KK;
|
||||
int32_t nbits_requested = symbols.size() / d_symbols_per_bit;
|
||||
int32_t nbits_requested = symbols.size() / D_SYMBOLS_PER_BIT;
|
||||
int32_t nbits_decoded;
|
||||
// fill two vectors with the two possible symbol alignments
|
||||
std::vector<double> symbols_vd1(symbols); // aligned symbol vector -> copy input symbol vector
|
||||
@@ -251,13 +251,13 @@ bool sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::get_bits(const st
|
||||
|
||||
|
||||
// ### helper class for detecting the preamble and collect the corresponding message candidates ###
|
||||
void sbas_l1_telemetry_decoder_cc::frame_detector::reset()
|
||||
void sbas_l1_telemetry_decoder_cc::Frame_Detector::reset()
|
||||
{
|
||||
d_buffer.clear();
|
||||
}
|
||||
|
||||
|
||||
void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const std::vector<int32_t> &bits, std::vector<std::pair<int32_t, std::vector<int32_t>>> &msg_candidates)
|
||||
void sbas_l1_telemetry_decoder_cc::Frame_Detector::get_frame_candidates(const std::vector<int32_t> &bits, std::vector<std::pair<int32_t, std::vector<int32_t>>> &msg_candidates)
|
||||
{
|
||||
std::stringstream ss;
|
||||
uint32_t sbas_msg_length = 250;
|
||||
@@ -321,12 +321,12 @@ void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const st
|
||||
|
||||
|
||||
// ### helper class for checking the CRC of the message candidates ###
|
||||
void sbas_l1_telemetry_decoder_cc::crc_verifier::reset()
|
||||
void sbas_l1_telemetry_decoder_cc::Crc_Verifier::reset()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void sbas_l1_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vector<msg_candiate_int_t> &msg_candidates, std::vector<msg_candiate_char_t> &valid_msgs)
|
||||
void sbas_l1_telemetry_decoder_cc::Crc_Verifier::get_valid_frames(const std::vector<msg_candiate_int_t> &msg_candidates, std::vector<msg_candiate_char_t> &valid_msgs)
|
||||
{
|
||||
std::stringstream ss;
|
||||
VLOG(FLOW) << "get_valid_frames(): "
|
||||
@@ -364,7 +364,7 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vec
|
||||
}
|
||||
|
||||
|
||||
void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_back_and_convert_to_bytes(const std::vector<int> &msg_candidate, std::vector<uint8_t> &bytes)
|
||||
void sbas_l1_telemetry_decoder_cc::Crc_Verifier::zerropad_back_and_convert_to_bytes(const std::vector<int> &msg_candidate, std::vector<uint8_t> &bytes)
|
||||
{
|
||||
std::stringstream ss;
|
||||
const size_t bits_per_byte = 8;
|
||||
@@ -391,7 +391,7 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_back_and_convert_to_by
|
||||
}
|
||||
|
||||
|
||||
void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_front_and_convert_to_bytes(const std::vector<int32_t> &msg_candidate, std::vector<uint8_t> &bytes)
|
||||
void sbas_l1_telemetry_decoder_cc::Crc_Verifier::zerropad_front_and_convert_to_bytes(const std::vector<int32_t> &msg_candidate, std::vector<uint8_t> &bytes)
|
||||
{
|
||||
std::stringstream ss;
|
||||
const size_t bits_per_byte = 8;
|
||||
@@ -466,7 +466,7 @@ int sbas_l1_telemetry_decoder_cc::general_work(int noutput_items __attribute__((
|
||||
for (const auto &valid_msg : valid_msgs)
|
||||
{
|
||||
int32_t message_sample_offset =
|
||||
(sample_alignment ? 0 : -1) + d_samples_per_symbol * (symbol_alignment ? -1 : 0) + d_samples_per_symbol * d_symbols_per_bit * valid_msg.first;
|
||||
(sample_alignment ? 0 : -1) + D_SAMPLES_PER_SYMBOL * (symbol_alignment ? -1 : 0) + D_SAMPLES_PER_SYMBOL * D_SYMBOLS_PER_BIT * valid_msg.first;
|
||||
double message_sample_stamp = sample_stamp + static_cast<double>(message_sample_offset) / 1000.0;
|
||||
VLOG(EVENT) << "message_sample_stamp=" << message_sample_stamp
|
||||
<< " (sample_stamp=" << sample_stamp
|
||||
|
||||
@@ -76,9 +76,9 @@ private:
|
||||
void viterbi_decoder(double *page_part_symbols, int32_t *page_part_bits);
|
||||
void align_samples();
|
||||
|
||||
static const int32_t d_samples_per_symbol = 2;
|
||||
static const int32_t d_symbols_per_bit = 2;
|
||||
static const int32_t d_block_size_in_bits = 30;
|
||||
static const int32_t D_SAMPLES_PER_SYMBOL = 2;
|
||||
static const int32_t D_SYMBOLS_PER_BIT = 2;
|
||||
static const int32_t D_BLOCK_SIZE_IN_BITS = 30;
|
||||
|
||||
bool d_dump;
|
||||
Gnss_Satellite d_satellite;
|
||||
@@ -94,11 +94,11 @@ private:
|
||||
typedef std::pair<int32_t, std::vector<uint8_t>> msg_candiate_char_t;
|
||||
|
||||
// helper class for sample alignment
|
||||
class sample_aligner
|
||||
class Sample_Aligner
|
||||
{
|
||||
public:
|
||||
sample_aligner();
|
||||
~sample_aligner();
|
||||
Sample_Aligner();
|
||||
~Sample_Aligner();
|
||||
void reset();
|
||||
/*
|
||||
* samples length must be a multiple of two
|
||||
@@ -116,11 +116,11 @@ private:
|
||||
} d_sample_aligner;
|
||||
|
||||
// helper class for symbol alignment and Viterbi decoding
|
||||
class symbol_aligner_and_decoder
|
||||
class Symbol_Aligner_And_Decoder
|
||||
{
|
||||
public:
|
||||
symbol_aligner_and_decoder();
|
||||
~symbol_aligner_and_decoder();
|
||||
Symbol_Aligner_And_Decoder();
|
||||
~Symbol_Aligner_And_Decoder();
|
||||
void reset();
|
||||
bool get_bits(const std::vector<double> &symbols, std::vector<int32_t> &bits);
|
||||
|
||||
@@ -133,7 +133,7 @@ private:
|
||||
|
||||
|
||||
// helper class for detecting the preamble and collect the corresponding message candidates
|
||||
class frame_detector
|
||||
class Frame_Detector
|
||||
{
|
||||
public:
|
||||
void reset();
|
||||
@@ -145,7 +145,7 @@ private:
|
||||
|
||||
|
||||
// helper class for checking the CRC of the message candidates
|
||||
class crc_verifier
|
||||
class Crc_Verifier
|
||||
{
|
||||
public:
|
||||
void reset();
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
static const u8 bitn[16] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
|
||||
static const u8 BITN[16] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
|
||||
|
||||
/** \defgroup bits Bit Utils
|
||||
* Bit field packing, unpacking and utility functions.
|
||||
@@ -249,7 +249,7 @@ u8 count_bits_u64(u64 v, u8 bv)
|
||||
int i = 0;
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
r += bitn[(v >> (i * 4)) & 0xf];
|
||||
r += BITN[(v >> (i * 4)) & 0xf];
|
||||
}
|
||||
return bv == 1 ? r : 64 - r;
|
||||
}
|
||||
@@ -268,7 +268,7 @@ u8 count_bits_u32(u32 v, u8 bv)
|
||||
int i = 0;
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
r += bitn[(v >> (i * 4)) & 0xf];
|
||||
r += BITN[(v >> (i * 4)) & 0xf];
|
||||
}
|
||||
return bv == 1 ? r : 32 - r;
|
||||
}
|
||||
@@ -287,7 +287,7 @@ u8 count_bits_u16(u16 v, u8 bv)
|
||||
int i = 0;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
r += bitn[(v >> (i * 4)) & 0xf];
|
||||
r += BITN[(v >> (i * 4)) & 0xf];
|
||||
}
|
||||
return bv == 1 ? r : 16 - r;
|
||||
}
|
||||
@@ -306,7 +306,7 @@ u8 count_bits_u8(u8 v, u8 bv)
|
||||
int i = 0;
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
r += bitn[(v >> (i * 4)) & 0xf];
|
||||
r += BITN[(v >> (i * 4)) & 0xf];
|
||||
}
|
||||
return bv == 1 ? r : 8 - r;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
* Cyclic redundancy checks.
|
||||
* \{ */
|
||||
|
||||
static const u32 crc24qtab[256] = {
|
||||
static const u32 CRC24QTAB[256] = {
|
||||
0x000000, 0x864CFB, 0x8AD50D, 0x0C99F6, 0x93E6E1, 0x15AA1A, 0x1933EC, 0x9F7F17,
|
||||
0xA18139, 0x27CDC2, 0x2B5434, 0xAD18CF, 0x3267D8, 0xB42B23, 0xB8B2D5, 0x3EFE2E,
|
||||
0xC54E89, 0x430272, 0x4F9B84, 0xC9D77F, 0x56A868, 0xD0E493, 0xDC7D65, 0x5A319E,
|
||||
@@ -93,7 +93,7 @@ u32 crc24q(const u8 *buf, u32 len, u32 crc)
|
||||
u32 i = 0;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
crc = ((crc << 8) & 0xFFFFFF) ^ crc24qtab[((crc >> 16) ^ buf[i]) & 0xff];
|
||||
crc = ((crc << 8) & 0xFFFFFF) ^ CRC24QTAB[((crc >> 16) ^ buf[i]) & 0xff];
|
||||
}
|
||||
return crc;
|
||||
}
|
||||
@@ -128,7 +128,7 @@ u32 crc24q_bits(u32 crc, const u8 *buf, u32 n_bits, bool invert)
|
||||
acc ^= 0xFFu;
|
||||
}
|
||||
b = (acc >> shift) & 0xFFu;
|
||||
crc = ((crc << 8) & 0xFFFFFFu) ^ crc24qtab[((crc >> 16) ^ b) & 0xFFu];
|
||||
crc = ((crc << 8) & 0xFFFFFFu) ^ CRC24QTAB[((crc >> 16) ^ b) & 0xFFu];
|
||||
}
|
||||
acc = (acc << 8) | *buf;
|
||||
if (invert)
|
||||
@@ -136,7 +136,7 @@ u32 crc24q_bits(u32 crc, const u8 *buf, u32 n_bits, bool invert)
|
||||
acc ^= 0xFFu;
|
||||
}
|
||||
b = (acc >> shift) & 0xFFu;
|
||||
crc = ((crc << 8) & 0xFFFFFFu) ^ crc24qtab[((crc >> 16) ^ b) & 0xFFu];
|
||||
crc = ((crc << 8) & 0xFFFFFFu) ^ CRC24QTAB[((crc >> 16) ^ b) & 0xFFu];
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user