LinuxPowerSyscall.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (C) 2014 Team XBMC
  3. * http://www.xbmc.org
  4. *
  5. * This Program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2, or (at your option)
  8. * any later version.
  9. *
  10. * This Program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with XBMC; see the file COPYING. If not, see
  17. * <http://www.gnu.org/licenses/>.
  18. *
  19. */
  20. #if defined (_LINUX)
  21. #include <stdlib.h>
  22. #include "LinuxPowerSyscall.h"
  23. #include "utils/log.h"
  24. CLinuxPowerSyscall::CLinuxPowerSyscall()
  25. {
  26. CLog::Log(LOGINFO, "Selected LinuxPower as PowerSyscall");
  27. }
  28. CLinuxPowerSyscall::~CLinuxPowerSyscall()
  29. { }
  30. bool CLinuxPowerSyscall::Powerdown()
  31. {
  32. system("/sbin/poweroff -F");
  33. return 0;
  34. }
  35. bool CLinuxPowerSyscall::Reboot()
  36. {
  37. system("/sbin/reboot -F");
  38. return 0;
  39. }
  40. int CLinuxPowerSyscall::BatteryLevel(void)
  41. { }
  42. bool CLinuxPowerSyscall::PumpPowerEvents(IPowerEventsCallback *callback)
  43. {
  44. return true;
  45. }
  46. #endif