Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: NPE on message interception SendStopTransaction when there is no active transaction #8

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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\"}",
Expand Down
Loading