1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 04:30:33 +00:00

Fix reading of cell masks. They are not transmitted if the corresponding cell mask availability flag is zero

This commit is contained in:
Carles Fernandez 2021-09-29 09:01:13 +02:00
parent d61e0ff76d
commit da9fa85631
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 29 additions and 11 deletions

View File

@ -235,10 +235,25 @@ bool Has_Simple_Printer::print_message(const Galileo_HAS_data* const has_data)
d_has_file << indent << indent << "Cell Mask Availability Flag: " << print_vector(has_data->cell_mask_availability_flag) << '\n'; d_has_file << indent << indent << "Cell Mask Availability Flag: " << print_vector(has_data->cell_mask_availability_flag) << '\n';
for (uint8_t i = 0; i < has_data->Nsys; i++) for (uint8_t i = 0; i < has_data->Nsys; i++)
{ {
const std::string text("Cell Mask " + std::to_string(i) + ": "); if (has_data->cell_mask_availability_flag[i] == true)
d_has_file << indent << indent << text; {
const std::string filler(indent.length() * 2 + text.length(), ' '); std::string text;
d_has_file << print_matrix(has_data->cell_mask[i], filler); if (has_data->gnss_id_mask[i] == 0)
{
text = "Cell Mask for GPS: ";
}
else if (has_data->gnss_id_mask[i] == 2)
{
text = "Cell Mask for Galileo: ";
}
else
{
text = "Cell Mask for Reserved: ";
}
d_has_file << indent << indent << text;
const std::string filler(indent.length() * 2 + text.length(), ' ');
d_has_file << print_matrix(has_data->cell_mask[i], filler);
}
} }
d_has_file << indent << indent << "Nav message: " << print_vector(has_data->nav_message) << " (0: GPS LNAV or Galileo I/NAV)\n"; d_has_file << indent << indent << "Nav message: " << print_vector(has_data->nav_message) << " (0: GPS LNAV or Galileo I/NAV)\n";

View File

@ -413,17 +413,20 @@ void galileo_e6_has_msg_receiver::read_MT1_body(const std::string& message_body)
d_cell_mask_availability_flag[d_HAS_data.header.mask_id][i] = d_HAS_data.cell_mask_availability_flag[i]; d_cell_mask_availability_flag[d_HAS_data.header.mask_id][i] = d_HAS_data.cell_mask_availability_flag[i];
message = std::string(message.begin() + 1, message.end()); message = std::string(message.begin() + 1, message.end());
int size_cell = ones_in_satellite_mask * ones_in_signal_mask; if (d_HAS_data.cell_mask_availability_flag[i] == true)
int pos = 0;
for (int s = 0; s < ones_in_satellite_mask; s++)
{ {
for (int sig = 0; sig < ones_in_signal_mask; sig++) int size_cell = ones_in_satellite_mask * ones_in_signal_mask;
int pos = 0;
for (int s = 0; s < ones_in_satellite_mask; s++)
{ {
d_HAS_data.cell_mask[i][s][sig] = (message[pos] == '1' ? true : false); for (int sig = 0; sig < ones_in_signal_mask; sig++)
pos++; {
d_HAS_data.cell_mask[i][s][sig] = (message[pos] == '1' ? true : false);
pos++;
}
} }
message = std::string(message.begin() + size_cell, message.end());
} }
message = std::string(message.begin() + size_cell, message.end());
d_HAS_data.nav_message[i] = read_has_message_body_uint8(message.substr(0, HAS_MSG_NAV_MESSAGE_LENGTH)); d_HAS_data.nav_message[i] = read_has_message_body_uint8(message.substr(0, HAS_MSG_NAV_MESSAGE_LENGTH));
d_nav_message_mask[d_HAS_data.header.mask_id][i] = d_HAS_data.nav_message[i]; d_nav_message_mask[d_HAS_data.header.mask_id][i] = d_HAS_data.nav_message[i];