Abstract interface for hardware peripheral packages.
More...
#include <IDekiPackage.h>
|
| virtual | ~IDekiPackage ()=default |
| virtual const char * | GetPackageId () const =0 |
| | Get the unique package identifier.
|
| virtual const char * | GetPackageName () const =0 |
| | Get the human-readable package name.
|
| virtual const char * | GetPackageCategory () const =0 |
| | Get the package category for UI grouping.
|
| virtual void | Configure (const PackageConfig &config)=0 |
| | Configure the package with pin mappings and settings.
|
| virtual bool | Initialize ()=0 |
| | Initialize the package hardware.
|
| virtual void | Shutdown ()=0 |
| | Shutdown the package and release resources.
|
| virtual void | Update (float deltaTime)=0 |
| | Update the package (called each frame).
|
| virtual PackageState | GetState () const =0 |
| | Get the current package state.
|
| virtual const char * | GetLastError () const =0 |
| | Get the last error message.
|
Abstract interface for hardware peripheral packages.
This interface defines the contract that hardware packages (SD card, GPS, WiFi, etc.) must implement to work with the Deki engine. Packages are discovered via plugin exports and configured through the editor's platform configuration.
Lifecycle:
- Package created via factory
- Configure() called with pin/setting configuration
- Initialize() called to set up hardware
- Update() called each frame (for polling packages)
- Shutdown() called on engine shutdown
◆ ~IDekiPackage()
| virtual IDekiPackage::~IDekiPackage |
( |
| ) |
|
|
virtualdefault |
◆ GetPackageId()
| virtual const char * IDekiPackage::GetPackageId |
( |
| ) |
const |
|
pure virtual |
Get the unique package identifier.
- Returns
- Package ID string (e.g., "sd_card", "gps", "wifi")
◆ GetPackageName()
| virtual const char * IDekiPackage::GetPackageName |
( |
| ) |
const |
|
pure virtual |
Get the human-readable package name.
- Returns
- Display name (e.g., "SD Card", "GPS Package")
◆ GetPackageCategory()
| virtual const char * IDekiPackage::GetPackageCategory |
( |
| ) |
const |
|
pure virtual |
Get the package category for UI grouping.
- Returns
- Category string (e.g., "storage", "sensors", "communication")
◆ Configure()
| virtual void IDekiPackage::Configure |
( |
const PackageConfig & | config | ) |
|
|
pure virtual |
Configure the package with pin mappings and settings.
Called before Initialize() to provide configuration from the platform. The package should store these settings for use during initialization.
- Parameters
-
| config | Configuration containing pins and settings |
◆ Initialize()
| virtual bool IDekiPackage::Initialize |
( |
| ) |
|
|
pure virtual |
Initialize the package hardware.
Called after Configure(). Should set up hardware, allocate resources, and prepare the package for operation.
- Returns
- true if initialization successful, false otherwise
◆ Shutdown()
| virtual void IDekiPackage::Shutdown |
( |
| ) |
|
|
pure virtual |
Shutdown the package and release resources.
Called during engine shutdown or when package is disabled. Should safely release all hardware resources.
◆ Update()
| virtual void IDekiPackage::Update |
( |
float | deltaTime | ) |
|
|
pure virtual |
Update the package (called each frame).
For polling-based packages (e.g., GPS), this is called each frame to read data and update state. For event-based packages, this may be a no-op.
- Parameters
-
| deltaTime | Time elapsed since last frame in seconds |
◆ GetState()
Get the current package state.
- Returns
- Current lifecycle state
◆ GetLastError()
| virtual const char * IDekiPackage::GetLastError |
( |
| ) |
const |
|
pure virtual |
Get the last error message.
- Returns
- Error string, or empty string if no error
The documentation for this class was generated from the following file: