C# AT24CXX IC卡无法解释的变量 我正在C++上开发一个C++卡分发器硬件API,我已经完成了简单的部分DLL导入等等,文档也做得很好。然而,这里有两个输入变量我搞不清楚,那就是文档 /** * AT24CXX IC card read data, must power on. * * @param [in] ComHandle Port handle(> 0). * @param [in] CardType Card type, see the value below. * @param [in] RLEN Data length of reading. * @param [in] ADDRH High byte of card memory address. * @param [in] ADDRL Low byte of card memory address. * @param [out] ReadData buffer to store return read result. * @param [out] ERR_Code buffer to store API function error code. please reference to @ref APIErrorCode. * * CardType value: * | Type | Type Value | Memory Size | Address Index Range * | ------ |------------- | ------------ | -------------------- * | AT24C01 | 0x30 | 128 byte | addr = 0x0000-0x007F * | AT24C02 | 0x31 | 256 byte | addr = 0x0000-0x00FF * | AT24C04 | 0x32 | 512 byte | addr = 0x0000-0x01FF * | AT24C08 | 0x33 | 1K byte | addr = 0x0000-0x03FF * | AT24C16 | 0x34 | 2K byte | addr = 0x0000-0x07FF * | AT24C32 | 0x35 | 4K byte | addr = 0x0000-0x0FFF * | AT24C64 | 0x36 | 8K byte | addr = 0x0000-0x1FFF * * @return == 0, success, != 0, failed. please reference to @ref APIReturn. * * @note the card memory address meaning is the address = (low byte + hight byte * 256). * */ int APIENTRY WBCM7200_AT24XXRead(HANDLE ComHandle, BYTE CardType, BYTE RLEN, BYTE ADDRH, BYTE ADDRL, BYTE ReadData[], BYTE *ERR_Code);

C# AT24CXX IC卡无法解释的变量 我正在C++上开发一个C++卡分发器硬件API,我已经完成了简单的部分DLL导入等等,文档也做得很好。然而,这里有两个输入变量我搞不清楚,那就是文档 /** * AT24CXX IC card read data, must power on. * * @param [in] ComHandle Port handle(> 0). * @param [in] CardType Card type, see the value below. * @param [in] RLEN Data length of reading. * @param [in] ADDRH High byte of card memory address. * @param [in] ADDRL Low byte of card memory address. * @param [out] ReadData buffer to store return read result. * @param [out] ERR_Code buffer to store API function error code. please reference to @ref APIErrorCode. * * CardType value: * | Type | Type Value | Memory Size | Address Index Range * | ------ |------------- | ------------ | -------------------- * | AT24C01 | 0x30 | 128 byte | addr = 0x0000-0x007F * | AT24C02 | 0x31 | 256 byte | addr = 0x0000-0x00FF * | AT24C04 | 0x32 | 512 byte | addr = 0x0000-0x01FF * | AT24C08 | 0x33 | 1K byte | addr = 0x0000-0x03FF * | AT24C16 | 0x34 | 2K byte | addr = 0x0000-0x07FF * | AT24C32 | 0x35 | 4K byte | addr = 0x0000-0x0FFF * | AT24C64 | 0x36 | 8K byte | addr = 0x0000-0x1FFF * * @return == 0, success, != 0, failed. please reference to @ref APIReturn. * * @note the card memory address meaning is the address = (low byte + hight byte * 256). * */ int APIENTRY WBCM7200_AT24XXRead(HANDLE ComHandle, BYTE CardType, BYTE RLEN, BYTE ADDRH, BYTE ADDRL, BYTE ReadData[], BYTE *ERR_Code);,c#,c++,pinvoke,hardware,C#,C++,Pinvoke,Hardware,我搞不清楚的变量是ADDRH和ADDRL。我研究了C++和C语言中的高、低比特,没有任何进展,无论如何,请参见下面的 [DllImport(CardDispenserLibrary, EntryPoint = "WBCM7200_AT24XXRead", CallingConvention = CallingConvention.StdCall)] public static extern int ReadCard(int comHandle, byte cardType, by

我搞不清楚的变量是ADDRH和ADDRL。我研究了C++和C语言中的高、低比特,没有任何进展,无论如何,请参见下面的

[DllImport(CardDispenserLibrary, EntryPoint = "WBCM7200_AT24XXRead", CallingConvention = CallingConvention.StdCall)]
        public static extern int ReadCard(int comHandle, byte cardType, byte rlen, byte addrh, byte addrl, byte[] readData, out byte error);

我使用ADDRH和ADDRL的所有可能组合调用了该函数,返回值为-1,输出字节为4,这在前面提到的APIRErrorCode中很容易丢失。我有一张2K卡。这些值是什么?

看起来它希望您将16位地址拆分为2个8位数字。你能告诉我你怎么称呼它吗?comHandle应该是IntPtr(HANDLE是一个空的*,所以它适应比特数)我发现这台机器里面还有其他的小机器,所以在尝试读取之前,你必须先调用powerOnOff,然后是CardScan,然后读取(WBCM7200_AT24XXRead)