namespace EC.AutoWeightServer.IfManager.FingerPrint
{
///
/// 基础连接参数
///
public class FingerPrintParam
{
///
/// 协议号(USB=0,COM=2)
///
public int NPort { get; set; }
///
/// 端口号 通讯端口号(USB=0,COM=[1, 255])
///
public int Port { get; set; }
///
/// 波特率索引号(波特率级别,默认给 3,即 9600,如表 1 所示)
///
public int NRidx { get; set; }
///
/// 串口是否提速(USB=0,COM=2)
///
public int NSped { get; set; }
public bool IsUsb()
{
return NPort.Equals(0);
}
public bool IsCom()
{
return NPort.Equals(2);
}
public int GetPortType()
{
return NPort.Equals(0) ? 0 : 1;
}
}
///
/// USB 连接参数
///
public class FpUsbParam : FingerPrintParam
{
public FpUsbParam()
{
NPort = 0;
Port = 0;
NRidx = 3;
NSped = 0;
}
}
///
/// Com 连接参数
///
public class FpComParam : FingerPrintParam
{
public FpComParam()
{
NPort = 2;
Port = 1;
NRidx = 3;
NSped = 2;
}
}
}