|
From: Mattias A. <mat...@us...> - 2001-04-27 14:53:32
|
The following files were modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_if.c 1.12 1.13=20=20=20=20=20=20=20=20=20=20=20=20
bt_if.h 1.7 1.8=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* extracted the ioctl part from set_local_name into bt_set_local_name=20
and renamed set_local_name to set_local_hostname
* changed some debug
The diff of the modified file(s):
--- bt_if.c 2001/04/26 10:52:30 1.12
+++ bt_if.c 2001/04/27 14:53:31 1.13
@@ -64,13 +64,15 @@
#include "bt_user.h"
#include "bt_errno.h"
=20
+#define D(x) //x
+
/* =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 */
/* Functions common for kernel and 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 */
=20
void init_stack(int bt_cfd, int spd)
{
- printf("Init stack\n");
+ syslog(LOG_INFO, "Init stack\n");
=20=20=20
#ifdef BT_USERSTACK
init_userstack();
@@ -87,9 +89,8 @@
bt_set_classofdevice(bt_cfd, 0x10, 0x3, 0x0, 0x0);
=20
#ifndef __CRIS__
- set_local_name(bt_cfd, "AXIS");
+ set_local_hostname(bt_cfd, "AXIS");
#endif
-=20=20
}
=20
/* =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 */
@@ -179,7 +180,7 @@
int bt_openctrl(void)
{
int bt_cfd;
- printf("Now opening BT Ctrl TTY [%s]\n", BT_CTRL_TTY);
+ D(syslog(LOG_INFO, "Now opening BT Ctrl TTY [%s]\n", BT_CTRL_TTY));
#ifdef BT_USERSTACK
printf(__FUNCTION__ ": ignored in userstack\n");
return FD_BTUSERCTRL;
@@ -207,7 +208,7 @@
if (GET_PSM(con_id) =3D=3D RFCOMM_LAYER)
con.id =3D con_id;
else{=20=20
- printf("Only connects rfcomm as client !\n");
+ printf("Only connects rfcomm (yet)\n");
return -1;
}
=20
@@ -804,7 +805,8 @@
#endif
}
=20
-void set_local_name(int bt_cfd, const char *local_name)
+
+void set_local_hostname(int bt_cfd, const char *local_name)
{
unsigned char domainname[DOMAIN_NAME_LENGTH+1];
unsigned char buf[LOCAL_NAME_LENGTH + HOST_NAME_LENGTH +=20
@@ -849,17 +851,23 @@
strcat(buf, ")");
}
=20
+ bt_set_local_name(bt_cfd, buf);
+
+}
+
+void bt_set_local_name(int bt_cfd, const char *name)
+{
+ syslog(LOG_INFO, "bt_set_local_name %s", name);
#ifndef BT_USERSTACK=20=20
- if (ioctl(bt_cfd, HCISETLOCALNAME, buf) < 0)
+ if (ioctl(bt_cfd, HCISETLOCALNAME, name) < 0)
{
perror(__FUNCTION__);
exit(1);
}
#else
- hci_change_local_name(buf);
+ hci_change_local_name(name);
#endif
}
-
=20
/* =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 */
/* Misc functions */
--- bt_if.h 2001/04/26 14:07:10 1.7
+++ bt_if.h 2001/04/27 14:53:31 1.8
@@ -322,9 +322,11 @@
void enable_dut(int bt_cfd);
=20
=20
-/* Sets friendly name in HW to hostname */
-void set_local_name(int bt_cfd, const char *local_name);
+/* Sets friendly name to local_name + hostname in HW */
+void set_local_hostname(int bt_cfd, const char *local_name);
=20
+/* Sets friendly name to name */
+void bt_set_local_name(int bt_cfd, const char *name);
/*=20
* Misc functions=20
*/
|