ocpp icon indicating copy to clipboard operation
ocpp copied to clipboard

Handle Charge Point response

Open gianmarcoodorizzi opened this issue 4 years ago • 1 comments

Hello,

as far as I managed to understand, the provided ExampleServerTestApp waits for incoming requests from a charge point (e.g.: a BootNotificationReq) and responds with a suitable response (a BootNotificationRes). These are all requests generated by the CS, while responses are generated by the CP. What is missing, though, is the ability to handle responses from a charge point, e.g.: the central system sends a UnlockConnectorReq and it should accept and parse the received UnlockConnectorRes. I've been trying to add this functionality, but I had no success. The fact that Scala is completely new to me is not helping.

Can someone be so kind to provide a hint on how to manage CP repsonses?

Thank you in advance.

gianmarcoodorizzi avatar Sep 24 '21 09:09 gianmarcoodorizzi

These are all requests generated by the CS, while responses are generated by the CP.

It's vice versa. The function you return from handleConnection is supposed to handle requests coming from a CP to the CS.

What is missing, though, is the ability to handle responses from a charge point

In ExampleServerTestApp, you can actually see an example of how to send a request to a CP and handle a response from it.

conn.send(...) returns a Future of a response:

Schermafbeelding 2021-09-25 om 10 50 13

Are you familiar with Future?

azolotko avatar Sep 25 '21 08:09 azolotko