diff options
author | Elliott Hughes <enh@google.com> | 2012-07-11 17:23:55 -0700 |
---|---|---|
committer | android code review <noreply-gerritcodereview@google.com> | 2012-07-11 17:23:55 -0700 |
commit | ebd5677dc67081c60827bcb4c958406d13bb1520 (patch) | |
tree | 6071d4ef53f27a4e3b17ff79d9dee5af9f92a083 | |
parent | 5f728e907ce9370732d457cb48fd771963765b3f (diff) | |
parent | bf6696874d1b57ffddc7848450b20e926ad5d0a4 (diff) | |
download | bluetooth-ebd5677dc67081c60827bcb4c958406d13bb1520.tar.gz |
Merge "Fix the timeout in bt_enable."
-rw-r--r-- | bluedroid/bluetooth.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bluedroid/bluetooth.c b/bluedroid/bluetooth.c index ee104c9..3ad2189 100644 --- a/bluedroid/bluetooth.c +++ b/bluedroid/bluetooth.c @@ -164,13 +164,12 @@ int bt_enable() { // Try for 10 seconds, this can only succeed once hciattach has sent the // firmware and then turned on hci device via HCIUARTSETPROTO ioctl - for (attempt = 1000; attempt > 0; attempt--) { + for (attempt = 100; attempt > 0; attempt--) { hci_sock = create_hci_sock(); if (hci_sock < 0) goto out; ret = ioctl(hci_sock, HCIDEVUP, HCI_DEV_ID); - ALOGI("bt_enable: ret: %d, errno: %d", ret, errno); if (!ret) { break; } else if (errno == EALREADY) { @@ -178,8 +177,11 @@ int bt_enable() { break; } + ALOGI("%s: ioctl(%d, HCIDEVUP, HCI_DEV_ID) failed: %s (%d)", + __FUNCTION__, hci_sock, strerror(errno), errno); + close(hci_sock); - usleep(100000); // 100 ms retry delay + usleep(100 * 1000); // 100 ms retry delay } if (attempt == 0) { ALOGE("%s: Timeout waiting for HCI device to come up, error- %d, ", |