Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.9 KiB

  1. /*
  2. * REVISIONS:
  3. * rct03Nov93: Broke off from port.h
  4. * cad08Dec93: slight interface changes
  5. * ajr01Feb94: Added backups support for unix
  6. * ajr01Feb94: Added Shared Memory stuff for unix backups client communications
  7. * srt28Mar96: Added support for pnp cables.
  8. * cgm08Dec95: Added rTag as static variable for NLM
  9. * dml17Jun96: Removed include port.h for NT platforms
  10. */
  11. #ifndef _INC__SERPORT_H
  12. #define _INC__SERPORT_H
  13. /**************************************************************************/
  14. #include <tchar.h>
  15. #include "cdefine.h"
  16. #include "_defs.h"
  17. #include "apc.h"
  18. #include "update.h"
  19. #include "stream.h"
  20. #include <windows.h>
  21. enum cableTypes {NORMAL,PNP};
  22. _CLASSDEF(SmartSerialPort)
  23. /**************************************************************************
  24. *
  25. * Serial Port Classes
  26. *
  27. **************************************************************************/
  28. class SmartSerialPort : public Stream {
  29. private:
  30. HANDLE FileHandle;
  31. cableTypes theCableType;
  32. INT RetryStatus;
  33. INT BaudRate;
  34. PCHAR DataBits;
  35. PCHAR Parity;
  36. PCHAR StopBits;
  37. ULONG theWaitTime;
  38. TCHAR theSmartSerialPortName[32];
  39. public:
  40. SmartSerialPort(TCHAR* aPortName, cableTypes aCableType);
  41. INT Read(CHAR* buffer, USHORT* size, ULONG timeout = READ_TIMEOUT);
  42. INT Read(CHAR* buffer, USHORT* size) {return 0;};
  43. INT SYSTOpenPort();
  44. INT SYSTClosePort();
  45. INT SYSTWriteToPort(PCHAR command);
  46. INT SYSTReadFromPort(PCHAR buffer, USHORT* size, ULONG timeout = READ_TIMEOUT);
  47. SmartSerialPort(cableTypes aCableType);
  48. virtual ~SmartSerialPort() {Close();};
  49. INT Initialize () {return (Open());}
  50. INT Open();
  51. INT Write(CHAR* command);
  52. INT Close();
  53. VOID SetWaitTime(ULONG time) {theWaitTime = time;};
  54. };
  55. #endif