Map27
 All Classes Functions Variables Enumerations Enumerator Pages
Public Member Functions | Protected Attributes | List of all members
Map27Port Class Reference

Abstract superclass for accessing RS232 port on the host. More...

#include <Map27/Port.h>

Inheritance diagram for Map27Port:
Map27UnixPort

Public Member Functions

 Map27Port ()
 Constructor.
 
virtual bool configure (uint32_t baud=9600)
 
virtual bool open ()
 
virtual bool close ()
 
virtual void send (uint8_t ch)
 
virtual bool canRead ()
 
virtual uint8_t read ()
 

Protected Attributes

uint32_t _baud
 The currently configured baud rate.
 

Detailed Description

Abstract superclass for accessing RS232 port on the host.

This class (or subclasses) are used by Map27PhysicalLayer to send and receive data to and from an RS232 port on the host computer.

At present the only concrete implementations are:

Examples:
test.cpp.

Member Function Documentation

bool Map27Port::canRead ( )
virtual

Test whether readable input characters are waiting

Returns
true if one or more octets are waiting to be read from the underlying device

Reimplemented in Map27UnixPort.

Examples:
test.cpp.
bool Map27Port::close ( )
virtual

Close the underlying physical device if it is currently open

Reimplemented in Map27UnixPort.

bool Map27Port::configure ( uint32_t  baud = 9600)
virtual

Sets the baud rate to use. Map27 mandates 8N1 format, but the baud rate is expected to be configurable to at least 1200 and 9600 baud This interface allows any supported baud rate to be set.

Parameters
[in]baudThe desired baud rate in bauds (ie per-second)
Examples:
test2.cpp, and test3.cpp.
bool Map27Port::open ( )
virtual

Open the underlying physical device Sets the baud rate to the configured rate and to 8N1

Reimplemented in Map27UnixPort.

uint8_t Map27Port::read ( )
virtual

Reads a single octet from the underlying device

Returns
The next octet to be read. Undefined if canRead() is not true.

Reimplemented in Map27UnixPort.

Examples:
test.cpp.
void Map27Port::send ( uint8_t  ch)
virtual

Sends a single octet to the underlying physical device

Parameters
[in]chThe character to send. Blocks until the character is queued by the operating system
[in]chThe octet to send

Reimplemented in Map27UnixPort.

Examples:
test.cpp.

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