|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
#include <GpgModule.h>
Public Member Functions | |
| const char * | getName () const override |
| core::ServiceState | getState () const override |
| bool | init () override |
| Initializes GPG module resources and slot assignments. | |
| bool | start () override |
| Starts GPG module and registers USB CCID interface. | |
| void | stop () override |
| Stops GPG module and unregisters CCID interface. | |
| const char * | getVersion () const override |
| Returns the module version string. | |
| uint8_t | getMenuItems (core::ModuleMenuItem *items, uint8_t maxItems) override |
| Provides main-menu entry for GPG module. | |
| core::IModule::SlotRequest | getSlotRequest () const override |
| Declares slot requirements for GPG module. | |
| void | setSlotRange (const core::IModule::SlotRange &range) override |
| Stores slot range assigned by module registry. | |
| 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 | onUnlock () |
| Called when device is unlocked. | |
| 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). | |
| Public Member Functions inherited from cdc::core::IService | |
| virtual | ~IService ()=default |
Static Public Member Functions | |
| static GpgModule & | instance () |
| Returns singleton GPG module instance. | |
Definition at line 7 of file GpgModule.h.
|
overridevirtual |
Provides main-menu entry for GPG module.
| items | Output menu item array. |
| maxItems | Maximum writable entries. |
Reimplemented from cdc::core::IModule.
Definition at line 1013 of file GpgModule.cpp.
References getName(), instance(), cdc::core::MAIN_MENU, cdc::mod_gpg::onMenuSelect(), cdc::mod_gpg::rebuildMenu(), cdc::mod_gpg::s_menuView, cdc::mod_gpg::s_viewsInitialized, cdc::ui::showToastError(), and cdc::ui::tr().
|
inlineoverridevirtual |
Get service name (for logging/debugging)
Implements cdc::core::IService.
Definition at line 9 of file GpgModule.h.
Referenced by getMenuItems(), getSlotRequest(), init(), start(), and stop().
|
overridevirtual |
Declares slot requirements for GPG module.
Reimplemented from cdc::core::IModule.
Definition at line 999 of file GpgModule.cpp.
References getName(), cdc::core::IModule::SlotRequest::mapName, cdc::core::IModule::SlotRequest::minEccSlots, and cdc::core::IModule::SlotRequest::minRmemSlots.
|
inlineoverridevirtual |
Get current service state
Implements cdc::core::IService.
Definition at line 10 of file GpgModule.h.
|
inlineoverridevirtual |
Returns the module version string.
Implements cdc::core::IModule.
Definition at line 15 of file GpgModule.h.
|
overridevirtual |
Initializes GPG module resources and slot assignments.
Implements cdc::core::IService.
Definition at line 915 of file GpgModule.cpp.
References cdc::core::ModuleRegistry::clearModuleErrorByName(), cdc::core::ERROR, getName(), gpg_storage_ready(), gpg_storage_set_rmem_range(), gpg_storage_set_slot_range(), cdc::core::INITIALIZED, cdc::core::ModuleRegistry::instance(), LOG_I, cdc::mod_gpg::registerCommands(), cdc::core::ModuleRegistry::registerModule(), cdc::mod_gpg::registerStrings(), cdc::core::ModuleRegistry::reportModuleError(), and TAG.
|
static |
Returns singleton GPG module instance.
Definition at line 906 of file GpgModule.cpp.
Referenced by getMenuItems().
|
overridevirtual |
Stores slot range assigned by module registry.
| range | Slot assignment. |
Reimplemented from cdc::core::IModule.
Definition at line 991 of file GpgModule.cpp.
|
overridevirtual |
Starts GPG module and registers USB CCID interface.
Implements cdc::core::IService.
Definition at line 944 of file GpgModule.cpp.
References cdc::mod_gpg::ble_gpg_xsig_init(), cdc::mod_gpg::ble_gpg_xsig_set_received_callback(), cdc::core::Ccid, ccid_init(), cdc::core::UsbInterfaceSpec::cls, cdc::core::UsbInterfaceSpec::epInSize, cdc::core::UsbInterfaceSpec::epOutSize, getName(), cdc::core::INITIALIZED, cdc::core::ModuleRegistry::instance(), cdc::core::UsbManager::instance(), LOG_W, cdc::core::UsbInterfaceSpec::name, cdc::core::ModuleRegistry::reportModuleError(), cdc::core::STARTED, cdc::core::STOPPED, and TAG.
|
overridevirtual |
Stops GPG module and unregisters CCID interface.
Implements cdc::core::IService.
Definition at line 982 of file GpgModule.cpp.
References cdc::core::Ccid, getName(), cdc::core::UsbManager::instance(), cdc::core::STOPPED, and cdc::core::UsbManager::unregisterInterface().