IGSTK
igstkSerialCommunicationForWindows.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkSerialCommunicationForWindows.h,v $
5  Language: C++
6  Date: $Date: 2008-02-11 01:41:51 $
7  Version: $Revision: 1.12 $
8 
9  Copyright (c) ISC Insight Software Consortium. All rights reserved.
10  See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 
18 #ifndef __igstkSerialCommunicationForWindows_h
19 #define __igstkSerialCommunicationForWindows_h
20 
21 #include <windows.h>
22 
24 
25 namespace igstk
26 {
27 
45 {
46 public:
47 
51 
52 public:
53 
56 
57 protected:
58 
60  typedef HANDLE HandleType;
61 
64 
67 
69  virtual ResultType InternalOpenPort( void );
70 
73  virtual ResultType InternalUpdateParameters( void );
74 
76  virtual ResultType InternalClosePort( void );
77 
79  virtual ResultType InternalSendBreak( void );
80 
82  virtual void InternalSleep( int milliseconds );
83 
85  virtual ResultType InternalPurgeBuffers( void );
86 
88  virtual ResultType InternalWrite( const char *message,
89  unsigned int numberOfBytes );
90 
92  virtual ResultType InternalRead( char *data, unsigned int numberOfBytes,
93  unsigned int &bytesRead );
94 
98  virtual ResultType InternalSetRTS(unsigned int signal);
99 
101  virtual ResultType InternalSetTimeout( unsigned int timeoutPeriod );
102 
104  virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
105 
106 private:
107 
108  unsigned int m_OldTimeoutPeriod;
109 
110  HandleType m_PortHandle; // com port handle
111 };
112 
113 } // end namespace igstk
114 
115 #endif // __igstkSerialCommunicationForWindows_h