Skip to main content

dart_ocpp 0.5.0 copy "dart_ocpp: ^0.5.0" to clipboard
dart_ocpp: ^0.5.0 copied to clipboard

OCPP 1.6-J and 2.0.1 Central System (server) and Charge Point (client) library over WebSocket, with typed message models and migration helpers.

0.5.0 - 2026-11-18 #

  • Complete OCPP 2.0.1 Central-System-initiated Core commands:
    • Added request and response models for 9 Central-System-initiated commands:
      • Reset: ResetRequest, ResetResponse, and enums ResetEnumType, ResetStatusEnumType.
      • RequestStartTransaction: RequestStartTransactionRequest, RequestStartTransactionResponse, and enum RequestStartStopStatusEnumType (reusing IdTokenType and ChargingProfileType).
      • RequestStopTransaction: RequestStopTransactionRequest, RequestStopTransactionResponse (reusing RequestStartStopStatusEnumType).
      • SetVariables: SetVariablesRequest, SetVariablesResponse, SetVariableDataType, SetVariableResultType, and enums AttributeEnumType, SetVariableStatusEnumType (reusing ComponentType, VariableType, StatusInfoType).
      • GetVariables: GetVariablesRequest, GetVariablesResponse, GetVariableDataType, GetVariableResultType, and enum GetVariableStatusEnumType (reusing ComponentType, VariableType, AttributeEnumType, StatusInfoType).
      • TriggerMessage: TriggerMessageRequest, TriggerMessageResponse, and enums MessageTriggerEnumType, TriggerMessageStatusEnumType (reusing EVSEType, StatusInfoType).
      • UnlockConnector: UnlockConnectorRequest, UnlockConnectorResponse, and enum UnlockStatusEnumType (reusing StatusInfoType).
      • ChangeAvailability: ChangeAvailabilityRequest, ChangeAvailabilityResponse, and enums OperationalStatusEnumType, ChangeAvailabilityStatusEnumType (reusing EVSEType, StatusInfoType).
      • ClearCache: ClearCacheRequest, ClearCacheResponse, and enum ClearCacheStatusEnumType (reusing StatusInfoType).
    • Added device model foundation types ComponentType and VariableType in device_model.dart (reusing EVSEType).
    • Charge point side (OcppClient): registered all 9 request types in typedRequestSpecs so client.on<T> handles inbound 2.0.1 commands with typed request decoding and typed response serialization.
    • Central System side (OcppSession): added typed send helper methods:
      • session.reset201(...) / session.sendReset201(req) / session.sendResetRequest(req)
      • session.requestStartTransaction(...) / session.sendRequestStartTransaction(req)
      • session.requestStopTransaction(...) / session.sendRequestStopTransaction(req)
      • session.setVariables(...) / session.sendSetVariables(req)
      • session.getVariables(...) / session.sendGetVariables(req)
      • session.triggerMessage201(...) / session.sendTriggerMessage201(req) / session.sendTriggerMessageRequest(req)
      • session.unlockConnector201(...) / session.sendUnlockConnector201(req) / session.sendUnlockConnectorRequest(req)
      • session.changeAvailability201(...) / session.sendChangeAvailability201(req) / session.sendChangeAvailabilityRequest(req)
      • session.clearCache201(...) / session.sendClearCache201(req) / session.sendClearCacheRequest(req)

0.4.0 - 2026-11-18 #

  • Complete OCPP 1.6 Core profile Central-System-initiated remote commands:
    • Added request and response models for 11 Central-System-initiated commands:
      • Reset: ResetReq, ResetConf, and enums ResetType, ResetStatus.
      • RemoteStartTransaction: RemoteStartTransactionReq, RemoteStartTransactionConf, and enum RemoteStartStopStatus (reusing ChargingProfile).
      • RemoteStopTransaction: RemoteStopTransactionReq, RemoteStopTransactionConf (reusing RemoteStartStopStatus).
      • ChangeConfiguration: ChangeConfigurationReq, ChangeConfigurationConf, and enum ConfigurationStatus.
      • GetConfiguration: GetConfigurationReq, GetConfigurationConf, and KeyValue object model.
      • TriggerMessage: TriggerMessageReq, TriggerMessageConf, and enums MessageTrigger, TriggerMessageStatus.
      • UnlockConnector: UnlockConnectorReq, UnlockConnectorConf, and enum UnlockStatus.
      • ChangeAvailability: ChangeAvailabilityReq, ChangeAvailabilityConf, and enums AvailabilityType, AvailabilityStatus.
      • ClearCache: ClearCacheReq, ClearCacheConf, and enum ClearCacheStatus.
      • GetDiagnostics: GetDiagnosticsReq, GetDiagnosticsConf.
      • UpdateFirmware: UpdateFirmwareReq, UpdateFirmwareConf.
    • Charge point side (OcppClient): registered all 11 request types in typedRequestSpecs so client.on<T> handles inbound remote commands with typed request decoding and typed response serialization.
    • Central System side (OcppSession): added typed send helper methods:
      • session.reset(type: ...) / session.sendReset(req)
      • session.remoteStartTransaction(...) / session.sendRemoteStartTransaction(req)
      • session.remoteStopTransaction(...) / session.sendRemoteStopTransaction(req)
      • session.changeConfiguration(...) / session.sendChangeConfiguration(req)
      • session.getConfiguration(...) / session.sendGetConfiguration(req)
      • session.triggerMessage(...) / session.sendTriggerMessage(req)
      • session.unlockConnector(...) / session.sendUnlockConnector(req)
      • session.changeAvailability(...) / session.sendChangeAvailability(req)
      • session.clearCache(...) / session.sendClearCache(req)
      • session.getDiagnostics(...) / session.sendGetDiagnostics(req)
      • session.updateFirmware(...) / session.sendUpdateFirmware(req)

0.3.0 - 2026-11-18 #

  • Central System (server) role: added OcppServer and OcppSession under lib/src/server/.
    • OcppServer: Binds an HTTP server and accepts WebSocket upgrades matching an optional pathPrefix (extracting chargePointId from the URL path).
    • Subprotocol negotiation: Server strictly negotiates ocpp1.6 or ocpp2.0.1 and rejects connections when there is no protocol overlap.
    • Pre-upgrade authorization hook: onAuthorize callback to validate credentials (e.g. HTTP Basic auth or tokens) before establishing a session.
    • Session lifecycle: Stream<OcppSessionEvent> emitting OcppSessionConnected and OcppSessionDisconnected. Reconnecting charge points close stale sessions cleanly.
    • Strict synchronicity and queueing: Outbound calls (OcppSession.call) respect OCPP-J synchronicity rules (at most one outstanding CALL per connection direction) using internal FIFO queueing.
    • Robust error handling: Malformed frames return CALLERROR (FormationViolation / FormatViolation / ProtocolError) without terminating the socket. Inbound calls without a registered handler respond with NotImplemented.
    • Outbound request timeouts: Configurable timeout that cleans up pending state and releases the queue.
    • Typed server-side convenience handlers: OcppSession.on<T> / off<T> and OcppServer.on<T> / onSession<T>.
      • OCPP 1.6 Core profile: BootNotification (BootNotificationReq), Heartbeat (HeartbeatReq), StatusNotification (StatusNotificationReq), Authorize (AuthorizeReq), StartTransaction (StartTransactionReq), StopTransaction (StopTransactionReq), MeterValues (MeterValuesReq), plus DataTransfer (DataTransferReq), DiagnosticsStatusNotification (DiagnosticsStatusNotificationReq), FirmwareStatusNotification (FirmwareStatusNotificationReq).
      • OCPP 2.0.1: BootNotification (BootNotificationRequest), Heartbeat (HeartbeatRequest), StatusNotification (StatusNotificationRequest), Authorize (AuthorizeRequest), TransactionEvent (TransactionEventRequest), DataTransfer (DataTransferRequest), FirmwareStatusNotification (FirmwareStatusNotificationRequest), LogStatusNotification (LogStatusNotificationRequest).

0.2.1 - 2026-11-17 #

  • Docs: corrected the package description, which said "client/server" while the library implements the Charge Point (client) role only. The Central System (server) role is not implemented. No code changes.

0.2.0 - 2026-11-01 #

  • Reservation: ReserveNow and CancelReservation for OCPP 1.6 (ReserveNowReq/Conf, CancelReservationReq/Conf) and 2.0.1 (ReserveNowRequest/Response, CancelReservationRequest/Response), with ReservationStatus, CancelReservationStatus, ReserveNowStatusEnumType, CancelReservationStatusEnumType and ConnectorEnumType.
  • Smart charging: SetChargingProfile, ClearChargingProfile, GetCompositeSchedule for both versions, with full ChargingProfile / ChargingSchedule / ChargingSchedulePeriod models (2.0.1: ChargingProfileType, ChargingScheduleType, ChargingSchedulePeriodType, SalesTariffType, CompositeScheduleType, ChargingLimitType, ChargingLimitSourceEnumType).
  • Local authorization list: SendLocalList and GetLocalListVersion for both versions (AuthorizationData, UpdateType for 1.6; AuthorizationDataType carrying IdTokenInfoType, UpdateEnumType for 2.0.1).
  • Migration: request and response translators in both directions for all of the above, plus idTagInfo / idTokenInfo helpers. Lossy fields are documented in MIGRATION.md.
  • Central-System-initiated typed messages: OcppClient.on<T>(handler) and off<T>(). Handled calls are decoded and answered (result; OcppCallException becomes a CALLERROR; other errors become InternalError) and are not emitted on incoming. Unmatched calls still arrive as raw OcppCall.

0.1.0 - 2026-11-01 #

  • Initial release: OCPP 1.6-J and 2.0.1 message models, codec, client, migration helpers.
0
likes
160
points
139
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

OCPP 1.6-J and 2.0.1 Central System (server) and Charge Point (client) library over WebSocket, with typed message models and migration helpers.

Repository (GitHub)
View/report issues

Topics

#ocpp #ev-charging #websocket #iot

License

MIT (license)

Dependencies

json_annotation, uuid, web_socket_channel

More

Packages that depend on dart_ocpp