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.

51 lines
1.3 KiB

  1. /*
  2. *
  3. * NOTES:
  4. *
  5. * REVISIONS:
  6. * ker02DEC92: Initial breakout of sensor classes into indiv files
  7. * ker04DEC92: Initial fill in of Member Functions
  8. * SjA10Dec92: Registers with ComController for BATTERY_CONDITION events in constructor.
  9. * SjA10Dec92: Now has an Update Method. Useful for debugging
  10. * SjA11Dec92: Validate correctly returns Err_NOERROR rather than VALID;
  11. * pcy16Feb93: Made to work more like a state sensor
  12. * pcy08Apr94: Trim size, use static iterators, dead code removal
  13. */
  14. #define INCL_BASE
  15. #define INCL_DOS
  16. #define INCL_NOPM
  17. #include "cdefine.h"
  18. extern "C" {
  19. #if (C_OS & C_OS2)
  20. #include <os2.h>
  21. #endif
  22. #include <stdlib.h>
  23. #include <stdio.h>
  24. #include <malloc.h>
  25. #include <string.h>
  26. }
  27. #include "err.h"
  28. #include "battcond.h"
  29. #include "comctrl.h"
  30. BatteryConditionSensor :: BatteryConditionSensor(PDevice aParent, PCommController aCommController)
  31. : StateSensor(aParent, aCommController, BATTERY_CONDITION)
  32. {
  33. storeState(BATTERY_GOOD);
  34. theCommController->RegisterEvent(BATTERY_CONDITION, this);
  35. // theState = BATTERY_GOOD;
  36. }
  37. BatteryConditionSensor :: ~BatteryConditionSensor()
  38. {
  39. if (theCommController)
  40. theCommController->UnregisterEvent(BATTERY_CONDITION, this);
  41. }