CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
host_api_vcard.cpp File Reference

vCard host API: read and manage the own card plus the received-card store, addressed by sorted position like the firmware's contact list. More...

#include "plugin_manager/host_api.h"
#include "plugin_manager/Plugin.h"
#include "mod_vcard/vcard_store.h"
#include "cdc_log.h"
#include <cstring>

Go to the source code of this file.

Functions

void * plg_get_active_plugin (void)
int host_vcard_get_own (char *out, size_t out_size)
 Copy the badge's own vCard text into out.
int host_vcard_received_count (void)
 Number of received vCards in the store.
int host_vcard_received_get (uint16_t index, char *out, size_t out_size)
 Copy the received vCard at sorted position index into out.
int host_vcard_received_display (uint16_t index, char *out, size_t out_size)
 Copy the display name of the received vCard at sorted position index into out (for list rows).
int host_vcard_set_own (const char *vcard, size_t len)
 Set / replace the badge's own vCard.
int host_vcard_received_add (const char *vcard, size_t len)
 Store a new received vCard.
int host_vcard_received_update (uint16_t index, const char *vcard, size_t len)
 Overwrite the received vCard at sorted position index.
int host_vcard_received_delete (uint16_t index)
 Delete the received vCard at sorted position index.

Detailed Description

vCard host API: read and manage the own card plus the received-card store, addressed by sorted position like the firmware's contact list.

All calls run inside a WASM frame on the plugin tick task; the vcard store does its own NVS-backed lazy loading, so no extra synchronisation is needed here. Strings cross the WASM boundary as stored (vCard 4.0 UTF-8 text).

Definition in file host_api_vcard.cpp.

Function Documentation

◆ plg_get_active_plugin()

void * plg_get_active_plugin ( void )

Definition at line 24 of file plugin_log_bridge.cpp.