1
0
Fork 0

formatting cleanup

This commit is contained in:
Kevin Matz 2023-04-27 09:23:56 -04:00
parent 08ca66fcb3
commit 7fffc6d0dd
1 changed files with 10 additions and 20 deletions

View File

@ -555,12 +555,10 @@ void Device::actionGetProductDetailIdList(const MsgPtr message, MsgPtr response)
response->responseType = RESPONSE_TYPE_ACK;
if (product_detail_list_.empty())
{
response->appendData(PRODUCT_DETAIL_NOT_DECLARED);
return;
}
for ( uint16_t detail : product_detail_list_ )
response->appendData(detail);
response->appendData(PRODUCT_DETAIL_NOT_DECLARED);
else
for (const auto detail : product_detail_list_)
response->appendData(detail);
}
@ -575,12 +573,8 @@ void Device::actionGetDevModelDescription(const MsgPtr message, MsgPtr response)
return;
response->responseType = RESPONSE_TYPE_ACK;
for (size_t i = 0; i < deviceModelDescription.size(); i++)
{
if (i > 32)
break;
response->appendData(deviceModelDescription.at(i));
}
for (size_t i = 0; i < deviceModelDescription.size() && i <= 32; i++)
response->appendData(deviceModelDescription.at(i));
}
@ -617,7 +611,7 @@ void Device::actionGetLanguage(const MsgPtr message, MsgPtr response)
response->responseType = RESPONSE_TYPE_ACK;
std::string label = std::string("en");
for (char& c : label)
for (const auto c : label)
response->appendData(c);
}
@ -633,7 +627,7 @@ void Device::actionSetLanguage(const MsgPtr message, MsgPtr response)
return;
std::string s;
for ( char c : *message->data())
for (char c : *message->data())
s += c;
if (s != "en")
@ -658,12 +652,8 @@ void Device::actionGetSoftwareVersionLabel(const MsgPtr message, MsgPtr response
response->responseType = RESPONSE_TYPE_ACK;
std::string label = std::string(LIB_VERSION_LABEL);
for (size_t i = 0; i < label.size(); i++)
{
if (i > 32)
break;
response->appendData(label.at(i));
}
for (size_t i = 0; i < label.size() && i <= 32; i++)
response->appendData(label.at(i));
}