|
From: Mattias A. <mat...@us...> - 2001-03-21 20:50:18
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
btinit.c 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
added SIGTERMI in sighandler to cope with atexit() functionality
added option -i used to set default speed on physdev
minor changes
The diff of the modified file(s):
--- btinit.c 2001/03/13 22:21:17 1.2
+++ btinit.c 2001/03/21 20:50:17 1.3
@@ -107,6 +107,7 @@
=20
static int btd_pid;
static char local_name[LOCAL_NAME_LENGTH+1]; /* 'friendly' name in HW modu=
le */
+static int init_hw_speed =3D 0; /* not set */
static int do_hwinit =3D 1; /* do vendor specific initialization */
static int do_reset =3D 0; /* reset hw using I/O pins */
static int phys_fd =3D -1; /* physical device e.g ttyS0 */
@@ -155,6 +156,11 @@
{
switch(opt)
{
+ case 'i':
+ /* uart device */
+ init_hw_speed =3D atoi(optarg);
+ syslog(LOG_INFO, "init_hw_speed %d baud\n", init_hw_speed);
+ break;
=20
case 'n':
printf("setting local name to %s\n", optarg);
@@ -205,12 +211,16 @@
}
=20
/* Set default speed */
+
+ if (init_hw_speed !=3D 0)
+ fd_setup(phys_fd, init_hw_speed, 1);
+ else
init_phys(phys_fd);
=20
/* Set the current tty to the bluetooth discpline */
set_bt_line_disc(phys_fd, bt_disc, physdev);
=20=20=20
- bt_cfd =3D open(BT_CTRL_TTY, O_RDWR | O_NOCTTY);
+ bt_cfd =3D bt_openctrl();
=20
init_stack(bt_cfd, atoi(speedstr));
=20
@@ -237,6 +247,7 @@
sigemptyset(&act.sa_mask);
act.sa_flags =3D 0;
sigaction(SIGUSR1, &act, 0);
+ sigaction(SIGTERM, &act, 0);
/* other sigs ? */
}
=20
@@ -253,6 +264,10 @@
btd_cleanup();
=20=20
longjmp(jmpbuffer, 1);
+ }
+ if (sig =3D=3D SIGUSR1)
+ {
+ exit(0);
}
return;
}
|