Main Site Documentation

USBH_SerialUSB


#1

hi,
I have 2 Questions:
1.(a). What is the size of the internal buffer of the USBH_SerialUSB class, for the method: (in the class GHI.Premium.USBHost.USBH_SerialUSB)
public int Read(byte[] buffer, int offset, int count)?
I.e. how many bytes it will keep until I will read the data?
1.(b). Can I configure that size?

2.Is there an event that I can register to, for data that arrives to the
USBH_SerialUSB through the USBHost? I don’t want to “sleep” on a loop for reading data.

my SW/FW versions:
Microsoft .NET Micro Framework v4.2 (QFE2)

SDK Versions:
GHI Premium SDK v1.0.2
GHI OSHW SDK v1.0.3
GHI .NET Gadgeteer v1.6.12.0

Libraries Versions:
Premium libs v4.2.9.0
OSHW libs v4.2.4.0

Firmware Version:
EMX (spider) v4.2.9.0, TinyBooter v4.2.9.0


#2
  1. In USB standards, the host must poll the device for data. And so the “buffer” is on the device, which depends on your device

  2. It is polling data, no events.

What you need to do is spin a thread to have a buffer and read the data regularly.