Closed hevanto closed 2 years ago
Makes sense, I opened a MR that should help you achieve what you need. I also added a bit of documentation in the readme regarding some more "advanced" features.
In a nutshell:
ocppj.SetMessageValidation(false)
Feel free to have a look and leave me some feedback, if you want.
The current limitation is, that you can only disable validation at a package level (i.e. for all messages, or none at all).
I can imagine supporting this at a per-message level, by passing options to Send
APIs in the future. This will be a major change though, so I'd take my time to design that right.
@lorenzodonini I looked a the PR. It looks ok to me and would work for my current issue.
Rationale
I'm currently working on a system to talk to an already installed set of charge points (about 1500). These charge points communicate OCPP 1.6 but do not conform strict to the spec.
e.g. The charge points will reject the RemoteStartTransaction command if no connectorId is provided. They assume connectorId 0 means that no connectorId is present in the request. This ofcourse is not possible to send right now, as the library validates every object for correctness (as it should actually... ).
Unfortunately upgrading/fixing the charge points is not an option. These are already in the field for many of years and the manufacturer is unwilling to upgrade / adjust their OCPP implementation.
Request
Have the option start the library in 'relax mode'; meaning to disable the validate calls on the objects send / received. Of course this would be an explicit option that needs to be set before initializing the library.