16
16
#include " resource.h"
17
17
#include " zcl/zcl.h"
18
18
19
+
20
+ #define CMD_ID_ANY 0x100
19
21
#define TIME_CLUSTER_ID 0x000A
20
22
21
23
#define TIME_ATTRID_TIME 0x0000
@@ -199,8 +201,16 @@ static ZCL_Param getZclParam(const QVariantMap ¶m)
199
201
200
202
if (param.contains (QLatin1String (" cmd" ))) // optional
201
203
{
202
- result.commandId = variantToUint (param[" cmd" ], UINT8_MAX, &ok);
203
- result.hasCommandId = ok ? 1 : 0 ;
204
+ if (param[" cmd" ].toString () == QLatin1String (" any" ))
205
+ {
206
+ result.commandId = CMD_ID_ANY;
207
+ result.hasCommandId = 1 ;
208
+ }
209
+ else
210
+ {
211
+ result.commandId = variantToUint (param[" cmd" ], UINT32_MAX, &ok);
212
+ result.hasCommandId = ok ? 1 : 0 ;
213
+ }
204
214
}
205
215
else
206
216
{
@@ -525,9 +535,16 @@ bool parseZclAttribute(Resource *r, ResourceItem *item, const deCONZ::ApsDataInd
525
535
return result;
526
536
}
527
537
528
- if (param.hasCommandId && param. commandId != zclFrame. commandId () )
538
+ if (param.hasCommandId )
529
539
{
530
- return result;
540
+ if (param.commandId == CMD_ID_ANY)
541
+ {
542
+
543
+ }
544
+ else if (param.commandId != zclFrame.commandId ())
545
+ {
546
+ return result;
547
+ }
531
548
}
532
549
else if (!param.hasCommandId && param.attributeCount == 0 )
533
550
{
@@ -564,7 +581,10 @@ bool parseZclAttribute(Resource *r, ResourceItem *item, const deCONZ::ApsDataInd
564
581
return result;
565
582
}
566
583
567
- if (!zclParam.hasCommandId && zclFrame.commandId () != deCONZ::ZclReadAttributesResponseId && zclFrame.commandId () != deCONZ::ZclReportAttributesId)
584
+ if (!zclParam.hasCommandId &&
585
+ zclFrame.isProfileWideCommand () &&
586
+ zclFrame.commandId () != deCONZ::ZclReadAttributesResponseId &&
587
+ zclFrame.commandId () != deCONZ::ZclReportAttributesId)
568
588
{
569
589
return result;
570
590
}
@@ -581,9 +601,16 @@ bool parseZclAttribute(Resource *r, ResourceItem *item, const deCONZ::ApsDataInd
581
601
582
602
if (zclParam.attributeCount == 0 ) // attributes are optional
583
603
{
584
- if (zclParam.hasCommandId && zclParam. commandId != zclFrame. commandId () )
604
+ if (zclParam.hasCommandId )
585
605
{
586
- return result;
606
+ if (zclParam.commandId == CMD_ID_ANY)
607
+ {
608
+
609
+ }
610
+ else if (zclParam.commandId != zclFrame.commandId ())
611
+ {
612
+ return result;
613
+ }
587
614
}
588
615
589
616
if (evalZclFrame (r, item, ind, zclFrame, parseParameters))
0 commit comments