xseignard / cordovarduino

Cordova/Phonegap plugin for USB host serial communication from an Android device.
MIT License
166 stars 110 forks source link

How to change buffer? #94

Open DRSDavidSoft opened 6 years ago

DRSDavidSoft commented 6 years ago

I notice that this plugin (or the Java underlying implementation) has a fixed buffer length of 40, which is inconvenient.

How do I raise that?

Hansander commented 6 years ago

Hi David,

Have you had success with this?

DRSDavidSoft commented 6 years ago

@Tns2205 No, I tried to write to tweak the plugin, but it is obvious that the underlying plugin (either UsbSerial or usb-serial-for-android) has this 40 byte buffer problem.

I also checked out PhysicaloidLibrary, before I ended up ditching the USB Host Api completely and used a compiled version od CH340 linux driver for the Android device, though it requires root.

Hope this issue get fixed for other devs, though.

Morathil commented 3 years ago

Hey, I think my issue is related to this.

I got huge data sets coming through the serial interface but the registerReadCallback only receives data (ArrayBuffer) with a maximum size of 512 at once. I got a similar implementation on the browser where i receive ArrayBuffer's with a size up to 25.000. With the huge data sets the read callback is called so often that it kills my app's performance.

Unfortunately, I'm not well informed about the serial interface part and the native java part. Hope some of you can help me out with this.