DeviceControlClass.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /////////////////////////////////////////////////////////////////////////////////
  2. /// Copyright (c) 2015 China Merchants Bank, all rights reserved ///
  3. /// Adapter Interface for Device control. ///
  4. /// ///
  5. /// ///
  6. /////////////////////////////////////////////////////////////////////////////////
  7. #ifndef __DEVICE_CONTROL_CLASS_H
  8. #define __DEVICE_CONTROL_CLASS_H
  9. #include "DeviceBaseClass.h"
  10. enum ControlType
  11. {
  12. USB_PORT_DISABLE, //disable the USB port
  13. USB_PORT_ENABLE, //enable the USB port
  14. };
  15. class DeviceControlClass : public DeviceBaseClass
  16. {
  17. public:
  18. //
  19. // Connect to device and do initialization.
  20. // Make preparations for controlling the device.
  21. // Arguments:
  22. // - dwPort[in] com port number
  23. // - dwBaudRate[in] Baud rate
  24. //
  25. virtual ErrorCodeEnum DevOpen(DWORD dwPort,DWORD dwBaudRate) = 0;
  26. //
  27. // Open/Close port.
  28. //
  29. virtual ErrorCodeEnum PortControl(ControlType eType)
  30. {
  31. return Error_NotImpl;
  32. }
  33. };
  34. #endif //__CARD_SWIPER_CLASS_H