|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
External-feature host API: one plugin invokes a named feature provided by another installed plugin ("Open with" semantics). More...
#include "plugin_manager/host_api.h"#include "plugin_manager/ExtFeatureName.h"#include "plugin_manager/Plugin.h"#include "plugin_manager/PluginManager.h"#include "cdc_views/MessageBox.h"#include "cdc_ui/I18n.h"#include "cdc_log.h"#include "esp_heap_caps.h"#include "freertos/FreeRTOS.h"#include "freertos/semphr.h"#include <cstring>#include <string>Go to the source code of this file.
Functions | |
| void * | plg_get_active_plugin (void) |
| int | host_ext_feature_available (const char *feature) |
| Check whether an installed plugin provides feature. | |
| int | host_ext_feature_use (const char *feature, const uint8_t *data, size_t len, uint32_t status_action_id) |
| Invoke feature with a payload; the provider runs in the foreground. | |
| int | host_ext_feature_register_handler (const char *feature, uint32_t action_id) |
| Register this plugin as the live handler for a feature it provides. | |
| int | host_ext_feature_consume (uint8_t *buf, size_t buf_size, char *feature_out, size_t feature_size) |
| Pull the payload of the job that fired the current handler action. | |
| int | host_ext_feature_result (int32_t status_code) |
| Report the outcome of the job this provider is currently handling. | |
| void | plg_ext_feature_pump (void) |
| void | plg_ext_feature_on_unload (void *plugin) |
External-feature host API: one plugin invokes a named feature provided by another installed plugin ("Open with" semantics).
Threading mirrors host_api_msg.cpp. host_ext_feature_use runs inside the caller's WASM frame and only stashes the job (it must never start the provider inline - startPlugin would tear down the executing caller instance). plg_ext_feature_pump() runs on the plugin tick task, switches the provider to the foreground and fires its handler action; the payload is consumable for that dispatch only. The provider later reports the outcome via host_ext_feature_result, which routes the status back to the caller as an action - if the caller is still loaded.
All state below is touched from WASM frames (tick task or UI dispatch) and the pump; a single mutex keeps the job slot consistent across those paths.
Definition in file host_api_ext_feature.cpp.
| void plg_ext_feature_on_unload | ( | void * | plugin | ) |
Definition at line 295 of file host_api_ext_feature.cpp.
References HOST_EXT_FEATURE_STATUS_ERROR.
| void plg_ext_feature_pump | ( | void | ) |
Definition at line 240 of file host_api_ext_feature.cpp.
References HOST_EXT_FEATURE_NAME_MAX, HOST_EXT_FEATURE_STATUS_ERROR, cdc::plugin_manager::PluginManager::instance(), LOG_W, cdc::plugin_manager::Ok, and TAG.
Referenced by cdc::plugin_manager::PluginManager::dispatchTick().
| void * plg_get_active_plugin | ( | void | ) |
Definition at line 24 of file plugin_log_bridge.cpp.
Referenced by host_ext_feature_register_handler(), host_ext_feature_result(), and host_ext_feature_use().