ThinkingHome.DeviceModel.FluentApi
ThinkingHome.DeviceModel.FluentApi
HandleQueries Class
Общие запросы хендлов к ядру. Чтение — это Query устройства плюс выбор своего значения из снапшота (отдельного канала чтения в ядре нет); discovery — выбор своего фрагмента дескриптора. Отсутствие — null, транспорт и неизвестное устройство в Query — исключения ядра.
internal static class HandleQueriesInheritance System.Object → HandleQueries
Methods
HandleQueries.GetCapabilityAsync<TCapability>(this IDeviceHost, string, int, string, CancellationToken) Method
Описание способности (endpoint, instance, тип) или null, если её нет.
public static System.Threading.Tasks.Task<TCapability?> GetCapabilityAsync<TCapability>(this ThinkingHome.DeviceModel.IDeviceHost host, string deviceId, int endpointId, string instance, System.Threading.CancellationToken ct)
where TCapability : ThinkingHome.DeviceModel.Capabilities.Capability;Type parameters
TCapability
Parameters
host IDeviceHost
deviceId System.String
endpointId System.Int32
instance System.String
ct System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<TCapability>
HandleQueries.GetEndpointAsync(this IDeviceHost, string, int, CancellationToken) Method
Endpoint дескриптора или null, если endpoint'а (или устройства) нет.
public static System.Threading.Tasks.Task<ThinkingHome.DeviceModel.Endpoint?> GetEndpointAsync(this ThinkingHome.DeviceModel.IDeviceHost host, string deviceId, int endpointId, System.Threading.CancellationToken ct);Parameters
host IDeviceHost
deviceId System.String
endpointId System.Int32
ct System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<Endpoint>
HandleQueries.GetPropertyAsync<TProperty>(this IDeviceHost, string, int, string, CancellationToken) Method
Описание свойства (endpoint, instance, тип) или null, если его нет.
public static System.Threading.Tasks.Task<TProperty?> GetPropertyAsync<TProperty>(this ThinkingHome.DeviceModel.IDeviceHost host, string deviceId, int endpointId, string instance, System.Threading.CancellationToken ct)
where TProperty : ThinkingHome.DeviceModel.Properties.Property;Type parameters
TProperty
Parameters
host IDeviceHost
deviceId System.String
endpointId System.Int32
instance System.String
ct System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<TProperty>
HandleQueries.GetStateAsync<TState>(this IDeviceHost, string, int, string, CancellationToken) Method
Значение (endpoint, instance, тип) из снапшота или null, если его там нет.
public static System.Threading.Tasks.Task<TState?> GetStateAsync<TState>(this ThinkingHome.DeviceModel.IDeviceHost host, string deviceId, int endpointId, string instance, System.Threading.CancellationToken ct)
where TState : ThinkingHome.DeviceModel.State.StateValue;Type parameters
TState
Parameters
host IDeviceHost
deviceId System.String
endpointId System.Int32
instance System.String
ct System.Threading.CancellationToken