CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
VcardModule.h
Go to the documentation of this file.
1#pragma once
2
3#include "cdc_core/IModule.h"
4
5struct cJSON;
6
7namespace cdc::mod_vcard {
8
9class VcardModule : public core::IModule {
10public:
11 static VcardModule& instance();
12
13 const char* getName() const override { return "mod_vcard"; }
14 const char* getVersion() const override { return "1.0.0"; }
15 core::ServiceState getState() const override { return state_; }
16
17 bool init() override;
18 bool start() override;
19 void stop() override;
20
21 uint8_t getMenuItems(core::ModuleMenuItem* items, uint8_t maxItems) override;
22 uint8_t getLockScreenContextItems(core::LockScreenContextItem* items, uint8_t maxItems) override;
23 void onTick(uint32_t nowMs) override;
24
25 bool exportBackup(cJSON* out) override;
26 core::IModule::BackupResult importBackup(const cJSON* in) override;
27
28private:
30};
31
32} // namespace cdc::mod_vcard
33
34extern "C" void mod_vcard_register();
void mod_vcard_register()
Registers vCard module initializer in global module registry.
Module interface that extends IService with module-specific features.
Definition IModule.h:55
void onTick(uint32_t nowMs) override
Periodic vCard module tick forwarding BLE state machine.
core::ServiceState getState() const override
Definition VcardModule.h:15
const char * getVersion() const override
Returns the module version string.
Definition VcardModule.h:14
void stop() override
Stops vCard BLE service and module runtime.
bool init() override
Initializes module UI strings, serial commands, and BLE service hooks.
static VcardModule & instance()
Returns singleton vCard module instance.
bool exportBackup(cJSON *out) override
Exports the own vCard and all received vCards into the backup section.
uint8_t getMenuItems(core::ModuleMenuItem *items, uint8_t maxItems) override
Provides tools-menu entry for vCard module.
bool start() override
Starts vCard module service.
core::IModule::BackupResult importBackup(const cJSON *in) override
Restores the own vCard and received vCards from the backup section.
const char * getName() const override
Definition VcardModule.h:13
uint8_t getLockScreenContextItems(core::LockScreenContextItem *items, uint8_t maxItems) override
Provides the lock-screen quick action that shows the owner vCard as a QR code.
Per-module restore outcome reported by importBackup().
Definition IModule.h:85
Lock screen context menu item registered by a module.
Definition IModule.h:42
Menu item registered by a module.
Definition IModule.h:29