Logo Search packages:      
Sourcecode: icomlib version File versions  Download package

PComm Class Reference

#include <pcomm.h>

List of all members.

Detailed Description

The Primitive Communications Object.

PComm object is the serial i/o object. It facilitates the low level grunt work for reading and writing to the serial device(s). It handles the string manipulation necessary for communication with the radio.

Definition at line 47 of file pcomm.h.

Public Member Functions

size_pc PCAsk (char *)
 Issue a status request from the radio.
void PCClose ()
 Closes the currently active file descriptor.
size_pc PCHear (char *)
 Receive a repsonse from the radio.
 PComm (char *pcrDev, tcflag_t baudRate=B9600, const char *name=0)
 The PComm Constructor.
bool PCOpen (const char *pcrDev=PCRDEV, tcflag_t baudRate=B9600)
 Opens another file descriptor to the serial device.
size_pc PCRawRead (char *)
 reads directly from the current socket.
size_pc PCRawWrite (char *)
 writes directly to the current socket.
size_pc PCTell (char *)
 Issue a command string to the radio.
 ~PComm ()
 The PComm Destructor.

Private Member Functions

void countCall ()
 function to keep track on the number of calls
size_pc Read (char *)
 Internal function to read from the socket.
void resetCall ()
 resets the radio and port
size_pc Write (char *)
 Internal function to write to the socket.

Private Attributes

char askBuf [256]
 Buffer for sending data in PCAsk.
size_pc askCtr
 Receive bytecount used in PCAsk.
char callBuf [256]
 Internal buffer for radio reset.
int callCount
 Counter for number of times the radio has been written to.
bool errRead
 Was there an error reading?
bool errWrite
 Was there an error writing?
int fd
 Socket descriptor used for current session.
fd_set * FDSet
 Socket set used in the select.
char hearBuf [256]
 Buffer for receiving data in PCHear.
size_pc hearCtr
 Receive bytecount used in PCHear.
char int_name [256]
 Internal object name. Warning: not necessarily populated.
struct termios * newtio
 Port settings to be applied for current session.
struct termios * oldtio
 Stores the port's original settings.
char pcrDevice [256]
 Current serial/comm device.
tcflag_t pcrSpeed
 Current baud rate.
char readBuf [256]
 Buffer for reading data used in wrapper Read().
size_pc readCtr
 Receive bytecount used in wrapper function Read().
int retVal
 Select()'s return value.
size_pc tellCtr
 Send bytecount used in PCTell.
struct timeval * timeOut
 Used in the select for timeout(s).
char writeBuf [256]
 Buffer for writing data used in wrapper Write().
size_pc writeCtr
 Send bytecount used in wrapper function Write().

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index