| @@ -172,15 +172,19 @@ struct PropertyDelegateDetail | |||||
| static auto getSubscribeId (const PropertyRequestHeader&) { return String{}; } | static auto getSubscribeId (const PropertyRequestHeader&) { return String{}; } | ||||
| static auto getSubscribeId (const PropertyReplyHeader&) { return String{}; } | static auto getSubscribeId (const PropertyReplyHeader&) { return String{}; } | ||||
| static auto getStatus (const PropertySubscriptionHeader&) { return 0; } | |||||
| static auto getStatus (const PropertyRequestHeader&) { return 0; } | |||||
| static auto getStatus (const PropertyReplyHeader& h) { return h.status; } | |||||
| static std::optional<int> getStatus (const PropertySubscriptionHeader&) { return {}; } | |||||
| static std::optional<int> getStatus (const PropertyRequestHeader&) { return {}; } | |||||
| static std::optional<int> getStatus (const PropertyReplyHeader& h) { return h.status; } | |||||
| template <typename T> | template <typename T> | ||||
| static auto toFieldsFromHeader (const T& t) | static auto toFieldsFromHeader (const T& t) | ||||
| { | { | ||||
| auto fields = t.extended; | auto fields = t.extended; | ||||
| // Status shall always be included if it is present in the header | |||||
| if (const auto status = getStatus (t)) | |||||
| fields["status"] = *status; | |||||
| if (getResource (t) != getResource (T())) | if (getResource (t) != getResource (T())) | ||||
| fields["resource"] = getResource (t); | fields["resource"] = getResource (t); | ||||
| @@ -199,9 +203,6 @@ struct PropertyDelegateDetail | |||||
| if (t.mediaType != T().mediaType) | if (t.mediaType != T().mediaType) | ||||
| fields["mediaType"] = t.mediaType; | fields["mediaType"] = t.mediaType; | ||||
| if (getStatus (t) != getStatus (T())) | |||||
| fields["status"] = getStatus (t); | |||||
| if (getSetPartial (t)) | if (getSetPartial (t)) | ||||
| fields["setPartial"] = true; | fields["setPartial"] = true; | ||||