I'm sending 199 151 2 3 3 7 63 173 174 block to serial port and got success. But when i do it with libusb nothing happens. No error or nothing happens.
here how i send data to serial (RS 232):
unsigned char data[9];
//filling data
RS232_cputs(comportNumber, &data[0], 9); //success
here how i send data to usb
//endPointAdressIn = 2;
//timeout = 0;
for( int i = 0; i < 9; i++ )
{
libusb_bulk_transfer(deviceHandle, endPointAdressIn , data, 3, &actual, timeout);
}
Is there a protocol difference between usb and serial RS? If i send same data serial and usb, cant i get success?
I've found something like that:
when they send data to serial, sending char by char. when i sending it serial i also do like that. But they send same data to usb they'are adding two chars for each: for 199 151 2 3 3 7 63 173 174 data, they are sending 2 1 199 2 1 151 2 1 2 2 1 3 2 1 3 2 1 7 2 1 6 2 1 3 2 1 173 2 1 174
They'are i also tried it like that:
transferredData[0]=0x02;
transferredData[1]=0x01;
for( int i = 0; i < 9; i++ )
{
transferredData[2] = data[i];
return_value = libusb_bulk_transfer(deviceHandle, endPointAdressIn , transferredData, 3, &actual, 0);
}
i have added 2, 1 for each my data member and i send it like that. And also nothing happened. No error or nothing in my hardware.
So what am i doing wrong?