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

Sort Sources attribute in power source configuration cluster based on order of the power source cluster #17840

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
second attempt to fix conversion error
fessehaeve committed May 4, 2022
commit 6419b4652ed6b92febf1c69c2db7af283cca7855
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ CHIP_ERROR PowerSourceConfigurationAttrAccess::Read(const ConcreteReadAttributeP
}

std::qsort(orderEpPair, idx / 2, sizeof(uint16_t) * 2, compareOrder);
for (uint8_t i = 0; i < idx; i += 2U)
for (uint8_t i = 0; i < idx; i += (uint8_t) 2)
{
ReturnErrorOnFailure(encoder.Encode((uint16_t) orderEpPair[i + 1]));
}