@@ -71,8 +71,8 @@ bool StatusNotificationReqConverter::fromJson(const rapidjson::Value& json,
7171 extract (json, " info" , data.info );
7272 data.status = ChargePointStatusHelper.fromString (json[" status" ].GetString ());
7373 ret = ret && extract (json, " timestamp" , data.timestamp , error_message);
74- extract (json, " info " , data.vendorId );
75- extract (json, " info " , data.vendorErrorCode );
74+ extract (json, " vendorId " , data.vendorId );
75+ extract (json, " vendorErrorCode " , data.vendorErrorCode );
7676 if (!ret)
7777 {
7878 error_code = ocpp::rpc::IRpc::RPC_ERROR_TYPE_CONSTRAINT_VIOLATION;
@@ -87,12 +87,12 @@ bool StatusNotificationReqConverter::toJson(const StatusNotificationReq& data, r
8787 fill (json, " errorCode" , ChargePointErrorCodeHelper.toString (data.errorCode ));
8888 fill (json, " status" , ChargePointStatusHelper.toString (data.status ));
8989 fill (json, " timestamp" , data.timestamp );
90- if (data.errorCode != ChargePointErrorCode::NoError)
91- {
90+ if (data.info .isSet ())
9291 fill (json, " info" , data.info );
92+ if (data.vendorId .isSet ())
9393 fill (json, " vendorId" , data.vendorId );
94+ if (data.vendorErrorCode .isSet ())
9495 fill (json, " vendorErrorCode" , data.vendorErrorCode );
95- }
9696 return true ;
9797}
9898
0 commit comments