WifiScanner
public protocol WifiScanner : Peripheral
WifiScanner peripheral interface.
Allows scanning the device’s wifi environment to obtain information about the current occupation of wifi channels.
This peripheral can be retrieved by:
drone.getPeripheral(Peripherals.wifiScanner)
-
Whether the peripheral is currently scanning wifi networks environment.
Declaration
Swift
var scanning: Bool { get }
-
Latest scan results. Empty if no results were obtained yet or when scanning is not ongoing.
Declaration
Swift
var scanResults: [ScanResult] { get }
-
Requests the wifi environment scanning process to start.
While scanning, the peripheral will regularly report wifi channels occupation. These results can be obtained using
scanResults
.This has no effect if
scanning
is already ongoing.Declaration
Swift
func startScan()
-
Requests an ongoing scan operation to stop.
When scanning stops,
scanResults
are cleared immediately.This has no effect if this peripheral is not currently
scanning
.Declaration
Swift
func stopScan()
-
Retrieves the amount of wifi networks that are currently using a given wifi channel.
Declaration
Swift
@available(*, deprecated, message: "Use `scanResults` instead") func getOccupationRate(forChannel channel: WifiChannel) -> Int
Parameters
channel
the wifi channel to query occupation information of
Return Value
the channel occupation rate