Choco OS  V.0.16.9.0
Join to the chocolate world
oc_portman.h
Go to the documentation of this file.
1 
31 #ifndef SYSTEM_CORE_SRC_NET_OC_PORTMAN_H_
32 #define SYSTEM_CORE_SRC_NET_OC_PORTMAN_H_
33 
34 #include <oc_errors.h>
35 #include <oc_module.h>
36 #include <oc_process.h>
37 
43 #define _________________________________________TYPES_SECTION______________________________________________________________________________
44 
49 //==========================================================================================================================================
53 //==========================================================================================================================================
54 typedef uint32_t oC_PortMan_Port_t;
55 
56 //==========================================================================================================================================
62 //==========================================================================================================================================
63 typedef struct
64 {
69 
71 #undef _________________________________________TYPES_SECTION______________________________________________________________________________
72 
78 #define _________________________________________INTERFACE_SECTION__________________________________________________________________________
79 
84 extern oC_ErrorCode_t oC_PortMan_TurnOn ( void );
85 extern oC_ErrorCode_t oC_PortMan_TurnOff ( void );
86 extern oC_ErrorCode_t oC_PortMan_RegisterModule ( oC_Module_t Module , const oC_PortMan_Config_t * Config , oC_Time_t Timeout );
87 extern oC_ErrorCode_t oC_PortMan_UnregisterModule ( oC_Module_t Module , oC_Time_t Timeout );
88 extern oC_ErrorCode_t oC_PortMan_ReservePort ( oC_Module_t Module , oC_PortMan_Port_t * Port , oC_Time_t Timeout );
89 extern oC_ErrorCode_t oC_PortMan_ReleasePort ( oC_Module_t Module , oC_PortMan_Port_t Port , oC_Time_t Timeout );
90 extern oC_ErrorCode_t oC_PortMan_ReleaseAllPortsOf ( oC_Module_t Module , oC_Process_t Process , oC_Time_t Timeout );
91 extern bool oC_PortMan_IsPortReserved ( oC_Module_t Module , oC_PortMan_Port_t Port );
92 extern bool oC_PortMan_IsPortReservedBy ( oC_Module_t Module , oC_PortMan_Port_t Port , oC_Process_t Process );
93 
95 #undef _________________________________________INTERFACE_SECTION__________________________________________________________________________
96 
97 #endif /* SYSTEM_CORE_SRC_NET_OC_PORTMAN_H_ */
uint32_t oC_PortMan_Port_t
stores the port number
Definition: oc_portman.h:54
oC_ErrorCode_t oC_PortMan_RegisterModule(oC_Module_t Module, const oC_PortMan_Config_t *Config, oC_Time_t Timeout)
registers module in the port manager
Definition: oc_portman.c:257
oC_ErrorCode_t oC_PortMan_TurnOff(void)
turns off the module
Definition: oc_portman.c:180
oC_ErrorCode_t oC_PortMan_TurnOn(void)
turns on the module
Definition: oc_portman.c:126
oC_PortMan_Port_t FirstDynamicPortNumber
The first port, that can be dynamically reserved (when the port to reserve is 0). ...
Definition: oc_portman.h:66
oC_ErrorCode_t oC_PortMan_ReleaseAllPortsOf(oC_Module_t Module, oC_Process_t Process, oC_Time_t Timeout)
releases all ports reserved by a given process
Definition: oc_portman.c:522
The file with interface for the module library.
oC_PortMan_Port_t LastDynamicPortNumber
Last port, that can be dynamically reserved (when the port to reserve is 0).
Definition: oc_portman.h:67
oC_PortMan_Port_t MaximumPortNumber
Maximum number of correct port.
Definition: oc_portman.h:65
bool oC_PortMan_IsPortReservedBy(oC_Module_t Module, oC_PortMan_Port_t Port, oC_Process_t Process)
checks if the given port is reserved by the given process
Definition: oc_portman.c:602
bool oC_PortMan_IsPortReserved(oC_Module_t Module, oC_PortMan_Port_t Port)
returns true if port is reserved
Definition: oc_portman.c:567
oC_ErrorCode_t oC_PortMan_UnregisterModule(oC_Module_t Module, oC_Time_t Timeout)
unregisters module in the port manager
Definition: oc_portman.c:328
stores configuration of the module
Definition: oc_portman.h:63
The file with interface for process mechanism.
oC_ErrorCode_t oC_PortMan_ReservePort(oC_Module_t Module, oC_PortMan_Port_t *Port, oC_Time_t Timeout)
reserves a port of the given module
Definition: oc_portman.c:389
oC_ErrorCode_t oC_PortMan_ReleasePort(oC_Module_t Module, oC_PortMan_Port_t Port, oC_Time_t Timeout)
releases port
Definition: oc_portman.c:457