nyholku / purejavacomm

Pure Java implementation of JavaComm SerialPort
http://www.sparetimelabs.com/purejavacomm/index.html
BSD 3-Clause "New" or "Revised" License
366 stars 146 forks source link

allow buffer size to be adjusted #48

Closed jason-s closed 10 years ago

jason-s commented 10 years ago

https://github.com/nyholku/purejavacomm/blob/master/src/purejavacomm/PureJavaSerialPort.java#L616 shows a hardcoded buffer size of 2048.

Could you make this configurable? I am using a fast serial protocol and would like to use a larger buffer size.

nyholku commented 10 years ago

I might, but before event thinking about I think you should try and see if it makes any difference to you. On which platform you are on?

I'm not sure if setOutputBufferSize() in JavaComm is for this purpose or not, I've always wondered that because POSIX API does not support anything like that so I've been thinking that this was some sort of 'for Windows' users only feature.

nyholku commented 10 years ago

Ok, closing this as jason-s does not seem to be interested anymore and no one else has shown any interest. Feel feel to re-open.

jason-s commented 8 years ago

I got pulled off of this for a while, I think I missed your closing comment somehow.

I'm not sure if setOutputBufferSize() in JavaComm is for this purpose or not

Hmm. Now I'm not sure. See https://docs.oracle.com/cd/E17802_01/products/products/javacomm/reference/api/javax/comm/CommPort.html#setInputBufferSize(int) and https://docs.oracle.com/cd/E17802_01/products/products/javacomm/reference/api/javax/comm/CommPort.html#setOutputBufferSize(int)

but they don't really dictate the semantics very clearly.

The appropriate OS-level Windows features are in SetupComm but this is an internal OS buffer size and it's advisory.

If I ever get a chance to investigate further -- unfortunately my time is severely overtaxed as it is :-( -- then I will let you know.