D23576: Add property lastScanTime and lastRequestTime to WirelessDevice
Méven Car
noreply at phabricator.kde.org
Fri Aug 30 13:24:21 BST 2019
meven added a comment.
In D23576#522341 <https://phabricator.kde.org/D23576#522341>, @jgrulich wrote:
> In D23576#522340 <https://phabricator.kde.org/D23576#522340>, @meven wrote:
>
> > I am hesitant to add a second field "previousScan" that would store the previous lastScan timeStamp when a new one arrives.
> > This would be used to compute the time elapsed between the scans which is necessary to do since Network manager requires scans to be at least 10 seconds apart :
> > https://github.com/NetworkManager/NetworkManager/blob/master/src/devices/wifi/nm-device-wifi.c#L1205
>
>
> That would be useful I guess and could be used in plasma-nm.
>
> 1. You should set initial lastScan property to "-1" which should indicate there was no scan attempt
> 2. Mention that it will work only when NM 1.12+ is running, older NM releases don't support this property
> 3. Above mentioned will be a problem when you would like to rely on that in plasma-nm, because we should be working even with older NM versions
1. I missed your comment and made important code change, instead of using the LastScan property, I use QDateTime to retain requestScan event and LastScan changes event.
2. will do
3. My code in plasma should be compatible already D23578 <https://phabricator.kde.org/D23578>
INLINE COMMENTS
> jgrulich wrote in wirelessdevice.cpp:250
> Don't use QDateTime::currentDateTime() as it might be different from the actual value returned by NetworkManager.
LastScan is in CLOCK_BOOTIME which is complicated to work with.
So I use naively the signal time rather than the LastScan value.
This will need a bit of work just to work with it:
https://github.com/NetworkManager/NetworkManager/blob/a7d8fe0ea5eb7be42a86527226ea54fd221fb1b4/shared/nm-glib-aux/nm-time-utils.c#L193
REPOSITORY
R282 NetworkManagerQt
REVISION DETAIL
https://phabricator.kde.org/D23576
To: meven, jgrulich
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190830/395c5432/attachment.html>
More information about the Kde-frameworks-devel
mailing list