Skip to main content

IFlyZoneManager

IFlyZoneManager

Description The drone fly zone management mainly includes no-fly zone management, authorized zone management, and flyable zone management. No-fly zones are further divided into global fixed no-fly zones, temporary no-fly zones, and geofences (currently only supports JSON files conforming to the ED-269 standard). The SDK implements functions related to fly zones and provides interfaces that comply with laws and regulations for external use.

method getFlyZonesInSurroundingArea

fun getFlyZonesInSurroundingArea(
location: LocationCoordinate2D,
callback: CommonCallbacks.CompletionCallbackWithParam<List<FlyZoneInformation>?>
)

Description: Get no-fly zones within a 100-kilometer radius from the center location, including fixed no-fly zones, temporary no-fly zones, and geofences.

Input Parameters: location Center location

Input Parameters: callback Result callback

Output Parameters: None

Related Parameters: LocationCoordinate2D, FlyZoneInformation, FlyZoneCategory, FlyZoneShape

/**
* Location coordinate class
*/
data class LocationCoordinate2D(
val latitude: Double, // Latitude
val longitude: Double // Longitude
)

/**
* Fly zone information
*/
data class FlyZoneInformation(
/**
* Fly zone ID
*/
val flyZoneId: Long,
/**
* Fly zone name
*/
val name: String?,
/**
* Fly zone type
*/
val category: FlyZoneCategory,
/**
* Fly zone shape
*/
val shape: FlyZoneShape,
/**
* Fly zone lower limit in meters
*/
val lowerLimit: Double,
/**
* Fly zone upper limit in meters
*/
val upperLimit: Double,
/**
* Circle center coordinates
*/
val circleCenter: LocationCoordinate2D?,
/**
* Circle radius in meters
*/
val circleRadius: Double,
/**
* Polygon coordinates
*/
val polygonPoints: List<LocationCoordinate2D>? = null
)


/**
* Fly zone policy. Includes no-fly zones, authorized zones, warning zones, and enhanced warning zones.
*/
enum class FlyZoneCategory(val type: Int) {
UNKNOWN(-1),
/**
* Warning zone
*/
WARNING(0),
/**
* Authorization zone
*/
AUTHORIZATION(1),
/**
* No-fly zone
*/
RESTRICTED(2),

/**
* Enhanced warning zone
*/
ENHANCED_WARNING(3),
;
}

/**
* Fly zone shape type. Includes circular and polygonal.
*/
enum class FlyZoneShape(val type: Int) {
UNKNOWN(-1),

/**
* Circular
*/
CIRCLE(0),

/**
* Polygonal
*/
POLYGON(1),
;
}

method downloadAuthFlyZoneFromServer

fun downloadAuthFlyZoneFromServer(
aircraftSN: String,
token: String,
location: LocationCoordinate2D,
callback: CommonCallbacks.CompletionCallbackWithParam<List<FlyZoneAuthInformation>?>
)

Description: Retrieve specified aircraft authorization zone information from the server.

Input Parameters: aircraftSN Aircraft serial number

Input Parameters: token Token, obtained from the server during login, can be left blank if not available

Input Parameters: location Center location

Input Parameters: callback Result callback

Output Parameters: None

Related Parameters: LocationCoordinate2D, FlyZoneAuthInformation

/**
* Authorization zone information, currently only circular areas
*/
data class FlyZoneAuthInformation(
/**
* Unique identifier
*/
val id: String,
/**
* Aircraft serial number
*/
val aircraftSN: String,
/**
* Flyable area name
*/
val name: String,
/**
* Flyable area longitude
*/
val longitude: Double,
/**
* Flyable area latitude
*/
val latitude: Double,
/**
* Flyable area radius
*/
val radius: Float,
/**
* Flyable area height
*/
val height: Float,
/**
* Flyable area start timestamp in seconds
*/
val startTimeStamp: Long,
/**
* Flyable area end timestamp in seconds
*/
val endTimeStamp: Long,
)

method pushAuthFlyZoneToAircraft

fun pushAuthFlyZoneToAircraft(
drone: IAutelDroneDevice,
callback: CommonCallbacks.UpLoadFileCallbackWithProgress<Int>
)

Description: Upload authorization zone information to the aircraft's flight control. Note that the authorization zone information SN must match the aircraft SN, otherwise the upload will fail. Once uploaded successfully, the authorization zone becomes effective.

Input Parameters: drone Drone device

Input Parameters: callback Result callback

Output Parameters: None

Related Parameters: IAutelDroneDevice

method getAuthFlyZone

fun getAuthFlyZone(
aircraftSN: String,
callback: CommonCallbacks.CompletionCallbackWithParam<List<FlyZoneAuthInformation>?>
)

Description: Get authorization zone information

Input Parameters: aircraftSN Aircraft serial number

Input Parameters: callback Result callback

Output Parameters: None

Related Parameters: FlyZoneAuthInformation

method deleteAuthFlyZoneFromAircraft

fun deleteAuthFlyZoneFromAircraft(
drone: IAutelDroneDevice,
callback: CommonCallbacks.CompletionCallback
)

Description: Delete authorization zone information

Input Parameters: drone Drone device

Input Parameters: callback Result callback

Output Parameters: None

Related Parameters: IAutelDroneDevice

method importFlySafeDynamicDatabaseToMSDK

fun importFlySafeDynamicDatabaseToMSDK(
filePath: String,
callback: CommonCallbacks.CompletionCallbackWithParam<List<FlyZoneInformation>>
)

Description: Import the flight geofencing database into the MSDK. Currently, only EU geofencing data is supported. Geofencing data can be downloaded from the European Union Aviation Safety Agency website.

Input Parameters: filePath Data file path, the data file must be in JSON format and conform to the ED-269 standard.

Input Parameters: callback Result callback

Output Parameters: None

Related Parameters: FlyZoneInformation

method getFlySafeDynamicDataVersion

fun getFlySafeDynamicDataVersion(): String

Description: Get the version of the flight geofencing database. If not available, return empty.

Input Parameters: None

Output Parameters: Flight geofencing database version

Related Parameters: None

method pushFlySafeDynamicDatabaseToAircraft

fun pushFlySafeDynamicDatabaseToAircraft(
callback: CommonCallbacks.UpLoadFileCallbackWithProgress<Int>
)

Description: Upload the flight geofencing database to the aircraft's flight control. Once uploaded successfully, the geofence in the aircraft's flight control becomes effective.

Input Parameters: callback Result callback

Output Parameters: None

Related Parameters: None

method getAircraftFlyZoneCountryCode

fun getAircraftFlyZoneCountryCode(
aircraftSN: String,
callback: CommonCallbacks.CompletionCallbackWithParam<List<FlyableZoneInfo>>
)

Description: Get the country code of the flyable zone for the aircraft. The aircraft can only fly within the flyable zone.

Input Parameters: aircraftSN Aircraft serial number

Input Parameters: callback Result callback

Output Parameters: None

Related Parameters: FlyableZoneInfo

/**
* Flyable zone information
*/
data class FlyableZoneInfo(
val countryCode: String, // Country code
val startTimestamp: Long, // Start time
val endTimestamp: Long, // End time
val zoneType: Int, // Zone type
)

method refreshFlyZone

fun refreshFlyZone()

Description: Refresh the fly zone

Input Parameters: None

Output Parameters: None

Related Parameters: None

method getHotZoneCountryCode

fun getHotZoneCountryCode(callback: CommonCallbacks.CompletionCallbackWithParam<List<String>>)

Description: Get hot zones, where the aircraft is prohibited from flying

Input Parameters: callback Result callback

Output Parameters: None

Related Parameters: None

method isHotZoneCountry

fun isHotZoneCountry(countryCode: String): Boolean

Description: Determine if the current country of the aircraft is a hot zone

Input Parameters: countryCode Country code

Output Parameters: Whether it is a hot zone

Related Parameters: None

method addFlyZoneListener

fun addFlyZoneListener(callback: CommonCallbacks.CompletionCallbackWithParam<List<FlyZoneInformation>>)

Description: Add a fly zone listener

Input Parameters: callback Result callback

Output Parameters: None

Related Parameters: FlyZoneInformation

method removeFlyZoneListener

fun removeFlyZoneListener(callback: CommonCallbacks.CompletionCallbackWithParam<List<FlyZoneInformation>>)

Description: Remove a fly zone listener

Input Parameters: callback Result callback

Output Parameters: None

Related Parameters: None

method clearFlyZoneListener

fun clearFlyZoneListener()

Description: Clear fly zone listeners

Input Parameters: None

Output Parameters: None

Related Parameters: None