summaryrefslogtreecommitdiff
path: root/lib/neardal_adapter.c
diff options
context:
space:
mode:
authorRavi kumar Veeramally <ravikumar.veeramally@linux.intel.com>2012-12-11 16:02:11 +0100
committerFrederic PAUT <frederic.paut@linux.intel.com>2012-12-11 16:02:11 +0100
commit6eea69a09e1ebf058b3bdf3e80663d71d2d7a45e (patch)
tree6caf5c7ce458aa385b6b0c2de35665c0879ac8b2 /lib/neardal_adapter.c
parent4e41558d2d7a31d0cdcdd2d101472d899ccb5b2d (diff)
downloadneardal-6eea69a09e1ebf058b3bdf3e80663d71d2d7a45e.tar.gz
neardal-6eea69a09e1ebf058b3bdf3e80663d71d2d7a45e.tar.bz2
neardal-6eea69a09e1ebf058b3bdf3e80663d71d2d7a45e.zip
support for neard radio mode
Diffstat (limited to 'lib/neardal_adapter.c')
-rw-r--r--lib/neardal_adapter.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/neardal_adapter.c b/lib/neardal_adapter.c
index 9ea4dc2..8d1de76 100644
--- a/lib/neardal_adapter.c
+++ b/lib/neardal_adapter.c
@@ -172,6 +172,7 @@ static void neardal_adp_prv_cb_property_changed(orgNeardAdp *proxy,
DevProp *devProp = NULL;
gchar **array = NULL;
GVariant *gvalue = NULL;
+ gsize mode_len;
(void) proxy; /* remove warning */
(void) user_data; /* remove warning */
@@ -190,6 +191,19 @@ static void neardal_adp_prv_cb_property_changed(orgNeardAdp *proxy,
goto exit;
}
+ NEARDAL_TRACEF(" arg_unnamed_arg0 : %s\n", arg_unnamed_arg0);
+
+ if (!strcmp(arg_unnamed_arg0, "Mode")) {
+ if (adpProp->mode != NULL) {
+ g_free(adpProp->mode);
+ adpProp->mode = NULL;
+ }
+
+ adpProp->mode = g_strdup(g_variant_get_string(gvalue, &mode_len));
+ clientValue = adpProp->mode;
+ NEARDAL_TRACEF("neardalMgr.mode=%s\n", adpProp->mode);
+ }
+
if (!strcmp(arg_unnamed_arg0, "Polling")) {
adpProp->polling = g_variant_get_boolean(gvalue);
clientValue = GUINT_TO_POINTER(adpProp->polling);
@@ -383,6 +397,10 @@ static errorCode_t neardal_adp_prv_read_properties(AdpProp *adpProp)
if (tmpOut != NULL)
adpProp->powered = g_variant_get_boolean(tmpOut);
+ tmpOut = g_variant_lookup_value(tmp, "Mode", G_VARIANT_TYPE_STRING);
+ if (tmpOut != NULL)
+ adpProp->mode = g_variant_dup_string(tmpOut, &len);
+
tmpOut = g_variant_lookup_value(tmp, "Protocols",
G_VARIANT_TYPE_ARRAY);
if (tmpOut != NULL) {
@@ -546,6 +564,8 @@ static void neardal_adp_prv_free(AdpProp **adpProp)
(*adpProp)->proxy = NULL;
}
g_free((*adpProp)->name);
+ if ((*adpProp)->mode != NULL)
+ g_free((*adpProp)->mode);
if ((*adpProp)->protocols != NULL)
g_strfreev((*adpProp)->protocols);
g_free((*adpProp));