@@ -472,7 +472,7 @@ DeviceCommissioner::DeviceCommissioner() :
472
472
DeviceCommissioner::~DeviceCommissioner ()
473
473
{
474
474
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
475
- SetChkObjValid (( void *) this , ObjChkAction::Clear, nullptr );
475
+ DeviceLayer::ConnectivityMgr (). WiFiPAFCancelConnect ( );
476
476
#endif
477
477
}
478
478
@@ -833,7 +833,6 @@ CHIP_ERROR DeviceCommissioner::EstablishPASEConnection(NodeId remoteDeviceId, Re
833
833
ExitNow (CHIP_ERROR_INTERNAL);
834
834
}
835
835
mRendezvousParametersForDeviceDiscoveredOverWiFiPAF = params;
836
- SetChkObjValid ((void *) this , ObjChkAction::Set, nullptr );
837
836
DeviceLayer::ConnectivityMgr ().WiFiPAFConnect (params.GetSetupDiscriminator ().value (), (void *) this ,
838
837
OnWiFiPAFSubscribeComplete, OnWiFiPAFSubscribeError);
839
838
ExitNow (CHIP_NO_ERROR);
@@ -908,70 +907,8 @@ void DeviceCommissioner::OnDiscoveredDeviceOverBleError(void * appState, CHIP_ER
908
907
#endif // CONFIG_NETWORK_LAYER_BLE
909
908
910
909
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
911
- void DeviceCommissioner::SetChkObjValid (void * appObj, ObjChkAction action, bool * pIsObjValid)
912
- {
913
- static std::vector<void *> ObjVector;
914
- bool IsObjValid = false ;
915
-
916
- switch (action)
917
- {
918
- case ObjChkAction::Set: {
919
- for (auto lt = ObjVector.begin (); lt != ObjVector.end (); lt++)
920
- {
921
- if (*lt == appObj)
922
- {
923
- IsObjValid = true ;
924
- break ;
925
- }
926
- }
927
- if (IsObjValid == false )
928
- {
929
- ObjVector.push_back (appObj);
930
- IsObjValid = true ;
931
- }
932
- }
933
- break ;
934
- case ObjChkAction::Check: {
935
- for (auto lt = ObjVector.begin (); lt != ObjVector.end (); lt++)
936
- {
937
- if (*lt == appObj)
938
- {
939
- IsObjValid = true ;
940
- break ;
941
- }
942
- }
943
- }
944
- break ;
945
- case ObjChkAction::Clear: {
946
- for (auto lt = ObjVector.begin (); lt != ObjVector.end (); lt++)
947
- {
948
- if (*lt == appObj)
949
- {
950
- // Already existed in the list => Remove it
951
- ObjVector.erase (lt);
952
- break ;
953
- }
954
- }
955
- }
956
- break ;
957
- }
958
- if (pIsObjValid != nullptr )
959
- {
960
- *pIsObjValid = IsObjValid;
961
- }
962
- return ;
963
- }
964
-
965
910
void DeviceCommissioner::OnWiFiPAFSubscribeComplete (void * appState)
966
911
{
967
- bool isObjValid;
968
- SetChkObjValid (appState, ObjChkAction::Check, &isObjValid);
969
- if (isObjValid == false )
970
- {
971
- // The caller has been released.
972
- ChipLogError (Controller, " DeviceCommissioner has been destroyed!" );
973
- return ;
974
- }
975
912
auto self = (DeviceCommissioner *) appState;
976
913
auto device = self->mDeviceInPASEEstablishment ;
977
914
@@ -989,14 +926,6 @@ void DeviceCommissioner::OnWiFiPAFSubscribeComplete(void * appState)
989
926
990
927
void DeviceCommissioner::OnWiFiPAFSubscribeError (void * appState, CHIP_ERROR err)
991
928
{
992
- bool isObjValid;
993
- SetChkObjValid (appState, ObjChkAction::Check, &isObjValid);
994
- if (isObjValid == false )
995
- {
996
- // The caller has been released.
997
- ChipLogError (Controller, " DeviceCommissioner has been destroyed!" );
998
- return ;
999
- }
1000
929
auto self = (DeviceCommissioner *) appState;
1001
930
auto device = self->mDeviceInPASEEstablishment ;
1002
931
0 commit comments