Generic COM Functions
[Communications Interface]


Defines

#define com_send(iface, buf)   com_send_##iface (buf)
 Send data over specified interface. Blocks until the data has been transmitted.
#define com_sendto(iface, buf, dest)   com_sendto_##iface(buf,dest)
#define com_ioctl(iface, request, args...)   com_ioctl_##iface (request, ##args)
 Pass ioctl flag and data down to the given interface.
#define com_mode(iface, mode)   com_mode_##iface (mode)
 Pass the mode setting down to the given interface.

Functions

void com_flush (uint8_t iface)
 Flush the packets on a particular interface.
comBufcom_recv (uint8_t iface)
 Receive data from a specified interface. Blocks until a packet is available. It is important that once the received comBuf has been handled that the application call com_free_buf(buf) to release the buffer back to the system.
comBufcom_recv_timed (uint8_t iface, uint32_t msecs)
 Receive data from a specified interface. If no data is received in the specified amount of time, the call will return.
void com_free_buf (comBuf *buf)
 Release a buffer returned by com_recv or com_recv_timed back to the system. If buffers are not released with this method, The system will run out of buffers and not be able to receive data.

Detailed Description

These functions can be used with all interfaces.

Define Documentation

#define com_ioctl iface,
request,
args...   )     com_ioctl_##iface (request, ##args)
 

Parameters:
iface Interface used
Request The IOCTL to pass down to the interface.
Returns:
Retval, else IFACE_NOT_REGISTERED

Definition at line 435 of file com.h.

#define com_mode iface,
mode   )     com_mode_##iface (mode)
 

Parameters:
iface Interface used
mode The new mode.
Returns:
Retval, else IFACE_NOT_REGISTERED

Definition at line 442 of file com.h.

#define com_send iface,
buf   )     com_send_##iface (buf)
 

Parameters:
iface Interface to use
buf A pointer to the buffer containing data to send.
Returns:
Retval, else IFACE_NOT_REGISTERED

Definition at line 408 of file com.h.


Function Documentation

void com_flush uint8_t  iface  ) 
 

Parameters:
iface the interface to flush.

void com_free_buf comBuf buf  ) 
 

Parameters:
buf A pointer to the buffer to free.

comBuf* com_recv uint8_t  iface  ) 
 

Parameters:
iface Interface to use
Returns:
A buffer containing the received data.

comBuf* com_recv_timed uint8_t  iface,
uint32_t  msecs
 

Parameters:
iface Interface to use
msecs Milliseconds to wait before timing out
Returns:
A buffer containing the received data, or NULL if no data was received.


Generated on Mon Nov 23 06:26:00 2009 for MANTIS by  doxygen 1.4.6