Closed michaelbeaumont closed 3 years ago
I like the idea and changes look ok. I just have two considerations:
ChargePointHandler
naming, simply because in OCPP 2.0 charge points are suddenly called charging stations. I would imagine this naming will be kept in future versions, so I would suggest making this "future-proof" from the start. WDYT?ocppXX
layer as independent from the websocket layer as possible (users don't even see it in normal usage). With these changes the separation becomes less obvious. I would love not to extend the ws.Channel
interface with too many accessors in the future, because the point is to not access the websocket layer directly, but keep the ocppXX
layer as transparent as possible.Otherwise I'm fine with adding this as a breaking change for an upcoming release (once the tests are passing).
ocpp1.6
Assuming we're not adding any functionality to the ChargePointConnection
and ChargingStationConnection
interfaces, you could even go the extra mile and remove chargePointConnection
and chargingStationConnection
structs entirely. There's no real need for them, since ws.Channel
conforms to the two interfaces you defined (apart from the function naming, but that can be simplified on the websocket layer). Your call on this one.
For my purposes at least, it's enough to have the
NewChargePointHandler
acceptws.Channel
s, so I haven't changed all of the request callbacks. WDYT? I'll update2.0
if it looks good. @lorenzodonini