RKH
test_rkhsma.c
Go to the documentation of this file.
1 /*
2  * --------------------------------------------------------------------------
3  *
4  * Framework RKH
5  * -------------
6  *
7  * State-machine framework for reactive embedded systems
8  *
9  * Copyright (C) 2010 Leandro Francucci.
10  * All rights reserved. Protected by international copyright laws.
11  *
12  *
13  * RKH is free software: you can redistribute it and/or modify it under the
14  * terms of the GNU General Public License as published by the Free Software
15  * Foundation, either version 3 of the License, or (at your option) any
16  * later version.
17  *
18  * RKH is distributed in the hope that it will be useful, but WITHOUT ANY
19  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
21  * more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with RKH, see copying.txt file.
25  *
26  * Contact information:
27  * RKH site: http://vortexmakes.com/que-es/
28  * RKH GitHub: https://github.com/vortexmakes/RKH
29  * RKH Sourceforge: https://sourceforge.net/projects/rkh-reactivesys/
30  * e-mail: lf@vortexmakes.com
31  * ---------------------------------------------------------------------------
32  */
33 
46 /* -------------------------- Development history -------------------------- */
47 /*
48  * 2017.04.05 LeFr v2.4.05 ---
49  */
50 
51 /* -------------------------------- Authors -------------------------------- */
52 /*
53  * LeFr Leandro Francucci lf@vortexmakes.com
54  */
55 
56 /* --------------------------------- Notes --------------------------------- */
57 /* ----------------------------- Include files ----------------------------- */
58 #include "unity.h"
59 #include "rkhsma.h"
60 #include "smInstance.h" /* support files */
61 #include "smPolymorphism.h"
62 #include "Mock_rkhport.h"
63 #include "Mock_rkhtrc.h"
64 #include "Mock_rkhtrc_record.h"
65 #include "Mock_rkhtrc_filter.h"
66 #include "Mock_rkhsm.h"
67 #include "Mock_rkhqueue.h"
68 #include "Mock_rkhassert.h"
69 #include <string.h>
70 
71 /* ----------------------------- Local macros ------------------------------ */
72 /* ------------------------------- Constants ------------------------------- */
73 /* ---------------------------- Local data types --------------------------- */
74 /* ---------------------------- Global variables --------------------------- */
75 /* ---------------------------- Local variables ---------------------------- */
76 static RKHROM RKH_ROM_T base = {0, 0, "receiver"};
77 static RKH_SMA_T receiver;
78 const RKH_TRC_FIL_T fsma = {0, NULL}; /* Fake global variable of trace */
79  /* module (using for mocking) */
80 const RKH_TRC_FIL_T fsig = {0, NULL};
81 static RKH_EVT_T event = {0, 0, 0};
82 
83 /* ----------------------- Local function prototypes ----------------------- */
84 /* ---------------------------- Local functions ---------------------------- */
85 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
86 static void
87 checkVtbl(RKH_SMA_T *me, RKHActivate activate, RKHTask task,
88  RKHPostFifo postFifo, RKHPostLifo postLifo)
89 {
90  TEST_ASSERT_EQUAL_PTR(activate, me->vptr->activate);
91  TEST_ASSERT_EQUAL_PTR(task, me->vptr->task);
92  TEST_ASSERT_EQUAL_PTR(postFifo, me->vptr->post_fifo);
93  TEST_ASSERT_EQUAL_PTR(postLifo, me->vptr->post_lifo);
94 }
95 
96 static void
97 testActivate(RKH_SMA_T *me, const RKH_EVT_T **qSto, RKH_QUENE_T qSize,
98  void *stkSto, rui32_t stkSize)
99 {
100  (void)me;
101  (void)qSto;
102  (void)qSize;
103  (void)stkSto;
104  (void)stkSize;
105 }
106 
107 static void
108 testTask(RKH_SMA_T *me, void *arg)
109 {
110  (void)me;
111  (void)arg;
112 }
113 
114 static void
115 testPostFifo(RKH_SMA_T *me, const RKH_EVT_T *e, const void *const sender)
116 {
117  (void)me;
118  (void)e;
119  (void)sender;
120 }
121 
122 static void
123 testPostLifo(RKH_SMA_T *me, const RKH_EVT_T *e, const void *const sender)
124 {
125  (void)me;
126  (void)e;
127  (void)sender;
128 }
129 #endif
130 
131 static void
132 setUp_polymorphism(void)
133 {
134 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
135  /* Restore the default virtual table of RKH_SMA_T class */
136  singleton->vptr = &rkhSmaVtbl;
137 #endif
138  memset(rkh_sptbl, 0, sizeof(rkh_sptbl));
139 }
140 
141 /* ---------------------------- Global functions --------------------------- */
142 void
143 setUp(void)
144 {
145  receiver.sm.romrkh = &base;
146  Mock_rkhtrc_filter_Init();
147 }
148 
149 void
150 tearDown(void)
151 {
152  Mock_rkhtrc_filter_Verify();
153  Mock_rkhtrc_filter_Destroy();
154 }
155 
162 void
163 test_Register(void)
164 {
165  rkh_enter_critical_Expect();
166  rkh_trc_isoff__ExpectAndReturn(RKH_TE_SMA_REG, RKH_FALSE);
167  rkh_exit_critical_Expect();
168 
169  rkh_sma_register(&receiver);
170  TEST_ASSERT_EQUAL(&receiver, rkh_sptbl[receiver.sm.romrkh->prio]);
171 }
172 
173 void
174 test_UnRegister(void)
175 {
176  rkh_enter_critical_Expect();
177  rkh_trc_isoff__ExpectAndReturn(RKH_TE_SMA_UNREG, RKH_FALSE);
178  rkh_exit_critical_Expect();
179 
180  rkh_sma_unregister(&receiver);
181  TEST_ASSERT_EQUAL((RKH_SMA_T *)0, rkh_sptbl[receiver.sm.romrkh->prio]);
182 }
183 
184 void
185 test_Constructor(void)
186 {
187  rkh_sm_ctor_Expect(&(receiver.sm));
188 
189  rkh_sma_ctor(&receiver, (const RKHSmaVtbl *)0);
190 }
191 
192 void
193 test_TerminateOneRegisteredAO(void)
194 {
195  rkh_enter_critical_Expect();
196  rkh_trc_isoff__ExpectAndReturn(RKH_TE_SMA_REG, RKH_FALSE);
197  rkh_exit_critical_Expect();
198 
199  rkh_sma_register(&receiver);
200 
201  rkh_enter_critical_Expect();
202  rkh_trc_isoff__ExpectAndReturn(RKH_TE_SMA_UNREG, RKH_FALSE);
203  rkh_exit_critical_Expect();
204  rkh_trc_isoff__ExpectAndReturn(RKH_TE_SMA_TERM, RKH_FALSE);
205 
206  rkh_sma_terminate(&receiver);
207 
208  TEST_ASSERT_EQUAL((RKH_SMA_T *)0, rkh_sptbl[receiver.sm.romrkh->prio]);
209 }
210 
211 void
212 test_ActivateOneAO(void)
213 {
214  char *buff;
215 
216  rkh_queue_init_Expect(&receiver.equeue, (const void **)&buff, 16,
217  &receiver);
218 
219  rkh_enter_critical_Expect();
220  rkh_trc_isoff__ExpectAndReturn(RKH_TE_SMA_REG, RKH_FALSE);
221  rkh_exit_critical_Expect();
222 
223  rkh_sm_init_Expect((RKH_SM_T *)&receiver);
224 
225  rkh_trc_isoff__ExpectAndReturn(RKH_TE_SMA_ACT, RKH_FALSE);
226 
227  rkh_sma_activate(&receiver, (const RKH_EVT_T **)&buff, 16, NULL, 0);
228 }
229 
230 void
231 test_PostFifo(void)
232 {
233  rkh_enter_critical_Expect();
234  rkh_queue_put_fifo_Expect(&receiver.equeue, &event);
235  rkh_trc_isoff__ExpectAndReturn(RKH_TE_SMA_FIFO, RKH_FALSE);
236  rkh_exit_critical_Expect();
237 
238  rkh_sma_post_fifo(&receiver, &event, &receiver);
239 }
240 
241 void
242 test_PostLifo(void)
243 {
244  rkh_enter_critical_Expect();
245  rkh_queue_put_lifo_Expect(&receiver.equeue, &event);
246  rkh_trc_isoff__ExpectAndReturn(RKH_TE_SMA_LIFO, RKH_FALSE);
247  rkh_exit_critical_Expect();
248 
249  rkh_sma_post_lifo(&receiver, &event, &receiver);
250 }
251 
252 void
253 test_Get(void)
254 {
255  RKH_EVT_T *e;
256 
257  rkh_queue_get_ExpectAndReturn(&receiver.equeue, &event);
258  rkh_trc_isoff__ExpectAndReturn(RKH_TE_SMA_GET, RKH_FALSE);
259 
260  e = rkh_sma_get(&receiver);
261  TEST_ASSERT_EQUAL(&event, e);
262 }
263 
264 void
265 test_Defer(void)
266 {
267  rkh_enter_critical_Expect();
268  rkh_queue_put_fifo_Expect(&receiver.equeue, &event);
269  rkh_trc_isoff__ExpectAndReturn(RKH_TE_SMA_DEFER, RKH_FALSE);
270  rkh_exit_critical_Expect();
271 
272  rkh_sma_defer(&receiver.equeue, &event);
273 }
274 
275 void
276 test_Recall(void)
277 {
278  RKH_EVT_T *e;
279 
280  rkh_queue_get_ExpectAndReturn(&receiver.equeue, NULL);
281 
282  e = rkh_sma_recall(&receiver, &receiver.equeue);
283  TEST_ASSERT_EQUAL(NULL, e);
284 }
285 
295 void
296 test_ctorOfStaticPrivateAO(void)
297 {
298  Single_ctor(4);
299 
300  TEST_ASSERT_EQUAL_STRING("single", RKH_SMA_ACCESS_CONST(single, name));
301  TEST_ASSERT_EQUAL(4, Single_getFoo());
302 }
303 
304 void
305 test_staticPublicAOWithoutRuntimeCtor(void)
306 {
307  publicSingle->foo = 8;
308  TEST_ASSERT_EQUAL_STRING("publicSingle",
309  RKH_SMA_ACCESS_CONST(publicSingle, name));
310 }
311 
312 void
313 test_ctorOfStaticPublicAO(void)
314 {
315  PublicSingle_ctor(8);
316 
317  TEST_ASSERT_EQUAL_STRING("publicSingle",
318  RKH_SMA_ACCESS_CONST(publicSingle, name));
319  TEST_ASSERT_EQUAL(8, publicSingle->foo);
320 }
321 
322 void
323 test_ctorOfStaticOpaqueAO(void)
324 {
325  Opaque_ctor(opaque, 4);
326 
327  TEST_ASSERT_EQUAL(4, Opaque_getFoo(opaque));
328 }
329 
330 void
331 test_ctorOfStaticMultipleAO(void)
332 {
333  MultiplePublicSingle_ctor(single0, 8);
334 
335  TEST_ASSERT_EQUAL_STRING("single0",
336  RKH_SMA_ACCESS_CONST(single0, name));
337  TEST_ASSERT_EQUAL(8, single0->foo);
338 }
339 
340 void
341 test_ctorOfStaticArrayOfAO(void)
342 {
343  PublicSingle *pSingle = RKH_ARRAY_SMA(arrayOfSingles, 2);
344  MultiplePublicSingle_ctor(pSingle, 8);
345 
346  TEST_ASSERT_EQUAL_STRING("single2",
347  RKH_SMA_ACCESS_CONST(pSingle, name));
348  TEST_ASSERT_EQUAL(8, pSingle->foo);
349 }
350 
351 void
352 test_staticPrivateSMWithoutRuntimeCtor(void)
353 {
354  TEST_ASSERT_EQUAL_STRING("stateMachine",
355  RKH_SMA_ACCESS_CONST(stateMachine, name));
356  TEST_ASSERT_EQUAL_PTR(NULL, stateMachine->state);
357 }
358 
359 void
360 test_staticPublicSMWithoutRuntimeCtor(void)
361 {
362  TEST_ASSERT_EQUAL_STRING("publicStateMachine",
363  RKH_SMA_ACCESS_CONST(publicStateMachine, name));
364  TEST_ASSERT_EQUAL(8, publicSingle->foo);
365 }
366 
367 void
368 test_ctorOfStaticCompositePrivateSingletonAO(void)
369 {
370  Composite_ctor(16);
371 
372  TEST_ASSERT_EQUAL_STRING("composite",
373  RKH_SMA_ACCESS_CONST(composite, name));
374  TEST_ASSERT_EQUAL_STRING("region",
375  RKH_SMA_ACCESS_CONST(Composite_getItsReactivePart(), name));
376  TEST_ASSERT_EQUAL(16, Composite_getFoo());
377 }
378 
379 void
380 test_ctorOfStaticCompositePublicAO(void)
381 {
382  PublicComposite_ctor(publicComposite, 16);
383 
384  TEST_ASSERT_EQUAL_STRING("publicComposite",
385  RKH_SMA_ACCESS_CONST(publicComposite, name));
386  TEST_ASSERT_EQUAL_STRING("publicRegion",
387  RKH_SMA_ACCESS_CONST(&publicComposite->itsReactivePart, name));
388  TEST_ASSERT_EQUAL(16, publicComposite->foo);
389 }
390 
391 void
392 test_ctorOfStaticCompositeAOWithDerivedPublicSM(void)
393 {
394  PublicCompositeA_ctor(publicCompositeA, 16, 8);
395 
396  TEST_ASSERT_EQUAL_STRING("publicCompositeA",
397  RKH_SMA_ACCESS_CONST(publicCompositeA, name));
398  TEST_ASSERT_EQUAL_STRING("publicRegionA",
399  RKH_SMA_ACCESS_CONST(&publicCompositeA->itsReactivePart, name));
400  TEST_ASSERT_EQUAL(16, publicCompositeA->foo);
401  TEST_ASSERT_EQUAL(8, publicCompositeA->itsReactivePart.foo);
402 }
403 
404 void
405 test_ctorOfDynamicCompositeAO(void)
406 {
407  PublicSingle *actObj;
408 
409  actObj = PublicSingle_dynCtor(8);
410  TEST_ASSERT_NOT_NULL(actObj);
411  TEST_ASSERT_EQUAL(8, actObj->foo);
412 
413  TEST_ASSERT_EQUAL_STRING("publicSingleDyn",
414  RKH_SMA_ACCESS_CONST(actObj, name));
415 
416  PublicSingle_dynDtor(actObj);
417 }
418 
428 void
429 test_defaultVirtualFunctions(void)
430 {
431  setUp_polymorphism();
432 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
433  checkVtbl(singleton,
436 
437  TEST_ASSERT_EQUAL_PTR(&rkhSmaVtbl, singleton->vptr);
438 #endif
439 }
440 
441 void
442 test_callVirtualFunction(void)
443 {
444  setUp_polymorphism();
445 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
446  const RKH_EVT_T *qs[1];
447 
448  rkh_queue_init_Ignore(); /* for RKH_SMA_ACTIVATE() */
449  rkh_enter_critical_Expect();
450  rkh_trc_isoff__ExpectAndReturn(RKH_TE_SMA_REG, RKH_FALSE);
451  rkh_exit_critical_Expect();
452  rkh_sm_init_Ignore();
453  rkh_trc_isoff__ExpectAndReturn(RKH_TE_SMA_ACT, RKH_FALSE);
454 
455  rkh_enter_critical_Expect();
456  rkh_queue_put_fifo_Ignore();
457  rkh_trc_isoff__ExpectAndReturn(RKH_TE_SMA_FIFO, RKH_FALSE);
458  rkh_exit_critical_Expect();
459 
460  rkh_enter_critical_Expect();
461  rkh_queue_put_lifo_Ignore();
462  rkh_trc_isoff__ExpectAndReturn(RKH_TE_SMA_LIFO, RKH_FALSE);
463  rkh_exit_critical_Expect();
464 
465  RKH_SMA_ACTIVATE(singleton, qs, 1, 0, 0);
466  RKH_SMA_POST_FIFO(singleton, &event, NULL);
467  RKH_SMA_POST_LIFO(singleton, &event, NULL);
468 #endif
469 }
470 
471 void
472 test_setVirtualTable(void)
473 {
474  setUp_polymorphism();
475 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
476  const RKHSmaVtbl *vptr;
477  static const RKHSmaVtbl vtbl =
478  {
479  testActivate, testTask, testPostFifo, testPostLifo
480  };
481 
482  vptr = singleton->vptr = &vtbl;
483 
484  checkVtbl(singleton,
485  testActivate, testTask, testPostFifo, testPostLifo);
486 #endif
487 }
488 
489 void
490 test_runtimeSingletonAOCtor(void)
491 {
492  setUp_polymorphism();
493 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
494  rkh_sm_ctor_Expect(&singleton->sm);
495 
496  Singleton_ctor(8);
497  TEST_ASSERT_EQUAL(8, Singleton_getFoo());
498 
499  RKH_SMA_ACTIVATE(singleton, NULL, 0, NULL, 0);
500  TEST_ASSERT_EQUAL(0, Singleton_getFoo());
501 #endif
502 }
503 
504 void
505 test_runtimeMultipleAOCtorWithVtblForObj(void)
506 {
507  setUp_polymorphism();
508 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
509  rkh_sm_ctor_Ignore();
510  rkh_sm_ctor_Ignore();
511 
512  Multiple_ctor(multA, 2, Multiple_postFifoA);
513  Multiple_ctor(multB, 4, Multiple_postFifoB);
514 
515  checkVtbl((RKH_SMA_T *)multA,
516  rkh_sma_activate, rkh_sma_dispatch, Multiple_postFifoA,
518 
519  TEST_ASSERT_EQUAL(2, Multiple_getFoobar(multA));
520  TEST_ASSERT_EQUAL(4, Multiple_getFoobar(multB));
521 
522  RKH_SMA_POST_FIFO((RKH_SMA_T *)multA, NULL, NULL);
523  RKH_SMA_POST_FIFO((RKH_SMA_T *)multB, NULL, NULL);
524 
525  TEST_ASSERT_EQUAL(0, Multiple_getFoobar(multA));
526  TEST_ASSERT_EQUAL(8, Multiple_getFoobar(multB));
527 #endif
528 }
529 
530 void
531 test_runtimeMultipleAOCtorWithVtblForType(void)
532 {
533  setUp_polymorphism();
534 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
535  rkh_sm_ctor_Expect((RKH_SM_T *)cmdSignal);
536  rkh_sm_ctor_Expect((RKH_SM_T *)cmdRegister);
537 
538  Command_ctor(cmdSignal, 128);
539  Command_ctor(cmdRegister, 64);
540 
541  checkVtbl((RKH_SMA_T *)cmdSignal,
542  rkh_sma_activate, Command_task,
543  Command_postFifo, Command_postLifo);
544 
545  checkVtbl((RKH_SMA_T *)cmdRegister,
546  rkh_sma_activate, Command_task,
547  Command_postFifo, Command_postLifo);
548 #endif
549 }
550 
551 void
552 test_runtimeSubObjectCtorOfSMAAndSM(void)
553 {
554  setUp_polymorphism();
555 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
556  rkh_sm_ctor_Expect((RKH_SM_T *)theCallControl);
557  CallControl_ctorA(16);
558 
559  TEST_ASSERT_EQUAL(16, CallControl_getFoo());
560  checkVtbl((RKH_SMA_T *)theCallControl,
561  CallControl_activate, CallControl_task,
563 #endif
564 }
565 
566 void
567 test_runtimeSubObjectCtorOfSMAAndSMWithDefaultVtbl(void)
568 {
569  setUp_polymorphism();
570 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
571  rkh_sm_ctor_Expect((RKH_SM_T *)theCallControl);
572  CallControl_ctorB(8);
573 
574  TEST_ASSERT_EQUAL(8, CallControl_getFoo());
575  checkVtbl((RKH_SMA_T *)theCallControl,
578 #endif
579 }
580 
585 /* ------------------------------ End of file ------------------------------ */
void rkh_sma_dispatch(RKH_SMA_T *me, void *arg)
For cooperative scheduling policy, this function is used to dispatch the event to the active object b...
#define RKH_SMA_POST_LIFO(me_, e_, sender_)
Invoke the direct event posting facility rkh_sma_post_lifo(). If RKH_CFG_SMA_VFUNCT_EN is set RKH_ENA...
Definition: rkhsma.h:498
#define RKH_SMA_POST_FIFO(me_, e_, sender_)
Invoke the direct event posting facility rkh_sma_post_fifo(). If RKH_CFG_SMA_VFUNCT_EN is set RKH_ENA...
Definition: rkhsma.h:450
#define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_)
Invoke the active object activation function rkh_sma_activate(). If RKH_CFG_SMA_VFUNCT_EN is set RKH_...
Definition: rkhsma.h:250
#define RKH_FALSE
Standard define.
Definition: rkhdef.h:256
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_terminate(RKH_SMA_T *me)
Terminate a state machine application (SMA) as known as active object.
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...
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_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...
RKH_SMA_T * rkh_sptbl[RKH_CFG_FWK_MAX_SMA]
Priority arranged table of registered SMA.
rui8_t RKH_QUENE_T
This data type defines the maximum number of elements that any queue can contain.
Definition: rkhqueue.h:97
Specifies the interface of the acive object (SMA state machine applications) manager.
void rkh_sma_register(RKH_SMA_T *me)
Registers a state machine application (SMA) as known as active object into the framework,...
void(* RKHTask)(RKH_SMA_T *me, void *arg)
Definition: rkhsma.h:861
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_defer(RKH_QUEUE_T *q, const RKH_EVT_T *e)
Defer an event to a given separate event queue.
const RKHSmaVtbl rkhSmaVtbl
#define RKH_ARRAY_SMA(_arr, _ix)
Retrieves the pointer to active object from a SMA's array.
Definition: rkhsma.h:679
void(* RKHActivate)(RKH_SMA_T *me, const RKH_EVT_T **qSto, RKH_QUENE_T qSize, void *stkSto, rui32_t stkSize)
Definition: rkhsma.h:856
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(* RKHPostLifo)(RKH_SMA_T *me, const RKH_EVT_T *e, const void *const sender)
Definition: rkhsma.h:873
void(* RKHPostFifo)(RKH_SMA_T *me, const RKH_EVT_T *e, const void *const sender)
Definition: rkhsma.h:865
#define RKH_SMA_ACCESS_CONST(me_, member_)
Macro for accessing to members of state machine structure.
Definition: rkhsma.h:98
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...
#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_REG
Registers a state machine application (SMA) as known as active object into the framework,...
#define RKH_TE_SMA_UNREG
Removes the SMA as known as active object from the priority table, and thus from the framework,...
#define RKH_TE_SMA_TERM
Terminate a state machine application (SMA) as known as active object.
#define RKH_TE_SMA_DEFER
Defer an event to a given separate event queue.
#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_FIFO
Send an event to a state machine application (SMA) as known as active object through a queue using th...
Represents events without parameters.
Definition: rkhevt.h:170
Constant parameters of state machine.
Definition: rkhsm.h:1829
rui8_t prio
SMA (a.k.a Active Object) priority.
Definition: rkhsm.h:1837
Describes the state machine.
Definition: rkhsm.h:1905
RKHROM RKH_ROM_T * romrkh
Points to constant parameters of state machine.
Definition: rkhsm.h:1910
Describes the SMA (active object in UML).
Definition: rkhsma.h:772
RKH_SM_T sm
State machine.
Definition: rkhsma.h:777
RKH_EQ_TYPE equeue
Event queue of the SMA (a.k.a Active Object).
Definition: rkhsma.h:835
Represents the filter of signal and active object.
Virtual table for the RKH_SMA_T structure.
Definition: rkhsma.h:884