Monitor
Functions to monitor system operations. More...
Data Structures |
|
struct | gos_system_monitor_t |
Functions |
|
gos_result_t | gos_register_system_monitor ( gos_system_monitor_t *system_monitor, uint32_t permitted_delay_ms, gos_handler_noarg_t callback) |
gos_result_t | gos_unregister_system_monitor ( gos_system_monitor_t *system_monitor) |
gos_result_t | gos_update_system_monitor ( gos_system_monitor_t *system_monitor, uint32_t permitted_delay_ms) |
Detailed Description
Functions to monitor system operations.
Function Documentation
◆ gos_register_system_monitor()
gos_result_t gos_register_system_monitor | ( | gos_system_monitor_t * |
system_monitor,
|
uint32_t |
permitted_delay_ms,
|
||
gos_handler_noarg_t |
callback
|
||
) |
Registers a system monitor with the system monitor thread
A system monitor ensures the app thread or other construct is not locked up. This is done by periodically updating the monitor before a timeout. If the timeout expires a watchdog is triggered which performs a software reset.
A system monitor works as follows:
- Register a system monitor by calling: gos_register_system_monitor()
- Once the monitor is registered, gos_update_system_monitor() MUST be called before permitted_delay milliseconds expires otherwise a watchdog fault will occur.
- Use gos_unregister_system_monitor() to unregister the monitor.
- Note
- ALL system monitors must be unregistered before the app exits, i.e. during gos_deinit()
- Parameters
-
[out] system_monitor
: A pointer to a system monitor object that will be watched [in] permitted_delay_ms
: The maximum time in milliseconds allowed between monitor updates [in] callback
: Optional callback to be invoked when gos_update_system_monitor() is called for the monitor. Leave NULL if unused.
- Returns
- gos_result_t
- Examples:
- hurricane/security_camera/camera.c , and system/system_monitor/main.c .
◆ gos_unregister_system_monitor()
gos_result_t gos_unregister_system_monitor | ( | gos_system_monitor_t * |
system_monitor
|
) |
Unregister system monitor
This removes a system monitor.
- Parameters
-
system_monitor
System monitor object to unregister
- Returns
- gos_result_t
- Examples:
- hurricane/security_camera/camera.c , and system/system_monitor/main.c .
◆ gos_update_system_monitor()
gos_result_t gos_update_system_monitor | ( | gos_system_monitor_t * |
system_monitor,
|
uint32_t |
permitted_delay_ms
|
||
) |
Updates a system monitor and resets the last update time
After a system monitor is registered, this must be called before permitted_delay milliseconds expires otherwise a watchdog will be triggered.
- Parameters
-
[out] system_monitor
: A pointer to a system monitor object to be updated [in] permitted_delay_ms
: The maximum time in milliseconds allowed between monitor updates
- Returns
- gos_result_t
- Examples:
- hurricane/security_camera/camera.c , and system/system_monitor/main.c .