Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals

CommUDP Class Reference

#include <commudp.h>

Inheritance diagram for CommUDP:

Inheritance graph
[legend]
Collaboration diagram for CommUDP:

Collaboration graph
[legend]

Detailed Description

UDP Communication class.

A set of all functions, parameters and data related to the transmition and reception of data through the ethernet port using UDP.


Public Member Functions

 CommUDP (const char *servIP, int recport=REC_PORT, int sendport=REC_PORT)
 Initializes the UDP Communication.

int receive (unsigned char *buffer)
 Receives data from the ethernet port.

int send (unsigned char const *buffer, int numBytes)
 Transmits data through the ethernet port.

void setFD (int fd_tmp)
 Sets the descriptor of the communication port.

int getFD (void)
 Gets the descriptor of the communication port.


Constructor & Destructor Documentation

CommUDP::CommUDP const char *  servIP,
int  recport = REC_PORT,
int  sendport = REC_PORT
 

Initializes the UDP Communication.

Parameters:
servIP the IP address to send data to.
recport reception port number.
sendport transmition port number.


Member Function Documentation

int CommUDP::getFD void   ) 
 

Gets the descriptor of the communication port.

Returns:
the file descriptor for communication.

Reimplemented from Communication.

int CommUDP::receive unsigned char *  buffer  ) 
 

Receives data from the ethernet port.

Parameters:
buffer data received.
Returns:
the number of bytes received or an error code.

int CommUDP::send unsigned char const *  buffer,
int  numBytes
[virtual]
 

Transmits data through the ethernet port.

Parameters:
buffer data to transmit.
numBytes number of bytes to transmit.
Returns:
an error code.

Implements Communication.

void CommUDP::setFD int  fd_tmp  ) 
 

Sets the descriptor of the communication port.

Parameters:
fd_tmp the new file descriptor for the communication.

Reimplemented from Communication.


The documentation for this class was generated from the following file:
Generated on Sun Aug 21 21:28:48 2005 for PLC Modem/ABNT-14522 Library by doxygen 1.3.7