Method GetDeviceInfo
GetDeviceInfo()
Retrieves the device description document specified by the DescriptionLocation property.
Declaration
public Task<SsdpDevice> GetDeviceInfo()
Returns
Type | Description |
---|---|
Task<SsdpDevice> | An SsdpDevice instance describing the full device details. |
Remarks
This method may choose to cache (or return cached) information if called multiple times within the CacheLifetime period.
Exceptions
Type | Condition |
---|---|
System.Exception | This method using an HttpClient instance to retrieve the device description document, and as such any exception that can be thrown by HttpClient may be rethrown by this method. On the UWP platform this is likely to be a System.Exception instance and the hresult can be checked to determine the exact nature of the error. On other platforms it is likely to be a System.Net.WebException or System.Net.Http.HttpRequestException. Check the documentation for HttpClient on the platform(s) you're using. |
GetDeviceInfo(HttpClient)
Retrieves the device description document specified by the DescriptionLocation property using the provided
Declaration
public Task<SsdpRootDevice> GetDeviceInfo(HttpClient downloadHttpClient)
Parameters
Type | Name | Description |
---|---|---|
HttpClient | downloadHttpClient | A |
Returns
Type | Description |
---|---|
Task<SsdpRootDevice> | An SsdpDevice instance describing the full device details. |
Remarks
This method may choose to cache (or return cached) information if called multiple times within the CacheLifetime period.
This method performs no error handling, if an exception occurs downloading or parsing the document it will be thrown to the calling code. Ensure you setup correct error handling for these scenarios.
Exceptions
Type | Condition |
---|---|
System.Exception | This method using an HttpClient instance to retrieve the device description document, and as such any exception that can be thrown by HttpClient may be rethrown by this method. On the UWP platform this is likely to be a System.Exception instance and the hresult can be checked to determine the exact nature of the error. On other platforms it is likely to be a System.Net.WebException or System.Net.Http.HttpRequestException. Check the documentation for HttpClient on the platform(s) you're using. |