Skip to content

Websocket and generic improvements

Pre-release
Pre-release
Compare
Choose a tag to compare
@lorenzodonini lorenzodonini released this 25 Jul 09:50
· 160 commits to master since this release

Breaking Changes

Some breaking changes in the central system's function callbacks were introduced in this release:

  • The ChargePointConnection reference is passed to callbacks on the server (replaces the standalone charge point ID)
  • Handler functions in client and server now use type aliases
  • ConfigurationKey (used by the GetConfiguration feature) now uses pointers to values, to differentiate between empty and nil values. This fixes omissions of empty strings in GetConfiguration messages

All implementations will work as before, but the method signatures have slightly changed and will need to be updated. Please refer to the updated example or refer to a748928 for updating your implementation.

Additions and improvements

Websocket

  • Added an Addr method to the websocket server for retrieving the listening address
  • Added a StopConnection function on the websocket server, to close a single existing connection
  • Added a graceful shutdown mechanism on the websocket server, which now sends a close message to every open connection
  • Charge point IDs now contain only the ID, stripping any prefix from the path
  • Subprotocols are now correctly handled and enforced by the server,
  • New connections with unsupported subprotocol now get closed only after completing the handshake

Generic

  • Added missing OCPP 2.0.1 features (examples and documentation still WIP)
  • Improved OCPP error messages
  • An InternalError is now sent, instead of a ProtocolError, when sending errors as a message response
  • Improved ClientDispatcher.SendRequest signature

Bugfixes

  • Fixed several race conditions causing hanging and other issues when closing/restarting connections
  • Fixed some field constraints that were too restrictive in:
    • RemoteStopTransaction
    • StartTransaction
    • StopTransaction
    • CancelReservation
    • ReserveNow
    • ClearChargingProfile
  • Fixed panics when attempting to parse unknown responses
  • New connections with the same ID no longer override previous connections but are closed immediately with a PolicyViolation error instead