|
Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
|
Periodic/cyclic safety task creation with fixed priorities (ADR-001). More...
Files | |
| file | src/oal/task/sapi_task.c |
| Task service: validates parameters, then dispatches to the backend registered via sapi_task_register_backend() (ADR-005). | |
Data Structures | |
| struct | sapi_task_config_t |
| Configuration for sapi_task_create(). More... | |
Typedefs | |
| typedef struct sapi_task_impl_s * | sapi_task_handle_t |
| Opaque handle to a created task, returned by sapi_task_create(). | |
| typedef void(*) | sapi_task_entry_t(void *user_ctx) |
| Task entry point, invoked cyclically at the configured period. | |
Functions | |
| SAFEAPI_DECLARE_STORAGE (sapi_task_storage_t, 128U) | |
| Caller-owned, fixed-size storage backing one sapi_task_handle_t. | |
| sapi_status_t | sapi_task_create (sapi_task_storage_t *storage, const sapi_task_config_t *config, sapi_task_handle_t *out_handle) |
| Creates a task in the suspended state. | |
| sapi_status_t | sapi_task_start (sapi_task_handle_t handle) |
| Starts a created task. | |
| sapi_status_t | sapi_task_suspend (sapi_task_handle_t handle) |
| Suspends a running task. | |
| sapi_status_t | sapi_task_destroy (sapi_task_handle_t handle) |
| Terminates and destroys a task. | |
Periodic/cyclic safety task creation with fixed priorities (ADR-001).
| typedef struct sapi_task_impl_s* sapi_task_handle_t |
Opaque handle to a created task, returned by sapi_task_create().
Definition at line 32 of file sapi_task.h.
| typedef void(*) sapi_task_entry_t(void *user_ctx) |
Task entry point, invoked cyclically at the configured period.
Definition at line 35 of file sapi_task.h.
| sapi_status_t sapi_task_create | ( | sapi_task_storage_t * | storage, |
| const sapi_task_config_t * | config, | ||
| sapi_task_handle_t * | out_handle ) |
Creates a task in the suspended state.
| storage | Caller-owned storage for the handle's state. Must not be NULL. |
| config | Task configuration. Must not be NULL; config->entry must not be NULL. |
| out_handle | Receives the created task's handle. Must not be NULL. |
Definition at line 44 of file sapi_task.c.
| sapi_status_t sapi_task_start | ( | sapi_task_handle_t | handle | ) |
Starts a created task.
| handle | Task handle. Must not be NULL. |
Definition at line 68 of file sapi_task.c.
| sapi_status_t sapi_task_suspend | ( | sapi_task_handle_t | handle | ) |
Suspends a running task.
| handle | Task handle. Must not be NULL. |
Definition at line 85 of file sapi_task.c.
| sapi_status_t sapi_task_destroy | ( | sapi_task_handle_t | handle | ) |
Terminates and destroys a task.
| handle | Task handle. Must not be NULL. Invalid to use after this call. |
Definition at line 102 of file sapi_task.c.