|
From: Anders J. <and...@us...> - 2001-08-01 10:20:08
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
test.c 1.20 1.21=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Added commands to test_process_cmd.=20
The diff of the modified file(s):
--- test.c 2001/07/31 18:35:07 1.20
+++ test.c 2001/08/01 10:20:07 1.21
@@ -444,18 +444,59 @@
test_process_cmd(unsigned char *cmd, s32 size)
{
#ifdef CONFIG_BLUETOOTH_UNPLUG_TEST=20
- int testcase =3D my_atoi(cmd+2);
+ int testcase, tmp[10], i;
+ unsigned char bd[6], char_buf[4];
+ char_buf[3] =3D 0;
+ if(strncmp(cmd, "t ", 2) =3D=3D 0) {
+ testcase =3D my_atoi(cmd+2);
=20
if (testcase > 0) {
- print_data("Going to send: ", cmd, size);
process_test_cmd(testcase);
- } else {
- /* other stuff */
}
+ else {
+ printk("test_process_cmd: Couldn't parse testcase\n");
+ }
+ }
+ else if(!strncmp(cmd, "bb_conn ", 8)) {
+ for (i =3D 0; i < 6; i++) {
+ bd[i] =3D (unsigned char *)my_atoi(strncpy(&char_buf[0], cmd + 8 + (i*3=
), 3));
+ }
+=09=09
+ printk("Connecting BB to bd : %02X:%02X:%02X:%02X:%02X:%02X\n",
+ bd[5], bd[4], bd[3],
+ bd[2], bd[1], bd[0]);
+=09=09
+ l2cap_create_con(bd);
+ lp_connect_req(bd);
+ }
+ else if(!strncmp(cmd, "bb_disc ", 8)) {
+ int i =3D my_atoi(&cmd[8]);
+ lp_disconnect((unsigned short)i);
+ }
+ else if(!strncmp(cmd, "lcid_disconnect ", 16)) {
+ l2cap_con *con =3D NULL;
+ int i =3D my_atoi(&cmd[16]);
+ if(con =3D get_lcon(i)) {
+ l2ca_disconnect_req(con);
+ }
+ else {
+ printk("Didn't find lcid %d\n", i);
+ }
+ }
+ else if(!strncmp(cmd, "test_case_reject ", 17)) {
+ unsigned short fake_psm =3D 0x4561;
+ for (i =3D 0; i < 6; i++) {
+ bd[i] =3D (unsigned char)my_atoi(strncpy(&char_buf[0], cmd + 17 + i*3, =
3));
+ }=20=20
+ l2ca_connect_req(bd, fake_psm);
+ }
+ else {
+ printk("Unknown test cmd!\n");
+ }
+=09
#else
printk("test_process_cmd: Not available\n");
#endif
-
}
=20
/****************** END OF FILE sdp.c ************************************=
***/
|