maniac84
Full Member level 6

Currently using the PIC18F25k50 and I want to send data through it's usb port. I'm using the below coding to do usb transmitting:
Is it that my data will straightaway transmit out after it reach the 'HIDTxPacket' function? Or it waits awhile and only send out in the background? How do we know that our protocol got successfully sent out?
I'm sending four protocols out at one time. Protocol A (11 bytes data + 53 bytes 0x00), Protocol B (15 bytes data + 49 bytes 0x00), Protocol C (30 bytes data + 34 bytes 0x00) and Protocol D (11 bytes data + 53 bytes 0x00).
I'm asking this because sometimes my receiver device miss out some data that I transmit out and usually it misses out protocol C which is the one with longest data. So, I don't know it is my usb transmitter problem or it's my receiver problem? Since I don't have the coding for my receiver, I only can check my transmitting part.
Code:
if(!HIDTxHandleBusy(USBInHandle))
{
USBInHandle = HIDTxPacket(HID_EP,(BYTE*)&ToSendDataBuffer[0],64);
}
Is it that my data will straightaway transmit out after it reach the 'HIDTxPacket' function? Or it waits awhile and only send out in the background? How do we know that our protocol got successfully sent out?
I'm sending four protocols out at one time. Protocol A (11 bytes data + 53 bytes 0x00), Protocol B (15 bytes data + 49 bytes 0x00), Protocol C (30 bytes data + 34 bytes 0x00) and Protocol D (11 bytes data + 53 bytes 0x00).
I'm asking this because sometimes my receiver device miss out some data that I transmit out and usually it misses out protocol C which is the one with longest data. So, I don't know it is my usb transmitter problem or it's my receiver problem? Since I don't have the coding for my receiver, I only can check my transmitting part.