#define | FLOW_READ_ONLY 1 |
#define | FLOW_WRITE_ONLY 2 |
#define | FLOW_READ_WRITE 3 |
Functions | |
int | CreateItf (char *itf_name, int mode) |
int | CloseItf (int fd) |
int | WriteItf (int fd, void *buffer, int size) |
int | ReadItf (int fd, void *buffer, int size) |
int | GetItfStatus (int fd) |
An logical interface is a flow of data between one object an another. Before using it, it must be created (initialized) by the object, as well as described in the waveform definition file (*.app).
#define FLOW_READ_ONLY 1 |
#define FLOW_READ_WRITE 3 |
#define FLOW_WRITE_ONLY 2 |
int CloseItf | ( | int | fd | ) |
Close Interface
Deallocates interface resources and prevents it for using again. This action is performed automatically by ClosePHAL() function (at exit), however it is a good policy to manually call it for each interface for debuggin purposes.
fd | File descriptor to close |
0 not closed
int CreateItf | ( | char * | itf_name, | |
int | mode | |||
) |
Create Interface
Initializes an interface and allocated necessary resources. After this function has been called you can begin sending and receiving data through the interface. The function returns a file descriptor than will be used later to use the interface.
itf_name | Name of the interface. For maximum length, see HW API SYSTEM_STR_MAX_LEN | |
mode | FLOW_READ_ONLY, FLOW_WRITE_ONLY or FLOW_READ_WRITE |
-1 if error
int GetItfStatus | ( | int | fd | ) |
Obtain Interface Status
Obtain actual interface utilization, i.e. the amount of bytes in the queue
fd | File descriptor of the interface |
-1 Error
int ReadItf | ( | int | fd, | |
void * | buffer, | |||
int | size | |||
) |
Read from an interface
This function reads certain amount of data from a logical interface. The packetization problem is managed internally by ALOE. This means that although the remote object send its information in discrete packets, the receiver can obtain any desired amount of information. If packet has to be splitted or joined, it'll be done by ALOE.
fd | File descriptor of the interface | |
buffer | Pointer where to save the data | |
size | Amount of bytes to be received |
=0 Any data available
-1 Error receiveing from interface
int WriteItf | ( | int | fd, | |
void * | buffer, | |||
int | size | |||
) |
Write to an interface
This function writes certain amount of data into a logical interface. *
fd | File descriptor of the interface | |
buffer | Pointer for the user data | |
size | Amount of bytes to be written |
=0 Data could not be written
-1 Error sending through interface