summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas.TT_Lin <Thomas.TT_Lin@htc.com>2014-08-20 11:33:02 +0800
committerDmitry Shmidt <dimitrysh@google.com>2014-08-20 13:09:45 -0700
commit5f939e27e27f26d630c1cf8b5873bf8128161000 (patch)
tree78f26f794f55596a46c9605f05cbe8a5c8ff1615 /src
parent4169f6d038bd0fa3901ea43a70ed716a7ab184e6 (diff)
downloadandroid_hardware_broadcom_libbt-5f939e27e27f26d630c1cf8b5873bf8128161000.tar.gz
android_hardware_broadcom_libbt-5f939e27e27f26d630c1cf8b5873bf8128161000.tar.bz2
android_hardware_broadcom_libbt-5f939e27e27f26d630c1cf8b5873bf8128161000.zip
Bluetooth: Fix BT turn off timeout
When disable BT, host will close the "vnd_userial.fd". The buffer isn't empty. It can't close immediately. So we flush Tx before close to make sure no chars in buffer. Change-Id: I4c520e40e63cc3500a99710adf64860dcec82125 Signed-off-by: Thomas.TT_Lin <Thomas.TT_Lin@htc.com>
Diffstat (limited to 'src')
-rw-r--r--[-rwxr-xr-x]src/userial_vendor.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/userial_vendor.c b/src/userial_vendor.c
index b9c5f69..0f3f527 100755..100644
--- a/src/userial_vendor.c
+++ b/src/userial_vendor.c
@@ -294,7 +294,8 @@ void userial_vendor_close(void)
#endif
ALOGI("device fd = %d close", vnd_userial.fd);
-
+ // flush Tx before close to make sure no chars in buffer
+ tcflush(vnd_userial.fd, TCIOFLUSH);
if ((result = close(vnd_userial.fd)) < 0)
ALOGE( "close(fd:%d) FAILED result:%d", vnd_userial.fd, result);