using IoTClient.Enums;
using System.Collections.Generic;
namespace IoTClient.Extensions.Adapter
{
///
/// IoT连接适配接口
///
public interface IIoTClientCommon
{
///
/// 设备型号
///
string DeviceVersion { get; }
///
/// 是否是连接的
///
bool IsConnected { get; }
///
/// 连接信息
///
string ConnectionInfo { get; }
///
/// 打开连接(如果已经是连接状态会先关闭再打开)
///
///
Result Open();
///
/// 关闭连接
///
///
Result Close();
#region Read
///
/// 分批读取
///
/// 地址集合
/// 批量读取数量
///
Result> BatchRead(Dictionary addresses, int batchNumber);
///
/// 读取Boolean
///
/// 地址
///
Result ReadBoolean(string address);
///
/// 读取UInt16
///
/// 地址
///
Result ReadUInt16(string address);
///
/// 读取Int16
///
/// 地址
///
Result ReadInt16(string address);
///
/// 读取UInt32
///
/// 地址
///
Result ReadUInt32(string address);
///
/// 读取Int32
///
/// 地址
///
Result ReadInt32(string address);
///
/// 读取UInt64
///
/// 地址
///
Result ReadUInt64(string address);
///
/// 读取Int64
///
/// 地址
///
Result ReadInt64(string address);
///
/// 读取Float
///
/// 地址
///
Result ReadFloat(string address);
///
/// 读取Double
///
/// 地址
///
Result ReadDouble(string address);
#endregion
#region Write
///
/// 分批写入
///
/// 地址集合
/// 批量读取数量
///
Result BatchWrite(Dictionary addresses, int batchNumber);
///
/// 写入数据
///
/// 地址
/// 值
///
Result Write(string address, byte value);
///
/// 写入数据
///
/// 地址
/// 值
///
Result Write(string address, bool value);
///
/// 写入数据
///
/// 地址
/// 值
///
Result Write(string address, sbyte value);
///
/// 写入数据
///
/// 地址
/// 值
///
Result Write(string address, ushort value);
///
/// 写入数据
///
/// 地址
/// 值
///
Result Write(string address, short value);
///
/// 写入数据
///
/// 地址
/// 值
///
Result Write(string address, uint value);
///
/// 写入数据
///
/// 地址
/// 值
///
Result Write(string address, int value);
///
/// 写入数据
///
/// 地址
/// 值
///
Result Write(string address, ulong value);
///
/// 写入数据
///
/// 地址
/// 值
///
Result Write(string address, long value);
///
/// 写入数据
///
/// 地址
/// 值
///
Result Write(string address, float value);
///
/// 写入数据
///
/// 地址
/// 值
///
Result Write(string address, double value);
///
/// 写入数据
///
/// 地址
/// 值
/// 数据类型
///
Result Write(string address, object value, DataTypeEnum type);
#endregion
}
}