56 #include "unity_fixture.h"
58 #include "Mock_rkhport.h"
59 #include "Mockrkhtrc.h"
60 #include "Mockrkhsm.h"
61 #include "Mock_rkhqueue.h"
70 static RKHROM
RKH_ROM_T base = {0, 0,
"receiver"};
98 rkh_enter_critical_Expect();
100 rkh_exit_critical_Expect();
106 TEST(sma, UnRegister)
108 rkh_enter_critical_Expect();
110 rkh_exit_critical_Expect();
116 TEST(sma, Constructor)
118 rkh_sm_ctor_Expect(&(receiver.
sm));
123 TEST(sma, TerminateOneRegisteredAO)
125 rkh_enter_critical_Expect();
127 rkh_exit_critical_Expect();
131 rkh_enter_critical_Expect();
133 rkh_exit_critical_Expect();
141 TEST(sma, ActivateOneAO)
145 rkh_queue_init_Expect(&receiver.
equeue, &buff, 16, &receiver);
147 rkh_enter_critical_Expect();
149 rkh_exit_critical_Expect();
151 rkh_sm_init_Expect((
RKH_SM_T *)&receiver);
153 rkh_enter_critical_Expect();
155 rkh_exit_critical_Expect();
162 rkh_enter_critical_Expect();
163 rkh_queue_put_fifo_Expect(&receiver.
equeue, &event);
165 rkh_exit_critical_Expect();
172 rkh_enter_critical_Expect();
173 rkh_queue_put_lifo_Expect(&receiver.
equeue, &event);
175 rkh_exit_critical_Expect();
184 rkh_queue_get_ExpectAndReturn(&receiver.
equeue, &event);
185 rkh_enter_critical_Expect();
187 rkh_exit_critical_Expect();
190 TEST_ASSERT_EQUAL(&event, e);
195 rkh_enter_critical_Expect();
196 rkh_queue_put_fifo_Expect(&receiver.
equeue, &event);
198 rkh_exit_critical_Expect();
207 rkh_queue_get_ExpectAndReturn(&receiver.
equeue, NULL);
210 TEST_ASSERT_EQUAL(NULL, e);
void rkh_sma_activate(RKH_SMA_T *me, const RKH_EVT_T **qSto, RKH_QUENE_T qSize, void *stkSto, rui32_t stkSize)
Initializes and activates a previously created state machine application (SMA) as known as active obj...
RKHROM RKH_ROM_T * romrkh
Points to constant parameters of state machine.
RKH_EVT_T * rkh_sma_get(RKH_SMA_T *me)
Get an event from the event queue of an state machine application (SMA) as known as active object...
void rkh_sma_ctor(RKH_SMA_T *me, const RKHSmaVtbl *vtbl)
Initializes the virtual table of the active object instance and calls the constructor operation of it...
Describes the SMA (active object in UML).
Represents events without parameters.
RKH_SMA_T * rkh_sptbl[RKH_CFG_FWK_MAX_SMA]
Priority arranged table of registered SMA.
RKH_EQ_TYPE equeue
Event queue of the SMA (a.k.a Active Object).
Represents the filter of signal and active object.
void rkh_sma_defer(RKH_QUEUE_T *q, const RKH_EVT_T *e)
Defer an event to a given separate event queue.
RKH_SM_T sm
State machine.
#define RKH_FALSE
Standard define.
#define RKH_TE_SMA_UNREG
Removes the SMA as known as active object from the priority table, and thus from the framework...
void rkh_sma_post_lifo(RKH_SMA_T *me, const RKH_EVT_T *e, const void *const sender)
Send an event to a state machine application (SMA) as known as active object through a queue using th...
void rkh_sma_unregister(RKH_SMA_T *me)
Removes the SMA as known as active object from the priority table, and thus from the framework...
void rkh_sma_register(RKH_SMA_T *me)
Registers a state machine application (SMA) as known as active object into the framework, which implies to store a pointer to the SMA in the priority table.
Constant parameters of state machine.
#define RKH_TE_SMA_DEFER
Defer an event to a given separate event queue.
rui8_t prio
SMA (a.k.a Active Object) priority.
Describes the state machine.
Virtual table for the RKH_SMA_T structure.
RKH_EVT_T * rkh_sma_recall(RKH_SMA_T *me, RKH_QUEUE_T *q)
Recall a deferred event from a given event queue.
void rkh_sma_post_fifo(RKH_SMA_T *me, const RKH_EVT_T *e, const void *const sender)
Send an event to a state machine application (SMA) as known as active object through a queue using th...
void rkh_sma_terminate(RKH_SMA_T *me)
Terminate a state machine application (SMA) as known as active object.
#define RKH_TE_SMA_REG
Registers a state machine application (SMA) as known as active object into the framework, which implies to store a pointer to the SMA in the priority table.
#define RKH_TE_SMA_LIFO
Send an event to a state machine application (SMA) as known as active object through a queue using th...
#define RKH_TE_SMA_FIFO
Send an event to a state machine application (SMA) as known as active object through a queue using th...
#define RKH_TE_SMA_ACT
Initializes and activates a previously created state machine application (SMA) as known as active obj...
#define RKH_TE_SMA_GET
Get an event from the active object's queue.
#define RKH_TE_SMA_TERM
Terminate a state machine application (SMA) as known as active object.
Specifies the interface of the acive object (SMA state machine applications) manager.