DJI Windows SDK Documentation

class FlyZoneHandler

sealed class FlyZoneHandler
Declaration:DJI.WindowsSDK.FlySafe
Description:

Fly Zone Handler gives information about nearby fly zones, and APIs to unlock zones that can be unlocked. Depending on location, there are three types of fly zones possible:

  • Circle: Cylinder or truncated cone volume with four levels of restriction:
    • Warning Zones : no restriction
    • Enhanced warning zones : Flight restricted, can be unlocked for flight when the user logs into their DJI account
    • Authorization zones : Flight restricted, can be unlocked for flight when the user logs into their DJI account and the account has been authorized to unlock authorization zones.
    • Restricted zones : Flight restricted

  • Polygon: Fly zone that consists of one or more sub fly zones that are cylinders or complex volumes with different height limitations. A height limitation of 0 means flight is completely restricted.
    Class Members:
    method GetFlyZonesInSurroundArea
    async Task<ResultValue<List<FlyZoneInformation>>> GetFlyZonesInSurroundArea()
    Declaration:DJI.WindowsSDK.FlySafe
    Description:

    Gets all the fly zones within 10 km of the aircraft.

    Return:
    async Task<ResultValue<List<FlyZoneInformation>>>Information of fly zones around the aircraft if the operation has no error. The information may be null when there is no fly zones around the aircraft.
    Unlock Fly Zones
    method
    method GetUnlockedFlyZonesForAircraft
    async Task<ResultValue<List<FlyZoneInformation>>> GetUnlockedFlyZonesForAircraft()
    Declaration:DJI.WindowsSDK.FlySafe
    Description:

    Gets a list of authorization fly zones unlocked by the account for the connected aircraft. It includes fly zones unlocked by the Flight Planner (http://www.dji.com/flysafe/geo-system#planner), and the ones unlocked during flight using DJI Go or any DJI Mobile/Windows SDK based application. This list does NOT include fly zones unlocked by custom unlocking.

    Return:
    async Task<ResultValue<List<FlyZoneInformation>>>Information of unlocked fly zones on the aircraft if the operation has no error. The information may be null when there is no unlocked fly zones on the aircraft.
    method UnlockFlyZones
    async Task<SDKError> UnlockFlyZones(List<uint> flyZoneIDs)
    Declaration:DJI.WindowsSDK.FlySafe
    Description:

    Unlocks the selected fly zones. This method can be used to unlock authorization zones. After unlocking the zones, flight will be unrestricted in those zones until the unlock expires. The unlocking record will be linked to the user's account and will be accessible to DJI Go and other DJI Mobile/Windows SDK based applications.
    Data Protection Notes - Calling this method will send the following protected data to DJI server:
    - User account information
    - The serial number of the connected aircraft.

    Input Parameters:
    List<uint> flyZoneIDsThe IDs of AuthorizedWarningZones.
    Return:
    async Task<SDKError>The operation error code.
    method SetUnlockingEnabled
    async Task<SDKError> SetUnlockingEnabled(FlyZoneInformation flyZone, bool enabled)
    Declaration:DJI.WindowsSDK.FlySafe
    Description:

    Set the enabled state to the selected authorization fly zone on the aircraft. This method can be used to set the enabled state for specific authorization fly zone currently on the aircraft. All authorization fly zones on the aircraft can be retrieved with GetUnlockedFlyZonesForAircraft.

    Input Parameters:
    FlyZoneInformation flyZoneThe fly zone of to enabled.
    bool enabledThe enabled state set to the authorization fly zone on the aircraft.
    Return:
    async Task<SDKError>The operation error code.
    method GetUnlockingEnabled
    async Task<ResultValue<bool>> GetUnlockingEnabled(FlyZoneInformation flyZone)
    Declaration:DJI.WindowsSDK.FlySafe
    Description:

    Get the enabled state of the selected authorization fly zone on the aircraft. All authorization fly zones on the aircraft can be retrieved with GetUnlockedFlyZonesForAircraft.

    Input Parameters:
    FlyZoneInformation flyZoneGet the enabled state of the selected authorization fly zone on the aircraft.
    Return:
    async Task<ResultValue<bool>>The enabled state of the selected authorization fly zone on the aircraft. If the selected authorization fly zone could not be found on the aircraft, an unknown error code of the operation will be returned.
    Custom Unlock Zones
    method
    method ReloadUnlockedZoneGroupsFromServer
    async Task<SDKError> ReloadUnlockedZoneGroupsFromServer()
    Declaration:DJI.WindowsSDK.FlySafe
    Description:

    Reloads the unlocked zone groups unlocked by the current user's account from the server. For all products this includes both self unlocked and custom unlocked zones. Each unlocked zone group corresponds to one aircraft serial number. After launch, SDK will call this method once. It will call this method again when either the network connection or the current account state changes (e.g. when a new user successfully logs in). Call this method any other time to trigger the reloading manually. Calling this method will NOT synchronize the loaded zone groups onto the aircraft. To get a list of groups currently loaded from the server, call GetLoadedUnlockedZoneGroups. User will need to manually call SyncUnlockedZoneGroupToAircraft to synchronize the unlocked group to the connected aircraft after the unlocked zone groups are reloaded.

    Return:
    async Task<SDKError>The operation error code.
    method GetCustomUnlockZonesFromAircraft
    async Task<ResultValue<List<CustomUnlockZone>>> GetCustomUnlockZonesFromAircraft()
    Declaration:DJI.WindowsSDK.FlySafe
    Description:

    Gets the Custom Unlock Zones currently on the aircraft.

    Return:
    async Task<ResultValue<List<CustomUnlockZone>>>Customs unlock zones on the aircraft. The result will be null when there is some error or there is no custom unlock zones on the aircraft.
    method EnableCustomUnlockZone
    async Task<SDKError> EnableCustomUnlockZone(CustomUnlockZone customUnlockZone)
    Declaration:DJI.WindowsSDK.FlySafe
    Description:

    Enables an Custom Unlock Zones that is on the aircraft. All Custom Unlock Zones on the aircraft can be retrieved with GetCustomUnlockZonesFromAircraft. At any time, only one Custom Unlock Zone can be enabled. Enabling an Custom Unlock Zone will disable the previously enabled zone.

    Input Parameters:
    CustomUnlockZone customUnlockZoneCustom Unlock Zone to enabled.
    Return:
    async Task<SDKError>The operation error code.
    method DisableCustomUnlockZone
    async Task<SDKError> DisableCustomUnlockZone()
    Declaration:DJI.WindowsSDK.FlySafe
    Description:

    Disables the custom unlock zone currently on the aircraft if there is. The currently enabled custom unlock zone can be retrieved with GetEnabledCustomUnlockZone.

    Return:
    async Task<SDKError>The operation error code.
    method GetEnabledCustomUnlockZone
    async Task<ResultValue<CustomUnlockZone>> GetEnabledCustomUnlockZone()
    Declaration:DJI.WindowsSDK.FlySafe
    Return:
    async Task<ResultValue<CustomUnlockZone>>The currently enabled custom unlock zone on the aircraft. The result will be null when this is some error or there is no enabled custom unlock zone on the aircraft.
    Unlocked Zone Groups
    method
    method GetLoadedUnlockedZoneGroups
    async Task<ResultValue<List<UnlockZoneGroup>>> GetLoadedUnlockedZoneGroups()
    Declaration:DJI.WindowsSDK.FlySafe
    Description:

    Gets the unlocked zone groups loaded from the server. Each zone group corresponds to one aircraft. The loaded zone groups will NOT be synchronized to the aircraft automatically. User need to manually invoke SyncUnlockedZoneGroupToAircraft to synchronize the unlocked zone group to the connected aircraft. Invoke ReloadUnlockedZoneGroupsFromServer to trigger the reloading of unlocked zone groups manually.

    Return:
    async Task<ResultValue<List<UnlockZoneGroup>>>Unlocked zone groups loaded from the server associated to the logged-in account. The result will be null when this is some error or there is no unlocked zone group associated to the logged-in account.
    method SyncUnlockedZoneGroupToAircraft
    async Task<SDKError> SyncUnlockedZoneGroupToAircraft(UnlockZoneGroup group)
    Declaration:DJI.WindowsSDK.FlySafe
    Description:

    Synchronizes the unlocked zone group to the connected aircraft. SDK will select the unlocked zone group that matches the serial number of the connected aircraft. After the unlocked zone group is synchronized to the aircraft successfully, the latest unlocked fly zones and the custom unlock zones on the aircraft can be checked by the follow methods:

    - Unlocked fly zones: GetUnlockedFlyZonesForAircraft
    - Custom unlock zones: GetCustomUnlockZonesFromAircraft

    Input Parameters:
    UnlockZoneGroup groupUnlocked zone group to synchronize.
    Return:
    async Task<SDKError>The operation error code.
    property
    property ProductIndex
    uint ProductIndex { get; }
    Declaration:DJI.WindowsSDK.FlySafe
    Description:

    The index of the product to which this component handler belongs. The default product index is 0.