Firmware
|
Power-related API. More...
#include <stdbool.h>
Go to the source code of this file.
Functions | |
__EXPORT int | px4_register_shutdown_hook (shutdown_hook_t hook) |
Register a method that should be called when powering off (and also on reboot). More... | |
__EXPORT int | px4_unregister_shutdown_hook (shutdown_hook_t hook) |
Unregister a shutdown hook. More... | |
__EXPORT int | px4_shutdown_request (bool reboot, bool to_bootloader) |
Request the system to shut down or reboot. More... | |
__EXPORT int | px4_shutdown_lock (void) |
Grab the shutdown lock. More... | |
__EXPORT int | px4_shutdown_unlock (void) |
Release the shutdown lock. More... | |
Variables | |
__BEGIN_DECLS typedef bool(* | shutdown_hook_t )(void) |
Shutdown hook callback method (. More... | |
Power-related API.
__EXPORT int px4_register_shutdown_hook | ( | shutdown_hook_t | hook | ) |
Register a method that should be called when powering off (and also on reboot).
hook | callback method. It must not block, but return immediately. When the system is requested to shutdown, the registered hooks will be called regularily until either all of them return true, or a timeout is reached. |
__EXPORT int px4_shutdown_lock | ( | void | ) |
Grab the shutdown lock.
It will prevent the system from shutting down until the lock is released. It is safe to call this recursively.
__EXPORT int px4_shutdown_request | ( | bool | reboot, |
bool | to_bootloader | ||
) |
Request the system to shut down or reboot.
Note the following:
reboot | perform a reboot instead of a shutdown |
to_bootloader | reboot into bootloader mode (only used if reboot is true) |
__EXPORT int px4_shutdown_unlock | ( | void | ) |
Release the shutdown lock.
__EXPORT int px4_unregister_shutdown_hook | ( | shutdown_hook_t | hook | ) |
Unregister a shutdown hook.
hook | callback method to be removed |
__BEGIN_DECLS typedef bool(* shutdown_hook_t) (void) |
Shutdown hook callback method (.