To properly use the WirelessDevice::RequestScan, we need to listen to LastScan property change.
lastScanTime reflects the time when we receive a LastScan property change.
lastRequestScanTime reflects the time when we last requested a scan.
To properly use the WirelessDevice::RequestScan, we need to listen to LastScan property change.
lastScanTime reflects the time when we receive a LastScan property change.
lastRequestScanTime reflects the time when we last requested a scan.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
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.
src/wirelessdevice.cpp | ||
---|---|---|
251 | Don't use QDateTime::currentDateTime() as it might be different from the actual value returned by NetworkManager. |
src/wirelessdevice.cpp | ||
---|---|---|
251 | LastScan is in CLOCK_BOOTIME which is complicated to work with. |
src/wirelessdevice.cpp | ||
---|---|---|
251 | Then cannot you work with it as with qlonglong? It shouldn't matter then if it's in CLOCK_BOOTIME . |
src/wirelessdevice.cpp | ||
---|---|---|
251 | I need to be able to know the elapsed time since LastScan. So it doesn't matter as long as I manage to get a CLOCK_BOOTIME value for current time. Anyway I am thinking about adding a short util function somewhere to convert CLOCK_BOOTTIME to QDateTime. |
I have implemented the CLOCK_BOOTTIME conversion to QDateTime in QDateTime NetworkManager::clockBootTimeToQDateTime
src/utils.h | ||
---|---|---|
86 |
|
Sorry, I missed that last one. Once it's fixed it's ready to go.
src/wirelessdevice.h | ||
---|---|---|
232 | const QDateTime ×tamp |
D23578 is the next step, but it is not in great shape.
To do things properly, it will require quite some changes I fear.
src/wirelessdevice.h | ||
---|---|---|
143 | Thinking about it now, wouldn't be this wording better? QDateTime lastScanRequestTime() const; Maybe even without the "Time" at the end so it's consistent with "lastScan". |
src/wirelessdevice.h | ||
---|---|---|
143 | Please do, you can push it directly, it's just a function rename. |