From 2b9f59d4652df3de56d19aa6ef3974f3b6fdc0f0 Mon Sep 17 00:00:00 2001 From: Arron Wang Date: Mon, 13 May 2013 09:58:57 +0800 Subject: Add adapter powered signal Change-Id: I7bf650500d907d3cdfbb2df1d8aa5fa5ae77bb26 --- src/adapter.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index e303b3a..0ee15da 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -144,6 +144,15 @@ static void polling_changed(struct near_adapter *adapter) DBUS_TYPE_BOOLEAN, &adapter->polling); } +static void powered_changed(struct near_adapter *adapter) +{ + + near_dbus_property_changed_basic(adapter->path, + NFC_ADAPTER_INTERFACE, "Powered", + DBUS_TYPE_BOOLEAN, &adapter->powered); +} + + static void rf_mode_changed(struct near_adapter *adapter) { const char *rf_mode = rf_mode_to_string(adapter); @@ -419,6 +428,7 @@ static DBusMessage *set_property(DBusConnection *conn, } adapter->powered = powered; + powered_changed(adapter); } else { return __near_error_invalid_property(msg); } -- cgit v1.2.3