Line data Source code
1 : /*
2 : *
3 : * Copyright (c) 2021-2024 Project CHIP Authors
4 : * All rights reserved.
5 : *
6 : * Licensed under the Apache License, Version 2.0 (the "License");
7 : * you may not use this file except in compliance with the License.
8 : * You may obtain a copy of the License at
9 : *
10 : * http://www.apache.org/licenses/LICENSE-2.0
11 : *
12 : * Unless required by applicable law or agreed to in writing, software
13 : * distributed under the License is distributed on an "AS IS" BASIS,
14 : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 : * See the License for the specific language governing permissions and
16 : * limitations under the License.
17 : */
18 :
19 : #pragma once
20 : #include <app-common/zap-generated/cluster-objects.h>
21 : #include <app/AttributePathParams.h>
22 : #include <app/ClusterStateCache.h>
23 : #include <app/OperationalSessionSetup.h>
24 : #include <controller/CommissioneeDeviceProxy.h>
25 : #if CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC
26 : #include <controller/jcm/TrustVerification.h> // nogncheck
27 : #endif // CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC
28 : #include <credentials/attestation_verifier/DeviceAttestationDelegate.h>
29 : #include <credentials/attestation_verifier/DeviceAttestationVerifier.h>
30 : #include <crypto/CHIPCryptoPAL.h>
31 : #include <lib/support/Span.h>
32 : #include <lib/support/Variant.h>
33 : #include <matter/tracing/build_config.h>
34 : #include <system/SystemClock.h>
35 :
36 : namespace chip {
37 : namespace Controller {
38 :
39 : class DeviceCommissioner;
40 :
41 : enum CommissioningStage : uint8_t
42 : {
43 : kError,
44 : kSecurePairing, ///< Establish a PASE session with the device
45 : kReadCommissioningInfo, ///< Query Attributes relevant to commissioning (can perform multiple read interactions)
46 : kArmFailsafe, ///< Send ArmFailSafe (0x30:0) command to the device
47 : kConfigRegulatory, ///< Send SetRegulatoryConfig (0x30:2) command to the device
48 : kConfigureUTCTime, ///< SetUTCTime if the DUT has a time cluster
49 : kConfigureTimeZone, ///< Configure a time zone if one is required and available
50 : kConfigureDSTOffset, ///< Configure DST offset if one is required and available
51 : kConfigureDefaultNTP, ///< Configure a default NTP server if one is required and available
52 : kSendPAICertificateRequest, ///< Send PAI CertificateChainRequest (0x3E:2) command to the device
53 : kSendDACCertificateRequest, ///< Send DAC CertificateChainRequest (0x3E:2) command to the device
54 : kSendAttestationRequest, ///< Send AttestationRequest (0x3E:0) command to the device
55 : kAttestationVerification, ///< Verify AttestationResponse (0x3E:1) validity
56 : kAttestationRevocationCheck, ///< Verify Revocation Status of device's DAC chain
57 : kJCMTrustVerification, ///< Perform JCM trust verification steps
58 : kSendOpCertSigningRequest, ///< Send CSRRequest (0x3E:4) command to the device
59 : kValidateCSR, ///< Verify CSRResponse (0x3E:5) validity
60 : kGenerateNOCChain, ///< TLV encode Node Operational Credentials (NOC) chain certs
61 : kSendTrustedRootCert, ///< Send AddTrustedRootCertificate (0x3E:11) command to the device
62 : kSendNOC, ///< Send AddNOC (0x3E:6) command to the device
63 : kConfigureTrustedTimeSource, ///< Configure a trusted time source if one is required and available (must be done after SendNOC)
64 : kICDGetRegistrationInfo, ///< Waiting for the higher layer to provide ICD registration informations.
65 : kICDRegistration, ///< Register for ICD management
66 :
67 : // NOTE: If any new steps are added between kWiFiNetworkSetup and kICDSendStayActive, double-check
68 : // whether the logic in AutoCommissioner::CommissioningStepFinished that checks for "network
69 : // failure" conditions still makes sense.
70 : kWiFiNetworkSetup, ///< Send AddOrUpdateWiFiNetwork (0x31:2) command to the device
71 : kThreadNetworkSetup, ///< Send AddOrUpdateThreadNetwork (0x31:3) command to the device
72 : kFailsafeBeforeWiFiEnable, ///< Extend the fail-safe before doing kWiFiNetworkEnable
73 : kFailsafeBeforeThreadEnable, ///< Extend the fail-safe before doing kThreadNetworkEnable
74 : kWiFiNetworkEnable, ///< Send ConnectNetwork (0x31:6) command to the device for the WiFi network
75 : kThreadNetworkEnable, ///< Send ConnectNetwork (0x31:6) command to the device for the Thread network
76 : kEvictPreviousCaseSessions, ///< Evict previous stale case sessions from a commissioned device with this node ID before
77 : kFindOperationalForStayActive, ///< Perform operational discovery and establish a CASE session with the device for ICD
78 : ///< StayActive command
79 : kFindOperationalForCommissioningComplete, ///< Perform operational discovery and establish a CASE session with the device for
80 : ///< Commissioning Complete command
81 : kSendComplete, ///< Send CommissioningComplete (0x30:4) command to the device
82 : kICDSendStayActive, ///< Send Keep Alive to ICD
83 : // NOTE: If any new steps are added between kWiFiNetworkSetup and kICDSendStayActive, double-check
84 : // whether the logic in AutoCommissioner::CommissioningStepFinished that checks for "network
85 : // failure" conditions still makes sense.
86 :
87 : /// Send ScanNetworks (0x31:0) command to the device.
88 : /// ScanNetworks can happen anytime after kArmFailsafe.
89 : kScanNetworks,
90 : /// Waiting for the higher layer to provide network credentials before continuing the workflow.
91 : /// Call CHIPDeviceController::NetworkCredentialsReady() when CommissioningParameters is populated with
92 : /// network credentials to use in kWiFiNetworkSetup or kThreadNetworkSetup steps.
93 : kNeedsNetworkCreds,
94 : kPrimaryOperationalNetworkFailed, ///< Indicate that the primary operational network (on root endpoint) failed, should remove
95 : ///< the primary network config later.
96 : kRemoveWiFiNetworkConfig, ///< Remove Wi-Fi network config.
97 : kRemoveThreadNetworkConfig, ///< Remove Thread network config.
98 : kConfigureTCAcknowledgments, ///< Send SetTCAcknowledgements (0x30:6) command to the device
99 : kRequestWiFiCredentials, ///< Wi-Fi credentials are needed; ask for those.
100 : kRequestThreadCredentials, ///< Thread credentials are needed; ask for those.
101 : kCleanup, ///< Call delegates with status, free memory, clear timers and state.
102 : #if CHIP_DEVICE_CONFIG_ENABLE_NFC_BASED_COMMISSIONING
103 : kUnpoweredPhaseComplete, ///< Commissioning completed until connect network for unpowered commissioning (NFC)
104 : #endif
105 : };
106 :
107 : enum class ICDRegistrationStrategy : uint8_t
108 : {
109 : kIgnore, ///< Do not check whether the device is an ICD during commissioning
110 : kBeforeComplete, ///< Do commissioner self-registration or external controller registration,
111 : ///< Controller should provide a ICDKey manager for generating symmetric key
112 : };
113 :
114 : const char * StageToString(CommissioningStage stage);
115 :
116 : #if MATTER_TRACING_ENABLED
117 : const char * MetricKeyForCommissioningStage(CommissioningStage stage);
118 : #endif
119 :
120 : struct WiFiCredentials
121 : {
122 : ByteSpan ssid;
123 : ByteSpan credentials;
124 13 : WiFiCredentials(ByteSpan newSsid, ByteSpan newCreds) : ssid(newSsid), credentials(newCreds) {}
125 : };
126 :
127 : struct TermsAndConditionsAcknowledgement
128 : {
129 : uint16_t acceptedTermsAndConditions;
130 : uint16_t acceptedTermsAndConditionsVersion;
131 : };
132 :
133 : struct NOCChainGenerationParameters
134 : {
135 : ByteSpan nocsrElements;
136 : ByteSpan signature;
137 : };
138 :
139 : struct CompletionStatus
140 : {
141 85 : CompletionStatus() : err(CHIP_NO_ERROR), failedStage(NullOptional), attestationResult(NullOptional) {}
142 : CHIP_ERROR err;
143 : Optional<CommissioningStage> failedStage;
144 : Optional<Credentials::AttestationVerificationResult> attestationResult;
145 : Optional<app::Clusters::GeneralCommissioning::CommissioningErrorEnum> commissioningError;
146 : Optional<app::Clusters::NetworkCommissioning::NetworkCommissioningStatusEnum> networkCommissioningStatus;
147 : };
148 :
149 : inline constexpr uint16_t kDefaultFailsafeTimeout = 60;
150 :
151 : // Per spec, all commands that are sent with the failsafe armed need at least
152 : // a 30s timeout.
153 : inline constexpr System::Clock::Timeout kMinimumCommissioningStepTimeout = System::Clock::Seconds16(30);
154 :
155 : class CommissioningParameters
156 : {
157 : public:
158 : static constexpr size_t kMaxThreadDatasetLen = 254;
159 : static constexpr size_t kMaxSsidLen = 32;
160 : static constexpr size_t kMaxCredentialsLen = 64;
161 : static constexpr size_t kMaxCountryCodeLen = 2;
162 :
163 : // Value to use when setting the commissioning failsafe timer on the node being commissioned.
164 : // If the failsafe timer value is passed in as part of the commissioning parameters, that value will be used. If not supplied,
165 : // the AutoCommissioner will set this to the recommended value read from the node. If that is not set, it will fall back to the
166 : // default kDefaultFailsafeTimeout.
167 : // This value should be set before running PerformCommissioningStep for the kArmFailsafe step.
168 2 : const Optional<uint16_t> GetFailsafeTimerSeconds() const { return mFailsafeTimerSeconds; }
169 :
170 : // Value to use when re-setting the commissioning failsafe timer immediately prior to operational discovery.
171 : // If a CASE failsafe timer value is passed in as part of the commissioning parameters, then the failsafe timer
172 : // will be reset using this value before operational discovery begins. If not supplied, then the AutoCommissioner
173 : // will not automatically reset the failsafe timer before operational discovery begins. It can be useful for the
174 : // commissioner to set the CASE failsafe timer to a small value (ex. 30s) when the regular failsafe timer is set
175 : // to a larger value to accommodate user interaction during setup (network credential selection, user consent
176 : // after device attestation).
177 3 : const Optional<uint16_t> GetCASEFailsafeTimerSeconds() const { return mCASEFailsafeTimerSeconds; }
178 :
179 : // The location (indoor/outdoor) of the node being commissioned.
180 : // The node regulartory location (indoor/outdoor) should be set by the commissioner explicitly as it may be different than the
181 : // location of the commissioner. This location will be set on the node if the node supports configurable regulatory location
182 : // (from GetLocationCapability - see below). If the regulatory location is not supplied, this will fall back to the location in
183 : // GetDefaultRegulatoryLocation and then to Outdoor (most restrictive).
184 : // This value should be set before calling PerformCommissioningStep for the kConfigRegulatory step.
185 1 : const Optional<app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum> GetDeviceRegulatoryLocation() const
186 : {
187 1 : return mDeviceRegulatoryLocation;
188 : }
189 :
190 : // Value to determine whether the node supports Concurrent Connections as read from the GeneralCommissioning cluster.
191 : // In the AutoCommissioner, this is automatically set from from the kReadCommissioningInfo stage.
192 8 : Optional<bool> GetSupportsConcurrentConnection() const { return mSupportsConcurrentConnection; }
193 :
194 : // The country code to be used for the node, if set.
195 44 : Optional<CharSpan> GetCountryCode() const { return mCountryCode; }
196 :
197 2 : Optional<TermsAndConditionsAcknowledgement> GetTermsAndConditionsAcknowledgement() const
198 : {
199 2 : return mTermsAndConditionsAcknowledgement;
200 : }
201 :
202 : // Time zone to set for the node
203 : // If required, this will be truncated to fit the max size allowable on the node
204 51 : Optional<app::DataModel::List<app::Clusters::TimeSynchronization::Structs::TimeZoneStruct::Type>> GetTimeZone() const
205 : {
206 51 : return mTimeZone;
207 : }
208 :
209 : // DST offset list. If required, this will be truncated to fit the max size allowable on the node
210 : // DST list will only be sent if the commissionee requires DST offsets, as indicated in the SetTimeZone response
211 47 : Optional<app::DataModel::List<app::Clusters::TimeSynchronization::Structs::DSTOffsetStruct::Type>> GetDSTOffsets() const
212 : {
213 47 : return mDSTOffsets;
214 : }
215 :
216 : // Default NTP to set on the node if supported and required
217 : // Default implementation will not overide a value already set on the commissionee
218 : // TODO: Add a force option?
219 50 : Optional<app::DataModel::Nullable<CharSpan>> GetDefaultNTP() const { return mDefaultNTP; }
220 :
221 : // Trusted time source
222 : // Default implementation will not override a value already set on the commissionee
223 : // TODO: Add a force option?
224 : Optional<app::DataModel::Nullable<app::Clusters::TimeSynchronization::Structs::FabricScopedTrustedTimeSourceStruct::Type>>
225 2 : GetTrustedTimeSource() const
226 : {
227 2 : return mTrustedTimeSource;
228 : }
229 :
230 : // Nonce sent to the node to use during the CSR request.
231 : // When using the AutoCommissioner, this value will be ignored in favour of the value supplied by the
232 : // OperationalCredentialsDelegate ObtainCsrNonce function. If the credential delegate is not supplied, the value supplied here
233 : // will be used. If neither is supplied random value will be used as a fallback.
234 : // This value must be set before calling PerformCommissioningStep for the kSendOpCertSigningRequest step.
235 41 : const Optional<ByteSpan> GetCSRNonce() const { return mCSRNonce; }
236 :
237 : // Nonce value sent to the node to use during the attestation request.
238 : // When using the AutoCommissioner, this value will fall back to random if not supplied.
239 : // If a non-random value is to be used, the value must be set before calling PerformCommissioningStep for the
240 : // kSendAttestationRequest step.
241 42 : const Optional<ByteSpan> GetAttestationNonce() const { return mAttestationNonce; }
242 :
243 : // WiFi SSID and credentials to use when adding/updating and enabling WiFi on the node.
244 : // This value must be set before calling PerformCommissioningStep for the kWiFiNetworkSetup or kWiFiNetworkEnable steps.
245 52 : const Optional<WiFiCredentials> GetWiFiCredentials() const { return mWiFiCreds; }
246 :
247 : // Thread operational dataset to use when adding/updating and enabling the thread network on the node.
248 : // This value must be set before calling PerformCommissioningStep for the kThreadNetworkSetup or kThreadNetworkEnable steps.
249 53 : const Optional<ByteSpan> GetThreadOperationalDataset() const { return mThreadOperationalDataset; }
250 :
251 : // The NOCSR parameters (elements and signature) returned from the node. In the AutoCommissioner, this is set using the data
252 : // returned from the kSendOpCertSigningRequest stage.
253 : // This value must be set before calling PerformCommissioningStep for the kGenerateNOCChain step.
254 2 : const Optional<NOCChainGenerationParameters> GetNOCChainGenerationParameters() const { return mNOCChainGenerationParameters; }
255 :
256 : // The root certificate for the operational certificate chain. In the auto commissioner, this is set by by the kGenerateNOCChain
257 : // stage through the OperationalCredentialsDelegate.
258 : // This value must be set before calling PerformCommissioningStep for the kSendTrustedRootCert step.
259 2 : const Optional<ByteSpan> GetRootCert() const { return mRootCert; }
260 :
261 : // The node operational certificate for the node being commissioned. In the AutoCommissioner, this is set by by the
262 : // kGenerateNOCChain stage through the OperationalCredentialsDelegate.
263 : // This value must be set before calling PerformCommissioningStep for the kSendNOC step.
264 : // This value must also be set before calling PerformCommissioningStep for the kSendTrustedRootCert step, as it is used to set
265 : // the node id in the DeviceProxy.
266 2 : const Optional<ByteSpan> GetNoc() const { return mNoc; }
267 :
268 : // The intermediate certificate for the node being commissioned. In the AutoCommissioner, this is set by by the
269 : // kGenerateNOCChain stage through the OperationalCredentialsDelegate.
270 : // This value should be set before calling PerformCommissioningStep for the kSendNOC step.
271 2 : const Optional<ByteSpan> GetIcac() const { return mIcac; }
272 :
273 : // Epoch key for the identity protection key for the node being commissioned. In the AutoCommissioner, this is set by by the
274 : // kGenerateNOCChain stage through the OperationalCredentialsDelegate.
275 : // This value must be set before calling PerformCommissioningStep for the kSendNOC step.
276 2 : const Optional<Crypto::IdentityProtectionKeySpan> GetIpk() const
277 : {
278 4 : return mIpk.HasValue() ? MakeOptional(mIpk.Value().Span()) : NullOptional;
279 : }
280 :
281 : // Admin subject id used for the case access control entry created if the AddNOC command succeeds. In the AutoCommissioner, this
282 : // is set by by the kGenerateNOCChain stage through the OperationalCredentialsDelegate.
283 : // This must be set before calling PerformCommissioningStep for the kSendNOC step.
284 1 : const Optional<NodeId> GetAdminSubject() const { return mAdminSubject; }
285 :
286 : // Attestation elements from the node. These are obtained from node in response to the AttestationRequest command. In the
287 : // AutoCommissioner, this is automatically set from the report from the kSendAttestationRequest stage.
288 : // This must be set before calling PerformCommissioningStep for the kAttestationVerification step.
289 3 : const Optional<ByteSpan> GetAttestationElements() const { return mAttestationElements; }
290 :
291 : // Attestation signature from the node. This is obtained from node in response to the AttestationRequest command. In the
292 : // AutoCommissioner, this is automatically set from the report from the kSendAttestationRequest stage.
293 : // This must be set before calling PerformCommissioningStep for the kAttestationVerification step.
294 3 : const Optional<ByteSpan> GetAttestationSignature() const { return mAttestationSignature; }
295 :
296 : // Product attestation intermediate certificate from the node. This is obtained from the node in response to the
297 : // CertificateChainRequest command for the PAI. In the AutoCommissioner, this is automatically set from the report from the
298 : // kSendPAICertificateRequest stage.
299 : // This must be set before calling PerformCommissioningStep for the kAttestationVerificationstep.
300 3 : const Optional<ByteSpan> GetPAI() const { return mPAI; }
301 :
302 : // Device attestation certificate from the node. This is obtained from the node in response to the CertificateChainRequest
303 : // command for the DAC. In the AutoCommissioner, this is automatically set from the report from the kSendDACCertificateRequest
304 : // stage.
305 : // This must be set before calling PerformCommissioningStep for the kAttestationVerification step.
306 3 : const Optional<ByteSpan> GetDAC() const { return mDAC; }
307 :
308 : // Node ID when a matching fabric is found in the Node Operational Credentials cluster.
309 : // In the AutoCommissioner, this is set from kReadCommissioningInfo stage.
310 2 : const Optional<NodeId> GetRemoteNodeId() const { return mRemoteNodeId; }
311 :
312 : // Node vendor ID from the basic information cluster. In the AutoCommissioner, this is automatically set from report from the
313 : // kReadCommissioningInfo stage.
314 : // This must be set before calling PerformCommissioningStep for the kAttestationVerification step.
315 1 : const Optional<VendorId> GetRemoteVendorId() const { return mRemoteVendorId; }
316 :
317 : // Node product ID from the basic information cluster. In the AutoCommissioner, this is automatically set from report from the
318 : // kReadCommissioningInfo stage.
319 : // This must be set before calling PerformCommissioningStep for the kAttestationVerification step.
320 1 : const Optional<uint16_t> GetRemoteProductId() const { return mRemoteProductId; }
321 :
322 : // Default regulatory location set by the node, as read from the GeneralCommissioning cluster. In the AutoCommissioner, this is
323 : // automatically set from report from the kReadCommissioningInfo stage.
324 : // This should be set before calling PerformCommissioningStep for the kConfigRegulatory step.
325 1 : const Optional<app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum> GetDefaultRegulatoryLocation() const
326 : {
327 1 : return mDefaultRegulatoryLocation;
328 : }
329 :
330 : // Location capabilities of the node, as read from the GeneralCommissioning cluster. In the AutoCommissioner, this is
331 : // automatically set from report from the kReadCommissioningInfo stage.
332 : // This should be set before calling PerformCommissioningStep for the kConfigRegulatory step.
333 1 : const Optional<app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum> GetLocationCapability() const
334 : {
335 1 : return mLocationCapability;
336 : }
337 :
338 : // Status to send when calling CommissioningComplete on the PairingDelegate during the kCleanup step. The AutoCommissioner uses
339 : // this to pass through any error messages received during commissioning.
340 2 : const CompletionStatus & GetCompletionStatus() const { return completionStatus; }
341 :
342 1 : CommissioningParameters & SetFailsafeTimerSeconds(uint16_t seconds)
343 : {
344 1 : mFailsafeTimerSeconds.SetValue(seconds);
345 1 : return *this;
346 : }
347 :
348 1 : CommissioningParameters & SetCASEFailsafeTimerSeconds(uint16_t seconds)
349 : {
350 1 : mCASEFailsafeTimerSeconds.SetValue(seconds);
351 1 : return *this;
352 : }
353 :
354 1 : CommissioningParameters & SetDeviceRegulatoryLocation(app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum location)
355 : {
356 1 : mDeviceRegulatoryLocation.SetValue(location);
357 1 : return *this;
358 : }
359 :
360 7 : CommissioningParameters & SetSupportsConcurrentConnection(bool concurrentConnection)
361 : {
362 7 : mSupportsConcurrentConnection.SetValue(concurrentConnection);
363 7 : return *this;
364 : }
365 :
366 : // The lifetime of the buffer countryCode is pointing to should exceed the
367 : // lifetime of CommissioningParameters object.
368 2 : CommissioningParameters & SetCountryCode(CharSpan countryCode)
369 : {
370 2 : mCountryCode.SetValue(countryCode);
371 2 : return *this;
372 : }
373 :
374 : CommissioningParameters &
375 1 : SetTermsAndConditionsAcknowledgement(TermsAndConditionsAcknowledgement termsAndConditionsAcknowledgement)
376 : {
377 1 : mTermsAndConditionsAcknowledgement.SetValue(termsAndConditionsAcknowledgement);
378 1 : return *this;
379 : }
380 :
381 : // The lifetime of the list buffer needs to exceed the lifetime of the CommissioningParameters object.
382 : CommissioningParameters &
383 3 : SetTimeZone(app::DataModel::List<app::Clusters::TimeSynchronization::Structs::TimeZoneStruct::Type> timeZone)
384 : {
385 3 : mTimeZone.SetValue(timeZone);
386 3 : return *this;
387 : }
388 :
389 : // The lifetime of the list buffer needs to exceed the lifetime of the CommissioningParameters object.
390 : CommissioningParameters &
391 3 : SetDSTOffsets(app::DataModel::List<app::Clusters::TimeSynchronization::Structs::DSTOffsetStruct::Type> dstOffsets)
392 : {
393 3 : mDSTOffsets.SetValue(dstOffsets);
394 3 : return *this;
395 : }
396 :
397 : // The lifetime of the char span needs to exceed the lifetime of the CommissioningParameters
398 4 : CommissioningParameters & SetDefaultNTP(app::DataModel::Nullable<CharSpan> defaultNTP)
399 : {
400 4 : mDefaultNTP.SetValue(defaultNTP);
401 4 : return *this;
402 : }
403 :
404 1 : CommissioningParameters & SetTrustedTimeSource(
405 : app::DataModel::Nullable<app::Clusters::TimeSynchronization::Structs::FabricScopedTrustedTimeSourceStruct::Type>
406 : trustedTimeSource)
407 : {
408 1 : mTrustedTimeSource.SetValue(trustedTimeSource);
409 1 : return *this;
410 : }
411 :
412 : // The lifetime of the buffer csrNonce is pointing to, should exceed the lifetime of CommissioningParameters object.
413 39 : CommissioningParameters & SetCSRNonce(ByteSpan csrNonce)
414 : {
415 39 : mCSRNonce.SetValue(csrNonce);
416 39 : return *this;
417 : }
418 :
419 : // The lifetime of the buffer attestationNonce is pointing to, should exceed the lifetime of CommissioningParameters object.
420 40 : CommissioningParameters & SetAttestationNonce(ByteSpan attestationNonce)
421 : {
422 40 : mAttestationNonce.SetValue(attestationNonce);
423 40 : return *this;
424 : }
425 :
426 : // If a WiFiCredentials is provided, then the WiFiNetworkScan will not be attempted
427 12 : CommissioningParameters & SetWiFiCredentials(WiFiCredentials wifiCreds)
428 : {
429 12 : mWiFiCreds.SetValue(wifiCreds);
430 12 : mAttemptWiFiNetworkScan.SetValue(false);
431 12 : return *this;
432 : }
433 :
434 : // If a ThreadOperationalDataset is provided, then the ThreadNetworkScan will not be attempted
435 12 : CommissioningParameters & SetThreadOperationalDataset(ByteSpan threadOperationalDataset)
436 : {
437 :
438 12 : mThreadOperationalDataset.SetValue(threadOperationalDataset);
439 12 : mAttemptThreadNetworkScan = MakeOptional(static_cast<bool>(false));
440 12 : return *this;
441 : }
442 : // This parameter should be set with the information returned from kSendOpCertSigningRequest. It must be set before calling
443 : // kGenerateNOCChain.
444 1 : CommissioningParameters & SetNOCChainGenerationParameters(const NOCChainGenerationParameters & params)
445 : {
446 1 : mNOCChainGenerationParameters.SetValue(params);
447 1 : return *this;
448 : }
449 : // Root certs can be generated from the kGenerateNOCChain step. This must be set before calling kSendTrustedRootCert.
450 3 : CommissioningParameters & SetRootCert(const ByteSpan & rcac)
451 : {
452 3 : mRootCert.SetValue(rcac);
453 3 : return *this;
454 : }
455 : // NOC and intermediate cert can be generated from the kGenerateNOCChain step. NOC must be set before calling
456 : // kSendTrustedRootCert. ICAC and NOC must be set before calling kSendNOC
457 1 : CommissioningParameters & SetNoc(const ByteSpan & noc)
458 : {
459 1 : mNoc.SetValue(noc);
460 1 : return *this;
461 : }
462 1 : CommissioningParameters & SetIcac(const ByteSpan & icac)
463 : {
464 1 : mIcac.SetValue(icac);
465 1 : return *this;
466 : }
467 1 : CommissioningParameters & SetIpk(const Crypto::IdentityProtectionKeySpan ipk)
468 : {
469 1 : mIpk.SetValue(Crypto::IdentityProtectionKey(ipk));
470 1 : return *this;
471 : }
472 1 : CommissioningParameters & SetAdminSubject(const NodeId adminSubject)
473 : {
474 1 : mAdminSubject.SetValue(adminSubject);
475 1 : return *this;
476 : }
477 1 : CommissioningParameters & SetAttestationElements(const ByteSpan & attestationElements)
478 : {
479 1 : mAttestationElements = MakeOptional(attestationElements);
480 1 : return *this;
481 : }
482 1 : CommissioningParameters & SetAttestationSignature(const ByteSpan & attestationSignature)
483 : {
484 1 : mAttestationSignature = MakeOptional(attestationSignature);
485 1 : return *this;
486 : }
487 1 : CommissioningParameters & SetPAI(const ByteSpan & pai)
488 : {
489 1 : mPAI = MakeOptional(pai);
490 1 : return *this;
491 : }
492 1 : CommissioningParameters & SetDAC(const ByteSpan & dac)
493 : {
494 1 : mDAC = MakeOptional(dac);
495 1 : return *this;
496 : }
497 1 : CommissioningParameters & SetRemoteNodeId(NodeId id)
498 : {
499 1 : mRemoteNodeId = MakeOptional(id);
500 1 : return *this;
501 : }
502 1 : CommissioningParameters & SetRemoteVendorId(VendorId id)
503 : {
504 1 : mRemoteVendorId = MakeOptional(id);
505 1 : return *this;
506 : }
507 1 : CommissioningParameters & SetRemoteProductId(uint16_t id)
508 : {
509 1 : mRemoteProductId = MakeOptional(id);
510 1 : return *this;
511 : }
512 1 : CommissioningParameters & SetDefaultRegulatoryLocation(app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum location)
513 : {
514 1 : mDefaultRegulatoryLocation = MakeOptional(location);
515 1 : return *this;
516 : }
517 1 : CommissioningParameters & SetLocationCapability(app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum capability)
518 : {
519 1 : mLocationCapability = MakeOptional(capability);
520 1 : return *this;
521 : }
522 1 : void SetCompletionStatus(const CompletionStatus & status) { completionStatus = status; }
523 :
524 1 : CommissioningParameters & SetDeviceAttestationDelegate(Credentials::DeviceAttestationDelegate * deviceAttestationDelegate)
525 : {
526 1 : mDeviceAttestationDelegate = deviceAttestationDelegate;
527 1 : return *this;
528 : }
529 :
530 3 : Credentials::DeviceAttestationDelegate * GetDeviceAttestationDelegate() const { return mDeviceAttestationDelegate; }
531 :
532 : // If an SSID is provided, and AttemptWiFiNetworkScan is true,
533 : // then a directed scan will be performed using the SSID provided in the WiFiCredentials object
534 7 : Optional<bool> GetAttemptWiFiNetworkScan() const { return mAttemptWiFiNetworkScan; }
535 4 : CommissioningParameters & SetAttemptWiFiNetworkScan(bool attemptWiFiNetworkScan)
536 : {
537 4 : mAttemptWiFiNetworkScan = MakeOptional(attemptWiFiNetworkScan);
538 4 : return *this;
539 : }
540 :
541 : // If a ThreadOperationalDataset is provided, then the ThreadNetworkScan will not be attempted
542 7 : Optional<bool> GetAttemptThreadNetworkScan() const { return mAttemptThreadNetworkScan; }
543 5 : CommissioningParameters & SetAttemptThreadNetworkScan(bool attemptThreadNetworkScan)
544 : {
545 5 : if (!mThreadOperationalDataset.HasValue())
546 : {
547 4 : mAttemptThreadNetworkScan = MakeOptional(attemptThreadNetworkScan);
548 : }
549 5 : return *this;
550 : }
551 :
552 : // Only perform the PASE steps of commissioning.
553 : // Commissioning will be completed by another admin on the network.
554 5 : Optional<bool> GetSkipCommissioningComplete() const { return mSkipCommissioningComplete; }
555 1 : CommissioningParameters & SetSkipCommissioningComplete(bool skipCommissioningComplete)
556 : {
557 1 : mSkipCommissioningComplete = MakeOptional(skipCommissioningComplete);
558 1 : return *this;
559 : }
560 :
561 : // Check for matching fabric on target device by reading fabric list and looking for a
562 : // fabricId and RootCert match. If a match is detected, then use GetNodeId() to
563 : // access the nodeId for the device on the matching fabric.
564 1 : bool GetCheckForMatchingFabric() const { return mCheckForMatchingFabric; }
565 1 : CommissioningParameters & SetCheckForMatchingFabric(bool checkForMatchingFabric)
566 : {
567 1 : mCheckForMatchingFabric = checkForMatchingFabric;
568 1 : return *this;
569 : }
570 :
571 : #if CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC
572 : // Check for Joint Commissioning Method
573 : Optional<bool> GetUseJCM() const { return mUseJCM; }
574 :
575 : // Set the Joint Commissioning Method
576 : CommissioningParameters & SetUseJCM(bool useJCM)
577 : {
578 : mUseJCM = MakeOptional(useJCM);
579 : return *this;
580 : }
581 : #endif // CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC
582 :
583 40 : ICDRegistrationStrategy GetICDRegistrationStrategy() const { return mICDRegistrationStrategy; }
584 2 : CommissioningParameters & SetICDRegistrationStrategy(ICDRegistrationStrategy icdRegistrationStrategy)
585 : {
586 2 : mICDRegistrationStrategy = icdRegistrationStrategy;
587 2 : return *this;
588 : }
589 :
590 6 : Optional<NodeId> GetICDCheckInNodeId() const { return mICDCheckInNodeId; }
591 3 : CommissioningParameters & SetICDCheckInNodeId(NodeId icdCheckInNodeId)
592 : {
593 3 : mICDCheckInNodeId = MakeOptional(icdCheckInNodeId);
594 3 : return *this;
595 : }
596 :
597 6 : Optional<uint64_t> GetICDMonitoredSubject() const { return mICDMonitoredSubject; }
598 3 : CommissioningParameters & SetICDMonitoredSubject(uint64_t icdMonitoredSubject)
599 : {
600 3 : mICDMonitoredSubject = MakeOptional(icdMonitoredSubject);
601 3 : return *this;
602 : }
603 :
604 12 : Optional<ByteSpan> GetICDSymmetricKey() const { return mICDSymmetricKey; }
605 3 : CommissioningParameters & SetICDSymmetricKey(ByteSpan icdSymmetricKey)
606 : {
607 3 : mICDSymmetricKey = MakeOptional(icdSymmetricKey);
608 3 : return *this;
609 : }
610 :
611 6 : Optional<app::Clusters::IcdManagement::ClientTypeEnum> GetICDClientType() const { return mICDClientType; }
612 3 : CommissioningParameters & SetICDClientType(app::Clusters::IcdManagement::ClientTypeEnum icdClientType)
613 : {
614 3 : mICDClientType = MakeOptional(icdClientType);
615 3 : return *this;
616 : }
617 :
618 3 : Optional<uint32_t> GetICDStayActiveDurationMsec() const { return mICDStayActiveDurationMsec; }
619 1 : CommissioningParameters & SetICDStayActiveDurationMsec(uint32_t stayActiveDurationMsec)
620 : {
621 1 : mICDStayActiveDurationMsec = MakeOptional(stayActiveDurationMsec);
622 1 : return *this;
623 : }
624 1 : void ClearICDStayActiveDurationMsec() { mICDStayActiveDurationMsec.ClearValue(); }
625 :
626 41 : Span<const app::AttributePathParams> GetExtraReadPaths() const { return mExtraReadPaths; }
627 :
628 : // Additional attribute paths to read as part of the kReadCommissioningInfo stage.
629 : // These values read from the device will be available in ReadCommissioningInfo.attributes.
630 : // Clients should avoid requesting paths that are already read internally by the commissioner
631 : // as no consolidation of internally read and extra paths provided here will be performed.
632 2 : CommissioningParameters & SetExtraReadPaths(Span<const app::AttributePathParams> paths)
633 : {
634 2 : mExtraReadPaths = paths;
635 2 : return *this;
636 : }
637 :
638 : // Clear all members that depend on some sort of external buffer. Can be
639 : // used to make sure that we are not holding any dangling pointers.
640 43 : void ClearExternalBufferDependentValues()
641 : {
642 43 : mCSRNonce.ClearValue();
643 43 : mAttestationNonce.ClearValue();
644 43 : mWiFiCreds.ClearValue();
645 43 : mCountryCode.ClearValue();
646 43 : mThreadOperationalDataset.ClearValue();
647 43 : mNOCChainGenerationParameters.ClearValue();
648 43 : mRootCert.ClearValue();
649 43 : mNoc.ClearValue();
650 43 : mIcac.ClearValue();
651 43 : mIpk.ClearValue();
652 43 : mAttestationElements.ClearValue();
653 43 : mAttestationSignature.ClearValue();
654 43 : mPAI.ClearValue();
655 43 : mDAC.ClearValue();
656 43 : mTimeZone.ClearValue();
657 43 : mDSTOffsets.ClearValue();
658 43 : mDefaultNTP.ClearValue();
659 43 : mICDSymmetricKey.ClearValue();
660 43 : mExtraReadPaths = decltype(mExtraReadPaths)();
661 43 : }
662 :
663 : private:
664 : // Items that can be set by the commissioner
665 : Optional<uint16_t> mFailsafeTimerSeconds;
666 : Optional<uint16_t> mCASEFailsafeTimerSeconds;
667 : Optional<app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum> mDeviceRegulatoryLocation;
668 : Optional<app::DataModel::List<app::Clusters::TimeSynchronization::Structs::TimeZoneStruct::Type>> mTimeZone;
669 : Optional<app::DataModel::List<app::Clusters::TimeSynchronization::Structs::DSTOffsetStruct::Type>> mDSTOffsets;
670 : Optional<app::DataModel::Nullable<CharSpan>> mDefaultNTP;
671 : Optional<app::DataModel::Nullable<app::Clusters::TimeSynchronization::Structs::FabricScopedTrustedTimeSourceStruct::Type>>
672 : mTrustedTimeSource;
673 : Optional<ByteSpan> mCSRNonce;
674 : Optional<ByteSpan> mAttestationNonce;
675 : Optional<WiFiCredentials> mWiFiCreds;
676 : Optional<CharSpan> mCountryCode;
677 : Optional<TermsAndConditionsAcknowledgement> mTermsAndConditionsAcknowledgement;
678 : Optional<ByteSpan> mThreadOperationalDataset;
679 : Optional<NOCChainGenerationParameters> mNOCChainGenerationParameters;
680 : Optional<ByteSpan> mRootCert;
681 : Optional<ByteSpan> mNoc;
682 : Optional<ByteSpan> mIcac;
683 : Optional<Crypto::IdentityProtectionKey> mIpk;
684 : Optional<NodeId> mAdminSubject;
685 : // Items that come from the device in commissioning steps
686 : Optional<ByteSpan> mAttestationElements;
687 : Optional<ByteSpan> mAttestationSignature;
688 : Optional<ByteSpan> mPAI;
689 : Optional<ByteSpan> mDAC;
690 : Optional<NodeId> mRemoteNodeId;
691 : Optional<VendorId> mRemoteVendorId;
692 : Optional<uint16_t> mRemoteProductId;
693 : Optional<app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum> mDefaultRegulatoryLocation;
694 : Optional<app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum> mLocationCapability;
695 : Optional<bool> mSupportsConcurrentConnection;
696 : CompletionStatus completionStatus;
697 : Credentials::DeviceAttestationDelegate * mDeviceAttestationDelegate =
698 : nullptr; // Delegate to handle device attestation failures during commissioning
699 : Optional<bool> mAttemptWiFiNetworkScan;
700 : Optional<bool> mAttemptThreadNetworkScan; // This automatically gets set to false when a ThreadOperationalDataset is set
701 : Optional<bool> mSkipCommissioningComplete;
702 :
703 : Optional<NodeId> mICDCheckInNodeId;
704 : Optional<uint64_t> mICDMonitoredSubject;
705 : Optional<ByteSpan> mICDSymmetricKey;
706 : Optional<app::Clusters::IcdManagement::ClientTypeEnum> mICDClientType;
707 : Optional<uint32_t> mICDStayActiveDurationMsec;
708 : ICDRegistrationStrategy mICDRegistrationStrategy = ICDRegistrationStrategy::kIgnore;
709 : bool mCheckForMatchingFabric = false;
710 : Span<const app::AttributePathParams> mExtraReadPaths;
711 :
712 : Optional<bool> mUseJCM;
713 : };
714 :
715 : struct RequestedCertificate
716 : {
717 1 : RequestedCertificate(ByteSpan newCertificate) : certificate(newCertificate) {}
718 : ByteSpan certificate;
719 : };
720 :
721 : struct AttestationResponse
722 : {
723 1 : AttestationResponse(ByteSpan newAttestationElements, ByteSpan newSignature) :
724 1 : attestationElements(newAttestationElements), signature(newSignature)
725 1 : {}
726 : ByteSpan attestationElements;
727 : ByteSpan signature;
728 : };
729 :
730 : struct CSRResponse
731 : {
732 1 : CSRResponse(ByteSpan elements, ByteSpan newSignature) : nocsrElements(elements), signature(newSignature) {}
733 : ByteSpan nocsrElements;
734 : ByteSpan signature;
735 : };
736 :
737 : struct NocChain
738 : {
739 0 : NocChain(ByteSpan newNoc, ByteSpan newIcac, ByteSpan newRcac, Crypto::IdentityProtectionKeySpan newIpk,
740 0 : NodeId newAdminSubject) :
741 0 : noc(newNoc),
742 0 : icac(newIcac), rcac(newRcac), ipk(newIpk), adminSubject(newAdminSubject)
743 0 : {}
744 : ByteSpan noc;
745 : ByteSpan icac;
746 : ByteSpan rcac;
747 : Crypto::IdentityProtectionKeySpan ipk;
748 : NodeId adminSubject;
749 : };
750 :
751 : struct OperationalNodeFoundData
752 : {
753 0 : OperationalNodeFoundData(OperationalDeviceProxy proxy) : operationalProxy(proxy) {}
754 : OperationalDeviceProxy operationalProxy;
755 : };
756 :
757 : struct NetworkClusterInfo
758 : {
759 : EndpointId endpoint = kInvalidEndpointId;
760 : app::Clusters::NetworkCommissioning::Attributes::ConnectMaxTimeSeconds::TypeInfo::DecodableType minConnectionTime = 0;
761 : // maxScanTime == 0 means we don't know; normal commissioning step timeouts
762 : // will apply in that case.
763 : app::Clusters::NetworkCommissioning::Attributes::ScanMaxTimeSeconds::TypeInfo::DecodableType maxScanTime = 0;
764 : };
765 : struct NetworkClusters
766 : {
767 : NetworkClusterInfo wifi;
768 : NetworkClusterInfo thread;
769 : NetworkClusterInfo eth;
770 : };
771 : struct BasicClusterInfo
772 : {
773 : VendorId vendorId = VendorId::Common;
774 : uint16_t productId = 0;
775 : };
776 : struct GeneralCommissioningInfo
777 : {
778 : uint64_t breadcrumb = 0;
779 : uint16_t recommendedFailsafe = 0;
780 : app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum currentRegulatoryLocation =
781 : app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum::kIndoorOutdoor;
782 : app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum locationCapability =
783 : app::Clusters::GeneralCommissioning::RegulatoryLocationTypeEnum::kIndoorOutdoor;
784 : bool isCommissioningWithoutPower = false;
785 : };
786 :
787 : // ICDManagementClusterInfo is populated when the controller reads information from
788 : // the ICD Management cluster, and is used to communicate that information.
789 : struct ICDManagementClusterInfo
790 : {
791 : // Whether the ICD is capable of functioning as a LIT device. If false, the ICD can only be a SIT device.
792 : bool isLIT = false;
793 : // Whether the ICD supports the check-in protocol. LIT devices have to support it, but SIT devices
794 : // might or might not.
795 : bool checkInProtocolSupport = false;
796 : // Indicate the maximum interval in seconds the server can stay in idle mode.
797 : uint32_t idleModeDuration = 0;
798 : // Indicate the minimum interval in milliseconds the server typically will stay in active mode after initial transition out of
799 : // idle mode.
800 : uint32_t activeModeDuration = 0;
801 : // Indicate the minimum amount of time in milliseconds the server typically will stay active after network activity when in
802 : // active mode.
803 : uint16_t activeModeThreshold = 0;
804 : // userActiveModeTriggerHint indicates which user action(s) will trigger the ICD to switch to Active mode.
805 : // For a LIT: The device is required to provide a value for the bitmap.
806 : // For a SIT: The device may not provide a value. In that case, none of the bits will be set.
807 : //
808 : // userActiveModeTriggerInstruction may provide additional information for users for some specific
809 : // userActiveModeTriggerHint values.
810 : BitMask<app::Clusters::IcdManagement::UserActiveModeTriggerBitmap> userActiveModeTriggerHint;
811 : CharSpan userActiveModeTriggerInstruction;
812 : };
813 :
814 : struct ReadCommissioningInfo
815 : {
816 : #if CHIP_CONFIG_ENABLE_READ_CLIENT
817 : app::ClusterStateCache const * attributes = nullptr;
818 : #endif
819 : NetworkClusters network;
820 : BasicClusterInfo basic;
821 : GeneralCommissioningInfo general;
822 : bool requiresUTC = false;
823 : bool requiresTimeZone = false;
824 : bool requiresDefaultNTP = false;
825 : bool requiresTrustedTimeSource = false;
826 : uint8_t maxTimeZoneSize = 1;
827 : uint8_t maxDSTSize = 1;
828 : NodeId remoteNodeId = kUndefinedNodeId;
829 : bool supportsConcurrentConnection = true;
830 : ICDManagementClusterInfo icd;
831 : };
832 :
833 : struct TimeZoneResponseInfo
834 : {
835 : bool requiresDSTOffsets;
836 : };
837 :
838 : struct AttestationErrorInfo
839 : {
840 0 : AttestationErrorInfo(Credentials::AttestationVerificationResult result) : attestationResult(result) {}
841 : Credentials::AttestationVerificationResult attestationResult;
842 : };
843 :
844 : struct CommissioningErrorInfo
845 : {
846 0 : CommissioningErrorInfo(app::Clusters::GeneralCommissioning::CommissioningErrorEnum result) : commissioningError(result) {}
847 : app::Clusters::GeneralCommissioning::CommissioningErrorEnum commissioningError;
848 : };
849 :
850 : struct NetworkCommissioningStatusInfo
851 : {
852 0 : NetworkCommissioningStatusInfo(app::Clusters::NetworkCommissioning::NetworkCommissioningStatusEnum result) :
853 0 : networkCommissioningStatus(result)
854 0 : {}
855 : app::Clusters::NetworkCommissioning::NetworkCommissioningStatusEnum networkCommissioningStatus;
856 : };
857 :
858 : class CommissioningDelegate
859 : {
860 : public:
861 23 : virtual ~CommissioningDelegate(){};
862 : /* CommissioningReport is returned after each commissioning step is completed. The reports for each step are:
863 : * kReadCommissioningInfo: ReadCommissioningInfo
864 : * kArmFailsafe: CommissioningErrorInfo if there is an error
865 : * kConfigRegulatory: CommissioningErrorInfo if there is an error
866 : * kConfigureUTCTime: None
867 : * kConfigureTimeZone: TimeZoneResponseInfo
868 : * kConfigureDSTOffset: None
869 : * kConfigureDefaultNTP: None
870 : * kSendPAICertificateRequest: RequestedCertificate
871 : * kSendDACCertificateRequest: RequestedCertificate
872 : * kSendAttestationRequest: AttestationResponse
873 : * kAttestationVerification: AttestationErrorInfo if there is an error
874 : * kAttestationRevocationCheck: AttestationErrorInfo if there is an error
875 : * kJCMTrustVerification: JCMTrustVerificationError if there is an error
876 : * kSendOpCertSigningRequest: CSRResponse
877 : * kGenerateNOCChain: NocChain
878 : * kSendTrustedRootCert: None
879 : * kSendNOC: None
880 : * kConfigureTrustedTimeSource: None
881 : * kWiFiNetworkSetup: NetworkCommissioningStatusInfo if there is an error
882 : * kThreadNetworkSetup: NetworkCommissioningStatusInfo if there is an error
883 : * kWiFiNetworkEnable: NetworkCommissioningStatusInfo if there is an error
884 : * kThreadNetworkEnable: NetworkCommissioningStatusInfo if there is an error
885 : * kEvictPreviousCaseSessions: None
886 : * kFindOperationalForStayActive OperationalNodeFoundData
887 : * kFindOperationalForCommissioningComplete: OperationalNodeFoundData
888 : * kICDSendStayActive: CommissioningErrorInfo if there is an error
889 : * kSendComplete: CommissioningErrorInfo if there is an error
890 : * kCleanup: None
891 : */
892 : struct CommissioningReport
893 : : Variant<RequestedCertificate, AttestationResponse, CSRResponse, NocChain, OperationalNodeFoundData, ReadCommissioningInfo,
894 : AttestationErrorInfo, CommissioningErrorInfo, NetworkCommissioningStatusInfo, TimeZoneResponseInfo
895 : #if CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC
896 : ,
897 : JCM::TrustVerificationError
898 : #endif // CHIP_DEVICE_CONFIG_ENABLE_JOINT_FABRIC
899 : >
900 : {
901 1 : CommissioningReport() : stageCompleted(CommissioningStage::kError) {}
902 : CommissioningStage stageCompleted;
903 : };
904 : virtual CHIP_ERROR SetCommissioningParameters(const CommissioningParameters & params) = 0;
905 : virtual const CommissioningParameters & GetCommissioningParameters() const = 0;
906 : virtual void SetOperationalCredentialsDelegate(OperationalCredentialsDelegate * operationalCredentialsDelegate) = 0;
907 : virtual CHIP_ERROR StartCommissioning(DeviceCommissioner * commissioner, CommissioneeDeviceProxy * proxy) = 0;
908 : virtual CHIP_ERROR CommissioningStepFinished(CHIP_ERROR err, CommissioningReport report) = 0;
909 : };
910 :
911 : } // namespace Controller
912 : } // namespace chip
|