What a hardware peripheral package (SD card, GPS, WiFi, ...) implements.
More...
#include <deki/providers/IPackage.h>
|
| virtual | ~IPackage ()=default |
| virtual const char * | GetPackageId () const =0 |
| | Unique id, such as "sd_card", "gps" or "wifi".
|
| virtual const char * | GetPackageName () const =0 |
| | Display name, such as "SD Card".
|
| virtual const char * | GetPackageCategory () const =0 |
| | Category for grouping in the UI, such as "storage" or "sensors".
|
| virtual void | Configure (const PackageConfig &config)=0 |
| | Receives the platform's pins and settings before Initialize(); keep them for it.
|
| virtual bool | Initialize ()=0 |
| | Sets up the hardware and resources, after Configure().
|
| virtual void | Shutdown ()=0 |
| | Releases all hardware resources, on engine shutdown or when the package is disabled.
|
| virtual void | Update (float deltaTime)=0 |
| | Called every frame with the seconds since the last one.
|
| virtual PackageState | GetState () const =0 |
| virtual const char * | GetLastError () const =0 |
| | The last error message, or "" when there was none.
|
What a hardware peripheral package (SD card, GPS, WiFi, ...) implements.
Packages are found through plugin exports and configured in the editor's platform configuration.
Lifecycle:
- created by a factory
- Configure() with the pins and settings
- Initialize() sets up the hardware
- Update() every frame
- Shutdown() on engine shutdown
◆ ~IPackage()
| virtual Deki::IPackage::~IPackage |
( |
| ) |
|
|
virtualdefault |
◆ GetPackageId()
| virtual const char * Deki::IPackage::GetPackageId |
( |
| ) |
const |
|
pure virtual |
Unique id, such as "sd_card", "gps" or "wifi".
◆ GetPackageName()
| virtual const char * Deki::IPackage::GetPackageName |
( |
| ) |
const |
|
pure virtual |
Display name, such as "SD Card".
◆ GetPackageCategory()
| virtual const char * Deki::IPackage::GetPackageCategory |
( |
| ) |
const |
|
pure virtual |
Category for grouping in the UI, such as "storage" or "sensors".
◆ Configure()
| virtual void Deki::IPackage::Configure |
( |
const PackageConfig & | config | ) |
|
|
pure virtual |
Receives the platform's pins and settings before Initialize(); keep them for it.
◆ Initialize()
| virtual bool Deki::IPackage::Initialize |
( |
| ) |
|
|
pure virtual |
Sets up the hardware and resources, after Configure().
Returns false on failure.
◆ Shutdown()
| virtual void Deki::IPackage::Shutdown |
( |
| ) |
|
|
pure virtual |
Releases all hardware resources, on engine shutdown or when the package is disabled.
◆ Update()
| virtual void Deki::IPackage::Update |
( |
float | deltaTime | ) |
|
|
pure virtual |
Called every frame with the seconds since the last one.
Polling packages (such as GPS) read their data here; event-driven ones may do nothing.
◆ GetState()
◆ GetLastError()
| virtual const char * Deki::IPackage::GetLastError |
( |
| ) |
const |
|
pure virtual |
The last error message, or "" when there was none.
The documentation for this class was generated from the following file: