XferData

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable
        Hi, I would like to know XferData(ref buf, ref len) at Visual C# method. When I transfer from Device to Host, Does "len" need to be the maximum packet size? For example, what kind of method should be used to receive 16 bytes of data from HOST? Although I tested the following contents, I was not successful. --- int Len = 16; byte[] Buf = new byte[Len]; BulkEndpoint.XferData(ref Buf, ref Len); --- Best Regards, Kochi   
0 Likes
2 Replies
Anonymous
Not applicable

I use BulkOutEndPt and BulkInEndPt instead of BulkEndPt.

   

 

   

   

int len = 3;

   

byte[] buf = new byte[len];

buf[0] = (byte)Commands.VR_SET_INTEGRATION_TIME;

   

   

buf[1] = (byte)(integrationTime & 0xff);

   

buf[2] = (byte)((integrationTime >> 😎 & 0xff);

   

if (myDev.BulkOutEndPt.XferData(ref buf, ref len) == true)

   

{

   

     {

   

                 return Responses.PASSED;

   

           else

   

               return Responses.FAILED;

   

      }

   

            return Responses.INCOMMANDFAILED;

   

}

   

else

   

   

return Responses.OUTCOMMANDFAILED;

   

   

 

   

   

 

   

 

   

   

      else

   

   

          if (buf[0] == 0)

   

   

     len = 1;

   

     if (myDev.BulkInEndPt.XferData(ref buf, ref len) == true)

0 Likes
Anonymous
Not applicable

BulkEndPoint would point to the first Bulk Endpoint of your device. If it is a OUT endpoint was it configured to send 16 bytes?

   

If it is a IN endpoint then if it was configured properly then it should have received the data and XferData would have returned success. Please let us know your configuration.

   

Regards,

   

Anand

0 Likes