|
From: Anders J. <and...@us...> - 2002-02-06 11:31:59
|
The following files were modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
Makefile 1.11 1.12=20=20=20=20=20=20=20=20=20=20=20=20
bt_if.h 1.30 1.31=20=20=20=20=20=20=20=20=20=20=20=20
bttest.c 1.23 1.24=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Patch from Alain Paschoud:
* Added IOCTL to get remotename of a device.
* Added INCLUDE_PAN to the Makefile.
* Added remote_name command to bttest.
* Added bnep_test command to bttest.
The diff of the modified file(s):
--- Makefile 2001/10/18 15:56:25 1.11
+++ Makefile 2002/02/06 11:31:56 1.12
@@ -16,6 +16,7 @@
#HAVE_READLINE =3D 1
=20
INCLUDE_UNPLUG_TEST =3D 1
+INCLUDE_PAN =3D 1
=20
INSTDIR =3D $(prefix)/bin/
INSTMODE =3D 0755
@@ -44,6 +45,10 @@
=20
ifdef INCLUDE_UNPLUG_TEST
CFLAGS +=3D -DCONFIG_BLUETOOTH_UNPLUG_TEST
+endif
+
+ifdef INCLUDE_PAN
+CFLAGS +=3D -DCONFIG_BLUETOOTH_PAN
endif
=20
CFLAGS +=3D -MMD
--- bt_if.h 2002/01/18 13:44:39 1.30
+++ bt_if.h 2002/02/06 11:31:56 1.31
@@ -78,6 +78,8 @@
#define L2CAP_TEST2_LAYER 0x1233
#define L2CAP_TEST3_LAYER 0x4461
=20
+#define BT_NAME_LENGTH 248
+
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
/* SDP server */
=20
@@ -147,6 +149,7 @@
#define HCIPINCODENEGATIVEREPLY _IOWR(BT_IOC_MAGIC, 0x24, unsigned char[6])
#define HCIAUTHENTICATION_REQUESTED _IOW(BT_IOC_MAGIC, 0x25, unsigned char=
[6])
#define HCISETCONNECTION_ENCRYPTION _IOW(BT_IOC_MAGIC, 0x26, unsigned char=
[7])
+#define HCIREMOTENAME_REQUEST _IOW(BT_IOC_MAGIC, 0x27, unsigned char[255])
=20
/* Link Policy Commands */
=20
--- bttest.c 2001/10/16 16:26:43 1.23
+++ bttest.c 2002/02/06 11:31:56 1.24
@@ -80,6 +80,7 @@
"\nMenu",
"------------------------",
" inq <max nbr resp> <inq time>",
+ " remote_name <xx:xx:xx:xx:xx:xx>",
" rf_conn <xx:xx:xx:xx:xx:xx> <srv ch> <line>",
" rf_send <nbr bytes> <nbr repeats> <line>",=20
" rf_disc <line>",
@@ -102,6 +103,9 @@
#endif
#ifdef CONFIG_BLUETOOTH_UNPLUG_TEST
" upt <teststring>", /* e.g testcase 4.3 't 43' */
+#ifdef CONFIG_BLUETOOTH_PAN
+ " bnep_test <param> <testcase>",
+#endif
#endif
" quit",=20
=20
@@ -522,7 +526,7 @@
retval =3D bt_testcmd(bt_cfd, buf);
}
else if(sscanf(buf, "hotlist_set %d %x:%x:%x:%x:%x:%x",=20
- &tmp[6], &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tm=
p[5]))
+ &tmp[6], &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tm=
p[5])=3D=3D 7)
{
FILE *hotlist_fd;
int i, j;
@@ -571,6 +575,30 @@
printf("Enabling sending of disconnect respons\n");
bt_testcmd(bt_cfd, buf);
}=20=20=20
+ else if(sscanf(buf, "bnep_test %d %d",=20
+ &tmp[0], &tmp[1]) =3D=3D 2)
+ {=20
+ if (ioctl(bt_cfd, BNEPTEST, &tmp[0]) < 0)
+ {
+ perror(__FUNCTION__);
+ return 0;
+ }
+ }=20
+ else if(sscanf(buf, "remote_name %x:%x:%x:%x:%x:%x",=20=20
+ &bd[0], &bd[1], &bd[2], &bd[3], &bd[4], &bd[5]) =3D=3D 6)
+ {
+ unsigned char remote_name[BT_NAME_LENGTH + 1];
+ memcpy(&remote_name[0], &bd[0], 6);
+=20=20=20=20
+ if (retval =3D ioctl(bt_cfd, HCIREMOTENAME_REQUEST, &remote_name[0]))
+ {
+ printf("Remote Name Request Failed (status %d)\n", retval);
+ return 0;
+ }
+ printf("Remote Name (%02X:%02X:%02X:%02X:%02X:%02X): %s\n",=20
+ bd[0], bd[1], bd[2], bd[3], bd[4], bd[5], remote_name);
+ }
+
else
{
printf("> error: command not recognized or wrong syntax\n");
|