usb-serial-for-android icon indicating copy to clipboard operation
usb-serial-for-android copied to clipboard

Know when Tx buffer is empty?

Open edu07E1 opened this issue 8 years ago • 0 comments

Hello I'm testing the library with PL2303HX and it works great. The only issue I'm having is when sending data, the call to mConnection.bulkTransfer in the write method returns immediately as it writes information to Tx buffer, so I have to wait for the data to be transmitted in order to close the port without losing data. If I call close() just after write() the data transmission is reset and data is lost. Is there a way to know if Tx buffer is empty so I can safely call close() ?

edu07E1 avatar Apr 25 '16 17:04 edu07E1