CCOMSerial.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /******************************************************************************
  2. |* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3. |* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4. |* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5. |* PARTICULAR PURPOSE.
  6. |*
  7. |* Copyright 1995-2005 Nero AG. All Rights Reserved.
  8. |*-----------------------------------------------------------------------------
  9. |* NeroSDK / NeroRobo
  10. |*
  11. |* PROGRAM: CCOMSerial.h
  12. |*
  13. |* PURPOSE: Interface for serial (COM) port communication
  14. ******************************************************************************/
  15. /* Serial interface for PC COM Ports.
  16. * This is an extension to the CSerial interface to allow
  17. * some COM Port specific configuration for interfaces
  18. * returning the type PORT_SERIAL at runtime */
  19. #ifndef CCOMSERIAL_H
  20. #define CCOMSERIAL_H
  21. #include "CSerial.h"
  22. class CCOMSerial
  23. :public CSerial
  24. {
  25. public:
  26. typedef enum
  27. {
  28. CPARITY_EVEN,
  29. CPARITY_MARK,
  30. CPARITY_NO,
  31. CPARITY_ODD,
  32. CPARITY_SPACE
  33. } ParitySettings;
  34. typedef enum
  35. {
  36. STOPBITS_ONE,
  37. STOPBITS_ONEP5,
  38. STOPBITS_TWO
  39. } StopBitSettings;
  40. /* Adjust the configuration of the serial interface. Specify:
  41. * - iBaudRate: the baud rate at which the communication device operates
  42. * - iDataBits: specifies the number of bits in the bytes transmitted and received
  43. * - psParity: specifies the parity scheme to be used. It is one values above
  44. * - sbStopBits: specifies the number of stop bits to be used. It is one values above
  45. * Returns TRUE on success.
  46. * WARNING! Must not be called when port is open */
  47. virtual BOOL SetConfiguration(int iBaudRate, int iDataBits, ParitySettings psParity, StopBitSettings sbStopBits) = 0;
  48. virtual SerialPortType GetPortType() { return PORT_SERIAL; };
  49. };
  50. #endif // CCOMSERIAL_H