mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 10:32:33 +01:00
station: send initial signal level notification
After registration of a SignalLevelAgent, make iwd inform the client of the initial signal level via a "Changed" method call.
This commit is contained in:
parent
0b9e7eb120
commit
3d27d0d80a
@ -450,6 +450,11 @@ const char *netdev_get_path(struct netdev *netdev)
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t netdev_get_rssi_level_idx(struct netdev *netdev)
|
||||||
|
{
|
||||||
|
return netdev->cur_rssi_level_idx;
|
||||||
|
}
|
||||||
|
|
||||||
static void netdev_set_powered_result(int error, uint16_t type,
|
static void netdev_set_powered_result(int error, uint16_t type,
|
||||||
const void *data,
|
const void *data,
|
||||||
uint32_t len, void *user_data)
|
uint32_t len, void *user_data)
|
||||||
|
@ -145,6 +145,7 @@ bool netdev_get_4addr(struct netdev *netdev);
|
|||||||
const char *netdev_get_name(struct netdev *netdev);
|
const char *netdev_get_name(struct netdev *netdev);
|
||||||
bool netdev_get_is_up(struct netdev *netdev);
|
bool netdev_get_is_up(struct netdev *netdev);
|
||||||
const char *netdev_get_path(struct netdev *netdev);
|
const char *netdev_get_path(struct netdev *netdev);
|
||||||
|
uint8_t netdev_get_rssi_level_idx(struct netdev *netdev);
|
||||||
|
|
||||||
struct handshake_state *netdev_handshake_state_new(struct netdev *netdev);
|
struct handshake_state *netdev_handshake_state_new(struct netdev *netdev);
|
||||||
struct handshake_state *netdev_get_handshake(struct netdev *netdev);
|
struct handshake_state *netdev_get_handshake(struct netdev *netdev);
|
||||||
|
@ -3716,6 +3716,7 @@ static struct l_dbus_message *station_dbus_signal_agent_register(
|
|||||||
{
|
{
|
||||||
struct station *station = user_data;
|
struct station *station = user_data;
|
||||||
const char *path, *sender;
|
const char *path, *sender;
|
||||||
|
struct l_dbus_message *reply;
|
||||||
struct l_dbus_message_iter level_iter;
|
struct l_dbus_message_iter level_iter;
|
||||||
int8_t levels[16];
|
int8_t levels[16];
|
||||||
int err;
|
int err;
|
||||||
@ -3758,12 +3759,19 @@ static struct l_dbus_message *station_dbus_signal_agent_register(
|
|||||||
|
|
||||||
l_debug("agent %s path %s", sender, path);
|
l_debug("agent %s path %s", sender, path);
|
||||||
|
|
||||||
/*
|
reply = l_dbus_message_new_method_return(message);
|
||||||
* TODO: send an initial notification in a oneshot idle callback,
|
l_dbus_send(dbus, reply);
|
||||||
* if state is connected.
|
|
||||||
*/
|
|
||||||
|
|
||||||
return l_dbus_message_new_method_return(message);
|
if (station->connected_network) {
|
||||||
|
struct netdev *netdev = station->netdev;
|
||||||
|
uint8_t level = netdev_get_rssi_level_idx(netdev);
|
||||||
|
|
||||||
|
station_signal_agent_notify(station->signal_agent,
|
||||||
|
netdev_get_path(netdev),
|
||||||
|
level);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct l_dbus_message *station_dbus_signal_agent_unregister(
|
static struct l_dbus_message *station_dbus_signal_agent_unregister(
|
||||||
|
Loading…
Reference in New Issue
Block a user