Skip to content
Snippets Groups Projects
Commit 210fc7f6 authored by Grigoris Pavlakis's avatar Grigoris Pavlakis
Browse files

Update ParameterService source and test to use resetRead() instead of the...

Update ParameterService source and test to use resetRead() instead of the hackier msg.readPosition = 0 and fix some formatting
parent f4b1e76d
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ struct Parameter {
};
/**
* Parameter manager
* Parameter manager - ST[20]
* Holds the list with the parameters and provides functions
* for parameter reporting and modification.
*
......
......@@ -73,7 +73,7 @@ Message ParameterService::reportParameterIds(Message paramIds) {
reqParam.appendUint32(paramsList[currId].settingData);
} else {
// generate failure of execution notification for ST[06]
// generate failure of execution notification for ST[06]
continue; //ignore the invalid ID
}
}
......@@ -110,7 +110,7 @@ void ParameterService::setParameterIds(Message newParamValues) {
paramsList[currId].settingData = newParamValues.readUint32();
} else {
// generate failure of execution notification for ST[06]
// generate failure of execution notification for ST[06]
continue; // ignore the invalid ID
}
}
......@@ -119,7 +119,7 @@ void ParameterService::setParameterIds(Message newParamValues) {
uint16_t ParameterService::numOfValidIds(Message idMsg) {
idMsg.readPosition = 0;
idMsg.resetRead();
// start reading from the beginning of the idMsg object
// (original obj. will not be influenced if this is called by value)
......
......@@ -20,7 +20,7 @@ TEST_CASE("Parameter Report Subservice") {
request.appendUint16(3); // valid
report = pserv.reportParameterIds(request);
request.readPosition = 0;
request.resetRead();
uint16_t repIdCount = report.readUint16();
uint16_t reqIdCount = request.readUint16();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment