@@ -150,6 +150,22 @@ class DLL_EXPORT UserPrompter
150
150
*/
151
151
virtual void PromptCommissioningFailed (const char * commissioneeName, CHIP_ERROR error) = 0;
152
152
153
+ /* *
154
+ * @brief
155
+ * Called to prompt the user for consent to allow the given commissioneeName/vendorId/productId to be commissioned.
156
+ * For example "[commissioneeName] is requesting permission to cast to this TV, approve?"
157
+ *
158
+ * If user responds with OK then implementor should call CommissionerRespondOk();
159
+ * If user responds with Cancel then implementor should call CommissionerRespondCancel();
160
+ *
161
+ * @param[in] vendorId The vendorId in the DNS-SD advertisement of the requesting commissionee.
162
+ * @param[in] productId The productId in the DNS-SD advertisement of the requesting commissionee.
163
+ * @param[in] commissioneeName The commissioneeName in the DNS-SD advertisement of the requesting commissionee.
164
+ *
165
+ */
166
+ virtual void PromptForAppInstallOKPermission (uint16_t vendorId, uint16_t productId, const char * commissioneeName) = 0;
167
+
168
+
153
169
virtual ~UserPrompter () = default ;
154
170
};
155
171
@@ -204,6 +220,27 @@ class DLL_EXPORT PasscodeService
204
220
virtual ~PasscodeService () = default ;
205
221
};
206
222
223
+ class DLL_EXPORT AppInstallationService
224
+ {
225
+ public:
226
+ /* *
227
+ * @brief
228
+ * Called to get the setup passcode from the content app corresponding to the given vendorId/productId.
229
+ *
230
+ * This will be called by the main chip thread so any blocking work should be moved to a separate thread.
231
+ *
232
+ * After attempting to obtain the passcode, implementor should call HandleContentAppPasscodeResponse();
233
+ *
234
+ * @param[in] vendorId The vendorId in the DNS-SD advertisement of the requesting commissionee.
235
+ * @param[in] productId The productId in the DNS-SD advertisement of the requesting commissionee.
236
+ * @param[in] rotatingId The rotatingId in the DNS-SD advertisement of the requesting commissionee.
237
+ *
238
+ */
239
+ virtual bool HasContentApp (uint16_t vendorId, uint16_t productId) = 0;
240
+
241
+ virtual ~AppInstallationService () = default ;
242
+ };
243
+
207
244
class DLL_EXPORT PostCommissioningListener
208
245
{
209
246
public:
@@ -392,6 +429,11 @@ class CommissionerDiscoveryController : public chip::Protocols::UserDirectedComm
392
429
inline void SetPasscodeService (PasscodeService * passcodeService) { mPasscodeService = passcodeService; }
393
430
inline PasscodeService * GetPasscodeService () { return mPasscodeService ; }
394
431
432
+ /* *
433
+ * Assign an AppInstallationService
434
+ */
435
+ inline void SetAppInstallationService (AppInstallationService * appInstallationService) { mAppInstallationService = appInstallationService; }
436
+
395
437
/* *
396
438
* Assign a Commissioner Callback to perform commissioning once user consent has been given
397
439
*/
@@ -430,6 +472,7 @@ class CommissionerDiscoveryController : public chip::Protocols::UserDirectedComm
430
472
UserDirectedCommissioningServer * mUdcServer = nullptr ;
431
473
UserPrompter * mUserPrompter = nullptr ;
432
474
PasscodeService * mPasscodeService = nullptr ;
475
+ AppInstallationService * mAppInstallationService = nullptr ;
433
476
CommissionerCallback * mCommissionerCallback = nullptr ;
434
477
PostCommissioningListener * mPostCommissioningListener = nullptr ;
435
478
};
0 commit comments