Author Topic: NrUsbPipe buffer limit  (Read 1160 times)

zerondeau

  • Newbie
  • *
  • Posts: 2
    • View Profile
NrUsbPipe buffer limit
« on: March 02, 2011, 04:09:26 pm »
hi there ,

is there any particular raison why ReadbufferSize is limit to >= 128 ?
I'm using it with microchip Pic32 (buffer is normally at 64)
I will change my buffer size in microchip firmware no problem.

just to know why.

thanks and have a nice day!

Yves

version 9.15
file : nrUsbPipe.pas

Code: [Select]
   
procedure TnrUSBPipePair.ThreadExecute(aThread: TThread);

  sz := fReadBufferSize;
  if sz < 128 then sz := 128;


Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: NrUsbPipe buffer limit
« Reply #1 on: March 02, 2011, 04:43:42 pm »
Hello

The small buffer increases CPU load.
Usual bulk buffer is 64, we selected double of this value.

This value does not disturb to read smaller length of input data.
If your device provides 1 byte of data, loop reads and processes 1 byte without waiting other 127 bytes.

Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.