|
From: Mattias A. <mat...@us...> - 2001-04-26 10:51:29
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_vendor.c 1.10 1.11=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* now use inparam in bt_set_event_filter
* fixed default values when setting page scan activity
* added include to string.h
* use syslog for debug
The diff of the modified file(s):
--- bt_vendor.c 2001/04/25 18:01:57 1.10
+++ bt_vendor.c 2001/04/26 10:51:28 1.11
@@ -45,6 +45,7 @@
#include <termios.h>
#include <syslog.h>
#include <sys/ioctl.h>
+#include <string.h>
=20
#include "bt_misc.h"
#include "bt_vendor.h"
@@ -192,6 +193,8 @@
void
ericsson_init_hw(int bt_cfd, int phys_fd, int spd)
{
+ /* Connection setup, all devices, no auto accept */
+ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 };
unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE);
=20
bt_write_scan_enable(bt_cfd, wrscan);
@@ -199,7 +202,7 @@
sleep(1);
=20
/* set_event_filter must be called for m/s switch on IrmaC! */
- bt_set_event_filter(bt_cfd, 0 /* inpars not used */);
+ bt_set_event_filter(bt_cfd, filter);
=20
sleep(1); // wait for HW...
=20
@@ -228,20 +231,22 @@
void
csr_init_hw(int bt_cfd, int phys_fd, int spd)
{
+ /* Connection setup, all devices, no auto accept */
+ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 };
unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE);
=20
- printf("Setting write_scan_enable in CSR module!\n");
+ syslog(LOG_INFO, "Setting write_scan_enable in CSR module!\n");
=20
bt_write_scan_enable(bt_cfd, wrscan);
=20=20=20
/* improves reliability when doing a connect */
- printf("Setting write_pagescan_activity in CSR module!\n");
+ syslog(LOG_INFO, "Setting write_pagescan_activity in CSR module!\n");
=20
- bt_write_pagescan_activity(bt_cfd, 0x50, 0x20);
+ bt_write_pagescan_activity(bt_cfd, 0x0800, 0x12);
=20
sleep(1);
=20
- bt_set_event_filter(bt_cfd, 0 /* inpars not used */);
+ bt_set_event_filter(bt_cfd, filter);
=20
syslog(LOG_INFO, "Setting baudrate in CSR module!\n");=20=20
=20
@@ -268,7 +273,10 @@
void
digianswer_init_hw(int bt_cfd, int phys_fd, int spd)
{
- printf("Setting baudrate in Digianswer PC card\n");
+ /* Connection setup, all devices, no auto accept */
+ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 };
+
+ syslog(LOG_INFO, "Setting baudrate in Digianswer PC card\n");
=20
bt_set_baudrate(bt_cfd, spd);
=20=20=20
@@ -277,7 +285,7 @@
printf("WARNING : Does this HW really support speeds > 115200 ?\n");
}
=20=20=20
- bt_set_event_filter(bt_cfd, 0 /* inpars not used */);
+ bt_set_event_filter(bt_cfd, filter);
=20
/* Now set phys device speed to whatever HW was set to use */
fd_setup(phys_fd, spd, USE_FLOW_CTRL);=20=20
@@ -298,20 +306,22 @@
void
usb_init_hw(int bt_cfd, int phys_fd, int spd)
{
+ /* Connection setup, all devices, no auto accept */
+ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 };
unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE);
=20
- printf("Setting write_scan_enable in USB module!\n");
+ syslog(LOG_INFO, "Setting write_scan_enable in USB module!\n");
=20
bt_write_scan_enable(bt_cfd, wrscan);
=20=20=20
/* improves reliability when doing a connect */
- printf("Setting write_pagescan_activity in CSR module!\n");
+ syslog(LOG_INFO, "Setting write_pagescan_activity in USB module!\n");
=20
- bt_write_pagescan_activity(bt_cfd, 0x8000, 0x12);
+ bt_write_pagescan_activity(bt_cfd, 0x0800, 0x12);
=20
sleep(1);
=20
- bt_set_event_filter(bt_cfd, 0 /* inpars not used */);
+ bt_set_event_filter(bt_cfd, filter);
}
=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=3D=3D=3D*/
@@ -327,12 +337,14 @@
void
generic_init_hw(int bt_cfd, int phys_fd, int spd)
{
+ /* Connection setup, all devices, no auto accept */
+ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 };
unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE);
=20
- printf("Setting write_scan_enable in generic module!\n");
+ syslog(LOG_INFO, "Setting write_scan_enable in generic module!\n");
=20=20=20
bt_write_scan_enable(bt_cfd, wrscan);
- bt_set_event_filter(bt_cfd, 0 /* inpars not used */);
+ bt_set_event_filter(bt_cfd, filter);
}
=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=3D=3D=3D*/
|