|
From: Peter K. <pk...@us...> - 2001-04-04 10:43:06
|
The following files were modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_misc.c 1.4 1.5=20=20=20=20=20=20=20=20=20=20=20=20=20
bt_misc.h 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20
btcon.c 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20
btd.c 1.6 1.7=20=20=20=20=20=20=20=20=20=20=20=20=20
bttest.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Use bd2str() instead of print_bd_addr().
The diff of the modified file(s):
--- bt_misc.c 2001/04/04 10:31:19 1.4
+++ bt_misc.c 2001/04/04 10:43:04 1.5
@@ -331,10 +331,14 @@
return;
}
=20
-void print_bd_addr(char* str, unsigned char bd[6])
+const char* bd2str(const unsigned char *bd)
{
- printf("%s: %02X:%02X:%02X:%02X:%02X:%02X\n",
- str, bd[0], bd[1], bd[2], bd[3], bd[4], bd[5]);
+ static char buf[20];
+
+ sprintf(buf, "%02X:%02X:%02X:%02X:%02X:%02X",
+ bd[0], bd[1], bd[2], bd[3], bd[4], bd[5]);
+
+ return buf;
}
=20
void=20
--- bt_misc.h 2001/03/30 12:34:54 1.3
+++ bt_misc.h 2001/04/04 10:43:04 1.4
@@ -59,7 +59,7 @@
=20
int write_pidfile(char *pidname);
void get_local_addr(char *str);
-void print_bd_addr(char* str, unsigned char *bd);
+const char* bd2str(const unsigned char *bd);
#ifndef BT_USERSTACK
void print_data(const char *message, unsigned char *buf, int len);
#endif
--- btcon.c 2001/04/04 10:32:03 1.3
+++ btcon.c 2001/04/04 10:43:04 1.4
@@ -175,8 +175,7 @@
=20=20=20
/* Connect RFCOMM session on line */
=20=20
- print_bd_addr("Connecting to ", bd);
- printf("on line %d\n", line);
+ printf("Connecting to %s on line %d\n", bd2str(bd), line);
=20
con_id =3D CREATE_RFCOMM_ID(line, srvch << 1);
=20
--- btd.c 2001/03/26 15:30:36 1.6
+++ btd.c 2001/04/04 10:43:04 1.7
@@ -268,8 +268,7 @@
physdev =3D optarg;
break;
=20=20=20=20=20=20=20
- case '?' :
- printf("unknown option: %c\n", optopt);
+ default:
break;
}
}
@@ -294,7 +293,7 @@
=20
/* Sets initial HW baudrate */
if (init_hw_speed !=3D 0)
- fd_setup(phys_fd, init_hw_speed, 1);
+ fd_setup(phys_fd, init_hw_speed, USE_FLOW_CTRL);
else
init_phys(phys_fd);
=20
@@ -359,10 +358,10 @@
=20=20=20=20=20=20=20
default:
{
+#ifdef USE_IPASSIGN
/* Got data on some fd */
int i, retval;
=20
-#ifdef USE_IPASSIGN=20
for (i=3D0; i < result; i++)=20
{
/* IPA response */
@@ -400,7 +399,7 @@
STATE(line) =3D CONNECTED;
=20=20=20=20=20=20=20
read_remote_bd(bt_cfd, PEER(line).remote_bd);
- print_bd_addr("remote bd ", PEER(line).remote_bd);
+ printf("Remote bd: %s\n", bd2str(PEER(line).remote_bd));
=20=20=20=20=20=20=20
#ifdef USE_IPASSIGN
D(syslog(LOG_INFO, "Sending IPA request\n"));
--- bttest.c 2001/03/30 12:46:32 1.5
+++ bttest.c 2001/04/04 10:43:04 1.6
@@ -249,7 +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);
+ printf("Local BD: %s\n", bd2str(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
@@ -313,7 +313,7 @@
bd[i] =3D (unsigned char)tmp[i];
}
=20=20
- print_bd_addr("Pinging ", bd);
+ printf("Pinging: %s\n", bd2str(bd));
=20
/* fill it with something */
memset(buf, 'A', count);
@@ -332,7 +332,7 @@
bd[i] =3D (unsigned char)tmp[i];
}
=20=20
- print_bd_addr("Get info from : ", bd);
+ printf("Get info from: %s\n", bd2str(bd));
=20
bt_getinfo(bt_cfd, bd, type);
}
|