Skip to content

Conversation

@cienporcien
Copy link
Contributor

Describe your changes

Add SessionSetup to EV side state machine

Issue ticket number and link

#138

Checklist before requesting a review

  • [ x] I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • [ x] I read the contribution documentation and made sure that my changes meet its requirements

Copy link
Member

@SebaLukas SebaLukas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check my comments.

Plus for the session_setup state:

At the moment, it is sufficient if the EV does not support pause/resume.
Pause/resume can be added relatively easily afterwards.

I have roughly written down how I imagine the process in this state:

  1. Check ResponseCode -> Evse old session joined or OK_NewSession
  2. Check session id -> like validate_and_setup_header() in https://github.com/EVerest/libiso15118/blob/main/src/iso15118/d20/context_helper.cpp#L30
  3. Check if the chargers wants to join an old session with the response code and not with the ctx session session_id
    -> Check Cert session id hash
  4. Create Req
    -> AuthSetupReq or
    -> Ac/DcChargeParameterDiscovery

Comment on lines +118 to +123
if (not charger_cert_hash.has_value()) {
logf_error(
"No charger certificate hash available although an old session was resumed. Abort the session.");
m_ctx.stop_session(true); // Tell stack to close the tcp/tls connection
return {};
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case the ev can also go to AuthSetup and treat this as a new session

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn´t clear to me in the standard.
image
From this it appears that the session should be terminated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the standard mean terminating the old session. And starting a new one.
I think in this case the ev should start a new session. The charger should handle this.

@SebaLukas
Copy link
Member

I have roughly written down how I imagine the process in this state:

  1. Check ResponseCode -> Evse old session joined or OK_NewSession
  2. Check session id -> like validate_and_setup_header() in https://github.com/EVerest/libiso15118/blob/main/src/iso15118/d20/context_helper.cpp#L30
  3. Check if the chargers wants to join an old session with the response code and not with the ctx session session_id
    -> Check Cert session id hash
  4. Create Req
    -> AuthSetupReq or
    -> Ac/DcChargeParameterDiscovery

@cienporcien Did you check my last reply?

@SebaLukas SebaLukas linked an issue Oct 31, 2025 that may be closed by this pull request
@cienporcien
Copy link
Contributor Author

I have roughly written down how I imagine the process in this state:

  1. Check ResponseCode -> Evse old session joined or OK_NewSession
  2. Check session id -> like validate_and_setup_header() in https://github.com/EVerest/libiso15118/blob/main/src/iso15118/d20/context_helper.cpp#L30
  3. Check if the chargers wants to join an old session with the response code and not with the ctx session session_id
    -> Check Cert session id hash
  4. Create Req
    -> AuthSetupReq or
    -> Ac/DcChargeParameterDiscovery

@cienporcien Did you check my last reply?

Hi Sebastian,
Sorry, I didn´t read this carefully enougn. I have made the change to use the response code instead of the ctx session_id.

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.

SessionSetup state implementation

2 participants