UpsDriverGWI.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef LIBFRAMEWORK_UPS_H
  2. #define LIBFRAMEWORK_UPS_H
  3. #include "UpsClass.h"
  4. class CUps : public UpsClass
  5. {
  6. public:
  7. CUps(void);
  8. ~CUps(void);
  9. //
  10. // Device initialization.
  11. // Configure port input/output direction.
  12. //
  13. virtual ErrorCodeEnum DevOpen(DWORD dwPort,DWORD dwBaudRate);
  14. //
  15. // Get device status
  16. //
  17. virtual ErrorCodeEnum GetDevStatus(UpsStatusEnum &eStatus);
  18. //
  19. // Shutdown ups and restart it in minutes.
  20. // Arguments:
  21. // - dwShutTime:time to shutdown (in minutes)
  22. // - dwRestartTime:time to restart (in minutes)
  23. //
  24. virtual ErrorCodeEnum Shutdown(DWORD dwShutTime,DWORD dwRestartTime);
  25. //
  26. // Get category infomation about device.
  27. //
  28. virtual ErrorCodeEnum GetDevCategory(DevCategoryInfo &devCategory);
  29. //
  30. // Reset device.
  31. // Do the cleaning work and initialize device again in order to return to
  32. // the normal condition.
  33. virtual ErrorCodeEnum Reset();
  34. //
  35. // Close device and do the cleaning work.
  36. // ex. close connection,close port,release memery and so on
  37. virtual ErrorCodeEnum DevClose();
  38. //
  39. // Get last error the device issued.
  40. // Error message must include explanatory memorandum ,the original error
  41. // code and anything in favour of location problem.
  42. virtual ErrorCodeEnum GetLastErr(DevErrorInfo &devErrInfo);
  43. private:
  44. ErrorCodeEnum ErrParse(long lResult);
  45. DevErrorInfo m_DevErrorInfo;
  46. };
  47. #endif //LIBFRAMEWORK_CARDSWIPER_IMPL_H