P2P: Show P2P peer signal level in D-Bus P2P device properties

Move level parameter from p2p_device to p2p_device_info in order to
expose this information and modify D-Bus P2P handler to return this new
parameter through the P2P device properties.

Signed-off-by: Fabien Marotte <fabienx.marotte@intel.com>
Signed-off-by: Jayant Sane <jayant.sane@intel.com>
This commit is contained in:
Jayant Sane 2011-06-23 21:29:10 +03:00 committed by Jouni Malinen
parent c2762e410f
commit 6402fc438b
4 changed files with 10 additions and 3 deletions

View file

@ -576,7 +576,7 @@ int p2p_add_device(struct p2p_data *p2p, const u8 *addr, int freq, int level,
dev->listen_freq = freq; dev->listen_freq = freq;
if (msg.group_info) if (msg.group_info)
dev->oper_freq = freq; dev->oper_freq = freq;
dev->level = level; dev->info.level = level;
p2p_copy_wps_info(dev, 0, &msg); p2p_copy_wps_info(dev, 0, &msg);
@ -2961,7 +2961,7 @@ int p2p_get_peer_info(struct p2p_data *p2p, const u8 *addr, int next,
"invitation_reqs=%u\n", "invitation_reqs=%u\n",
(int) (now.sec - dev->last_seen.sec), (int) (now.sec - dev->last_seen.sec),
dev->listen_freq, dev->listen_freq,
dev->level, dev->info.level,
p2p_wps_method_text(dev->wps_method), p2p_wps_method_text(dev->wps_method),
MAC2STR(dev->interface_addr), MAC2STR(dev->interface_addr),
MAC2STR(dev->member_in_go_dev), MAC2STR(dev->member_in_go_dev),

View file

@ -179,6 +179,11 @@ struct p2p_peer_info {
*/ */
char serial_number[33]; char serial_number[33];
/**
* level - Signal level
*/
int level;
/** /**
* config_methods - WPS Configuration Methods * config_methods - WPS Configuration Methods
*/ */

View file

@ -33,7 +33,6 @@ struct p2p_device {
struct dl_list list; struct dl_list list;
struct os_time last_seen; struct os_time last_seen;
int listen_freq; int listen_freq;
int level;
enum p2p_wps_method wps_method; enum p2p_wps_method wps_method;
struct p2p_peer_info info; struct p2p_peer_info info;

View file

@ -1112,6 +1112,9 @@ DBusMessage *wpas_dbus_getter_p2p_peer_properties(DBusMessage * message,
if (!wpa_dbus_dict_append_uint16(&dict_iter, "config_method", if (!wpa_dbus_dict_append_uint16(&dict_iter, "config_method",
info->config_methods)) info->config_methods))
goto err_no_mem; goto err_no_mem;
if (!wpa_dbus_dict_append_uint16(&dict_iter, "level",
info->level))
goto err_no_mem;
if (!wpa_dbus_dict_append_byte(&dict_iter, "devicecapability", if (!wpa_dbus_dict_append_byte(&dict_iter, "devicecapability",
info->dev_capab)) info->dev_capab))
goto err_no_mem; goto err_no_mem;