다음을 통해 공유


ChangeRadioState (Compact 2013)

3/26/2014

This function turns a specific radio on or off.

Syntax

HRESULT ChangeRadioState(
  RDD *pDev,
  DWORD dwState
  SAVEACTION sa
);

Parameters

  • pDev
    [in] Specifies the linked list of wireless devices retrieved by GetWirelessDevices.
  • dwState
    [in] Specifies the power state to set. The following table shows the possible values.

    State

    Value

    Description

    OFF

    0

    Power down the wireless device.

    ON

    1

    Power up the wireless device.

    DISCOVERABLE

    2

    Set the wireless device to be discovered by peer Bluetooth devices.

  • sa
    [in] Specifies how the desired state in the registry should be updated. The possible values are defined in the SAVEACTION enumeration.

Return Value

The following table shows the return values for this function.

Value

Description

S_OK

Successfully set the state of the radio.

E_FAIL

Radio state could not be changed.

S_FALSE

Radio was already in the desired state.

Remarks

The phone radio is turned on and off through a call to RestoreLastRadioTransmitReceiveState.

To change Bluetooth power state, call BthSetMode.

Power-managed wireless devices are set to power level D4 for OFF and PwrDeviceUnspecified for ON. These power states are defined in the CEDEVICE_POWER_STATE enumeration.

Requirements

Header

wrlspwr.h

Library

ossvcs.lib

See Also

Reference

Wireless Device Power Management Functions