|
From: Mattias A. <mat...@us...> - 2001-03-30 12:46:34
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bttest.c 1.4 1.5=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
added ping (echo req), getinfo (info req) for kernel mode stack aswell
The diff of the modified file(s):
--- bttest.c 2001/03/26 15:35:44 1.4
+++ bttest.c 2001/03/30 12:46:32 1.5
@@ -85,12 +85,14 @@
" rf_send <nbr bytes> <nbr repeats> <line>",=20
" rf_disc <line>",
" rf_wait <line>", /* waits for a connection on that line */
- " ping <xx:xx:xx:xx:xx:xx>",
+ " ping <xx:xx:xx:xx:xx:xx> <nbr bytes>",
+ " getinfo <xx:xx:xx:xx:xx:xx> <type>",
" setbd <xx:xx:xx:xx:xx:xx>", /* only ericsson HW */
" readbd", /* read module bd address */
" reset", /* reset board */
" role_switch <xx:xx:xx:xx:xx:xx> <role> (0=3Dmaster, 1=3Dslave)",
" stat ", /* similar to reading the /proc/bt */
+ " testcmd <test string>",
#ifdef ECS_TEST_FUNCTIONS
" ecs_entertest <handle> (hex)",
" ecs_testctrl <par1,par2,...,par9> (hex)",
@@ -108,7 +110,6 @@
" test_conn <xx:xx:xx:xx:xx:xx> <psm>", /* l2cap test using PSM psm */
" test_disc", /* disconnect all (both) test connections */
" test_case_reject <xx:xx:xx:xx:xx:xx>",=20
- " getinfo <xx:xx:xx:xx:xx:xx> <type>",
" ",
" bb_conn <xx:xx:xx:xx:xx:xx>", /* connect only baseband */
" bb_disc <hci handle>", /* disconnect baseband */
@@ -248,6 +249,7 @@
{
unsigned char my_bd_addr[6];=20=20
read_local_bd(bt_cfd, my_bd_addr);
+ print_bd_addr("Local BD ", my_bd_addr);
}
else if(sscanf(buf, "role_switch %x:%x:%x:%x:%x:%x %d ",
&tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4],=20
@@ -298,23 +300,46 @@
{
bt_showstatus();
}
- else if (sscanf(buf, "ping %x:%x:%x:%x:%x:%x",
- &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5]) =3D=3D 6)
+ else if (sscanf(buf, "ping %x:%x:%x:%x:%x:%x %d",
+ &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5],=20
+ &tmp[6]) =3D=3D 7)
{
+ unsigned char buf[1024];
unsigned char bd[6];
+ int count =3D tmp[6];
=20=20=20=20=20
for (i =3D 0; i < 6; i++)
{
bd[i] =3D (unsigned char)tmp[i];
}
=20=20
- printf("Pinging bd : %02X:%02X:%02X:%02X:%02X:%02X\n",
- bd[0], bd[1], bd[2],
- bd[3], bd[4], bd[5]);
+ print_bd_addr("Pinging ", bd);
=20
- bt_ping(bt_cfd, bd, NULL, 0);
+ /* fill it with something */
+ memset(buf, 'A', count);
+
+ bt_ping(bt_cfd, bd, (unsigned char*)&buf , (unsigned short)count);=20=
=20
+ }
+ else if (sscanf(buf, "getinfo %x:%x:%x:%x:%x:%x %d",
+ &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5],=20
+ &tmp[6]) =3D=3D 7)
+ {
+ unsigned char bd[6];
+ unsigned short type =3D tmp[6];
+
+ for (i =3D 0; i < 6; i++)
+ {
+ bd[i] =3D (unsigned char)tmp[i];
}
=20
+ print_bd_addr("Get info from : ", bd);
+
+ bt_getinfo(bt_cfd, bd, type);
+ }
+ else if (strncmp(buf, "testcmd", 7) =3D=3D 0)
+ {
+ bt_testcmd(bt_cfd, buf+7);
+ }
/* =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=3D */
/* FIXME !!! -- make this work for both kernel / usermode stack */
/* =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=3D */
|