1 #ifndef OPCUABRIDGE_ECUVERSIONMANIFESTSIGNED_H_ 2 #define OPCUABRIDGE_ECUVERSIONMANIFESTSIGNED_H_ 14 const std::string& getEcuIdentifier()
const {
return ecuIdentifier_; }
15 void setEcuIdentifier(
const std::string& ecuIdentifier) { ecuIdentifier_ = ecuIdentifier; }
16 const int& getPreviousTime()
const {
return previousTime_; }
17 void setPreviousTime(
const int& previousTime) { previousTime_ = previousTime; }
18 const int& getCurrentTime()
const {
return currentTime_; }
19 void setCurrentTime(
const int& currentTime) { currentTime_ = currentTime; }
20 const std::string& getSecurityAttack()
const {
return securityAttack_; }
21 void setSecurityAttack(
const std::string& securityAttack) { securityAttack_ = securityAttack; }
22 const Image& getInstalledImage()
const {
return installedImage_; }
23 void setInstalledImage(
const Image& installedImage) { installedImage_ = installedImage; }
25 Json::Value wrapMessage()
const {
27 v[
"ecu_serial"] = getEcuIdentifier();
28 v[
"previous_timeserver_time"] = getPreviousTime();
29 v[
"timeserver_time"] = getCurrentTime();
30 v[
"attacks_detected"] = getSecurityAttack();
31 v[
"installed_image"] = getInstalledImage().wrapMessage();
34 void unwrapMessage(Json::Value v) {
35 setEcuIdentifier(v[
"ecu_serial"].asString());
36 setPreviousTime(v[
"previous_timeserver_time"].asInt());
37 setCurrentTime(v[
"timeserver_time"].asInt());
38 setSecurityAttack(v[
"attacks_detected"].asString());
40 i.unwrapMessage(v[
"installed_image"]);
45 std::string ecuIdentifier_;
48 std::string securityAttack_;
49 Image installedImage_;
52 #ifdef OPCUABRIDGE_ENABLE_SERIALIZATION 53 SERIALIZE_FUNCTION_FRIEND_DECLARATION
55 DEFINE_SERIALIZE_METHOD() {
56 SERIALIZE_FIELD(ar,
"ecuIdentifier_", ecuIdentifier_);
57 SERIALIZE_FIELD(ar,
"previousTime_", previousTime_);
58 SERIALIZE_FIELD(ar,
"currentTime_", currentTime_);
59 SERIALIZE_FIELD(ar,
"securityAttack_", securityAttack_);
60 SERIALIZE_FIELD(ar,
"installedImage_", installedImage_);
62 #endif // OPCUABRIDGE_ENABLE_SERIALIZATION 66 #endif // OPCUABRIDGE_ECUVERSIONMANIFESTSIGNED_H_