summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2013-10-11 17:40:51 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2013-10-11 17:40:51 +0200
commit9a9e7a211a0165db907bc21e430dc386937a6a27 (patch)
tree73cd39fce9953760781fa47d4316c2a6782b0c2b /src
parentf777d8e262ee98617725b8b87a562c125267e664 (diff)
downloadneard-9a9e7a211a0165db907bc21e430dc386937a6a27.tar.gz
neard-9a9e7a211a0165db907bc21e430dc386937a6a27.tar.bz2
neard-9a9e7a211a0165db907bc21e430dc386937a6a27.zip
adapter: Do not send a poll command when adapter is down
No need to go through the kernel netlink NFC API if the adapter is known to be down.
Diffstat (limited to 'src')
-rw-r--r--src/adapter.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/adapter.c b/src/adapter.c
index 0b85ef5..e91fc30 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -444,6 +444,11 @@ static DBusMessage *start_poll_loop(DBusConnection *conn,
DBG("conn %p", conn);
+ if (!adapter->powered) {
+ near_error("Adapter is down, can not start polling");
+ return __near_error_failed(msg, ENODEV);
+ }
+
dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &dbus_mode,
DBUS_TYPE_INVALID);