Share via


Radio.SetStateAsync(RadioState) Method

Definition

An asynchronous operation that attempts to set the state of the radio represented by this object.

public:
 virtual IAsyncOperation<RadioAccessStatus> ^ SetStateAsync(RadioState value) = SetStateAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<RadioAccessStatus> SetStateAsync(RadioState const& value);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<RadioAccessStatus> SetStateAsync(RadioState value);
function setStateAsync(value)
Public Function SetStateAsync (value As RadioState) As IAsyncOperation(Of RadioAccessStatus)

Parameters

value
RadioState

The desired radio state.

Note

Only RadioState.On and RadioState.Off may be set using SetStateAsync.

Returns

An asynchronous state setting operation. On successful completion, contains an enumeration value describing status of the state change request.

Attributes

Windows requirements

App capabilities
cellularDeviceControl radios

Remarks

The radios capability is required for all radios. If the radio Kind is RadioKind.MobileBroadband, then this also requires cellularDeviceControl, a restricted capability given to Mobile Operators.

The returned IAsyncOperation<RadioAccessStatus> can throw the ERROR_BUSY exception when retrieving the result, if the radio state is changed by another process simultaneously. This exception must be caught and the operation retried if necessary.

Applies to