如何在flutter中使用c#dll文件来访问其功能



我需要在flutter中使用c#代码或其DLL文件来访问DLL文件中的一些函数。

#region Assembly HFReader9CSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
#endregion
namespace ReaderA
{
public static class StaticClassReaderA
{
public static int AdjustPwr(ref byte comAddr, ref byte _DirStep, int frmportindex);
public static int AutoOpenComPort(ref int port, ref byte comAddr, byte baud, ref int frmComPortIndex);
public static int CalibratePwr(ref byte comAddr, ref byte _VRMS, int frmportindex);
public static int CheckAntenna(ref byte comAddr, ref byte _AntValid, int frmportindex);
public static int CloseComPort();
public static int CloseNetPort(int PortHandle);
public static int CloseRf(ref byte comAddr, int frmportindex);
public static int CloseSpecComPort(int frmComPortIndex);
public static int CustomizedReadMultipleBlock(ref byte comAddr, ref byte state, byte[] UID, byte blocknum, byte blockCount, byte[] DataBuffer, ref byte errorCode, int frmportindex);
public static int CustomizedReadSingleBlock(ref byte comAddr, ref byte state, byte[] UID, byte blocknum, byte[] DataBuffer, ref byte errorCode, int frmportindex);
public static int CustomizedWriteSingleBlock(ref byte comAddr, ref byte state, byte[] UID, byte blocknum, byte[] DataBuffer, byte byteCount, ref byte ErrorCode, int frmportindex);
public static int GetAccessTime(ref byte comAddr, ref byte AccessTimeRet, int frmportindex);
public static int GetANTStatus(ref byte comAddr, ref byte Get_ANT_Status, int frmportindex);
public static int GetANTStatus_2(ref byte comAddr, ref byte Get_ANT_Status, int frmportindex);
public static int GetGeneralInput(ref byte comAddr, ref byte _Input, int frmportindex);
public static int GetInventoryTime(ref int m_Time, int frmportindex);
public static int GetParseMode(ref byte comAddr, ref byte Get_ParseMode, int frmportindex);
public static int GetPwr(ref byte comAddr, ref byte _Pwr, ref byte _PwrVal, int frmportindex);
public static int GetReaderInformation(ref byte comAddr, byte[] versionInfo, ref byte readerType, byte[] trType, ref byte InventoryScanTime, int frmComPortIndex);
public static int GetReceiveChannelStatus(ref byte comAddr, ref byte ReceiveChannelStatus, int frmportindex);
public static int GetScanModeStatus(ref byte comAddr, byte[] _Scan_Mode_Status, int frmportindex);
public static int GetSystemInformation(ref byte comAddr, ref byte state, byte[] UIDI, ref byte InformationFlag, byte[] UIDO, ref byte DSFID, ref byte AFI, byte[] MemorySize, ref byte ICReference, ref byte ErrorCode, int frmportindex);
public static int GetUserDefinedBlocklength(ref byte comAddr, ref byte _Block_len, int frmportindex);
public static int Inventory(ref byte comAddr, ref byte State, ref byte Afi, byte[] DsfidAndUID, ref byte CardNum, int frmComPortIndex);
public static int ISO14443AInventory(ref byte comAddr, byte[] SN, int frmportindex);
public static int LockAFI(ref byte comAddr, ref byte state, byte[] UID, ref byte errorCode, int frmportindex);
public static int LockBlock(ref byte comAddr, ref byte state, byte[] UID, byte blocknum, ref byte errorCode, int frmportindex);
public static int LockDSFID(ref byte comAddr, ref byte state, byte[] UID, ref byte ErrorCode, int frmportindex);
public static int LockMultipleBlock(ref byte comAddr, ref byte state, byte[] UID, byte StartBlock, byte blocknum, ref byte errorCode, int frmportindex);
public static int OpenComPort(int port, ref byte comAddr, byte baud, ref int frmComPortIndex);
public static int OpenNetPort(int Port, string IPaddr, ref byte ComAddr, ref int PortHandle);
public static int OpenRf(ref byte comAddr, int frmportindex);
public static int ProgramPwrTable(ref byte comAddr, byte _Pwr, byte _PwrVal, byte _VRMS, int frmportindex);
public static int ReadMultipleBlock(ref byte comAddr, ref byte state, byte[] UID, byte blocknum, byte blockCount, byte[] blockSecStatus, byte[] data, ref byte errorCode, int frmportindex);
public static int ReadScanModeData(byte[] ScanModeData, ref int ValidDatalength, int frmportindex);
public static int ReadSingleBlock(ref byte comAddr, ref byte State, byte[] UID, byte BlockNum, ref byte BlockSecStatus, byte[] Data, ref byte errorCode, int frmComPortIndex);
public static int ResetToReady(ref byte comAddr, ref byte state, byte[] UID, ref byte errorCode, int frmportindex);
public static int Select(ref byte comAddr, byte[] UID, ref byte errorCode, int frmportindex);
public static int SetAccessTime(ref byte comAddr, ref byte AccessTime, int frmportindex);
public static int SetActiveANT(ref byte comAddr, ref byte _ANT_Status, int frmportindex);
public static int SetActiveANT_2(ref byte comAddr, ref byte _ANT_Status, int frmportindex);
public static int SetGeneralOutput(ref byte comAddr, ref byte _Output, int frmportindex);
public static int SetParseMode(ref byte comAddr, ref byte _ParseMode, int frmportindex);
public static int SetPwr(ref byte comAddr, ref byte _Pwr, int frmportindex);
public static int SetPwrByValue(ref byte comAddr, ref byte _PwrVal, int frmportindex);
public static int SetReceiveChannel(ref byte comAddr, ref byte ReceiveChannel, int frmportindex);
public static int SetRelay(ref byte comAddr, ref byte _Relay, int frmportindex);
public static int SetScanMode(ref byte comAddr, byte[] _Scan_Mode_Data, int frmportindex);
public static int SetUserDefinedBlockLength(ref byte comAddr, ref byte _Block_len, int frmportindex);
public static int StayQuiet(ref byte comAddr, byte[] UID, ref byte errorCode, int frmComPortIndex);
public static int SyncScan(ref byte comAddr, byte _Sync, int frmportindex);
public static int TransparentCustomizedCmd(ref byte comAddr, byte[] RspTime, byte RspLength, byte CustomDataLength, byte[] CustomData, ref byte FeedbackDataLength, byte[] FeedbackData, ref byte errorCode, int frmportindex);
public static int TransparentRead(ref byte comAddr, byte RspLength, byte CustomDatalength, byte[] CustomData, ref byte FeedbackDataLength, byte[] FeedbackData, ref byte errorCode, int frmportindex);
public static int TransparentWrite(ref byte comAddr, byte[] option, byte RspLength, byte CustomDatalength, byte[] CustomData, ref byte FeedbackDataLength, byte[] FeedbackData, ref byte errorCode, int frmportindex);
public static int WriteAFI(ref byte comAddr, ref byte state, byte[] UID, byte AFI, ref byte errorCode, int frmportindex);
public static int WriteComAdr(ref byte currentComAddr, ref byte newComAddr, int frmportindex);
public static int WriteDSFID(ref byte comAddr, ref byte state, byte[] UID, byte DSFID, ref byte errorCode, int frmportindex);
public static int WriteInventoryScanTime(ref byte comAddr, ref byte InventoryScanTime, int frmportindex);
public static int WriteMultipleBlock(ref byte comAddr, ref byte state, byte[] UID, byte StartBlock, byte blocknum, byte[] data, ref byte errorCode, int frmportindex);
public static int WriteSingleBlock(ref byte comAddr, ref byte state, byte[] UID, byte blocknum, byte[] data, ref byte errorCode, int frmportindex);
}
}

我正在为图书馆管理系统开发一款NFC flutter应用程序。在这个图书馆里,所有的书都贴上了rfid标签。在应用程序中,当扫描标签或书籍时,它会将标签id发送到后端,并从互联网上获取书籍的详细信息。当书籍发行时,必须更改AFI值。该AFI值由HFGate检测,如果其值为01,则发出声音。这就是为什么我需要在flutter中使用DLL文件来将AFI值写入标记。从这个文件中,我需要在flutter中访问WriteAFI函数。或者我是否可以访问该函数的所有代码。

创建一个.net Web API,然后创建您自己的使用dll的端点。从移动设备请求这些端点。

最新更新