WifiScanner
@objc(GSWifiScanner)
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 }
-
Requests the WIFI environment scanning process to start.
While scanning, the peripheral will regularly report Wifi channels occupation. These results can be obtained using
getOccupationRate(forChannel:)
This has no effect if
scanning
is already ongoing.Declaration
Swift
func startScan()
-
Requests an ongoing scan operation to stop.
When scanning stops, internal scan results are cleared and the
getOccupationRate(forChannel:)
will report 0 for any channel.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
func getOccupationRate(forChannel channel: WifiChannel) -> Int
Parameters
channel
the Wifi channel to query occupation information of
Return Value
the channel occupation rate