|
From: Peter K. <pk...@us...> - 2001-09-07 12:47:10
|
The following files were modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_if.c 1.31 1.32=20=20=20=20=20=20=20=20=20=20=20=20
bt_if.h 1.21 1.22=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Corrected bt_read_country_code().
* Removed a couple of printf()'s.
* Fixed a couple of compiler warnings.
The diff of the modified file(s):
--- bt_if.c 2001/08/29 09:36:45 1.31
+++ bt_if.c 2001/09/07 12:47:09 1.32
@@ -72,7 +72,8 @@
=20
int init_stack(int bt_cfd)
{
- int ret;
+ int ret =3D 0;
+
syslog(LOG_INFO, "Init stack");
=20
#ifndef BT_USERSTACK
@@ -199,7 +200,6 @@
#ifdef __CRIS__
int devfd;
=20
- printf("Resetting HW board...\n");
if ((devfd =3D bt_openctrl()) >=3D 0)
{
if (ioctl(devfd, BTRESETPHYSICALHW) < 0)
@@ -210,8 +210,6 @@
sleep(2);
=20
close(devfd);
-
- printf("Done.\n");
}
else
{
@@ -248,8 +246,10 @@
{
bt_connection con;
int result;
+#ifdef BT_USERSTACK
unsigned short srv_ch;
unsigned short line;
+#endif
=20=20=20
memcpy(con.bd, bd, 6);
con.id =3D con_id;
@@ -261,17 +261,14 @@
case L2CAP_TEST_LAYER:
case L2CAP_TEST2_LAYER:
case L2CAP_TEST3_LAYER:
- {
break;
- }
=20=20=20=20=20
default:
- {
printf(__FUNCTION__" : Unknown layer\n");
con.id =3D 0;
return -1;
- }
}
+
#ifndef BT_USERSTACK
if ((result =3D ioctl(bt_fd, BTCONNECT, &con)))
printf("Connect failed [%s (%d)]\n", error_msg(result), result);
@@ -285,7 +282,7 @@
return -1;
}
=20=20=20=20=20
- printf("Connecting srv ch %d on line %d\n", srv_ch, line);
+// printf("Connecting srv ch %d on line %d\n", srv_ch, line);
result =3D bt_connect(bd, con_id);=09=09
}
#endif
@@ -472,6 +469,7 @@
if (ioctl(bt_cfd, HCISENDRAWDATA, buf) < 0)
{
perror(__FUNCTION__);
+ return -1;
}
#else
fprintf(stderr, __FUNCTION__ ": not yet implemented...\n");
@@ -869,7 +867,6 @@
exit(1);
}
syslog(LOG_INFO, "Registered bluetooth line discipline on %s", physdev);
- printf("Registered bluetooth line discipline on %s\n", physdev);
#else
fprintf(stderr, __FUNCTION__ ": ignored in usermode stack\n");
#endif
@@ -958,10 +955,12 @@
#endif
}
=20
-int bt_read_country_code(int bt_cfd, unsigned char *result)
+int bt_read_country_code(int bt_cfd)
{
+ int result;
+
#ifndef BT_USERSTACK=20=20
- if (ioctl(bt_cfd, HCIREADCOUNTRYCODE, result) < 0)
+ if (ioctl(bt_cfd, HCIREADCOUNTRYCODE, &result) < 0)
{
perror(__FUNCTION__);
exit(1);
--- bt_if.h 2001/08/29 09:36:45 1.21
+++ bt_if.h 2001/09/07 12:47:09 1.22
@@ -259,6 +259,7 @@
#define BT_CSR_PSKEY _IOWR(BT_IOC_MAGIC, 0xf5, unsigned short[CSR_PSKEY_MS=
GHDR_SIZE + CSR_PSKEY_MAXPARAMS])
=20
#define BTINITBCSP _IO(BT_IOC_MAGIC, 0xf6)
+
#define BTSETMAXCONNECTIONS _IOW(BT_IOC_MAGIC, 0xf7, unsigned char)
/* =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 */
/* Structs */
@@ -345,7 +346,7 @@
unsigned char minor_class,=20
unsigned char format);
=20
-int bt_read_country_code(int bt_cfd, unsigned char *result);
+int bt_read_country_code(int bt_cfd);
=20
void enable_dut(int bt_cfd);
=20
|