lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
262 stars 125 forks source link

ocpp1.6: Fix constraints to match spec #76

Closed michaelbeaumont closed 3 years ago

michaelbeaumont commented 3 years ago

Some constraints were too strict

lorenzodonini commented 3 years ago

@michaelbeaumont All tests contain validation checks, so these will obviously fail now.

I know that I have set "strict" constraints. My (probably biased) assumption was, that negative IDs don't really make sense. I realize this may not be an absolute truth, so thanks for removing those constraints.

In the v2.0.1 implementation I already decided to take these out and keep it simple.

michaelbeaumont commented 3 years ago

I totally agree it doesn't make sense. Unfortunately the 1.6 spec is quite underspecified in a number of instances, which leads to some vendors doing things like having reservationId = -1 to mean no reservationId.

lorenzodonini commented 3 years ago

I totally agree it doesn't make sense. Unfortunately the 1.6 spec is quite underspecified in a number of instances, which leads to some vendors doing things like having reservationId = -1 to mean no reservationId.

Which is funny imho, since:

  1. those fields are mostly optional
  2. typical SQL DBs out there have their auto-increment starting at 1. So these vendors could, at least for the reservation ID use case, actually use 0 as a no reservation ID value

In any case -> merged