|
3 | 3 | <developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink"> |
4 | 4 | <introduction> |
5 | 5 | <para> |
6 | | - This topic describes the asynchronous methods that the library provides. Please see <link xlink:href="833dd117-2e34-412d-8d52-4f3fd2dee3b1">Alpaca devices and ASCOM devices</link> for information on the Alpaca device / ASCOM device terminology. |
| 6 | + This topic describes the asynchronous discovery methods that the library provides. Please see <link xlink:href="833dd117-2e34-412d-8d52-4f3fd2dee3b1">Alpaca devices and ASCOM devices</link> |
| 7 | + for information on the Alpaca device / ASCOM device terminology. |
7 | 8 | </para> |
8 | 9 | </introduction> |
9 | 10 |
|
10 | 11 | <section address="TaskBasedMethods"> |
11 | 12 | <title>Task Based Asynchronous Methods</title> |
12 | 13 | <content> |
13 | 14 | <para> |
14 | | - The purpose of discovery is to identify devices that can be controlled through the Alpaca protocol and the library provides this information as generic lists of <codeEntityReference linkText="AlpacaDevices">T:ASCOM.Alpaca.Discovery.AlpacaDevice</codeEntityReference> |
| 15 | + The purpose of discovery is to identify devices that can be controlled through the Alpaca protocol and the library provides this information as generic lists of |
| 16 | + <codeEntityReference linkText="AlpacaDevices">T:ASCOM.Alpaca.Discovery.AlpacaDevice</codeEntityReference> |
15 | 17 | and <codeEntityReference linkText="AscomDevices">T:ASCOM.Alpaca.Discovery.AscomDevice</codeEntityReference> |
16 | 18 | </para> |
17 | 19 | <para> |
18 | 20 | These two static async methods return .NET Tasks that can be awaited or manipulated with Task methods: |
19 | | - <list class="bullet"> |
20 | | - <listItem> |
21 | | - <legacyBold>Alpaca devices</legacyBold>: <codeEntityReference linkText="AlpacaDiscovery.GetAlpacaDevicesAsync()">M:ASCOM.Alpaca.Discovery.AlpacaDiscovery.GetAlpacaDevicesAsync(System.Int32,System.Int32,System.Int32,System.Double,System.Boolean,System.Boolean,System.Boolean,ASCOM.Common.Alpaca.ServiceType,ASCOM.Common.Interfaces.ILogger,System.Threading.CancellationToken)</codeEntityReference> |
22 | | - </listItem> |
23 | | - <listItem> |
24 | | - <legacyBold>ASCOM devices</legacyBold>: <codeEntityReference linkText="AlpacaDiscovery.GetAscomDevicesAsync(DeviceTypes? deviceType)">M:ASCOM.Alpaca.Discovery.AlpacaDiscovery.GetAscomDevicesAsync(System.Nullable{ASCOM.Common.DeviceTypes},System.Int32,System.Int32,System.Int32,System.Double,System.Boolean,System.Boolean,System.Boolean,ASCOM.Common.Alpaca.ServiceType,ASCOM.Common.Interfaces.ILogger,System.Threading.CancellationToken)</codeEntityReference> |
25 | | - </listItem> |
26 | | - </list> |
27 | 21 | </para> |
| 22 | + <list class="bullet"> |
| 23 | + <listItem> |
| 24 | + <legacyBold>Alpaca devices</legacyBold>: <codeEntityReference linkText="AlpacaDiscovery.GetAlpacaDevicesAsync()">M:ASCOM.Alpaca.Discovery.AlpacaDiscovery.GetAlpacaDevicesAsync(System.Int32,System.Int32,System.Int32,System.Double,System.Boolean,System.Boolean,System.Boolean,ASCOM.Common.Alpaca.ServiceType,ASCOM.Common.Interfaces.ILogger,System.Threading.CancellationToken)</codeEntityReference> |
| 25 | + </listItem> |
| 26 | + <listItem> |
| 27 | + <legacyBold>ASCOM devices</legacyBold>: <codeEntityReference linkText="AlpacaDiscovery.GetAscomDevicesAsync(DeviceTypes? deviceType)">M:ASCOM.Alpaca.Discovery.AlpacaDiscovery.GetAscomDevicesAsync(System.Nullable{ASCOM.Common.DeviceTypes},System.Int32,System.Int32,System.Int32,System.Double,System.Boolean,System.Boolean,System.Boolean,ASCOM.Common.Alpaca.ServiceType,ASCOM.Common.Interfaces.ILogger,System.Threading.CancellationToken)</codeEntityReference> |
| 28 | + </listItem> |
| 29 | + </list> |
28 | 30 | <para> |
29 | 31 | Each method initiates a discovery when called and immediately returns an awaitable Task, enabling the calling method to continue processing while the discovery process runs. When discovery completes, the Task result is updated with a generic |
30 | 32 | list of <codeEntityReference>T:ASCOM.Alpaca.Discovery.AlpacaDevice</codeEntityReference> or <codeEntityReference>T:ASCOM.Alpaca.Discovery.AscomDevice</codeEntityReference> as appropriate. |
31 | 33 | </para> |
32 | 34 | <para> |
33 | | - Both asynchronous methods have parameters to customise discovery, however, all of these are optional and have default values, except for the <codeEntityReference>T:ASCOM.Common.DeviceTypes</codeEntityReference> parameter in the |
| 35 | + Both asynchronous methods have parameters to customise discovery, however, all of these are optional and have default values, except for the <codeEntityReference>T:ASCOM.Common.DeviceTypes</codeEntityReference> parameter in the |
34 | 36 | <codeEntityReference linkText="AlpacaDiscovery.GetAscomDevicesAsync(DeviceTypes? deviceType)">M:ASCOM.Alpaca.Discovery.AlpacaDiscovery.GetAscomDevicesAsync(System.Nullable{ASCOM.Common.DeviceTypes},System.Int32,System.Int32,System.Int32,System.Double,System.Boolean,System.Boolean,System.Boolean,ASCOM.Common.Alpaca.ServiceType,ASCOM.Common.Interfaces.ILogger,System.Threading.CancellationToken)</codeEntityReference> |
35 | 37 | method, which is a required parameter. |
36 | 38 | </para> |
37 | 39 | <para> |
38 | 40 | These examples show how to use the static asynchronous methods: |
39 | | - <code source="HelpExamples\AsyncMethodsAwait.cs" region="AsynchronousMethodsAwait1" language="csharp" title="Using the asynchronous methods" /> |
40 | 41 | </para> |
| 42 | + <code source="HelpExamples\AsyncMethodsAwait.cs" region="AsynchronousMethodsAwait1" language="csharp" title="Using the asynchronous methods" /> |
41 | 43 | <para> |
42 | 44 | Named parameters are helpful when only a few parameters require non-default values: |
43 | | - <code source="HelpExamples\AsyncMethodsAwait.cs" region="AsynchronousMethodsAwait2" language="csharp" title="Using named parameters" /> |
44 | 45 | </para> |
| 46 | + <code source="HelpExamples\AsyncMethodsAwait.cs" region="AsynchronousMethodsAwait2" language="csharp" title="Using named parameters" /> |
45 | 47 | <para> |
46 | 48 | If required, you can also work directly with the tasks returned by these methods: |
47 | | - <code source="HelpExamples\AsyncMethodsTask.cs" region="AsynchronousMethodsTask" language="csharp" title="Working with discovery tasks" /> |
48 | 49 | </para> |
| 50 | + <code source="HelpExamples\AsyncMethodsTask.cs" region="AsynchronousMethodsTask" language="csharp" title="Working with discovery tasks" /> |
49 | 51 | </content> |
50 | 52 | </section> |
51 | 53 | <bibliography></bibliography> |
|
0 commit comments