[PATCH 2/2 v2] doc: Fix SignalLevelAgent interface name and filename pointers
by Andrew Zaborowski
When the SignalLevelAgent doc blurb was moved to station-api.txt it
seems the interface was changed to Station.SignalLevelAgent in some
places but not in most and not in the code. Also fix the pointers to
the doc file.
---
doc/p2p-api.txt | 4 ++--
doc/station-api.txt | 31 ++++++++++++++-----------------
2 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/doc/p2p-api.txt b/doc/p2p-api.txt
index 08ee8d92..b10c51ed 100644
--- a/doc/p2p-api.txt
+++ b/doc/p2p-api.txt
@@ -47,8 +47,8 @@ Methods array(on) GetPeers()
Register the agent object to receive signal strength
level change notifications on the
- net.connman.iwd.Station.SignalLevelAgent interface,
- see station-api.txt. The "levels" parameter decides
+ net.connman.iwd.SignalLevelAgent interface, see
+ station-api.txt. The "levels" parameter decides
the thresholds in dBm that will generate a call to
the agent's Changed method whenever current RSSI
crosses any of the values. The values must be
diff --git a/doc/station-api.txt b/doc/station-api.txt
index b2131890..b640e18c 100644
--- a/doc/station-api.txt
+++ b/doc/station-api.txt
@@ -112,14 +112,13 @@ Methods void Scan()
Register the agent object to receive signal strength
level change notifications on the
net.connman.iwd.SignalLevelAgent interface, see
- signal-level-agent-api.txt. The "levels"
- parameters decides the thresholds in dBm that will
- generate a call to the agent's Changed
- method whenever current RSSI crosses any of the
- values. The values must be passed in descending
- order. The number and distance between requested
- threshold values is a compromise between resolution
- and the frequency of system wakeups and
+ below. The "levels" parameters decides the
+ thresholds in dBm that will generate a call to the
+ agent's Changed method whenever current RSSI crosses
+ any of the values. The values must be passed in
+ descending order. The number and distance between
+ requested threshold values is a compromise between
+ resolution and the frequency of system wakeups and
context-switches that are going to be occurring to
update the client's signal meter. Only one agent
can be registered at any time.
@@ -186,15 +185,13 @@ Methods void Release(object device)
measurement for the device's connected network
changes enough to go from one level to another out
of the N ranges defined by the array of (N-1)
- threshold values passed to
- net.connman.iwd.Station.RegisterSignalLevelAgent
- (see device-api.txt.) The level parameter is in
- the range from 0 to N, 0 being the strongest
- signal or above the first threshold value in the
- array, and N being the weakest and below the
- last threshold value. For example if
- RegisterSignalLevelAgent was called with the
- array [-40, -50, -60], the 'level' parameter of
+ threshold values passed to RegisterSignalLevelAgent().
+ The level parameter is in the range from 0 to N,
+ 0 being the strongest signal or above the first
+ threshold value in the array, and N being the
+ weakest and below the last threshold value. For
+ example if RegisterSignalLevelAgent was called with
+ the array [-40, -50, -60], the 'level' parameter of
0 would mean signal is received at -40 or more dBm
and 3 would mean below -60 dBm and might correspond
to 1 out of 4 bars on a UI signal meter.
--
2.25.1
1 year, 8 months
[PATCH 1/2] station: Fix .Scanning being reset early
by Andrew Zaborowski
periodic_scan_stop is called whenever we exit the autoscan state but a
periodic scan may not be running at the time. If we have a
user-triggered scan running, or the autoconnect_quick scan, and we reset
Scanning to false before that scan finished, a client could en up
calling GetOrderedNetwork too early and not receiving the scan results.
---
src/station.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/station.c b/src/station.c
index ad2c83a6..eb254bf6 100644
--- a/src/station.c
+++ b/src/station.c
@@ -1031,9 +1031,8 @@ static void periodic_scan_stop(struct station *station)
{
uint64_t id = netdev_get_wdev_id(station->netdev);
- scan_periodic_stop(id);
-
- station_property_set_scanning(station, false);
+ if (scan_periodic_stop(id))
+ station_property_set_scanning(station, false);
}
static bool station_needs_hidden_network_scan(struct station *station)
--
2.25.1
1 year, 8 months
[PATCH 1/5] station: Make Disconnect() cancel ConnectHiddenNetwork()
by Andrew Zaborowski
ConnectHiddenNetwork can be seen a triggering this sequence:
1. the active scan,
2. the optional agent request,
3. the Authentication/Association/4-Way Handshake/netconfig,
4. connected state
Currently Disconnect() interrupts 3 and 4, allow it to also interrupt
state 1. It's difficult to tell whether we're in state 2 from within
station.c.
---
src/station.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/station.c b/src/station.c
index 7fb4ae77..6ac9e53b 100644
--- a/src/station.c
+++ b/src/station.c
@@ -2749,6 +2749,15 @@ static struct l_dbus_message *station_dbus_disconnect(struct l_dbus *dbus,
*/
station_set_autoconnect(station, false);
+ if (station->hidden_network_scan_id) {
+ scan_cancel(netdev_get_wdev_id(station->netdev),
+ station->hidden_network_scan_id);
+ dbus_pending_reply(&station->hidden_pending,
+ dbus_error_aborted(station->hidden_pending));
+
+ return l_dbus_message_new_method_return(message);
+ }
+
if (!station_is_busy(station))
return l_dbus_message_new_method_return(message);
--
2.25.1
1 year, 8 months