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

B06:- Get variables requests #218

Merged
merged 10 commits into from
Oct 26, 2023
Merged

B06:- Get variables requests #218

merged 10 commits into from
Oct 26, 2023

Conversation

SNSubramanya
Copy link
Contributor

Returns a rejected as a response to get variable request for write only variables

@SNSubramanya SNSubramanya marked this pull request as ready for review October 18, 2023 12:27
@@ -112,6 +113,12 @@ GetVariableStatusEnum DeviceModel::request_value(const Component& component_id,
return GetVariableStatusEnum::NotSupportedAttributeType;
}

// only internal functions can access WriteOnly variables
if (attribute_opt.value().mutability.has_value() && !allow_write_only &&
Copy link
Contributor

@marcemmers marcemmers Oct 18, 2023

Choose a reason for hiding this comment

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

Slight nitpick but I normally prefer the simple bool comparison values up front before the longer checks:

Suggested change
if (attribute_opt.value().mutability.has_value() && !allow_write_only &&
if (!allow_write_only && attribute_opt.value().mutability.has_value() &&

Edit: Also they use and instead of &&

@SNSubramanya SNSubramanya marked this pull request as draft October 19, 2023 05:56
@SNSubramanya SNSubramanya changed the title B06.FR.09: Get WriteOnly variables B06:- Get variables requests Oct 19, 2023
@SNSubramanya SNSubramanya marked this pull request as ready for review October 20, 2023 11:06
@@ -719,9 +719,9 @@ void ChargePoint::handle_message(const EnhancedMessage<v201::MessageType>& messa

void ChargePoint::message_callback(const std::string& message) {
auto enhanced_message = this->message_queue->receive(message);
enhanced_message.message_size = message.size();
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering if we would like to do this assignment in the queue itself so 1.6 can use it as well.

Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
…sts a WriteOnly value

Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>

fix formatting

Signed-off-by: Soumya Subramanya <[email protected]>
Signed-off-by: Soumya Subramanya <[email protected]>
@SNSubramanya SNSubramanya force-pushed the B06-WriteOnly-Variables branch from 9eab486 to e102ee5 Compare October 26, 2023 05:16
@SNSubramanya SNSubramanya merged commit a133941 into main Oct 26, 2023
2 of 3 checks passed
@SNSubramanya SNSubramanya deleted the B06-WriteOnly-Variables branch October 26, 2023 05:26
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.

2 participants