aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus
diff options
context:
space:
mode:
authorAmit Khatri <amit.khatri@samsung.com>2015-06-10 10:06:09 (GMT)
committerJouni Malinen <j@w1.fi>2015-06-10 16:06:54 (GMT)
commit2899cba622deecde80026245094358a8e3c1d9d6 (patch)
tree0fa82d0e35cbc1d8098570be26b0479c67b85da7 /wpa_supplicant/dbus
parent8bb5cfe41ab6369bcbcb346d4b8448a3283c2cd9 (diff)
downloadhostap-2899cba622deecde80026245094358a8e3c1d9d6.zip
hostap-2899cba622deecde80026245094358a8e3c1d9d6.tar.gz
hostap-2899cba622deecde80026245094358a8e3c1d9d6.tar.bz2
P2P: Add ModelName info into D-Bus peer interface
Signed-off-by: Amit Khatri <amit.khatri@samsung.com> Signed-off-by: Rahul Jain <rahul.jain@samsung.com>
Diffstat (limited to 'wpa_supplicant/dbus')
-rw-r--r--wpa_supplicant/dbus/dbus_new.c4
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers_p2p.c37
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers_p2p.h4
3 files changed, 45 insertions, 0 deletions
diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index a97860b..e6915da 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -3315,6 +3315,10 @@ static const struct wpa_dbus_property_desc wpas_dbus_p2p_peer_properties[] = {
wpas_dbus_getter_p2p_peer_manufacturer,
NULL
},
+ { "ModelName", WPAS_DBUS_NEW_IFACE_P2P_PEER, "s",
+ wpas_dbus_getter_p2p_peer_modelname,
+ NULL
+ },
{ "PrimaryDeviceType", WPAS_DBUS_NEW_IFACE_P2P_PEER, "ay",
wpas_dbus_getter_p2p_peer_primary_device_type,
NULL
diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
index c8dd67b..bf1c8fe 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
@@ -1288,6 +1288,43 @@ dbus_bool_t wpas_dbus_getter_p2p_peer_manufacturer(DBusMessageIter *iter,
}
+dbus_bool_t wpas_dbus_getter_p2p_peer_modelname(DBusMessageIter *iter,
+ DBusError *error,
+ void *user_data)
+{
+ struct peer_handler_args *peer_args = user_data;
+ const struct p2p_peer_info *info;
+ char *tmp;
+
+ if (!wpa_dbus_p2p_check_enabled(peer_args->wpa_s, NULL, NULL, error))
+ return FALSE;
+
+ /* get the peer info */
+ info = p2p_get_peer_found(peer_args->wpa_s->global->p2p,
+ peer_args->p2p_device_addr, 0);
+ if (info == NULL) {
+ dbus_set_error(error, DBUS_ERROR_FAILED, "failed to find peer");
+ return FALSE;
+ }
+
+ tmp = os_strdup(info->model_name);
+ if (!tmp) {
+ dbus_set_error_const(error, DBUS_ERROR_NO_MEMORY, "no memory");
+ return FALSE;
+ }
+
+ if (!wpas_dbus_simple_property_getter(iter, DBUS_TYPE_STRING, &tmp,
+ error)) {
+ dbus_set_error_const(error, DBUS_ERROR_NO_MEMORY, "no memory");
+ os_free(tmp);
+ return FALSE;
+ }
+
+ os_free(tmp);
+ return TRUE;
+}
+
+
dbus_bool_t wpas_dbus_getter_p2p_peer_primary_device_type(
DBusMessageIter *iter, DBusError *error, void *user_data)
{
diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.h b/wpa_supplicant/dbus/dbus_new_handlers_p2p.h
index a84fc4a..5e1d410 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.h
+++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.h
@@ -119,6 +119,10 @@ dbus_bool_t wpas_dbus_getter_p2p_peer_manufacturer(DBusMessageIter *iter,
DBusError *error,
void *user_data);
+dbus_bool_t wpas_dbus_getter_p2p_peer_modelname(DBusMessageIter *iter,
+ DBusError *error,
+ void *user_data);
+
dbus_bool_t wpas_dbus_getter_p2p_peer_primary_device_type(
DBusMessageIter *iter, DBusError *error, void *user_data);