I’m using the java comm library to listen for bytes coming in over a serial port. I have it setup for async. notification, i.e. have a class implementing SerialPortEventListener. Is there any way to set the threshold at which the SerialPortEvent.DATA_AVAILABLE event is called. In my case the library waits until about 20 bytes are received before it fires this event, in my case I’d like to be notified when the first 8 bytes or so have been received.
Thank you for any replies.
I think your problem may be the hardware buffer that most (all?) PC serial port UARTs have. IIRC, it’s a minimum of 16 bytes long. Did you try calling
disableReceiveThreshold()on the Port object? This may drastically decrease efficiency, depending on how the driver is implemented.