gxPL  1.0
Tools, Application and Framework for xPL
Hardware Abstract Layer

Detailed Description

Description of the IO layer to the application layer. The application layer uses functions described here to access the io layer.

Warning
This part concerns the developers wishing to create a new io layer. The end-user should not access this layer directly.
Collaboration diagram for Hardware Abstract Layer:

Functions

int gxPLIoClose (gxPLIo *io)
 Close the input-output layer. More...
 
int gxPLIoIoCtl (gxPLIo *io, int c, va_list ap)
 device-specific input/output operations More...
 
gxPLIo * gxPLIoOpen (gxPLSetting *setting)
 Opening of the input-output layer. More...
 
int gxPLIoRecv (gxPLIo *io, void *buffer, int count, gxPLIoAddr *source)
 Receive a message from the network. More...
 
int gxPLIoSend (gxPLIo *io, const void *buffer, int count, const gxPLIoAddr *target)
 Send a message to the network. More...
 

Function Documentation

int gxPLIoClose ( gxPLIo *  io)

Close the input-output layer.

Parameters
ioio layer
Returns
0, -1 if error occurs
int gxPLIoIoCtl ( gxPLIo *  io,
int  c,
va_list  ap 
)

device-specific input/output operations

Parameters
ioio layer
cdevice-dependent request code
apiterating arguments from gxPLIoCtl()
Returns
0, -1 if error occurs
gxPLIo* gxPLIoOpen ( gxPLSetting setting)

Opening of the input-output layer.

Parameters
settingpointer to a configuration, this configuration can be modified by the function to return the actual configuration.
Returns
the object or NULL if error occurs
int gxPLIoRecv ( gxPLIo *  io,
void *  buffer,
int  count,
gxPLIoAddr source 
)

Receive a message from the network.

The call can be blocking, gxPLIoFuncPoll will be used before so you do not block.

Parameters
ioio layer
buffera buffer in which bytes are stored
countnumber of bytes requested
sourceif not NULL, returns the source address.
Returns
number of bytes read, a negative value if error
int gxPLIoSend ( gxPLIo *  io,
const void *  buffer,
int  count,
const gxPLIoAddr target 
)

Send a message to the network.

Parameters
ioio layer
bufferbuffer where the bytes were stored
countnumber of bytes to send
targetif target is NULL or if her broadcast flag is set, the broadcast address of the network is used.
Returns
number of bytes sent or frame identifier (greater than or equal to one), a negative value if error occurs