Main Page | Modules | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

SerialCommPortal Class Reference
[Communications Facilities]

#include <SerialCommPortal.hh>

Inherits FileCommPortal.

List of all members.


Detailed Description

Concrete class for a network messaging.

The concrete subclass of CommPortal which manages communications via a serial line. It manages a serial device that messages can be received from and sent to to a single SerialRemoteManager.


Public Member Functions

virtual ~SerialCommPortal ()
bool init (CommManager *mgr, const char *device, struct termios *tflags=NULL)
virtual MessagereceiveMsg ()
virtual bool releaseMsg (Message *message)
virtual bool flush ()
SerialRemoteManagerserialRemote () const
bool sendMsg (Message *msg, unsigned char *preamble, int preamble_size)

Static Public Member Functions

SerialCommPortalinstance (utils::SymbolTable *table)


Constructor & Destructor Documentation

virtual SerialCommPortal::~SerialCommPortal  )  [virtual]
 

This will close the UDP socket


Member Function Documentation

virtual bool SerialCommPortal::flush  )  [inline, virtual]
 

Flush message sends. If we are packaging or buffering message sends, force the real sends.

Returns:
Returns true for success and false for failure

Implements CommPortal.

bool SerialCommPortal::init CommManager mgr,
const char *  device,
struct termios *  tflags = NULL
 

Initialize the messager. Connect it to a CommManager and select a UDP port. A side effect is the storage of the portal in the manager's symbol table under the name SERIAL_COMM_PORTAL_INSTANCE

Parameters:
[in] mgr The controller communications manager.
[in] device The name of the serial device
[in] tflags Serial line terminal settings
Returns:
true for success, false for fatal failure

SerialCommPortal* SerialCommPortal::instance utils::SymbolTable *  table  )  [static]
 

Returns the communications protocol instance from manager. It looks up the symbol in the manager's symbol table under SERIAL_COMM_PORTAL_INSTANCE

virtual Message* SerialCommPortal::receiveMsg  )  [virtual]
 

Receive a message, blocking until one is available.

Returns:
Returns NULL for failure, and the next available message on success

Implements CommPortal.

virtual bool SerialCommPortal::releaseMsg Message message  )  [virtual]
 

Release a message received by CommPortal::receiveMsg. If you do not do this when you are done with a message, there will be a memory leak.

Parameters:
[in] message The message to be released.
Returns:
Return true for success and false for failure.

Implements CommPortal.


RHexLib Reference Documentation