|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
#include <SaoModule.h>
Public Member Functions | |
| const char * | getVersion () const override |
| Returns the module version string. | |
| bool | init () override |
| bool | start () override |
| Default start() implementation performing the standard transition. | |
| uint8_t | getMenuItems (core::ModuleMenuItem *items, uint8_t maxItems) override |
| Returns module menu items. | |
| void | onUnlock () override |
| Called when device is unlocked. | |
| Public Member Functions inherited from cdc::core::ModuleBase | |
| ModuleBase (const char *name) | |
| Constructs a module base with the given module name. | |
| const char * | getName () const override |
| Returns the module name supplied to the constructor. | |
| ServiceState | getState () const override |
| Returns the current service state. | |
| void | stop () override |
| Default stop() implementation that transitions to STOPPED. | |
| Public Member Functions inherited from cdc::core::IModule | |
| virtual bool | exportBackup (cJSON *out) |
| Exports this module's data as a JSON section for the backup file. | |
| virtual BackupResult | importBackup (const cJSON *in) |
| Restores this module's data from its JSON backup section. | |
| virtual ui::IView * | getEntryView () |
| Returns the module's entry view (main view when selected from menu). | |
| virtual uint8_t | getLockScreenContextItems (LockScreenContextItem *items, uint8_t maxItems) |
| Returns the module's lock screen context menu items. | |
| virtual void | onLock () |
| Called when device is locked. | |
| virtual void | onUsbConnect () |
| Called when USB is connected. | |
| virtual void | onUsbDisconnect () |
| Called when USB is disconnected. | |
| virtual void | onTick (uint32_t nowMs) |
| Called periodically (optional tick for background work). | |
| virtual void | setSlotRange (const SlotRange &range) |
| Sets the slot range assigned by the module registry (from compile-time memory map). | |
| virtual SlotRequest | getSlotRequest () const |
| Returns slot requirements for this module (from compile-time memory map). | |
| Public Member Functions inherited from cdc::core::IService | |
| virtual | ~IService ()=default |
Static Public Member Functions | |
| static SaoModule & | instance () |
Additional Inherited Members | |
| Protected Attributes inherited from cdc::core::ModuleBase | |
| const char * | name_ = nullptr |
| ServiceState | state_ = ServiceState::UNINITIALIZED |
Definition at line 7 of file SaoModule.h.
|
overridevirtual |
Returns module menu items.
| items | Output array to fill. |
| maxItems | Maximum items to return. |
Reimplemented from cdc::core::IModule.
Definition at line 53 of file SaoModule.cpp.
References cdc::mod_sao::getInfoView(), cdc::core::ModuleBase::getName(), cdc::core::TOOLS_MENU, and cdc::ui::tr().
|
inlineoverridevirtual |
Returns the module version string.
Implements cdc::core::IModule.
Definition at line 11 of file SaoModule.h.
|
overridevirtual |
Initialize the service (called once during boot)
Implements cdc::core::IService.
Definition at line 35 of file SaoModule.cpp.
References cdc::core::INITIALIZED, cdc::core::ModuleRegistry::instance(), LOG_I, cdc::core::ModuleRegistry::registerModule(), cdc::mod_sao::registerStrings(), cdc::core::ModuleBase::state_, and TAG.
|
static |
Definition at line 30 of file SaoModule.cpp.
|
overridevirtual |
Called when device is unlocked.
Reimplemented from cdc::core::IModule.
Definition at line 67 of file SaoModule.cpp.
References sao_scan(), cdc::core::STARTED, and cdc::core::ModuleBase::state_.
|
overridevirtual |
Default start() implementation performing the standard transition.
Allowed source states are INITIALIZED and STOPPED. Derived classes with custom start logic should call this base implementation first and propagate its return value, or set state_ themselves if they require a different transition policy.
Reimplemented from cdc::core::ModuleBase.
Definition at line 43 of file SaoModule.cpp.
References LOG_W, sao_init(), cdc::core::ModuleBase::start(), and TAG.