summaryrefslogtreecommitdiffstats
path: root/rfcomm
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-07-06 09:31:03 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-07-06 09:31:03 +0000
commitbe06891a834058b45fdc89c8a939c07fe4c23527 (patch)
tree3678bcb68dd137bf051b37b59362c32ee4b80e81 /rfcomm
parent34a99c66c24e032965834fd39ffe9e506bee91a0 (diff)
Sleep only 100 msecs for device detection
Diffstat (limited to 'rfcomm')
-rw-r--r--rfcomm/main.c8
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");