IGSTK
|
This class implements Windows specific methods for 32-bit communication over a Serial Port(RS-232 connection). More...
#include <igstkSerialCommunicationForWindows.h>
Protected Types | |
typedef HANDLE | HandleType |
Macro with standard traits declarations. |
Protected Member Functions | |
SerialCommunicationForWindows () | |
Constructor. | |
~SerialCommunicationForWindows () | |
Destructor. | |
virtual ResultType | InternalOpenPort (void) |
Opens serial port for communication;. | |
virtual ResultType | InternalUpdateParameters (void) |
Sets up communication on the open port as per the communication parameters. | |
virtual ResultType | InternalClosePort (void) |
Closes serial port. | |
virtual ResultType | InternalSendBreak (void) |
Send a serial break. | |
virtual void | InternalSleep (int milliseconds) |
Sleep for the number of milliseconds specified. | |
virtual ResultType | InternalPurgeBuffers (void) |
Purge the input and output buffers. | |
virtual ResultType | InternalWrite (const char *message, unsigned int numberOfBytes) |
Write data. | |
virtual ResultType | InternalRead (char *data, unsigned int numberOfBytes, unsigned int &bytesRead) |
Read data. | |
virtual ResultType | InternalSetRTS (unsigned int signal) |
Set the RTS value 0 : Clear the RTS (request-to-send) signal 1 : Sends the RTS signal. | |
virtual ResultType | InternalSetTimeout (unsigned int timeoutPeriod) |
Set the timeout. | |
virtual void | PrintSelf (std::ostream &os, itk::Indent indent) const |
Print object information. | |
![]() | |
LoggerType * | GetLogger () const |
Declarations related to the Logger. | |
SerialCommunication () | |
~SerialCommunication () | |
virtual void | InternalSleep (unsigned int) |
Sleep for the period of time specified, in milliseconds. | |
![]() | |
Communication (void) | |
Constructor is protected in order to enforce the use of the New() operator. | |
virtual | ~Communication (void) |
![]() | |
Object (void) | |
Constructor is protected in order to enforce the use of the New() operator. | |
virtual | ~Object (void) |
void | RegisterObservedObject (const ::igstk::Object *object, unsigned long tag) |
Register observed objects in an internal array so that they can be disconnected upon destruction. | |
void | RemoveFromObservedObjects () |
Remove observers that this object may have connected to other objects. |
Additional Inherited Members | |
![]() | |
enum | PortNumberType { PortNumber0 = 0, PortNumber1 = 1, PortNumber2 = 2, PortNumber3 = 3, PortNumber4 = 4, PortNumber5 = 5, PortNumber6 = 6, PortNumber7 = 7 } |
Available port numbers. More... | |
enum | BaudRateType { BaudRate9600 = 9600, BaudRate19200 = 19200, BaudRate38400 = 38400, BaudRate57600 = 57600, BaudRate115200 = 115200 } |
Available baud rates. More... | |
enum | DataBitsType { DataBits7 = 7, DataBits8 = 8 } |
Available data bits settings. More... | |
enum | ParityType { NoParity = 'N', OddParity = 'O', EvenParity = 'E' } |
Available parity settings. More... | |
enum | StopBitsType { StopBits1 = 1, StopBits2 = 2 } |
Available stop bits settings. More... | |
enum | HandshakeType { HandshakeOff = 0, HandshakeOn = 1 } |
Available hardware handshaking settings. More... | |
typedef Communication::ResultType | ResultType |
![]() | |
igstkStandardClassBasicTraitsMacro (SerialCommunication, Communication) | |
Standard traits of a basic class. | |
virtual void | SetPortNumber (PortNumberType _arg) |
Specify which serial port to use. | |
virtual PortNumberType | GetPortNumber () |
Get the serial port, where the ports are numbered 0 through 3. | |
virtual void | SetBaudRate (BaudRateType _arg) |
Set the baud rate to use. | |
virtual BaudRateType | GetBaudRate () |
Get the baud rate. | |
virtual void | SetDataBits (DataBitsType _arg) |
Set the number of bits per character. | |
virtual DataBitsType | GetDataBits () |
Get the number of bits per character. | |
virtual void | SetParity (ParityType _arg) |
Set the parity. | |
virtual ParityType | GetParity () |
Get the parity. | |
virtual void | SetStopBits (StopBitsType _arg) |
Set the number of stop bits. | |
virtual StopBitsType | GetStopBits () |
Get the number of stop bits. | |
virtual void | SetHardwareHandshake (HandshakeType _arg) |
Set whether to use hardware handshaking. | |
virtual HandshakeType | GetHardwareHandshake () |
Get whether hardware handshaking is enabled. | |
void | SetCaptureFileName (const char *filename) |
Set the name of the file into which the data stream is recorded. | |
const char * | GetCaptureFileName () const |
Get the filename into which the data stream is recorded. | |
virtual void | SetCapture (bool _arg) |
Set whether to record the data. | |
virtual bool | GetCapture () |
Get whether the data is being recorded. | |
ResultType | UpdateParameters (void) |
Update the communication parameters, in case you need to change the baud rate, handshaking, timeout, etc. | |
ResultType | OpenCommunication (void) |
The method OpenCommunication sets up communication as per the data provided. | |
ResultType | CloseCommunication (void) |
The method CloseCommunication closes the communication. | |
ResultType | SetRTS (unsigned int signal) |
Set the RTS value 0 : Clear the RTS (request-to-send) signal 1 : Sends the RTS signal. | |
ResultType | Write (const char *message, unsigned int numberOfBytes) |
Write method sends the string via the communication link. | |
ResultType | Read (char *data, unsigned int numberOfBytes, unsigned int &bytesRead) |
Read method receives the string via the communication link. | |
ResultType | SendBreak (void) |
Send a break in the serial communication, which by definition is a series of zeroes that lasts for a 0.3 second duration. | |
ResultType | PurgeBuffers (void) |
Purge the contents of the buffers. | |
void | Sleep (unsigned int milliseconds) |
Sleep for the specified number of milliseconds. | |
void | ExportStateMachineDescription (OutputStreamType &ostr, bool skipLoops=false) const |
Declarations related to the State Machine. | |
void | SetLogger (LoggerType *logger) |
Connect the Logger for this class. | |
![]() | |
static Pointer | New (void) |
Customized New method that will return the implementation of SerialCommunication that is appropriate for this platform. | |
![]() | |
ResultType |
This class implements Windows specific methods for 32-bit communication over a Serial Port(RS-232 connection).
"SerialCommunicationForWindows State Machine Diagram" "SerialCommunicationForWindows State Machine Diagram"
Definition at line 44 of file igstkSerialCommunicationForWindows.h.
|
protected |
Macro with standard traits declarations.
Return value type for interface functions Windows file handle type
Definition at line 49 of file igstkSerialCommunicationForWindows.h.
|
protected |
Constructor.
|
protected |
Destructor.
|
protectedvirtual |
Opens serial port for communication;.
Reimplemented from igstk::SerialCommunication.
|
protectedvirtual |
Sets up communication on the open port as per the communication parameters.
Reimplemented from igstk::SerialCommunication.
|
protectedvirtual |
Closes serial port.
Reimplemented from igstk::SerialCommunication.
|
protectedvirtual |
Send a serial break.
Reimplemented from igstk::SerialCommunication.
|
protectedvirtual |
Sleep for the number of milliseconds specified.
|
protectedvirtual |
Purge the input and output buffers.
Reimplemented from igstk::SerialCommunication.
|
protectedvirtual |
Write data.
Reimplemented from igstk::SerialCommunication.
|
protectedvirtual |
Read data.
Reimplemented from igstk::SerialCommunication.
|
protectedvirtual |
Set the RTS value 0 : Clear the RTS (request-to-send) signal 1 : Sends the RTS signal.
Reimplemented from igstk::SerialCommunication.
|
protectedvirtual |
Set the timeout.
|
protectedvirtual |
Print object information.
Reimplemented from igstk::SerialCommunication.