|
From: Anders J. <and...@us...> - 2003-11-05 21:30:14
|
The following files were modified in libs/openbt:
Name Old version New version Tag Comment
---- ----------- ----------- --- -------
bt_if.c 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
bt_if.h 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
bt_misc.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
bt_misc.h 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Added bt_disconnect_all.
* Added strtobd to parse bd-address-strings.
* Removed all USERSTACK defines.
The diff of the modified file(s):
--- bt_if.c 2003/11/05 15:24:05 1.3
+++ bt_if.c 2003/11/05 19:04:53 1.4
@@ -74,14 +74,11 @@ int init_stack(int bt_cfd, char * local_
{
syslog(LOG_INFO, "Init stack");
=20
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, BTINITSTACK) < 0)
{
return -1;
}
-#else
- init_userstack();
-#endif
+
=20
if (!bt_dfu_mode(bt_cfd, -1))
{
@@ -125,25 +122,12 @@ int bt_isinitiated(int bt_cfd)
void shutdown_stack(int bt_cfd)
{
syslog(LOG_INFO, "Shutting down bluetooth stack");
-#ifndef BT_USERSTACK
if (bt_cfd !=3D -1 && (ioctl(bt_cfd, BTSHUTDOWN) < 0))
{
syslog(LOG_ERR, "Shutting down stack failed (bt_cfd =3D %d)", bt_cfd);
}
-#else
- if (bt_initdone)
- {
- rfcomm_close();
- sdp_shutdown();
- tcs_shutdown();
- l2cap_shutdown();
- btmem_shutdown();
- bt_initdone =3D 0;
- }
-#endif
}
=20
-#ifndef BT_USERSTACK
char* bt_hw_vendor(void)
{
int bt_cfd =3D bt_openctrl();
@@ -157,11 +141,9 @@ char* bt_hw_vendor(void)
close(bt_cfd);
return buffer;
}
-#endif
=20
char* bt_firmware_info(void)
{
-#ifndef BT_USERSTACK
int bt_cfd =3D bt_openctrl();
static char buffer[80];
=20
@@ -172,15 +154,11 @@ char* bt_firmware_info(void)
}
close(bt_cfd);
return buffer;
-#else
- return bt_hw_firmware();
-#endif
}
=20
int
bt_bcsp_mode(int bt_cfd, int enable)
{
-#ifndef BT_USERSTACK
int fd =3D (bt_cfd < 0 ? bt_openctrl() : bt_cfd);
=20
if (fd < 0 || ioctl(fd, BTSETBCSPMODE, &enable) < 0)
@@ -195,15 +173,11 @@ bt_bcsp_mode(int bt_cfd, int enable)
}
=20
return enable;
-#else
- return 0;
-#endif
}
=20
int
bt_dfu_mode(int bt_cfd, int enable)
{
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, BT_SET_DFU_MODE, &enable) < 0)
{
perror(__FUNCTION__);
@@ -211,9 +185,6 @@ bt_dfu_mode(int bt_cfd, int enable)
}
=20
return enable;
-#else
- return 0;
-#endif
}
=20
void reset_hw(void)
@@ -247,16 +218,11 @@ int bt_openctrl(void)
int bt_cfd;
=20
D(syslog(LOG_INFO, "Now opening BT Ctrl TTY [" BT_CTRL_TTY "]"));
-#ifdef BT_USERSTACK
- printf(__FUNCTION__ ": ignored in userstack\n");
- return FD_BTUSERCTRL;
-#else
if ((bt_cfd =3D open(BT_CTRL_TTY, O_RDWR | O_NOCTTY)) < 0)
{
fprintf(stderr, "Could not open " BT_CTRL_TTY "\n");
exit(1);
}
-#endif
return bt_cfd;
}
=20
@@ -303,20 +269,10 @@ bt_disconnect(int bt_fd, unsigned int co
{
int ret_val =3D 0;
=20
-#ifndef BT_USERSTACK
if ((ret_val =3D ioctl(bt_fd, BTDISCONNECT, &con_id)))
printf("Disconnect failed [%s (%d)]\n", error_msg(ret_val), MSG_GET_CO=
DE(-ret_val));
else
printf("Disconnected.\n");
-#else
- if ((GET_PSM(con_id) =3D=3D RFCOMM_LAYER) && ((con_id >> 8) & 0xff) !=3D=
0)
- {
- printf("Use line 0 instead ! (usermode only)\n");
- return -1;
- }
-
- ret_val =3D bt_disconnect(con_id);
-#endif
return ret_val;
}
=20
@@ -334,32 +290,37 @@ bt_disconnect_bb(int bt_fd, unsigned cha
{
buf[5-i] =3D (unsigned char)*rem_bd++;
}
-#ifndef BT_USERSTACK
+
if ((ret_val =3D ioctl(bt_fd, BTDISCONNECT_BB, buf)) < 0)
printf("Disconnect BB failed [%s (%d)] err=3D%s\n", error_msg(ret_val)=
, MSG_GET_CODE(-ret_val), strerror(errno));
else
printf("BB Disconnected\n");
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
return ret_val;
}
=20
+/* Disconnect all connections */
+int
+bt_disconnect_all(int bt_cfd)
+{=20
+ if (bt_cfd !=3D -1 && (ioctl(bt_cfd, BTDISCONNECT_ALL) < 0))
+ {
+ fprintf(stderr, "Disconnect All failed: %s", strerror(errno));
+ return -1;
+ }
+ return 0;
+}
+
/* Check whether this line is lower connected in stack (rfcomm ready) */
int bt_isconnected(int bt_cfd, int line)
{
int fd =3D (bt_cfd < 0 ? bt_openctrl() : bt_cfd);
int ret;
-#ifndef BT_USERSTACK
if (fd < 0 || (ret =3D ioctl(fd, BTISLOWERCONNECTED, &line)) < 0)
{
perror(__FUNCTION__);
exit(1);
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
- ret =3D -1;
-#endif
+
if (bt_cfd < 0)
{
close(fd);
@@ -369,16 +330,7 @@ int bt_isconnected(int bt_cfd, int line)
=20
void bt_showstatus(void)
{
-#ifdef BT_USERSTACK
- char tmp[4096];
- int len;
-
- len =3D bt_read_internal(tmp);
- tmp[len] =3D 0;
- printf(tmp);
-#else
system("cat /proc/bt_internal");
-#endif
}
=20
int
@@ -446,51 +398,36 @@ void
bt_waitline(int bt_fd, int line)
{
printf("Wait for a connection on line %d\n", line);
-#ifndef BT_USERSTACK
if (ioctl(bt_fd, BTWAITFORCONNECTION, &line) < 0)
{
perror(__FUNCTION__);
exit(1);
}
printf("%s: Got a connection !\n", __FUNCTION__);
-#else
- /* fixme<1> */
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
void
bt_waitnewconnections(int bt_fd)
{
printf("Wait for a new connection\n");
-#ifndef BT_USERSTACK
if (ioctl(bt_fd, BTWAITNEWCONNECTIONS) < 0)
{
perror(__FUNCTION__);
exit(1);
}
printf("%s: Found a connection !\n", __FUNCTION__);
-#else
- /* fixme<1>*/
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
void
bt_waitconnection(int bt_fd, int line)
{
printf("Wait for a connection on line %d\n", line);
-#ifndef BT_USERSTACK
if (ioctl(bt_fd, BTWAITFORCONNECTION, &line) < 0)
{
perror(__FUNCTION__);
exit(1);
}
printf("%s: Got a connection !\n", __FUNCTION__);
-#else
- /* fixme<1>*/
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
int bt_send_raw_hci(int bt_cfd, unsigned char *data, char len)
@@ -503,16 +440,11 @@ int bt_send_raw_hci(int bt_cfd, unsigned
=20
print_data("data :", (char*)buf, (int)len+1);
=20
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, HCISENDRAWDATA, buf) < 0)
{
perror(__FUNCTION__);
return -1;
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
- //hci_send_raw_data(data, 16);
-#endif
return 0;
}
=20
@@ -531,7 +463,6 @@ bt_send_dfu_command(int bt_cfd, int len,
=20
memcpy((int *)buf+1, data, len);
=20
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, BT_SEND_DFU_COMMAND, buf) < 0)
{
perror(__FUNCTION__);
@@ -539,11 +470,6 @@ bt_send_dfu_command(int bt_cfd, int len,
}
=20
return 0;
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
- errno =3D EPERM;
- return -1;
-#endif
}
=20
int
@@ -551,7 +477,6 @@ bt_retrieve_dfu_response(int bt_cfd, int
{
*(int *)data =3D len - sizeof(int);
=20
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, BT_RETRIEVE_DFU_RESPONSE, data) < 0)
{
perror(__FUNCTION__);
@@ -562,11 +487,6 @@ bt_retrieve_dfu_response(int bt_cfd, int
=20
memmove(data, (int *)data+1, len);
return len;
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
- errno =3D EPERM;
- return -1;
-#endif
}
=20
int bt_ping(int bt_cfd, unsigned char bd[6],
@@ -580,16 +500,12 @@ int bt_ping(int bt_cfd, unsigned char bd
ping.len =3D len;
memcpy(ping.data, data, len);
=20
-#ifndef BT_USERSTACK
if ((ret_val =3D ioctl(bt_cfd, BTPING, &ping)) < 0)
{
printf("Error : [%s (%d)]\n", error_msg(ret_val), MSG_GET_CODE(-ret_va=
l));
}
else
printf("Success!\n");
-#else
- ret_val =3D l2ca_ping(bd, data, len);
-#endif
return ret_val;
}
=20
@@ -603,16 +519,12 @@ bt_getinfo(int bt_cfd, unsigned char bd[
msg[6] =3D (unsigned char)(type >> 8);
msg[7] =3D (unsigned char)(type & 0xff);
=20
-#ifndef BT_USERSTACK
if ((ret_val =3D ioctl(bt_cfd, BTGETINFO, msg)) < 0)
{
printf("Error : [%s (%d)]\n", error_msg(ret_val), MSG_GET_CODE(-ret_va=
l));
}
else
printf("Success!\n");
-#else
- ret_val =3D l2ca_getinfo(bd, type);
-#endif
return ret_val;
}
=20
@@ -627,44 +539,34 @@ int bt_testcmd(int bt_cfd, unsigned char
tmp[0] =3D len;
memcpy(tmp+1, cmd, len+1); /* don't forget nullterminate... */
=20
-#ifndef BT_USERSTACK
if ((ret_val =3D ioctl(bt_cfd, BTTESTCOMMAND, tmp)) < 0)
{
printf("Error : [%s (%d)]\n", error_msg(ret_val), MSG_GET_CODE(-ret_va=
l));
}
else
printf("Success!\n");
-#else
- ret_val =3D test_process_cmd(&tmp[1], tmp[0]);
-#endif
return ret_val;
}
=20
int bt_force_msswitch_as_server(int bt_cfd, int enable)
{
syslog(LOG_INFO, "%s: %d", __FUNCTION__, enable);
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, BTSETMSSWITCH, &enable) < 0)
{
perror(__FUNCTION__);
return -1;
}
-#else
- hci_force_msswitch(enable);
-#endif
return 0;
}
=20
int bt_dont_allow_slave(int bt_cfd, int flag)
{
syslog(LOG_INFO, "%s: %d", __FUNCTION__, flag);
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, BTDONTALLOWSLAVE, &flag) < 0)
{
perror(__FUNCTION__);
return -1;
}
-#endif
return 0;
}
=20
@@ -672,7 +574,6 @@ int bt_dont_allow_slave(int bt_cfd, int=20
int bt_set_max_conections(int bt_cfd, int connections)
{
syslog(LOG_INFO, "%s: %d", __FUNCTION__, connections);
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, BTSETMAXCONNECTIONS, &connections) < 0)
{
perror(__FUNCTION__);
@@ -680,19 +581,6 @@ int bt_set_max_conections(int bt_cfd, in
}
=20
return 0;
-#else
- {
- int ret_val =3D hci_set_max_connections(connections);
-
- if (ret_val >=3D 0)
- {
- return ret_val;
- }
-
- errno =3D -ret_val;
- return -1;
- }
-#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 */
@@ -712,7 +600,6 @@ bnep_connect(int bt_fd, unsigned char *b
con.bnep_src_uuid =3D srcservice;
con.bnep_dst_uuid =3D dstservice;
=20
-#ifndef BTD_USERSTACK
result =3D ioctl(bt_fd, BNEPCONNECT, &con);
if (result&0x0ff)
{
@@ -724,9 +611,6 @@ bnep_connect(int bt_fd, unsigned char *b
printf("BNEP connected on con_hdl =3D %.2X:%.2X\n", bd[0], bd[1]);
printf("BNEP Interface =3D 0x%X\n", bd[2]);
}
-#else
- printf(__FUNCTION__ ": Unsupported in usermode\n");
-#endif
return result;
}
=20
@@ -734,8 +618,6 @@ void
bnep_disconnect(int bt_fd, unsigned char *bd)
{
int result;
-
-#ifndef BTD_USERSTACK
result =3D ioctl(bt_fd, BNEPDISCONNECT, bd);
if (result)
{
@@ -746,9 +628,6 @@ bnep_disconnect(int bt_fd, unsigned char
{
printf("BNEP disconnect OK\n");
}
-#else
- printf(__FUNCTION__ ": Unsupported in usermode\n");
-#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 */
@@ -757,7 +636,6 @@ bnep_disconnect(int bt_fd, unsigned char
void
bt_read_rssi(int bt_cfd, unsigned char* con_hdl)
{
-#ifndef BTD_USERSTACK
if (ioctl(bt_cfd, HCIREADRSSI, con_hdl) < 0)
{
perror(__FUNCTION__);
@@ -773,93 +651,65 @@ bt_read_rssi(int bt_cfd, unsigned char*=20
printf("Not valid RSSI value !!!\n");
}
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
void
bt_park_mode(int bt_cfd, unsigned char* park_params)
{
-#ifndef BTD_USERSTACK
if (ioctl(bt_cfd, HCIPARKMODE, park_params) < 0)
{
perror(__FUNCTION__);
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
void
bt_exit_park_mode(int bt_cfd, unsigned char* con_hdl)
{
-#ifndef BTD_USERSTACK
if (ioctl(bt_cfd, HCIEXITPARKMODE, con_hdl) < 0)
{
perror(__FUNCTION__);
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
void
bt_sniff_mode(int bt_cfd, unsigned char* sniff_params)
{
-#ifndef BTD_USERSTACK
if (ioctl(bt_cfd, HCISNIFFMODE, sniff_params) < 0)
{
perror(__FUNCTION__);
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
void
bt_exit_sniff_mode(int bt_cfd, unsigned char* con_hdl)
{
-#ifndef BTD_USERSTACK
if (ioctl(bt_cfd, HCIEXITSNIFFMODE, con_hdl) < 0)
{
perror(__FUNCTION__);
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
void
bt_hold_mode(int bt_cfd, unsigned char* hold_params)
{
-#ifndef BTD_USERSTACK
if (ioctl(bt_cfd, HCIHOLDMODE, hold_params) < 0)
{
perror(__FUNCTION__);
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
void
bt_write_link_policy_settings(int bt_cfd, unsigned char* policy_params)
{
-#ifndef BTD_USERSTACK
if (ioctl(bt_cfd, HCIWRITELINKPOLICYSETTINGS, policy_params) < 0)
{
perror(__FUNCTION__);
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
void
bt_read_clock_offset(int bt_cfd, unsigned char* con_hdl)
{
-#ifndef BTD_USERSTACK
if (ioctl(bt_cfd, HCIREADCLOCKOFFSET, con_hdl) < 0)
{
perror(__FUNCTION__);
@@ -875,9 +725,6 @@ bt_read_clock_offset(int bt_cfd, unsigne
printf("Not valid CLOCK OFFSET value !!!\n");
}
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
void
@@ -885,7 +732,6 @@ bt_read_num_broadcast_rtx(int bt_cfd)
{
unsigned char num_rtx[2];
=20
-#ifndef BTD_USERSTACK
if (ioctl(bt_cfd, HCIREADNUMBROADCASTRETRANSMISSIONS, num_rtx) < 0)
{
perror(__FUNCTION__);
@@ -901,41 +747,29 @@ bt_read_num_broadcast_rtx(int bt_cfd)
printf("Not valid BROADCAST RTX value =3D 0x%X !!!\n",num_rtx[1]);
}
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
void
bt_write_num_broadcast_rtx(int bt_cfd, unsigned char* num_rtx)
{
-#ifndef BTD_USERSTACK
if (ioctl(bt_cfd, HCIWRITENUMBROADCASTRETRANSMISSIONS, num_rtx) < 0)
{
perror(__FUNCTION__);
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
void
bt_write_page_to(int bt_cfd, unsigned char* page_to)
{
-#ifndef BTD_USERSTACK
if (ioctl(bt_cfd, HCIWRITEPAGETO, page_to) < 0)
{
perror(__FUNCTION__);
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
void
bt_read_tx_power_level(int bt_cfd, unsigned char* tx_power_level)
{
-#ifndef BTD_USERSTACK
if (ioctl(bt_cfd, HCIREADTRANSMITPOWERLEVEL, tx_power_level) < 0)
{
perror(__FUNCTION__);
@@ -951,28 +785,20 @@ bt_read_tx_power_level(int bt_cfd, unsig
printf("Not valid TX POWER LEVEL value !!!\n");
}
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
void
bt_write_link_supervision_to(int bt_cfd, unsigned char* link_to)
{
-#ifndef BTD_USERSTACK
if (ioctl(bt_cfd, HCIWRITELINKSUPERVISIONTO, link_to) < 0)
{
perror(__FUNCTION__);
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
void
bt_write_page_scan_activity(int bt_cfd, unsigned char* page_scan)
{
-#ifndef BTD_USERSTACK
printf("Setting write_pagescan_activity: p_s_int =3D 0x%X%X p_s_win =3D =
0x%X%X\n",
page_scan[0] & 0xFF, page_scan[1] & 0xFF,
page_scan[4] & 0xFF, page_scan[5] & 0xFF);
@@ -981,26 +807,12 @@ bt_write_page_scan_activity(int bt_cfd,=20
{
perror(__FUNCTION__);
}
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
-#endif
}
=20
inquiry_results *
bt_inquiry(int bt_cfd, int nbr_rsp, int t)
{
int retval =3D 0;
-#ifdef BTD_USERSTACK
- char inq_lap[6];
-
- printf("Inquiring...\n");
-
- inq_lap[0] =3D 0x33;
- inq_lap[1] =3D 0x8b;
- inq_lap[2] =3D 0x9e;
-
- retval =3D hci_inquiry(inq_lap, t, nbr_rsp);
-#else
inquiry_results *inq_res;
=20
if (!(inq_res =3D malloc(sizeof *inq_res + nbr_rsp * 6)))
@@ -1020,8 +832,6 @@ bt_inquiry(int bt_cfd, int nbr_rsp, int=20
}
=20
return inq_res;
-#endif
- return inq_res;
}
=20
void
@@ -1030,15 +840,10 @@ bt_set_bd_addr(int bt_cfd, unsigned char
printf("Setting BD address to: %02X:%02X:%02X:%02X:%02X:%02X\n",
bd[0], bd[1], bd[2],
bd[3], bd[4], bd[5]);
-
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, HCIWRITEBDADDR, bd) < 0)
{
perror(__FUNCTION__);
}
-#else
- hci_set_bd_addr(bd);
-#endif
printf("Please reset HW to activate bd change\n");
}
=20
@@ -1051,40 +856,22 @@ int bt_set_baudrate(int bt_cfd, const ch
unsigned long spd =3D speedstrtoli(speedstr);
=20
syslog(LOG_INFO, "%s: %lu baud", __FUNCTION__, spd);
-#ifdef BT_USERSTACK
- tcflush(phys_fd, TCIOFLUSH);
- result =3D hci_set_baudrate(spd);
- usleep(10000);
-#else
+
if ((result =3D ioctl(bt_cfd, HCISETBAUDRATE, &spd)) < 0)
{
perror(__FUNCTION__);
exit(1);
}
-#endif
return result;
}
=20
void
read_local_bd(int bt_cfd, unsigned char *bd_addr)
{
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, HCIREADLOCALBDADDR, bd_addr) < 0)
{
perror(__FUNCTION__);
}
-#else
- int i;
- BD_ADDR rev_bd;
-
- hci_read_local_bd(rev_bd);
-
- /* return as big endian */
- for (i =3D 0; i < 6; i++)
- {
- bd_addr[i] =3D rev_bd[5-i];
- }
-#endif
}
=20
void=20
@@ -1099,23 +886,13 @@ read_remote_class(int bt_cfd, unsigned c
{
result[i] =3D bd_addr[5-i];
}
-#ifndef BT_USERSTACK
=20
if (ioctl(bt_cfd, BTREADREMOTECLASSOFDEV, result) < 0)
{
perror(__FUNCTION__);
err =3D -1;
}
-#else
- if((con =3D get_con(result, ANY_STATE)))=20
- {
- memcpy(result, con->remote_class_of_dev, 3);
- }=20
- else=20
- {
- err =3D -1;
- }
-#endif
+
if(err < 0)
{
memset(remote_class, 0, 3);
@@ -1132,39 +909,22 @@ void
enable_dut(int bt_cfd)
{
printf("Enable device under test mode\n");
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, HCIENABLEDUT) < 0)
{
perror(__FUNCTION__);
}
-#else
- hci_enable_dut();
-#endif
printf("done.\n");
}
=20
void
read_remote_bd(int bt_cfd, int line, unsigned char *bd_addr)
{
-#ifndef BT_USERSTACK
*(int*)bd_addr =3D line;
=20
if (ioctl(bt_cfd, BTREADREMOTEBDADDR, bd_addr) < 0)
{
perror(__FUNCTION__);
}
-#else
- BD_ADDR rev_bd;
- int i;
-
- get_remote_bd(bt_get_conhdl_from_line(line), rev_bd);
-
- /* return as big endian */
- for (i =3D 0; i < 6; i++)
- {
- bd_addr[i] =3D rev_bd[5-i];
- }
-#endif
}
=20
int
@@ -1177,8 +937,6 @@ read_remote_name(int bt_cfd, unsigned ch
{
cpylen =3D 254;
}
-=20=20
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, HCIREMOTENAME_REQUEST, tmpbuf) < 0)
{
perror(__FUNCTION__);
@@ -1188,10 +946,6 @@ read_remote_name(int bt_cfd, unsigned ch
memcpy(buf, tmpbuf, cpylen);
buf[cpylen] =3D 0;
return 0;
-#else
- fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
- return -1;
-#endif
}
=20
int bt_write_scan_enable(int bt_cfd, unsigned int flags)
@@ -1200,16 +954,11 @@ int bt_write_scan_enable(int bt_cfd, uns
=20
syslog(LOG_INFO, "Setting write_scan_enable: 0x%x", flags);
=20
-#ifdef BT_USERSTACK
- result =3D hci_write_scan_enable(flags);
-#else
-
if ((result =3D ioctl(bt_cfd, HCIWRITESCANENABLE, &flags)) < 0)
{
perror(__FUNCTION__);
exit(1);
}
-#endif
return result;
}
=20
@@ -1218,17 +967,10 @@ bt_write_pagescan_activity(int bt_cfd, u
unsigned int wind)
{
/* improves reliability when doing a connect */
-
+ unsigned int tmp[2];
syslog(LOG_INFO, "Setting write_pagescan_activity: int:0x%x wind:0x%x",
interval, wind);
=20
-
-#ifdef BT_USERSTACK
- hci_write_pagescan_activity(interval, wind);
-#else
- {
- unsigned int tmp[2];
-
tmp[0] =3D interval;
tmp[1] =3D wind;
=20
@@ -1238,8 +980,6 @@ bt_write_pagescan_activity(int bt_cfd, u
exit(1);
}
}
-#endif
-}
=20
int bt_set_event_filter(int bt_cfd, unsigned char *filter, int len)
{
@@ -1248,10 +988,6 @@ int bt_set_event_filter(int bt_cfd, unsi
=20
syslog(LOG_INFO, "Setting event filter");
=20
-#ifdef BT_USERSTACK
- result =3D hci_set_event_filter((u8*)filter, len);
-#else
-
tmp[0] =3D (len >> 8) & 0xff;
tmp[1] =3D len & 0xff;
memcpy(&tmp[2], filter, len);
@@ -1261,7 +997,6 @@ int bt_set_event_filter(int bt_cfd, unsi
perror(__FUNCTION__);
exit(1);
}
-#endif
return result;
}
=20
@@ -1282,15 +1017,11 @@ bt_set_classofdevice(int bt_cfd, unsigne
class_of_device[1] =3D ((service_class & 0x7) << 5) | (major_class & 0=
x1f);
class_of_device[2] =3D (service_class & 0x7f8) >> 3;
=20
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, HCIWRITECLASSOFDEVICE, class_of_device) < 0)
{
perror(__FUNCTION__);
exit(1);
}
-#else
- hci_write_class_of_device(class_of_device);
-#endif
break;
=20
case 1:
@@ -1324,20 +1055,15 @@ role_switch(int bt_cfd, unsigned char* b
=20
tmp[6] =3D (unsigned char)role;
=20
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, HCISWITCHROLE, tmp) < 0)
{
perror(__FUNCTION__);
}
-#else
- hci_switch_role(bd_addr, role);
-#endif
}
=20
void
set_bt_line_disc(int phys_fd, int bt_disc, char* physdev)
{
-#ifndef BT_USERSTACK
if (ioctl(phys_fd, TIOCSETD, &bt_disc) < 0)
{
perror(__FUNCTION__);
@@ -1345,9 +1071,6 @@ set_bt_line_disc(int phys_fd, int bt_dis
exit(1);
}
syslog(LOG_INFO, "Registered bluetooth line discipline on %s", physdev);
-#else
- fprintf(stderr, __FUNCTION__ ": Ignored in usermode stack\n");
-#endif
}
=20
=20
@@ -1423,32 +1146,22 @@ void bt_set_local_name(int bt_cfd, const
}
}
buffer[i] =3D '\0';
-
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, HCISETLOCALNAME, buffer) < 0)
{
perror(__FUNCTION__);
exit(1);
}
-#else
- hci_change_local_name(buffer);
-#endif
}
=20
int bt_read_country_code(int bt_cfd)
{
int result;
-
-#ifndef BT_USERSTACK
if (ioctl(bt_cfd, HCIREADCOUNTRYCODE, &result) < 0)
{
perror(__FUNCTION__);
exit(1);
}
return result;
-#else
- return hci_read_country_code();
-#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 */
@@ -1580,18 +1293,6 @@ int open_device(char* dev, int flags, in
{
int fd;
=20
-#ifdef BT_USERSTACK
- /* if opening bt dev or control dev simply discard and return fake fd */
- if ((strncmp(dev, "/dev/ttyBT", 11) =3D=3D 0) || (strcmp(dev, BT_CTRL_TT=
Y) =3D=3D 0))
- return 0xb055e;
-#if 0 /* fixme */
- if (use_local_socket)
- return open_socket(dev, role);
- else if (use_tcp_socket)
- return open_tcpsocket(dev, role);
-#endif
-#endif
-
D(syslog(LOG_INFO, "Opening dev %s", dev));
if ((fd =3D open(dev, flags | O_NOCTTY)) < 0)
{
@@ -1606,15 +1307,8 @@ int open_device(char* dev, int flags, in
void close_device(int fd)
{
D(syslog(LOG_INFO, __FUNCTION__));
-
-#ifdef BT_USERSTACK
- /* if fake fd is used, ignore close since there are no open fd */
- if (fd !=3D 0xb055e)
- close(fd);
-#else
if (fd !=3D -1)
close(fd);
-#endif
}
=20
int start_sdp_server(void)
@@ -1636,280 +1330,37 @@ int start_sdp_server(void)
return sdpsrv_pid;
}
=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 */
-/* Functions used in usermode stack only */
-/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
-
-/*
- *
- * FIXME -- NOT CHECKED AT ALL AFTER SPLIT UP OF BTD !!!!
- *
- */
-
-#ifdef BT_USERSTACK
-
-
-#if BT_DATADUMP_DEBUG
-#define BT_DATADUMP(str, data, len) print_data(str, data, len)
-#else
-#define BT_DATADUMP(str, data, len)
-#endif
-
-#if BT_DATA_DEBUG
-#if BT_USE_TIMESTAMPS
-#define BT_DATA(fmt...) do { print_time(1); printk(BT_DBG_STR"DATA " fmt);=
} while (0)
-#else
-#define BT_DATA(fmt...) printk(BT_DBG_STR"DATA " fmt)
-#endif /* BT_USE_TIMESTAMPS */
-
-#else /* BT_DATA_DEBUG */
-#define BT_DATA(fmt...)
-#endif /* BT_DATA_DEBUG */
-
-
-int init_read_thread(void)
-{
- printf("Initiating read thread\n");
- if (pthread_create(&read_thread, NULL, (void*)hci_receive_thread, NULL) =
!=3D 0)
- perror(__FUNCTION__);
- sleep(1); /* wait for thread to start */
- return 0;
-}
-
-void hci_receive_thread(void)
-{
- fd_set rfd;
- char databuf[4096];
-
- while (1)
- {
- FD_ZERO(&rfd);
- FD_SET(phys_fd, &rfd);
-
- select(phys_fd+1, &rfd, NULL, NULL, NULL);
-
- if (FD_ISSET(phys_fd, &rfd))
- {
- int len =3D read(phys_fd, &databuf, 4096);
-
- if (len > 0)
- {
- BT_DATA("-->|X| %3d\n", len);
- BT_DATADUMP("-->|X|", databuf, len);
- hci_receive_data(databuf, len);
- }
- }
- }
-}
-
-void
-init_upper_pty(void)
-{
- printf(__FUNCTION__);
-// open_pty();
-// init_pty_thread();
-}
-
-
-void init_userstack()
+int strtobd(unsigned char *src, unsigned char *dst)
{
- /* Direct function calls instead of ioctls... */
-
- init_read_thread();
-
- /* Initialise all layers in the bluetooth stack */
- DSYS("Initialising Bluetooth Stack\n");
-
- hci_init();
- l2cap_init();
- rfcomm_init();
- sdp_init(SERVER);
- tcs_init();
- test_init();
- btmem_init();
- unplug_test_init();
-
- bt_stat.bytes_received =3D 0;
- bt_stat.bytes_sent =3D 0;
-
- bt_initdone =3D 1;
-}
-
-/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
-/* Stack interface functions */
+ int bd[6], parseok =3D 0, i;
=20
-int bt_write_lower_driver(unsigned char *data, int len)
+ if (sscanf(src, "%2x%2x%2x%2x%2x%2x",
+ &bd[0], &bd[1], &bd[2],
+ &bd[3], &bd[4], &bd[5]) =3D=3D 6)
{
- int i;
-
- BT_DATA("<--|X| %3d\n", len);
-
- BT_DATADUMP("<--|X|", data, len);
- i =3D write(phys_fd, data, len);
- return i;
+ parseok =3D 1;
}
-
-
-/* Only works for the last connected rfcomm session */
-int
-bt_write_top(char *buf, int count, int line)
-{
- int retval;
- int bytes_sent =3D 0;
-
- BT_DATA(" |X|<-- %3d [%d]\n", count, line);
- BT_DATADUMP("|X|<--", buf, count);
-
- while (bytes_sent!=3Dcount)
- {
- retval =3D rfcomm_send_data(CREATE_RFCOMM_ID(line,test_dlci),
- buf + bytes_sent, count-bytes_sent);
-
- if (retval > 0)
- bytes_sent+=3Dretval;
- else if (retval=3D=3D0)
- usleep(1000); /* wait some ... */
- else
+ else if (sscanf(src, "%x:%x:%x:%x:%x:%x",
+ &bd[0], &bd[1], &bd[2],
+ &bd[3], &bd[4], &bd[5]) =3D=3D 6)
{
- printf("error\n");
- return retval;
- }
-
- usleep(1000); /* wait some time ... */
- };
-
- bt_stat.bytes_sent+=3Dbytes_sent;
-
- return bytes_sent;
+ parseok =3D 1;
}
=20
-int bt_receive_top(rfcomm_con *rfcomm, unsigned char *data, int len)
-{
- int n =3D 0;
-
- BT_DATA(" |X|--> %3d [%d]\n", len, rfcomm->line);
- BT_DATADUMP("|X|-->", data, len);
-
-#if 0 /* fixme */
- if (modem_emulation && !modem_connected)
+ if(parseok)
{
- modem_emulator(0xb055e, data, len);
- return len;
- }
-
- /* FIXME<2> -- why is data echoed back if no application is
- running on top of PTY ?? */
-
- if (!ready_for_ppp)
- return len;
-
- /* feed this to PTY connected to pppd or whatever application
- that may be running there... */
-
- if ((n =3D write(pty_master_fd, data, len)) !=3D len)
+ for(i =3D 0 ; i < 6 ; i++)
{
- BT_DATA(__FUNCTION__ ": tried to write %d bytes, wrote %d\n", len, n);
+ dst[i] =3D bd[i];
}
-#endif
-
- bt_stat.bytes_received+=3Dn;
-
- return n;
+ return 0;
}
-
-void
-bt_connect_ind(unsigned int con_id)
-{
- if (GET_PSM(con_id) =3D=3D RFCOMM_LAYER)
- printf(__FUNCTION__ ": RFCOMM dlci : %d\n",
- GET_RFCOMMDLCI(con_id));
else
- printf(__FUNCTION__ ": psm %d\n", GET_PSM(con_id));
-}
-
-void
-bt_connect_cfm(unsigned int con_id, int status)
{
- unsigned short psm;
- int line;
-
- psm =3D GET_PSM(con_id);
-
- if (status)
- {
- /* fixme -- only works for rfcomm now */
- line =3D GET_LINE(con_id);
-
- if ((line < 0) || (line > BT_NBR_DATAPORTS))
- {
- fprintf(stderr, __FUNCTION__ ": Invalid line (%d)\n", line);
- return;
- }
- fprintf(stderr, __FUNCTION__": Failed, status %d [%s] line %d\n", stat=
us, psmname(psm), line);
-
- return;
- }
-
- switch (psm)
- {
- case RFCOMM_LAYER:
- printf(__FUNCTION__ ": [%s]\n", psmname(psm));
- break;
-
- case SDP_LAYER:
- printf(__FUNCTION__ ": [%s]\n", psmname(psm));
- break;
-
- case TCS_LAYER:
- printf(__FUNCTION__ ": [%s]\n", psmname(psm));
- break;
-
- default:
- printf(__FUNCTION__ ": unknown layer %d\n", psm);
- break;
- }
-}
-
-void
-bt_disconnect_ind(unsigned int con_id)
-{
- if (GET_PSM(con_id) =3D=3D RFCOMM_LAYER)
- printf(__FUNCTION__ ": RFCOMM dlci : %d\n", GET_RFCOMMDLCI(con_id));
- else
- printf(__FUNCTION__ ": psm %d\n", GET_PSM(con_id));
+ return -1;
}
-
-int
-bt_register_rfcomm(struct rfcomm_con *rfcomm, u8 dlci)
-{
- printf(__FUNCTION__ ": dlci %d\n", dlci);
- test_rfcomm =3D rfcomm;
- test_dlci =3D dlci;
- return 0;
}
=20
-s32
-bt_unregister_rfcomm(s32 line)
-{
- printf(__FUNCTION__ ": line %d\n", line);
- /* fixme -- stub for now */
-}
=20
-s32
-bt_register_sdp(u8 line, u8 sdpID)
-{
- printf(__FUNCTION__ "\n");
- return 0;
-}
=20
-s32 bt_unregister_sdp(s32 line)
-{
- printf(__FUNCTION__ "\n");
- return 0;
-}
=20
-int bt_initiated(void)
-{
- return bt_initdone;
-}
-#endif /* BT_USERSTACK */
--- bt_if.h 2003/11/05 15:24:05 1.3
+++ bt_if.h 2003/11/05 19:04:53 1.4
@@ -42,10 +42,6 @@
#ifndef __BT_IF_H__
#define __BT_IF_H__
#include <sys/types.h>
-#ifdef BT_USERSTACK
-#include <pthread.h>
-#include "include/rfcomm.h"
-#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=3D=3D */
/* General defines */
@@ -83,18 +79,11 @@
=20
#define PID_FILE "/var/run/btd.pid"
=20
-#ifdef BT_USERSTACK
-#define SDPSRV_CMD "sdp_user"
-#define SDPSRV_PROC "/tmp/sdp_sock"
-#else
#define SDPSRV_CMD "sdp_server"
#define SDPSRV_PROC "/proc/sdp_srv"
-#endif
-
-#define SDPSRV_CONF "/etc/sdp.xml"
=20
=20
-#ifndef BT_USERSTACK
+#define SDPSRV_CONF "/etc/sdp.xml"
=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 */
/* IF Macros */
@@ -143,6 +132,9 @@
#define BTREADREMOTENAME _IOWR(BT_IOC_MAGIC, 0x12, unsigned char[BT_NAME_L=
ENGTH])
#define BTREADREMOTECLASSOFDEV _IOWR(BT_IOC_MAGIC, 0x13, unsigned char[6])
=20
+/* Disconnect all connections */
+#define BTDISCONNECT_ALL _IO(BT_IOC_MAGIC, 0x14)
+
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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 */
=20
@@ -307,8 +299,6 @@ typedef struct ping_struct
unsigned char data[1024];
} 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
@@ -319,9 +309,7 @@ typedef struct ping_struct
int init_stack(int bt_cfd, char * local_name);
int bt_isinitiated(int bt_cfd);
void shutdown_stack(int bt_cfd);
-#ifndef BT_USERSTACK
char* bt_hw_vendor(void);
-#endif
char* bt_firmware_info(void);
int bt_bcsp_mode(int bt_cfd, int enable);
int bt_dfu_mode(int bt_cfd, int enable);
@@ -332,13 +320,11 @@ void set_bt_line_disc(int phys_fd, int b
/*
* BNEP functions
*/
-#ifndef BTD_USERSTACK
int bnep_connect(int bt_fd, unsigned char *bd,=20
int srcservice, int dstservice,
unsigned char *pin, int pinlen);
=20
void bnep_disconnect(int bt_fd, unsigned char *bd);
-#endif
=20
/*
* Connect/Disconnect functions
@@ -347,7 +333,8 @@ void bnep_disconnect(int bt_fd, unsigned
int bt_connect(int bt_fd, unsigned char *bd, unsigned int con_id,=20
unsigned char *pin, unsigned char pinlen);
int bt_disconnect(int bt_fd, unsigned int con_id);
-int bt_disconnect_bb(int bt_fd, unsigned char *rem_bd); /* (Consafe) */
+int bt_disconnect_bb(int bt_fd, unsigned char *rem_bd);=20
+int bt_disconnect_all(int bt_cfd);
=20
void bt_waitline(int bt_fd, int line);
void bt_waitconnection(int bt_fd, int line);
@@ -422,37 +409,7 @@ int open_device(char* dev, int flags, in
void close_device(int fd);
const char *error_msg(int err);
int start_sdp_server(void);
+int strtobd(unsigned char *src, unsigned char *dst);
=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 */
-
-#ifdef BT_USERSTACK
-
-const char* psmname(unsigned short psm);
-int bt_write_lower_driver(unsigned char *data, int len);
-int bt_write_top(char *buf, int count, int line);
-int bt_receive_top(rfcomm_con *rfcomm, unsigned char *data, int len);
-void bt_rfcomm_connection_ready(int status);
-void bt_sdp_connection_ready(int status);
-int bt_initiated(void);
-extern int bt_read_proc(char *buf, int len);
-void init_userstack();
-
-#ifdef BT_USERSTACK
-int bt_register_rfcomm(struct rfcomm_con *rfcomm, unsigned char dlci);
-void bt_connect_cfm(unsigned int con_id, int status);
-#endif
-
-/* FIXME<1> clean this up !!! */
-bt_stat_struct bt_stat;
-
-/* Thread used to read data on "physical" device i.e where BT HW sits */
-pthread_t read_thread;
-int init_read_thread(void);
-void hci_receive_thread(void);
-
-/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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_IF_H__ */
--- bt_misc.c 2003/11/04 10:59:39 1.1
+++ bt_misc.c 2003/11/05 19:04:53 1.2
@@ -551,7 +551,6 @@ bd2str(const unsigned char *bd)
return buf;
}
=20
-#ifndef BT_USERSTACK
void=20
print_data(const char *message, const unsigned char *buf, int len)
{=20
@@ -572,7 +571,6 @@ print_data(const char *message, const un
printf("\n");
}
}
-#endif
=20
/* Sets pin code to string pin, disabled if using 'disable' as pin */
void
--- bt_misc.h 2003/11/04 10:59:39 1.1
+++ bt_misc.h 2003/11/05 19:04:53 1.2
@@ -68,9 +68,7 @@ char *get_local_ip_address(void);
char* get_domain_name(void);
=20
const char *bd2str(const unsigned char *bd);
-#ifndef BT_USERSTACK
void print_data(const char *message, const unsigned char *buf, int len);
-#endif
void set_pin_code(const char *pin);
=20
#endif /* __BT_MISC_H__*/
|