簡體   English   中英

如何使用 flutter 中的 c# dll 文件訪問其功能?

[英]How to use c# dll files in flutter to access its functions?

我需要在 flutter 中使用 c# 代碼或其 DLL 文件來訪問 Z5884E40D596370BE5406F271 中的一些功能。

#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 值。 HFGate檢測到此 AFI 值,如果其值為 01,則發出聲音。這就是為什么我需要 DLL 文件在 flutter 中使用以將 AFI 值寫入標簽。 從這個文件中,我需要訪問 flutter 中的 WriteAFI function。 或者,如果我可以訪問該 function 的所有代碼。

創建一個 .net Web API,然后使用 Z06416233FE4AB24C5933122 創建您自己的端點。 從移動設備請求這些端點。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM