I'm trying to read data from an HID circuit. I have a project in C # that works but I can not import the functions in Windev. Can someone help me?
THANK YOU ALL
public byte[] LeggiEeprom(byte iniz, byte quanti)
{
int i = 0;
bool success;
Byte[] dato = new Byte[256];
// Test 3 - Single packet write, 100 packets read
Debug.WriteLine("Reference Application -> Starting");
// Declare our output buffer
Byte[] outputBuffer = new Byte[9];
// Declare our input buffer (this has to be 128 bytes)
Byte[] inputBuffer = new Byte[9];
// Byte 0 must be set to 0
outputBuffer[0] = 0;
// Byte 1 must be set to our command
outputBuffer[1] = 0xC0;
outputBuffer[2] = 0x69;
outputBuffer[3] = 0x10;
outputBuffer[4] = iniz;
outputBuffer[5] = quanti;
outputBuffer[6] = checksum(outputBuffer, 5);
success = writeRawReportToDevice(outputBuffer);
// Only proceed if the write was successful
if (success) i = receiveUSB(ref dato);
else MessageBox.Show("ERRORE USB");
return dato;
}
public byte checksum(byte[] valori, int length)
{
int i;
byte CRC = 0;
for (i = 1; i < length + 1; i++) CRC ^= valori
;
CRC &= 0x3F;
CRC |= 0x80;
return CRC;
}