External parameters allow default value specifications:
external param SECTION_CONFIGS: SectionConfigs default TELEMETRY_SECTION_DEFAULTS
However, the loadParameters function generated does not supply the default value when it fails to load from the database:
// Get parameter SECTION_CONFIGS
param_valid = this->m_paramGetOut_OutputPort[0].invoke(
_id,
_buff
);
// If there was a deserialization issue, mark it invalid
if (param_valid == Fw::ParamValid::VALID) {
// Pass the local ID to the delegate
constexpr FwPrmIdType _localId = PARAMID_SECTION_CONFIGS;
FW_ASSERT(this->paramDelegatePtr != nullptr);
// Call the delegate deserialize function for m_SECTION_CONFIGS
_stat = this->paramDelegatePtr->deserializeParam(_baseId, _localId, param_valid, _buff);
if (_stat != Fw::FW_SERIALIZE_OK) {
param_valid = Fw::ParamValid::INVALID;
}
}
else {
param_valid = Fw::ParamValid::INVALID; // <------- Here the database failed to load. However, no call to `deserializeParam` with a default value was supplied
}
Since default is allowed with external it seems that the default value should be supplied to ensure that the default is set.
External parameters allow default value specifications:
However, the
loadParametersfunction generated does not supply the default value when it fails to load from the database:Since
defaultis allowed withexternalit seems that the default value should be supplied to ensure that the default is set.