Source code of Windows XP (NT5)
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.

68 lines
1.9 KiB

  1. /* Copyright 1999 American Power Conversion, All Rights Reserverd
  2. *
  3. * Description:
  4. * The ApcMiniDriver class provides an interface that is
  5. * compatible with the MiniDriver interface for the Windows2000
  6. * UPS service.
  7. * The ApcMiniDriver makes use of a modified
  8. * PowerChute plus UPS service. This modified service has had
  9. * all of the networking, data logging, and flex manager code
  10. * removed. All that is left is the modeling and monitoring of
  11. * the connected UPS system. It is assumed that a "smart"
  12. * signalling UPS is connected.
  13. * The ApcMiniDriver class is also responsible for filling in
  14. * the advanced registry settings, battery replacement condition,
  15. * serial #, firmware rev, etc...
  16. *
  17. * Revision History:
  18. * mholly 14Apr1999 Created
  19. * mholly 12May1999 no longer taking aCommPort in UPSInit
  20. *
  21. */
  22. #ifndef _INC_APCMINIDRVR_H_
  23. #define _INC_APCMINIDRVR_H_
  24. #include "update.h"
  25. class NTServerApplication;
  26. class ApcMiniDriver : public UpdateObj
  27. {
  28. public:
  29. ApcMiniDriver();
  30. ~ApcMiniDriver();
  31. INT Update(PEvent anEvent) ;
  32. DWORD UPSInit();
  33. void UPSStop();
  34. void UPSWaitForStateChange(DWORD aState, DWORD anInterval);
  35. DWORD UPSGetState();
  36. void UPSCancelWait();
  37. void UPSTurnOff(DWORD aTurnOffDelay);
  38. protected:
  39. INT initalizeAdvancedUpsData();
  40. INT initalizeUpsApplication();
  41. void cleanupUpsApplication();
  42. void setLowBatteryDuration();
  43. INT onUtilityLineCondition(PEvent anEvent);
  44. INT onBatteryReplacementCondition(PEvent anEvent);
  45. INT onBatteryCondition(PEvent anEvent);
  46. INT onCommunicationState(PEvent anEvent);
  47. INT onTimerPulse(PEvent anEvent);
  48. private:
  49. NTServerApplication * theUpsApp;
  50. DWORD theState;
  51. HANDLE theStateChangedEvent;
  52. DWORD theReplaceBatteryState;
  53. ULONG theRunTimeTimer;
  54. DWORD theOnBatteryRuntime;
  55. DWORD theBatteryCapacity;
  56. };
  57. #endif