Welcome! Log In Create A New Profile

Advanced

Convert C# to WLanguage

Posted by Spartaco 
Convert C# to WLanguage
November 30, 2018 12:54AM
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;
}
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: