File syn_ao.c¶
Go to the source code of this file
Active Object framework implementation.
#include "../port/syn_port_system.h"#include "../sched/syn_sched.h"#include "../util/syn_assert.h"#include "syn_ao.h"
Public Functions¶
| Type | Name |
|---|---|
| void | syn_ao_init (SYN_ActiveObject * ao, const char * name, const SYN_FSM_Transition * transitions, SYN_FSM_State initial_state, void * mailbox_buf, size_t mailbox_cap) Initialize an Active Object. |
| bool | syn_ao_post (SYN_ActiveObject * ao, uint16_t sig, void * data) Post an event to the Active Object's mailbox. |
Public Static Functions¶
| Type | Name |
|---|---|
| SYN_PT_Status | syn_ao_pt_run (SYN_PT * pt, SYN_Task * task) Protothread entry for active objects dispatches queued events. |
Public Functions Documentation¶
function syn_ao_init¶
Initialize an Active Object.
void syn_ao_init (
SYN_ActiveObject * ao,
const char * name,
const SYN_FSM_Transition * transitions,
SYN_FSM_State initial_state,
void * mailbox_buf,
size_t mailbox_cap
)
Parameters:
aoActive Object instance.nameName of the active object (used for task/logging).transitionsTransition table for the internal state machine.initial_stateInitial state of the state machine.mailbox_bufBuffer backing the mailbox event queue.mailbox_capCapacity (number of elements) of the buffer.
function syn_ao_post¶
Post an event to the Active Object's mailbox.
Thread-safe and ISR-safe. Protects the mailbox write using critical sections.
Parameters:
aoActive Object instance.sigSignal identifier.dataOptional payload.
Returns:
true if the event was successfully queued, false if queue is full.
Public Static Functions Documentation¶
function syn_ao_pt_run¶
Protothread entry for active objects dispatches queued events.
Parameters:
ptProtothread state.taskOwning scheduler task.
Returns:
PT status.
The documentation for this class was generated from the following file src/syntropic/sched/syn_ao.c