CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
Plugin lifecycle

Opt-in background residency. More...

Functions

int host_set_resident (bool resident)
 Request (true) or drop (false) background residency. Needs the background or autoload capability to have any effect.

Detailed Description

Opt-in background residency.

The background and autoload capabilities only grant permission to stay resident; they do not by themselves keep the plugin loaded. A plugin must call host_set_resident(true) to actually remain in the background (typically in plugin_init for an autoload service, or while running for a background one). Without it, the plugin is torn down when the user leaves it, and an autoload plugin is unloaded right after boot init. Pass false to opt back out.

Function Documentation

◆ host_set_resident()

int host_set_resident ( bool resident)

Request (true) or drop (false) background residency. Needs the background or autoload capability to have any effect.

Returns
HOST_OK, or HOST_ERR_GENERIC if called with no active plugin.

Definition at line 19 of file host_api_lifecycle.cpp.

References HOST_ERR_GENERIC, HOST_OK, plg_get_active_plugin(), and resident.

Referenced by cdc::plugin_manager::w_host_set_resident().