|
From: Peter K. <pk...@us...> - 2001-04-20 15:29:22
|
The following files were modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_if.c 1.9 1.10=20=20=20=20=20=20=20=20=20=20=20=20
bt_if.h 1.4 1.5=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Added BTHWVENDOR ioctl and bt_hw_vendor() to retrieve the harware vendor.
* Some clean-up.
The diff of the modified file(s):
--- bt_if.c 2001/04/18 14:01:34 1.9
+++ bt_if.c 2001/04/20 15:29:21 1.10
@@ -78,7 +78,7 @@
=20=20=20
if (ioctl(bt_cfd, BTINITSTACK)<0)
{
- perror("Init stack");
+ perror(__FUNCTION__);
exit(1);
}
#endif
@@ -100,9 +100,9 @@
int bt_cfd =3D open(BT_CTRL_TTY, O_RDWR | O_NOCTTY);
int stack_initiated =3D -1;
=20
- if (ioctl(bt_cfd, BTISINITIATED, &stack_initiated) < 0)
+ if (bt_cfd < 0 || ioctl(bt_cfd, BTISINITIATED, &stack_initiated) < 0)
{
- perror("bt_isinitiated");
+ perror(__FUNCTION__);
exit(1);
}
close(bt_cfd);
@@ -131,6 +131,22 @@
#endif
}
=20
+#ifndef BT_USERSTACK
+char* bt_hw_vendor(void)
+{
+ int bt_cfd =3D open(BT_CTRL_TTY, O_RDWR | O_NOCTTY);
+ static char buffer[20];
+
+ if (bt_cfd < 0 || ioctl(bt_cfd, BTHWVENDOR, buffer) < 0)
+ {
+ perror(__FUNCTION__);
+ return NULL;
+ }
+ close(bt_cfd);
+ return buffer;
+}
+#endif
+
void reset_hw(void)
{
#ifdef __CRIS__
@@ -141,7 +157,7 @@
{
if (ioctl(devfd, BTRESETPHYSICALHW) < 0)
{
- perror("Resetting hardware");
+ perror(__FUNCTION__);
exit(1);
}
sleep(2);
@@ -152,7 +168,7 @@
}
else
{
- printf("ERROR! Failed to open " BT_CTRL_TTY "\n");
+ fprintf(stderr, "ERROR! Failed to open " BT_CTRL_TTY "\n");
}
#else
printf("Please reset HW board within 5 seconds\n");
@@ -165,12 +181,12 @@
int bt_cfd;
printf("Now opening BT Ctrl TTY [%s]\n", BT_CTRL_TTY);
#ifdef BT_USERSTACK
- printf("bt_openctrl : ignored in userstack\n");
+ printf(__FUNCTION__ ": ignored in userstack\n");
return FD_BTUSERCTRL;
#else=20
if ((bt_cfd =3D open(BT_CTRL_TTY, O_RDWR | O_NOCTTY)) < 0)
{
- printf("could not open %s\n", BT_CTRL_TTY);
+ fprintf(stderr, "could not open %s\n", BT_CTRL_TTY);
exit(1);
}
#endif
@@ -209,7 +225,8 @@
srv_ch =3D GET_RFCOMMSRVCH(con_id);
line =3D GET_RFCOMMLINE(con_id);
=20=20
- if (line !=3D 0) {
+ if (line !=3D 0)
+ {
printf("Use line 0 instead ! (usermode only)\n");
return -1;
}
@@ -238,7 +255,8 @@
CHECK_RFCOMM(con_id);
line =3D GET_RFCOMMLINE(con_id);
=20=20=20
- if (line !=3D 0) {
+ if (line !=3D 0)
+ {
printf("Use line 0 instead ! (usermode only)\n");
return -1;
}
@@ -256,11 +274,11 @@
#ifndef BT_USERSTACK
if ((ret =3D ioctl(bt_fd, BTISLOWERCONNECTED, &line)) < 0)
{
- perror("bt_isconnected");
+ perror(__FUNCTION__);
exit(1);
}
#else
- printf("bt_isconnected NOT IMPL FOR USERMODE STACK !!\n");
+ fprintf(stderr, __FUNCTION__ ": not yet implemented...\n");
ret =3D -1;
#endif
return ret;
@@ -274,10 +292,10 @@
=20
len =3D bt_read_internal(tmp);
tmp[len] =3D 0;
- printf("%s", tmp);
+ printf(tmp);
#else
/*FIXME -- read /proc/bt_internal and print it on the console */
- printf("not yet...\n");
+ fprintf(stderr, __FUNCTION__ ": not yet implemented...\n");
#endif=20
}
=20
@@ -299,7 +317,7 @@
len =3D MAXSIZE;
}
=20=20=20
- printf("bt_send %d X %d bytes [%d k]\n", len, repeat, len*repeat/1000);=
=20
+ printf(__FUNCTION__ ": %d X %d bytes [%d k]\n", len, repeat, len*repeat/=
1000);=20
=20=20=20
/* fill them with letters... */
for (j =3D 0; j < len; j++)
@@ -348,32 +366,30 @@
#ifndef BT_USERSTACK
if (ioctl(bt_fd, BTWAITFORCONNECTION, &line) < 0)
{
- perror("bt_waitline");
+ perror(__FUNCTION__);
exit(1);
}
- printf("bt_waitline : got a connection !\n");
+ printf(__FUNCTION__ ": got a connection !\n");
#else
/* fixme<1> */
- printf("bt_waitline : not impl in usermode stack\n");
+ fprintf(stderr, __FUNCTION__ ": not yet implemented...\n");
#endif
}
=20
void
bt_waitnewconnections(int bt_fd)
{
- syslog(LOG_INFO, "bt_waitnewconnections\n");
+ printf("Wait for a new connection\n");
#ifndef BT_USERSTACK
if (ioctl(bt_fd, BTWAITNEWCONNECTIONS) < 0)
{
- perror("bt_waitnewconnections");
+ perror(__FUNCTION__);
exit(1);
}
- printf("bt_waitnewconnections : found a connection !\n");
- return;
+ printf(__FUNCTION__ ": found a connection !\n");
#else
/* fixme<1>*/
- printf("bt_waitnewconnections : not impl in usermode stack\n");
- return;
+ fprintf(stderr, __FUNCTION__ ": not yet implemented...\n");
#endif
}
=20=20
@@ -384,13 +400,13 @@
#ifndef BT_USERSTACK
if (ioctl(bt_fd, BTWAITFORCONNECTION, &line) < 0)
{
- perror("bt_waitconnection");
+ perror(__FUNCTION__);
exit(1);
}
- printf("bt_waitconnection : got a connection !\n");
+ printf(__FUNCTION__ ": got a connection !\n");
#else
/* fixme<1>*/
- printf("bt_waitconnection : not impl in usermode stack\n");
+ fprintf(stderr, __FUNCTION__ ": not yet implemented...\n");
#endif
}
=20
@@ -407,10 +423,10 @@
#ifndef BT_USERSTACK=20
if (ioctl(bt_cfd, HCISENDRAWDATA, buf) < 0)
{
- perror("bt_send_raw_hci");
+ perror(__FUNCTION__);
}
#else
- printf("not yet for usermode stack...\n");
+ fprintf(stderr, __FUNCTION__ ": not yet implemented...\n");
//hci_send_raw_data(data, 16);
#endif
return 0;
@@ -422,7 +438,7 @@
int ret_val;
struct ping_struct ping;
=20=20=20
- print_data("bt_ping BD : ", bd, 6);
+ print_data(__FUNCTION__ " BD : ", bd, 6);
memcpy(ping.bd, bd, 6);
ping.len =3D len;=20=20
memcpy(ping.data, data, len);
@@ -465,9 +481,9 @@
=20
int bt_testcmd(int bt_cfd, unsigned char *cmd)
{
- int ret_val;
+ int ret_val =3D 0;
=20=20=20
- printf("bt_testcmd\n");
+ printf(__FUNCTION__ "\n");
print_data("cmd ", cmd, strlen(cmd));
=20
#ifndef BT_USERSTACK=20
@@ -478,7 +494,7 @@
else
printf("Success!\n");
#else
- printf("bt_testcmd mpt for usermode stack yet\n");
+ fprintf(stderr, __FUNCTION__ ": not yet implemented...\n");
#endif
return ret_val;
}
@@ -487,11 +503,11 @@
{
int ret_val;
=20
- syslog(LOG_INFO, "bt_force_msswitch_as_server: %d\n", enable);
+ syslog(LOG_INFO, __FUNCTION__ ": %d", enable);
#ifndef BT_USERSTACK=20
if ((ret_val =3D ioctl(bt_cfd, BTSETMSSWITCH, &enable)) !=3D 0)
{
- printf("Error : %s\n", error_msg(ret_val));
+ fprintf(stderr, __FUNCTION__ ": %s\n", error_msg(ret_val));
}
#else
hci_force_msswitch(enable);
@@ -499,7 +515,6 @@
return ret_val;
}
=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 */
/* HCI functions */
=20
@@ -527,7 +542,7 @@
=20
if (ioctl(bt_cfd, HCIINQUIRY, inq_res) < 0)
{
- perror("Inquiry");
+ perror(__FUNCTION__);
exit(1);
}
=20
@@ -551,7 +566,7 @@
#ifndef BT_USERSTACK
if (ioctl(bt_cfd, HCIWRITEBDADDR, bd) < 0)
{
- perror("Set bd addr");
+ perror(__FUNCTION__);
}
#else
hci_set_bd_addr(bd);
@@ -566,7 +581,7 @@
{
int result;
=20
- syslog(LOG_INFO, "bt_set_baudrate %d baud", spd);
+ syslog(LOG_INFO, __FUNCTION__ ": %d baud", spd);
#ifdef BT_USERSTACK
tcflush(phys_fd, TCIOFLUSH);
result =3D hci_set_baudrate(spd);
@@ -574,7 +589,7 @@
#else
if ((result =3D ioctl(bt_cfd, HCISETBAUDRATE, &spd)) < 0)
{
- perror("HCISETBAUDRATE");
+ perror(__FUNCTION__);
exit(1);
}
#endif
@@ -587,7 +602,7 @@
#ifndef BT_USERSTACK
if (ioctl(bt_cfd, HCIREADLOCALBDADDR, bd_addr) < 0)
{
- perror("Read bd addr");
+ perror(__FUNCTION__);
}
#else
int i;
@@ -610,7 +625,7 @@
#ifndef BT_USERSTACK
if (ioctl(bt_cfd, HCIENABLEDUT) < 0)
{
- perror("enable_dut");
+ perror(__FUNCTION__);
}
#else
hci_enable_dut();
@@ -626,7 +641,7 @@
#ifndef BT_USERSTACK
if (ioctl(bt_cfd, BTREADREMOTEBDADDR, bd_addr) < 0)
{
- perror("Read client bd addr");
+ perror(__FUNCTION__);
}
#else
BD_ADDR rev_bd;
@@ -647,7 +662,7 @@
unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE);
int result;
=20=20=20
- syslog(LOG_INFO, "Setting write_scan_enable [0x%x]\n", wrscan);
+ syslog(LOG_INFO, "Setting write_scan_enable [0x%x]", wrscan);
=20
#ifdef BT_USERSTACK
result =3D hci_write_scan_enable(wrscan);
@@ -655,7 +670,7 @@
=20
if ((result =3D ioctl(bt_cfd, HCIWRITESCANENABLE, &wrscan)) < 0)
{=20
- perror("bt_set_writescanenable");
+ perror(__FUNCTION__);
exit(1);
}
#endif=09
@@ -667,10 +682,9 @@
unsigned int wind)
{
/* improves reliability when doing a connect */
- syslog(LOG_INFO, "Setting write_pagescan_activity in CSR module!\n");
+ syslog(LOG_INFO, "Setting write_pagescan_activity in CSR module!");
=20
#ifdef BT_USERSTACK
-
hci_write_pagescan_activity(interval, wind);
#else
{
@@ -681,7 +695,7 @@
=20
if (ioctl(bt_cfd, HCIWRITEPAGESCANACTIVITY, &tmp) < 0)
{=20
- perror("bt_write_pagescan_activity");
+ perror(__FUNCTION__);
exit(1);
}
}
@@ -707,7 +721,7 @@
=20
if ((result =3D ioctl(bt_cfd, HCISET_EVENT_FILTER, &evfilter)) < 0)
{=20
- perror("HCISET_EVENT_FILTER");
+ perror(__FUNCTION__);
exit(1);
}
#endif
@@ -732,7 +746,7 @@
#ifndef BT_USERSTACK=20
if (ioctl(bt_cfd, HCIWRITECLASSOFDEVICE, class_of_device) < 0)
{
- perror("bt_set_classofdevice");
+ perror(__FUNCTION__);
exit(1);
}
#else
@@ -741,16 +755,15 @@
break;
=20
case 1:
- syslog(LOG_INFO, "bt_set_classofdevice, Unsupported format 0x%02x\n",=
=20
- format);
+ syslog(LOG_INFO, __FUNCTION__ ": Unsupported format 0x%02x\n", format);
break;
=20
case 2:
- syslog(LOG_INFO, "bt_set_classofdevice, Unsupported format 0x%02x\n", =
format);
+ syslog(LOG_INFO, __FUNCTION__ ": Unsupported format 0x%02x\n", format);
break;
=20
default:
- syslog(LOG_INFO, "bt_set_classofdevice, Unsupported format 0x%02x\n", =
format);
+ syslog(LOG_INFO, __FUNCTION__ ": Unsupported format 0x%02x\n", format);
break;
}
}
@@ -775,7 +788,7 @@
#ifndef BT_USERSTACK
if (ioctl(bt_cfd, HCISWITCHROLE, tmp) < 0)
{
- perror("role_switch");
+ perror(__FUNCTION__);
}
#else
hci_switch_role(bd_addr, role);
@@ -788,14 +801,14 @@
#ifndef BT_USERSTACK
if (ioctl(phys_fd, TIOCSETD, &bt_disc) < 0)
{
- perror("Set bt line disc");
+ perror(__FUNCTION__);
syslog(LOG_INFO, "Forgot to insmod bt.o ? [bt_disc %d]\n", bt_disc);
exit(1);
}
syslog(LOG_INFO, "Registered bluetooth line discipline on %s\n", physdev=
);
printf("Registered bluetooth line discipline on %s\n", physdev);
#else
- printf("set_bt_line_disc, ignored in usermode stack\n");
+ fprintf(stderr, __FUNCTION__ ": ignored in usermode stack\n");
#endif
}
=20
@@ -847,7 +860,7 @@
#ifndef BT_USERSTACK=20=20
if (ioctl(bt_cfd, HCISETLOCALNAME, buf) < 0)
{
- perror("HCI set local name");=20
+ perror(__FUNCTION__);
exit(1);
}
#else
@@ -992,7 +1005,7 @@
syslog(LOG_INFO, "Opening dev %s\n", dev);
if ((fd =3D open(dev, flags | O_NOCTTY)) < 0)
{
- perror("open_device");
+ perror(__FUNCTION__);
exit(1);
}
=20=20=20
@@ -1002,7 +1015,7 @@
=20
void close_device(int fd)
{
- syslog(LOG_INFO, "close_device");
+ syslog(LOG_INFO, __FUNCTION__);
=20=20=20
#ifdef BT_USERSTACK
/* if fake fd is used, ignore close since there are no open fd */
@@ -1071,7 +1084,7 @@
{
printf("Initiating read thread\n");
if (pthread_create(&read_thread, NULL, (void*)hci_receive_thread, NULL) =
!=3D 0)
- perror("pthread_create");=20=20=20=20
+ perror(__FUNCTION__);
sleep(1); /* wait for thread to start */
return 0;
}
@@ -1105,7 +1118,7 @@
void
init_upper_pty(void)
{
- printf("init_upper_pty");
+ printf(__FUNCTION__);
// open_pty();
// init_pty_thread();=20=20
}
@@ -1208,8 +1221,7 @@
=20=20=20
if ((n =3D write(pty_master_fd, data, len)) !=3D len)
{
- BT_DATA("bt_receive_top: tried to write %d bytes, wrote %d\n",
- len, n);
+ BT_DATA(__FUNCTION__ ": tried to write %d bytes, wrote %d\n", len, n);
}
#endif
=20
@@ -1222,10 +1234,10 @@
bt_connect_ind(unsigned int con_id)=20
{
if (GET_PSM(con_id) =3D=3D RFCOMM_LAYER)
- printf("bt_connect_ind : RFCOMM dlci : %d\n",=20
+ printf(__FUNCTION__ ": RFCOMM dlci : %d\n",=20
GET_RFCOMMDLCI(con_id));
else
- printf("bt_connect_ind : psm %d\n", GET_PSM(con_id));
+ printf(__FUNCTION__ ": psm %d\n", GET_PSM(con_id));
}
=20
void
@@ -1242,29 +1254,29 @@
=20
if ((line < 0) || (line > BT_NBR_DATAPORTS)) {
=20
- printf("bt_connect_cfm on invalid line (%d)\n", line);
+ fprintf(stderr, __FUNCTION__ ": invalid line (%d)\n", line);
return;
}
- printf("bt_connect_cfm : failed, status %d [%s] line %d\n", status, ps=
mname(psm), line);
+ fprintf(stderr, __FUNCTION__": failed, status %d [%s] line %d\n", stat=
us, psmname(psm), line);
=20
return;
}
=20
switch (psm) {
case RFCOMM_LAYER:
- printf("bt_connect_cfm [%s]\n", psmname(psm));
+ printf(__FUNCTION__ ": [%s]\n", psmname(psm));
break;
=20
case SDP_LAYER:
- printf("bt_connect_cfm [%s]\n", psmname(psm));
+ printf(__FUNCTION__ ": [%s]\n", psmname(psm));
break;
=20
case TCS_LAYER:
- printf("bt_connect_cfm [%s]\n", psmname(psm));
+ printf(__FUNCTION__ ": [%s]\n", psmname(psm));
break;
=20
default:
- printf("bt_connect_cfm : unknown layer %d\n", psm);
+ printf(__FUNCTION__ ": unknown layer %d\n", psm);
break;
}
}
@@ -1273,15 +1285,15 @@
bt_disconnect_ind(unsigned int con_id)=20
{
if (GET_PSM(con_id) =3D=3D RFCOMM_LAYER)
- printf("bt_disconnect_ind : RFCOMM dlci : %d\n", GET_RFCOMMDLCI(con_id=
));
+ printf(__FUNCTION__ ": RFCOMM dlci : %d\n", GET_RFCOMMDLCI(con_id));
else
- printf("bt_disconnect_ind : psm %d\n", GET_PSM(con_id));
+ printf(__FUNCTION__ ": psm %d\n", GET_PSM(con_id));
}
=20
int
bt_register_rfcomm(struct rfcomm_con *rfcomm, u8 dlci)
{
- printf("bt_register_rfcomm on dlci %d\n", dlci);
+ printf(__FUNCTION__ ": dlci %d\n", dlci);
test_rfcomm =3D rfcomm;
test_dlci =3D dlci;
return 0;
@@ -1290,20 +1302,20 @@
s32
bt_unregister_rfcomm(s32 line)
{
- printf("bt_unregister_rfcomm on line %d\n", line);
+ printf(__FUNCTION__ ": line %d\n", line);
/* fixme -- stub for now */
}
=20
s32
bt_register_sdp(u8 line, u8 sdpID)
{
- printf("bt_register_sdp\n");
+ printf(__FUNCTION__ "\n");
return 0;
}
=20
s32 bt_unregister_sdp(s32 line)
{
- printf("bt_unregister_sdp\n");
+ printf(__FUNCTION__ "\n");
return 0;
}
=20
--- bt_if.h 2001/03/30 12:32:47 1.4
+++ bt_if.h 2001/04/20 15:29:21 1.5
@@ -41,7 +41,7 @@
=20=20
=20
#ifndef __BT_IF_H__
-#define __BT_IP_H__
+#define __BT_IF_H__
=20
#include "btd.h"
#ifdef BT_USERSTACK
@@ -61,10 +61,10 @@
#ifndef N_BT
#define N_BT 15
#endif
+
#define HOST_NAME_LENGTH 100
#define DOMAIN_NAME_LENGTH 100
=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 */
/* BT defines */
=20
@@ -112,7 +112,6 @@
#define L2CAP_FAILED 0xf0
#define L2CAP_CON_UNRESPONSIVE 0xf1
=20
-
#ifndef BT_USERSTACK
=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 */
@@ -148,6 +147,7 @@
#define BTREADREMOTEBDADDR _IOR(BT_IOC_MAGIC, 0x07, unsigned char[6])
#define BTRESETPHYSICALHW _IO(BT_IOC_MAGIC, 0x08)
#define BTISINITIATED _IOR(BT_IOC_MAGIC, 0x09, int)
+#define BTHWVENDOR _IOR(BT_IOC_MAGIC, 0x0A, char[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=3D=3D */
/* Ioctls for executing HCI commands */
@@ -166,7 +166,6 @@
=20
#define HCISWITCHROLE _IOW(BT_IOC_MAGIC, 0x20, unsigned char[7])
=20
-
/* Host Controller & Baseband Commands */
=20
#define HCIRESET _IO(BT_IOC_MAGIC, 0x30)
@@ -186,19 +185,16 @@
#define HCIWRITE_ENCRYPTION_MODE _IOWR(BT_IOC_MAGIC, 0x3e, int)
#define HCISET_EVENT_FILTER _IOW(BT_IOC_MAGIC, 0x3f, unsigned char[3])
=20
-
/* Informational Parameters */
=20
#define HCIREADLOCALBDADDR _IOR(BT_IOC_MAGIC, 0x45, unsigned char[6])
=20
-
/* Status Parameters */
=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 */
/* Testing Commands */
#define HCIENABLEDUT _IO(BT_IOC_MAGIC, 0x65)
=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 */
/* Ioctls Vendor specific HCI commands */
=20
@@ -243,12 +239,14 @@
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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 */
=20
-typedef struct bt_connection{
+typedef struct bt_connection
+{
unsigned char bd[6];
unsigned int id; /* | psm(16 bits)=A0| layer_specific (16 bits)=A0|=A0*/
} bt_connection;
=20
-typedef struct inquiry_results {
+typedef struct inquiry_results
+{
unsigned int nbr_of_units;
unsigned int inq_time;
unsigned char bd_addr[0];
@@ -262,6 +260,7 @@
} ping_struct;
=20
#endif /* BT_USERSTACK */
+
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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 to both usermode and kernel stack */
=20
@@ -272,8 +271,11 @@
void init_stack(int bt_cfd, int spd);
int bt_isinitiated(void);
void shutdown_stack(int bt_cfd);
-int bt_openctrl(void);
+#ifndef BT_USERSTACK
+char* bt_hw_vendor(void);
+#endif
void reset_hw(void);
+int bt_openctrl(void);
void set_bt_line_disc(int phys_fd, int bt_disc, char* physdev);
=20
/*=20
@@ -333,10 +335,6 @@
const char *error_msg(int err);
int start_sdp_server(void);
=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 */
/* Functions only used in usermode stack */
=20
@@ -369,4 +367,4 @@
=20
#endif
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
-#endif /* __BT_IP_H__*/
+#endif /* __BT_IF_H__ */
|