-
Notifications
You must be signed in to change notification settings - Fork 112
RpcApi: add new JSON RPC API module #1324
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
base: main
Are you sure you want to change the base?
Conversation
acd8932
to
9dc9ae4
Compare
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.
just a first quick review, I haven't look into it in detail yet
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.
Discovery of json-rpc-cxx in non-EDM builds (e.g. Yocto) is broken.
This is pending a fix.
Fixed. |
modules/API/RpcApi/tools/python-client-gui/everest-json-rpc-websocket-client.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Fabian Hartung <[email protected]> Signed-off-by: Moritz Barsnick <[email protected]> Co-authored-by: Fabian Hartung <[email protected]> Co-authored-by: Moritz Barsnick <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
…tocol_to_charge_protocol function Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
As changed in the merged PR #1319. Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Add a Findjson-rpc-cxx.cmake for non-EDM builds. The target_include_directories() directive needs to be different for EDM and non-EDM (Yocto) builds for the header-only json-rpc-cxx. Also remove json-rpc-cxx from target_link_libraries(), as it is header-only. Signed-off-by: Moritz Barsnick <[email protected]>
…figuration from YAML files Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Introduce a little bit more consistency. Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Only listen on all interfaces if explicitly asked via config "all". Do not accept an empty string. Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
… flag EVSE index 0 is reserved for the charger itself and should not be used to set/clear the EVSE error present flag. In the future, we might want to introduce a charger error present flag. Signed-off-by: Fabian Hartung <[email protected]>
… storage Signed-off-by: Fabian Hartung <[email protected]>
… on session start Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
In case charging is already paused, it is not necessary to set the current limit to 0. The current limit is only set to 0 if it is necessary to prevent charging. Signed-off-by: Fabian Hartung <[email protected]>
…nd charging is not allowed Signed-off-by: Fabian Hartung <[email protected]>
Added a wait_for_current_limit_applied method to the EVSEStatusStore to allow waiting for the requested current limit to be applied with a timeout. This allows correct error reporting if the limit could not be applied in time. The timeout is set to 5 seconds in the RpcApiRequestHandler.cpp. Signed-off-by: Fabian Hartung <[email protected]>
…_current case Signed-off-by: Fabian Hartung <[email protected]>
6ac26d4
to
f6d5ae4
Compare
…ts when applying phase count Signed-off-by: Fabian Hartung <[email protected]>
This library is required for the RpcApi module from everest-core PR EVerest/everest-core#1324. Also provide a minimal json-rpc-cxxConfig.cmake with INTERFACE target for the header-only library. This allows CMake to resolve and include the json-rpc-cxx target using find_package(json-rpc-cxx REQUIRED). Signed-off-by: Fabian Hartung <[email protected]> Signed-off-by: Moritz Barsnick <[email protected]> Co-authored-by: Fabian Hartung <[email protected]>
Describe your changes
This introduces a new API module RpcApi, which uses JSON RPC, and WebSockets as a transport layer.
It uses both RPC Methods and Notifications.
This is the implementation according to the proposal with was discussed here on Zulip and documented here. The original proposal what slightly modified, as several details proved inconsistent, impractical, or just mis-specified.
Documentation of the current state of implementation is included in the module's
docs/
subdirectory. The current (or the final merged) state will be manifested as API version 1.0.0. Future updates to the external API definition will require version bumps.A Python GUI test client is included under
modules/API/RpcApi/tools/python-client-gui/
.Not implemented in the current state of the API:
This will be added later, with corresponding bumps of the API version (where applicable).
A non-squashed version of this work is found in the branch feature/json-rpc-api-nosquash. for reference regarding small change steps, commit messages with motivations, and so on.
Co-authored-by: Fabian Hartung [email protected]
Co-authored-by: Moritz Barsnick [email protected]
Issue ticket number and link
Checklist before requesting a review