djiuser_WIpZkFJugOwS
lvl.1
Italy
Offline
|
Ok, found the solution. You have to implement a delegate like this:
let drone: DJIAircraft = DJISDKManager.product() as! DJIAircraft
drone.flightController?.delegate = self
drone.battery?.delegate = self
and add : DJIFlightControllerDelegate, DJIBatteryDelegate to you script and implement the function of this protocol/interface
public func battery(_ battery: DJIBattery, didUpdate state: DJIBatteryState) {
//code
}
public func flightController(_ fc: DJIFlightController, didUpdate state: DJIFlightControllerState) {
//code
}
|
|