Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/c/mip/definitions/data_gnss.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,9 @@ void insert_mip_gnss_rf_error_detection_data(microstrain_serializer* serializer,

insert_mip_gnss_rf_error_detection_data_spoofing_state(serializer, self->spoofing_state);

for(unsigned int i=0; i < 4; i++)
microstrain_insert_u16(serializer, self->frequency);

for(unsigned int i=0; i < 2; i++)
microstrain_insert_u8(serializer, self->reserved[i]);

insert_mip_gnss_rf_error_detection_data_valid_flags(serializer, self->valid_flags);
Expand All @@ -681,7 +683,9 @@ void extract_mip_gnss_rf_error_detection_data(microstrain_serializer* serializer

extract_mip_gnss_rf_error_detection_data_spoofing_state(serializer, &self->spoofing_state);

for(unsigned int i=0; i < 4; i++)
microstrain_extract_u16(serializer, &self->frequency);

for(unsigned int i=0; i < 2; i++)
microstrain_extract_u8(serializer, &self->reserved[i]);

extract_mip_gnss_rf_error_detection_data_valid_flags(serializer, &self->valid_flags);
Expand Down
7 changes: 4 additions & 3 deletions src/c/mip/definitions/data_gnss.h
Original file line number Diff line number Diff line change
Expand Up @@ -1181,8 +1181,8 @@ static const mip_gnss_rf_error_detection_data_valid_flags MIP_GNSS_RF_ERROR_DETE
static const mip_gnss_rf_error_detection_data_valid_flags MIP_GNSS_RF_ERROR_DETECTION_DATA_VALID_FLAGS_RF_BAND = 0x0001; ///<
static const mip_gnss_rf_error_detection_data_valid_flags MIP_GNSS_RF_ERROR_DETECTION_DATA_VALID_FLAGS_JAMMING_STATE = 0x0002; ///<
static const mip_gnss_rf_error_detection_data_valid_flags MIP_GNSS_RF_ERROR_DETECTION_DATA_VALID_FLAGS_SPOOFING_STATE = 0x0004; ///<
static const mip_gnss_rf_error_detection_data_valid_flags MIP_GNSS_RF_ERROR_DETECTION_DATA_VALID_FLAGS_FLAGS = 0x0007; ///<
static const mip_gnss_rf_error_detection_data_valid_flags MIP_GNSS_RF_ERROR_DETECTION_DATA_VALID_FLAGS_ALL = 0x0007;
static const mip_gnss_rf_error_detection_data_valid_flags MIP_GNSS_RF_ERROR_DETECTION_DATA_VALID_FLAGS_FREQUENCY = 0x0008; ///<
static const mip_gnss_rf_error_detection_data_valid_flags MIP_GNSS_RF_ERROR_DETECTION_DATA_VALID_FLAGS_ALL = 0x000F;
static inline void insert_mip_gnss_rf_error_detection_data_valid_flags(microstrain_serializer* serializer, const mip_gnss_rf_error_detection_data_valid_flags self)
{
microstrain_insert_u16(serializer, (uint16_t)(self));
Expand All @@ -1200,7 +1200,8 @@ struct mip_gnss_rf_error_detection_data
mip_gnss_rf_error_detection_data_rfband rf_band; ///< RF Band of the reported information
mip_gnss_rf_error_detection_data_jamming_state jamming_state; ///< GNSS Jamming State (as reported by the GNSS module)
mip_gnss_rf_error_detection_data_spoofing_state spoofing_state; ///< GNSS Spoofing State (as reported by the GNSS module)
uint8_t reserved[4]; ///< Reserved for future use
uint16_t frequency; ///< Center frequency of the RF band in MHz
uint8_t reserved[2]; ///< Reserved for future use
mip_gnss_rf_error_detection_data_valid_flags valid_flags;
};
typedef struct mip_gnss_rf_error_detection_data mip_gnss_rf_error_detection_data;
Expand Down
8 changes: 6 additions & 2 deletions src/cpp/mip/definitions/data_gnss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,9 @@ void RfErrorDetection::insert(Serializer& serializer) const

serializer.insert(spoofing_state);

for(unsigned int i=0; i < 4; i++)
serializer.insert(frequency);

for(unsigned int i=0; i < 2; i++)
serializer.insert(reserved[i]);

serializer.insert(valid_flags);
Expand All @@ -529,7 +531,9 @@ void RfErrorDetection::extract(Serializer& serializer)

serializer.extract(spoofing_state);

for(unsigned int i=0; i < 4; i++)
serializer.extract(frequency);

for(unsigned int i=0; i < 2; i++)
serializer.extract(reserved[i]);

serializer.extract(valid_flags);
Expand Down
15 changes: 8 additions & 7 deletions src/cpp/mip/definitions/data_gnss.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1669,8 +1669,8 @@ struct RfErrorDetection
RF_BAND = 0x0001, ///<
JAMMING_STATE = 0x0002, ///<
SPOOFING_STATE = 0x0004, ///<
FLAGS = 0x0007, ///<
ALL = 0x0007,
FREQUENCY = 0x0008, ///<
ALL = 0x000F,
};
uint16_t value = NONE;

Expand All @@ -1688,16 +1688,17 @@ struct RfErrorDetection
constexpr void jammingState(bool val) { value &= ~JAMMING_STATE; if(val) value |= JAMMING_STATE; }
constexpr bool spoofingState() const { return (value & SPOOFING_STATE) > 0; }
constexpr void spoofingState(bool val) { value &= ~SPOOFING_STATE; if(val) value |= SPOOFING_STATE; }
constexpr uint16_t flags() const { return (value & FLAGS) >> 0; }
constexpr void flags(uint16_t val) { value = (value & ~FLAGS) | (val << 0); }
constexpr bool frequency() const { return (value & FREQUENCY) > 0; }
constexpr void frequency(bool val) { value &= ~FREQUENCY; if(val) value |= FREQUENCY; }
constexpr bool allSet() const { return value == ALL; }
constexpr void setAll() { value |= ALL; }
};
/// Parameters
RFBand rf_band = static_cast<RFBand>(0); ///< RF Band of the reported information
JammingState jamming_state = static_cast<JammingState>(0); ///< GNSS Jamming State (as reported by the GNSS module)
SpoofingState spoofing_state = static_cast<SpoofingState>(0); ///< GNSS Spoofing State (as reported by the GNSS module)
uint8_t reserved[4] = {0}; ///< Reserved for future use
uint16_t frequency = 0; ///< Center frequency of the RF band in MHz
uint8_t reserved[2] = {0}; ///< Reserved for future use
ValidFlags valid_flags;

/// Descriptors
Expand All @@ -1710,12 +1711,12 @@ struct RfErrorDetection

auto asTuple() const
{
return std::make_tuple(rf_band,jamming_state,spoofing_state,reserved,valid_flags);
return std::make_tuple(rf_band,jamming_state,spoofing_state,frequency,reserved,valid_flags);
}

auto asTuple()
{
return std::make_tuple(std::ref(rf_band),std::ref(jamming_state),std::ref(spoofing_state),std::ref(reserved),std::ref(valid_flags));
return std::make_tuple(std::ref(rf_band),std::ref(jamming_state),std::ref(spoofing_state),std::ref(frequency),std::ref(reserved),std::ref(valid_flags));
}

/// Serialization
Expand Down
13 changes: 11 additions & 2 deletions src/cpp/mip/metadata/definitions/data_gnss.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1825,7 +1825,7 @@ struct MetadataFor<data_gnss::RfErrorDetection::ValidFlags>
{ uint32_t(1), "rf_band", "" },
{ uint32_t(2), "jamming_state", "" },
{ uint32_t(4), "spoofing_state", "" },
{ uint32_t(7), "flags", "" },
{ uint32_t(8), "frequency", "" },
};

static constexpr inline BitfieldInfo value = {
Expand Down Expand Up @@ -1870,13 +1870,22 @@ struct MetadataFor<data_gnss::RfErrorDetection>
/* .count = */ 1,
/* .condition = */ {},
},
{
/* .name = */ "frequency",
/* .docs = */ "Center frequency of the RF band in MHz",
/* .type = */ {Type::U16, nullptr},
/* .accessor = */ nullptr, //utils::access<type, uint16_t, &type::frequency>,
/* .attributes = */ {true, false, false, false, false},
/* .count = */ 1,
/* .condition = */ {},
},
{
/* .name = */ "reserved",
/* .docs = */ "Reserved for future use",
/* .type = */ {Type::U8, nullptr},
/* .accessor = */ nullptr, //utils::access<type, uint8_t, &type::reserved>,
/* .attributes = */ {true, false, false, false, false},
/* .count = */ 4,
/* .count = */ 2,
/* .condition = */ {},
},
{
Expand Down