Share via


RemoteWakeup Property

The RemoteWakeup property gets or sets whether a device supports remote wake-up.

This property is read/write.

Syntax

HRESULT put_RemoteWakeup(
  [in]           VARIANT_BOOL pfRemoteWakeup
);

HRESULT get_RemoteWakeup(
  [out, retval]  VARIANT_BOOL *fRemoteWakeup
);

Property Value

Caller-allocated space to hold the remote wake-up value.

Error Codes

RemoteWakeup returns one of the following values:

Name Meaning
S_OK

The operation succeeded.

E_POINTER

The pRemoteWakeup parameter was not a valid pointer.

E_INVALIDARG

The RemoteWakeup parameter is not a valid VARIANT_BOOL value.

Remarks

You can use the RemoteWakeup property to determine the value of the D1 bit that is returned from a GET_STATUS request that is sent to a device, as described in section 9.4.5 of the USB 2.0 specification.

The following C++ code example shows how to set and get the RemoteWakeup property.

HRESULT CLoopBackDevice::UpdateRemoteWake(ISoftUSBDevice *piDevice)
{
HRESULT hr = S_OK;
VARIANT_BOOL   fRemoteWake = FALSE;
VARIANT_BOOL   fNewRemoteWake = FALSE;

 if(NULL == piDevice)
{
 hr = E_INVALIDARG;
 goto Exit;
}

// Get the current value of remote wake up
 hr = piDevice->get_RemoteWake (&fRemoteWake);
 if(FAILED(hr))
 goto Exit;

// Update the remote wake-up value if required
 if (fNewRemoteWake != fRemoteWake)
{
 hr = piDevice->put_ RemoteWake (fNewRemoteWake);
 if(FAILED(hr))
 goto Exit;
}
Exit:
 return hr;
}

Requirements

Header

SoftUSBif.h

See Also

ISoftUSBDevice

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010