diff options
author | Matthew Xie <mattx@google.com> | 2011-11-01 21:58:57 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-11-01 21:58:57 +0000 |
commit | b57a990fb027dd0faa2ac6d9a5d6e8a65cac9c87 (patch) | |
tree | 63235a0b639bc2d88deb27aa1aedd005a49362bc | |
parent | 0d3fb27c54ae134bddd30eed464bf7d05a3dd5e1 (diff) | |
parent | 62432dd0bb4d59f640bde9309f86eef2fd984f18 (diff) | |
download | bluetooth-b57a990fb027dd0faa2ac6d9a5d6e8a65cac9c87.tar.gz |
am 62432dd0: Check EALREADY status for HCIDEVUP command
* commit '62432dd0bb4d59f640bde9309f86eef2fd984f18':
Check EALREADY status for HCIDEVUP command
-rw-r--r-- | bluedroid/bluetooth.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bluedroid/bluetooth.c b/bluedroid/bluetooth.c index 680b746..7024ae6 100644 --- a/bluedroid/bluetooth.c +++ b/bluedroid/bluetooth.c @@ -168,11 +168,17 @@ int bt_enable() { if (hci_sock < 0) goto out; ret = ioctl(hci_sock, HCIDEVUP, HCI_DEV_ID); + + LOGI("bt_enable: ret: %d, errno: %d", ret, errno); if (!ret) { break; + } else if (errno == EALREADY) { + LOGW("Bluetoothd already started, unexpectedly!"); + break; } + close(hci_sock); - usleep(10000); // 10 ms retry delay + usleep(100000); // 100 ms retry delay } if (attempt == 0) { LOGE("%s: Timeout waiting for HCI device to come up, error- %d, ", |