diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2006-07-06 09:31:03 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2006-07-06 09:31:03 +0000 |
commit | be06891a834058b45fdc89c8a939c07fe4c23527 (patch) | |
tree | 3678bcb68dd137bf051b37b59362c32ee4b80e81 /rfcomm | |
parent | 34a99c66c24e032965834fd39ffe9e506bee91a0 (diff) |
Sleep only 100 msecs for device detection
Diffstat (limited to 'rfcomm')
-rw-r--r-- | rfcomm/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rfcomm/main.c b/rfcomm/main.c index db30dd66..1d302a98 100644 --- a/rfcomm/main.c +++ b/rfcomm/main.c @@ -261,7 +261,7 @@ static void cmd_connect(int ctl, int dev, bdaddr_t *bdaddr, int argc, char **arg struct pollfd p; socklen_t alen; char dst[18], devname[MAXPATHLEN]; - int sk, fd, try = 3; + int sk, fd, try = 30; laddr.rc_family = AF_BLUETOOTH; bacpy(&laddr.rc_bdaddr, bdaddr); @@ -337,7 +337,7 @@ static void cmd_connect(int ctl, int dev, bdaddr_t *bdaddr, int argc, char **arg if ((fd = open(devname, O_RDONLY | O_NOCTTY)) < 0) { if (try--) { snprintf(devname, MAXPATHLEN - 1, "/dev/rfcomm%d", dev); - sleep(1); + usleep(100); continue; } perror("Can't open RFCOMM device"); @@ -401,7 +401,7 @@ static void cmd_listen(int ctl, int dev, bdaddr_t *bdaddr, int argc, char **argv struct pollfd p; socklen_t alen; char dst[18], devname[MAXPATHLEN]; - int sk, nsk, fd, try = 3; + int sk, nsk, fd, try = 30; laddr.rc_family = AF_BLUETOOTH; bacpy(&laddr.rc_bdaddr, bdaddr); @@ -454,7 +454,7 @@ static void cmd_listen(int ctl, int dev, bdaddr_t *bdaddr, int argc, char **argv if ((fd = open(devname, O_RDONLY | O_NOCTTY)) < 0) { if (try--) { snprintf(devname, MAXPATHLEN - 1, "/dev/rfcomm%d", dev); - sleep(1); + usleep(100); continue; } perror("Can't open RFCOMM device"); |