|
From: Willy S. <sag...@us...> - 2002-04-08 16:43:57
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Tag Comment
---- ----------- ----------- --- -------
bt_if.c 1.44 1.45=20=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Added new commands
The diff of the modified file(s):
--- bt_if.c 28 Feb 2002 20:08:31 -0000 1.44
+++ bt_if.c 8 Apr 2002 11:20:31 -0000 1.45
@@ -665,9 +665,313 @@
}
=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 */
+/* BNEP functions */
+
+
+void
+bnep_connect(int bt_fd, unsigned char *bd)
+{
+ unsigned int result;
+=20=20=20=20=20=20=20=20=20=20
+#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]);
+ }
+#else
+ {=20=20
+ printf("Unsupported in usermode\n");
+ }
+#endif
+}
+=20
+void
+bnep_disconnect(int bt_fd, unsigned char *bd)
+{
+ int result;
+=20=20=20=20=20=20=20=20
+ #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);
+ else=20
+ printf("Disconnect OK\n");
+#else
+ {=20=20
+ printf("Unsupported in usermode\n");
+ }
+#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 */
/* HCI functions */
=20
=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");
+ }
+ 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");
+ }
+#endif
+}
+
+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");
+ }
+#else
+ {=20=20
+ printf("Unsupported in usermode\n");
+ }
+#endif
+}
+
+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");
+ }
+#else
+ {=20=20
+ printf("Unsupported in usermode\n");
+ }
+#endif
+}
+
+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");
+ }
+#else
+ {=20=20
+ printf("Unsupported in usermode\n");
+ }
+#endif
+}
+
+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");
+ }
+#else
+ {=20=20
+ printf("Unsupported in usermode\n");
+ }
+#endif
+}
+
+void=20
+bt_hold_mode(int bt_cfd, unsigned char* hold_params)
+{
+#ifndef BTD_USERSTACK=20
+ if (ioctl(bt_cfd, HCIHOLDMODE, hold_params) < 0)
+ {
+ perror("hold mode");
+ }
+#else
+ {=20=20
+ printf("Unsupported in usermode\n");
+ }
+#endif
+}
+
+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");
+ }
+#else
+ {=20=20
+ printf("Unsupported in usermode\n");
+ }
+#endif
+}
+
+
+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");
+ }
+ else
+ {
+ if ((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");
+ }
+#endif
+}
+
+void
+bt_read_num_broadcast_rtx(int bt_cfd)
+{
+ unsigned char num_rtx[2];
+
+#ifndef BTD_USERSTACK=20
+ if (ioctl(bt_cfd, HCIREADNUMBROADCASTRETRANSMISSIONS, num_rtx) < 0)
+ {
+ perror("read_num_broadcast_rtx");
+ }
+ else
+ {
+ if ( (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");
+ }
+#endif
+}
+
+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");
+ }
+#else
+ {=20=20
+ printf("Unsupported in usermode\n");
+ }
+#endif
+}
+
+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");
+ }
+#else
+ {=20=20
+ printf("Unsupported in usermode\n");
+ }
+#endif
+}
+
+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");
+ }
+ 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");
+ }
+#endif
+}
+
+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");
+ }
+#else
+ {=20=20
+ printf("Unsupported in usermode\n");
+ }
+#endif
+}
+
+
+
+
+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);
+=20=20
+ if (ioctl(bt_cfd, HCIWRITEPAGESCANACTIVITY, page_scan) < 0)
+ {=20
+ perror("write_page_scan_activity");
+ }
+#else
+ {=20=20
+ printf("Unsupported in usermode\n");
+ }
+#endif
+}
+
+
int
bt_inquiry(int bt_cfd, int nbr_rsp, int t)
{
@@ -756,6 +1060,10 @@
return result;
}
=20
+
+
+
+
void
read_local_bd(int bt_cfd, unsigned char *bd_addr)
{
@@ -1529,3 +1837,8 @@
return bt_initdone;
}
#endif /* BT_USERSTACK */
+
+
+
+
+
|