Choco OS  V.0.16.9.0
Join to the chocolate world
oc_portman.c File Reference

Interface functions for PortManager. More...

#include <oc_portman.h>
#include <oc_list.h>
#include <oc_intman.h>
#include <oc_mutex.h>
#include <oc_event.h>

Go to the source code of this file.

Data Structures

struct  PortReservation_t
 stores port reservation More...
 
struct  ModuleRegistration_t
 stores module registration More...
 

Functions

static ModuleRegistration_tModuleRegistration_New (oC_Module_t Module, const oC_PortMan_Config_t *Config)
 allocates memory for new module registration
 
static bool ModuleRegistration_Delete (ModuleRegistration_t *Registration)
 releases memory for the given module registration
 
static ModuleRegistration_tGetModuleRegistration (oC_Module_t Module)
 looking for a registration of the given module
 
static PortReservation_tGetPortReservation (ModuleRegistration_t *Registration, oC_PortMan_Port_t Port)
 looking for a port reservation in the given module registration
 
static PortReservation_tGetNextProcessReservation (ModuleRegistration_t *Registration, oC_Process_t Process)
 looking for the next reservation of the port that is related with the given process
 
static oC_PortMan_Port_t GetFreePort (ModuleRegistration_t *Registration)
 returns first free dynamic port
 
static bool WaitForFreePortRelease (ModuleRegistration_t *Registration, oC_PortMan_Port_t *Port, oC_Time_t Timeout)
 waits for release of free port
 
static bool WaitForPortRelease (ModuleRegistration_t *Registration, oC_PortMan_Port_t *Port, oC_Time_t Timeout)
 waits for a port release
 
static PortReservation_tPortReservation_New (oC_PortMan_Port_t Port)
 allocates memory for a port reservation
 
static bool PortReservation_Delete (PortReservation_t *Reservation)
 releases memory of port reservation
 
oC_ErrorCode_t oC_PortMan_TurnOn (void)
 turns on the module More...
 
oC_ErrorCode_t oC_PortMan_TurnOff (void)
 turns off the module More...
 
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 More...
 
oC_ErrorCode_t oC_PortMan_UnregisterModule (oC_Module_t Module, oC_Time_t Timeout)
 unregisters module in the port manager More...
 
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 More...
 
oC_ErrorCode_t oC_PortMan_ReleasePort (oC_Module_t Module, oC_PortMan_Port_t Port, oC_Time_t Timeout)
 releases port More...
 
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 More...
 
bool oC_PortMan_IsPortReserved (oC_Module_t Module, oC_PortMan_Port_t Port)
 returns true if port is reserved More...
 
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 More...
 

Detailed Description


Author
Patryk Kubiak
Note
Copyright (C) 2016 Patryk Kubiak patry.nosp@m.k.ku.nosp@m.biak@.nosp@m.choc.nosp@m.oos.o.nosp@m.rg

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Definition in file oc_portman.c.