diff --git a/README.md b/README.md index 2dc6591..96a5980 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,18 @@ If you're just using the terminal, you can run the following command: ./gradlew run v201:run ``` +## What's up with the 🤓? + +Clicking the icon gives access to "message interception". The primary purpose is to have a high degree of control over which messages +are sent and received by the charge point. That way it is possible to replicate potentially buggy behavior or custom implementations in +a one-off manner without needing to change the actual programming of the charge point. For "normal operation" of the charge point the +standard interface should be sufficient. + +Also note that the message interception functions are not hooked up to the internal machinery of the charge point. For example, sending +a `StopTransaction` message will not actually change the state of an ongoing charge to be stopped. That means using these functions +also makes it very easy to put the charge point into a state that does not match up with what the CSMS is expecting, which can quickly +lead to unexpected behavior. + ## Executables If you only care about running the application you can find the latest release on diff --git a/v16/src/jvmMain/kotlin/com/monta/ocpp/emulator/interceptor/view/SendMessageWindow.kt b/v16/src/jvmMain/kotlin/com/monta/ocpp/emulator/interceptor/view/SendMessageWindow.kt index 4be9f8f..7b78cf7 100644 --- a/v16/src/jvmMain/kotlin/com/monta/ocpp/emulator/interceptor/view/SendMessageWindow.kt +++ b/v16/src/jvmMain/kotlin/com/monta/ocpp/emulator/interceptor/view/SendMessageWindow.kt @@ -314,7 +314,7 @@ fun defaultPayload(messageType: Feature): String { transactionId = transaction?.id?.value?.toInt() ?: 0, transactionData = listOf( MeterValue( - timestamp = transaction!!.startTime.atZone(ZoneOffset.UTC), + timestamp = transaction?.startTime?.atZone(ZoneOffset.UTC), sampledValue = listOf( SampledValue( value = "OCMF|{\"FV\":\"1.0\",\"GI\":\"7cc7af6f-5c10-4f2f-aa95-b3570606b564\",\"GS\":\"\",\"GV\":\"1.1.2\",\"PG\":\"T74\",\"MV\":\"Gossen Metrawatt\",\"MM\":\"EM2289\",\"MS\":\"FI7309540155\",\"MF\":\"03.03\",\"IS\":true,\"IT\":\"ISO14443\",\"ID\":\"04340fca3c6f80\",\"RD\":[{\"TM\":\"2023-01-20T22:12:40,000+0100 I\",\"TX\":\"B\",\"RV\":166841,\"RI\":\"1-b:1.8.0\",\"RU\":\"Wh\",\"RT\":\"AC\",\"EF\":\"\",\"ST\":\"G\"}]}|{\"SD\":\"304402201B26AB8E9EA9A55CEAADE226713B92AD2DAF6189FC36472DF4E82EB577BC1D09022034521C01EF03E7A1A2F48820357AE7E77BD87975AF393FC4362419B79321D876\"}",