Skip to content

Commit

Permalink
Set DeviceInstanceInfoProvider to the platform implementation.
Browse files Browse the repository at this point in the history
In the project-chip#19514 there was a mistake made.
Within some platforms, the DeviceInstanceInfoProvider was set to
a generic one instead of the platform implementation.

To resolve this issue, the DeviceInstanceInfoProvider has been
set to the proper one in PlatformManager implementation for
Android, Darwin, Linux, Tizen, and WebOS.
  • Loading branch information
ArekBalysNordic committed Jul 13, 2022
1 parent a903f59 commit 6b99092
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/platform/Darwin/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@

#include <platform/internal/CHIPDeviceLayerInternal.h>

#include <platform/Darwin/DeviceInstanceInfoProviderImpl.h>
#include <platform/Darwin/DiagnosticDataProviderImpl.h>
#include <platform/DeviceInstanceInfoProvider.h>
#include <platform/PlatformManager.h>

// Include the non-inline definitions for the GenericPlatformManagerImpl<> template,
Expand All @@ -48,6 +50,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack()
#endif // CHIP_DISABLE_PLATFORM_KVS
SetConfigurationMgr(&ConfigurationManagerImpl::GetDefaultInstance());
SetDiagnosticDataProvider(&DiagnosticDataProviderImpl::GetDefaultInstance());
SetDeviceInstanceInfoProvider(&DeviceInstanceInfoProviderMgrImpl());

mRunLoopSem = dispatch_semaphore_create(0);

Expand Down
3 changes: 3 additions & 0 deletions src/platform/Linux/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <lib/support/CHIPMem.h>
#include <lib/support/logging/CHIPLogging.h>
#include <platform/DeviceControlServer.h>
#include <platform/DeviceInstanceInfoProvider.h>
#include <platform/Linux/DeviceInstanceInfoProviderImpl.h>
#include <platform/Linux/DiagnosticDataProviderImpl.h>
#include <platform/PlatformManager.h>
#include <platform/internal/GenericPlatformManagerImpl_POSIX.ipp>
Expand Down Expand Up @@ -175,6 +177,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack()
ReturnErrorOnFailure(Internal::PosixConfig::Init());
SetConfigurationMgr(&ConfigurationManagerImpl::GetDefaultInstance());
SetDiagnosticDataProvider(&DiagnosticDataProviderImpl::GetDefaultInstance());
SetDeviceInstanceInfoProvider(&DeviceInstanceInfoProviderMgrImpl());

// Call _InitChipStack() on the generic implementation base class
// to finish the initialization process.
Expand Down
3 changes: 3 additions & 0 deletions src/platform/Tizen/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@

#include <platform/internal/CHIPDeviceLayerInternal.h>

#include <platform/DeviceInstanceInfoProvider.h>
#include <platform/PlatformManager.h>
#include <platform/Tizen/DeviceInstanceInfoProviderImpl.h>
#include <platform/Tizen/DiagnosticDataProviderImpl.h>
#include <platform/internal/GenericPlatformManagerImpl_POSIX.ipp>

Expand All @@ -39,6 +41,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void)
ReturnErrorOnFailure(Internal::PosixConfig::Init());
SetConfigurationMgr(&ConfigurationManagerImpl::GetDefaultInstance());
SetDiagnosticDataProvider(&DiagnosticDataProviderImpl::GetDefaultInstance());
SetDeviceInstanceInfoProvider(&DeviceInstanceInfoProviderMgrImpl());

return Internal::GenericPlatformManagerImpl_POSIX<PlatformManagerImpl>::_InitChipStack();
}
Expand Down
3 changes: 3 additions & 0 deletions src/platform/android/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@

#include <lib/support/CHIPMem.h>
#include <lib/support/logging/CHIPLogging.h>
#include <platform/DeviceInstanceInfoProvider.h>
#include <platform/PlatformManager.h>
#include <platform/android/DeviceInstanceInfoProviderImpl.h>
#include <platform/android/DiagnosticDataProviderImpl.h>
#include <platform/internal/GenericPlatformManagerImpl_POSIX.ipp>

Expand All @@ -46,6 +48,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack()
SuccessOrExit(err);
SetConfigurationMgr(&ConfigurationManagerImpl::GetDefaultInstance());
SetDiagnosticDataProvider(&DiagnosticDataProviderImpl::GetDefaultInstance());
SetDeviceInstanceInfoProvider(&DeviceInstanceInfoProviderMgrImpl());

// Call _InitChipStack() on the generic implementation base class
// to finish the initialization process.
Expand Down
3 changes: 3 additions & 0 deletions src/platform/webos/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
#include <lib/support/CHIPMem.h>
#include <lib/support/logging/CHIPLogging.h>
#include <platform/DeviceControlServer.h>
#include <platform/DeviceInstanceInfoProvider.h>
#include <platform/PlatformManager.h>
#include <platform/internal/GenericPlatformManagerImpl_POSIX.ipp>
#include <platform/webos/DeviceInfoProviderImpl.h>
#include <platform/webos/DeviceInstanceInfoProviderImpl.h>
#include <platform/webos/DiagnosticDataProviderImpl.h>

#include <thread>
Expand Down Expand Up @@ -166,6 +168,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack()
SetConfigurationMgr(&ConfigurationManagerImpl::GetDefaultInstance());
SetDiagnosticDataProvider(&DiagnosticDataProviderImpl::GetDefaultInstance());
SetDeviceInfoProvider(&DeviceInfoProviderImpl::GetDefaultInstance());
SetDeviceInstanceInfoProvider(&DeviceInstanceInfoProviderMgrImpl());

// Call _InitChipStack() on the generic implementation base class
// to finish the initialization process.
Expand Down

0 comments on commit 6b99092

Please sign in to comment.