Skip to content

Commit

Permalink
Merge pull request #4857 from manup/master
Browse files Browse the repository at this point in the history
Fix 0xA6 APS errors due false srcEndpoint selection
  • Loading branch information
manup authored May 10, 2021
2 parents 2052ff9 + 9e6f960 commit 4bc324a
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18063,19 +18063,31 @@ uint8_t DeRestPluginPrivate::endpoint()
return haEndpoint;
}

if (!apsCtrl)
{
return 1;
}

const deCONZ::Node *node;

if (apsCtrl && apsCtrl->getNode(0, &node) == 0)
const auto coordMac = apsCtrl->getParameter(deCONZ::ParamMacAddress);

int i = 0;
while (apsCtrl->getNode(i, &node) == 0)
{
std::vector<uint8_t> eps = node->endpoints();
i++;

std::vector<uint8_t>::const_iterator i = eps.begin();
std::vector<uint8_t>::const_iterator end = eps.end();
if (node->address().ext() != coordMac)
{
continue;
}

for (; i != end; ++i)
const auto eps = node->endpoints();

for (quint8 ep : eps)
{
deCONZ::SimpleDescriptor sd;
if (node->copySimpleDescriptor(*i, &sd) == 0)
if (node->copySimpleDescriptor(ep, &sd) == 0)
{
if (sd.profileId() == HA_PROFILE_ID)
{
Expand Down

0 comments on commit 4bc324a

Please sign in to comment.