我正在尝试运行以下代码,并且在dll中,它定义为
(unsigned char * ReadAndWriteToDevice(unsigned char InputReport1,unsigned char OutputReport1,int DevDet);)
adcdll = cdll.LoadLibrary("adcDLL1.dll")
When I run this code,
DvDetect = c_ubyte(0)
adcdll.DevDetect(pointer(DvDetect))
OutputReport1 = numpy.ndarray(shape=70, dtype= 'B')
InputReport1 = numpy.ndarray(shape=70, dtype= 'B')
adcdll_ReadAndWriteToDevice = adcdll.ReadAndWriteToDevice
adcdll_ReadAndWriteToDevice.argtypes = [c_char_p,c_char_p, c_int]
adcdll_ReadAndWriteToDevice.restype = c_char_p
OutputReport1[1] = 0xF1
adcdll.ReadAndWriteToDevice(InputReport1,OutputReport1,1)
It give me the error
argument 1: <class 'TypeError'>: wrong type