m2mb API docs  30.00.007
m2mb API sets documentation
m2mb_os_ev.h
Go to the documentation of this file.
1 /*===============================================================================================*/
2 /* >>> Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. <<< */
26 #ifndef M2MB_OS_EV_H
27 #define M2MB_OS_EV_H
28 
29 
30 
31 /* GLOBAL DECLARATIONS ----------------------------------------------------------- */
32 #define M2MB_OS_EV_INVALID 0
33 #define M2MB_OS_EV_INVALID_ATTR 0
34 
35 
36 
37 /* Global declarations ==========================================================================*/
38 /*-----------------------------------------------------------------------------------------------
39 
40  can be called directly without specify CMDS_ARGS
41  osRes = m2mb_os_ev_setAttrItem_( &evAttrHandle,
42  M2MB_OS_EV_SEL_CMD_CREATE_ATTR, NULL,
43  M2MB_OS_EV_SEL_CMD_NAME, "event_1",
44  M2MB_OS_EV_SEL_CMD_USRNAME, "myevent1"
45  );
46  -----------------------------------------------------------------------------------------------*/
47 #ifdef _WIN32
48 #define m2mb_os_ev_setAttrItem_( h, ... ) m2mb_os_ev_setAttrItem( h, CMDS_ARGS( __VA_ARGS__ ) )
49 #else
50 #define m2mb_os_ev_setAttrItem_( h, args... ) m2mb_os_ev_setAttrItem( h, CMDS_ARGS( args ) )
51 #endif
52 
53 
54 
55 /* Global typedefs --------------------------------------------------------------- */
56 
57 typedef enum
58 {
59  M2MB_OS_EV_SEL_CMD_CREATE_ATTR,
60  M2MB_OS_EV_SEL_CMD_DEL_ATTR,
61  /* use as Os name , can be used during creation */
62  M2MB_OS_EV_SEL_CMD_NAME,
63  /* if set, usr name could be different from Os used in creation */
64  M2MB_OS_EV_SEL_CMD_USRNAME,
65  /* number of task suspended on this resource */
66  M2MB_OS_EV_SEL_CMD_SUSPENDED_COUNT,
67  /* first task (M2MB_OS_TASK_HANDLE) to be served when its required resources will be available */
68  M2MB_OS_EV_SEL_CMD_1ST_SUSP,
69  /* to get the status of current bits event */
70  M2MB_OS_EV_SEL_CMD_CURRENT_BITS_EVENT,
71 
72  /* ---- */
73  M2MB_OS_EV_SEL_CMD_END,
74  ENUM_TO_INT( M2MB_OS_EV_SEL_CMD_E )
75 } M2MB_OS_EV_SEL_CMD_E;
76 
77 /* options for setting event bits: set or clear specified ones */
78 typedef enum
79 {
80  M2MB_OS_EV_SET = 0,
81  M2MB_OS_EV_CLEAR = 2,
82 
83  /* ---- */
84  M2MB_OS_EV_SET_OPT_END,
85  ENUM_TO_INT( M2MB_OS_EV_SET_OPT_E )
86 } M2MB_OS_EV_SET_OPT_E;
87 
88 /* options for getting event bits: get all selected (and clear) or get any of selected (and clear matches) */
89 typedef enum
90 {
91  /* get the event if any of the selected event bits are set ...*/
92  M2MB_OS_EV_GET_ANY = 0,
93  /* ... then clear all the set bit in selected event bits */
94  M2MB_OS_EV_GET_ANY_AND_CLEAR,
95  /* get the event if all the selected event bits are set ...*/
96  M2MB_OS_EV_GET_ALL,
97  /* ... then clear all the set bit in selected event bits */
98  M2MB_OS_EV_GET_ALL_AND_CLEAR,
99 
100  /* ---- */
101  M2MB_OS_EV_GET_OPT_END,
102  ENUM_TO_INT( M2MB_OS_EV_GET_OPT_E )
103 } M2MB_OS_EV_GET_OPT_E;
104 
105 typedef struct M2MB_OS_EV_HANDLE_TAG *M2MB_OS_EV_HANDLE;
106 typedef struct M2MB_OS_EV_ATTR_HANDLE_TAG *M2MB_OS_EV_ATTR_HANDLE;
107 
108 
109 /* Global functions =============================================================================*/
110 
111 /*-----------------------------------------------------------------------------------------------*/
173 /*-----------------------------------------------------------------------------------------------*/
174 M2MB_OS_RESULT_E m2mb_os_ev_init( M2MB_OS_EV_HANDLE *pEvHandle, M2MB_OS_EV_ATTR_HANDLE *pEvAttrHandle );
175 
176 /*-----------------------------------------------------------------------------------------------*/
213 /*-----------------------------------------------------------------------------------------------*/
214 M2MB_OS_RESULT_E m2mb_os_ev_deinit( M2MB_OS_EV_HANDLE evHandle );
215 
216 /*-----------------------------------------------------------------------------------------------*/
267 /*-----------------------------------------------------------------------------------------------*/
268 M2MB_OS_RESULT_E m2mb_os_ev_set(
269  M2MB_OS_EV_HANDLE evHandle,
270  UINT32 evBits,
271  M2MB_OS_EV_SET_OPT_E optSet
272 );
273 
274 /*-----------------------------------------------------------------------------------------------*/
345 /*-----------------------------------------------------------------------------------------------*/
346 M2MB_OS_RESULT_E m2mb_os_ev_get(
347  M2MB_OS_EV_HANDLE evHandle,
348  UINT32 reqEvBits,
349  M2MB_OS_EV_GET_OPT_E optGet,
350  UINT32 *pCurEvBits,
351  UINT32 timeout
352 );
353 
354 /*-----------------------------------------------------------------------------------------------*/
428 /*-----------------------------------------------------------------------------------------------*/
429 M2MB_OS_RESULT_E m2mb_os_ev_setAttrItem( M2MB_OS_EV_ATTR_HANDLE *pEvAttrHandle, UINT8 nCmds, ... );
430 
431 /*-----------------------------------------------------------------------------------------------*/
509 /*-----------------------------------------------------------------------------------------------*/
510 M2MB_OS_RESULT_E m2mb_os_ev_getItem(
511  M2MB_OS_EV_HANDLE evHandle,
512  M2MB_OS_EV_SEL_CMD_E selCmd,
513  MEM_W *pOut,
514  void *pIn
515 );
516 
517 /*-----------------------------------------------------------------------------------------------*/
557 /*-----------------------------------------------------------------------------------------------*/
558 M2MB_OS_RESULT_E m2mb_os_ev_setItem(
559  M2MB_OS_EV_HANDLE evHandle,
560  M2MB_OS_EV_SEL_CMD_E selCmd,
561  void *pIn
562 );
563 
564 
565 #endif /* M2MB_OS_EV_H */
m2mb_os_ev_set
M2MB_OS_RESULT_E m2mb_os_ev_set(M2MB_OS_EV_HANDLE evHandle, UINT32 evBits, M2MB_OS_EV_SET_OPT_E optSet)
Set bits of event in a specified event.
m2mb_os_ev_setItem
M2MB_OS_RESULT_E m2mb_os_ev_setItem(M2MB_OS_EV_HANDLE evHandle, M2MB_OS_EV_SEL_CMD_E selCmd, void *pIn)
Set specific properties of the event.
m2mb_os_ev_getItem
M2MB_OS_RESULT_E m2mb_os_ev_getItem(M2MB_OS_EV_HANDLE evHandle, M2MB_OS_EV_SEL_CMD_E selCmd, MEM_W *pOut, void *pIn)
Get specific properties of the event.
m2mb_os_ev_setAttrItem
M2MB_OS_RESULT_E m2mb_os_ev_setAttrItem(M2MB_OS_EV_ATTR_HANDLE *pEvAttrHandle, UINT8 nCmds,...)
Set specific attribute for event init or creation.
m2mb_os_ev_get
M2MB_OS_RESULT_E m2mb_os_ev_get(M2MB_OS_EV_HANDLE evHandle, UINT32 reqEvBits, M2MB_OS_EV_GET_OPT_E optGet, UINT32 *pCurEvBits, UINT32 timeout)
Get an application event.
m2mb_os_ev_init
M2MB_OS_RESULT_E m2mb_os_ev_init(M2MB_OS_EV_HANDLE *pEvHandle, M2MB_OS_EV_ATTR_HANDLE *pEvAttrHandle)
Application Event Set Creation.
m2mb_os_ev_deinit
M2MB_OS_RESULT_E m2mb_os_ev_deinit(M2MB_OS_EV_HANDLE evHandle)
Application Event deinit or deletion.