@@ -473,7 +473,7 @@ void DeRestPluginPrivate::handleZclConfigureReportingResponseIndication(const de
473
473
continue ;
474
474
}
475
475
476
- DBG_Printf (DBG_INFO, " ZCL configure reporting rsp seq: %u 0x%016llX for cluster 0x%04X attr 0x%04X status 0x%02X\n " , zclFrame.sequenceNumber (), ind.srcAddress ().ext (), ind.clusterId (), val.attributeId , status);
476
+ DBG_Printf (DBG_INFO, " ZCL configure reporting rsp seq: %u 0x%016llX for ep: 0x%02X cluster: 0x%04X attr: 0x%04X status: 0x%02X\n " , zclFrame.sequenceNumber (), ind.srcAddress ().ext (), ind. srcEndpoint (), ind.clusterId (), val.attributeId , status);
477
477
478
478
// mark as succefully configured
479
479
if (status == deCONZ::ZclSuccessStatus)
@@ -496,10 +496,10 @@ void DeRestPluginPrivate::handleZclConfigureReportingResponseIndication(const de
496
496
stream >> direction;
497
497
stream >> attrId;
498
498
499
- NodeValue &val = restNode->getZclValue (ind.clusterId (), attrId);
499
+ NodeValue &val = restNode->getZclValue (ind.clusterId (), attrId, ind. srcEndpoint () );
500
500
if (val.zclSeqNum == zclFrame.sequenceNumber () && val.clusterId == ind.clusterId ())
501
501
{
502
- DBG_Printf (DBG_INFO, " ZCL configure reporting rsp seq: %u 0x%016llX for cluster 0x%04X attr 0x%04X status 0x%02X\n " , zclFrame.sequenceNumber (), ind.srcAddress ().ext (), ind.clusterId (), val.attributeId , status);
502
+ DBG_Printf (DBG_INFO, " ZCL configure reporting rsp seq: %u 0x%016llX for ep: 0x%02X cluster: 0x%04X attr: 0x%04X status: 0x%02X\n " , zclFrame.sequenceNumber (), ind.srcAddress ().ext (), ind. srcEndpoint (), ind.clusterId (), val.attributeId , status);
503
503
504
504
if (status == deCONZ::ZclSuccessStatus)
505
505
{
@@ -550,7 +550,7 @@ void DeRestPluginPrivate::handleBindAndUnbindRspIndication(const deCONZ::ApsData
550
550
551
551
if (status == deCONZ::ZdpSuccess)
552
552
{
553
- DBG_Printf (DBG_INFO, " %s response success for 0x%016llx cluster 0x%04X\n " , what, i->binding .srcAddress , i->binding .clusterId );
553
+ DBG_Printf (DBG_INFO, " %s response success for 0x%016llx ep: 0x%02X cluster: 0x%04X\n " , what, i->binding .srcAddress , i-> binding . srcEndpoint , i->binding .clusterId );
554
554
if (ind.clusterId () == ZDP_BIND_RSP_CLID)
555
555
{
556
556
if (sendConfigureReportingRequest (*i))
@@ -561,7 +561,7 @@ void DeRestPluginPrivate::handleBindAndUnbindRspIndication(const deCONZ::ApsData
561
561
}
562
562
else
563
563
{
564
- DBG_Printf (DBG_INFO, " %s response failed with status 0x%02X for 0x%016llx cluster 0x%04X\n " , what, status, i->binding .srcAddress , i->binding .clusterId );
564
+ DBG_Printf (DBG_INFO, " %s response failed with status 0x%02X for 0x%016llx ep: 0x%02X cluster: 0x%04X\n " , what, status, i->binding .srcAddress , i-> binding . srcEndpoint , i->binding .clusterId );
565
565
}
566
566
567
567
i->state = BindingTask::StateFinished;
@@ -692,7 +692,7 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt, const s
692
692
693
693
for (const ConfigureReportingRequest &rq : requests)
694
694
{
695
- NodeValue &val = bt.restNode ->getZclValue (bt.binding .clusterId , rq.attributeId );
695
+ NodeValue &val = bt.restNode ->getZclValue (bt.binding .clusterId , rq.attributeId , bt. binding . srcEndpoint );
696
696
if (val.clusterId == bt.binding .clusterId )
697
697
{
698
698
// value exists
@@ -727,7 +727,7 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt, const s
727
727
// values doesn't exist, create
728
728
deCONZ::NumericUnion dummy;
729
729
dummy.u64 = 0 ;
730
- bt.restNode ->setZclValue (NodeValue::UpdateByZclReport, bt.binding .clusterId , rq.attributeId , dummy);
730
+ bt.restNode ->setZclValue (NodeValue::UpdateByZclReport, bt.binding .srcEndpoint , bt. binding . clusterId , rq.attributeId , dummy);
731
731
val.zclSeqNum = zclSeqNum;
732
732
val.minInterval = rq.minInterval ;
733
733
val.maxInterval = rq.maxInterval ;
@@ -860,9 +860,9 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
860
860
// add values if not already present
861
861
deCONZ::NumericUnion dummy;
862
862
dummy.u64 = 0 ;
863
- if (bt.restNode ->getZclValue (bt.binding .clusterId , 0x0000 ).clusterId != bt.binding .clusterId )
863
+ if (bt.restNode ->getZclValue (bt.binding .clusterId , 0x0000 , bt. binding . srcEndpoint ).clusterId != bt.binding .clusterId )
864
864
{
865
- bt.restNode ->setZclValue (NodeValue::UpdateInvalid, bt.binding .clusterId , 0x0000 , dummy);
865
+ bt.restNode ->setZclValue (NodeValue::UpdateInvalid, bt.binding .srcEndpoint , bt. binding . clusterId , 0x0000 , dummy);
866
866
}
867
867
868
868
rq.dataType = deCONZ::Zcl8BitBitMap;
@@ -879,9 +879,9 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
879
879
const Sensor *sensor = static_cast <Sensor *>(bt.restNode );
880
880
if (sensor && sensor->modelId ().startsWith (QLatin1String (" SML00" ))) // Hue motion sensor
881
881
{
882
- if (bt.restNode ->getZclValue (bt.binding .clusterId , 0x0030 ).clusterId != bt.binding .clusterId )
882
+ if (bt.restNode ->getZclValue (bt.binding .clusterId , 0x0030 , bt. binding . srcEndpoint ).clusterId != bt.binding .clusterId )
883
883
{
884
- bt.restNode ->setZclValue (NodeValue::UpdateInvalid, bt.binding .clusterId , 0x0030 , dummy);
884
+ bt.restNode ->setZclValue (NodeValue::UpdateInvalid, bt.binding .srcEndpoint , bt. binding . clusterId , 0x0030 , dummy);
885
885
}
886
886
ConfigureReportingRequest rq2;
887
887
rq2.dataType = deCONZ::Zcl8BitUint;
@@ -911,9 +911,9 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
911
911
// add values if not already present
912
912
deCONZ::NumericUnion dummy;
913
913
dummy.u64 = 0 ;
914
- if (bt.restNode ->getZclValue (bt.binding .clusterId , IAS_ZONE_CLUSTER_ATTR_ZONE_STATUS_ID).clusterId != bt.binding .clusterId )
914
+ if (bt.restNode ->getZclValue (bt.binding .clusterId , IAS_ZONE_CLUSTER_ATTR_ZONE_STATUS_ID, bt. binding . srcEndpoint ).clusterId != bt.binding .clusterId )
915
915
{
916
- bt.restNode ->setZclValue (NodeValue::UpdateInvalid, bt.binding .clusterId , IAS_ZONE_CLUSTER_ATTR_ZONE_STATUS_ID, dummy);
916
+ bt.restNode ->setZclValue (NodeValue::UpdateInvalid, bt.binding .srcEndpoint , bt. binding . clusterId , IAS_ZONE_CLUSTER_ATTR_ZONE_STATUS_ID, dummy);
917
917
}
918
918
rq.minInterval = 1 ;
919
919
rq.maxInterval = 300 ;
@@ -1166,12 +1166,12 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
1166
1166
// add values if not already present
1167
1167
deCONZ::NumericUnion dummy;
1168
1168
dummy.u64 = 0 ;
1169
- if (bt.restNode ->getZclValue (POWER_CONFIGURATION_CLUSTER_ID, rq.attributeId ).attributeId != rq.attributeId )
1169
+ if (bt.restNode ->getZclValue (POWER_CONFIGURATION_CLUSTER_ID, rq.attributeId , bt. binding . srcEndpoint ).attributeId != rq.attributeId )
1170
1170
{
1171
- bt.restNode ->setZclValue (NodeValue::UpdateInvalid, POWER_CONFIGURATION_CLUSTER_ID, rq.attributeId , dummy);
1171
+ bt.restNode ->setZclValue (NodeValue::UpdateInvalid, bt. binding . srcEndpoint , POWER_CONFIGURATION_CLUSTER_ID, rq.attributeId , dummy);
1172
1172
}
1173
1173
1174
- NodeValue &val = bt.restNode ->getZclValue (POWER_CONFIGURATION_CLUSTER_ID, rq.attributeId );
1174
+ NodeValue &val = bt.restNode ->getZclValue (POWER_CONFIGURATION_CLUSTER_ID, rq.attributeId , bt. binding . srcEndpoint );
1175
1175
1176
1176
if (val.timestampLastReport .isValid () && (val.timestampLastReport .secsTo (now) < val.maxInterval * 1.5 ))
1177
1177
{
@@ -1441,17 +1441,17 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
1441
1441
deCONZ::NumericUnion dummy;
1442
1442
dummy.u64 = 0 ;
1443
1443
// add usertest value if not already present
1444
- if (bt.restNode ->getZclValue (BASIC_CLUSTER_ID, 0x0032 ).attributeId != 0x0032 )
1444
+ if (bt.restNode ->getZclValue (BASIC_CLUSTER_ID, 0x0032 , bt. binding . srcEndpoint ).attributeId != 0x0032 )
1445
1445
{
1446
- bt.restNode ->setZclValue (NodeValue::UpdateInvalid, BASIC_CLUSTER_ID, 0x0032 , dummy);
1446
+ bt.restNode ->setZclValue (NodeValue::UpdateInvalid, bt. binding . srcEndpoint , BASIC_CLUSTER_ID, 0x0032 , dummy);
1447
1447
}
1448
1448
// ledindication value if not already present
1449
- if (bt.restNode ->getZclValue (BASIC_CLUSTER_ID, 0x0033 ).attributeId != 0x0033 )
1449
+ if (bt.restNode ->getZclValue (BASIC_CLUSTER_ID, 0x0033 , bt. binding . srcEndpoint ).attributeId != 0x0033 )
1450
1450
{
1451
- bt.restNode ->setZclValue (NodeValue::UpdateInvalid, BASIC_CLUSTER_ID, 0x0033 , dummy);
1451
+ bt.restNode ->setZclValue (NodeValue::UpdateInvalid, bt. binding . srcEndpoint , BASIC_CLUSTER_ID, 0x0033 , dummy);
1452
1452
}
1453
1453
1454
- NodeValue &val = bt.restNode ->getZclValue (BASIC_CLUSTER_ID, 0x0032 );
1454
+ NodeValue &val = bt.restNode ->getZclValue (BASIC_CLUSTER_ID, 0x0032 , bt. binding . srcEndpoint );
1455
1455
1456
1456
if (val.timestampLastReport .isValid () && (val.timestampLastReport .secsTo (now) < val.maxInterval * 1.5 ))
1457
1457
{
@@ -1485,12 +1485,12 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
1485
1485
deCONZ::NumericUnion dummy;
1486
1486
dummy.u64 = 0 ;
1487
1487
// 'sw build id' value if not already present
1488
- if (bt.restNode ->getZclValue (BASIC_CLUSTER_ID, 0x4000 ).attributeId != 0x4000 )
1488
+ if (bt.restNode ->getZclValue (BASIC_CLUSTER_ID, 0x4000 , bt. binding . srcEndpoint ).attributeId != 0x4000 )
1489
1489
{
1490
- bt.restNode ->setZclValue (NodeValue::UpdateInvalid, BASIC_CLUSTER_ID, 0x4000 , dummy);
1490
+ bt.restNode ->setZclValue (NodeValue::UpdateInvalid, bt. binding . srcEndpoint , BASIC_CLUSTER_ID, 0x4000 , dummy);
1491
1491
}
1492
1492
1493
- NodeValue &val = bt.restNode ->getZclValue (BASIC_CLUSTER_ID, 0x4000 );
1493
+ NodeValue &val = bt.restNode ->getZclValue (BASIC_CLUSTER_ID, 0x4000 , bt. binding . srcEndpoint );
1494
1494
1495
1495
if (val.timestampLastReport .isValid () && (val.timestampLastReport .secsTo (now) < val.maxInterval * 1.5 ))
1496
1496
{
@@ -1521,8 +1521,8 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
1521
1521
val.u64 = 0 ;
1522
1522
1523
1523
// mark button event binding as resolved
1524
- sensor->setZclValue (NodeValue::UpdateByZclReport, VENDOR_CLUSTER_ID, 0x0000 , val);
1525
- NodeValue &val2 = bt.restNode ->getZclValue (VENDOR_CLUSTER_ID, 0x0000 );
1524
+ sensor->setZclValue (NodeValue::UpdateByZclReport, bt. binding . srcEndpoint , VENDOR_CLUSTER_ID, 0x0000 , val);
1525
+ NodeValue &val2 = bt.restNode ->getZclValue (VENDOR_CLUSTER_ID, 0x0000 , bt. binding . srcEndpoint );
1526
1526
if (val2.maxInterval == 0 )
1527
1527
{
1528
1528
val2.maxInterval = 60 * 60 * 8 ; // prevent further check for 8 hours
@@ -2111,13 +2111,13 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
2111
2111
if (val.timestampLastReport .isValid () &&
2112
2112
val.timestampLastReport .secsTo (now) < maxInterval) // got update in timely manner
2113
2113
{
2114
- DBG_Printf (DBG_INFO_L2, " binding for attribute reporting of cluster 0x%04X seems to be active\n " , (*i) );
2114
+ DBG_Printf (DBG_INFO_L2, " binding for attribute reporting of ep: 0x%02X cluster 0x%04X seems to be active\n " , val. endpoint , *i );
2115
2115
continue ;
2116
2116
}
2117
2117
2118
2118
if (!sensor->node ()->nodeDescriptor ().receiverOnWhenIdle () && sensor->lastRx ().secsTo (now) > 3 )
2119
2119
{
2120
- DBG_Printf (DBG_INFO, " skip binding for attribute reporting of cluster 0x%04X (end-device might sleep)\n " , (*i) );
2120
+ DBG_Printf (DBG_INFO, " skip binding for attribute reporting of ep: 0x%02X cluster 0x%04X (end-device might sleep)\n " , val. endpoint , *i );
2121
2121
return false ;
2122
2122
}
2123
2123
0 commit comments