Device Base Class
Public header: #include "brookesia/hal_interface/device.hpp"
API Reference
Header File
Classes
-
class Device
Base class for HAL devices.
A concrete device can publish one or more interface instances through
interfaces_during initialization, then those interfaces can be queried from the global registry.Subclassed by esp_brookesia::hal::AudioDevice, esp_brookesia::hal::DisplayDevice, esp_brookesia::hal::StorageDevice
Public Functions
-
virtual bool probe() = 0
Check whether the device is supported on current runtime conditions.
- Returns
trueif the device can be initialized; otherwisefalse.
-
inline const std::string &get_name() const
Get the registry name of this device.
- Returns
Device name.
- template<typename T> inline requires IsInterface< T > std::shared_ptr< T > get_interface (const std::string &name) const
Retrieve a typed interface owned by this device by interface registry name.
-
virtual bool probe() = 0
Type Aliases
-
using esp_brookesia::hal::DeviceRegistry = lib_utils::PluginRegistry<Device>
Registry alias for HAL devices.