mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Fixes artf3989: Java SerialPort no longer ignores return value of serialRead
Change-Id: I5d522111189372a3c95b90804abf05ae1d0b553e
This commit is contained in:
@@ -362,9 +362,9 @@ public class SerialPort {
|
||||
ByteBuffer status = ByteBuffer.allocateDirect(4);
|
||||
status.order(ByteOrder.LITTLE_ENDIAN);
|
||||
ByteBuffer dataReceivedBuffer = ByteBuffer.allocateDirect(count);
|
||||
SerialPortJNI.serialRead(m_port, dataReceivedBuffer, count, status.asIntBuffer());
|
||||
int gotten = SerialPortJNI.serialRead(m_port, dataReceivedBuffer, count, status.asIntBuffer());
|
||||
HALUtil.checkStatus(status.asIntBuffer());
|
||||
byte[] retVal = new byte[count];
|
||||
byte[] retVal = new byte[gotten];
|
||||
dataReceivedBuffer.get(retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user