├── .github └── workflows │ └── scala.yml ├── .gitignore ├── LICENSE ├── README.md ├── build.sbt ├── example-json-client └── src │ └── main │ └── scala │ └── com │ └── thenewmotion │ └── ocpp │ └── json │ └── example │ └── JsonClientTestApp.scala ├── example-json-server-20 └── src │ └── main │ └── scala │ └── com │ └── thenewmotion │ └── ocpp │ └── json │ └── example │ └── ExampleServerTestApp.scala ├── example-json-server └── src │ └── main │ └── scala │ └── com │ └── thenewmotion │ └── ocpp │ └── json │ └── example │ └── ExampleServerTestApp.scala ├── ocpp-j-api └── src │ ├── it │ └── scala │ │ └── com │ │ └── thenewmotion │ │ └── ocpp │ │ └── json │ │ └── api │ │ └── ClientServerIntegrationSpec.scala │ ├── main │ └── scala │ │ └── com │ │ └── thenewmotion │ │ └── ocpp │ │ └── json │ │ └── api │ │ ├── BaseOcppConnectionComponent.scala │ │ ├── CallIdGenerator.scala │ │ ├── DefaultSrpcComponent.scala │ │ ├── Ocpp1XConnectionComponent.scala │ │ ├── Ocpp20ConnectionComponent.scala │ │ ├── OcppConnectionComponent.scala │ │ ├── OutgoingOcppEndpoint.scala │ │ ├── RequestHandler.scala │ │ ├── SrpcComponent.scala │ │ ├── WebSocketComponent.scala │ │ ├── client │ │ ├── CakeBasedOcppClientEndpoint.scala │ │ ├── OcppJsonClient.scala │ │ └── SimpleClientWebSocketComponent.scala │ │ ├── package.scala │ │ └── server │ │ ├── Ocpp1XJsonServer.scala │ │ ├── Ocpp20JsonServer.scala │ │ ├── OcppJsonServer.scala │ │ └── SimpleServerWebSocketComponent.scala │ └── test │ ├── resources │ └── logback.xml │ └── scala │ └── com │ └── thenewmotion │ └── ocpp │ └── json │ └── api │ ├── DefaultSrpcConnectionSpec.scala │ ├── Ocpp1XConnectionSpec.scala │ ├── Ocpp20ConnectionSpec.scala │ ├── RequestHandlerSpec.scala │ └── client │ ├── OcppJsonClientSpec.scala │ └── SimpleClientWebSocketComponentSpec.scala ├── ocpp-json └── src │ ├── main │ └── scala │ │ └── com │ │ └── thenewmotion │ │ └── ocpp │ │ └── json │ │ ├── SerializationCommon.scala │ │ ├── TransportMessageJsonSerializer.scala │ │ ├── TransportMessageParser.scala │ │ ├── TransportMessageProtocol.scala │ │ ├── v1x │ │ ├── JsonOperation.scala │ │ ├── OcppMessageSerializer.scala │ │ ├── Serialization.scala │ │ ├── VersionSpecificMessage.scala │ │ ├── ZonedDateTimeJsonFormat.scala │ │ ├── v15 │ │ │ ├── Message.scala │ │ │ └── SerializationV15.scala │ │ └── v16 │ │ │ ├── Message.scala │ │ │ └── SerializationV16.scala │ │ └── v20 │ │ ├── Ocpp20Procedure.scala │ │ ├── Serialization.scala │ │ └── serialization │ │ ├── ChargingRateSerializer.scala │ │ ├── EnumerableNameSerializer.scala │ │ ├── InstantSerializer.scala │ │ └── package.scala │ └── test │ ├── resources │ └── com │ │ └── thenewmotion │ │ └── ocpp │ │ └── json │ │ ├── srpc │ │ ├── callmessage.json │ │ ├── errorresponsemessage.json │ │ ├── responsemessage.json │ │ ├── wrongelementsmessage-toofew.json │ │ ├── wrongelementsmessage-toomany.json │ │ └── wrongtypemessage.json │ │ ├── v1x │ │ ├── ocpp15 │ │ │ ├── gir_without_srpc │ │ │ │ ├── authorize.request.json │ │ │ │ ├── authorize.response.json │ │ │ │ ├── bootnotification.request.json │ │ │ │ ├── bootnotification.response.json │ │ │ │ ├── centralsystemdatatransfer.request.json │ │ │ │ ├── centralsystemdatatransfer.response.json │ │ │ │ ├── chargepointdatatransfer.request.json │ │ │ │ ├── chargepointdatatransfer.response.json │ │ │ │ ├── diagnosticsstatusnotification.request.json │ │ │ │ ├── diagnosticsstatusnotification.response.json │ │ │ │ ├── firmwarestatusnotification.request.json │ │ │ │ ├── firmwarestatusnotification.response.json │ │ │ │ ├── heartbeat.request.json │ │ │ │ ├── heartbeat.response.json │ │ │ │ ├── metervalues.request.json │ │ │ │ ├── metervalues.response.json │ │ │ │ ├── remotecancelreservation.request.json │ │ │ │ ├── remotecancelreservation.response.json │ │ │ │ ├── remotechangeavailability.request.json │ │ │ │ ├── remotechangeavailability.response.json │ │ │ │ ├── remotechangeconfiguration.request.json │ │ │ │ ├── remotechangeconfiguration.response.json │ │ │ │ ├── remoteclearcache.request.json │ │ │ │ ├── remoteclearcache.response.json │ │ │ │ ├── remotegetconfiguration.request.json │ │ │ │ ├── remotegetconfiguration.response.json │ │ │ │ ├── remotegetdiagnostics.request.json │ │ │ │ ├── remotegetdiagnostics.response.json │ │ │ │ ├── remotegetlocallistversion.request.json │ │ │ │ ├── remotegetlocallistversion.response.json │ │ │ │ ├── remotereservenow.request.json │ │ │ │ ├── remotereservenow.response.json │ │ │ │ ├── remotereset.request.json │ │ │ │ ├── remotereset.response.json │ │ │ │ ├── remotesendlocallist.request.json │ │ │ │ ├── remotesendlocallist.response.json │ │ │ │ ├── remotestarttransaction.request.json │ │ │ │ ├── remotestarttransaction.response.json │ │ │ │ ├── remotestoptransaction.request.json │ │ │ │ ├── remotestoptransaction.response.json │ │ │ │ ├── remoteunlockconnector.request.json │ │ │ │ ├── remoteunlockconnector.response.json │ │ │ │ ├── remoteupdatefirmware.request.json │ │ │ │ ├── remoteupdatefirmware.response.json │ │ │ │ ├── starttransaction.request.json │ │ │ │ ├── starttransaction.response.json │ │ │ │ ├── statusnotification.request.json │ │ │ │ ├── statusnotification.response.json │ │ │ │ ├── stoptransaction.request.json │ │ │ │ └── stoptransaction.response.json │ │ │ └── without_srpc │ │ │ │ ├── authorize.request.json │ │ │ │ ├── authorize.response.json │ │ │ │ ├── bootnotification.request.json │ │ │ │ ├── bootnotification.response.json │ │ │ │ ├── cancelreservation.request.json │ │ │ │ ├── cancelreservation.response.json │ │ │ │ ├── centralsystemdatatransfer.request.json │ │ │ │ ├── centralsystemdatatransfer.response.json │ │ │ │ ├── changeavailability.invalidstatus.response.json │ │ │ │ ├── changeavailability.request.json │ │ │ │ ├── changeavailability.response.json │ │ │ │ ├── changeavailability.wholecharger.request.json │ │ │ │ ├── changeconfiguration.request.json │ │ │ │ ├── changeconfiguration.response.json │ │ │ │ ├── chargepointdatatransfer.request.json │ │ │ │ ├── chargepointdatatransfer.response.json │ │ │ │ ├── clearcache.request.json │ │ │ │ ├── clearcache.response.json │ │ │ │ ├── diagnosticsstatusnotification.request.json │ │ │ │ ├── diagnosticsstatusnotification.response.json │ │ │ │ ├── firmwarestatusnotification.request.json │ │ │ │ ├── firmwarestatusnotification.response.json │ │ │ │ ├── getconfiguration.request.json │ │ │ │ ├── getconfiguration.response.json │ │ │ │ ├── getdiagnostics.request.json │ │ │ │ ├── getdiagnostics.response.json │ │ │ │ ├── getlocallistversion.request.json │ │ │ │ ├── getlocallistversion.response.json │ │ │ │ ├── heartbeat.request.json │ │ │ │ ├── heartbeat.response.json │ │ │ │ ├── metervalues.invalidproperty.request.json │ │ │ │ ├── metervalues.request.json │ │ │ │ ├── metervalues.response.json │ │ │ │ ├── remotestarttransaction.request.json │ │ │ │ ├── remotestarttransaction.response.json │ │ │ │ ├── remotestoptransaction.request.json │ │ │ │ ├── remotestoptransaction.response.json │ │ │ │ ├── reservenow.request.json │ │ │ │ ├── reservenow.response.json │ │ │ │ ├── reset.request.json │ │ │ │ ├── reset.response.json │ │ │ │ ├── sendlocallist.request.json │ │ │ │ ├── sendlocallist.response.json │ │ │ │ ├── starttransaction.localtime.request.json │ │ │ │ ├── starttransaction.request.json │ │ │ │ ├── starttransaction.response.json │ │ │ │ ├── statusnotification.inerror-noerror.request.json │ │ │ │ ├── statusnotification.inerror.request.json │ │ │ │ ├── statusnotification.request.json │ │ │ │ ├── statusnotification.response.json │ │ │ │ ├── stoptransaction.request.json │ │ │ │ ├── stoptransaction.response.json │ │ │ │ ├── unlockconnector.request.json │ │ │ │ ├── unlockconnector.response.json │ │ │ │ ├── updatefirmware.invalidurl.request.json │ │ │ │ ├── updatefirmware.request.json │ │ │ │ └── updatefirmware.response.json │ │ └── v16 │ │ │ └── schemas │ │ │ ├── Authorize.json │ │ │ ├── AuthorizeResponse.json │ │ │ ├── BootNotification.json │ │ │ ├── BootNotificationResponse.json │ │ │ ├── CancelReservation.json │ │ │ ├── CancelReservationResponse.json │ │ │ ├── ChangeAvailability.json │ │ │ ├── ChangeAvailabilityResponse.json │ │ │ ├── ChangeConfiguration.json │ │ │ ├── ChangeConfigurationResponse.json │ │ │ ├── ClearCache.json │ │ │ ├── ClearCacheResponse.json │ │ │ ├── ClearChargingProfile.json │ │ │ ├── ClearChargingProfileResponse.json │ │ │ ├── DataTransfer.json │ │ │ ├── DataTransferResponse.json │ │ │ ├── DiagnosticsStatusNotification.json │ │ │ ├── DiagnosticsStatusNotificationResponse.json │ │ │ ├── FirmwareStatusNotification.json │ │ │ ├── FirmwareStatusNotificationResponse.json │ │ │ ├── GetCompositeSchedule.json │ │ │ ├── GetCompositeScheduleResponse.json │ │ │ ├── GetConfiguration.json │ │ │ ├── GetConfigurationResponse.json │ │ │ ├── GetDiagnostics.json │ │ │ ├── GetDiagnosticsResponse.json │ │ │ ├── GetLocalListVersion.json │ │ │ ├── GetLocalListVersionResponse.json │ │ │ ├── Heartbeat.json │ │ │ ├── HeartbeatResponse.json │ │ │ ├── MeterValues.json │ │ │ ├── MeterValuesResponse.json │ │ │ ├── RemoteStartTransaction.json │ │ │ ├── RemoteStartTransactionResponse.json │ │ │ ├── RemoteStopTransaction.json │ │ │ ├── RemoteStopTransactionResponse.json │ │ │ ├── ReserveNow.json │ │ │ ├── ReserveNowResponse.json │ │ │ ├── Reset.json │ │ │ ├── ResetResponse.json │ │ │ ├── SendLocalList.json │ │ │ ├── SendLocalListResponse.json │ │ │ ├── SetChargingProfile.json │ │ │ ├── SetChargingProfileResponse.json │ │ │ ├── StartTransaction.json │ │ │ ├── StartTransactionResponse.json │ │ │ ├── StatusNotification.json │ │ │ ├── StatusNotificationResponse.json │ │ │ ├── StopTransaction.json │ │ │ ├── StopTransactionResponse.json │ │ │ ├── TriggerMessage.json │ │ │ ├── TriggerMessageResponse.json │ │ │ ├── UnlockConnector.json │ │ │ ├── UnlockConnectorResponse.json │ │ │ ├── UpdateFirmware.json │ │ │ └── UpdateFirmwareResponse.json │ │ └── v20 │ │ └── schemas │ │ ├── AuthorizeRequest.json │ │ ├── AuthorizeResponse.json │ │ ├── BootNotificationRequest.json │ │ ├── BootNotificationResponse.json │ │ ├── CancelReservationRequest.json │ │ ├── CancelReservationResponse.json │ │ ├── CertificateSignedRequest.json │ │ ├── CertificateSignedResponse.json │ │ ├── ChangeAvailabilityRequest.json │ │ ├── ChangeAvailabilityResponse.json │ │ ├── ClearCacheRequest.json │ │ ├── ClearCacheResponse.json │ │ ├── ClearChargingProfileRequest.json │ │ ├── ClearChargingProfileResponse.json │ │ ├── ClearDisplayMessageRequest.json │ │ ├── ClearDisplayMessageResponse.json │ │ ├── ClearVariableMonitoringRequest.json │ │ ├── ClearVariableMonitoringResponse.json │ │ ├── ClearedChargingLimitRequest.json │ │ ├── ClearedChargingLimitResponse.json │ │ ├── CostUpdatedRequest.json │ │ ├── CostUpdatedResponse.json │ │ ├── CustomerInformationRequest.json │ │ ├── CustomerInformationResponse.json │ │ ├── DataTransferRequest.json │ │ ├── DataTransferResponse.json │ │ ├── DeleteCertificateRequest.json │ │ ├── DeleteCertificateResponse.json │ │ ├── FirmwareStatusNotificationRequest.json │ │ ├── FirmwareStatusNotificationResponse.json │ │ ├── Get15118EVCertificateRequest.json │ │ ├── Get15118EVCertificateResponse.json │ │ ├── GetBaseReportRequest.json │ │ ├── GetBaseReportResponse.json │ │ ├── GetCertificateStatusRequest.json │ │ ├── GetCertificateStatusResponse.json │ │ ├── GetChargingProfilesRequest.json │ │ ├── GetChargingProfilesResponse.json │ │ ├── GetCompositeScheduleRequest.json │ │ ├── GetCompositeScheduleResponse.json │ │ ├── GetDisplayMessagesRequest.json │ │ ├── GetDisplayMessagesResponse.json │ │ ├── GetInstalledCertificateIdsRequest.json │ │ ├── GetInstalledCertificateIdsResponse.json │ │ ├── GetLocalListVersionRequest.json │ │ ├── GetLocalListVersionResponse.json │ │ ├── GetLogRequest.json │ │ ├── GetLogResponse.json │ │ ├── GetMonitoringReportRequest.json │ │ ├── GetMonitoringReportResponse.json │ │ ├── GetReportRequest.json │ │ ├── GetReportResponse.json │ │ ├── GetTransactionStatusRequest.json │ │ ├── GetTransactionStatusResponse.json │ │ ├── GetVariablesRequest.json │ │ ├── GetVariablesResponse.json │ │ ├── HeartbeatRequest.json │ │ ├── HeartbeatResponse.json │ │ ├── InstallCertificateRequest.json │ │ ├── InstallCertificateResponse.json │ │ ├── LogStatusNotificationRequest.json │ │ ├── LogStatusNotificationResponse.json │ │ ├── MeterValuesRequest.json │ │ ├── MeterValuesResponse.json │ │ ├── NotifyCentralChargingNeedsRequest.json │ │ ├── NotifyCentralChargingNeedsResponse.json │ │ ├── NotifyChargingLimitRequest.json │ │ ├── NotifyChargingLimitResponse.json │ │ ├── NotifyCustomerInformationRequest.json │ │ ├── NotifyCustomerInformationResponse.json │ │ ├── NotifyDisplayMessagesRequest.json │ │ ├── NotifyDisplayMessagesResponse.json │ │ ├── NotifyEVChargingNeedsRequest.json │ │ ├── NotifyEVChargingNeedsResponse.json │ │ ├── NotifyEVChargingScheduleRequest.json │ │ ├── NotifyEVChargingScheduleResponse.json │ │ ├── NotifyEventRequest.json │ │ ├── NotifyEventResponse.json │ │ ├── NotifyMonitoringReportRequest.json │ │ ├── NotifyMonitoringReportResponse.json │ │ ├── NotifyReportRequest.json │ │ ├── NotifyReportResponse.json │ │ ├── PublishFirmwareRequest.json │ │ ├── PublishFirmwareResponse.json │ │ ├── PublishFirmwareStatusNotificationRequest.json │ │ ├── PublishFirmwareStatusNotificationResponse.json │ │ ├── Renegotiate15118ScheduleRequest.json │ │ ├── Renegotiate15118ScheduleResponse.json │ │ ├── ReportChargingProfilesRequest.json │ │ ├── ReportChargingProfilesResponse.json │ │ ├── RequestStartTransactionRequest.json │ │ ├── RequestStartTransactionResponse.json │ │ ├── RequestStopTransactionRequest.json │ │ ├── RequestStopTransactionResponse.json │ │ ├── ReservationStatusUpdateRequest.json │ │ ├── ReservationStatusUpdateResponse.json │ │ ├── ReserveNowRequest.json │ │ ├── ReserveNowResponse.json │ │ ├── ResetRequest.json │ │ ├── ResetResponse.json │ │ ├── SecurityEventNotificationRequest.json │ │ ├── SecurityEventNotificationResponse.json │ │ ├── SendLocalListRequest.json │ │ ├── SendLocalListResponse.json │ │ ├── SetChargingProfileRequest.json │ │ ├── SetChargingProfileResponse.json │ │ ├── SetDisplayMessageRequest.json │ │ ├── SetDisplayMessageResponse.json │ │ ├── SetMonitoringBaseRequest.json │ │ ├── SetMonitoringBaseResponse.json │ │ ├── SetMonitoringLevelRequest.json │ │ ├── SetMonitoringLevelResponse.json │ │ ├── SetNetworkProfileRequest.json │ │ ├── SetNetworkProfileResponse.json │ │ ├── SetVariableMonitoringRequest.json │ │ ├── SetVariableMonitoringResponse.json │ │ ├── SetVariablesRequest.json │ │ ├── SetVariablesResponse.json │ │ ├── SignCertificateRequest.json │ │ ├── SignCertificateResponse.json │ │ ├── StatusNotificationRequest.json │ │ ├── StatusNotificationResponse.json │ │ ├── TransactionEventRequest.json │ │ ├── TransactionEventResponse.json │ │ ├── TriggerMessageRequest.json │ │ ├── TriggerMessageResponse.json │ │ ├── UnlockConnectorRequest.json │ │ ├── UnlockConnectorResponse.json │ │ ├── UnpublishFirmwareRequest.json │ │ ├── UnpublishFirmwareResponse.json │ │ ├── Update15118EVCertificateRequest.json │ │ ├── Update15118EVCertificateResponse.json │ │ ├── UpdateFirmwareRequest.json │ │ └── UpdateFirmwareResponse.json │ └── scala │ └── com │ └── thenewmotion │ └── ocpp │ └── json │ ├── CommonGenerators.scala │ ├── TransportMessageParserSpec.scala │ ├── v1x │ ├── GirOcppMessageSerializationSpec.scala │ ├── OcppMessageSerializationSpec.scala │ └── v16 │ │ ├── JsonSchemaValidationSpec.scala │ │ ├── SerializationV16Spec.scala │ │ └── scalacheck │ │ ├── Helpers.scala │ │ └── MessageGenerators.scala │ └── v20 │ ├── JsonSchemaValidationSpec.scala │ ├── SerializationSpec.scala │ └── scalacheck │ ├── Helpers.scala │ └── MessageGenerators.scala ├── ocpp-messages └── src │ └── main │ └── scala │ ├── com │ └── thenewmotion │ │ └── ocpp │ │ ├── Version.scala │ │ ├── VersionFamily.scala │ │ └── messages │ │ ├── Message.scala │ │ ├── ReqRes.scala │ │ ├── v1x │ │ ├── CentralSystem.scala │ │ ├── CentralSystemAction.scala │ │ ├── ChargePoint.scala │ │ ├── ChargePointAction.scala │ │ ├── ChargePointErrorCode.scala │ │ ├── ChargePointStatus.scala │ │ ├── ChargingProfile.scala │ │ ├── DataTransferStatus.scala │ │ ├── IdTagInfo.scala │ │ ├── Message.scala │ │ ├── ReqRes.scala │ │ ├── Scope.scala │ │ ├── SyncCentralSystem.scala │ │ ├── SyncChargePoint.scala │ │ ├── meter │ │ │ └── Meter.scala │ │ └── v1x.scala │ │ └── v20 │ │ ├── Authorization.scala │ │ ├── Availability.scala │ │ ├── LocalAuthorizationListManagement.scala │ │ ├── Message.scala │ │ ├── Provisioning.scala │ │ ├── RemoteControl.scala │ │ ├── ReqRes.scala │ │ └── Transactions.scala │ └── enums │ ├── EnumUtils.scala │ └── reflection │ └── EnumUtils.scala ├── project ├── build.properties └── plugins.sbt └── version.sbt /.github/workflows/scala.yml: -------------------------------------------------------------------------------- 1 | name: Scala CI 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Set up JDK 11 17 | uses: actions/setup-java@v2 18 | with: 19 | java-version: '11' 20 | distribution: 'adopt' 21 | - name: Run tests 22 | run: sbt test 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Maven 2 | target 3 | pom.xml.versionsBackup 4 | 5 | # Idea 6 | .idea/ 7 | *.iml 8 | *.ipr 9 | *.iws 10 | .buildpath 11 | *.ids 12 | 13 | # Mac 14 | .DS_Store 15 | 16 | #JRebel 17 | rebel.xml 18 | 19 | # vim 20 | .*.sw? 21 | 22 | # ctags 23 | /tags 24 | 25 | # Visual Studio Code 26 | /.vscode/ 27 | -------------------------------------------------------------------------------- /example-json-server/src/main/scala/com/thenewmotion/ocpp/json/example/ExampleServerTestApp.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json 3 | package example 4 | 5 | import java.time.ZonedDateTime 6 | import scala.concurrent.ExecutionContext.Implicits.global 7 | import scala.concurrent.duration._ 8 | import scala.io.Source 9 | import messages.v1x._ 10 | import api._ 11 | 12 | object ExampleServerTestApp extends App { 13 | 14 | val server = new Ocpp1XJsonServer(2345, Version.V15) { 15 | 16 | override def handleConnection(chargePointIdentity: String, conn: Ocpp1XJsonServer.OutgoingEndpoint): CentralSystemRequestHandler = { 17 | 18 | conn.onClose.foreach(_ => println(s"Disconnected client $chargePointIdentity")) 19 | 20 | { 21 | (req: CentralSystemReq) => 22 | 23 | println(s"Received request $req from client $chargePointIdentity") 24 | 25 | req match { 26 | case req: BootNotificationReq => 27 | // let's send a GetConfiguration to see what this charge point is up to 28 | conn.send(GetConfigurationReq(Nil)) foreach { res => 29 | println(s"Charge point $chargePointIdentity responded to GetConfiguration: $res") 30 | } 31 | 32 | BootNotificationRes( 33 | status = RegistrationStatus.Accepted, 34 | currentTime = ZonedDateTime.now(), 35 | interval = 5.minutes 36 | ) 37 | 38 | case _ => 39 | throw OcppException(PayloadErrorCode.NotImplemented, "Request type not implemented") 40 | } 41 | } 42 | } 43 | } 44 | 45 | server.start() 46 | 47 | println("Example server listening at port 2345. Press ENTER to exit.") 48 | Source.stdin.bufferedReader.readLine() 49 | 50 | server.stop() 51 | } 52 | -------------------------------------------------------------------------------- /ocpp-j-api/src/main/scala/com/thenewmotion/ocpp/json/api/BaseOcppConnectionComponent.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json 3 | package api 4 | 5 | import scala.language.higherKinds 6 | import scala.util.control.NonFatal 7 | import messages._ 8 | import org.slf4j.LoggerFactory 9 | 10 | trait BaseOcppConnectionComponent[ 11 | OUTREQBOUND <: Request, 12 | INRESBOUND <: Response, 13 | OUTREQRES[_ <: OUTREQBOUND, _ <: INRESBOUND], 14 | INREQBOUND <: Request, 15 | OUTRESBOUND <: Response, 16 | INREQRES[_ <: INREQBOUND, _ <: OUTRESBOUND] 17 | ] extends OcppConnectionComponent[ 18 | OUTREQBOUND, 19 | INRESBOUND, 20 | OUTREQRES, 21 | INREQBOUND, 22 | OUTRESBOUND, 23 | INREQRES 24 | ] { 25 | 26 | self: SrpcComponent => 27 | 28 | trait BaseOcppConnection extends OcppConnection { 29 | 30 | private val logger = LoggerFactory.getLogger(this.getClass) 31 | 32 | /** 33 | * OcppConnectionComponent implementations should use this to turn 34 | * exceptions thrown by the library user implemented `onRequest` methods 35 | * into call errors to be reported to the remote communication partner. 36 | * 37 | * @return The SrpcResponse reporting the error 38 | */ 39 | protected def requestHandlerErrorToSrpcCallResult: PartialFunction[Throwable, SrpcResponse] = { 40 | case NonFatal(e) => 41 | 42 | val ocppError = e match { 43 | case OcppException(err) => err 44 | case _ => OcppError(PayloadErrorCode.InternalError, "Unexpected error processing request") 45 | } 46 | 47 | SrpcCallError( 48 | ocppError.error, 49 | ocppError.description 50 | ) 51 | } 52 | 53 | protected def logIncomingRequestHandlingError(call: SrpcCall): PartialFunction[Throwable, Throwable] = { 54 | case e: Throwable => 55 | logger.warn(s"Exception processing OCPP request ${call.procedureName}:", e) 56 | e 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /ocpp-j-api/src/main/scala/com/thenewmotion/ocpp/json/api/CallIdGenerator.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.json.api 2 | 3 | trait CallIdGenerator { 4 | def next(): String 5 | } 6 | 7 | object CallIdGenerator { 8 | def apply() = new AtomicCallIdGenerator 9 | } 10 | 11 | class AtomicCallIdGenerator extends CallIdGenerator { 12 | private val id = new java.util.concurrent.atomic.AtomicLong(-1) 13 | 14 | def next(): String = id.incrementAndGet.toHexString 15 | } 16 | -------------------------------------------------------------------------------- /ocpp-j-api/src/main/scala/com/thenewmotion/ocpp/json/api/OutgoingOcppEndpoint.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json.api 3 | 4 | import scala.language.higherKinds 5 | import scala.concurrent.Future 6 | import messages._ 7 | 8 | /** 9 | * Generic interface of an outgoing OCPP connection endpoint as it appears to the 10 | * library user: 11 | * 12 | * * The send method should be called to send outgoing requests 13 | * * The close method should be called to close the connection 14 | * 15 | * @tparam OUTREQ The type of outgoing requests (either ChargePointReq or CentralSystemReq) 16 | * @tparam INRES The type of incoming responses (either ChargePointRes or CentralSystemRes) 17 | * @tparam OUTREQRES Typeclass relating outgoing request types to incoming response types 18 | */ 19 | trait OutgoingOcppEndpoint[ 20 | OUTREQ <: Request, 21 | INRES <: Response, 22 | OUTREQRES[_ <: OUTREQ, _ <: INRES] <: ReqRes[_, _] 23 | ] { 24 | 25 | /** 26 | * Send a request to the party at the other side of this connection 27 | * 28 | * @param req The request to send 29 | * @param reqRes Evidence of the request-response relationship of the REQ and RES types 30 | * @tparam REQ The type of request (e.g. BootNotificationReq, ResetReq, ...) 31 | * @tparam RES The type of response (e.g. BootNotificationRes, ResetRes, ...) 32 | * @return A future that will be completed with the response from the other 33 | * side. If the other side fails to respond, the future will be failed. 34 | */ 35 | def send[REQ <: OUTREQ, RES <: INRES](req: REQ)(implicit reqRes: OUTREQRES[REQ, RES]): Future[RES] 36 | 37 | /** 38 | * Close the connection 39 | * 40 | * This method is asynchronous: once the connection has been closed, the future is completed. 41 | */ 42 | def close(): Future[Unit] 43 | 44 | /** 45 | * @return A future that is completed once the connection is closed 46 | */ 47 | def onClose: Future[Unit] 48 | } 49 | 50 | -------------------------------------------------------------------------------- /ocpp-j-api/src/main/scala/com/thenewmotion/ocpp/json/api/SrpcComponent.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json 3 | package api 4 | 5 | import scala.concurrent.Future 6 | 7 | /** 8 | * The middle layer in the three-layer protocol stack of OCPP-J: Simple Remote 9 | * Procedure Call. 10 | * 11 | * The SRPC layer relates WebSocket messages to each other as calls, 12 | * call results and call errors. 13 | * 14 | * Although the OCPP 1.6 specification no longer uses the term "SRPC", it is 15 | * present in the original specification on 16 | * http://www.gir.fr/ocppjs/ocpp_srpc_spec.shtml, which is referenced by the 17 | * IANA WebSocket Subprotocol Name Registry at 18 | * https://www.iana.org/assignments/websocket/websocket.xml. So bureaucracy is 19 | * on our side in naming this. 20 | */ 21 | trait SrpcComponent { 22 | trait SrpcConnection { 23 | /** 24 | * Send an outgoing call to the remote endpoint 25 | * @param msg The outgoing call 26 | * @return The incoming response, asynchronously 27 | */ 28 | def sendCall(msg: SrpcCall): Future[SrpcResponse] 29 | 30 | /** 31 | * Close the connection. 32 | * 33 | * This will allow all pending incoming calls to be responded to, 34 | * and only then will close the underlying WebSocket. 35 | * 36 | * @return A future that is completed when connection has indeed closed 37 | */ 38 | def close(): Future[Unit] 39 | 40 | /** 41 | * Close the connection, without waiting for the call handler to handle 42 | * calls that were already received. 43 | * 44 | * @return 45 | */ 46 | def forceClose(): Unit 47 | 48 | /** 49 | * A future that is completed once the SRPC connection is closed 50 | */ 51 | def onClose: Future[Unit] 52 | } 53 | 54 | def srpcConnection: SrpcConnection 55 | 56 | /** 57 | * To be overridden to handle incoming calls 58 | * 59 | * @param msg The incoming call 60 | * @return The outgoing message, asynchronously 61 | */ 62 | def onSrpcCall(msg: SrpcCall): Future[SrpcResponse] 63 | } 64 | 65 | -------------------------------------------------------------------------------- /ocpp-j-api/src/main/scala/com/thenewmotion/ocpp/json/api/WebSocketComponent.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json.api 3 | 4 | import org.json4s._ 5 | 6 | /** 7 | * The lowest layer in the three-layer protocol stack of OCPP-J: WebSocket 8 | */ 9 | trait WebSocketComponent { 10 | trait WebSocketConnection { 11 | /** 12 | * Send a JSON message to the other party 13 | */ 14 | def send(msg: JValue): Unit 15 | 16 | /** 17 | * Hang up the connection to the other party 18 | */ 19 | def close(): Unit 20 | } 21 | 22 | def webSocketConnection: WebSocketConnection 23 | 24 | /** 25 | * Called when a new JSON message arrives. 26 | * 27 | * To be implemented by children using the WebSocket connectivity. To be called by children implementing the 28 | * WebSocket connectivity. 29 | */ 30 | def onMessage(msg: JValue) 31 | 32 | /** 33 | * Called when a WebSocket error occurs 34 | * @param e 35 | */ 36 | def onError(e: Throwable) 37 | 38 | /** 39 | * Called when the WebSocket connection is disconnected 40 | */ 41 | def onWebSocketDisconnect(): Unit 42 | } 43 | -------------------------------------------------------------------------------- /ocpp-j-api/src/main/scala/com/thenewmotion/ocpp/json/api/package.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json 3 | 4 | import scala.language.higherKinds 5 | import messages._ 6 | import messages.v1x._ 7 | import messages.v20.{Request => _, Response => _, _} 8 | 9 | package object api { 10 | 11 | type ChargePointRequestHandler = 12 | RequestHandler[ChargePointReq, ChargePointRes, ChargePointReqRes] 13 | 14 | type CentralSystemRequestHandler = 15 | RequestHandler[CentralSystemReq, CentralSystemRes, CentralSystemReqRes] 16 | 17 | type CsRequestHandler = 18 | RequestHandler[CsRequest, CsResponse, CsReqRes] 19 | 20 | type CsmsRequestHandler = 21 | RequestHandler[CsmsRequest, CsmsResponse, CsmsReqRes] 22 | 23 | val OcppJsonClient: client.OcppJsonClient.type = client.OcppJsonClient 24 | type OcppJsonClient[ 25 | F <: VersionFamily, 26 | OQ <: Request, 27 | IS <: Response, 28 | ORR[_ <: OQ, _ <: IS] <: ReqRes[_, _], 29 | IQ <: Request, 30 | OS <: Response, 31 | IRR[_ <: IQ, _ <: OS] <: ReqRes[_, _] 32 | ] = client.OcppJsonClient[F, OQ, IS, ORR, IQ, OS, IRR] 33 | type Ocpp1XJsonClient = client.Ocpp1XJsonClient 34 | type Ocpp20JsonClient = client.Ocpp20JsonClient 35 | 36 | val OcppJsonServer: server.OcppJsonServer.type = server.OcppJsonServer 37 | type OcppJsonServer[ 38 | F <: VersionFamily, 39 | OQ <: Request, 40 | IS <: Response, 41 | ORR[_ <: OQ, _ <: IS] <: ReqRes[_, _], 42 | IQ <: Request, 43 | OS <: Response, 44 | IRR[_ <: IQ, _ <: OS] <: ReqRes[_, _] 45 | ] = server.OcppJsonServer[F, OQ, IS, ORR, IQ, OS, IRR] 46 | val Ocpp1XJsonServer: server.Ocpp1XJsonServer.type = server.Ocpp1XJsonServer 47 | type Ocpp1XJsonServer = server.Ocpp1XJsonServer 48 | val Ocpp20JsonServer: server.Ocpp20JsonServer.type = server.Ocpp20JsonServer 49 | type Ocpp20JsonServer = server.Ocpp20JsonServer 50 | } 51 | -------------------------------------------------------------------------------- /ocpp-j-api/src/main/scala/com/thenewmotion/ocpp/json/api/server/Ocpp1XJsonServer.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json.api 3 | package server 4 | 5 | import scala.concurrent.ExecutionContext 6 | import org.java_websocket.WebSocket 7 | import messages.v1x._ 8 | 9 | /** 10 | * A simple server implementation to show how this library can be used in servers. 11 | * 12 | * @param listenPort The port to listen on 13 | * @param requestedOcppVersion The OCPP version to serve (either 1.5 or 1.6; negotiation is not supported) 14 | */ 15 | abstract class Ocpp1XJsonServer(listenPort: Int, requestedOcppVersion: Version1X)(implicit ec: ExecutionContext) 16 | extends OcppJsonServer[ 17 | VersionFamily.V1X.type, 18 | ChargePointReq, 19 | ChargePointRes, 20 | ChargePointReqRes, 21 | CentralSystemReq, 22 | CentralSystemRes, 23 | CentralSystemReqRes 24 | ](listenPort, requestedOcppVersion) { 25 | protected def newConnectionCake( 26 | connection: WebSocket, 27 | chargePointIdentity: String 28 | ): BaseConnectionCake = 29 | new BaseConnectionCake(connection, chargePointIdentity) 30 | with CentralSystemOcpp1XConnectionComponent { 31 | 32 | lazy val ocppConnection: Ocpp1XConnection = defaultCentralSystemOcppConnection 33 | 34 | lazy val ocppVersion: Version = requestedOcppVersion 35 | } 36 | } 37 | 38 | object Ocpp1XJsonServer { 39 | type OutgoingEndpoint = OutgoingOcppEndpoint[ChargePointReq, ChargePointRes, ChargePointReqRes] 40 | } 41 | 42 | -------------------------------------------------------------------------------- /ocpp-j-api/src/main/scala/com/thenewmotion/ocpp/json/api/server/Ocpp20JsonServer.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json 3 | package api 4 | package server 5 | 6 | import scala.concurrent.ExecutionContext 7 | import org.java_websocket.WebSocket 8 | import messages.v20._ 9 | import VersionFamily._ 10 | 11 | /** 12 | * A simple server implementation to show how this library can be used in servers. 13 | * 14 | * @param listenPort The port to listen on 15 | * @param requestedOcppVersion The OCPP version to serve (either 1.5 or 1.6; negotiation is not supported) 16 | */ 17 | abstract class Ocpp20JsonServer(listenPort: Int)(implicit ec: ExecutionContext) 18 | extends OcppJsonServer[ 19 | VersionFamily.V20.type, 20 | CsRequest, 21 | CsResponse, 22 | CsReqRes, 23 | CsmsRequest, 24 | CsmsResponse, 25 | CsmsReqRes 26 | ](listenPort, Version.V20) { 27 | 28 | protected def newConnectionCake( 29 | connection: WebSocket, 30 | chargePointIdentity: String 31 | ): BaseConnectionCake = new BaseConnectionCake(connection, chargePointIdentity) with CsmsOcpp20ConnectionComponent 32 | } 33 | 34 | object Ocpp20JsonServer { 35 | type OutgoingEndpoint = OutgoingOcppEndpoint[CsRequest, CsResponse, CsReqRes] 36 | } 37 | 38 | -------------------------------------------------------------------------------- /ocpp-j-api/src/main/scala/com/thenewmotion/ocpp/json/api/server/SimpleServerWebSocketComponent.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json.api 3 | package server 4 | 5 | import org.java_websocket.WebSocket 6 | import org.json4s.JValue 7 | import org.json4s.native.JsonMethods.{compact, render, parse} 8 | 9 | trait SimpleServerWebSocketComponent extends WebSocketComponent { 10 | 11 | self: SrpcComponent => 12 | 13 | trait SimpleServerWebSocketConnection extends WebSocketConnection { 14 | 15 | def webSocket: WebSocket 16 | 17 | def send(msg: JValue): Unit = webSocket.send(compact(render(msg))) 18 | 19 | def close(): Unit = webSocket.close() 20 | } 21 | 22 | def feedIncomingMessage(msg: String): Unit = self.onMessage(parse(msg)) 23 | 24 | def feedIncomingDisconnect(): Unit = self.onWebSocketDisconnect() 25 | 26 | def feedIncomingError(err: Exception): Unit = self.onError(err) 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /ocpp-j-api/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %date %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /ocpp-j-api/src/test/scala/com/thenewmotion/ocpp/json/api/client/SimpleClientWebSocketComponentSpec.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.json.api.client 2 | 3 | import org.specs2.mutable.Specification 4 | 5 | class SimpleClientWebSocketComponentSpec extends Specification { 6 | 7 | "SimpleClientWebSocketComponent" should { 8 | 9 | "encode HTTP Basic Auth credentials with base64 according to RFC 2045" in { 10 | 11 | val b64 = SimpleClientWebSocketComponent.toBase64String( 12 | "AL1000", 13 | "0001020304050607FFFFFFFFFFFFFFFFFFFFFFFF" 14 | ) 15 | 16 | b64 mustEqual "QUwxMDAwOgABAgMEBQYH////////////////" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ocpp-json/src/main/scala/com/thenewmotion/ocpp/json/SerializationCommon.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json 3 | 4 | import java.net.URI 5 | import scala.util.{Failure, Success, Try} 6 | import enums.reflection.EnumUtils.{Enumerable, Nameable} 7 | import org.json4s.MappingException 8 | 9 | private[json] trait SerializationCommon { 10 | /** 11 | * Tries to get select the enumerable value whose name is equal to the given string. If no such enum value exists, 12 | * throws a net.liftweb.json.MappingException. 13 | */ 14 | def enumerableFromJsonString[T <: Nameable](enum: Enumerable[T], s: String): T = 15 | enum.withName(s) match { 16 | case None => 17 | throw new MappingException(s"Value $s is not valid for ${enum.getClass.getSimpleName}") 18 | case Some(v) => v 19 | } 20 | 21 | def noneIfDefault[T <: Nameable](enumerable: messages.v1x.EnumerableWithDefault[T], actual: T): Option[String] = 22 | if (actual == enumerable.default) None else Some(actual.name) 23 | 24 | def defaultIfNone[T <: Nameable](enumerable: messages.v1x.EnumerableWithDefault[T], str: Option[String]): T = 25 | str.map(enumerableFromJsonString(enumerable, _)).getOrElse(enumerable.default) 26 | 27 | def noneIfEmpty[T](l: List[T]): Option[List[T]] = 28 | if (l.isEmpty) None else Some(l) 29 | 30 | def emptyIfNone[T](o: Option[List[T]]): List[T] = 31 | o.getOrElse(List.empty[T]) 32 | 33 | /** 34 | * Parses a URI and throws a lift-json MappingException if the syntax is wrong 35 | */ 36 | def parseURI(s: String) = Try { 37 | new URI(s) 38 | } match { 39 | case Failure(e: Exception) => throw MappingException(s"Could not parse URL $s in OCPP-JSON message", e) 40 | case Failure(e) => throw e 41 | case Success(u) => u 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ocpp-json/src/main/scala/com/thenewmotion/ocpp/json/TransportMessageJsonSerializer.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json 3 | 4 | import org.json4s._ 5 | import SrpcMessageType._ 6 | 7 | object TransportMessageJsonSerializer extends SerializationCommon { 8 | 9 | def apply(): Serializer[SrpcEnvelope] = new CustomSerializer[SrpcEnvelope](format => ( 10 | { 11 | case JArray( 12 | JInt(callType) :: 13 | JString(callId) :: 14 | contents 15 | ) => 16 | SrpcEnvelope(callId, toPayload(callType, contents)) 17 | }, 18 | 19 | { 20 | case msg: SrpcEnvelope => 21 | JArray( 22 | JInt(toCallType(msg.payload)) :: 23 | JString(msg.callId) :: 24 | toContents(msg.payload) 25 | ) 26 | } 27 | )) 28 | 29 | private def toPayload(callType: BigInt, contents: List[JValue]): SrpcMessage = 30 | (callType, contents) match { 31 | case (CALL.`id`, JString(opName) :: payload :: Nil) => 32 | SrpcCall(opName, payload) 33 | case (CALLRESULT.`id`, payload :: Nil) => 34 | SrpcCallResult(payload) 35 | case (CALLERROR.`id`, JString(errorName) :: JString(errorDesc) :: errorDetails :: Nil) => 36 | SrpcCallError( 37 | enumerableFromJsonString(PayloadErrorCode, errorName), 38 | errorDesc, 39 | errorDetails 40 | ) 41 | case _ => 42 | throw new MappingException("Malformed content in SRPC array") 43 | } 44 | 45 | private def toCallType(payload: SrpcMessage): BigInt = 46 | payload match { 47 | case _: SrpcCall => CALL.id 48 | case _: SrpcCallResult => CALLRESULT.id 49 | case _: SrpcCallError => CALLERROR.id 50 | } 51 | 52 | private def toContents(msg: SrpcMessage): List[JValue] = 53 | msg match { 54 | case SrpcCall(procedureName, payload) => 55 | JString(procedureName) :: 56 | payload :: Nil 57 | case SrpcCallResult(payload) => 58 | payload :: Nil 59 | case SrpcCallError(code, desc, details) => 60 | JString(code.name) :: 61 | JString(desc) :: 62 | details :: Nil 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /ocpp-json/src/main/scala/com/thenewmotion/ocpp/json/TransportMessageParser.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json 3 | 4 | import org.json4s._ 5 | import org.json4s.native.JsonParser 6 | import org.json4s.native.JsonMethods._ 7 | 8 | object TransportMessageParser { 9 | 10 | implicit val formats = 11 | DefaultFormats + TransportMessageJsonSerializer() 12 | 13 | def parse(input: String): SrpcEnvelope = 14 | parse(JsonParser.parse(input)) 15 | 16 | def parse(input: JValue): SrpcEnvelope = { 17 | input.extract[SrpcEnvelope] 18 | } 19 | 20 | def writeJValue(input: SrpcEnvelope): JValue = { 21 | Extraction.decompose(input) 22 | } 23 | 24 | def write(input: SrpcEnvelope): String = 25 | compact(render(writeJValue(input))) 26 | } 27 | -------------------------------------------------------------------------------- /ocpp-json/src/main/scala/com/thenewmotion/ocpp/json/v1x/OcppMessageSerializer.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json 3 | package v1x 4 | 5 | import org.json4s.{DefaultFormats, Extraction, JValue} 6 | 7 | /** 8 | * A typeclass of all types that can be serialized to/from any supported OCPP-JSON version 9 | * 10 | * @tparam M The message type, for example com.thenewmotion.ocpp.messages.AuthorizeReq 11 | * @tparam V The version to/from which the message can be serialized 12 | */ 13 | trait OcppMessageSerializer[M <: messages.v1x.Message, V <: Version] { 14 | 15 | protected[json] type VersionSpecific 16 | 17 | protected val manifest: Manifest[VersionSpecific] 18 | 19 | protected implicit val formats = DefaultFormats + new ZonedDateTimeJsonFormat 20 | 21 | protected[json] def to(msg: M): VersionSpecific 22 | protected[json] def from(msg: VersionSpecific): M 23 | 24 | def serialize(msg: M): JValue = Extraction.decompose(to(msg)) 25 | 26 | def deserialize(json: JValue): M = from(Extraction.extract[VersionSpecific](json)(formats, manifest)) 27 | } 28 | 29 | object OcppMessageSerializer { 30 | def variantFor[M <: messages.v1x.Message, V <: Version, SpecM <: VersionSpecificMessage : Manifest]( 31 | toF: M => SpecM, 32 | fromF: SpecM => M): OcppMessageSerializer[M, V] = 33 | new OcppMessageSerializer[M, V] { 34 | 35 | protected[json] type VersionSpecific = SpecM 36 | 37 | protected val manifest: Manifest[SpecM] = implicitly[Manifest[SpecM]] 38 | 39 | protected[json] def to(msg: M): SpecM = toF(msg) 40 | 41 | protected[json] def from(msg: SpecM): M = fromF(msg) 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /ocpp-json/src/main/scala/com/thenewmotion/ocpp/json/v1x/Serialization.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json 3 | package v1x 4 | 5 | import messages.v1x.Message 6 | import org.json4s.native.JsonMethods.{compact, render} 7 | import org.json4s.{DefaultFormats, Formats, JValue, native} 8 | 9 | /** Reading and writing OCPP 1.x messages encoded with JSON */ 10 | object Serialization { 11 | 12 | implicit val formats: Formats = DefaultFormats + new ZonedDateTimeJsonFormat 13 | 14 | def serialize[M <: Message, V <: Version](msg: M)(implicit versionVariant: OcppMessageSerializer[M, V]): JValue = 15 | versionVariant.serialize(msg) 16 | 17 | def write[M <: Message, V <: Version](msg: M)(implicit versionVariant: OcppMessageSerializer[M, V]): String = 18 | compact(render(serialize[M, V](msg))) 19 | 20 | def deserialize[M <: Message, V <: Version](json: JValue)(implicit versionVariant: OcppMessageSerializer[M, V]): M = 21 | versionVariant.deserialize(json) 22 | 23 | def read[M <: Message, V <: Version](s: String)(implicit versionVariant: OcppMessageSerializer[M, V]): M = 24 | deserialize[M, V](native.JsonParser.parse(s)) 25 | } 26 | -------------------------------------------------------------------------------- /ocpp-json/src/main/scala/com/thenewmotion/ocpp/json/v1x/VersionSpecificMessage.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.json.v1x 2 | 3 | trait VersionSpecificMessage 4 | -------------------------------------------------------------------------------- /ocpp-json/src/main/scala/com/thenewmotion/ocpp/json/v1x/ZonedDateTimeJsonFormat.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.json.v1x 2 | 3 | import java.time.format.DateTimeFormatter.ISO_OFFSET_DATE_TIME 4 | import java.time.{ZoneId, ZonedDateTime} 5 | 6 | import org.json4s.CustomSerializer 7 | import org.json4s.JsonAST._ 8 | 9 | class ZonedDateTimeJsonFormat extends CustomSerializer[ZonedDateTime](format => ( 10 | { 11 | case JString(formattedDate) => 12 | ZonedDateTime 13 | .parse(formattedDate, ISO_OFFSET_DATE_TIME) 14 | .withZoneSameInstant(ZoneId.of("UTC")) 15 | }, 16 | { 17 | case x: ZonedDateTime => JString(x.withZoneSameInstant(ZoneId.of("UTC")).format(ISO_OFFSET_DATE_TIME)) 18 | })) 19 | 20 | -------------------------------------------------------------------------------- /ocpp-json/src/main/scala/com/thenewmotion/ocpp/json/v20/Serialization.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json 3 | package v20 4 | 5 | import org.json4s.{DefaultFormats, Extraction, Formats, JValue} 6 | import org.json4s.native.JsonMethods.{compact, render} 7 | import org.json4s.native.JsonParser.parse 8 | import messages.v20._ 9 | 10 | object Serialization { 11 | private val formats: Formats = DefaultFormats ++ serialization.ocppSerializers 12 | 13 | def serialize(msg: Message): JValue = 14 | Extraction.decompose(msg)(formats) 15 | 16 | def write(msg: Message): String = 17 | compact(render(serialize(msg))) 18 | 19 | def deserialize[M <: Message : Manifest](json: JValue): M = 20 | Extraction.extract[M](json)(formats, manifest[M]) 21 | 22 | def read[M <: Message : Manifest](s: String): M = 23 | deserialize[M](parse(s, useBigDecimalForDouble = true)) 24 | } 25 | -------------------------------------------------------------------------------- /ocpp-json/src/main/scala/com/thenewmotion/ocpp/json/v20/serialization/ChargingRateSerializer.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json.v20.serialization 3 | 4 | import messages.v20.ChargingRate 5 | import org.json4s.CustomSerializer 6 | import org.json4s.JsonAST.JDecimal 7 | 8 | object ChargingRateSerializer extends CustomSerializer[ChargingRate](_ => ({ 9 | case JDecimal(r) => ChargingRate(r.toDouble) 10 | }, { 11 | case ChargingRate(rate) => JDecimal(BigDecimal(rate).setScale(1)) 12 | })) 13 | -------------------------------------------------------------------------------- /ocpp-json/src/main/scala/com/thenewmotion/ocpp/json/v20/serialization/EnumerableNameSerializer.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.json.v20.serialization 2 | 3 | import enums.reflection.EnumUtils.{Enumerable, Nameable} 4 | import org.json4s.{CustomSerializer, JString} 5 | 6 | class EnumerableNameSerializer[T <: Nameable : Manifest](e: Enumerable[T]) extends CustomSerializer[T](_ => ({ 7 | case JString(n) if e.withName(n).isDefined => e.withName(n).getOrElse { 8 | sys.error("Enum value name recognized in isDefined but not in result!?") 9 | } 10 | }, { 11 | { 12 | case n: T => JString(n.name) 13 | } 14 | })) 15 | -------------------------------------------------------------------------------- /ocpp-json/src/main/scala/com/thenewmotion/ocpp/json/v20/serialization/InstantSerializer.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.json.v20.serialization 2 | 3 | import java.time.{Instant, ZoneId, ZonedDateTime} 4 | import java.time.format.DateTimeFormatter.ISO_OFFSET_DATE_TIME 5 | import org.json4s.{CustomSerializer, JString} 6 | 7 | object InstantSerializer extends CustomSerializer[Instant](_ => ({ 8 | case JString(t) => ZonedDateTime.parse(t, ISO_OFFSET_DATE_TIME).toInstant 9 | }, { 10 | case instant: Instant => JString( 11 | ZonedDateTime.ofInstant(instant, ZoneId.of("UTC")).format(ISO_OFFSET_DATE_TIME) 12 | ) 13 | })) 14 | -------------------------------------------------------------------------------- /ocpp-json/src/main/scala/com/thenewmotion/ocpp/json/v20/serialization/package.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package json 3 | package v20 4 | 5 | import messages.v20._ 6 | 7 | package object serialization { 8 | 9 | val ocppSerializers = Seq( 10 | new EnumerableNameSerializer(BootReason), 11 | InstantSerializer, 12 | ChargingRateSerializer, 13 | new EnumerableNameSerializer(BootNotificationStatus), 14 | new EnumerableNameSerializer(IdTokenType), 15 | new EnumerableNameSerializer(ChargingProfilePurpose), 16 | new EnumerableNameSerializer(ChargingProfileKind), 17 | new EnumerableNameSerializer(RecurrencyKind), 18 | new EnumerableNameSerializer(ChargingRateUnit), 19 | new EnumerableNameSerializer(RequestStartStopStatus), 20 | new EnumerableNameSerializer(Reason), 21 | new EnumerableNameSerializer(TriggerReason), 22 | new EnumerableNameSerializer(TransactionEvent), 23 | new EnumerableNameSerializer(ReadingContext), 24 | new EnumerableNameSerializer(Measurand), 25 | new EnumerableNameSerializer(Phase), 26 | new EnumerableNameSerializer(Location), 27 | new EnumerableNameSerializer(SignatureMethod), 28 | new EnumerableNameSerializer(EncodingMethod), 29 | new EnumerableNameSerializer(ChargingState), 30 | new EnumerableNameSerializer(AuthorizationStatus), 31 | new EnumerableNameSerializer(MessageFormat), 32 | new EnumerableNameSerializer(ConnectorStatus), 33 | new EnumerableNameSerializer(HashAlgorithm), 34 | new EnumerableNameSerializer(CertificateStatus), 35 | new EnumerableNameSerializer(Attribute), 36 | new EnumerableNameSerializer(GetVariableStatus), 37 | new EnumerableNameSerializer(SetVariableStatus), 38 | new EnumerableNameSerializer(Update), 39 | new EnumerableNameSerializer(UpdateStatus), 40 | new EnumerableNameSerializer(ReportBase), 41 | new EnumerableNameSerializer(GenericDeviceModelStatus), 42 | new EnumerableNameSerializer(Mutability), 43 | new EnumerableNameSerializer(Data) 44 | ) 45 | } 46 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/srpc/callmessage.json: -------------------------------------------------------------------------------- 1 | [2,"1234567","CallMessageAction",{"payload":"something"}] -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/srpc/errorresponsemessage.json: -------------------------------------------------------------------------------- 1 | [4,"1234567","InternalError","description",{"payload":"something"}] -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/srpc/responsemessage.json: -------------------------------------------------------------------------------- 1 | [3,"1234567",{"payload":"something"}] -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/srpc/wrongelementsmessage-toofew.json: -------------------------------------------------------------------------------- 1 | [2,"1234567","WrongElements"] -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/srpc/wrongelementsmessage-toomany.json: -------------------------------------------------------------------------------- 1 | [2,"1234567","WrongElements","additional string",{"payload":"something"}] -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/srpc/wrongtypemessage.json: -------------------------------------------------------------------------------- 1 | [1,"1234567","WrongTypeMessage",{"payload":"something"}] -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/authorize.request.json: -------------------------------------------------------------------------------- 1 | {"idTag":"04F8692AA23E80"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/authorize.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "idTagInfo": { 3 | "status": "Invalid", 4 | "parentIdTag": "04F8692AA23E80" 5 | } 6 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/bootnotification.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "chargePointVendor": "DBT", 3 | "chargePointModel": "NQC-ACDC", 4 | "chargePointSerialNumber": "gir.vat.mx.000e48", 5 | "chargeBoxSerialNumber": "gir.vat.mx.000e48", 6 | "firmwareVersion": "1.0.49", 7 | "iccid": "", 8 | "imsi": "", 9 | "meterType": "DBT NQC-ACDC", 10 | "meterSerialNumber": "gir.vat.mx.000e48" 11 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/bootnotification.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Accepted", 3 | "currentTime": "2017-09-21T05:26:36Z", 4 | "heartbeatInterval": 86400 5 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/centralsystemdatatransfer.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "vendorId": "com.vendor", 3 | "messageId": "pi", 4 | "data": "3.14159265359" 5 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/centralsystemdatatransfer.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Accepted" 3 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/chargepointdatatransfer.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "vendorId": "com.vendor", 3 | "messageId": "pi", 4 | "data": "3.14159265359" 5 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/chargepointdatatransfer.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Accepted" 3 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/diagnosticsstatusnotification.request.json: -------------------------------------------------------------------------------- 1 | {"status":"Uploaded"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/diagnosticsstatusnotification.response.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/firmwarestatusnotification.request.json: -------------------------------------------------------------------------------- 1 | {"status":"DownloadFailed"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/firmwarestatusnotification.response.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/heartbeat.request.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/heartbeat.response.json: -------------------------------------------------------------------------------- 1 | {"currentTime":"2017-09-21T05:29:02Z"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/metervalues.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectorId": 2, 3 | "transactionId": 2, 4 | "values": [ 5 | { 6 | "timestamp": "2013-03-07T16:52:16Z", 7 | "values": [ 8 | { 9 | "value": "0", 10 | "unit": "Wh", 11 | "measurand": "Energy.Active.Import.Register" 12 | }, 13 | { 14 | "value": "0", 15 | "unit": "varh", 16 | "measurand": "Energy.Reactive.Import.Register" 17 | } 18 | ] 19 | }, 20 | { 21 | "timestamp": "2013-03-07T19:52:16Z", 22 | "values": [ 23 | { 24 | "value": "20", 25 | "unit": "Wh", 26 | "measurand": "Energy.Active.Import.Register" 27 | }, 28 | { 29 | "value": "20", 30 | "unit": "varh", 31 | "measurand": "Energy.Reactive.Import.Register" 32 | } 33 | ] 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/metervalues.response.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotecancelreservation.request.json: -------------------------------------------------------------------------------- 1 | {"reservationId": 0} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotecancelreservation.response.json: -------------------------------------------------------------------------------- 1 | {"status":"Accepted"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotechangeavailability.request.json: -------------------------------------------------------------------------------- 1 | {"connectorId":1,"type":"Inoperative"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotechangeavailability.response.json: -------------------------------------------------------------------------------- 1 | {"status":"Accepted"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotechangeconfiguration.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "KVCBX_LANG", 3 | "value": "FR" 4 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotechangeconfiguration.response.json: -------------------------------------------------------------------------------- 1 | {"status":"Accepted"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remoteclearcache.request.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remoteclearcache.response.json: -------------------------------------------------------------------------------- 1 | {"status":"Accepted"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotegetconfiguration.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": [ 3 | "KVCBX_PROFILE" 4 | ] 5 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotegetconfiguration.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurationKey": [ 3 | { 4 | "key": "KVCBX_PROFILE", 5 | "readonly": true, 6 | "value": "NQC-ACDC" 7 | } 8 | ], 9 | "unknownKey": [ 10 | "UNKNOWN_KEY1", 11 | "UNKNOWN_KEY2" 12 | ] 13 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotegetdiagnostics.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "location": "ftp://root:root@axis.gir.foo/tmp", 3 | "startTime": "2013-02-01T15:09:18Z", 4 | "stopTime": "2013-02-01T15:09:18Z", 5 | "retries": 4, 6 | "retryInterval": 20 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotegetdiagnostics.response.json: -------------------------------------------------------------------------------- 1 | {"fileName": "diag-gir.vat.mx.000e48-20130131132608.txt"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotegetlocallistversion.request.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotegetlocallistversion.response.json: -------------------------------------------------------------------------------- 1 | {"listVersion":0} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotereservenow.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectorId": 0, 3 | "expiryDate": "2013-02-01T15:09:18Z", 4 | "idTag": "044943121F1D80", 5 | "parentIdTag": "", 6 | "reservationId": 0 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotereservenow.response.json: -------------------------------------------------------------------------------- 1 | {"status":"Accepted"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotereset.request.json: -------------------------------------------------------------------------------- 1 | {"type":"Soft"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotereset.response.json: -------------------------------------------------------------------------------- 1 | {"status":"Accepted"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotesendlocallist.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "updateType": "Full", 3 | "listVersion": 1, 4 | "localAuthorisationList": [ 5 | { 6 | "idTag": "044943121F1D80", 7 | "idTagInfo": { 8 | "status": "Accepted", 9 | "expiryDate": "2013-02-01T15:09:18Z", 10 | "parentIdTag": "" 11 | } 12 | } 13 | ], 14 | "hash": "" 15 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotesendlocallist.response.json: -------------------------------------------------------------------------------- 1 | {"status":"Accepted","hash":""} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotestarttransaction.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "idTag": "044943121F1D80", 3 | "connectorId": 2 4 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotestarttransaction.response.json: -------------------------------------------------------------------------------- 1 | {"status":"Accepted"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotestoptransaction.request.json: -------------------------------------------------------------------------------- 1 | {"transactionId": 1} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remotestoptransaction.response.json: -------------------------------------------------------------------------------- 1 | {"status":"Accepted"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remoteunlockconnector.request.json: -------------------------------------------------------------------------------- 1 | {"connectorId":1} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remoteunlockconnector.response.json: -------------------------------------------------------------------------------- 1 | {"status":"Accepted"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remoteupdatefirmware.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "retrieveDate": "2013-02-01T15:09:18Z", 3 | "location": "ftp://root:root@fork.gir.foo/tmp/kvcbx-updt.amx", 4 | "retries": 4, 5 | "retryInterval": 20 6 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/remoteupdatefirmware.response.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/starttransaction.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectorId": 2, 3 | "idTag": "B4F62CEF", 4 | "timestamp": "2013-02-01T15:09:18Z", 5 | "meterStart": 0, 6 | "reservationId": 0 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/starttransaction.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactionId": 3, 3 | "idTagInfo": { 4 | "status": "Accepted", 5 | "parentIdTag": "04F8692AA23E80" 6 | } 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/statusnotification.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectorId": 2, 3 | "status": "Available", 4 | "errorCode": "NoError", 5 | "info": "", 6 | "timestamp": "2013-02-01T15:09:18Z", 7 | "vendorId": "" 8 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/statusnotification.response.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/stoptransaction.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactionId": 2, 3 | "idTag": "04F8692AA23E80", 4 | "timestamp": "2013-02-01T15:09:18Z", 5 | "meterStop": 20, 6 | "transactionData": [ 7 | { 8 | "values": [ 9 | { 10 | "timestamp": "2013-03-07T16:52:16Z", 11 | "values": [ 12 | { 13 | "value": "0", 14 | "unit": "Wh", 15 | "measurand": "Energy.Active.Import.Register" 16 | }, 17 | { 18 | "value": "0", 19 | "unit": "varh", 20 | "measurand": "Energy.Reactive.Import.Register" 21 | } 22 | ] 23 | } 24 | ] 25 | }, 26 | { 27 | "values": [ 28 | { 29 | "timestamp": "2013-03-07T16:52:16Z", 30 | "values": [ 31 | { 32 | "value": "0", 33 | "unit": "Wh", 34 | "measurand": "Energy.Active.Import.Register" 35 | }, 36 | { 37 | "value": "0", 38 | "unit": "varh", 39 | "measurand": "Energy.Reactive.Import.Register" 40 | } 41 | ] 42 | } 43 | ] 44 | } 45 | ] 46 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/gir_without_srpc/stoptransaction.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "idTagInfo": { 3 | "status": "Accepted", 4 | "parentIdTag": "04F8692AA23E80" 5 | } 6 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/authorize.request.json: -------------------------------------------------------------------------------- 1 | {"idTag": "B4F62CEF"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/authorize.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "idTagInfo": { 3 | "status": "Accepted", 4 | "expiryDate": "2013-02-01T15:09:18Z", 5 | "parentIdTag": "PARENT" 6 | } 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/bootnotification.request.json: -------------------------------------------------------------------------------- 1 | {"chargePointVendor": "DBT", 2 | "chargePointModel": "NQC-ACDC", 3 | "chargePointSerialNumber": "gir.vat.mx.000e48", 4 | "chargeBoxSerialNumber": "gir.vat.mx.000e48", 5 | "firmwareVersion": "1.0.49", 6 | "iccid": "", 7 | "imsi": "", 8 | "meterType": "DBT NQC-ACDC", 9 | "meterSerialNumber": "gir.vat.mx.000e48"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/bootnotification.response.json: -------------------------------------------------------------------------------- 1 | {"status":"Accepted","currentTime":"2013-09-27T14:03:00Z","heartbeatInterval":600} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/cancelreservation.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "reservationId": 42 3 | } 4 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/cancelreservation.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Accepted" 3 | } 4 | 5 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/centralsystemdatatransfer.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "vendorId": "com.vendor", 3 | "messageId": "pi", 4 | "data": "3.14159265359" 5 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/centralsystemdatatransfer.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Accepted" 3 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/changeavailability.invalidstatus.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Geaccepteerd" 3 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/changeavailability.request.json: -------------------------------------------------------------------------------- 1 | {"connectorId": 1, 2 | "type": "Inoperative"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/changeavailability.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Accepted" 3 | } 4 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/changeavailability.wholecharger.request.json: -------------------------------------------------------------------------------- 1 | {"connectorId": 0, 2 | "type": "Operative"} 3 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/changeconfiguration.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "KVCBX_LANG", 3 | "value": "FR" 4 | } 5 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/changeconfiguration.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Accepted" 3 | } 4 | 5 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/chargepointdatatransfer.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "vendorId": "com.vendor", 3 | "messageId": "pi", 4 | "data": "3.14159265359" 5 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/chargepointdatatransfer.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Accepted" 3 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/clearcache.request.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/clearcache.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Accepted" 3 | } 4 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/diagnosticsstatusnotification.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Uploaded" 3 | } 4 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/diagnosticsstatusnotification.response.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/firmwarestatusnotification.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "DownloadFailed" 3 | } 4 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/firmwarestatusnotification.response.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/getconfiguration.request.json: -------------------------------------------------------------------------------- 1 | {"key": ["apeschaap", "hompeschomp"]} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/getconfiguration.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurationKey": [ 3 | { 4 | "key": "KVCBX_PROFILE", 5 | "readonly": true, 6 | "value": "NQC-ACDC" 7 | } 8 | ], 9 | "unknownKey": [ 10 | "UNKNOWN_KEY1", 11 | "UNKNOWN_KEY2" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/getdiagnostics.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "location": "ftp://root:root@axis.gir.foo/tmp", 3 | "startTime": "2013-02-01T15:09:18Z", 4 | "stopTime": "2013-08-08T16:09:18Z", 5 | "retries": 4, 6 | "retryInterval": 20 7 | } 8 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/getdiagnostics.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileName": "diag-gir.vat.mx.000e48-20130131132608.txt" 3 | } 4 | 5 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/getlocallistversion.request.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/getlocallistversion.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "listVersion": 0 3 | } 4 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/heartbeat.request.json: -------------------------------------------------------------------------------- 1 | {} 2 | 3 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/heartbeat.response.json: -------------------------------------------------------------------------------- 1 | {"currentTime": "2013-02-01T15:09:18Z"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/metervalues.invalidproperty.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectorId": 2, 3 | "transactionId": 0, 4 | "values": [ 5 | { 6 | "timestamp": "2013-03-07T16:52:16Z", 7 | "values": [ 8 | { 9 | "value": "0" 10 | }, 11 | { 12 | "value": "0", 13 | "unit": "varh", 14 | "measurand": "Energy.Reactive.Import.Register" 15 | } 16 | ] 17 | }, 18 | { 19 | "timestamp": "2013-03-07T19:52:16Z", 20 | "values": [ 21 | { 22 | "value": "20" 23 | }, 24 | { 25 | "value": "20", 26 | "unit": "varh", 27 | "context": "not valid! bork bork!", 28 | "measurand": "Energy.Reactive.Import.Register" 29 | } 30 | ] 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/metervalues.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectorId": 2, 3 | "transactionId": 0, 4 | "values": [ 5 | { 6 | "timestamp": "2013-03-07T16:52:16Z", 7 | "values": [ 8 | { 9 | "value": "0" 10 | }, 11 | { 12 | "value": "0", 13 | "unit": "varh", 14 | "measurand": "Energy.Reactive.Import.Register" 15 | } 16 | ] 17 | }, 18 | { 19 | "timestamp": "2013-03-07T19:52:16Z", 20 | "values": [ 21 | { 22 | "value": "20" 23 | }, 24 | { 25 | "value": "20", 26 | "unit": "varh", 27 | "measurand": "Energy.Reactive.Import.Register" 28 | } 29 | ] 30 | } 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/metervalues.response.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/remotestarttransaction.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "idTag": "044943121F1D80", 3 | "connectorId": 2 4 | } 5 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/remotestarttransaction.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Accepted" 3 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/remotestoptransaction.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactionId": 1 3 | } 4 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/remotestoptransaction.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Rejected" 3 | } 4 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/reservenow.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectorId": 0, 3 | "expiryDate": "2013-02-01T15:09:18Z", 4 | "idTag": "044943121F1D80", 5 | "parentIdTag": "", 6 | "reservationId": 0 7 | } 8 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/reservenow.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Accepted" 3 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/reset.request.json: -------------------------------------------------------------------------------- 1 | {"type":"Soft"} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/reset.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Accepted" 3 | } 4 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/sendlocallist.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "updateType": "Full", 3 | "listVersion": 1, 4 | "localAuthorisationList": [ 5 | { 6 | "idTag": "044943121F1D80", 7 | "idTagInfo": { 8 | "status": "Accepted", 9 | "expiryDate": "2013-02-01T15:09:18Z", 10 | "parentIdTag": "" 11 | } 12 | } 13 | ], 14 | "hash": "" 15 | } 16 | 17 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/sendlocallist.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "Accepted", 3 | "hash": "" 4 | } 5 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/starttransaction.localtime.request.json: -------------------------------------------------------------------------------- 1 | {"connectorId": 2, 2 | "idTag": "B4F62CEF", 3 | "timestamp": "2013-02-01T17:09:18+02:00", 4 | "meterStart": 0, 5 | "reservationId": 0} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/starttransaction.request.json: -------------------------------------------------------------------------------- 1 | {"connectorId": 2, 2 | "idTag": "B4F62CEF", 3 | "timestamp": "2013-02-01T15:09:18Z", 4 | "meterStart": 0, 5 | "reservationId": 0} 6 | 7 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/starttransaction.response.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactionId": 0, 3 | "idTagInfo": { 4 | "status": "Accepted", 5 | "expiryDate": "2013-02-01T15:09:18Z", 6 | "parentIdTag": "PARENT" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/statusnotification.inerror-noerror.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectorId": 2, 3 | "status": "Faulted", 4 | "errorCode": "NoError", 5 | "info": "Het laadpunt is een beetje in de bonen", 6 | "timestamp": "2013-02-01T15:09:18Z", 7 | "vendorId": "TNM", 8 | "vendorErrorCode": "Lolwut?" 9 | } 10 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/statusnotification.inerror.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectorId": 2, 3 | "status": "Faulted", 4 | "errorCode": "PowerMeterFailure", 5 | "info": "Die meter is kats doorgefikt joh", 6 | "timestamp": "2013-02-01T15:09:18Z", 7 | "vendorId": "TNM", 8 | "vendorErrorCode": "MeterB0rk3d" 9 | } 10 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/statusnotification.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectorId": 2, 3 | "status": "Available", 4 | "errorCode": "NoError", 5 | "timestamp": "2013-02-01T15:09:18Z", 6 | "vendorId": "", 7 | "info": "Info msg" 8 | } 9 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/statusnotification.response.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/stoptransaction.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactionId": 0, 3 | "idTag": "B4F62CEF", 4 | "timestamp": "2013-02-01T15:09:18Z", 5 | "meterStop": 20, 6 | "transactionData": [ 7 | { 8 | "values": [ 9 | { 10 | "timestamp": "2013-03-07T16:52:16Z", 11 | "values": [ 12 | { 13 | "value": "0" 14 | }, 15 | { 16 | "value": "0", 17 | "measurand": "Energy.Reactive.Import.Register", 18 | "unit": "varh" 19 | } 20 | ] 21 | }, 22 | { 23 | "timestamp": "2013-03-07T16:52:16Z", 24 | "values": [ 25 | { 26 | "value": "0" 27 | }, 28 | { 29 | "value": "0", 30 | "measurand": "Energy.Reactive.Import.Register", 31 | "unit": "varh" 32 | } 33 | ] 34 | } 35 | ] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/stoptransaction.response.json: -------------------------------------------------------------------------------- 1 | {"idTagInfo":{"status":"Expired","expiryDate":"2013-02-01T15:09:18Z","parentIdTag":"PARENT"}} 2 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/unlockconnector.request.json: -------------------------------------------------------------------------------- 1 | {"connectorId":1} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/unlockconnector.response.json: -------------------------------------------------------------------------------- 1 | {"status":"Accepted"} 2 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/updatefirmware.invalidurl.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "retrieveDate": "2013-02-01T15:09:18Z", 3 | "location": "Hoi, ik ben een bedorven eland. Aangenaam.", 4 | "retries": 4, 5 | "retryInterval": 20 6 | } 7 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/updatefirmware.request.json: -------------------------------------------------------------------------------- 1 | { 2 | "retrieveDate": "2013-02-01T15:09:18Z", 3 | "location": "ftp://root:root@fork.gir.foo/tmp/kvcbx-updt.amx", 4 | "retries": 4, 5 | "retryInterval": 20 6 | } 7 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/ocpp15/without_srpc/updatefirmware.response.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/Authorize.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "AuthorizeRequest", 4 | "type": "object", 5 | "properties": { 6 | "idTag": { 7 | "type": "string", 8 | "maxLength": 20 9 | } 10 | }, 11 | "additionalProperties": false, 12 | "required": [ 13 | "idTag" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/AuthorizeResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "AuthorizeResponse", 4 | "type": "object", 5 | "properties": { 6 | "idTagInfo": { 7 | "type": "object", 8 | "properties": { 9 | "status": { 10 | "type": "string", 11 | "enum": [ 12 | "Accepted", 13 | "Blocked", 14 | "Expired", 15 | "Invalid", 16 | "ConcurrentTx" 17 | ] 18 | }, 19 | "expiryDate": { 20 | "type": "string", 21 | "format": "date-time" 22 | }, 23 | "parentIdTag": { 24 | "type": "string", 25 | "maxLength": 20 26 | } 27 | }, 28 | "required": [ 29 | "status" 30 | ] 31 | } 32 | }, 33 | "additionalProperties": false, 34 | "required": [ 35 | "idTagInfo" 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/BootNotification.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "BootNotificationRequest", 4 | "type": "object", 5 | "properties": { 6 | "chargePointVendor": { 7 | "type": "string", 8 | "maxLength": 20 9 | }, 10 | "chargePointModel": { 11 | "type": "string", 12 | "maxLength": 20 13 | }, 14 | "chargePointSerialNumber": { 15 | "type": "string", 16 | "maxLength": 25 17 | }, 18 | "chargeBoxSerialNumber": { 19 | "type": "string", 20 | "maxLength": 25 21 | }, 22 | "firmwareVersion": { 23 | "type": "string", 24 | "maxLength": 50 25 | }, 26 | "iccid": { 27 | "type": "string", 28 | "maxLength": 20 29 | }, 30 | "imsi": { 31 | "type": "string", 32 | "maxLength": 20 33 | }, 34 | "meterType": { 35 | "type": "string", 36 | "maxLength": 25 37 | }, 38 | "meterSerialNumber": { 39 | "type": "string", 40 | "maxLength": 25 41 | } 42 | }, 43 | "additionalProperties": false, 44 | "required": [ 45 | "chargePointVendor", 46 | "chargePointModel" 47 | ] 48 | } 49 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/BootNotificationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "BootNotificationResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Accepted", 10 | "Pending", 11 | "Rejected" 12 | ] 13 | }, 14 | "currentTime": { 15 | "type": "string", 16 | "format": "date-time" 17 | }, 18 | "interval": { 19 | "type": "number" 20 | } 21 | }, 22 | "additionalProperties": false, 23 | "required": [ 24 | "status", 25 | "currentTime", 26 | "interval" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/CancelReservation.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "CancelReservationRequest", 4 | "type": "object", 5 | "properties": { 6 | "reservationId": { 7 | "type": "integer" 8 | } 9 | }, 10 | "additionalProperties": false, 11 | "required": [ 12 | "reservationId" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/CancelReservationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "CancelReservationResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Accepted", 10 | "Rejected" 11 | ] 12 | } 13 | }, 14 | "additionalProperties": false, 15 | "required": [ 16 | "status" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/ChangeAvailability.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "ChangeAvailabilityRequest", 4 | "type": "object", 5 | "properties": { 6 | "connectorId": { 7 | "type": "integer" 8 | }, 9 | "type": { 10 | "type": "string", 11 | "enum": [ 12 | "Inoperative", 13 | "Operative" 14 | ] 15 | } 16 | }, 17 | "additionalProperties": false, 18 | "required": [ 19 | "connectorId", 20 | "type" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/ChangeAvailabilityResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "ChangeAvailabilityResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Accepted", 10 | "Rejected", 11 | "Scheduled" 12 | ] 13 | } 14 | }, 15 | "additionalProperties": false, 16 | "required": [ 17 | "status" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/ChangeConfiguration.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "ChangeConfigurationRequest", 4 | "type": "object", 5 | "properties": { 6 | "key": { 7 | "type": "string", 8 | "maxLength": 50 9 | }, 10 | "value": { 11 | "type": "string", 12 | "maxLength": 500 13 | } 14 | }, 15 | "additionalProperties": false, 16 | "required": [ 17 | "key", 18 | "value" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/ChangeConfigurationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "ChangeConfigurationResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Accepted", 10 | "Rejected", 11 | "RebootRequired", 12 | "NotSupported" 13 | ] 14 | } 15 | }, 16 | "additionalProperties": false, 17 | "required": [ 18 | "status" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/ClearCache.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "ClearCacheRequest", 4 | "type": "object", 5 | "properties": {}, 6 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/ClearCacheResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "ClearCacheResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Accepted", 10 | "Rejected" 11 | ] 12 | } 13 | }, 14 | "additionalProperties": false, 15 | "required": [ 16 | "status" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/ClearChargingProfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "ClearChargingProfileRequest", 4 | "type": "object", 5 | "properties": { 6 | "id": { 7 | "type": "integer" 8 | }, 9 | "connectorId": { 10 | "type": "integer" 11 | }, 12 | "chargingProfilePurpose": { 13 | "type": "string", 14 | "enum": [ 15 | "ChargePointMaxProfile", 16 | "TxDefaultProfile", 17 | "TxProfile" 18 | ] 19 | }, 20 | "stackLevel": { 21 | "type": "integer" 22 | } 23 | }, 24 | "additionalProperties": false 25 | } 26 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/ClearChargingProfileResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "ClearChargingProfileResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Accepted", 10 | "Unknown" 11 | ] 12 | } 13 | }, 14 | "additionalProperties": false, 15 | "required": [ 16 | "status" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/DataTransfer.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "DataTransferRequest", 4 | "type": "object", 5 | "properties": { 6 | "vendorId": { 7 | "type": "string", 8 | "maxLength": 255 9 | }, 10 | "messageId": { 11 | "type": "string", 12 | "maxLength": 50 13 | }, 14 | "data": { 15 | "type": "string" 16 | } 17 | }, 18 | "additionalProperties": false, 19 | "required": [ 20 | "vendorId" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/DataTransferResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "DataTransferResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Accepted", 10 | "Rejected", 11 | "UnknownMessageId", 12 | "UnknownVendorId" 13 | ] 14 | }, 15 | "data": { 16 | "type": "string" 17 | } 18 | }, 19 | "additionalProperties": false, 20 | "required": [ 21 | "status" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/DiagnosticsStatusNotification.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "DiagnosticsStatusNotificationRequest", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Idle", 10 | "Uploaded", 11 | "UploadFailed", 12 | "Uploading" 13 | ] 14 | } 15 | }, 16 | "additionalProperties": false, 17 | "required": [ 18 | "status" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/DiagnosticsStatusNotificationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "DiagnosticsStatusNotificationResponse", 4 | "type": "object", 5 | "properties": {}, 6 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/FirmwareStatusNotification.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "FirmwareStatusNotificationRequest", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Downloaded", 10 | "DownloadFailed", 11 | "Downloading", 12 | "Idle", 13 | "InstallationFailed", 14 | "Installing", 15 | "Installed" 16 | ] 17 | } 18 | }, 19 | "additionalProperties": false, 20 | "required": [ 21 | "status" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/FirmwareStatusNotificationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "FirmwareStatusNotificationResponse", 4 | "type": "object", 5 | "properties": {}, 6 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/GetCompositeSchedule.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "GetCompositeScheduleRequest", 4 | "type": "object", 5 | "properties": { 6 | "connectorId": { 7 | "type": "integer" 8 | }, 9 | "duration": { 10 | "type": "integer" 11 | }, 12 | "chargingRateUnit": { 13 | "type": "string", 14 | "enum": [ 15 | "A", 16 | "W" 17 | ] 18 | } 19 | }, 20 | "additionalProperties": false, 21 | "required": [ 22 | "connectorId", 23 | "duration" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/GetCompositeScheduleResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "GetCompositeScheduleResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Accepted", 10 | "Rejected" 11 | ] 12 | }, 13 | "connectorId": { 14 | "type": "integer" 15 | }, 16 | "scheduleStart": { 17 | "type": "string", 18 | "format": "date-time" 19 | }, 20 | "chargingSchedule": { 21 | "type": "object", 22 | "properties": { 23 | "duration": { 24 | "type": "integer" 25 | }, 26 | "startSchedule": { 27 | "type": "string", 28 | "format": "date-time" 29 | }, 30 | "chargingRateUnit": { 31 | "type": "string", 32 | "enum": [ 33 | "A", 34 | "W" 35 | ] 36 | }, 37 | "chargingSchedulePeriod": { 38 | "type": "array", 39 | "items": { 40 | "type": "object", 41 | "properties": { 42 | "startPeriod": { 43 | "type": "integer" 44 | }, 45 | "limit": { 46 | "type": "number", 47 | "multipleOf" : 0.1 48 | }, 49 | "numberPhases": { 50 | "type": "integer" 51 | } 52 | }, 53 | "required": [ 54 | "startPeriod", 55 | "limit" 56 | ] 57 | } 58 | }, 59 | "minChargingRate": { 60 | "type": "number", 61 | "multipleOf" : 0.1 62 | } 63 | }, 64 | "required": [ 65 | "chargingRateUnit", 66 | "chargingSchedulePeriod" 67 | ] 68 | } 69 | }, 70 | "additionalProperties": false, 71 | "required": [ 72 | "status" 73 | ] 74 | } 75 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/GetConfiguration.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "GetConfigurationRequest", 4 | "type": "object", 5 | "properties": { 6 | "key": { 7 | "type": "array", 8 | "items": { 9 | "type": "string", 10 | "maxLength": 50 11 | } 12 | } 13 | }, 14 | "additionalProperties": false 15 | } 16 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/GetConfigurationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "GetConfigurationResponse", 4 | "type": "object", 5 | "properties": { 6 | "configurationKey": { 7 | "type": "array", 8 | "items": { 9 | "type": "object", 10 | "properties": { 11 | "key": { 12 | "type": "string", 13 | "maxLength": 50 14 | }, 15 | "readonly": { 16 | "type": "boolean" 17 | }, 18 | "value": { 19 | "type": "string", 20 | "maxLength": 500 21 | } 22 | }, 23 | "required": [ 24 | "key", 25 | "readonly" 26 | ] 27 | } 28 | }, 29 | "unknownKey": { 30 | "type": "array", 31 | "items": { 32 | "type": "string", 33 | "maxLength": 50 34 | } 35 | } 36 | }, 37 | "additionalProperties": false 38 | } 39 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/GetDiagnostics.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "GetDiagnosticsRequest", 4 | "type": "object", 5 | "properties": { 6 | "location": { 7 | "type": "string", 8 | "format": "uri" 9 | }, 10 | "retries": { 11 | "type": "integer" 12 | }, 13 | "retryInterval": { 14 | "type": "integer" 15 | }, 16 | "startTime": { 17 | "type": "string", 18 | "format": "date-time" 19 | }, 20 | "stopTime": { 21 | "type": "string", 22 | "format": "date-time" 23 | } 24 | }, 25 | "additionalProperties": false, 26 | "required": [ 27 | "location" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/GetDiagnosticsResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "GetDiagnosticsResponse", 4 | "type": "object", 5 | "properties": { 6 | "fileName": { 7 | "type": "string", 8 | "maxLength": 255 9 | } 10 | }, 11 | "additionalProperties": false 12 | } 13 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/GetLocalListVersion.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "GetLocalListVersionRequest", 4 | "type": "object", 5 | "properties": {}, 6 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/GetLocalListVersionResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "GetLocalListVersionResponse", 4 | "type": "object", 5 | "properties": { 6 | "listVersion": { 7 | "type": "integer" 8 | } 9 | }, 10 | "additionalProperties": false, 11 | "required": [ 12 | "listVersion" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/Heartbeat.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "HeartbeatRequest", 4 | "type": "object", 5 | "properties": {}, 6 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/HeartbeatResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "HeartbeatResponse", 4 | "type": "object", 5 | "properties": { 6 | "currentTime": { 7 | "type": "string", 8 | "format": "date-time" 9 | } 10 | }, 11 | "additionalProperties": false, 12 | "required": [ 13 | "currentTime" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/MeterValuesResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "MeterValuesResponse", 4 | "type": "object", 5 | "properties": {}, 6 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/RemoteStartTransactionResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "RemoteStartTransactionResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Accepted", 10 | "Rejected" 11 | ] 12 | } 13 | }, 14 | "additionalProperties": false, 15 | "required": [ 16 | "status" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/RemoteStopTransaction.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "RemoteStopTransactionRequest", 4 | "type": "object", 5 | "properties": { 6 | "transactionId": { 7 | "type": "integer" 8 | } 9 | }, 10 | "additionalProperties": false, 11 | "required": [ 12 | "transactionId" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/RemoteStopTransactionResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "RemoteStopTransactionResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Accepted", 10 | "Rejected" 11 | ] 12 | } 13 | }, 14 | "additionalProperties": false, 15 | "required": [ 16 | "status" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/ReserveNow.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "ReserveNowRequest", 4 | "type": "object", 5 | "properties": { 6 | "connectorId": { 7 | "type": "integer" 8 | }, 9 | "expiryDate": { 10 | "type": "string", 11 | "format": "date-time" 12 | }, 13 | "idTag": { 14 | "type": "string", 15 | "maxLength": 20 16 | }, 17 | "parentIdTag": { 18 | "type": "string", 19 | "maxLength": 20 20 | }, 21 | "reservationId": { 22 | "type": "integer" 23 | } 24 | }, 25 | "additionalProperties": false, 26 | "required": [ 27 | "connectorId", 28 | "expiryDate", 29 | "idTag", 30 | "reservationId" 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/ReserveNowResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "ReserveNowResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Accepted", 10 | "Faulted", 11 | "Occupied", 12 | "Rejected", 13 | "Unavailable" 14 | ] 15 | } 16 | }, 17 | "additionalProperties": false, 18 | "required": [ 19 | "status" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/Reset.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "ResetRequest", 4 | "type": "object", 5 | "properties": { 6 | "type": { 7 | "type": "string", 8 | "enum": [ 9 | "Hard", 10 | "Soft" 11 | ] 12 | } 13 | }, 14 | "additionalProperties": false, 15 | "required": [ 16 | "type" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/ResetResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "ResetResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Accepted", 10 | "Rejected" 11 | ] 12 | } 13 | }, 14 | "additionalProperties": false, 15 | "required": [ 16 | "status" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/SendLocalListResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "SendLocalListResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Accepted", 10 | "Failed", 11 | "NotSupported", 12 | "VersionMismatch" 13 | ] 14 | } 15 | }, 16 | "additionalProperties": false, 17 | "required": [ 18 | "status" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/SetChargingProfileResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "SetChargingProfileResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Accepted", 10 | "Rejected", 11 | "NotSupported" 12 | ] 13 | } 14 | }, 15 | "additionalProperties": false, 16 | "required": [ 17 | "status" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/StartTransaction.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "StartTransactionRequest", 4 | "type": "object", 5 | "properties": { 6 | "connectorId": { 7 | "type": "integer" 8 | }, 9 | "idTag": { 10 | "type": "string", 11 | "maxLength": 20 12 | }, 13 | "meterStart": { 14 | "type": "integer" 15 | }, 16 | "reservationId": { 17 | "type": "integer" 18 | }, 19 | "timestamp": { 20 | "type": "string", 21 | "format": "date-time" 22 | } 23 | }, 24 | "additionalProperties": false, 25 | "required": [ 26 | "connectorId", 27 | "idTag", 28 | "meterStart", 29 | "timestamp" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/StartTransactionResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "StartTransactionResponse", 4 | "type": "object", 5 | "properties": { 6 | "idTagInfo": { 7 | "type": "object", 8 | "properties": { 9 | "expiryDate": { 10 | "type": "string", 11 | "format": "date-time" 12 | }, 13 | "parentIdTag": { 14 | "type": "string", 15 | "maxLength": 20 16 | }, 17 | "status": { 18 | "type": "string", 19 | "enum": [ 20 | "Accepted", 21 | "Blocked", 22 | "Expired", 23 | "Invalid", 24 | "ConcurrentTx" 25 | ] 26 | } 27 | }, 28 | "required": [ 29 | "status" 30 | ] 31 | }, 32 | "transactionId": { 33 | "type": "integer" 34 | } 35 | }, 36 | "additionalProperties": false, 37 | "required": [ 38 | "idTagInfo", 39 | "transactionId" 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/StatusNotification.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "StatusNotificationRequest", 4 | "type": "object", 5 | "properties": { 6 | "connectorId": { 7 | "type": "integer" 8 | }, 9 | "errorCode": { 10 | "type": "string", 11 | "enum": [ 12 | "ConnectorLockFailure", 13 | "EVCommunicationError", 14 | "GroundFailure", 15 | "HighTemperature", 16 | "InternalError", 17 | "LocalListConflict", 18 | "NoError", 19 | "OtherError", 20 | "OverCurrentFailure", 21 | "PowerMeterFailure", 22 | "PowerSwitchFailure", 23 | "ReaderFailure", 24 | "ResetFailure", 25 | "UnderVoltage", 26 | "OverVoltage", 27 | "WeakSignal" 28 | ] 29 | }, 30 | "info": { 31 | "type": "string", 32 | "maxLength": 50 33 | }, 34 | "status": { 35 | "type": "string", 36 | "enum": [ 37 | "Available", 38 | "Preparing", 39 | "Charging", 40 | "SuspendedEVSE", 41 | "SuspendedEV", 42 | "Finishing", 43 | "Reserved", 44 | "Unavailable", 45 | "Faulted" 46 | ] 47 | }, 48 | "timestamp": { 49 | "type": "string", 50 | "format": "date-time" 51 | }, 52 | "vendorId": { 53 | "type": "string", 54 | "maxLength": 255 55 | }, 56 | "vendorErrorCode": { 57 | "type": "string", 58 | "maxLength": 50 59 | } 60 | }, 61 | "additionalProperties": false, 62 | "required": [ 63 | "connectorId", 64 | "errorCode", 65 | "status" 66 | ] 67 | } 68 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/StatusNotificationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "StatusNotificationResponse", 4 | "type": "object", 5 | "properties": {}, 6 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/StopTransactionResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "StopTransactionResponse", 4 | "type": "object", 5 | "properties": { 6 | "idTagInfo": { 7 | "type": "object", 8 | "properties": { 9 | "expiryDate": { 10 | "type": "string", 11 | "format": "date-time" 12 | }, 13 | "parentIdTag": { 14 | "type": "string", 15 | "maxLength": 20 16 | }, 17 | "status": { 18 | "type": "string", 19 | "enum": [ 20 | "Accepted", 21 | "Blocked", 22 | "Expired", 23 | "Invalid", 24 | "ConcurrentTx" 25 | ] 26 | } 27 | }, 28 | "required": [ 29 | "status" 30 | ] 31 | } 32 | }, 33 | "additionalProperties": false 34 | } 35 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/TriggerMessage.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "TriggerMessageRequest", 4 | "type": "object", 5 | "properties": { 6 | "requestedMessage": { 7 | "type": "string", 8 | "enum": [ 9 | "BootNotification", 10 | "DiagnosticsStatusNotification", 11 | "FirmwareStatusNotification", 12 | "Heartbeat", 13 | "MeterValues", 14 | "StatusNotification" 15 | ] 16 | }, 17 | "connectorId": { 18 | "type": "integer" 19 | } 20 | }, 21 | "additionalProperties": false, 22 | "required": [ 23 | "requestedMessage" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/TriggerMessageResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "TriggerMessageResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Accepted", 10 | "Rejected", 11 | "NotImplemented" 12 | ] 13 | } 14 | }, 15 | "additionalProperties": false, 16 | "required": [ 17 | "status" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/UnlockConnector.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "UnlockConnectorRequest", 4 | "type": "object", 5 | "properties": { 6 | "connectorId": { 7 | "type": "integer" 8 | } 9 | }, 10 | "additionalProperties": false, 11 | "required": [ 12 | "connectorId" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/UnlockConnectorResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "UnlockConnectorResponse", 4 | "type": "object", 5 | "properties": { 6 | "status": { 7 | "type": "string", 8 | "enum": [ 9 | "Unlocked", 10 | "UnlockFailed", 11 | "NotSupported" 12 | ] 13 | } 14 | }, 15 | "additionalProperties": false, 16 | "required": [ 17 | "status" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/UpdateFirmware.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "UpdateFirmwareRequest", 4 | "type": "object", 5 | "properties": { 6 | "location": { 7 | "type": "string", 8 | "format": "uri" 9 | }, 10 | "retries": { 11 | "type": "number" 12 | }, 13 | "retrieveDate": { 14 | "type": "string", 15 | "format": "date-time" 16 | }, 17 | "retryInterval": { 18 | "type": "number" 19 | } 20 | }, 21 | "additionalProperties": false, 22 | "required": [ 23 | "location", 24 | "retrieveDate" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v1x/v16/schemas/UpdateFirmwareResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "UpdateFirmwareResponse", 4 | "type": "object", 5 | "properties": {}, 6 | "additionalProperties": false 7 | } 8 | -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/BootNotificationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:BootNotificationResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "currentTime": { 9 | "type": "string", 10 | "format": "date-time" 11 | }, 12 | "interval": { 13 | "type": "integer" 14 | }, 15 | "status": { 16 | "type": "string", 17 | "additionalProperties": true, 18 | "enum": [ 19 | "Accepted", 20 | "Pending", 21 | "Rejected" 22 | ] 23 | } 24 | }, 25 | "required": [ 26 | "currentTime", 27 | "interval", 28 | "status" 29 | ] 30 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/CancelReservationRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:CancelReservationRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "reservationId": { 9 | "type": "integer" 10 | } 11 | }, 12 | "required": [ 13 | "reservationId" 14 | ] 15 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/CancelReservationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:CancelReservationResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/CertificateSignedRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:CertificateSignedRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "cert": { 9 | "type": "array", 10 | "additionalItems": false, 11 | "items": { 12 | "type": "string", 13 | "maxLength": 800 14 | }, 15 | "minItems": 1 16 | }, 17 | "typeOfCertificate": { 18 | "type": "string", 19 | "additionalProperties": true, 20 | "enum": [ 21 | "ChargingStationCertificate", 22 | "V2GCertificate" 23 | ] 24 | } 25 | }, 26 | "required": [ 27 | "cert" 28 | ] 29 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/CertificateSignedResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:CertificateSignedResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ChangeAvailabilityRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ChangeAvailabilityRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "evseId": { 9 | "type": "integer" 10 | }, 11 | "operationalStatus": { 12 | "type": "string", 13 | "additionalProperties": true, 14 | "enum": [ 15 | "Inoperative", 16 | "Operative" 17 | ] 18 | } 19 | }, 20 | "required": [ 21 | "evseId", 22 | "operationalStatus" 23 | ] 24 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ChangeAvailabilityResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ChangeAvailabilityResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected", 14 | "Scheduled" 15 | ] 16 | } 17 | }, 18 | "required": [ 19 | "status" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ClearCacheRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ClearCacheRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ClearCacheResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ClearCacheResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ClearChargingProfileRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ClearChargingProfileRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "definitions": { 6 | "ChargingProfilePurposeEnumType": { 7 | "type": "string", 8 | "additionalProperties": true, 9 | "enum": [ 10 | "ChargingStationExternalConstraints", 11 | "ChargingStationMaxProfile", 12 | "TxDefaultProfile", 13 | "TxProfile" 14 | ] 15 | }, 16 | "ClearChargingProfileType": { 17 | "javaType": "ClearChargingProfile", 18 | "type": "object", 19 | "additionalProperties": true, 20 | "properties": { 21 | "id": { 22 | "type": "integer" 23 | }, 24 | "chargingProfilePurpose": { 25 | "$ref": "#/definitions/ChargingProfilePurposeEnumType" 26 | }, 27 | "stackLevel": { 28 | "type": "integer" 29 | } 30 | } 31 | } 32 | }, 33 | "type": "object", 34 | "additionalProperties": true, 35 | "properties": { 36 | "evseId": { 37 | "type": "integer" 38 | }, 39 | "chargingProfile": { 40 | "$ref": "#/definitions/ClearChargingProfileType" 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ClearChargingProfileResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ClearChargingProfileResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Unknown" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ClearDisplayMessageRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ClearDisplayMessageRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "id": { 9 | "type": "integer" 10 | } 11 | }, 12 | "required": [ 13 | "id" 14 | ] 15 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ClearDisplayMessageResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ClearDisplayMessageResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Unknown" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ClearVariableMonitoringRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ClearVariableMonitoringRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "id": { 9 | "type": "array", 10 | "additionalItems": false, 11 | "items": { 12 | "type": "integer" 13 | }, 14 | "minItems": 1 15 | } 16 | }, 17 | "required": [ 18 | "id" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ClearVariableMonitoringResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ClearVariableMonitoringResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "definitions": { 6 | "ClearMonitoringStatusEnumType": { 7 | "type": "string", 8 | "additionalProperties": true, 9 | "enum": [ 10 | "Accepted", 11 | "Rejected", 12 | "NotFound" 13 | ] 14 | }, 15 | "ClearMonitoringResultType": { 16 | "javaType": "ClearMonitoringResult", 17 | "type": "object", 18 | "additionalProperties": true, 19 | "properties": { 20 | "id": { 21 | "type": "integer" 22 | }, 23 | "status": { 24 | "$ref": "#/definitions/ClearMonitoringStatusEnumType" 25 | } 26 | }, 27 | "required": [ 28 | "id", 29 | "status" 30 | ] 31 | } 32 | }, 33 | "type": "object", 34 | "additionalProperties": true, 35 | "properties": { 36 | "clearMonitoringResult": { 37 | "type": "array", 38 | "additionalItems": false, 39 | "items": { 40 | "$ref": "#/definitions/ClearMonitoringResultType" 41 | }, 42 | "minItems": 1 43 | } 44 | }, 45 | "required": [ 46 | "clearMonitoringResult" 47 | ] 48 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ClearedChargingLimitRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ClearedChargingLimitRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "chargingLimitSource": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "EMS", 13 | "Other", 14 | "SO", 15 | "CSO" 16 | ] 17 | }, 18 | "evseId": { 19 | "type": "integer" 20 | } 21 | }, 22 | "required": [ 23 | "chargingLimitSource" 24 | ] 25 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ClearedChargingLimitResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ClearedChargingLimitResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/CostUpdatedRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:CostUpdatedRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "totalCost": { 9 | "type": "number" 10 | }, 11 | "transactionId": { 12 | "type": "string", 13 | "maxLength": 36 14 | } 15 | }, 16 | "required": [ 17 | "totalCost", 18 | "transactionId" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/CostUpdatedResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:CostUpdatedResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/CustomerInformationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:CustomerInformationResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected", 14 | "Invalid" 15 | ] 16 | } 17 | }, 18 | "required": [ 19 | "status" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/DataTransferRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:DataTransferRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "messageId": { 9 | "type": "string", 10 | "maxLength": 50 11 | }, 12 | "data": {}, 13 | "vendorId": { 14 | "type": "string", 15 | "maxLength": 255 16 | } 17 | }, 18 | "required": [ 19 | "vendorId" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/DataTransferResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:DataTransferResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected", 14 | "UnknownMessageId", 15 | "UnknownVendorId" 16 | ] 17 | }, 18 | "data": {} 19 | }, 20 | "required": [ 21 | "status" 22 | ] 23 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/DeleteCertificateRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:DeleteCertificateRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "definitions": { 6 | "HashAlgorithmEnumType": { 7 | "type": "string", 8 | "additionalProperties": true, 9 | "enum": [ 10 | "SHA256", 11 | "SHA384", 12 | "SHA512" 13 | ] 14 | }, 15 | "CertificateHashDataType": { 16 | "javaType": "CertificateHashData", 17 | "type": "object", 18 | "additionalProperties": true, 19 | "properties": { 20 | "hashAlgorithm": { 21 | "$ref": "#/definitions/HashAlgorithmEnumType" 22 | }, 23 | "issuerNameHash": { 24 | "type": "string", 25 | "maxLength": 128 26 | }, 27 | "issuerKeyHash": { 28 | "type": "string", 29 | "maxLength": 128 30 | }, 31 | "serialNumber": { 32 | "type": "string", 33 | "maxLength": 20 34 | } 35 | }, 36 | "required": [ 37 | "hashAlgorithm", 38 | "issuerNameHash", 39 | "issuerKeyHash", 40 | "serialNumber" 41 | ] 42 | } 43 | }, 44 | "type": "object", 45 | "additionalProperties": true, 46 | "properties": { 47 | "certificateHashData": { 48 | "$ref": "#/definitions/CertificateHashDataType" 49 | } 50 | }, 51 | "required": [ 52 | "certificateHashData" 53 | ] 54 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/DeleteCertificateResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:DeleteCertificateResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Failed", 14 | "NotFound" 15 | ] 16 | } 17 | }, 18 | "required": [ 19 | "status" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/FirmwareStatusNotificationRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:FirmwareStatusNotificationRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "CertificateVerified", 13 | "Downloaded", 14 | "DownloadFailed", 15 | "Downloading", 16 | "DownloadScheduled", 17 | "DownloadPaused", 18 | "Idle", 19 | "InstallationFailed", 20 | "Installing", 21 | "Installed", 22 | "InstallRebooting", 23 | "InstallScheduled", 24 | "InstallVerificationFailed", 25 | "InvalidSignature", 26 | "InvalidCertificate", 27 | "RevokedCertificate", 28 | "PublishFailed", 29 | "SignatureVerified" 30 | ] 31 | }, 32 | "requestId": { 33 | "type": "integer" 34 | } 35 | }, 36 | "required": [ 37 | "status", 38 | "requestId" 39 | ] 40 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/FirmwareStatusNotificationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:FirmwareStatusNotificationResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/Get15118EVCertificateRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:Get15118EVCertificateRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "15118SchemaVersion": { 9 | "type": "string", 10 | "maxLength": 50 11 | }, 12 | "exiRequest": { 13 | "type": "string", 14 | "maxLength": 5500 15 | } 16 | }, 17 | "required": [ 18 | "15118SchemaVersion", 19 | "exiRequest" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/Get15118EVCertificateResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:Get15118EVCertificateResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "definitions": { 6 | "15118EVCertificateStatusEnumType": { 7 | "type": "string", 8 | "additionalProperties": true, 9 | "enum": [ 10 | "Accepted", 11 | "Failed" 12 | ] 13 | }, 14 | "CertificateChainType": { 15 | "javaType": "CertificateChain", 16 | "type": "object", 17 | "additionalProperties": true, 18 | "properties": { 19 | "certificate": { 20 | "type": "string", 21 | "maxLength": 800 22 | }, 23 | "childCertificate": { 24 | "type": "array", 25 | "additionalItems": false, 26 | "items": { 27 | "type": "string", 28 | "maxLength": 800 29 | }, 30 | "minItems": 1, 31 | "maxItems": 4 32 | } 33 | }, 34 | "required": [ 35 | "certificate" 36 | ] 37 | } 38 | }, 39 | "type": "object", 40 | "additionalProperties": true, 41 | "properties": { 42 | "status": { 43 | "$ref": "#/definitions/15118EVCertificateStatusEnumType" 44 | }, 45 | "saProvisioningCertificateChain": { 46 | "$ref": "#/definitions/CertificateChainType" 47 | }, 48 | "contractSignatureCertificateChain": { 49 | "$ref": "#/definitions/CertificateChainType" 50 | }, 51 | "exiResponse": { 52 | "type": "string", 53 | "maxLength": 5500 54 | } 55 | }, 56 | "required": [ 57 | "status", 58 | "exiResponse", 59 | "contractSignatureCertificateChain", 60 | "saProvisioningCertificateChain" 61 | ] 62 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetBaseReportRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetBaseReportRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "requestId": { 9 | "type": "integer" 10 | }, 11 | "reportBase": { 12 | "type": "string", 13 | "additionalProperties": true, 14 | "enum": [ 15 | "ConfigurationInventory", 16 | "FullInventory", 17 | "SummaryInventory" 18 | ] 19 | } 20 | }, 21 | "required": [ 22 | "requestId", 23 | "reportBase" 24 | ] 25 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetBaseReportResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetBaseReportResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected", 14 | "NotSupported" 15 | ] 16 | } 17 | }, 18 | "required": [ 19 | "status" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetCertificateStatusRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetCertificateStatusRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "definitions": { 6 | "HashAlgorithmEnumType": { 7 | "type": "string", 8 | "additionalProperties": true, 9 | "enum": [ 10 | "SHA256", 11 | "SHA384", 12 | "SHA512" 13 | ] 14 | }, 15 | "OCSPRequestDataType": { 16 | "javaType": "OCSPRequestData", 17 | "type": "object", 18 | "additionalProperties": true, 19 | "properties": { 20 | "hashAlgorithm": { 21 | "$ref": "#/definitions/HashAlgorithmEnumType" 22 | }, 23 | "issuerNameHash": { 24 | "type": "string", 25 | "maxLength": 128 26 | }, 27 | "issuerKeyHash": { 28 | "type": "string", 29 | "maxLength": 128 30 | }, 31 | "serialNumber": { 32 | "type": "string", 33 | "maxLength": 20 34 | }, 35 | "responderURL": { 36 | "type": "string", 37 | "maxLength": 512 38 | } 39 | }, 40 | "required": [ 41 | "hashAlgorithm", 42 | "issuerNameHash", 43 | "issuerKeyHash", 44 | "serialNumber" 45 | ] 46 | } 47 | }, 48 | "type": "object", 49 | "additionalProperties": true, 50 | "properties": { 51 | "ocspRequestData": { 52 | "$ref": "#/definitions/OCSPRequestDataType" 53 | } 54 | }, 55 | "required": [ 56 | "ocspRequestData" 57 | ] 58 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetCertificateStatusResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetCertificateStatusResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected" 14 | ] 15 | }, 16 | "ocspResult": { 17 | "type": "string", 18 | "maxLength": 5500 19 | } 20 | }, 21 | "required": [ 22 | "status" 23 | ] 24 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetChargingProfilesResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetChargingProfilesResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "NoProfiles" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetCompositeScheduleRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetCompositeScheduleRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "duration": { 9 | "type": "integer" 10 | }, 11 | "chargingRateUnit": { 12 | "type": "string", 13 | "additionalProperties": true, 14 | "enum": [ 15 | "W", 16 | "A" 17 | ] 18 | }, 19 | "evseId": { 20 | "type": "integer" 21 | } 22 | }, 23 | "required": [ 24 | "duration", 25 | "evseId" 26 | ] 27 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetDisplayMessagesRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetDisplayMessagesRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "requestId": { 9 | "type": "integer" 10 | }, 11 | "priority": { 12 | "type": "string", 13 | "additionalProperties": true, 14 | "enum": [ 15 | "AlwaysFront", 16 | "InFront", 17 | "NormalCycle" 18 | ] 19 | }, 20 | "state": { 21 | "type": "string", 22 | "additionalProperties": true, 23 | "enum": [ 24 | "Charging", 25 | "Faulted", 26 | "Idle", 27 | "Unavailable" 28 | ] 29 | }, 30 | "id": { 31 | "type": "array", 32 | "additionalItems": false, 33 | "items": { 34 | "type": "integer" 35 | }, 36 | "minItems": 1 37 | } 38 | }, 39 | "required": [ 40 | "requestId" 41 | ] 42 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetDisplayMessagesResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetDisplayMessagesResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Unknown" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetInstalledCertificateIdsRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetInstalledCertificateIdsRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "typeOfCertificate": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "V2GRootCertficate", 13 | "MORootCertificate", 14 | "CSOSubCA1", 15 | "CSOSubCA2", 16 | "CSMSRootCertificate", 17 | "ManufacturerRootCertificate" 18 | ] 19 | } 20 | }, 21 | "required": [ 22 | "typeOfCertificate" 23 | ] 24 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetInstalledCertificateIdsResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetInstalledCertificateIdsResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "definitions": { 6 | "GetInstalledCertificateStatusEnumType": { 7 | "type": "string", 8 | "additionalProperties": true, 9 | "enum": [ 10 | "Accepted", 11 | "NotFound" 12 | ] 13 | }, 14 | "HashAlgorithmEnumType": { 15 | "type": "string", 16 | "additionalProperties": true, 17 | "enum": [ 18 | "SHA256", 19 | "SHA384", 20 | "SHA512" 21 | ] 22 | }, 23 | "CertificateHashDataType": { 24 | "javaType": "CertificateHashData", 25 | "type": "object", 26 | "additionalProperties": true, 27 | "properties": { 28 | "hashAlgorithm": { 29 | "$ref": "#/definitions/HashAlgorithmEnumType" 30 | }, 31 | "issuerNameHash": { 32 | "type": "string", 33 | "maxLength": 128 34 | }, 35 | "issuerKeyHash": { 36 | "type": "string", 37 | "maxLength": 128 38 | }, 39 | "serialNumber": { 40 | "type": "string", 41 | "maxLength": 20 42 | } 43 | }, 44 | "required": [ 45 | "hashAlgorithm", 46 | "issuerNameHash", 47 | "issuerKeyHash", 48 | "serialNumber" 49 | ] 50 | } 51 | }, 52 | "type": "object", 53 | "additionalProperties": true, 54 | "properties": { 55 | "certificateHashData": { 56 | "type": "array", 57 | "additionalItems": false, 58 | "items": { 59 | "$ref": "#/definitions/CertificateHashDataType" 60 | }, 61 | "minItems": 1 62 | }, 63 | "status": { 64 | "$ref": "#/definitions/GetInstalledCertificateStatusEnumType" 65 | } 66 | }, 67 | "required": [ 68 | "status" 69 | ] 70 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetLocalListVersionRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetLocalListVersionRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetLocalListVersionResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetLocalListVersionResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "versionNumber": { 9 | "type": "integer" 10 | } 11 | }, 12 | "required": [ 13 | "versionNumber" 14 | ] 15 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetLogRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetLogRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "definitions": { 6 | "LogEnumType": { 7 | "type": "string", 8 | "additionalProperties": true, 9 | "enum": [ 10 | "DiagnosticsLog", 11 | "SecurityLog" 12 | ] 13 | }, 14 | "LogParametersType": { 15 | "javaType": "LogParameters", 16 | "type": "object", 17 | "additionalProperties": true, 18 | "properties": { 19 | "remoteLocation": { 20 | "type": "string", 21 | "maxLength": 512 22 | }, 23 | "oldestTimestamp": { 24 | "type": "string", 25 | "format": "date-time" 26 | }, 27 | "latestTimestamp": { 28 | "type": "string", 29 | "format": "date-time" 30 | } 31 | }, 32 | "required": [ 33 | "remoteLocation" 34 | ] 35 | } 36 | }, 37 | "type": "object", 38 | "additionalProperties": true, 39 | "properties": { 40 | "log": { 41 | "$ref": "#/definitions/LogParametersType" 42 | }, 43 | "logType": { 44 | "$ref": "#/definitions/LogEnumType" 45 | }, 46 | "requestId": { 47 | "type": "integer" 48 | }, 49 | "retries": { 50 | "type": "integer" 51 | }, 52 | "retryInterval": { 53 | "type": "integer" 54 | } 55 | }, 56 | "required": [ 57 | "logType", 58 | "requestId", 59 | "log" 60 | ] 61 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetLogResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetLogResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected", 14 | "AcceptedCanceled" 15 | ] 16 | }, 17 | "filename": { 18 | "type": "string", 19 | "maxLength": 255 20 | } 21 | }, 22 | "required": [ 23 | "status" 24 | ] 25 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetMonitoringReportResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetMonitoringReportResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected", 14 | "NotSupported" 15 | ] 16 | } 17 | }, 18 | "required": [ 19 | "status" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetReportResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetReportResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected", 14 | "NotSupported" 15 | ] 16 | } 17 | }, 18 | "required": [ 19 | "status" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetTransactionStatusRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetTransactionStatusRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "transactionId": { 9 | "type": "string", 10 | "maxLength": 36 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/GetTransactionStatusResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:GetTransactionStatusResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "ongoingIndicator": { 9 | "type": "boolean" 10 | }, 11 | "messagesInQueue": { 12 | "type": "boolean" 13 | } 14 | }, 15 | "required": [ 16 | "messagesInQueue" 17 | ] 18 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/HeartbeatRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:HeartbeatRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/HeartbeatResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:HeartbeatResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "currentTime": { 9 | "type": "string", 10 | "format": "date-time" 11 | } 12 | }, 13 | "required": [ 14 | "currentTime" 15 | ] 16 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/InstallCertificateRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:InstallCertificateRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "certificateType": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "V2GRootCertficate", 13 | "MORootCertificate", 14 | "CSOSubCA1", 15 | "CSOSubCA2", 16 | "CSMSRootCertificate", 17 | "ManufacturerRootCertificate" 18 | ] 19 | }, 20 | "certificate": { 21 | "type": "string", 22 | "maxLength": 800 23 | } 24 | }, 25 | "required": [ 26 | "certificateType", 27 | "certificate" 28 | ] 29 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/InstallCertificateResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:InstallCertificateResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "SignatureError", 14 | "CertificateExpired", 15 | "CertificateRevoked", 16 | "NoCertificateAvailable", 17 | "CertChainError", 18 | "ContractCancelled" 19 | ] 20 | } 21 | }, 22 | "required": [ 23 | "status" 24 | ] 25 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/LogStatusNotificationRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:LogStatusNotificationRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "BadMessage", 13 | "Idle", 14 | "NotSupportedOperation", 15 | "PermissionDenied", 16 | "Uploaded", 17 | "UploadFailure", 18 | "Uploading" 19 | ] 20 | }, 21 | "requestId": { 22 | "type": "integer" 23 | } 24 | }, 25 | "required": [ 26 | "status", 27 | "requestId" 28 | ] 29 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/LogStatusNotificationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:LogStatusNotificationResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/MeterValuesResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:MeterValuesResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/NotifyCentralChargingNeedsResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:NotifyCentralChargingNeedsResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/NotifyChargingLimitResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:NotifyChargingLimitResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/NotifyCustomerInformationRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:NotifyCustomerInformationRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "data": { 9 | "type": "string", 10 | "maxLength": 512 11 | }, 12 | "tbc": { 13 | "type": "boolean" 14 | }, 15 | "seqNo": { 16 | "type": "integer" 17 | }, 18 | "generatedAt": { 19 | "type": "string", 20 | "format": "date-time" 21 | }, 22 | "requestId": { 23 | "type": "integer" 24 | } 25 | }, 26 | "required": [ 27 | "data", 28 | "tbc", 29 | "seqNo", 30 | "generatedAt" 31 | ] 32 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/NotifyCustomerInformationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:NotifyCustomerInformationResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/NotifyDisplayMessagesResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:NotifyDisplayMessagesResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/NotifyEVChargingNeedsResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:NotifyEVChargingNeedsResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected", 14 | "Processing" 15 | ] 16 | } 17 | }, 18 | "required": [ 19 | "status" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/NotifyEVChargingScheduleResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:NotifyEVChargingScheduleResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/NotifyEventResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:NotifyEventResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/NotifyMonitoringReportResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:NotifyMonitoringReportResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/NotifyReportResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:NotifyReportResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/PublishFirmwareRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:PublishFirmwareRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "location": { 9 | "type": "string", 10 | "maxLength": 512 11 | }, 12 | "retries": { 13 | "type": "integer" 14 | }, 15 | "checksum": { 16 | "type": "string", 17 | "maxLength": 32 18 | } 19 | }, 20 | "required": [ 21 | "location", 22 | "checksum" 23 | ] 24 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/PublishFirmwareResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:PublishFirmwareResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/PublishFirmwareStatusNotificationRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:PublishFirmwareStatusNotificationRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Downloaded", 13 | "DownloadFailed", 14 | "Downloading", 15 | "DownloadScheduled", 16 | "DownloadPaused", 17 | "PublishFailed", 18 | "Published", 19 | "InvalidChecksum", 20 | "ChecksumVerified" 21 | ] 22 | }, 23 | "location": { 24 | "type": "array", 25 | "additionalItems": false, 26 | "items": { 27 | "type": "string", 28 | "maxLength": 512 29 | }, 30 | "minItems": 1 31 | } 32 | }, 33 | "required": [ 34 | "status" 35 | ] 36 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/PublishFirmwareStatusNotificationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:PublishFirmwareStatusNotificationResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/Renegotiate15118ScheduleRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:Renegotiate15118ScheduleRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "definitions": { 6 | "EVSEType": { 7 | "javaType": "EVSE", 8 | "type": "object", 9 | "additionalProperties": true, 10 | "properties": { 11 | "id": { 12 | "type": "integer" 13 | }, 14 | "connectorId": { 15 | "type": "integer" 16 | } 17 | }, 18 | "required": [ 19 | "id" 20 | ] 21 | } 22 | }, 23 | "type": "object", 24 | "additionalProperties": true, 25 | "properties": { 26 | "evse": { 27 | "$ref": "#/definitions/EVSEType" 28 | } 29 | }, 30 | "required": [ 31 | "evse" 32 | ] 33 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/Renegotiate15118ScheduleResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:Renegotiate15118ScheduleResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ReportChargingProfilesResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ReportChargingProfilesResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/RequestStartTransactionResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:RequestStartTransactionResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected" 14 | ] 15 | }, 16 | "transactionId": { 17 | "type": "string", 18 | "maxLength": 36 19 | } 20 | }, 21 | "required": [ 22 | "status" 23 | ] 24 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/RequestStopTransactionRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:RequestStopTransactionRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "transactionId": { 9 | "type": "string", 10 | "maxLength": 36 11 | } 12 | }, 13 | "required": [ 14 | "transactionId" 15 | ] 16 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/RequestStopTransactionResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:RequestStopTransactionResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ReservationStatusUpdateRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ReservationStatusUpdateRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "reservationId": { 9 | "type": "integer" 10 | }, 11 | "reservationUpdateStatus": { 12 | "type": "string", 13 | "additionalProperties": true, 14 | "enum": [ 15 | "Expired", 16 | "Removed" 17 | ] 18 | } 19 | }, 20 | "required": [ 21 | "reservationId", 22 | "reservationUpdateStatus" 23 | ] 24 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ReservationStatusUpdateResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ReservationStatusUpdateResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ReserveNowResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ReserveNowResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Faulted", 14 | "Occupied", 15 | "Rejected", 16 | "Unavailable" 17 | ] 18 | } 19 | }, 20 | "required": [ 21 | "status" 22 | ] 23 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ResetRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ResetRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "type": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Immediate", 13 | "OnIdle" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "type" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/ResetResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:ResetResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected", 14 | "Scheduled" 15 | ] 16 | } 17 | }, 18 | "required": [ 19 | "status" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/SecurityEventNotificationRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:SecurityEventNotificationRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "type": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "FirmwareUpdated", 13 | "FailedToAuthenticateAtCsms", 14 | "CsmsFailedToAuthenticate", 15 | "SettingSystemTime", 16 | "StartupOfTheDevice", 17 | "ResetOrReboot", 18 | "SecurityLogWasCleared", 19 | "ReconfigurationOfSecurityParameters", 20 | "MemoryExhaustion", 21 | "InvalidMessages", 22 | "AttemptedReplayAttacks", 23 | "TamperDetectionActivated", 24 | "InvalidFirmwareSignature", 25 | "InvalidFirmwareSigningCertificate", 26 | "InvalidCsmsCertificate", 27 | "InvalidChargingStationCertificate", 28 | "InvalidTLSVersion", 29 | "InvalidTLSCipherSuite" 30 | ] 31 | }, 32 | "timestamp": { 33 | "type": "string", 34 | "format": "date-time" 35 | } 36 | }, 37 | "required": [ 38 | "type", 39 | "timestamp" 40 | ] 41 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/SecurityEventNotificationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:SecurityEventNotificationResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/SendLocalListResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:SendLocalListResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Failed", 14 | "VersionMismatch" 15 | ] 16 | } 17 | }, 18 | "required": [ 19 | "status" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/SetChargingProfileResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:SetChargingProfileResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/SetDisplayMessageResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:SetDisplayMessageResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "NotSupportedMessageFormat", 14 | "Rejected", 15 | "NotSupportedPriority", 16 | "NotSupportedState", 17 | "UnknownTransaction" 18 | ] 19 | } 20 | }, 21 | "required": [ 22 | "status" 23 | ] 24 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/SetMonitoringBaseRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:SetMonitoringBaseRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "monitoringBase": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "All", 13 | "FactoryDefault", 14 | "None" 15 | ] 16 | } 17 | }, 18 | "required": [ 19 | "monitoringBase" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/SetMonitoringBaseResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:SetMonitoringBaseResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected", 14 | "NotSupported" 15 | ] 16 | } 17 | }, 18 | "required": [ 19 | "status" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/SetMonitoringLevelRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:SetMonitoringLevelRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "severity": { 9 | "type": "integer" 10 | } 11 | }, 12 | "required": [ 13 | "severity" 14 | ] 15 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/SetMonitoringLevelResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:SetMonitoringLevelResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/SetNetworkProfileResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:SetNetworkProfileResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected", 14 | "Failed" 15 | ] 16 | } 17 | }, 18 | "required": [ 19 | "status" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/SignCertificateRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:SignCertificateRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "csr": { 9 | "type": "string", 10 | "maxLength": 800 11 | }, 12 | "typeOfCertificate": { 13 | "type": "string", 14 | "additionalProperties": true, 15 | "enum": [ 16 | "ChargingStationCertificate", 17 | "V2GCertificate" 18 | ] 19 | } 20 | }, 21 | "required": [ 22 | "csr" 23 | ] 24 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/SignCertificateResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:SignCertificateResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/StatusNotificationRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:StatusNotificationRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "timestamp": { 9 | "type": "string", 10 | "format": "date-time" 11 | }, 12 | "connectorStatus": { 13 | "type": "string", 14 | "additionalProperties": true, 15 | "enum": [ 16 | "Available", 17 | "Occupied", 18 | "Reserved", 19 | "Unavailable", 20 | "Faulted" 21 | ] 22 | }, 23 | "evseId": { 24 | "type": "integer" 25 | }, 26 | "connectorId": { 27 | "type": "integer" 28 | } 29 | }, 30 | "required": [ 31 | "timestamp", 32 | "connectorStatus", 33 | "evseId", 34 | "connectorId" 35 | ] 36 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/StatusNotificationResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:StatusNotificationResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true 7 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/TriggerMessageRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:TriggerMessageRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "definitions": { 6 | "MessageTriggerEnumType": { 7 | "type": "string", 8 | "additionalProperties": true, 9 | "enum": [ 10 | "BootNotification", 11 | "LogStatusNotification", 12 | "FirmwareStatusNotification", 13 | "Heartbeat", 14 | "MeterValues", 15 | "SignChargingStationCertificate", 16 | "SignV2GCertificate", 17 | "StatusNotification", 18 | "TransactionEvent" 19 | ] 20 | }, 21 | "EVSEType": { 22 | "javaType": "EVSE", 23 | "type": "object", 24 | "additionalProperties": true, 25 | "properties": { 26 | "id": { 27 | "type": "integer" 28 | }, 29 | "connectorId": { 30 | "type": "integer" 31 | } 32 | }, 33 | "required": [ 34 | "id" 35 | ] 36 | } 37 | }, 38 | "type": "object", 39 | "additionalProperties": true, 40 | "properties": { 41 | "evse": { 42 | "$ref": "#/definitions/EVSEType" 43 | }, 44 | "requestedMessage": { 45 | "$ref": "#/definitions/MessageTriggerEnumType" 46 | } 47 | }, 48 | "required": [ 49 | "requestedMessage" 50 | ] 51 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/TriggerMessageResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:TriggerMessageResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected", 14 | "NotImplemented" 15 | ] 16 | } 17 | }, 18 | "required": [ 19 | "status" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/UnlockConnectorRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:UnlockConnectorRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "evseId": { 9 | "type": "integer" 10 | }, 11 | "connectorId": { 12 | "type": "integer" 13 | } 14 | }, 15 | "required": [ 16 | "evseId", 17 | "connectorId" 18 | ] 19 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/UnlockConnectorResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:UnlockConnectorResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Unlocked", 13 | "UnlockFailed" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "status" 19 | ] 20 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/UnpublishFirmwareRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:UnpublishFirmwareRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "checksum": { 9 | "type": "string", 10 | "maxLength": 32 11 | } 12 | }, 13 | "required": [ 14 | "checksum" 15 | ] 16 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/UnpublishFirmwareResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:UnpublishFirmwareResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "DownloadOngoing", 13 | "NoFirmware", 14 | "Unpublished" 15 | ] 16 | } 17 | }, 18 | "required": [ 19 | "status" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/Update15118EVCertificateRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:Update15118EVCertificateRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "15118SchemaVersion": { 9 | "type": "string", 10 | "maxLength": 50 11 | }, 12 | "exiRequest": { 13 | "type": "string", 14 | "maxLength": 5500 15 | } 16 | }, 17 | "required": [ 18 | "15118SchemaVersion", 19 | "exiRequest" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/Update15118EVCertificateResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:Update15118EVCertificateResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Failed" 14 | ] 15 | }, 16 | "exiResponse": { 17 | "type": "string", 18 | "maxLength": 5500 19 | } 20 | }, 21 | "required": [ 22 | "status" 23 | ] 24 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/UpdateFirmwareRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:UpdateFirmwareRequest", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "definitions": { 6 | "FirmwareType": { 7 | "javaType": "Firmware", 8 | "type": "object", 9 | "additionalProperties": true, 10 | "properties": { 11 | "location": { 12 | "type": "string", 13 | "maxLength": 512 14 | }, 15 | "retrieveDateTime": { 16 | "type": "string", 17 | "format": "date-time" 18 | }, 19 | "installDateTime": { 20 | "type": "string", 21 | "format": "date-time" 22 | }, 23 | "signingCertificate": { 24 | "type": "string", 25 | "maxLength": 800 26 | }, 27 | "signature": { 28 | "type": "string", 29 | "maxLength": 800 30 | } 31 | }, 32 | "required": [ 33 | "location", 34 | "retrieveDateTime" 35 | ] 36 | } 37 | }, 38 | "type": "object", 39 | "additionalProperties": true, 40 | "properties": { 41 | "retries": { 42 | "type": "integer" 43 | }, 44 | "retryInterval": { 45 | "type": "integer" 46 | }, 47 | "requestId": { 48 | "type": "integer" 49 | }, 50 | "firmware": { 51 | "$ref": "#/definitions/FirmwareType" 52 | } 53 | }, 54 | "required": [ 55 | "requestId", 56 | "firmware" 57 | ] 58 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/resources/com/thenewmotion/ocpp/json/v20/schemas/UpdateFirmwareResponse.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "$id": "urn:OCPP:Cp:2:2018:4:UpdateFirmwareResponse", 4 | "comment": "OCPP 2.0 - v1p0", 5 | "type": "object", 6 | "additionalProperties": true, 7 | "properties": { 8 | "status": { 9 | "type": "string", 10 | "additionalProperties": true, 11 | "enum": [ 12 | "Accepted", 13 | "Rejected", 14 | "AcceptedCanceled" 15 | ] 16 | } 17 | }, 18 | "required": [ 19 | "status" 20 | ] 21 | } -------------------------------------------------------------------------------- /ocpp-json/src/test/scala/com/thenewmotion/ocpp/json/CommonGenerators.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.json 2 | 3 | import org.scalacheck.Gen 4 | import Gen._ 5 | import enums.reflection.EnumUtils.{Enumerable, Nameable} 6 | 7 | object CommonGenerators { 8 | 9 | def enumerableGen[T <: Nameable](e: Enumerable[T]): Gen[T] = 10 | oneOf(e.values.toList) 11 | 12 | def enumerableNameGen[T <: Nameable](e: Enumerable[T]): Gen[String] = enumerableGen(e).map(_.name) 13 | } 14 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/Version.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | 3 | import enums.EnumUtils.{Enumerable, Nameable} 4 | 5 | sealed trait Version extends Nameable { 6 | def family: VersionFamily 7 | } 8 | 9 | sealed trait Version1X extends Version { 10 | override val family = VersionFamily.V1X 11 | } 12 | 13 | object Version extends Enumerable[Version] { 14 | case object V12 extends Version1X { override val name = "1.2" } 15 | case object V15 extends Version1X { override val name = "1.5" } 16 | case object V16 extends Version1X { override val name = "1.6" } 17 | case object V20 extends Version { 18 | override val name = "2.0" 19 | override val family = VersionFamily.V20 20 | } 21 | 22 | val values = Set(V12, V15, V16, V20) 23 | } 24 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/Message.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.messages 2 | 3 | trait Message 4 | 5 | trait Request extends Message 6 | trait Response extends Message 7 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/ReqRes.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.messages 2 | 3 | /** 4 | * ReqRes works as a multi-parameter typeclass for associating response types to request types. That is, if an implicit 5 | * value with type ReqRes[REQ, RES] is in scope, it means that RES is the response type that belongs to a request of 6 | * type REQ. 7 | * 8 | * @tparam REQ 9 | * @tparam RES 10 | */ 11 | trait ReqRes[REQ <: Request, RES <: Response] 12 | 13 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v1x/CentralSystem.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.messages.v1x 2 | 3 | import scala.concurrent.{ExecutionContext, Future} 4 | 5 | trait CentralSystem { 6 | 7 | def authorize(req: AuthorizeReq): Future[AuthorizeRes] 8 | def startTransaction(req: StartTransactionReq): Future[StartTransactionRes] 9 | def stopTransaction(req: StopTransactionReq): Future[StopTransactionRes] 10 | def heartbeat: Future[HeartbeatRes] 11 | def meterValues(req: MeterValuesReq): Future[Unit] 12 | def bootNotification(req: BootNotificationReq): Future[BootNotificationRes] 13 | def statusNotification(req: StatusNotificationReq): Future[Unit] 14 | def firmwareStatusNotification(req: FirmwareStatusNotificationReq): Future[Unit] 15 | def diagnosticsStatusNotification(req: DiagnosticsStatusNotificationReq): Future[Unit] 16 | def dataTransfer(req: CentralSystemDataTransferReq): Future[CentralSystemDataTransferRes] 17 | 18 | def apply[REQ <: CentralSystemReq, RES <: CentralSystemRes](req: REQ)( 19 | implicit reqRes: CentralSystemReqRes[REQ, RES], 20 | ec: ExecutionContext 21 | ): Future[RES] = reqRes.applyAsync(req)(this, ec) 22 | } 23 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v1x/CentralSystemAction.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.messages.v1x 2 | 3 | import enums.reflection.EnumUtils.{Enumerable, Nameable} 4 | 5 | sealed trait CentralSystemAction extends Nameable 6 | object CentralSystemAction extends Enumerable[CentralSystemAction] { 7 | object Authorize extends CentralSystemAction 8 | object StartTransaction extends CentralSystemAction 9 | object StopTransaction extends CentralSystemAction 10 | object BootNotification extends CentralSystemAction 11 | object DiagnosticsStatusNotification extends CentralSystemAction 12 | object FirmwareStatusNotification extends CentralSystemAction 13 | object Heartbeat extends CentralSystemAction 14 | object MeterValues extends CentralSystemAction 15 | object StatusNotification extends CentralSystemAction 16 | object DataTransfer extends CentralSystemAction 17 | 18 | val values = Set( 19 | Authorize, 20 | StartTransaction, 21 | StopTransaction, 22 | BootNotification, 23 | DiagnosticsStatusNotification, 24 | FirmwareStatusNotification, 25 | Heartbeat, 26 | MeterValues, 27 | StatusNotification, 28 | DataTransfer 29 | ) 30 | } 31 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v1x/ChargePoint.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.messages.v1x 2 | 3 | import scala.concurrent.{ExecutionContext, Future} 4 | 5 | trait ChargePoint { 6 | 7 | def remoteStartTransaction(req: RemoteStartTransactionReq): Future[RemoteStartTransactionRes] 8 | def remoteStopTransaction(req: RemoteStopTransactionReq): Future[RemoteStopTransactionRes] 9 | def unlockConnector(req: UnlockConnectorReq): Future[UnlockConnectorRes] 10 | def getDiagnostics(req: GetDiagnosticsReq): Future[GetDiagnosticsRes] 11 | def changeConfiguration(req: ChangeConfigurationReq): Future[ChangeConfigurationRes] 12 | def getConfiguration(req: GetConfigurationReq): Future[GetConfigurationRes] 13 | def changeAvailability(req: ChangeAvailabilityReq): Future[ChangeAvailabilityRes] 14 | def clearCache: Future[ClearCacheRes] 15 | def reset(req: ResetReq): Future[ResetRes] 16 | def updateFirmware(req: UpdateFirmwareReq): Future[Unit] 17 | def sendLocalList(req: SendLocalListReq): Future[SendLocalListRes] 18 | def getLocalListVersion: Future[GetLocalListVersionRes] 19 | def dataTransfer(req: ChargePointDataTransferReq): Future[ChargePointDataTransferRes] 20 | def reserveNow(req: ReserveNowReq): Future[ReserveNowRes] 21 | def cancelReservation(req: CancelReservationReq): Future[CancelReservationRes] 22 | def clearChargingProfile(req: ClearChargingProfileReq): Future[ClearChargingProfileRes] 23 | def getCompositeSchedule(req: GetCompositeScheduleReq): Future[GetCompositeScheduleRes] 24 | def setChargingProfile(req: SetChargingProfileReq): Future[SetChargingProfileRes] 25 | def triggerMessage(req: TriggerMessageReq): Future[TriggerMessageRes] 26 | 27 | def apply[REQ <: ChargePointReq, RES <: ChargePointRes](req: REQ)( 28 | implicit reqRes: ChargePointReqRes[REQ, RES], 29 | ec: ExecutionContext 30 | ): Future[RES] = 31 | reqRes.applyAsync(req)(this, ec) 32 | } 33 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v1x/ChargePointAction.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.messages.v1x 2 | 3 | import enums.reflection.EnumUtils.{Enumerable, Nameable} 4 | 5 | sealed trait ChargePointAction extends Nameable 6 | object ChargePointAction extends Enumerable[ChargePointAction] { 7 | object CancelReservation extends ChargePointAction 8 | object ChangeAvailability extends ChargePointAction 9 | object ChangeConfiguration extends ChargePointAction 10 | object ClearCache extends ChargePointAction 11 | object DataTransfer extends ChargePointAction 12 | object GetConfiguration extends ChargePointAction 13 | object GetDiagnostics extends ChargePointAction 14 | object GetLocalListVersion extends ChargePointAction 15 | object RemoteStartTransaction extends ChargePointAction 16 | object RemoteStopTransaction extends ChargePointAction 17 | object ReserveNow extends ChargePointAction 18 | object Reset extends ChargePointAction 19 | object SendLocalList extends ChargePointAction 20 | object UnlockConnector extends ChargePointAction 21 | object UpdateFirmware extends ChargePointAction 22 | object SetChargingProfile extends ChargePointAction 23 | object ClearChargingProfile extends ChargePointAction 24 | object GetCompositeSchedule extends ChargePointAction 25 | object TriggerMessage extends ChargePointAction 26 | 27 | val values = Set( 28 | CancelReservation, 29 | ChangeAvailability, 30 | ChangeConfiguration, 31 | ClearCache, 32 | DataTransfer, 33 | GetConfiguration, 34 | GetDiagnostics, 35 | GetLocalListVersion, 36 | RemoteStartTransaction, 37 | RemoteStopTransaction, 38 | ReserveNow, 39 | Reset, 40 | SendLocalList, 41 | UnlockConnector, 42 | UpdateFirmware, 43 | SetChargingProfile, 44 | ClearChargingProfile, 45 | GetCompositeSchedule, 46 | TriggerMessage 47 | ) 48 | } -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v1x/ChargePointErrorCode.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.messages.v1x 2 | 3 | import enums.reflection.EnumUtils.{Enumerable, Nameable} 4 | 5 | sealed trait ChargePointErrorCode extends Nameable 6 | object ChargePointErrorCode extends Enumerable[ChargePointErrorCode] { 7 | case object ConnectorLockFailure extends ChargePointErrorCode 8 | case object HighTemperature extends ChargePointErrorCode 9 | case object EVCommunicationError extends ChargePointErrorCode // ocpp 1.6: renamed from Mode3Error 10 | case object PowerMeterFailure extends ChargePointErrorCode 11 | case object PowerSwitchFailure extends ChargePointErrorCode 12 | case object ReaderFailure extends ChargePointErrorCode 13 | case object ResetFailure extends ChargePointErrorCode 14 | case object GroundFailure extends ChargePointErrorCode // ocpp 1.5 15 | case object OverCurrentFailure extends ChargePointErrorCode 16 | case object OverVoltage extends ChargePointErrorCode // ocpp 1.6 17 | case object UnderVoltage extends ChargePointErrorCode 18 | case object WeakSignal extends ChargePointErrorCode 19 | case object InternalError extends ChargePointErrorCode // ocpp 1.6 20 | case object LocalListConflict extends ChargePointErrorCode // ocpp 1.6 21 | case object OtherError extends ChargePointErrorCode 22 | 23 | val values = Set( 24 | ConnectorLockFailure, 25 | HighTemperature, 26 | EVCommunicationError, 27 | PowerMeterFailure, 28 | PowerSwitchFailure, 29 | ReaderFailure, 30 | ResetFailure, 31 | GroundFailure, 32 | OverCurrentFailure, 33 | OverVoltage, 34 | UnderVoltage, 35 | WeakSignal, 36 | InternalError, 37 | LocalListConflict, 38 | OtherError 39 | ) 40 | } 41 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v1x/ChargePointStatus.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.messages.v1x 2 | 3 | import enums.reflection.EnumUtils.{Enumerable, Nameable} 4 | 5 | sealed trait ChargePointStatus { def info: Option[String] } 6 | object ChargePointStatus { 7 | final case class Occupied( 8 | kind: Option[OccupancyKind], // only set in ocpp 1.6 9 | info: Option[String] = None 10 | ) extends ChargePointStatus 11 | final case class Faulted( 12 | errorCode: Option[ChargePointErrorCode], 13 | info: Option[String] = None, 14 | vendorErrorCode: Option[String] 15 | ) extends ChargePointStatus 16 | final case class Available(info: Option[String] = None) extends ChargePointStatus 17 | final case class Unavailable(info: Option[String] = None) extends ChargePointStatus 18 | final case class Reserved(info: Option[String] = None) extends ChargePointStatus // since OCPP 1.5 19 | } 20 | 21 | // ocpp 1.6 22 | sealed trait OccupancyKind extends Nameable 23 | object OccupancyKind extends Enumerable[Nameable] { 24 | case object Preparing extends OccupancyKind 25 | case object Charging extends OccupancyKind 26 | case object SuspendedEVSE extends OccupancyKind 27 | case object SuspendedEV extends OccupancyKind 28 | case object Finishing extends OccupancyKind 29 | val values = Set(Preparing, Charging, SuspendedEVSE, SuspendedEV, Finishing) 30 | } 31 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v1x/DataTransferStatus.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.messages.v1x 2 | 3 | import enums.reflection.EnumUtils.{Enumerable, Nameable} 4 | 5 | sealed trait DataTransferStatus extends Nameable 6 | object DataTransferStatus extends Enumerable[DataTransferStatus] { 7 | case object Accepted extends DataTransferStatus 8 | case object Rejected extends DataTransferStatus 9 | case object UnknownMessageId extends DataTransferStatus 10 | case object UnknownVendorId extends DataTransferStatus 11 | 12 | val values = Set(Accepted, Rejected, UnknownMessageId, UnknownVendorId) 13 | } 14 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v1x/IdTagInfo.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.messages.v1x 2 | 3 | import java.time.ZonedDateTime 4 | import enums.reflection.EnumUtils.{Nameable, Enumerable} 5 | 6 | sealed trait AuthorizationStatus extends Nameable 7 | object AuthorizationStatus extends Enumerable[AuthorizationStatus] { 8 | case object Accepted extends AuthorizationStatus 9 | case object IdTagBlocked extends AuthorizationStatus { override def name = "Blocked" } 10 | case object IdTagExpired extends AuthorizationStatus { override def name = "Expired" } 11 | case object IdTagInvalid extends AuthorizationStatus { override def name = "Invalid" } 12 | case object ConcurrentTx extends AuthorizationStatus 13 | 14 | val values = Set(Accepted, IdTagBlocked, IdTagExpired, IdTagInvalid, ConcurrentTx) 15 | } 16 | 17 | case class IdTagInfo( 18 | status: AuthorizationStatus, 19 | expiryDate: Option[ZonedDateTime] = None, 20 | parentIdTag: Option[String] = None 21 | ) 22 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v1x/Scope.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.messages.v1x 2 | 3 | /** 4 | * @author Yaroslav Klymko 5 | */ 6 | sealed trait Scope 7 | case object ChargePointScope extends Scope 8 | case class ConnectorScope(id: Int) extends Scope 9 | 10 | object Scope { 11 | private[ocpp] def fromOcpp(connectorId: Int): Scope = 12 | if (connectorId <= 0) ChargePointScope else ConnectorScope.fromOcpp(connectorId) 13 | 14 | private[ocpp] implicit class RichScope(val self: Scope) extends AnyVal { 15 | def toOcpp: Int = self match { 16 | case ChargePointScope => 0 17 | case ConnectorScope(id) => id + 1 18 | } 19 | } 20 | } 21 | 22 | object ConnectorScope { 23 | private[ocpp] def fromOcpp(connectorId: Int): ConnectorScope = ConnectorScope(connectorId - 1) 24 | } 25 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v1x/SyncCentralSystem.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package messages 3 | package v1x 4 | 5 | trait SyncCentralSystem { 6 | def authorize(req: AuthorizeReq): AuthorizeRes 7 | def startTransaction(req: StartTransactionReq): StartTransactionRes 8 | def stopTransaction(req: StopTransactionReq): StopTransactionRes 9 | def heartbeat: HeartbeatRes 10 | def meterValues(req: MeterValuesReq) 11 | def bootNotification(req: BootNotificationReq): BootNotificationRes 12 | def statusNotification(req: StatusNotificationReq) 13 | def firmwareStatusNotification(req: FirmwareStatusNotificationReq) 14 | def diagnosticsStatusNotification(req: DiagnosticsStatusNotificationReq) 15 | def dataTransfer(req: CentralSystemDataTransferReq): CentralSystemDataTransferRes 16 | 17 | def apply[REQ <: CentralSystemReq, RES <: CentralSystemRes](req: REQ)(implicit reqRes: CentralSystemReqRes[REQ, RES]): RES = reqRes(req)(this) 18 | } 19 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v1x/SyncChargePoint.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package messages 3 | package v1x 4 | 5 | trait SyncChargePoint { 6 | def remoteStartTransaction(req: RemoteStartTransactionReq): RemoteStartTransactionRes 7 | def remoteStopTransaction(req: RemoteStopTransactionReq): RemoteStopTransactionRes 8 | def unlockConnector(req: UnlockConnectorReq): UnlockConnectorRes 9 | def getDiagnostics(req: GetDiagnosticsReq): GetDiagnosticsRes 10 | def changeConfiguration(req: ChangeConfigurationReq): ChangeConfigurationRes 11 | def getConfiguration(req: GetConfigurationReq): GetConfigurationRes 12 | def changeAvailability(req: ChangeAvailabilityReq): ChangeAvailabilityRes 13 | def clearCache: ClearCacheRes 14 | def reset(req: ResetReq): ResetRes 15 | def updateFirmware(req: UpdateFirmwareReq) 16 | def sendLocalList(req: SendLocalListReq): SendLocalListRes 17 | def getLocalListVersion: GetLocalListVersionRes 18 | def dataTransfer(req: ChargePointDataTransferReq): ChargePointDataTransferRes 19 | def reserveNow(req: ReserveNowReq): ReserveNowRes 20 | def cancelReservation(req: CancelReservationReq): CancelReservationRes 21 | def clearChargingProfile(req: ClearChargingProfileReq): ClearChargingProfileRes 22 | def getCompositeSchedule(req: GetCompositeScheduleReq): GetCompositeScheduleRes 23 | def setChargingProfile(req: SetChargingProfileReq): SetChargingProfileRes 24 | def triggerMessage(req: TriggerMessageReq): TriggerMessageRes 25 | 26 | def apply[REQ <: ChargePointReq, RES <: ChargePointRes](req: REQ)(implicit reqRes: ChargePointReqRes[REQ, RES]): RES = reqRes(req)(this) 27 | } 28 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v1x/v1x.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package messages 3 | 4 | package object v1x extends v1x.ReqResInstances { 5 | type IdTag = String 6 | } 7 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v20/Authorization.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package messages 3 | package v20 4 | 5 | import enums.reflection.EnumUtils.{Enumerable, Nameable} 6 | 7 | case class AuthorizeRequest( 8 | evseId: Option[List[Int]], 9 | idToken: IdToken, 10 | `15118CertificateHashData`: Option[List[OCSPRequestData]] 11 | ) extends CsmsRequest 12 | 13 | case class OCSPRequestData( 14 | hashAlgorithm: HashAlgorithm, 15 | issuerNameHash: String, 16 | issuerKeyHash: String, 17 | serialNumber: String, 18 | responderURL: Option[String] 19 | ) 20 | 21 | sealed trait HashAlgorithm extends Nameable 22 | object HashAlgorithm extends Enumerable[HashAlgorithm] { 23 | case object SHA256 extends HashAlgorithm 24 | case object SHA384 extends HashAlgorithm 25 | case object SHA512 extends HashAlgorithm 26 | 27 | val values = List(SHA256, SHA384, SHA512) 28 | } 29 | 30 | case class AuthorizeResponse( 31 | certificateStatus: Option[CertificateStatus], 32 | evseId: Option[List[Int]], 33 | idTokenInfo: IdTokenInfo 34 | ) extends CsmsResponse 35 | 36 | sealed trait CertificateStatus extends Nameable 37 | object CertificateStatus extends Enumerable[CertificateStatus] { 38 | case object Accepted extends CertificateStatus 39 | case object SignatureError extends CertificateStatus 40 | case object CertificateExpired extends CertificateStatus 41 | case object CertificateRevoked extends CertificateStatus 42 | case object NoCertificateAvailable extends CertificateStatus 43 | case object CertChainError extends CertificateStatus 44 | case object ContractCancelled extends CertificateStatus 45 | 46 | val values = List( 47 | Accepted, 48 | SignatureError, 49 | CertificateExpired, 50 | CertificateRevoked, 51 | NoCertificateAvailable, 52 | CertChainError, 53 | ContractCancelled 54 | ) 55 | } 56 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v20/Availability.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package messages 3 | package v20 4 | 5 | import java.time.Instant 6 | 7 | import enums.reflection.EnumUtils.{Enumerable, Nameable} 8 | 9 | case class HeartbeatRequest() extends CsmsRequest 10 | 11 | case class HeartbeatResponse( 12 | currentTime: Instant 13 | ) extends CsmsResponse 14 | 15 | case class StatusNotificationRequest( 16 | timestamp: Instant, 17 | connectorStatus: ConnectorStatus, 18 | evseId: Int, 19 | connectorId: Int 20 | ) extends CsmsRequest 21 | 22 | sealed trait ConnectorStatus extends Nameable 23 | object ConnectorStatus extends Enumerable[ConnectorStatus] { 24 | case object Available extends ConnectorStatus 25 | case object Occupied extends ConnectorStatus 26 | case object Reserved extends ConnectorStatus 27 | case object Unavailable extends ConnectorStatus 28 | case object Faulted extends ConnectorStatus 29 | 30 | val values = List( 31 | Available, 32 | Occupied, 33 | Reserved, 34 | Unavailable, 35 | Faulted 36 | ) 37 | } 38 | 39 | case class StatusNotificationResponse() extends CsmsResponse 40 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v20/LocalAuthorizationListManagement.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp.messages.v20 2 | 3 | import enums.reflection.EnumUtils.{Enumerable, Nameable} 4 | 5 | case class SendLocalListRequest( 6 | versionNumber: Int, 7 | updateType: Update, 8 | localAuthorizationData: AuthorizationData 9 | ) extends CsRequest 10 | 11 | sealed trait Update extends Nameable 12 | object Update extends Enumerable[Update] { 13 | case object Differential extends Update 14 | case object Full extends Update 15 | 16 | val values = List(Differential, Full) 17 | } 18 | 19 | case class AuthorizationData( 20 | idTokenInfo: IdTokenInfo, 21 | idToken: IdToken 22 | ) 23 | 24 | case class SendLocalListResponse( 25 | status: UpdateStatus 26 | ) extends CsResponse 27 | 28 | sealed trait UpdateStatus extends Nameable 29 | object UpdateStatus extends Enumerable[UpdateStatus] { 30 | case object Accepted extends UpdateStatus 31 | case object Failed extends UpdateStatus 32 | case object VersionMismatch extends UpdateStatus 33 | 34 | val values = List(Accepted, Failed, VersionMismatch) 35 | } -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v20/Message.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package messages 3 | package v20 4 | 5 | trait Message extends messages.Message 6 | 7 | trait Request extends Message with messages.Request 8 | trait Response extends Message with messages.Response 9 | 10 | trait CsRequest extends Request 11 | trait CsResponse extends Response 12 | trait CsmsRequest extends Request 13 | trait CsmsResponse extends Response 14 | 15 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/com/thenewmotion/ocpp/messages/v20/ReqRes.scala: -------------------------------------------------------------------------------- 1 | package com.thenewmotion.ocpp 2 | package messages 3 | package v20 4 | 5 | abstract class CsReqRes [REQ <: CsRequest , RES <: CsResponse ] extends ReqRes[REQ, RES] 6 | 7 | abstract class CsmsReqRes[REQ <: CsmsRequest, RES <: CsmsResponse] extends ReqRes[REQ, RES] 8 | 9 | object CsReqRes { 10 | implicit object GetBaseReportReqRes extends CsReqRes[GetBaseReportRequest , GetBaseReportResponse ] 11 | implicit object GetTransactionStatusReqRes extends CsReqRes[GetTransactionStatusRequest , GetTransactionStatusResponse ] 12 | implicit object GetVariablesReqRes extends CsReqRes[GetVariablesRequest , GetVariablesResponse ] 13 | implicit object RequestStartTransactionReqRes extends CsReqRes[RequestStartTransactionRequest, RequestStartTransactionResponse] 14 | implicit object RequestStopTransactionReqRes extends CsReqRes[RequestStopTransactionRequest , RequestStopTransactionResponse ] 15 | implicit object SendLocalListReqRes extends CsReqRes[SendLocalListRequest , SendLocalListResponse ] 16 | implicit object SetVariablesReqRes extends CsReqRes[SetVariablesRequest , SetVariablesResponse ] 17 | } 18 | 19 | object CsmsReqRes { 20 | implicit object AuthorizeReqRes extends CsmsReqRes[AuthorizeRequest , AuthorizeResponse ] 21 | implicit object BootNotificationReqRes extends CsmsReqRes[BootNotificationRequest , BootNotificationResponse ] 22 | implicit object HeartbeatReqRes extends CsmsReqRes[HeartbeatRequest , HeartbeatResponse ] 23 | implicit object NotifyReportReqRes extends CsmsReqRes[NotifyReportRequest , NotifyReportResponse ] 24 | implicit object StatusNotificationReqRes extends CsmsReqRes[StatusNotificationRequest, StatusNotificationResponse] 25 | implicit object TransactionEventReqRes extends CsmsReqRes[TransactionEventRequest , TransactionEventResponse ] 26 | } 27 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/enums/EnumUtils.scala: -------------------------------------------------------------------------------- 1 | package enums 2 | 3 | 4 | object EnumUtils { 5 | trait Nameable { 6 | def name: String 7 | } 8 | trait Enumerable[T <: Nameable] { 9 | def values: Iterable[T] 10 | def withName(name: String): Option[T] = values.find(_.name == name) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ocpp-messages/src/main/scala/enums/reflection/EnumUtils.scala: -------------------------------------------------------------------------------- 1 | package enums.reflection 2 | 3 | /** 4 | * This version of the enum utils can 5 | * only be used in top-level definitions, 6 | * otherwise the reflective .getSimpleName 7 | * call throws an exception. 8 | */ 9 | object EnumUtils { 10 | 11 | trait Nameable { 12 | def name: String = this.getClass.getSimpleName 13 | .replaceAll("minus", "-").replaceAll("\\$", "")} 14 | 15 | trait Enumerable[T <: Nameable] { 16 | def values: Iterable[T] 17 | def withName(name: String): Option[T] = values.find(_.name == name) 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.3.5 2 | -------------------------------------------------------------------------------- /project/plugins.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") 2 | 3 | addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.7") 4 | 5 | addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.4.2") 6 | 7 | addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.10") 8 | addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") 9 | 10 | addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0") 11 | -------------------------------------------------------------------------------- /version.sbt: -------------------------------------------------------------------------------- 1 | ThisBuild / version := "9.2.5-SNAPSHOT" 2 | --------------------------------------------------------------------------------