26 return p && p->manifest().capabilities.vcard;
30int resolve_sorted_slot(uint16_t index) {
33 if (index >= n)
return -1;
56 int slot = resolve_sorted_slot(index);
65 int slot = resolve_sorted_slot(index);
70 return static_cast<int>(std::strlen(out));
78 LOG_W(
"PLG_VCARD",
"set_own rejected: %s", err);
91 LOG_W(
"PLG_VCARD",
"add rejected: %s", err);
100 int slot = resolve_sorted_slot(index);
104 LOG_W(
"PLG_VCARD",
"update rejected: %s", err);
112 int slot = resolve_sorted_slot(index);
Owned WAMR module instance + per-plugin state.
CDC Log: logging over TinyUSB CDC and UART.
#define LOG_W(tag, fmt,...)
int host_vcard_received_count(void)
Number of received vCards in the store.
int host_vcard_received_add(const char *vcard, size_t len)
Store a new received vCard.
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.
#define HOST_VCARD_MAX_LEN
Maximum length of a single vCard text including the NUL.
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_get_own(char *out, size_t out_size)
Copy the badge's own vCard text into out.
int host_vcard_received_delete(uint16_t index)
Delete the received vCard at sorted position index.
int host_vcard_received_get(uint16_t index, char *out, size_t out_size)
Copy the received vCard at sorted position index into out.
CDC Badge OS plugin host API - canonical C ABI contract.
#define HOST_ERR_NO_CAPABILITY
#define HOST_ERR_INVALID_ARG
#define HOST_ERR_NO_MEMORY
#define HOST_ERR_NOT_FOUND
void * plg_get_active_plugin(void)
void * plg_get_active_plugin(void)
size_t vcard_store_get_own(char *out, size_t max_len)
Retrieves local own-vCard text.
bool vcard_store_set_own(const char *vcard, size_t len, char *err, size_t err_len)
Stores local own-vCard after validation and field filtering.
bool vcard_store_update(uint16_t slot, const char *vcard, size_t len, char *err, size_t err_len)
Overwrites the vCard stored at slot in place after validation.
size_t vcard_store_get(uint16_t slot, char *out, size_t max_len)
Retrieves raw vCard text from slot.
bool vcard_store_add(const char *vcard, size_t len, char *err, size_t err_len)
Adds peer vCard to first free slot after validation and duplicate check.
uint16_t vcard_store_get_sorted(uint16_t *out_slots, uint16_t max_slots)
Returns slot indices of stored cards sorted by last name.
uint16_t vcard_store_count(void)
Returns number of stored peer vCards.
bool vcard_store_contains(const char *vcard, size_t len)
Reports whether an exact-text vCard is already stored.
bool vcard_store_get_display(uint16_t slot, char *out, size_t max_len)
Retrieves cached display label for slot.
bool vcard_store_delete(uint16_t slot)
Deletes peer vCard at slot index.