Radio.FromIdAsync(String) Method

Definition

Retrieves a Radio object by device identifier.

public:
 static IAsyncOperation<Radio ^> ^ FromIdAsync(Platform::String ^ deviceId);
/// [Windows.Foundation.Metadata.Overload("FromIdAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<Radio> FromIdAsync(winrt::hstring const& deviceId);
[Windows.Foundation.Metadata.Overload("FromIdAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<Radio> FromIdAsync(string deviceId);
function fromIdAsync(deviceId)
Public Shared Function FromIdAsync (deviceId As String) As IAsyncOperation(Of Radio)

Parameters

deviceId
String

Platform::String

winrt::hstring

A string that identifies a particular radio device.

Returns

An asynchronous retrieval operation. On successful completion, it contains a Radio object that represents the specified radio device. Otherwise it throws an exception.

Attributes

Remarks

This method retrieves the current representation of a radio by device identifier. The identifier is typically obtained from Windows.Devices.Enumeration.DeviceInformation.FindAllAsync.

This approach is more reliable than using GetRadiosAsync in scenarios where a USB radio has failed or been removed. When a radio fails or is removed, GetRadiosAsync returns no radio object. FindAllAsync still returns a valid Id that can be passed to FromIdAsync to obtain the radio object, which will report itself as Disabled.

If the underlying hardware has been removed or is unavailable, the returned object reflects the last known configuration and typically reports a Disabled state. A radio that no longer exists will not appear in new enumeration snapshots.

Applies to

See also