24
24
#include " BindingHandler.h"
25
25
#include " Globals.h"
26
26
27
+ #include < DeviceInfoProviderImpl.h>
27
28
#include < app-common/zap-generated/attributes/Accessors.h>
28
29
#include < app/TestEventTriggerDelegate.h>
29
30
#include < app/clusters/general-diagnostics-server/GenericFaultTestEventTriggerHandler.h>
32
33
#include < app/clusters/ota-requestor/OTATestEventTriggerHandler.h>
33
34
#include < app/server/Dnssd.h>
34
35
#include < app/server/Server.h>
35
- #include < data-model-providers/codegen/Instance.h>
36
-
36
+ #include < app/util/attribute-storage.h>
37
37
#include < credentials/DeviceAttestationCredsProvider.h>
38
38
#include < credentials/examples/DeviceAttestationCredsExample.h>
39
-
39
+ # include < data-model-providers/codegen/Instance.h >
40
40
#include < inet/EndPointStateOpenThread.h>
41
-
42
- #include < DeviceInfoProviderImpl.h>
43
41
#include < setup_payload/OnboardingCodesUtil.h>
44
42
#include < setup_payload/QRCodeSetupPayloadGenerator.h>
45
43
#include < setup_payload/SetupPayload.h>
@@ -62,6 +60,7 @@ using namespace ::chip::app;
62
60
using namespace ::chip::TLV;
63
61
using namespace ::chip::Credentials;
64
62
using namespace ::chip::DeviceLayer;
63
+ using namespace app ::Clusters::Descriptor::Structs;
65
64
66
65
#include < platform/CHIPDeviceLayer.h>
67
66
@@ -79,6 +78,62 @@ using namespace ::chip::DeviceLayer;
79
78
80
79
namespace {
81
80
81
+ #if (CONFIG_1_TO_2_ZAP || CONFIG_1_TO_8_ZAP || CONFIG_1_TO_12_ZAP)
82
+
83
+ // Switches Namespace: 0x43, tag 0x08 (Custom)
84
+ constexpr const uint8_t kNamespaceSwitches = 0x43 ;
85
+ constexpr const uint8_t kTagCustom = 0x08 ;
86
+
87
+ const SemanticTagStruct::Type switch1TagList[] = { { .namespaceID = kNamespaceSwitches ,
88
+ .tag = kTagCustom ,
89
+ .label = chip::Optional<chip::app::DataModel::Nullable<chip::CharSpan>>(
90
+ { chip::app::DataModel::MakeNullable (chip::CharSpan (" Switch1" , 7 )) }) } };
91
+ const SemanticTagStruct::Type switch2TagList[] = { { .namespaceID = kNamespaceSwitches ,
92
+ .tag = kTagCustom ,
93
+ .label = Optional<DataModel::Nullable<CharSpan>>(
94
+ DataModel::MakeNullable (CharSpan (" Switch2" , 7 ))) } };
95
+ const SemanticTagStruct::Type switch3TagList[] = { { .namespaceID = kNamespaceSwitches ,
96
+ .tag = kTagCustom ,
97
+ .label = Optional<DataModel::Nullable<CharSpan>>(
98
+ DataModel::MakeNullable (CharSpan (" Switch3" , 7 ))) } };
99
+ const SemanticTagStruct::Type switch4TagList[] = { { .namespaceID = kNamespaceSwitches ,
100
+ .tag = kTagCustom ,
101
+ .label = Optional<DataModel::Nullable<CharSpan>>(
102
+ DataModel::MakeNullable (CharSpan (" Switch4" , 7 ))) } };
103
+ const SemanticTagStruct::Type switch5TagList[] = { { .namespaceID = kNamespaceSwitches ,
104
+ .tag = kTagCustom ,
105
+ .label = Optional<DataModel::Nullable<CharSpan>>(
106
+ DataModel::MakeNullable (CharSpan (" Switch5" , 7 ))) } };
107
+ const SemanticTagStruct::Type switch6TagList[] = { { .namespaceID = kNamespaceSwitches ,
108
+ .tag = kTagCustom ,
109
+ .label = Optional<DataModel::Nullable<CharSpan>>(
110
+ DataModel::MakeNullable (CharSpan (" Switch6" , 7 ))) } };
111
+ const SemanticTagStruct::Type switch7TagList[] = { { .namespaceID = kNamespaceSwitches ,
112
+ .tag = kTagCustom ,
113
+ .label = Optional<DataModel::Nullable<CharSpan>>(
114
+ DataModel::MakeNullable (CharSpan (" Switch7" , 7 ))) } };
115
+ const SemanticTagStruct::Type switch8TagList[] = { { .namespaceID = kNamespaceSwitches ,
116
+ .tag = kTagCustom ,
117
+ .label = Optional<DataModel::Nullable<CharSpan>>(
118
+ DataModel::MakeNullable (CharSpan (" Switch8" , 7 ))) } };
119
+ const SemanticTagStruct::Type switch9TagList[] = { { .namespaceID = kNamespaceSwitches ,
120
+ .tag = kTagCustom ,
121
+ .label = Optional<DataModel::Nullable<CharSpan>>(
122
+ DataModel::MakeNullable (CharSpan (" Switch9" , 7 ))) } };
123
+ const SemanticTagStruct::Type switch11TagList[] = { { .namespaceID = kNamespaceSwitches ,
124
+ .tag = kTagCustom ,
125
+ .label = Optional<DataModel::Nullable<CharSpan>>(
126
+ DataModel::MakeNullable (CharSpan (" Switch11" , 8 ))) } };
127
+ const SemanticTagStruct::Type switch12TagList[] = { { .namespaceID = kNamespaceSwitches ,
128
+ .tag = kTagCustom ,
129
+ .label = Optional<DataModel::Nullable<CharSpan>>(
130
+ DataModel::MakeNullable (CharSpan (" Switch12" , 8 ))) } };
131
+ const SemanticTagStruct::Type switch13TagList[] = { { .namespaceID = kNamespaceSwitches ,
132
+ .tag = kTagCustom ,
133
+ .label = Optional<DataModel::Nullable<CharSpan>>(
134
+ DataModel::MakeNullable (CharSpan (" Switch13" , 8 ))) } };
135
+ #endif
136
+
82
137
static DeviceCallbacks EchoCallbacks;
83
138
84
139
TaskHandle_t sAppTaskHandle ;
@@ -231,6 +286,8 @@ void AppTask::InitServer(intptr_t arg)
231
286
232
287
chip::Server::GetInstance ().Init (initParams);
233
288
289
+ InitTag ();
290
+
234
291
ConfigurationMgr ().LogDeviceConfig ();
235
292
PrintOnboardingCodes (chip::RendezvousInformationFlags (chip::RendezvousInformationFlag::kBLE ));
236
293
}
@@ -493,3 +550,36 @@ void AppTask::DispatchEvent(AppEvent * aEvent)
493
550
* Update cluster status after application level changes
494
551
*/
495
552
void AppTask::UpdateClusterState (void ) {}
553
+
554
+ void AppTask::InitTag ()
555
+ {
556
+ #if CONFIG_DEFAULT_ZAP
557
+ #elif CONFIG_1_TO_2_ZAP
558
+ SetTagList (1 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch1TagList));
559
+ SetTagList (2 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch2TagList));
560
+ SetTagList (3 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch3TagList));
561
+ #elif CONFIG_1_TO_8_ZAP
562
+ SetTagList (1 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch1TagList));
563
+ SetTagList (2 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch2TagList));
564
+ SetTagList (3 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch3TagList));
565
+ SetTagList (4 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch4TagList));
566
+ SetTagList (5 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch5TagList));
567
+ SetTagList (6 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch6TagList));
568
+ SetTagList (7 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch7TagList));
569
+ SetTagList (8 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch8TagList));
570
+ SetTagList (9 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch9TagList));
571
+ #elif CONFIG_1_TO_11_ZAP
572
+ SetTagList (1 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch1TagList));
573
+ SetTagList (2 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch2TagList));
574
+ SetTagList (3 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch3TagList));
575
+ SetTagList (4 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch4TagList));
576
+ SetTagList (5 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch5TagList));
577
+ SetTagList (6 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch6TagList));
578
+ SetTagList (7 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch7TagList));
579
+ SetTagList (8 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch8TagList));
580
+ SetTagList (9 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch9TagList));
581
+ SetTagList (11 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch11TagList));
582
+ SetTagList (12 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch12TagList));
583
+ SetTagList (13 , Span<const Clusters::Descriptor::Structs::SemanticTagStruct::Type>(switch13TagList));
584
+ #endif
585
+ }
0 commit comments