dbus: Add MeshGroupRemoved signal
This is similar to the control interface event MESH-GROUP-REMOVED. Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
This commit is contained in:
parent
89e9cd25d2
commit
a39b040b4c
6 changed files with 88 additions and 0 deletions
|
@ -795,6 +795,7 @@ nomem:
|
|||
|
||||
|
||||
#ifdef CONFIG_MESH
|
||||
|
||||
void wpas_dbus_signal_mesh_group_started(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid)
|
||||
{
|
||||
|
@ -825,6 +826,42 @@ void wpas_dbus_signal_mesh_group_started(struct wpa_supplicant *wpa_s,
|
|||
dbus_connection_send(iface->con, msg, NULL);
|
||||
dbus_message_unref(msg);
|
||||
}
|
||||
|
||||
|
||||
void wpas_dbus_signal_mesh_group_removed(struct wpa_supplicant *wpa_s,
|
||||
const u8 *meshid, u8 meshid_len,
|
||||
int reason)
|
||||
{
|
||||
struct wpas_dbus_priv *iface;
|
||||
DBusMessage *msg;
|
||||
DBusMessageIter iter, dict_iter;
|
||||
|
||||
iface = wpa_s->global->dbus;
|
||||
|
||||
/* Do nothing if the control interface is not turned on */
|
||||
if (!iface || !wpa_s->dbus_new_path)
|
||||
return;
|
||||
|
||||
msg = dbus_message_new_signal(wpa_s->dbus_new_path,
|
||||
WPAS_DBUS_NEW_IFACE_MESH,
|
||||
"MeshGroupRemoved");
|
||||
if (!msg)
|
||||
return;
|
||||
|
||||
dbus_message_iter_init_append(msg, &iter);
|
||||
if (!wpa_dbus_dict_open_write(&iter, &dict_iter) ||
|
||||
!wpa_dbus_dict_append_byte_array(&dict_iter, "SSID",
|
||||
(const char *) meshid,
|
||||
meshid_len) ||
|
||||
!wpa_dbus_dict_append_int32(&dict_iter, "DisconnectReason",
|
||||
reason) ||
|
||||
!wpa_dbus_dict_close_write(&iter, &dict_iter))
|
||||
wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
|
||||
else
|
||||
dbus_connection_send(iface->con, msg, NULL);
|
||||
dbus_message_unref(msg);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_MESH */
|
||||
|
||||
|
||||
|
@ -3664,6 +3701,12 @@ static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
|
|||
END_ARGS
|
||||
}
|
||||
},
|
||||
{ "MeshGroupRemoved", WPAS_DBUS_NEW_IFACE_MESH,
|
||||
{
|
||||
{ "args", "a{sv}", ARG_OUT },
|
||||
END_ARGS
|
||||
}
|
||||
},
|
||||
#endif /* CONFIG_MESH */
|
||||
{ NULL, NULL, { END_ARGS } }
|
||||
};
|
||||
|
|
|
@ -243,6 +243,9 @@ void wpas_dbus_signal_p2p_invitation_received(struct wpa_supplicant *wpa_s,
|
|||
int op_freq);
|
||||
void wpas_dbus_signal_mesh_group_started(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid);
|
||||
void wpas_dbus_signal_mesh_group_removed(struct wpa_supplicant *wpa_s,
|
||||
const u8 *meshid, u8 meshid_len,
|
||||
int reason);
|
||||
|
||||
#else /* CONFIG_CTRL_IFACE_DBUS_NEW */
|
||||
|
||||
|
@ -564,6 +567,13 @@ void wpas_dbus_signal_mesh_group_started(struct wpa_supplicant *wpa_s,
|
|||
{
|
||||
}
|
||||
|
||||
static inline
|
||||
void wpas_dbus_signal_mesh_group_removed(struct wpa_supplicant *wpa_s,
|
||||
const u8 *meshid, u8 meshid_len,
|
||||
int reason)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
|
||||
|
||||
#endif /* CTRL_IFACE_DBUS_H_NEW */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue