-
Notifications
You must be signed in to change notification settings - Fork 57
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
E04-offline transactions #173
Conversation
Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
14c22d2
to
206141e
Compare
Signed-off-by: Soumya Subramanya <[email protected]>
lib/ocpp/v201/charge_point.cpp
Outdated
@@ -218,8 +229,13 @@ void ChargePoint::on_transaction_finished(const int32_t evse_id, const DateTime& | |||
id_token_opt = _id_token; | |||
} | |||
|
|||
std::optional<bool> offline; | |||
if (this->websocket_connection_status == WebsocketConnectionStatusEnum::Disconnected) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would put this into a separate function because this is the same code 6 times. We could also change the signature of transaction_event_req to not take a std::optional but just a bool instead and always report true or false in every TransactionEvent.req message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also considered changing the signature, but from what i understand from the specs , only flags with "true" are generally reported and this flag is false by default so i left it optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand to are also allowed to set it to false in case you are online..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My 2 cents on this: Only send the offline
value if we were offline and otherwise omit it. All the functionality is there and it saves a bit of data, even if its a minor amount.
You could indeed change it to a bool in transaction_event_req and do the omitting in that function.
Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
Add an offline flag for all transaction related messages
E04.FR.03