summaryrefslogtreecommitdiffstats
path: root/rfcomm
diff options
context:
space:
mode:
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");