summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2013-08-14 09:27:45 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2013-08-20 11:05:30 +0200
commit18736bf9eaf3622cec6c96661b3068dd6dc939e5 (patch)
tree681cb5a34c3cc2591ed651024352de9a9c03817d /src
parente5147f44094c71362216f3b34b7c8cfcefd67d38 (diff)
downloadneard-18736bf9eaf3622cec6c96661b3068dd6dc939e5.tar.gz
neard-18736bf9eaf3622cec6c96661b3068dd6dc939e5.tar.bz2
neard-18736bf9eaf3622cec6c96661b3068dd6dc939e5.zip
adapter: Use dbus_bool_t for D-Bus functions
Diffstat (limited to 'src')
-rw-r--r--src/adapter.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/adapter.c b/src/adapter.c
index a67d59c..59d023f 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -142,10 +142,12 @@ static char *rf_mode_to_string(struct near_adapter *adapter)
static void polling_changed(struct near_adapter *adapter)
{
+ dbus_bool_t polling;
+ polling = adapter->polling;
near_dbus_property_changed_basic(adapter->path,
NFC_ADAPTER_INTERFACE, "Polling",
- DBUS_TYPE_BOOLEAN, &adapter->polling);
+ DBUS_TYPE_BOOLEAN, &polling);
}
static void rf_mode_changed(struct near_adapter *adapter)
@@ -347,6 +349,7 @@ static DBusMessage *get_properties(DBusConnection *conn,
const char *rf_mode;
DBusMessage *reply;
DBusMessageIter array, dict;
+ dbus_bool_t val;
DBG("conn %p", conn);
@@ -358,11 +361,13 @@ static DBusMessage *get_properties(DBusConnection *conn,
near_dbus_dict_open(&array, &dict);
+ val = adapter->powered;
near_dbus_dict_append_basic(&dict, "Powered",
- DBUS_TYPE_BOOLEAN, &adapter->powered);
+ DBUS_TYPE_BOOLEAN, &val);
+ val = adapter->polling;
near_dbus_dict_append_basic(&dict, "Polling",
- DBUS_TYPE_BOOLEAN, &adapter->polling);
+ DBUS_TYPE_BOOLEAN, &val);
rf_mode = rf_mode_to_string(adapter);
if (rf_mode != NULL)
@@ -403,7 +408,7 @@ static DBusMessage *set_property(DBusConnection *conn,
type = dbus_message_iter_get_arg_type(&value);
if (g_str_equal(name, "Powered") == TRUE) {
- near_bool_t powered;
+ dbus_bool_t powered;
if (type != DBUS_TYPE_BOOLEAN)
return __near_error_invalid_arguments(msg);