You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using Service.Execute.Model;
|
|
|
|
|
|
|
|
|
|
namespace Service.Rfid;
|
|
|
|
|
|
|
|
|
|
public class RfidMgr
|
|
|
|
|
{
|
|
|
|
|
public static RfidReadWriteTool RfidReadWriteTool;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 连接
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<bool> Connected()
|
|
|
|
|
{
|
|
|
|
|
bool bResult = RfidReadWriteTool.ConnectRfid();
|
|
|
|
|
return bResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 断开
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static async Task<bool> CloseRfid()
|
|
|
|
|
{
|
|
|
|
|
bool bResult = RfidReadWriteTool.CloseRfid();
|
|
|
|
|
return bResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 开始读
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static bool BeginRead()
|
|
|
|
|
{
|
|
|
|
|
bool bResult = RfidReadWriteTool.ScanRfidUserDataTag();
|
|
|
|
|
return bResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 停止读
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static bool StopRead()
|
|
|
|
|
{
|
|
|
|
|
bool bResult = RfidReadWriteTool.StopRfidResult();
|
|
|
|
|
return bResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 读取信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static RfidReadModel? ReadRifd()
|
|
|
|
|
{
|
|
|
|
|
return RfidReadWriteTool.RfidReadModel;
|
|
|
|
|
}
|
|
|
|
|
}
|