|
From: Mats F. <ma...@us...> - 2001-06-14 15:13:25
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
btd.c 1.20 1.21=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Disconnect bluetooth link if IPA fails
The diff of the modified file(s):
--- btd.c 2001/06/13 12:18:00 1.20
+++ btd.c 2001/06/14 15:13:23 1.21
@@ -376,11 +376,24 @@
ipa_read(ipa_fd, msg);
if ((retval =3D parse_ipa_response(msg)) < 0)
{
- /* FIXME -- we got an error. Reset peer ? */
- syslog(LOG_INFO, "Got IPA error %d", retval);
+ unsigned int con_id;
+ int line =3D ((struct ipa_status*)(msg->msg))->id;
+ syslog(LOG_INFO, "Got IPA error %d, disconnecting line %d", retval,=
line);
+=09=20=20=20=20=20=20
+ con_id =3D CREATE_RFCOMM_ID(line, 0);
+=09=20=20=20=20=20=20
+ if (bt_disconnect(bt_cfd, con_id) < 0)
+ {
+ /* FIXME: What to do if disconnection fails */
+ syslog(LOG_INFO, "Disconnection failed");
+ }
+ else
+ {
+ STATE(line) =3D NOCONNECTION;
}=20=20=20=20=20=20=20=20=20=20=20
}
}=20
+ }=20
#endif
}
break;
@@ -929,7 +942,7 @@
/* Check state */
if (STATE(rsp->id) !=3D WAITING_RETURN_PPPCONF)
{
- syslog(LOG_INFO, __FUNCTION__ ": Wrong state");
+ syslog(LOG_INFO, __FUNCTION__ ": Wrong state (case IPARSP_STATUS)"=
);
return -ERR_WRONGSTATE;
}
=20
@@ -959,7 +972,7 @@
/* Check state */
if (STATE(rsp->id) !=3D WAITING_PPPCONF)
{
- syslog(LOG_INFO, __FUNCTION__ ": Wrong state");
+ syslog(LOG_INFO, __FUNCTION__ ": Wrong state case (IPARSP_PEERSETT=
INGS)");
return -ERR_WRONGSTATE;
}
=20
|