Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Away-Mode not supported #2

Open
opdenkamp opened this issue Oct 26, 2016 · 0 comments
Open

Windows Away-Mode not supported #2

opdenkamp opened this issue Oct 26, 2016 · 0 comments

Comments

@opdenkamp
Copy link
Contributor

Moved from Pulse-Eight/libcec#243

Latest libcec still doesn't support Windows Away-Mode, which has been a part of Windows since XP MCE. This breaks CEC functionality and makes CEC adapter basically useless on Windows machines:

When Windows tries to wake up system in Away-Mode (to perform a schedules Windows Update or tv recording for example), libcec doesn't recognize away-mode call and overwrites it.

Instead of system remaining "silent", libcec sends out CEC command and wakes up connected tv and avr.


Problem applies to official libcec tray application as well as to 3rd party application like Kodi that rely on libcec library.

Unofficial CEC Tray application by CIR21 properly supports Windows Away-Mode, so implementation is possible.


OpenPHT needs to register to receive away-mode status:

RegisterPowerSettingNotification(m_hWnd, &GUID_SYSTEM_AWAYMODE, DEVICE_NOTIFY_WINDOW_HANDLE);

The powermanager then needs to check for the Away-Mode call like this:

case PBT_POWERSETTINGCHANGE:
{
POWERBROADCAST_SETTING* s = (POWERBROADCAST_SETTING*)nEventData;
if( s != NULL && IsEqualGUID( s->PowerSetting, GUID_SYSTEM_AWAYMODE ) )
// The computer is entering "away" mode.

Further technical documentation is available in the attached documents or over on MSDN:
Microsoft documentation

awaymode.pdf
AvailabilityRequests.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant