Choco OS  V.0.16.9.0
Join to the chocolate world
oc_service.h
Go to the documentation of this file.
1 
26 #ifndef SYSTEM_CORE_INC_KERNEL_OC_SERVICE_H_
27 #define SYSTEM_CORE_INC_KERNEL_OC_SERVICE_H_
28 
29 #include <oc_errors.h>
30 #include <oc_thread.h>
31 #include <oc_process.h>
32 #include <oc_module.h>
33 
39 #define _________________________________________TYPES_SECTION______________________________________________________________________________
40 
41 typedef struct Context_t * oC_Service_Context_t;
42 
43 typedef oC_ErrorCode_t (*oC_Service_StartFunction_t)( oC_Service_Context_t * outContext );
44 typedef oC_ErrorCode_t (*oC_Service_StopFunction_t) ( oC_Service_Context_t * Context );
45 
46 typedef oC_ErrorCode_t (*oC_Service_MainFunction_t)( oC_Service_Context_t Context );
47 
48 //==========================================================================================================================================
49 //==========================================================================================================================================
50 typedef struct
51 {
52  const char * Name;
53  oC_Service_StartFunction_t StartFunction;
54  oC_Service_StopFunction_t StopFunction;
55  oC_Service_MainFunction_t MainFunction;
56  oC_MemorySize_t MainThreadStackSize;
57  oC_MemorySize_t HeapMapSize;
58  oC_MemorySize_t AllocationLimit;
59  oC_Module_RequiredArray_t RequiredModules;
60  oC_Process_Priority_t Priority;
62 
63 //==========================================================================================================================================
69 //==========================================================================================================================================
70 typedef struct Service_t * oC_Service_t;
71 
72 #undef _________________________________________TYPES_SECTION______________________________________________________________________________
73 
79 #define _________________________________________PROTOTYPES_SECTION_________________________________________________________________________
80 
81 extern oC_Service_t oC_Service_New ( const oC_Service_Registration_t * Registration );
82 extern bool oC_Service_Delete ( oC_Service_t * Service );
83 extern bool oC_Service_IsCorrect ( oC_Service_t Service );
84 extern oC_ErrorCode_t oC_Service_Start ( oC_Service_t Service );
85 extern oC_ErrorCode_t oC_Service_Stop ( oC_Service_t Service );
86 extern bool oC_Service_IsActive ( oC_Service_t Service );
87 extern const char * oC_Service_GetName ( oC_Service_t Service );
88 extern oC_Process_t oC_Service_GetProcess ( oC_Service_t Service );
89 
90 #undef _________________________________________PROTOTYPES_SECTION_________________________________________________________________________
91 
92 #endif /* SYSTEM_CORE_INC_KERNEL_OC_SERVICE_H_ */
The file with interface for thread managing.
oC_Service_t oC_Service_New(const oC_Service_Registration_t *Registration)
allocates memory for a new service
Definition: oc_service.c:111
oC_Process_t oC_Service_GetProcess(oC_Service_t Service)
returns process associated with the service
Definition: oc_service.c:338
const char * oC_Service_GetName(oC_Service_t Service)
returns name of the service
Definition: oc_service.c:321
The file with interface for the module library.
bool oC_Service_Delete(oC_Service_t *Service)
releases memory allocated for a service
Definition: oc_service.c:175
oC_ErrorCode_t oC_Service_Start(oC_Service_t Service)
starts the service
Definition: oc_service.c:232
bool oC_Service_IsActive(oC_Service_t Service)
returns true if the service is correct and active
Definition: oc_service.c:311
oC_ErrorCode_t oC_Service_Stop(oC_Service_t Service)
stops the service
Definition: oc_service.c:273
stores ETH context
Definition: oc_eth.c:97
The file with interface for process mechanism.
struct Service_t * oC_Service_t
object for storing service data
Definition: oc_service.h:70
bool oC_Service_IsCorrect(oC_Service_t Service)
returns true if the service object is correct
Definition: oc_service.c:216