blob: 5e5e9aefff650a0657f3a101c9167942d872f853 [file] [log] [blame]
/*
*
* <COPYRIGHT>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* Provides an implementation of the PlatformManager object.
*/
#ifndef PLATFORM_MANAGER_IMPL_H
#define PLATFORM_MANAGER_IMPL_H
#include <platform/internal/GenericPlatformManagerImpl_FreeRTOS.h>
namespace chip {
namespace DeviceLayer {
/**
* Concrete implementation of the PlatformManager singleton object for the nRF52 platform.
*/
class PlatformManagerImpl final
: public PlatformManager,
public Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>
{
// Allow the PlatformManager interface class to delegate method calls to
// the implementation methods provided by this class.
friend PlatformManager;
// Allow the generic implementation base class to call helper methods on
// this class.
friend Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>;
public:
// ===== Platform-specific members that may be accessed directly by the application.
/* none so far */
private:
// ===== Methods that implement the PlatformManager abstract interface.
CHIP_ERROR _InitChipStack(void);
// ===== Members for internal use by the following friends.
friend PlatformManager & PlatformMgr(void);
friend PlatformManagerImpl & PlatformMgrImpl(void);
friend class Internal::BLEManagerImpl;
static PlatformManagerImpl sInstance;
using Internal::GenericPlatformManagerImpl_FreeRTOS<PlatformManagerImpl>::PostEventFromISR;
};
/**
* Returns the public interface of the PlatformManager singleton object.
*
* chip applications should use this to access features of the PlatformManager object
* that are common to all platforms.
*/
inline PlatformManager & PlatformMgr(void)
{
return PlatformManagerImpl::sInstance;
}
/**
* Returns the platform-specific implementation of the PlatformManager singleton object.
*
* chip applications can use this to gain access to features of the PlatformManager
* that are specific to the ESP32 platform.
*/
inline PlatformManagerImpl & PlatformMgrImpl(void)
{
return PlatformManagerImpl::sInstance;
}
} // namespace DeviceLayer
} // namespace chip
#endif // PLATFORM_MANAGER_IMPL_H