-
Notifications
You must be signed in to change notification settings - Fork 92
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
Feature/powermeter interface adaptions #347
Conversation
703097f
to
8b8f78a
Compare
switch cable id and tariff ids to integer; add start and stop transaction responses Signed-off-by: Fabian Klemm <[email protected]>
Signed-off-by: Fabian Klemm <[email protected]>
Signed-off-by: Fabian Klemm <[email protected]>
Signed-off-by: Fabian Klemm <[email protected]>
Signed-off-by: Fabian Klemm <[email protected]>
Signed-off-by: Fabian Klemm <[email protected]>
2d50437
to
4b766f9
Compare
Signed-off-by: Fabian Klemm <[email protected]>
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.
Looks good, just some minor things!
types/powermeter.yaml
Outdated
additionalProperties: false | ||
required: | ||
- status | ||
- transaction_id |
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.
transaction_id is required but not defined
std::string powermeterImpl::handle_stop_transaction(std::string& transaction_id) { | ||
return "NOT_SUPPORTED"; | ||
types::powermeter::TransactionStopResponse powermeterImpl::handle_stop_transaction(std::string& transaction_id) { | ||
return {.status = types::powermeter::TransactionRequestStatus::NOT_SUPPORTED, |
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.
The designated initializers for structs (the dot notation) is valid C99 afaik but not in C++17 (it was added in C++20 I think). GCC supports a lot of C99 while compiling C++ but this may not be portable when using other compilers
return true; | ||
types::powermeter::TransactionStartResponse | ||
powermeterImpl::handle_start_transaction(types::powermeter::TransactionReq& value) { | ||
return {.status = types::powermeter::TransactionRequestStatus::OK}; |
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.
see comment below about designated inits
@@ -45,18 +45,20 @@ std::string powermeterImpl::handle_stop_transaction(std::string& transaction_id) | |||
|
|||
bsm::SignedOCMFSnapshot signed_snapshot(data); | |||
|
|||
return signed_snapshot.O(); | |||
return {.status = types::powermeter::TransactionRequestStatus::OK, .ocmf = signed_snapshot.O()}; |
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.
see below
return false; | ||
types::powermeter::TransactionStartResponse | ||
powermeterImpl::handle_start_transaction(types::powermeter::TransactionReq& value) { | ||
return {.status = types::powermeter::TransactionRequestStatus::NOT_SUPPORTED, |
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.
see below
std::string powermeterImpl::handle_stop_transaction(std::string& transaction_id) { | ||
return "NOT_SUPPORTED"; | ||
types::powermeter::TransactionStopResponse powermeterImpl::handle_stop_transaction(std::string& transaction_id) { | ||
return {.status = types::powermeter::TransactionRequestStatus::NOT_SUPPORTED, |
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.
see below
return false; | ||
types::powermeter::TransactionStartResponse | ||
powermeterImpl::handle_start_transaction(types::powermeter::TransactionReq& value) { | ||
return {.status = types::powermeter::TransactionRequestStatus::NOT_SUPPORTED, |
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.
see below
std::string powermeterImpl::handle_stop_transaction(std::string& transaction_id) { | ||
return "NOT_SUPPORTED"; | ||
types::powermeter::TransactionStopResponse powermeterImpl::handle_stop_transaction(std::string& transaction_id) { | ||
return {.status = types::powermeter::TransactionRequestStatus::NOT_SUPPORTED, |
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.
see below
Signed-off-by: Fabian Klemm <[email protected]>
Signed-off-by: Fabian Klemm <[email protected]>
Signed-off-by: Fabian Klemm <[email protected]>
@corneliusclaussen : thx for the review! I applied everything you mentioned. There is a final eslint complaint about unused variables; however, that is a common thing in the |
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.
Please squash into single commit with proper description of the changes before merging
Adjusts the Powermeter Interface and types:
Follow up adaptions of the mopdules