diff --git a/CHANGELOG.md b/CHANGELOG.md index 6519f06bd..1dca3ca9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change log + +- [#381](https://github.com/mobilityhouse/ocpp/issues/381) FormatViolation serialization bug with OCPP 1.6-J + ## 0.21.0 (2023-10-19) - [#492] Minor fixes _handle_call doc string - Thanks @drc38 diff --git a/ocpp/exceptions.py b/ocpp/exceptions.py index 6c570425f..22c693b40 100644 --- a/ocpp/exceptions.py +++ b/ocpp/exceptions.py @@ -68,12 +68,31 @@ class SecurityError(OCPPError): class FormatViolationError(OCPPError): + """ + Not strict OCPP 1.6 - see FormationViolationError + Valid OCPP 2.0.1 + """ + code = "FormatViolation" default_description = ( "Payload for Action is syntactically incorrect or " "structure for Action" ) +class FormationViolationError(OCPPError): + """ + To allow for strict OCPP 1.6 compliance + 5. Known issues that will not be fixed + 5.2. Page 14, par 4.2.3. CallError: incorrect name in enum: FormationViolation + Incorrect name in enum: FormationViolation + """ + + code = "FormationViolation" + default_description = ( + "Payload for Action is syntactically incorrect or structure for Action" + ) + + class PropertyConstraintViolationError(OCPPError): code = "PropertyConstraintViolation" default_description = ( @@ -83,6 +102,14 @@ class PropertyConstraintViolationError(OCPPError): class OccurenceConstraintViolationError(OCPPError): + """ + To allow for strict OCPP 1.6 compliance + ocpp-j-1.6-errata-sheet.pdf + 5. Known issues that will not be fixed + 5.1. Page 14, par 4.2.3: CallError: Typo in enum + Typo in enum: OccurenceConstraintViolation + """ + code = "OccurenceConstraintViolation" default_description = ( "Payload for Action is syntactically correct but " @@ -91,6 +118,20 @@ class OccurenceConstraintViolationError(OCPPError): ) +class OccurrenceConstraintViolationError(OCPPError): + """ + Not strict OCPP 1.6 - see OccurenceConstraintViolationError + Valid OCPP 2.0.1 + """ + + code = "OccurrenceConstraintViolation" + default_description = ( + "Payload for Action is syntactically correct but " + "at least one of the fields violates occurence " + "constraints" + ) + + class TypeConstraintViolationError(OCPPError): code = "TypeConstraintViolation" default_description = (