usb-serial-for-android
usb-serial-for-android copied to clipboard
Know when Tx buffer is empty?
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() ?