using System;
using System.Threading;
using System.Threading.Tasks;
namespace NModbus
{
///
/// A network of slave devices on a single transport.
///
public interface IModbusSlaveNetwork : IDisposable
{
///
/// Listen for incoming requests.
///
///
Task ListenAsync(CancellationToken cancellationToken = new CancellationToken());
///
/// Add a slave to the network.
///
///
void AddSlave(IModbusSlave slave);
///
/// Get a slave from the network.
///
/// The slave address
/// The specified slave, or null if one can't be found.
IModbusSlave GetSlave(byte unitId);
///
/// Removes a slave from the network.
///
///
void RemoveSlave(byte unitId);
}
}