Files
Sharp7Reactive/Sharp7.Rx/Interfaces/IS7Connector.cs
Federico Barresi dcac7002f9 fixed value notifications
added observable extensions
2018-11-22 14:03:28 +01:00

24 lines
923 B
C#

using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Sharp7.Rx.Enums;
namespace Sharp7.Rx.Interfaces
{
internal interface IS7Connector : IDisposable
{
IObservable<ConnectionState> ConnectionState { get; }
Task InitializeAsync();
Task<bool> Connect();
Task Disconnect();
Task<bool> ReadBit(Operand operand, ushort byteAddress, byte bitAdress, ushort dbNr, CancellationToken token);
Task<byte[]> ReadBytes(Operand operand, ushort startByteAddress, ushort bytesToRead, ushort dBNr, CancellationToken token);
Task<bool> WriteBit(Operand operand, ushort startByteAddress, byte bitAdress, bool value, ushort dbNr, CancellationToken token);
Task<ushort> WriteBytes(Operand operand, ushort startByteAdress, byte[] data, ushort dBNr, CancellationToken token);
ILogger Logger { get; }
}
}