[PATCH 5/9] dbus: Provide the intended address of the peer
Tomasz Bursztyka
tomasz.bursztyka
Wed May 14 06:10:42 PDT 2014
This info will be fulfilled once paired with the peer.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka at linux.intel.com>
---
wpa_supplicant/dbus/dbus_new.c | 4 ++++
wpa_supplicant/dbus/dbus_new_handlers_p2p.c | 24 ++++++++++++++++++++++++
wpa_supplicant/dbus/dbus_new_handlers_p2p.h | 4 ++++
3 files changed, 32 insertions(+)
diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index 6bd2a40..67a121e 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -3271,6 +3271,10 @@ static const struct wpa_dbus_property_desc wpas_dbus_p2p_peer_properties[] = {
wpas_dbus_getter_p2p_peer_device_address,
NULL
},
+ { "IntendedAddress", WPAS_DBUS_NEW_IFACE_P2P_PEER, "ay",
+ wpas_dbus_getter_p2p_peer_intended_address,
+ NULL
+ },
{ NULL, NULL, NULL, NULL, NULL }
};
diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
index 20cbeed..676124e 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
@@ -20,6 +20,7 @@
#include "dbus_new_handlers_p2p.h"
#include "dbus_dict_helpers.h"
#include "p2p/p2p.h"
+#include "p2p/p2p_i.h"
#include "common/ieee802_11_defs.h"
#include "ap/hostapd.h"
#include "ap/ap_config.h"
@@ -1520,6 +1521,29 @@ dbus_bool_t wpas_dbus_getter_p2p_peer_device_address(DBusMessageIter *iter,
ETH_ALEN, error);
}
+dbus_bool_t wpas_dbus_getter_p2p_peer_intended_address(DBusMessageIter *iter,
+ DBusError *error,
+ void *user_data)
+{
+ struct peer_handler_args *peer_args = user_data;
+ const struct p2p_peer_info *info;
+ struct p2p_device *dev;
+
+ info = p2p_get_peer_info(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;
+ }
+
+ dev = (struct p2p_device *) (((u8 *) info) -
+ offsetof(struct p2p_device, info));
+
+ return wpas_dbus_simple_array_property_getter(
+ iter, DBUS_TYPE_BYTE, (char *) dev->intended_addr,
+ ETH_ALEN, error);
+}
/**
* wpas_dbus_getter_persistent_groups - Get array of persistent group objects
diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.h b/wpa_supplicant/dbus/dbus_new_handlers_p2p.h
index 67e0e9d..4d1cbab 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.h
+++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.h
@@ -151,6 +151,10 @@ dbus_bool_t wpas_dbus_getter_p2p_peer_device_address(DBusMessageIter *iter,
DBusError *error,
void *user_data);
+dbus_bool_t wpas_dbus_getter_p2p_peer_intended_address(DBusMessageIter *iter,
+ DBusError *error,
+ void *user_data);
+
/*
* P2P Group properties
*/
--
1.8.3.2
More information about the Hostap
mailing list