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

E04-offline transactions #173

Merged
merged 7 commits into from
Sep 18, 2023
Merged

E04-offline transactions #173

merged 7 commits into from
Sep 18, 2023

Conversation

SNSubramanya
Copy link
Contributor

E04.FR.03

Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com>
Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com>
Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com>
Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com>
@@ -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) {
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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..

Copy link
Contributor

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 <s.subramanya@alfen.com>
Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com>
Signed-off-by: Soumya Subramanya <s.subramanya@alfen.com>
@SNSubramanya SNSubramanya merged commit 5dc53c8 into main Sep 18, 2023
3 checks passed
@SNSubramanya SNSubramanya deleted the E04-offline-transactions branch September 18, 2023 15:00
bWF0dGhpYXMK pushed a commit to bWF0dGhpYXMK/libocpp that referenced this pull request Sep 27, 2023
Add an offline flag for all transaction related messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants