Show / Hide Table of Contents

Class DeviceManager

Manages the workflow of connecting and disconnecting devices for use with Observables. Slightly outdated documentation: href="https://melbournedeveloper.github.io/Device.Net/articles/DeviceManager.html"

Inheritance
System.Object
DeviceManager
Implements
IDeviceManager
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Device.Net
Assembly: Device.Net.dll
Syntax
public class DeviceManager : IDeviceManager, IDisposable

Constructors

DeviceManager(DeviceNotify, NotifyDeviceError, Func<IDevice, Task>, GetConnectedDevicesAsync, GetDeviceAsync, Int32, ILoggerFactory, Boolean)

Manages the workflow of connecting and disconnecting devices for use with Observables

Declaration
public DeviceManager(DeviceNotify notifyDeviceInitialized, NotifyDeviceError notifyDeviceException, Func<IDevice, Task> initializeDeviceAction, GetConnectedDevicesAsync getConnectedDevicesAsync, GetDeviceAsync getDevice, int pollMilliseconds, ILoggerFactory loggerFactory = null, bool filterMiddleMessages = true)
Parameters
Type Name Description
DeviceNotify notifyDeviceInitialized
NotifyDeviceError notifyDeviceException
System.Func<IDevice, System.Threading.Tasks.Task> initializeDeviceAction
GetConnectedDevicesAsync getConnectedDevicesAsync
GetDeviceAsync getDevice
System.Int32 pollMilliseconds
Microsoft.Extensions.Logging.ILoggerFactory loggerFactory
System.Boolean filterMiddleMessages

Properties

ConnectedDevicesObservable

Declaration
public IObservable<IReadOnlyCollection<ConnectedDeviceDefinition>> ConnectedDevicesObservable { get; }
Property Value
Type Description
System.IObservable<System.Collections.Generic.IReadOnlyCollection<ConnectedDeviceDefinition>>

FilterMiddleMessages

Placeholder. Don't use. This functionality will be injected in

Declaration
public bool FilterMiddleMessages { get; }
Property Value
Type Description
System.Boolean

SelectedDevice

Declaration
public IDevice SelectedDevice { get; }
Property Value
Type Description
IDevice

Methods

Dispose()

Declaration
public void Dispose()

QueueRequest(IRequest)

Declaration
public void QueueRequest(IRequest request)
Parameters
Type Name Description
IRequest request

SelectDevice(ConnectedDeviceDefinition)

Sets the selected device

Declaration
public void SelectDevice(ConnectedDeviceDefinition connectedDevice)
Parameters
Type Name Description
ConnectedDeviceDefinition connectedDevice

Start()

Declaration
public async Task Start()
Returns
Type Description
System.Threading.Tasks.Task

WriteAndReadAsync<TResponse>(IRequest, Func<Byte[], TResponse>)

Declaration
public async Task<TResponse> WriteAndReadAsync<TResponse>(IRequest request, Func<byte[], TResponse> convertFunc)
Parameters
Type Name Description
IRequest request
System.Func<System.Byte[], TResponse> convertFunc
Returns
Type Description
System.Threading.Tasks.Task<TResponse>
Type Parameters
Name Description
TResponse

Implements

IDeviceManager
System.IDisposable
In This Article
Back to top Generated by DocFX