diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-08-18 18:29:40 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-08-18 18:29:40 +0000 |
commit | 3dec6f11d625a351bae0aada4160f3d2de429cdd (patch) | |
tree | d77a073813bf7f34fc18dcaea812f94cd46d41e1 /hcid/dbus-rfcomm.c | |
parent | 58887f9452b222cfb28bf8c5c11d13bd5de95efb (diff) |
Fixed SetMode when the adapter is DOWN
Diffstat (limited to 'hcid/dbus-rfcomm.c')
-rw-r--r-- | hcid/dbus-rfcomm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hcid/dbus-rfcomm.c b/hcid/dbus-rfcomm.c index a7d7cbc1..f5c5708a 100644 --- a/hcid/dbus-rfcomm.c +++ b/hcid/dbus-rfcomm.c @@ -700,6 +700,7 @@ static struct service_data rfcomm_services[] = { DBusHandlerResult handle_rfcomm_method(DBusConnection *conn, DBusMessage *msg, void *data) { + const struct hci_dbus_data *pdata = data; service_handler_func_t handler; if (!hcid_dbus_use_experimental()) @@ -710,6 +711,9 @@ DBusHandlerResult handle_rfcomm_method(DBusConnection *conn, DBusMessage *msg, return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } + if (!pdata->up) + return error_not_ready(conn, msg); + /* Initialize the RFCOMM control socket if has not yet been done */ if (rfcomm_ctl < 0) { rfcomm_ctl = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_RFCOMM); |