|
From: Anders J. <and...@us...> - 2001-10-16 16:37:51
|
The following files were modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_errno.h 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20
bttest.c 1.22 1.23=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* bttest can now run with arguments, as example bttest 'rf_conn xx:xx:xx:xx=
:xx:xx 1 0' will start bttest, run the cmd and then exit.
* Added HCI_INQUIRY_FAILED.
The diff of the modified file(s):
--- bt_errno.h 2001/10/12 12:01:16 1.3
+++ bt_errno.h 2001/10/16 16:26:43 1.4
@@ -107,3 +107,4 @@
#define BT_ALREADYCONNECTED 0x2
#define BT_TIMEOUT 0x3
#define BT_LINE_BUSY 0x4
+#define BT_INQ_FAILED 0x5
--- bttest.c 2001/10/10 14:56:00 1.22
+++ bttest.c 2001/10/16 16:26:43 1.23
@@ -128,6 +128,7 @@
};
=20
static unsigned char hotlist[10][6];
+static int quit_bttest;
=20
#if !defined(HAVE_READLINE) && !defined(HAVE_READLINE_READLINE)
static void read_history(char *hist_file_name);
@@ -150,10 +151,11 @@
}
=20
int
-main(void)
+main(int argc, char **argv)
{
- int bt_cfd, i , j;
+ int bt_cfd, i , j, tmp;
FILE *hotlist_fd;
+ quit_bttest =3D 0;
=20
/* Open BT ctrl device */=20=20
if ((bt_cfd =3D bt_openctrl()) < 0)
@@ -191,6 +193,17 @@
}
}
=20=20=20
+ if(argc > 1)
+ {
+ for(i =3D 1 ; i < argc ; i++)
+ {
+ if((tmp =3D process_cmd(argv[i], bt_cfd)) < 0)
+ {
+ return -1;
+ }
+ }
+ return 0;
+ }
=20
read_history(BTD_HISTORY_FILE);=20=20
=20=20=20
@@ -198,7 +211,6 @@
=20=20=20
while (1)
{
- int tmp;
char *tmp_char, hotlist_entry;
char tmp_line[200];
char *line =3D (char*) readline("> ");
@@ -226,7 +238,7 @@
tmp =3D process_cmd(line, bt_cfd);
}
=20
- if (tmp =3D=3D QUIT_BTD)
+ if (quit_bttest =3D=3D QUIT_BTD)
{
break;
}
@@ -245,7 +257,7 @@
=20
if (!strncmp(buf, "quit", 4))
{
- return QUIT_BTD;
+ quit_bttest =3D QUIT_BTD;
}
else if (sscanf(buf, "rf_conn %x:%x:%x:%x:%x:%x %d %d",
&tmp[0], &tmp[1], &tmp[2],
@@ -284,7 +296,7 @@
}
else if (sscanf(buf, "inq %d %d", &tmp[0], &tmp[1]) =3D=3D 2)
{
- bt_inquiry(bt_cfd, tmp[0], tmp[1]);
+ retval =3D bt_inquiry(bt_cfd, tmp[0], tmp[1]);
}
else if (sscanf(buf, "rf_send %d %d %d", &i, &repeat, &line) =3D=3D 3)
{
@@ -295,7 +307,7 @@
btfd =3D open(dev, O_RDWR | O_NOCTTY);
=20
if (btfd > 0)
- bt_send(btfd, i, repeat);
+ return bt_send(btfd, i, repeat);
else
{
perror("bt_send");
|