@@ -197,10 +197,28 @@ JNI_METHOD(void, setChipDeviceEventProvider)(JNIEnv *, jobject, jobject provider
197
197
#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
198
198
class MyPincodeService : public PasscodeService
199
199
{
200
- bool HasTargetContentApp (uint16_t vendorId, uint16_t productId, chip::CharSpan rotatingId,
201
- chip::Protocols::UserDirectedCommissioning::TargetAppInfo & info, uint32_t & passcode ) override
200
+ void LookupTargetContentApp (uint16_t vendorId, uint16_t productId, chip::CharSpan rotatingId,
201
+ chip::Protocols::UserDirectedCommissioning::TargetAppInfo & info) override
202
202
{
203
- return ContentAppPlatform::GetInstance ().HasTargetContentApp (vendorId, productId, rotatingId, info, passcode);
203
+ uint32_t passcode;
204
+ bool foundApp = ContentAppPlatform::GetInstance ().HasTargetContentApp (vendorId, productId, rotatingId, info, passcode);
205
+ if (!foundApp)
206
+ {
207
+ info.checkState = chip::Controller::TargetAppCheckState::kAppNotFound ;
208
+ }
209
+ else if (passcode != 0 )
210
+ {
211
+ info.checkState = chip::Controller::TargetAppCheckState::kAppFoundPasscodeReturned ;
212
+ }
213
+ else
214
+ {
215
+ info.checkState = chip::Controller::TargetAppCheckState::kAppFoundNoPasscode ;
216
+ }
217
+ CommissionerDiscoveryController * cdc = GetCommissionerDiscoveryController ();
218
+ if (cdc != nullptr )
219
+ {
220
+ cdc->HandleTargetContentAppCheck (info, passcode);
221
+ }
204
222
}
205
223
206
224
uint32_t GetCommissionerPasscode (uint16_t vendorId, uint16_t productId, chip::CharSpan rotatingId) override
@@ -209,9 +227,14 @@ class MyPincodeService : public PasscodeService
209
227
return 12345678 ;
210
228
}
211
229
212
- uint32_t FetchCommissionPasscodeFromContentApp (uint16_t vendorId, uint16_t productId, CharSpan rotatingId) override
230
+ void FetchCommissionPasscodeFromContentApp (uint16_t vendorId, uint16_t productId, CharSpan rotatingId) override
213
231
{
214
- return ContentAppPlatform::GetInstance ().GetPasscodeFromContentApp (vendorId, productId, rotatingId);
232
+ uint32_t passcode = ContentAppPlatform::GetInstance ().GetPasscodeFromContentApp (vendorId, productId, rotatingId);
233
+ CommissionerDiscoveryController * cdc = GetCommissionerDiscoveryController ();
234
+ if (cdc != nullptr )
235
+ {
236
+ cdc->HandleContentAppPasscodeResponse (passcode);
237
+ }
215
238
}
216
239
};
217
240
MyPincodeService gMyPincodeService ;
0 commit comments