#include <SerialPort_t.h>
Inheritance diagram for vpr::SerialPort_t:


Public Methods | |
| SerialPort_t (const std::string &port_name) | |
| Constructor. More... | |
| virtual | ~SerialPort_t () |
| Destructor. More... | |
| virtual const std::string & | getName () const |
| Gets the name of the encapsulated serial port. More... | |
| vpr::ReturnStatus | open () |
| Opens the serial port. More... | |
| vpr::ReturnStatus | close () |
| Closes the serial port. More... | |
| vpr::ReturnStatus | setBlocking (bool blocking) |
| Reconfigures the serial port so that it is in blocking or non-blocking mode depending on the value of the parameter. More... | |
| vpr::ReturnStatus | clearAll () |
| Clears all of the serial port settings. More... | |
| bool | isBlocking () const |
| Get the current blocking state for the serial port. More... | |
| virtual IOSys::Handle | getHandle () const |
| Gets the vpr::IOSys::Handle object for this serial port. More... | |
| void | setOpenReadOnly () |
| Sets the open flags so that the serial port is opened in read-only mode. More... | |
| void | setOpenWriteOnly () |
| Sets the open flags so that the serial port is opened in write-only mode. More... | |
| void | setOpenReadWrite () |
| Sets the open flags so that the serial port is opened in read/write mode. More... | |
| vpr::SerialTypes::UpdateActionOption | getUpdateAction () const |
| Gets the current update action. More... | |
| void | setUpdateAction (vpr::SerialTypes::UpdateActionOption action) |
| Changes the current update action to take place as described by the given value. More... | |
| vpr::ReturnStatus | getMinInputSize (vpr::Uint16 &size) const |
| Queries the serial port for the minimum buffer size. More... | |
| vpr::ReturnStatus | setMinInputSize (const vpr::Uint8 size) |
| Attempts to change the minimum buffer size to the given argument. More... | |
| vpr::ReturnStatus | getTimeout (vpr::Uint8 &timeout) const |
| Gets the value of the timeout (in tenths of a second) to wait for data to arrive. More... | |
| vpr::ReturnStatus | setTimeout (const vpr::Uint8 timeout_val) |
| Sets the value of the timeout to wait for data to arrive. More... | |
| vpr::ReturnStatus | getCharacterSize (vpr::SerialTypes::CharacterSizeOption &size) const |
| Gets the character size (the bits per byte). More... | |
| vpr::ReturnStatus | setCharacterSize (const vpr::SerialTypes::CharacterSizeOption bpb) |
| Sets the current character size (the bits per byte) to the size in the given value. More... | |
| bool | getReadState () const |
| Gets the current read state for the port. More... | |
| vpr::ReturnStatus | setRead (bool flag) |
| Changes the receiver so that bytes can or cannot be read from the port. More... | |
| bool | getLocalAttachState () const |
| Gets the current local attach state for the port. More... | |
| vpr::ReturnStatus | setLocalAttach (bool flag) |
| Mark the device as locally attached or not. More... | |
| vpr::ReturnStatus | getStopBits (vpr::Uint8 &num_bits) const |
| Gets the number of stop bits in use. More... | |
| vpr::ReturnStatus | setStopBits (const vpr::Uint8 num_bits) |
| Sets the number of stop bits to use. More... | |
| bool | getCanonicalState () const |
| Queries the canonical input state of the serial port. More... | |
| vpr::ReturnStatus | setCanonicalInput (bool flag) |
| Enables canonical input. More... | |
| bool | getBadByteIgnoreState () const |
| Gets the current state of ignoring bytes with framing errors (other than a BREAK) or parity errors. More... | |
| vpr::ReturnStatus | setBadByteIgnore (bool flag) |
| Enables or disables ignoring of received bytes with framing errors or parity errors. More... | |
| bool | getBreakByteIgnoreState () const |
| Gets the current state of ignoring BREAK bytes. More... | |
| vpr::ReturnStatus | setBreakByteIgnore (bool flag) |
| Enables or disables ignoring of received BREAK bytes. More... | |
| bool | getInputParityCheckState () const |
| Gets the state of parity checking for input. More... | |
| vpr::ReturnStatus | setInputParityCheck (bool flag) |
| Enables or disables input parity checking. More... | |
| bool | getBitStripState () const |
| Gets the current state of bit stripping. More... | |
| vpr::ReturnStatus | setBitStripping (bool flag) |
| Enables or disables stripping of input bytes to seven bits. More... | |
| bool | getStartStopInputState () const |
| Gets the state of start-stop input control. More... | |
| vpr::ReturnStatus | setStartStopInput (bool flag) |
| Enables or disables start-stop input control. More... | |
| bool | getStartStopOutputState () const |
| Gets the state of start-stop output control. More... | |
| vpr::ReturnStatus | setStartStopOutput (bool flag) |
| Enables or disables start-stop output control. More... | |
| bool | getParityGenerationState () const |
| Gets the current state of parity generation for outgoing bytes and parity checking for incoming bytes. More... | |
| vpr::ReturnStatus | setParityGeneration (bool flag) |
| Enables or disables parity generation for outgoing bytes and parity checking for incoming bytes. More... | |
| bool | getParityErrorMarkingState () const |
| Returns the current state of parity error marking for this serial port. More... | |
| vpr::ReturnStatus | setParityErrorMarking (bool flag) |
| Enables or disables marking of bytes with parity errors or framing errors (except BREAKs). More... | |
| vpr::SerialTypes::ParityType | getParity () const |
| Gets the current parity checking type (either odd or even). More... | |
| vpr::ReturnStatus | setParity (const vpr::SerialTypes::ParityType &type) |
| Enables even or odd parity. More... | |
| vpr::ReturnStatus | getInputBaudRate (vpr::Uint32 &rate) const |
| Gets the current input baud rate. More... | |
| vpr::ReturnStatus | setInputBaudRate (const vpr::Uint32 baud) |
| Sets the current input baud rate. More... | |
| vpr::ReturnStatus | getOutputBaudRate (vpr::Uint32 &rate) const |
| Gets the current output baud rate. More... | |
| vpr::ReturnStatus | setOutputBaudRate (const vpr::Uint32 baud) |
| Sets the current output baud rate. More... | |
| vpr::ReturnStatus | drainOutput () |
| Waits for all output to be transmitted. More... | |
| vpr::ReturnStatus | controlFlow (SerialTypes::FlowActionOption opt) |
| Alters the input or output flow control. More... | |
| bool | getHardwareFlowControlState () const |
| Returns the current enable state of hardware flow control. More... | |
| vpr::ReturnStatus | setHardwareFlowControl (bool flag) |
| Attempts to enable "hardware" flow control. More... | |
| vpr::ReturnStatus | flushQueue (SerialTypes::FlushQueueOption queue) |
| Discards either the input buffer (unread data received from the terminal device) or the output buffer (data written but not yet transmitted to the terminal device). More... | |
| vpr::ReturnStatus | sendBreak (const int duration) |
| Transmit a continuous stream of zero bits for the given duration. More... | |
| int | getCarrierDetect () const |
| Return the status of the carrier detect signal. More... | |
| int | getDataSetReady () const |
| Returns the status of the data set ready line. More... | |
| int | getClearToSend () const |
| Returns the status of the clear to send. More... | |
| int | getRingIndicator () const |
| Returns the status of the ring indicator line. More... | |
| vpr::ReturnStatus | setDataTerminalReady (bool val) |
| Sets the data terminal ready line. More... | |
| vpr::ReturnStatus | setRequestToSend (bool val) |
| Sets the ready to send line. More... | |
Protected Methods | |
| virtual vpr::ReturnStatus | read_i (void *buffer, const vpr::Uint32 length, vpr::Uint32 &bytes_read, const vpr::Interval timeout=vpr::Interval::NoTimeout) |
Implementation of the read template method. More... | |
| virtual vpr::ReturnStatus | readn_i (void *buffer, const vpr::Uint32 length, vpr::Uint32 &bytes_read, const vpr::Interval timeout=vpr::Interval::NoTimeout) |
Implementation of the readn template method. More... | |
| virtual vpr::ReturnStatus | write_i (const void *buffer, const vpr::Uint32 length, vpr::Uint32 &bytes_written, const vpr::Interval timeout=vpr::Interval::NoTimeout) |
Implementation of the write template method. More... | |
Protected Attributes | |
| RealSerialPortImpl | mSioImpl |
| Platform-specific serial port implementation object. More... | |
Definition at line 56 of file SerialPort_t.h.
|
||||||||||
|
Constructor.
Definition at line 69 of file SerialPort_t.h. References mSioImpl, and vpr::Port::Port.
|
|
|||||||||
|
Destructor. This does nothing.
Definition at line 81 of file SerialPort_t.h.
00082 {
00083 /* Do nothing. */ ;
00084 }
|
|
|||||||||
|
Gets the name of the encapsulated serial port.
Reimplemented from vpr::BlockIO. Definition at line 99 of file SerialPort_t.h. References mSioImpl.
00100 {
00101 return mSioImpl.getName();
00102 }
|
|
|||||||||
|
Opens the serial port.
Implements vpr::BlockIO. Definition at line 115 of file SerialPort_t.h. References mSioImpl.
00116 {
00117 return mSioImpl.open();
00118 }
|
|
|||||||||
|
Closes the serial port.
Implements vpr::BlockIO. Definition at line 131 of file SerialPort_t.h. References mSioImpl.
00132 {
00133 return mSioImpl.close();
00134 }
|
|
||||||||||
|
Reconfigures the serial port so that it is in blocking or non-blocking mode depending on the value of the parameter. If the serial port has not been opened yet, it will be opened in blocking or non-blocking mode appropriately.
Implements vpr::BlockIO. Definition at line 151 of file SerialPort_t.h. References mSioImpl.
00152 {
00153 return mSioImpl.setBlocking(blocking);
00154 }
|
|
|||||||||
|
Clears all of the serial port settings.
Definition at line 166 of file SerialPort_t.h. References mSioImpl.
00167 {
00168 return mSioImpl.clearAll();
00169 }
|
|
|||||||||
|
Get the current blocking state for the serial port.
Reimplemented from vpr::BlockIO. Definition at line 179 of file SerialPort_t.h. References mSioImpl.
00180 {
00181 return mSioImpl.isBlocking();
00182 }
|
|
|||||||||
|
Gets the vpr::IOSys::Handle object for this serial port.
Implements vpr::BlockIO. Definition at line 190 of file SerialPort_t.h. References mSioImpl.
00191 {
00192 return mSioImpl.getHandle();
00193 }
|
|
|||||||||
|
Sets the open flags so that the serial port is opened in read-only mode.
Definition at line 207 of file SerialPort_t.h. References mSioImpl.
00208 {
00209 mSioImpl.setOpenReadOnly();
00210 }
|
|
|||||||||
|
Sets the open flags so that the serial port is opened in write-only mode.
Definition at line 221 of file SerialPort_t.h. References mSioImpl.
00222 {
00223 mSioImpl.setOpenWriteOnly();
00224 }
|
|
|||||||||
|
Sets the open flags so that the serial port is opened in read/write mode.
Definition at line 235 of file SerialPort_t.h. References mSioImpl.
00236 {
00237 mSioImpl.setOpenReadWrite();
00238 }
|
|
|||||||||
|
Gets the current update action. This tells when updates to the serial device take effect.
Definition at line 252 of file SerialPort_t.h. References mSioImpl.
00253 {
00254 return mSioImpl.getUpdateAction();
00255 }
|
|
||||||||||
|
Changes the current update action to take place as described by the given value.
Definition at line 269 of file SerialPort_t.h. References mSioImpl.
00270 {
00271 mSioImpl.setUpdateAction(action);
00272 }
|
|
||||||||||
|
Queries the serial port for the minimum buffer size. This is only applicable in non-canonical mode. The min buffer size determines how many bytes must be read before a read can return.
Definition at line 291 of file SerialPort_t.h. References mSioImpl.
00292 {
00293 return mSioImpl.getMinInputSize(size);
00294 }
|
|
||||||||||
|
Attempts to change the minimum buffer size to the given argument.
This will change the minimum number of bytes required in the buffer before a
Definition at line 311 of file SerialPort_t.h. References mSioImpl.
00312 {
00313 return mSioImpl.setMinInputSize(size);
00314 }
|
|
||||||||||
|
Gets the value of the timeout (in tenths of a second) to wait for data to arrive. This is only applicable in non-canonical mode.
Definition at line 331 of file SerialPort_t.h. References mSioImpl.
00332 {
00333 return mSioImpl.getTimeout(timeout);
00334 }
|
|
||||||||||
|
Sets the value of the timeout to wait for data to arrive. The value given must be in tenths of a second. This is only applicable in non-canonical mode.
Definition at line 351 of file SerialPort_t.h. References mSioImpl.
00352 {
00353 return mSioImpl.setTimeout(timeout_val);
00354 }
|
|
||||||||||
|
Gets the character size (the bits per byte).
Definition at line 372 of file SerialPort_t.h. References mSioImpl.
00373 {
00374 return mSioImpl.getCharacterSize(size);
00375 }
|
|
||||||||||
|
Sets the current character size (the bits per byte) to the size in the given value. This is used for both reding and writing, and the size does not include the parity bit (if any).
Definition at line 393 of file SerialPort_t.h. References mSioImpl.
00394 {
00395 return mSioImpl.setCharacterSize(bpb);
00396 }
|
|
|||||||||
|
Gets the current read state for the port.
Definition at line 408 of file SerialPort_t.h. References mSioImpl.
00409 {
00410 return mSioImpl.getReadState();
00411 }
|
|
||||||||||
|
Changes the receiver so that bytes can or cannot be read from the port.
Definition at line 425 of file SerialPort_t.h. References mSioImpl.
00426 {
00427 return mSioImpl.setRead(flag);
00428 }
|
|
|||||||||
|
Gets the current local attach state for the port.
Definition at line 440 of file SerialPort_t.h. References mSioImpl.
00441 {
00442 return mSioImpl.getLocalAttachState();
00443 }
|
|
||||||||||
|
Mark the device as locally attached or not.
Definition at line 456 of file SerialPort_t.h. References mSioImpl.
00457 {
00458 return mSioImpl.setLocalAttach(flag);
00459 }
|
|
||||||||||
|
Gets the number of stop bits in use. This will be either 1 or 2.
Definition at line 475 of file SerialPort_t.h. References mSioImpl.
00476 {
00477 return mSioImpl.getStopBits(num_bits);
00478 }
|
|
||||||||||
|
Sets the number of stop bits to use. The value must be either 1 or 2.
Definition at line 493 of file SerialPort_t.h. References mSioImpl.
00494 {
00495 return mSioImpl.setStopBits(num_bits);
00496 }
|
|
|||||||||
|
Queries the canonical input state of the serial port.
If canonical mode is enabled, the characters
Definition at line 517 of file SerialPort_t.h. References mSioImpl.
00518 {
00519 return mSioImpl.getCanonicalState();
00520 }
|
|
||||||||||
|
Enables canonical input. See getCanonicalState() for more information about what this means.
Definition at line 534 of file SerialPort_t.h. References mSioImpl.
00535 {
00536 return mSioImpl.setCanonicalInput(flag);
00537 }
|
|
|||||||||
|
Gets the current state of ignoring bytes with framing errors (other than a BREAK) or parity errors.
Definition at line 549 of file SerialPort_t.h. References mSioImpl.
00550 {
00551 return mSioImpl.getBadByteIgnoreState();
00552 }
|
|
||||||||||
|
Enables or disables ignoring of received bytes with framing errors or parity errors.
Definition at line 568 of file SerialPort_t.h. References mSioImpl.
00569 {
00570 return mSioImpl.setBadByteIgnore(flag);
00571 }
|
|
|||||||||
|
Gets the current state of ignoring BREAK bytes.
Definition at line 582 of file SerialPort_t.h. References mSioImpl.
00583 {
00584 return mSioImpl.getBreakByteIgnoreState();
00585 }
|
|
||||||||||
|
Enables or disables ignoring of received BREAK bytes.
Definition at line 599 of file SerialPort_t.h. References mSioImpl.
00600 {
00601 return mSioImpl.setBreakByteIgnore(flag);
00602 }
|
|
|||||||||
|
Gets the state of parity checking for input.
Definition at line 613 of file SerialPort_t.h. References mSioImpl.
00614 {
00615 return mSioImpl.getInputParityCheckState();
00616 }
|
|
||||||||||
|
Enables or disables input parity checking.
Definition at line 630 of file SerialPort_t.h. References mSioImpl.
00631 {
00632 return mSioImpl.setInputParityCheck(flag);
00633 }
|
|
|||||||||
|
Gets the current state of bit stripping. When enabled, input bytes are stripped to seven bits. Otherwise, all eight bits are processed.
Definition at line 645 of file SerialPort_t.h. References mSioImpl.
00646 {
00647 return mSioImpl.getBitStripState();
00648 }
|
|
||||||||||
|
Enables or disables stripping of input bytes to seven bits.
Definition at line 662 of file SerialPort_t.h. References mSioImpl.
00663 {
00664 return mSioImpl.setBitStripping(flag);
00665 }
|
|
|||||||||
|
Gets the state of start-stop input control. When enabled, if the terminal driver sees that the receive buffer is getting full, a STOP command is sent to the serial port. The device should respond by halting its data flow. When the input queue has been processed, a START command is sent to the serial port which should cause it to resume putting bytes onto the input queue. PRE: The serial port is open. POST: The current state of start-stop input control is returned to the caller.
Definition at line 682 of file SerialPort_t.h. References mSioImpl.
00683 {
00684 return mSioImpl.getStartStopInputState();
00685 }
|
|
||||||||||
|
Enables or disables start-stop input control. See getStartStopInputState() for more information.
Definition at line 700 of file SerialPort_t.h. References mSioImpl.
00701 {
00702 return mSioImpl.setStartStopInput(flag);
00703 }
|
|
|||||||||
|
Gets the state of start-stop output control. When enabled, when the terminal driver receives a STOP command, output stops. When it receives a START command, output resumes. If disabled, these commands are read as normal characters.
Definition at line 718 of file SerialPort_t.h. References mSioImpl.
00719 {
00720 return mSioImpl.getStartStopOutputState();
00721 }
|
|
||||||||||
|
Enables or disables start-stop output control. See getStartStopOutputState() for more information.
Definition at line 738 of file SerialPort_t.h. References mSioImpl.
00739 {
00740 return mSioImpl.setStartStopOutput(flag);
00741 }
|
|
|||||||||
|
Gets the current state of parity generation for outgoing bytes and parity checking for incoming bytes.
Definition at line 755 of file SerialPort_t.h. References mSioImpl.
00756 {
00757 return mSioImpl.getParityGenerationState();
00758 }
|
|
||||||||||
|
Enables or disables parity generation for outgoing bytes and parity checking for incoming bytes.
Definition at line 773 of file SerialPort_t.h. References mSioImpl.
00774 {
00775 return mSioImpl.setParityGeneration(flag);
00776 }
|
|
|||||||||
|
Returns the current state of parity error marking for this serial port.
Definition at line 786 of file SerialPort_t.h. References mSioImpl.
00787 {
00788 return mSioImpl.getParityErrorMarkingState();
00789 }
|
|
||||||||||
|
Enables or disables marking of bytes with parity errors or framing errors (except BREAKs). This is only active if input parity and framing error reporting is enabled (see setInputParityCheck() for more information). The mark is the three-byte sequence \377 \0 X where X is the byte received in error. If bit stripping is enabled, a valid \377 byte is passed as the two-byte sequence \377 \377.
Definition at line 810 of file SerialPort_t.h. References mSioImpl.
00811 {
00812 return mSioImpl.setParityErrorMarking(flag);
00813 }
|
|
|||||||||
|
Gets the current parity checking type (either odd or even).
Definition at line 824 of file SerialPort_t.h. References mSioImpl.
00825 {
00826 return mSioImpl.getParity();
00827 }
|
|
||||||||||
|
Enables even or odd parity.
Definition at line 840 of file SerialPort_t.h. References mSioImpl.
00841 {
00842 return mSioImpl.setParity(type);
00843 }
|
|
||||||||||
|
Gets the current input baud rate.
Definition at line 858 of file SerialPort_t.h. References mSioImpl.
00859 {
00860 return mSioImpl.getInputBaudRate(rate);
00861 }
|
|
||||||||||
|
Sets the current input baud rate.
Definition at line 874 of file SerialPort_t.h. References mSioImpl.
00875 {
00876 return mSioImpl.setInputBaudRate(baud);
00877 }
|
|
||||||||||
|
Gets the current output baud rate.
|