|
From: Alain P. <apa...@us...> - 2002-08-09 14:54:47
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Tag Comment
---- ----------- ----------- --- -------
bt_if.c 1.50 1.51=20=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Added Object Transfer Service Class by default.
The diff of the modified file(s):
--- bt_if.c 6 Aug 2002 17:56:15 -0000 1.50
+++ bt_if.c 9 Aug 2002 14:54:45 -0000 1.51
@@ -87,7 +87,7 @@
if (!bt_dfu_mode(bt_cfd, -1))
{
/* fixme<3> -- read these parameters from config file ? */
- bt_set_classofdevice(bt_cfd, 0x10, 0x3, 0x0, 0x0);
+ bt_set_classofdevice(bt_cfd, 0x90, 0x3, 0x0, 0x0);
=20
#ifndef __CRIS__
if (!local_name)
|
|
From: Alain P. <apa...@us...> - 2002-08-12 12:08:00
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Tag Comment
---- ----------- ----------- --- -------
bt_if.c 1.51 1.52=20=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Corrected a missing \0 missing at the end of the name to send to the module
Corrected a "char" to "signed char" so that there is no more warning.
The diff of the modified file(s):
--- bt_if.c 9 Aug 2002 14:54:45 -0000 1.51
+++ bt_if.c 12 Aug 2002 12:07:58 -0000 1.52
@@ -871,7 +871,7 @@
}
else
{
- if ((char)con_hdl[2] >=3D 0)
+ if ((signed char)con_hdl[2] >=3D 0)
printf("CLOCK OFFSET =3D 0x%X%X\n", con_hdl[1], con_hdl[0]);
else
printf("Not valid CLOCK OFFSET value !!!\n");
@@ -895,7 +895,7 @@
}
else
{
- if ( (char)num_rtx[1] >=3D 0 )
+ if ( (signed char)num_rtx[1] >=3D 0 )
printf("read num broadcast rtx =3D 0x%X\n", num_rtx[0]);
else
printf("Not valid BROADCAST RTX value =3D 0x%X !!!\n",num_rtx[1]);
@@ -1383,8 +1383,8 @@
{
buf[len++] =3D ' ';
buf[len++] =3D '(';
- buf[len] =3D '\0';
}
+ buf[len] =3D '\0';
}
=20
if (add_host)
|
|
From: Alain P. <apa...@us...> - 2002-08-26 15:07:42
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Tag Comment
---- ----------- ----------- --- -------
bt_if.c 1.52 1.53=20=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Just add an example how to set the module as a heaset to that phones find t=
hem when
searching for headsets.
The diff of the modified file(s):
--- bt_if.c 12 Aug 2002 12:07:58 -0000 1.52
+++ bt_if.c 26 Aug 2002 15:07:28 -0000 1.53
@@ -88,6 +88,8 @@
{
/* fixme<3> -- read these parameters from config file ? */
bt_set_classofdevice(bt_cfd, 0x90, 0x3, 0x0, 0x0);
+ /* Test : uncomment next line (and comment previous) to set your devic=
e as a headset */
+// bt_set_classofdevice(bt_cfd, 0xFFE, 0x4, 0x1, 0x0);
=20
#ifndef __CRIS__
if (!local_name)
|
|
From: Peter K. <pk...@us...> - 2002-11-07 14:38:21
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Tag Comment
---- ----------- ----------- --- -------
bt_if.c 1.53 1.54=20=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Clean up.
The diff of the modified file(s):
--- bt_if.c 26 Aug 2002 15:07:28 -0000 1.53
+++ bt_if.c 7 Nov 2002 14:38:19 -0000 1.54
@@ -1,7 +1,7 @@
/*
* bt_if.c -- Interface functions towards kernel / userstack
*
- * Copyright (C) 2000, 2001 Axis Communications AB
+ * Copyright (C) 2000, 2001, 2002 Axis Communications AB
*
* Author: Mattias Agren <mat...@ax...>
*
@@ -353,7 +353,7 @@
else
printf("BB Disconnected\n");
#else
- fprintf(stderr, __FUNCTION__ ": not yet implemented...\n");
+ fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
#endif
return ret_val;
}
@@ -370,7 +370,7 @@
exit(1);
}
#else
- fprintf(stderr, __FUNCTION__ ": not yet implemented...\n");
+ fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
ret =3D -1;
#endif
if (bt_cfd < 0)
@@ -459,17 +459,17 @@
void
bt_waitline(int bt_fd, int line)
{
- printf("wait for a connection on line %d\n", 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(__FUNCTION__ ": got a connection !\n");
+ printf(__FUNCTION__ ": Got a connection !\n");
#else
/* fixme<1> */
- fprintf(stderr, __FUNCTION__ ": not yet implemented...\n");
+ fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
#endif
}
=20
@@ -483,10 +483,10 @@
perror(__FUNCTION__);
exit(1);
}
- printf(__FUNCTION__ ": found a connection !\n");
+ printf(__FUNCTION__ ": Found a connection !\n");
#else
/* fixme<1>*/
- fprintf(stderr, __FUNCTION__ ": not yet implemented...\n");
+ fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
#endif
}
=20=20
@@ -500,10 +500,10 @@
perror(__FUNCTION__);
exit(1);
}
- printf(__FUNCTION__ ": got a connection !\n");
+ printf(__FUNCTION__ ": Got a connection !\n");
#else
/* fixme<1>*/
- fprintf(stderr, __FUNCTION__ ": not yet implemented...\n");
+ fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
#endif
}
=20
@@ -524,7 +524,7 @@
return -1;
}
#else
- fprintf(stderr, __FUNCTION__ ": not yet implemented...\n");
+ fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
//hci_send_raw_data(data, 16);
#endif
return 0;
@@ -698,7 +698,6 @@
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
/* BNEP functions */
=20
-
void
bnep_connect(int bt_fd, unsigned char *bd)
{
@@ -707,15 +706,17 @@
#ifndef BTD_USERSTACK
result =3D ioctl(bt_fd, BNEPCONNECT, bd);
if (result&0x0ff)
- printf("Connect failed [%s ((0x%X))]\n", error_msg(result&0x0ff), resu=
lt);
- else {
- printf("Connected on con_hdl =3D %.2X:%.2X\n", bd[0], bd[1]);
- printf("BNEP Interface =3D 0x%X\n", bd[2]);
+ {
+ printf("BNEP connect failed [%s ((0x%X))]\n",
+ error_msg(result & 0x0ff), result);
}
-#else
+ else
{=20=20
- printf("Unsupported in usermode\n");
+ 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
}
=20=20
@@ -727,106 +728,95 @@
#ifndef BTD_USERSTACK
result =3D ioctl(bt_fd, BNEPDISCONNECT, bd);
if (result)=20
- printf("Disconnect failed [%s ((0x%X))]\n", error_msg(resul=
t&0x0ff), result&0x0ff);
+ {
+ printf("BNEP disconnect failed [%s ((0x%X))]\n",
+ error_msg(result & 0x0ff), result & 0x0ff);
+ }
else=20
- printf("Disconnect OK\n");
-#else
{=20=20
- printf("Unsupported in usermode\n");
+ 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 */
/* HCI functions */
=20
-
void
bt_read_rssi(int bt_cfd, unsigned char* con_hdl)
{
-
#ifndef BTD_USERSTACK=20
if (ioctl(bt_cfd, HCIREADRSSI, con_hdl) < 0)
{
- perror("read_rssi");
+ perror(__FUNCTION__);
}
else
{
if (con_hdl[1] =3D=3D 2)
+ {
printf("RSSI level =3D 0x%X\n", con_hdl[0]);
+ }
else
+ {
printf("Not valid RSSI value !!!\n");
}
-#else
- {=20=20
- printf("Unsupported in usermode\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=20
if (ioctl(bt_cfd, HCIPARKMODE, park_params) < 0)
{
- perror("park_mode");
+ perror(__FUNCTION__);
}
#else
- {=20=20
- printf("Unsupported in usermode\n");
- }
+ fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
#endif
}
=20
void
bt_exit_park_mode(int bt_cfd, unsigned char* con_hdl)
{
-
#ifndef BTD_USERSTACK=20
if (ioctl(bt_cfd, HCIEXITPARKMODE, con_hdl) < 0)
{
- perror("exit_park_mode");
+ perror(__FUNCTION__);
}
#else
- {=20=20
- printf("Unsupported in usermode\n");
- }
+ fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
#endif
}
=20
void
bt_sniff_mode(int bt_cfd, unsigned char* sniff_params)
{
-
#ifndef BTD_USERSTACK=20
if (ioctl(bt_cfd, HCISNIFFMODE, sniff_params) < 0)
{
- perror("sniff_mode");
+ perror(__FUNCTION__);
}
#else
- {=20=20
- printf("Unsupported in usermode\n");
- }
+ fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
#endif
}
=20
void
bt_exit_sniff_mode(int bt_cfd, unsigned char* con_hdl)
{
-
#ifndef BTD_USERSTACK=20
if (ioctl(bt_cfd, HCIEXITSNIFFMODE, con_hdl) < 0)
{
- perror("exit_sniff_mode");
+ perror(__FUNCTION__);
}
#else
- {=20=20
- printf("Unsupported in usermode\n");
- }
+ fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
#endif
}
=20
@@ -836,52 +826,47 @@
#ifndef BTD_USERSTACK=20
if (ioctl(bt_cfd, HCIHOLDMODE, hold_params) < 0)
{
- perror("hold mode");
+ perror(__FUNCTION__);
}
#else
- {=20=20
- printf("Unsupported in usermode\n");
- }
+ 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=20
if (ioctl(bt_cfd, HCIWRITELINKPOLICYSETTINGS, policy_params) < 0)
{
- perror("write_link_policy_settings");
+ perror(__FUNCTION__);
}
#else
- {=20=20
- printf("Unsupported in usermode\n");
- }
+ fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
#endif
}
=20
-
void
bt_read_clock_offset(int bt_cfd, unsigned char* con_hdl)
{
-
#ifndef BTD_USERSTACK=20
if (ioctl(bt_cfd, HCIREADCLOCKOFFSET, con_hdl) < 0)
{
- perror("read_rssi");
+ perror(__FUNCTION__);
}
else
{
if ((signed char)con_hdl[2] >=3D 0)
+ {
printf("CLOCK OFFSET =3D 0x%X%X\n", con_hdl[1], con_hdl[0]);
+ }
else
+ {
printf("Not valid CLOCK OFFSET value !!!\n");
}
-#else
- {=20=20
- printf("Unsupported in usermode\n");
}
+#else
+ fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
#endif
}
=20
@@ -893,116 +878,104 @@
#ifndef BTD_USERSTACK=20
if (ioctl(bt_cfd, HCIREADNUMBROADCASTRETRANSMISSIONS, num_rtx) < 0)
{
- perror("read_num_broadcast_rtx");
+ perror(__FUNCTION__);
}
else
{
if ( (signed char)num_rtx[1] >=3D 0 )
+ {
printf("read num broadcast rtx =3D 0x%X\n", num_rtx[0]);
+ }
else
+ {
printf("Not valid BROADCAST RTX value =3D 0x%X !!!\n",num_rtx[1]);
}
-#else
- {=20=20
- printf("Unsupported in usermode\n");
}
+#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=20
if (ioctl(bt_cfd, HCIWRITENUMBROADCASTRETRANSMISSIONS, num_rtx) < 0)
{
- perror("write_num_broadcast_rtx");
+ perror(__FUNCTION__);
}
#else
- {=20=20
- printf("Unsupported in usermode\n");
- }
+ fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
#endif
}
=20
void
bt_write_page_to(int bt_cfd, unsigned char* page_to)
{
-
#ifndef BTD_USERSTACK=20
if (ioctl(bt_cfd, HCIWRITEPAGETO, page_to) < 0)
{
- perror("write_page_to");
+ perror(__FUNCTION__);
}
#else
- {=20=20
- printf("Unsupported in usermode\n");
- }
+ 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=20
if (ioctl(bt_cfd, HCIREADTRANSMITPOWERLEVEL, tx_power_level) < 0)
{
- perror("read_tx_power_level");
+ perror(__FUNCTION__);
}
else
{
if ( (char)tx_power_level[1] =3D=3D 1 )
+ {
printf("read tx power level =3D 0x%X\n", tx_power_level[0]);
+ }
else
+ {
printf("Not valid TX POWER LEVEL value !!!\n");
}
-#else
- {=20=20
- printf("Unsupported in usermode\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=20
if (ioctl(bt_cfd, HCIWRITELINKSUPERVISIONTO, link_to) < 0)
{
- perror("link_supervision_to");
+ perror(__FUNCTION__);
}
#else
- {=20=20
- printf("Unsupported in usermode\n");
- }
+ 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=20
- printf("Setting write_pagescan_activity: p_s_int =3D 0x%X%X p_s_win=
=3D 0x%X
-%X\n",page_scan[0]&0x0FF, page_scan[1]&0x0FF, page_scan[4]&0x0FF, page_sca=
n[5]&0x0FF);
+ 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);
=20=20=20
if (ioctl(bt_cfd, HCIWRITEPAGESCANACTIVITY, page_scan) < 0)
{=20
- perror("write_page_scan_activity");
+ perror(__FUNCTION__);
}
#else
- {=20=20
- printf("Unsupported in usermode\n");
- }
+ fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n");
#endif
}
=20
-
int
bt_inquiry(int bt_cfd, int nbr_rsp, int t, int get_name)
{
@@ -1043,11 +1016,13 @@
/* First print the number of units found */
printf("%d", inq_res->nbr_of_units);
=20=09
- for (i =3D 0; i < inq_res->nbr_of_units; i++) {
+ for (i =3D 0; i < inq_res->nbr_of_units; i++)
+ {
/* Copy BD_ADDR to send in ioctl */
memcpy(name_device,inq_res->bd_addr + 6*i, 6);
=20=20=20=20=20
- if ((retval =3D ioctl(bt_cfd, HCIREMOTENAME_REQUEST, name_device)) < 0=
) {
+ if ((retval =3D ioctl(bt_cfd, HCIREMOTENAME_REQUEST, name_device)) <=
0)
+ {
fprintf (stderr, "Remote name request failed [%s (%d)]\n", error_msg=
(retval), MSG_GET_CODE(-retval));
/* Test if the problem is that the IOCTL doesn't exist */
if (errno =3D=3D EINVAL)
@@ -1055,24 +1030,29 @@
/* Print a default name */
printf("\nDevice with unknown name");
}
- else {
+ else
+ {
switch (retval)
{
case 0x04: /* Page timeout */
printf("\nDevice with unknown name");
break;
+
case 0x00:
- if (name_device[0] =3D=3D '\0') {
+ if (name_device[0] =3D=3D '\0')
+ {
printf("Device with empty name\n");
}
- else {
+ else
+ {
printf("\n%s", name_device);
}
break;
+
default:
- printf("\nDevice with unrecoverable name");;
+ printf("\nDevice with unrecoverable name");
+ break;
} /* Switch */
-
}
=20
/* Print BD address */
@@ -1080,7 +1060,6 @@
inq_res->bd_addr[0+6*i], inq_res->bd_addr[1+6*i],
inq_res->bd_addr[2+6*i], inq_res->bd_addr[3+6*i],
inq_res->bd_addr[4+6*i], inq_res->bd_addr[5+6*i]);
-=09=20=20
} /* End of loop on every addresses founded */
} /* End of if get_name */
else
@@ -1093,7 +1072,6 @@
inq_res->bd_addr[2+6*i], inq_res->bd_addr[3+6*i],
inq_res->bd_addr[4+6*i], inq_res->bd_addr[5+6*i]);
}
-
}
free(inq_res);
#endif
@@ -1141,10 +1119,6 @@
return result;
}
=20
-
-
-
-
void
read_local_bd(int bt_cfd, unsigned char *bd_addr)
{
@@ -1199,7 +1173,8 @@
get_remote_bd(line, rev_bd);
=20
/* return as big endian */
- for (i =3D 0; i < 6; i++) {
+ for (i =3D 0; i < 6; i++)
+ {
bd_addr[i] =3D rev_bd[5-i];
}
#endif
@@ -1357,7 +1332,7 @@
}
syslog(LOG_INFO, "Registered bluetooth line discipline on %s", physdev);
#else
- fprintf(stderr, __FUNCTION__ ": ignored in usermode stack\n");
+ fprintf(stderr, __FUNCTION__ ": Ignored in usermode stack\n");
#endif
}
=20
@@ -1638,7 +1613,7 @@
{
execvp(SDPSRV_CMD, args);
=20
- fprintf(stderr, "%s: no such file or directory\n", SDPSRV_CMD);
+ fprintf(stderr, "%s: No such file or directory\n", SDPSRV_CMD);
syslog(LOG_INFO, "%s not found", SDPSRV_CMD);
=20
_exit(0);
@@ -1845,21 +1820,23 @@
=20
psm =3D GET_PSM(con_id);
=20
- if (status) {
+ if (status)
+ {
/* fixme -- only works for rfcomm now */
line =3D GET_LINE(con_id);
=20
- if ((line < 0) || (line > BT_NBR_DATAPORTS)) {
-
- fprintf(stderr, __FUNCTION__ ": invalid line (%d)\n", line);
+ 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);
+ fprintf(stderr, __FUNCTION__": Failed, status %d [%s] line %d\n", stat=
us, psmname(psm), line);
=20
return;
}
=20
- switch (psm) {
+ switch (psm)
+ {
case RFCOMM_LAYER:
printf(__FUNCTION__ ": [%s]\n", psmname(psm));
break;
@@ -1921,8 +1898,3 @@
return bt_initdone;
}
#endif /* BT_USERSTACK */
-
-
-
-
-
|
|
From: Anders J. <and...@us...> - 2003-02-06 15:31:12
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bt_if.c 1.56 1.57=20=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: get_remote_name and get_remote_bd changed to use hci_hdl to find the connection. The diff of the modified file(s): --- bt_if.c 13 Jan 2003 19:48:07 -0000 1.56 +++ bt_if.c 6 Feb 2003 15:31:08 -0000 1.57 @@ -1211,7 +1211,7 @@ BD_ADDR rev_bd; int i; =20 - get_remote_bd(line, rev_bd); + get_remote_bd(bt_get_conhdl_from_line(line), rev_bd); =20 /* return as big endian */ for (i =3D 0; i < 6; i++) |