summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2013-01-04 16:10:26 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2013-01-31 01:35:38 +0100
commitf03efcc0e43557b7498aba3f53bafb1ecc28a453 (patch)
treee5609edf121e06d35259d716bfbe88c32472da0a /src
parent096477056cd1931757853bd456064727ebc5ef2e (diff)
downloadneard-f03efcc0e43557b7498aba3f53bafb1ecc28a453.tar.gz
neard-f03efcc0e43557b7498aba3f53bafb1ecc28a453.tar.bz2
neard-f03efcc0e43557b7498aba3f53bafb1ecc28a453.zip
agent: Set carrier power state hint in prepare_bt_data
If alternative carrier is power state is known add it to dictionary.
Diffstat (limited to 'src')
-rw-r--r--src/agent.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/agent.c b/src/agent.c
index df0dd39..b12631d 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -280,6 +280,12 @@ static struct bt_data *parse_reply(DBusMessage *reply)
return bt_data;
}
+static const char *cps2string[] = {
+ "inactive",
+ "active",
+ "activating",
+};
+
static void prepare_bt_data(DBusMessage *message, struct bt_data *data)
{
DBusMessageIter iter;
@@ -302,6 +308,13 @@ static void prepare_bt_data(DBusMessage *message, struct bt_data *data)
near_dbus_dict_append_fixed_array(&dict, name, DBUS_TYPE_BYTE,
&pdata, data->size);
+
+ if (data->state != CPS_UNKNOWN) {
+ const char *state = cps2string[data->state];
+
+ near_dbus_dict_append_basic(&dict, "State",
+ DBUS_TYPE_STRING, &state);
+ }
}
near_dbus_dict_close(&iter, &dict);