|
From: Anders J. <and...@us...> - 2001-11-22 14:42:53
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
btd.c 1.32 1.33=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Added option -I, --use-ipa, to enable btdm to use IPA.
The diff of the modified file(s):
--- btd.c 2001/10/16 15:02:20 1.32
+++ btd.c 2001/11/22 14:42:52 1.33
@@ -80,6 +80,10 @@
force uart communication to not use CTS and RTS
default: flow control activated if defined hardware support it
=20
+ -I, --use-ipa
+ enable use of ipa
+ default: not enabled
+
e.g
./btdm --reset --speed 460800 --physdev /dev/ttyS0 --local-name OpenBT
./btdm --reset --speed 1000000/1 --physdev /dev/ttyS0 --local-name Open=
BT
@@ -188,6 +192,8 @@
static int phys_fd =3D -1; /* physical device e.g ttyS0 */
static sigjmp_buf jmpbuffer; /* used to jump back in program after doing r=
eset */
=20
+static int use_ipa =3D 0;=20
+
/* long option list */
static struct option long_options[] =3D
{
@@ -198,6 +204,7 @@
{ "local-name", 1, NULL, 'n' }, /* set local bluetooth name */
{ "reset", 0, NULL, 'R' }, /* reset BT HW */
{ "speed", 1, NULL, 's' }, /* uart speed towards hw */
+ { "use-ipa", 0, NULL, 'I' },
{ 0, 0, 0, 0 }
};
=20
@@ -230,7 +237,7 @@
}
=20=20=20
/* now parse options */
- while ((opt =3D getopt_long(argc, argv, "fi:m:nRs:u:",
+ while ((opt =3D getopt_long(argc, argv, "fi:m:nRs:u:I",
long_options, &option_index)) !=3D -1)
{
switch(opt)
@@ -275,6 +282,10 @@
D(syslog(LOG_INFO, "phys dev: %s", optarg));
physdev =3D optarg;
break;
+ case 'I':
+ D(syslog(LOG_INFO, "using IPA"));
+ use_ipa =3D 1;
+ break;
=20
default:
break;
@@ -335,7 +346,7 @@
=20
FD_ZERO(&rfd);=20=20
=20
- if (ipa_fd >=3D 0)
+ if (use_ipa && (ipa_fd >=3D 0))
FD_SET(ipa_fd, &rfd);
=20=20=20=20=20
result =3D select(FD_SETSIZE, &rfd, NULL, NULL, &tv);
@@ -343,7 +354,8 @@
{
case 0:
{
-#ifdef USE_IPASSIGN
+ if(ipa_fd >=3D 0)
+ {=20=20
/* Check for outstanding IPA requests */
int i =3D 0, waiting_iparsp =3D 0;
while (i < BT_NBR_DATAPORTS)
@@ -359,10 +371,8 @@
=20=20=20=20=20=20=20=20=20
if (waiting_iparsp)
break;
-#endif
-=20=20=20=20=20=20=20=20
+ }
/* Timeout, check for new rfcomm cons */
-
discover_connections(bt_cfd);
}
break;
@@ -487,7 +497,7 @@
opts[i++] =3D "passive";
=20=20=20
/* check if we have used IPA */
- if (ipset)
+ if (use_ipa && ipset)
{
/* FIXME -- maybe parhand can modify ppp options=20
file directly */
@@ -814,7 +824,8 @@
PEER(i).ipset =3D NULL;
}
=20
-#ifdef USE_IPASSIGN
+ if(use_ipa)
+ {
/* Look for IPA server */
ipa_fd =3D -1;
i =3D 1;
@@ -841,7 +852,7 @@
D(syslog(LOG_INFO, "Found IPA server"));
}
}=20
-#endif
+ }
=20
if (modem_emul =3D=3D 1)
D(syslog(LOG_INFO, "Using modem emulation"));
@@ -873,7 +884,7 @@
phys_fd =3D -1;
}
=20
- if (ipa_fd !=3D -1)
+ if (ipa_fd >=3D 0)
{
D(syslog(LOG_INFO, "Closing connection to IPA"));
tcflush(ipa_fd, TCIOFLUSH);
|