diff --git a/DJIDebuger.xcodeproj/project.pbxproj b/DJIDebuger.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f1531fb --- /dev/null +++ b/DJIDebuger.xcodeproj/project.pbxproj @@ -0,0 +1,491 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 3B40CAD61BCCB89C00EF6E3D /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3B40CAD51BCCB89C00EF6E3D /* main.mm */; }; + 3B40CAD91BCCB89C00EF6E3D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B40CAD81BCCB89C00EF6E3D /* AppDelegate.m */; }; + 3B40CADC1BCCB89C00EF6E3D /* DJIDRootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B40CADB1BCCB89C00EF6E3D /* DJIDRootViewController.m */; }; + 3B40CADF1BCCB89C00EF6E3D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3B40CADD1BCCB89C00EF6E3D /* Main.storyboard */; }; + 3B40CAE11BCCB89C00EF6E3D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3B40CAE01BCCB89C00EF6E3D /* Assets.xcassets */; }; + 3B40CAE41BCCB89C00EF6E3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3B40CAE21BCCB89C00EF6E3D /* LaunchScreen.storyboard */; }; + 3B40CAEF1BCCB89C00EF6E3D /* DJIDebugerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B40CAEE1BCCB89C00EF6E3D /* DJIDebugerTests.m */; }; + F75E19E31C2AB5A50088846C /* DJISDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F75E19E11C2AB59F0088846C /* DJISDK.framework */; }; + F75E19E41C2AB5A50088846C /* DJISDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F75E19E11C2AB59F0088846C /* DJISDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 3B40CAEB1BCCB89C00EF6E3D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3B40CAC91BCCB89C00EF6E3D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3B40CAD01BCCB89C00EF6E3D; + remoteInfo = DJIDebuger; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + DE248D111BE7957200610DD6 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F75E19E41C2AB5A50088846C /* DJISDK.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 387EE3BD1BD222700002C877 /* DJIDebuger.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = DJIDebuger.entitlements; sourceTree = ""; }; + 3B40CAD11BCCB89C00EF6E3D /* DJIDebuger.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DJIDebuger.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B40CAD51BCCB89C00EF6E3D /* main.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = ""; }; + 3B40CAD71BCCB89C00EF6E3D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 3B40CAD81BCCB89C00EF6E3D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 3B40CADA1BCCB89C00EF6E3D /* DJIDRootViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DJIDRootViewController.h; sourceTree = ""; }; + 3B40CADB1BCCB89C00EF6E3D /* DJIDRootViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DJIDRootViewController.m; sourceTree = ""; }; + 3B40CADE1BCCB89C00EF6E3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 3B40CAE01BCCB89C00EF6E3D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 3B40CAE31BCCB89C00EF6E3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 3B40CAE51BCCB89C00EF6E3D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3B40CAEA1BCCB89C00EF6E3D /* DJIDebugerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DJIDebugerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B40CAEE1BCCB89C00EF6E3D /* DJIDebugerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DJIDebugerTests.m; sourceTree = ""; }; + 3B40CAF01BCCB89C00EF6E3D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F75E19E11C2AB59F0088846C /* DJISDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DJISDK.framework; path = ../DJISDK.framework; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3B40CACE1BCCB89C00EF6E3D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F75E19E31C2AB5A50088846C /* DJISDK.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3B40CAE71BCCB89C00EF6E3D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3B40CAC81BCCB89C00EF6E3D = { + isa = PBXGroup; + children = ( + 3B40CAD31BCCB89C00EF6E3D /* DJIDebuger */, + 3B40CAED1BCCB89C00EF6E3D /* DJIDebugerTests */, + 3B40CAD21BCCB89C00EF6E3D /* Products */, + ); + sourceTree = ""; + }; + 3B40CAD21BCCB89C00EF6E3D /* Products */ = { + isa = PBXGroup; + children = ( + 3B40CAD11BCCB89C00EF6E3D /* DJIDebuger.app */, + 3B40CAEA1BCCB89C00EF6E3D /* DJIDebugerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 3B40CAD31BCCB89C00EF6E3D /* DJIDebuger */ = { + isa = PBXGroup; + children = ( + 3B40CAD71BCCB89C00EF6E3D /* AppDelegate.h */, + 3B40CAD81BCCB89C00EF6E3D /* AppDelegate.m */, + 3B40CADA1BCCB89C00EF6E3D /* DJIDRootViewController.h */, + 3B40CADB1BCCB89C00EF6E3D /* DJIDRootViewController.m */, + 3B40CADD1BCCB89C00EF6E3D /* Main.storyboard */, + 3B40CAE01BCCB89C00EF6E3D /* Assets.xcassets */, + 3B40CAE21BCCB89C00EF6E3D /* LaunchScreen.storyboard */, + 3B40CAE51BCCB89C00EF6E3D /* Info.plist */, + 3B40CAFC1BCCE05600EF6E3D /* Frameworks */, + 3B40CAD41BCCB89C00EF6E3D /* Supporting Files */, + ); + path = DJIDebuger; + sourceTree = ""; + }; + 3B40CAD41BCCB89C00EF6E3D /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 387EE3BD1BD222700002C877 /* DJIDebuger.entitlements */, + 3B40CAD51BCCB89C00EF6E3D /* main.mm */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 3B40CAED1BCCB89C00EF6E3D /* DJIDebugerTests */ = { + isa = PBXGroup; + children = ( + 3B40CAEE1BCCB89C00EF6E3D /* DJIDebugerTests.m */, + 3B40CAF01BCCB89C00EF6E3D /* Info.plist */, + ); + path = DJIDebugerTests; + sourceTree = ""; + }; + 3B40CAFC1BCCE05600EF6E3D /* Frameworks */ = { + isa = PBXGroup; + children = ( + F75E19E11C2AB59F0088846C /* DJISDK.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 3B40CAD01BCCB89C00EF6E3D /* DJIDebuger */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3B40CAF31BCCB89C00EF6E3D /* Build configuration list for PBXNativeTarget "DJIDebuger" */; + buildPhases = ( + 3B40CACD1BCCB89C00EF6E3D /* Sources */, + 3B40CACE1BCCB89C00EF6E3D /* Frameworks */, + 3B40CACF1BCCB89C00EF6E3D /* Resources */, + DE248D111BE7957200610DD6 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = DJIDebuger; + productName = DJIDebuger; + productReference = 3B40CAD11BCCB89C00EF6E3D /* DJIDebuger.app */; + productType = "com.apple.product-type.application"; + }; + 3B40CAE91BCCB89C00EF6E3D /* DJIDebugerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3B40CAF61BCCB89C00EF6E3D /* Build configuration list for PBXNativeTarget "DJIDebugerTests" */; + buildPhases = ( + 3B40CAE61BCCB89C00EF6E3D /* Sources */, + 3B40CAE71BCCB89C00EF6E3D /* Frameworks */, + 3B40CAE81BCCB89C00EF6E3D /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 3B40CAEC1BCCB89C00EF6E3D /* PBXTargetDependency */, + ); + name = DJIDebugerTests; + productName = DJIDebugerTests; + productReference = 3B40CAEA1BCCB89C00EF6E3D /* DJIDebugerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 3B40CAC91BCCB89C00EF6E3D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0700; + ORGANIZATIONNAME = DJI; + TargetAttributes = { + 3B40CAD01BCCB89C00EF6E3D = { + CreatedOnToolsVersion = 7.0; + SystemCapabilities = { + com.apple.BackgroundModes = { + enabled = 1; + }; + com.apple.WAC = { + enabled = 0; + }; + }; + }; + 3B40CAE91BCCB89C00EF6E3D = { + CreatedOnToolsVersion = 7.0; + TestTargetID = 3B40CAD01BCCB89C00EF6E3D; + }; + }; + }; + buildConfigurationList = 3B40CACC1BCCB89C00EF6E3D /* Build configuration list for PBXProject "DJIDebuger" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 3B40CAC81BCCB89C00EF6E3D; + productRefGroup = 3B40CAD21BCCB89C00EF6E3D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 3B40CAD01BCCB89C00EF6E3D /* DJIDebuger */, + 3B40CAE91BCCB89C00EF6E3D /* DJIDebugerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 3B40CACF1BCCB89C00EF6E3D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3B40CAE41BCCB89C00EF6E3D /* LaunchScreen.storyboard in Resources */, + 3B40CAE11BCCB89C00EF6E3D /* Assets.xcassets in Resources */, + 3B40CADF1BCCB89C00EF6E3D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3B40CAE81BCCB89C00EF6E3D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 3B40CACD1BCCB89C00EF6E3D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3B40CADC1BCCB89C00EF6E3D /* DJIDRootViewController.m in Sources */, + 3B40CAD91BCCB89C00EF6E3D /* AppDelegate.m in Sources */, + 3B40CAD61BCCB89C00EF6E3D /* main.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3B40CAE61BCCB89C00EF6E3D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3B40CAEF1BCCB89C00EF6E3D /* DJIDebugerTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 3B40CAEC1BCCB89C00EF6E3D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3B40CAD01BCCB89C00EF6E3D /* DJIDebuger */; + targetProxy = 3B40CAEB1BCCB89C00EF6E3D /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 3B40CADD1BCCB89C00EF6E3D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 3B40CADE1BCCB89C00EF6E3D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 3B40CAE21BCCB89C00EF6E3D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 3B40CAE31BCCB89C00EF6E3D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 3B40CAF11BCCB89C00EF6E3D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 3B40CAF21BCCB89C00EF6E3D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 3B40CAF41BCCB89C00EF6E3D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)/../../../DJI-SDK3-I\"", + "\"$(SRCROOT)/../../DJI-MidWare-I/DJIMidware/DJIMidware\"/**", + "\"$(SRCROOT)/../../DJI-Logger-I/DJILogger\"/**", + ); + INFOPLIST_FILE = DJIDebuger/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = DJI.DJIDebuger; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; + }; + name = Debug; + }; + 3B40CAF51BCCB89C00EF6E3D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)/../../../DJI-SDK3-I\"", + "\"$(SRCROOT)/../../DJI-MidWare-I/DJIMidware/DJIMidware\"/**", + "\"$(SRCROOT)/../../DJI-Logger-I/DJILogger\"/**", + ); + INFOPLIST_FILE = DJIDebuger/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = DJI.DJIDebuger; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; + }; + name = Release; + }; + 3B40CAF71BCCB89C00EF6E3D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = DJIDebugerTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = DJI.DJIDebugerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DJIDebuger.app/DJIDebuger"; + }; + name = Debug; + }; + 3B40CAF81BCCB89C00EF6E3D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = DJIDebugerTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = DJI.DJIDebugerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DJIDebuger.app/DJIDebuger"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3B40CACC1BCCB89C00EF6E3D /* Build configuration list for PBXProject "DJIDebuger" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3B40CAF11BCCB89C00EF6E3D /* Debug */, + 3B40CAF21BCCB89C00EF6E3D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3B40CAF31BCCB89C00EF6E3D /* Build configuration list for PBXNativeTarget "DJIDebuger" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3B40CAF41BCCB89C00EF6E3D /* Debug */, + 3B40CAF51BCCB89C00EF6E3D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3B40CAF61BCCB89C00EF6E3D /* Build configuration list for PBXNativeTarget "DJIDebugerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3B40CAF71BCCB89C00EF6E3D /* Debug */, + 3B40CAF81BCCB89C00EF6E3D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 3B40CAC91BCCB89C00EF6E3D /* Project object */; +} diff --git a/DJIDebuger.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/DJIDebuger.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..7fd4b6a --- /dev/null +++ b/DJIDebuger.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/DJIDebuger.xcodeproj/project.xcworkspace/xcshareddata/DJIDebuger.xcscmblueprint b/DJIDebuger.xcodeproj/project.xcworkspace/xcshareddata/DJIDebuger.xcscmblueprint new file mode 100644 index 0000000..71f5703 --- /dev/null +++ b/DJIDebuger.xcodeproj/project.xcworkspace/xcshareddata/DJIDebuger.xcscmblueprint @@ -0,0 +1,37 @@ +{ + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "2D40537C1A47C4A4FB2A287A6D90813A26E2BC2C", + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { + + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { + "93F0A401E49107C99959E6952ABAF47F85C46FE9" : 0, + "2D40537C1A47C4A4FB2A287A6D90813A26E2BC2C" : 0, + "FF0D3C4C22A075989D4F328A65F089073E4A775B" : 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "6C55A934-35C2-4976-A5CF-2A938671FE1B", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { + "93F0A401E49107C99959E6952ABAF47F85C46FE9" : "ios-remotelogger\/", + "2D40537C1A47C4A4FB2A287A6D90813A26E2BC2C" : "ios-bridge\/", + "FF0D3C4C22A075989D4F328A65F089073E4A775B" : "DJI-MidWare-I\/" + }, + "DVTSourceControlWorkspaceBlueprintNameKey" : "DJIDebuger", + "DVTSourceControlWorkspaceBlueprintVersion" : 204, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "DJIDebuger\/DJIDebuger.xcodeproj", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "ssh:\/\/us003.fly-access.com:7999\/msdk\/ios-bridge.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "2D40537C1A47C4A4FB2A287A6D90813A26E2BC2C" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "ssh:\/\/us003.fly-access.com:7999\/msdk\/ios-remotelogger.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "93F0A401E49107C99959E6952ABAF47F85C46FE9" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "djigit11-rd.dji.com:iOS\/DJI-MidWare-I.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "FF0D3C4C22A075989D4F328A65F089073E4A775B" + } + ] +} \ No newline at end of file diff --git a/DJIDebuger.xcodeproj/project.xcworkspace/xcuserdata/zlinoliver.xcuserdatad/UserInterfaceState.xcuserstate b/DJIDebuger.xcodeproj/project.xcworkspace/xcuserdata/zlinoliver.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..5394203 Binary files /dev/null and b/DJIDebuger.xcodeproj/project.xcworkspace/xcuserdata/zlinoliver.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/DJIDebuger.xcodeproj/xcshareddata/xcschemes/DJIDebuger.xcscheme b/DJIDebuger.xcodeproj/xcshareddata/xcschemes/DJIDebuger.xcscheme new file mode 100644 index 0000000..9b41ac9 --- /dev/null +++ b/DJIDebuger.xcodeproj/xcshareddata/xcschemes/DJIDebuger.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DJIDebuger.xcodeproj/xcuserdata/ares.xcuserdatad/xcschemes/DJIDebuger.xcscheme b/DJIDebuger.xcodeproj/xcuserdata/ares.xcuserdatad/xcschemes/DJIDebuger.xcscheme new file mode 100644 index 0000000..9b41ac9 --- /dev/null +++ b/DJIDebuger.xcodeproj/xcuserdata/ares.xcuserdatad/xcschemes/DJIDebuger.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DJIDebuger.xcodeproj/xcuserdata/ares.xcuserdatad/xcschemes/xcschememanagement.plist b/DJIDebuger.xcodeproj/xcuserdata/ares.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..a9b1b97 --- /dev/null +++ b/DJIDebuger.xcodeproj/xcuserdata/ares.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + DJIDebuger.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 3B40CAD01BCCB89C00EF6E3D + + primary + + + 3B40CAE91BCCB89C00EF6E3D + + primary + + + + + diff --git a/DJIDebuger.xcodeproj/xcuserdata/zlinoliver.xcuserdatad/xcschemes/xcschememanagement.plist b/DJIDebuger.xcodeproj/xcuserdata/zlinoliver.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..e9aa7d3 --- /dev/null +++ b/DJIDebuger.xcodeproj/xcuserdata/zlinoliver.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,19 @@ + + + + + SuppressBuildableAutocreation + + 3B40CAD01BCCB89C00EF6E3D + + primary + + + 3B40CAE91BCCB89C00EF6E3D + + primary + + + + + diff --git a/DJIDebuger/AppDelegate.h b/DJIDebuger/AppDelegate.h new file mode 100644 index 0000000..9c8657b --- /dev/null +++ b/DJIDebuger/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// DJIDebuger +// +// Created by DJI on 15/10/13. +// Copyright © 2015年 DJI. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/DJIDebuger/AppDelegate.m b/DJIDebuger/AppDelegate.m new file mode 100644 index 0000000..e1bcf95 --- /dev/null +++ b/DJIDebuger/AppDelegate.m @@ -0,0 +1,44 @@ +// +// AppDelegate.m +// DJIDebuger +// +// Created by DJI on 15/10/13. +// Copyright © 2015年 DJI. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + +@end diff --git a/DJIDebuger/Assets.xcassets/AppIcon.appiconset/Contents.json b/DJIDebuger/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..c8ac72f --- /dev/null +++ b/DJIDebuger/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,77 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-60@3x.png", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-76@2x.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DJIDebuger/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png b/DJIDebuger/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png new file mode 100644 index 0000000..bc8648d Binary files /dev/null and b/DJIDebuger/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png differ diff --git a/DJIDebuger/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png b/DJIDebuger/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png new file mode 100644 index 0000000..5894155 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png differ diff --git a/DJIDebuger/Assets.xcassets/AppIcon.appiconset/Icon-76.png b/DJIDebuger/Assets.xcassets/AppIcon.appiconset/Icon-76.png new file mode 100644 index 0000000..b79d672 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/AppIcon.appiconset/Icon-76.png differ diff --git a/DJIDebuger/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png b/DJIDebuger/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png new file mode 100644 index 0000000..c9481c1 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png differ diff --git a/DJIDebuger/Assets.xcassets/Contents.json b/DJIDebuger/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/DJIDebuger/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DJIDebuger/Assets.xcassets/icon_circle_green_1.imageset/Contents.json b/DJIDebuger/Assets.xcassets/icon_circle_green_1.imageset/Contents.json new file mode 100644 index 0000000..fd3f611 --- /dev/null +++ b/DJIDebuger/Assets.xcassets/icon_circle_green_1.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon_circle_green_1.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "icon_circle_green_1@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "icon_circle_green_1@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DJIDebuger/Assets.xcassets/icon_circle_green_1.imageset/icon_circle_green_1.png b/DJIDebuger/Assets.xcassets/icon_circle_green_1.imageset/icon_circle_green_1.png new file mode 100644 index 0000000..4fed592 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_circle_green_1.imageset/icon_circle_green_1.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_circle_green_1.imageset/icon_circle_green_1@2x.png b/DJIDebuger/Assets.xcassets/icon_circle_green_1.imageset/icon_circle_green_1@2x.png new file mode 100644 index 0000000..2761029 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_circle_green_1.imageset/icon_circle_green_1@2x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_circle_green_1.imageset/icon_circle_green_1@3x.png b/DJIDebuger/Assets.xcassets/icon_circle_green_1.imageset/icon_circle_green_1@3x.png new file mode 100644 index 0000000..b46d2e9 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_circle_green_1.imageset/icon_circle_green_1@3x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_circle_green_2.imageset/Contents.json b/DJIDebuger/Assets.xcassets/icon_circle_green_2.imageset/Contents.json new file mode 100644 index 0000000..1ae4df6 --- /dev/null +++ b/DJIDebuger/Assets.xcassets/icon_circle_green_2.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon_circle_green_2.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "icon_circle_green_2@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "icon_circle_green_2@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DJIDebuger/Assets.xcassets/icon_circle_green_2.imageset/icon_circle_green_2.png b/DJIDebuger/Assets.xcassets/icon_circle_green_2.imageset/icon_circle_green_2.png new file mode 100644 index 0000000..5c68cf7 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_circle_green_2.imageset/icon_circle_green_2.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_circle_green_2.imageset/icon_circle_green_2@2x.png b/DJIDebuger/Assets.xcassets/icon_circle_green_2.imageset/icon_circle_green_2@2x.png new file mode 100644 index 0000000..57e9401 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_circle_green_2.imageset/icon_circle_green_2@2x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_circle_green_2.imageset/icon_circle_green_2@3x.png b/DJIDebuger/Assets.xcassets/icon_circle_green_2.imageset/icon_circle_green_2@3x.png new file mode 100644 index 0000000..8ea83eb Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_circle_green_2.imageset/icon_circle_green_2@3x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_circle_red_1.imageset/Contents.json b/DJIDebuger/Assets.xcassets/icon_circle_red_1.imageset/Contents.json new file mode 100644 index 0000000..246dbad --- /dev/null +++ b/DJIDebuger/Assets.xcassets/icon_circle_red_1.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon_circle_red_1.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "icon_circle_red_1@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "icon_circle_red_1@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DJIDebuger/Assets.xcassets/icon_circle_red_1.imageset/icon_circle_red_1.png b/DJIDebuger/Assets.xcassets/icon_circle_red_1.imageset/icon_circle_red_1.png new file mode 100644 index 0000000..76d69a0 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_circle_red_1.imageset/icon_circle_red_1.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_circle_red_1.imageset/icon_circle_red_1@2x.png b/DJIDebuger/Assets.xcassets/icon_circle_red_1.imageset/icon_circle_red_1@2x.png new file mode 100644 index 0000000..ab3b4d0 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_circle_red_1.imageset/icon_circle_red_1@2x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_circle_red_1.imageset/icon_circle_red_1@3x.png b/DJIDebuger/Assets.xcassets/icon_circle_red_1.imageset/icon_circle_red_1@3x.png new file mode 100644 index 0000000..928eef0 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_circle_red_1.imageset/icon_circle_red_1@3x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_circle_red_2.imageset/Contents.json b/DJIDebuger/Assets.xcassets/icon_circle_red_2.imageset/Contents.json new file mode 100644 index 0000000..5de9d98 --- /dev/null +++ b/DJIDebuger/Assets.xcassets/icon_circle_red_2.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon_circle_red_2.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "icon_circle_red_2@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "icon_circle_red_2@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DJIDebuger/Assets.xcassets/icon_circle_red_2.imageset/icon_circle_red_2.png b/DJIDebuger/Assets.xcassets/icon_circle_red_2.imageset/icon_circle_red_2.png new file mode 100644 index 0000000..f2b84d4 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_circle_red_2.imageset/icon_circle_red_2.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_circle_red_2.imageset/icon_circle_red_2@2x.png b/DJIDebuger/Assets.xcassets/icon_circle_red_2.imageset/icon_circle_red_2@2x.png new file mode 100644 index 0000000..7d8204e Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_circle_red_2.imageset/icon_circle_red_2@2x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_circle_red_2.imageset/icon_circle_red_2@3x.png b/DJIDebuger/Assets.xcassets/icon_circle_red_2.imageset/icon_circle_red_2@3x.png new file mode 100644 index 0000000..897086b Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_circle_red_2.imageset/icon_circle_red_2@3x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_dji.imageset/Contents.json b/DJIDebuger/Assets.xcassets/icon_dji.imageset/Contents.json new file mode 100644 index 0000000..b63fd10 --- /dev/null +++ b/DJIDebuger/Assets.xcassets/icon_dji.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon_dji.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "icon_dji@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "icon_dji@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DJIDebuger/Assets.xcassets/icon_dji.imageset/icon_dji.png b/DJIDebuger/Assets.xcassets/icon_dji.imageset/icon_dji.png new file mode 100644 index 0000000..e5639b0 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_dji.imageset/icon_dji.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_dji.imageset/icon_dji@2x.png b/DJIDebuger/Assets.xcassets/icon_dji.imageset/icon_dji@2x.png new file mode 100644 index 0000000..a39e9c9 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_dji.imageset/icon_dji@2x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_dji.imageset/icon_dji@3x.png b/DJIDebuger/Assets.xcassets/icon_dji.imageset/icon_dji@3x.png new file mode 100644 index 0000000..4322b81 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_dji.imageset/icon_dji@3x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_navigation_bar.imageset/Contents.json b/DJIDebuger/Assets.xcassets/icon_navigation_bar.imageset/Contents.json new file mode 100644 index 0000000..15f169b --- /dev/null +++ b/DJIDebuger/Assets.xcassets/icon_navigation_bar.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon_navigation_bar.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "icon_navgation_bar@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "icon_navigation_bar@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DJIDebuger/Assets.xcassets/icon_navigation_bar.imageset/icon_navgation_bar@2x.png b/DJIDebuger/Assets.xcassets/icon_navigation_bar.imageset/icon_navgation_bar@2x.png new file mode 100644 index 0000000..c975ef6 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_navigation_bar.imageset/icon_navgation_bar@2x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_navigation_bar.imageset/icon_navigation_bar.png b/DJIDebuger/Assets.xcassets/icon_navigation_bar.imageset/icon_navigation_bar.png new file mode 100644 index 0000000..2931fc0 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_navigation_bar.imageset/icon_navigation_bar.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_navigation_bar.imageset/icon_navigation_bar@3x.png b/DJIDebuger/Assets.xcassets/icon_navigation_bar.imageset/icon_navigation_bar@3x.png new file mode 100644 index 0000000..f728b25 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_navigation_bar.imageset/icon_navigation_bar@3x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_rc.imageset/Contents.json b/DJIDebuger/Assets.xcassets/icon_rc.imageset/Contents.json new file mode 100644 index 0000000..b64d34c --- /dev/null +++ b/DJIDebuger/Assets.xcassets/icon_rc.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon_rc.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "icon_rc@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "icon_rc@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DJIDebuger/Assets.xcassets/icon_rc.imageset/icon_rc.png b/DJIDebuger/Assets.xcassets/icon_rc.imageset/icon_rc.png new file mode 100644 index 0000000..e673f50 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_rc.imageset/icon_rc.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_rc.imageset/icon_rc@2x.png b/DJIDebuger/Assets.xcassets/icon_rc.imageset/icon_rc@2x.png new file mode 100644 index 0000000..28b217c Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_rc.imageset/icon_rc@2x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_rc.imageset/icon_rc@3x.png b/DJIDebuger/Assets.xcassets/icon_rc.imageset/icon_rc@3x.png new file mode 100644 index 0000000..ca5415a Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_rc.imageset/icon_rc@3x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_rect.imageset/Contents.json b/DJIDebuger/Assets.xcassets/icon_rect.imageset/Contents.json new file mode 100644 index 0000000..332acc6 --- /dev/null +++ b/DJIDebuger/Assets.xcassets/icon_rect.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon_rect.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "icon_rect@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "icon_rect@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DJIDebuger/Assets.xcassets/icon_rect.imageset/icon_rect.png b/DJIDebuger/Assets.xcassets/icon_rect.imageset/icon_rect.png new file mode 100644 index 0000000..12c2500 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_rect.imageset/icon_rect.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_rect.imageset/icon_rect@2x.png b/DJIDebuger/Assets.xcassets/icon_rect.imageset/icon_rect@2x.png new file mode 100644 index 0000000..40e5b2e Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_rect.imageset/icon_rect@2x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_rect.imageset/icon_rect@3x.png b/DJIDebuger/Assets.xcassets/icon_rect.imageset/icon_rect@3x.png new file mode 100644 index 0000000..2633014 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_rect.imageset/icon_rect@3x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_tab_bkgnd.imageset/Contents.json b/DJIDebuger/Assets.xcassets/icon_tab_bkgnd.imageset/Contents.json new file mode 100644 index 0000000..8843cfc --- /dev/null +++ b/DJIDebuger/Assets.xcassets/icon_tab_bkgnd.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon_tab_bkgnd.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "icon_tab_bkgnd@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "icon_tab_bkgnd@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DJIDebuger/Assets.xcassets/icon_tab_bkgnd.imageset/icon_tab_bkgnd.png b/DJIDebuger/Assets.xcassets/icon_tab_bkgnd.imageset/icon_tab_bkgnd.png new file mode 100644 index 0000000..2cbd4c3 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_tab_bkgnd.imageset/icon_tab_bkgnd.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_tab_bkgnd.imageset/icon_tab_bkgnd@2x.png b/DJIDebuger/Assets.xcassets/icon_tab_bkgnd.imageset/icon_tab_bkgnd@2x.png new file mode 100644 index 0000000..e15829c Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_tab_bkgnd.imageset/icon_tab_bkgnd@2x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_tab_bkgnd.imageset/icon_tab_bkgnd@3x.png b/DJIDebuger/Assets.xcassets/icon_tab_bkgnd.imageset/icon_tab_bkgnd@3x.png new file mode 100644 index 0000000..35210c4 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_tab_bkgnd.imageset/icon_tab_bkgnd@3x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_tab_left.imageset/Contents.json b/DJIDebuger/Assets.xcassets/icon_tab_left.imageset/Contents.json new file mode 100644 index 0000000..38aac74 --- /dev/null +++ b/DJIDebuger/Assets.xcassets/icon_tab_left.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon_tab_left-1.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "icon_tab_left@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "icon_tab_left@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DJIDebuger/Assets.xcassets/icon_tab_left.imageset/icon_tab_left-1.png b/DJIDebuger/Assets.xcassets/icon_tab_left.imageset/icon_tab_left-1.png new file mode 100644 index 0000000..d607300 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_tab_left.imageset/icon_tab_left-1.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_tab_left.imageset/icon_tab_left@2x.png b/DJIDebuger/Assets.xcassets/icon_tab_left.imageset/icon_tab_left@2x.png new file mode 100644 index 0000000..1e83795 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_tab_left.imageset/icon_tab_left@2x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_tab_left.imageset/icon_tab_left@3x.png b/DJIDebuger/Assets.xcassets/icon_tab_left.imageset/icon_tab_left@3x.png new file mode 100644 index 0000000..871b78f Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_tab_left.imageset/icon_tab_left@3x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_tab_right.imageset/Contents.json b/DJIDebuger/Assets.xcassets/icon_tab_right.imageset/Contents.json new file mode 100644 index 0000000..968f335 --- /dev/null +++ b/DJIDebuger/Assets.xcassets/icon_tab_right.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon_tab_right.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "icon_tab_right@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "icon_tab_right@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DJIDebuger/Assets.xcassets/icon_tab_right.imageset/icon_tab_right.png b/DJIDebuger/Assets.xcassets/icon_tab_right.imageset/icon_tab_right.png new file mode 100644 index 0000000..85d92ce Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_tab_right.imageset/icon_tab_right.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_tab_right.imageset/icon_tab_right@2x.png b/DJIDebuger/Assets.xcassets/icon_tab_right.imageset/icon_tab_right@2x.png new file mode 100644 index 0000000..8ef9b4c Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_tab_right.imageset/icon_tab_right@2x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_tab_right.imageset/icon_tab_right@3x.png b/DJIDebuger/Assets.xcassets/icon_tab_right.imageset/icon_tab_right@3x.png new file mode 100644 index 0000000..3ad91eb Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_tab_right.imageset/icon_tab_right@3x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_wifi.imageset/Contents.json b/DJIDebuger/Assets.xcassets/icon_wifi.imageset/Contents.json new file mode 100644 index 0000000..e9f8a0f --- /dev/null +++ b/DJIDebuger/Assets.xcassets/icon_wifi.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "icon_wifi.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "icon_wifi@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "icon_wifi@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DJIDebuger/Assets.xcassets/icon_wifi.imageset/icon_wifi.png b/DJIDebuger/Assets.xcassets/icon_wifi.imageset/icon_wifi.png new file mode 100644 index 0000000..1dcce49 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_wifi.imageset/icon_wifi.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_wifi.imageset/icon_wifi@2x.png b/DJIDebuger/Assets.xcassets/icon_wifi.imageset/icon_wifi@2x.png new file mode 100644 index 0000000..6f88936 Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_wifi.imageset/icon_wifi@2x.png differ diff --git a/DJIDebuger/Assets.xcassets/icon_wifi.imageset/icon_wifi@3x.png b/DJIDebuger/Assets.xcassets/icon_wifi.imageset/icon_wifi@3x.png new file mode 100644 index 0000000..72faa4a Binary files /dev/null and b/DJIDebuger/Assets.xcassets/icon_wifi.imageset/icon_wifi@3x.png differ diff --git a/DJIDebuger/Base.lproj/LaunchScreen.storyboard b/DJIDebuger/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..78686cd --- /dev/null +++ b/DJIDebuger/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DJIDebuger/Base.lproj/Main.storyboard b/DJIDebuger/Base.lproj/Main.storyboard new file mode 100644 index 0000000..1be23af --- /dev/null +++ b/DJIDebuger/Base.lproj/Main.storyboard @@ -0,0 +1,238 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DJIDebuger/DJIDRootViewController.h b/DJIDebuger/DJIDRootViewController.h new file mode 100644 index 0000000..3373e5a --- /dev/null +++ b/DJIDebuger/DJIDRootViewController.h @@ -0,0 +1,14 @@ +// +// DJIDRootViewController.h +// DJIDebuger +// +// Created by DJI on 15/10/13. +// Copyright © 2015年 DJI. All rights reserved. +// + +#import + +@interface DJIDRootViewController : UIViewController + +@end + diff --git a/DJIDebuger/DJIDRootViewController.m b/DJIDebuger/DJIDRootViewController.m new file mode 100644 index 0000000..2604a74 --- /dev/null +++ b/DJIDebuger/DJIDRootViewController.m @@ -0,0 +1,151 @@ +// +// DJIDRootViewController.m +// DJIDebuger +// +// Created by DJI on 15/10/13. +// Copyright © 2015年 DJI. All rights reserved. +// + +#import "DJIDRootViewController.h" +#import +#include +#include +#include + +#define weakSelf(__TARGET__) __weak typeof(self) __TARGET__=self +#define weakReturn(__TARGET__) if(__TARGET__==nil)return; + +#define DJI_SERVICE_OPTION_KEY @"DJI_SERVICE_OPTION_KEY" +#define DJI_DEBUG_ID_NAME_KEY @"DJI_DEBUG_ID_NAME_KEY" + +#define GREEN_IMAGE_1 [UIImage imageNamed:@"icon_circle_green_1"] +#define GREEN_IMAGE_2 [UIImage imageNamed:@"icon_circle_green_2"] +#define RED_IMAGE_1 [UIImage imageNamed:@"icon_circle_red_1"] +#define RED_IMAGE_2 [UIImage imageNamed:@"icon_circle_red_2"] + +@interface DJIDRootViewController () + +@property (assign,nonatomic) pthread_mutex_t serviceMutex; + +// UI +@property (weak,nonatomic) IBOutlet UILabel* debugIdLabel; +@property (weak,nonatomic) IBOutlet UILabel* debugTitleLabel; + +@property (weak,nonatomic) IBOutlet UIImageView* rcImageView1; +@property (weak,nonatomic) IBOutlet UIImageView* rcImageView2; + +@property (weak,nonatomic) IBOutlet UIImageView* wifiImageView1; +@property (weak,nonatomic) IBOutlet UIImageView* wifiImageView2; + +@end + +@implementation DJIDRootViewController + +- (void) updateIPAddress:(NSString*) ipaddress { + weakSelf(target); + dispatch_async(dispatch_get_main_queue(), ^{ + weakReturn(target); + target.debugIdLabel.text = ipaddress; + }); +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + pthread_mutex_init(&_serviceMutex, NULL); + + [self initUI]; + + weakSelf(target); + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + weakReturn(target); + [DJISDKManager startSDKDebugServerWithCompletion:^(NSString* ipaddress){ + [target updateIPAddress:ipaddress]; + }]; + [DJISDKManager setDebugServerDelegate:target]; + }); +} + +- (UIStatusBarStyle) preferredStatusBarStyle { + return UIStatusBarStyleLightContent; +} + +-(void) dealloc +{ + pthread_mutex_destroy(&_serviceMutex); +} + +-(void) viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + [UIApplication sharedApplication].idleTimerDisabled = YES; +} + +-(void) viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + [UIApplication sharedApplication].idleTimerDisabled = NO; +} + +-(void) initUI +{ + [self setWiFiConnectionStatus:NO]; + [self setRCConnectionStatus:NO]; + + self.debugIdLabel.text = @""; + +} + +-(void) setRCConnectionStatus:(BOOL)connected +{ + if (connected) { + self.rcImageView1.image = GREEN_IMAGE_1; + self.rcImageView2.image = GREEN_IMAGE_2; + } + else + { + self.rcImageView1.image = RED_IMAGE_1; + self.rcImageView2.image = RED_IMAGE_2; + } +} + +-(void) setWiFiConnectionStatus:(BOOL)connected +{ + if (connected) { + self.wifiImageView1.image = GREEN_IMAGE_1; + self.wifiImageView2.image = GREEN_IMAGE_2; + } + else + { + self.wifiImageView1.image = RED_IMAGE_1; + self.wifiImageView2.image = RED_IMAGE_2; + } +} + +#pragma mark - UI Action + +-(IBAction) onResetButtonClicked:(id)sender +{ + [self setWiFiConnectionStatus:NO]; + weakSelf(target); + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + weakReturn(target); + [DJISDKManager setDebugServerDelegate:target]; + [DJISDKManager startSDKDebugServerWithCompletion:^(NSString * ipaddress){ + [target updateIPAddress:ipaddress]; + }]; + }); +} + +-(void) sdkDebugServerWithRCConnectionStatus:(BOOL)isRCConnected andDebugClientConnectionStatus:(BOOL)isWifiConnected{ + + weakSelf(target); + dispatch_async(dispatch_get_main_queue(), ^{ + weakReturn(target); + [target setRCConnectionStatus:isRCConnected]; + [target setWiFiConnectionStatus:isWifiConnected]; + }); + +} + +@end diff --git a/DJIDebuger/DJIDebuger.entitlements b/DJIDebuger/DJIDebuger.entitlements new file mode 100644 index 0000000..c9a86ce --- /dev/null +++ b/DJIDebuger/DJIDebuger.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.external-accessory.wireless-configuration + + + diff --git a/DJIDebuger/Info.plist b/DJIDebuger/Info.plist new file mode 100644 index 0000000..d121f71 --- /dev/null +++ b/DJIDebuger/Info.plist @@ -0,0 +1,68 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + DJI Bridge + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIcons + + CFBundleIcons~ipad + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.1 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + UIBackgroundModes + + external-accessory + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedExternalAccessoryProtocols + + com.dji.video + com.dji.protocol + com.dji.common + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/DJIDebuger/main.mm b/DJIDebuger/main.mm new file mode 100644 index 0000000..7085e67 --- /dev/null +++ b/DJIDebuger/main.mm @@ -0,0 +1,16 @@ +// +// main.m +// DJIDebuger +// +// Created by DJI on 15/10/13. +// Copyright © 2015年 DJI. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/DJIDebugerTests/DJIDebugerTests.m b/DJIDebugerTests/DJIDebugerTests.m new file mode 100644 index 0000000..b49c119 --- /dev/null +++ b/DJIDebugerTests/DJIDebugerTests.m @@ -0,0 +1,39 @@ +// +// DJIDebugerTests.m +// DJIDebugerTests +// +// Created by DJI on 15/10/13. +// Copyright © 2015年 DJI. All rights reserved. +// + +#import + +@interface DJIDebugerTests : XCTestCase + +@end + +@implementation DJIDebugerTests + +- (void)setUp { + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. +} + +- (void)testPerformanceExample { + // This is an example of a performance test case. + [self measureBlock:^{ + // Put the code you want to measure the time of here. + }]; +} + +@end diff --git a/DJIDebugerTests/Info.plist b/DJIDebugerTests/Info.plist new file mode 100644 index 0000000..ba72822 --- /dev/null +++ b/DJIDebugerTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/DJISDK.framework/DJISDK b/DJISDK.framework/DJISDK new file mode 100755 index 0000000..8c30b51 Binary files /dev/null and b/DJISDK.framework/DJISDK differ diff --git a/DJISDK.framework/Headers/DJIAirLink.h b/DJISDK.framework/Headers/DJIAirLink.h new file mode 100644 index 0000000..d05ed06 --- /dev/null +++ b/DJISDK.framework/Headers/DJIAirLink.h @@ -0,0 +1,44 @@ +// +// DJIAirLink.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +@class DJIWiFiLink; +@class DJILBAirLink; + +/** + * This class contains DJI WiFi and DJI Lightbridge components, you can check if the current device supports WiFi and + * Lightbridge features by accessing the following two BOOL variables. + */ +@interface DJIAirLink : DJIBaseComponent + +/** + * YES if WiFi Link is supported + * + */ +@property (nonatomic, readonly) BOOL isWifiLinkSupported; + +/** + * YES if LB Air Link is supported + * + */ +@property (nonatomic, readonly) BOOL isLBAirLinkSupported; + +/** + * Returns WiFiLink if it's available + * + */ +@property (nonatomic, strong) DJIWiFiLink *wifiLink; + +/** + * Returns Lightbridge Link if it's available + * + */ +@property (nonatomic, strong) DJILBAirLink *lbAirLink; + +@end diff --git a/DJISDK.framework/Headers/DJIAircraft.h b/DJISDK.framework/Headers/DJIAircraft.h new file mode 100755 index 0000000..c2e0c4d --- /dev/null +++ b/DJISDK.framework/Headers/DJIAircraft.h @@ -0,0 +1,85 @@ +// +// DJIAircraft.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +@class DJIFlightController; +@class DJIGimbal; +@class DJIBattery; +@class DJIRemoteController; +@class DJICamera; +@class DJIAirLink; +@protocol DJIAircraftDelegate; + +NS_ASSUME_NONNULL_BEGIN + +/** + * + * This class contains the components of an aircraft. + */ +@interface DJIAircraft : DJIBaseProduct + +/** + * Returns an instance of the aircraft's camera. + * + * @see DJICamera + */ +@property(nonatomic, readonly) DJICamera *_Nullable camera; + +/** + * Returns an instance of the aircraft's flight controller. + * + * @see DJIFlightController + */ +@property(nonatomic, readonly) DJIFlightController *_Nullable flightController; + +/** + * Returns an instance of the aircraft's gimbal. + * + * @see DJIGimbal + */ +@property(nonatomic, readonly) DJIGimbal *_Nullable gimbal; + +/** + * Returns an instance of the aircraft's smart battery. + * + * @see DJIBattery + */ +@property(nonatomic, readonly) DJIBattery *_Nullable battery; + +/** + * Returns an instance of the aircraft's remote controller. + * + * @see DJIRemoteController + */ +@property(nonatomic, readonly) DJIRemoteController *_Nullable remoteController; + +/** + * Returns an instance of the aircraft's airLink. + * + * @see DJIAirLink + */ +@property(nonatomic, readonly) DJIAirLink *_Nullable airLink; + +/** + * Sets the aircraft's name. The aircraft's name should be less than 32 characters. + * + * @param name Name to be set to the aircraft. + * @param completion Completion block + */ +- (void)setAircraftName:(NSString *)name withCompletion:(DJICompletionBlock)completion; + +/** + * Returns the aircraft's name. + * + * @param completion Remote execution result callback block. + */ +- (void)getAircraftNameWithCompletion:(void (^)(NSString *name, NSError *_Nullable error))completion; + +@end +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIBaseComponent.h b/DJISDK.framework/Headers/DJIBaseComponent.h new file mode 100644 index 0000000..c634ff3 --- /dev/null +++ b/DJISDK.framework/Headers/DJIBaseComponent.h @@ -0,0 +1,72 @@ +// +// DJIBaseComponent.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN +@class DJIBaseComponent; +@class DJIBaseProduct; + +/** + * The DJIComponentConnectivityDelegate defines methods that are called by DJIBaseComponent object + * in response to the connectivity change. + * + */ +@protocol DJIComponentConnectivityDelegate + +@optional + +/** + * Called when connectivity status changed for the component. + */ +- (void)component:(DJIBaseComponent *)component connectivityChanged:(BOOL)isConnected; + +@end + +/** + * Abstract class for components in a DJI Product. + * A component can be a camera, gimbal, remote controller, etc. A DJI product consists of several + * components. + */ +@interface DJIBaseComponent : NSObject + +/** + * Use this delegate to get notified on connectivity status changes. + */ +@property (nonatomic, weak) id connectivityDelegate; + +/** + * The connectivity of the component. + */ +@property (assign, nonatomic, readonly, getter = isConnected) BOOL connected; + +/** + * The name of the component. Different types of components will have different names. + */ +@property (copy, nonatomic, readonly) NSString *_Nonnull name; + +/** + * Product to which this component is connected + */ +@property (nonatomic, readonly, weak) DJIBaseProduct *_Nullable product; + +/** + * Get component's firmware version + * + */ +- (void)getFirmwareVersionWithCompletion:(void (^)(NSString *_Nullable version, NSError *_Nullable error))block; + +/** + * Get serial number of the component. Please note this serial number does not match with the serial number found in the physical component. + * + */ +- (void)getSerialNumberWithCompletion:(void (^)(NSString *_Nullable serialNumber, NSError *_Nullable error))block; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIBaseProduct.h b/DJISDK.framework/Headers/DJIBaseProduct.h new file mode 100644 index 0000000..0dcfa1f --- /dev/null +++ b/DJISDK.framework/Headers/DJIBaseProduct.h @@ -0,0 +1,98 @@ +// +// DJIBaseProduct.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +#ifdef __cplusplus +#define DJI_API_EXTERN extern "C" __attribute__((visibility("default"))) +#else +#define DJI_API_EXTERN extern __attribute__((visibility("default"))) +#endif + +#define DJI_API_DEPRECATED __attribute__((__deprecated__)) + +NS_ASSUME_NONNULL_BEGIN + +//Keys for components dictionary +extern NSString *const DJIFlightControllerComponentKey; +extern NSString *const DJIRemoteControllerComponentKey; +extern NSString *const DJICameraComponentKey; +extern NSString *const DJIGimbalComponentKey; +extern NSString *const DJIAirLinkComponentKey; +extern NSString *const DJIBatteryComponentKey; +extern NSString *const DJIHandheldControllerComponentKey; + +/** + * Completion block for asynchronous operations. This completion block is used for methods that return at an unknown future time. + * + * @param error Error object if an error occured during async operation. nil if no error occurred. + */ +typedef void (^_Nullable DJICompletionBlock)(NSError *_Nullable error); + +@class DJIBaseComponent; +@class DJIBaseProduct; + +/** + * + * This protocol provides delegate methods to get notified on component and product connectivity changes. + * + */ +@protocol DJIBaseProductDelegate + +@optional + +/** + * Callback delegate method when a component object changed + * + */ +- (void)componentWithKey:(NSString *)key changedFrom:(DJIBaseComponent *_Nullable)oldComponent to:(DJIBaseComponent *_Nullable)newComponent; + +/** + * Called when connectivity status changed for the base product. + * + */ +- (void)product:(DJIBaseProduct *)product connectivityChanged:(BOOL)isConnected; + +@end + +/** + * + * Abstract class for all DJI Products + */ +@interface DJIBaseProduct : NSObject + +/** + * Use this delegate to get notified on component changes and connectivity status changes. + * + */ +@property (nonatomic, weak) id delegate; +/** + * Connectivity status. In case of aircraft, if the aircraft is out of range or turned off, then the connectivity status changes to NOT connected. + * + */ +@property (assign, nonatomic, readonly, getter = isConnected) BOOL connected; + +/** + * Contains a dictionary of all the available components + * + */ +@property (nonatomic, readonly) NSDictionary *> *_Nullable components; + +/** + * Get product's firmware package version + * + */ +- (void)getFirmwarePackageVersionWithCompletion:(void (^)(NSString *_Nullable version, NSError *_Nullable error))block; + +/** + * Returns the model of the product. + */ +@property (nonatomic, strong, readonly) NSString *_Nullable model; + +@end +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIBattery.h b/DJISDK.framework/Headers/DJIBattery.h new file mode 100644 index 0000000..8347256 --- /dev/null +++ b/DJISDK.framework/Headers/DJIBattery.h @@ -0,0 +1,249 @@ +// +// DJIBattery.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@class DJIBattery; + +/*********************************************************************************/ +#pragma mark - DJIBatteryState +/*********************************************************************************/ + +/** + * The DJIBatteryState is used to keep track the real-time state of the battery. + */ +@interface DJIBatteryState : NSObject + +/** + * Returns the volume (mAh - milliamp hours) of the total amount of energy stored in the battery + * when the battery is fully charged. The volume of the battery at full charge changes over time + * as the battery continues to get used. Over time, as the battery continues to get charged, the + * value of fullChargeEnergy will decrease. + */ +@property(nonatomic, readonly) NSInteger fullChargeEnergy; + +/** + * Returns the remaining energy stored in the battery (mAh - milliamp hours). + */ +@property(nonatomic, readonly) NSInteger currentEnergy; + +/** + * Returns the current battery voltage (mV). + */ +@property(nonatomic, readonly) NSInteger currentVoltage; + +/** + * Returns the real time current draw of the battery (mA). A negative value means the battery is being discharged, + * while positive means it's being charged. + */ +@property(nonatomic, readonly) NSInteger currentCurrent; + +/** + * Returns the percentage of remaining lifetime value of the battery. The range of this + * value is [0 - 100]. + */ +@property(nonatomic, readonly) NSInteger lifetimeRemainingPercent; + +/** + * Returns the percentage of battery energy left. The range of this value is [0 - 100]. + */ +@property(nonatomic, readonly) NSInteger batteryEnergyRemainingPercent; + +/** + * Returns the temperature of battery in Centigrade, with the range [-128 to 127]. + */ +@property(nonatomic, readonly) NSInteger batteryTemperature; + +/** + * Returns the total number of discharges the battery has gone through over its lifetime. + * The total number of discharges includes discharges that happen through normal use and + * discharges that are manually set. + */ +@property(nonatomic, readonly) NSInteger numberOfDischarge; + +@end + +/*********************************************************************************/ +#pragma mark - DJIBatteryWarningInformation +/*********************************************************************************/ +/** + * The DJIBatteryWarningInformation is used to keep a record of the unusual status of the battery + * for the past 30 days. For all the properties below, please continuously check these values to ensure the + * battery's state is normal. If any of the properties below that indicate an issue with the battery, we + * reccomend notifying the user. + * + * NOTE: No automatic action will be taken if any of the properties below return true, + * which is why it becomes imperative the user is notified of the issue. + * + * All states are not supported by OSMO. + */ +@interface DJIBatteryWarningInformation : NSObject + +/** + * YES if battery should be discharged due to a current overload. + */ +@property(nonatomic, readonly) BOOL dischargeDueToCurrentOverload; + +/** + * YES if battery should be discharged due to being over heated. + */ +@property(nonatomic, readonly) BOOL dischargeDueToOverHeating; + +/** + * YES if battery should be discharged due to a low temperature. + */ +@property(nonatomic, readonly) BOOL dischargeDueToLowTemperature; + +/** + * YES if battery should be discharged due to it being short circuited. + */ +@property(nonatomic, readonly) BOOL dischargeDueToShortCircuit; + +/** + * YES if battery has been configured to be discharged over a specific + * number of days. Once the battery is fully charged again, the battery will discharge + * over the number of days set here again. This process is cyclical. + */ +@property(nonatomic, readonly) BOOL customDischargeEnabled; + +/** + * Returns the index at which one of the cells in the battery is below the normal voltage. + * The Phantom 3 Series have 4 cell batteries. The Inspire series and M100 have + * 6 cell batteries. + * + */ +@property(nonatomic, readonly) uint8_t underVoltageBatteryCellIndex; + +/** + * Returns the index at which one of the cells in the battery is damaged. The first cell has index 1. + * The Phantom 3 Series have 4 cell batteries. The Inspire series and M100 have + * 6 cell batteries. + */ +@property(nonatomic, readonly) uint8_t damagedBatteryCellIndex; + +@end + +/*********************************************************************************/ +#pragma mark - DJIBatteryCell +/*********************************************************************************/ + +/** + * Class that contains battery cell voltage data. + */ +@interface DJIBatteryCell : NSObject + +/** + * Returns the voltage (mV) of the current battery cell. + */ +@property(nonatomic, readonly) uint16_t voltage; + +@end + +/*********************************************************************************/ +#pragma mark - DJIBatteryDelegate +/*********************************************************************************/ + +/** + * The protocol provides a delegate method for you to update battery's current state. + */ +@protocol DJIBatteryDelegate + +@optional + +/** + * Updates the battery's current state. + * + * @param battery Battery that has updated state. + * @param batteryState The battery's state. + */ +- (void)battery:(DJIBattery *)battery didUpdateState:(DJIBatteryState *)batteryState; + +@end + +/*********************************************************************************/ +#pragma mark - DJIBattery +/*********************************************************************************/ + +/** + * This class manages the battery's information and real-time status of the connected product. + */ +@interface DJIBattery : DJIBaseComponent + +/** + * Returns the number of battery cells. + */ +@property(nonatomic, readonly) NSUInteger numberOfCell; + +/** + * Delegate that recevies the updated state pushed by the battery. + */ +@property(nonatomic, weak) id delegate; + +/** + * YES if battery is a smart battery. + */ +- (BOOL)isSmartBattery; + +//----------------------------------------------------------------- +#pragma mark Get battery properties and status +//----------------------------------------------------------------- +/** + * Gets the battery's history. The DJI battery keeps the history for + * the past 30 days. The NSArray named history in the block holds objects of type + * DJIBatteryWarningInformation. Need to check isSmartBattery method before using this method. + * Not supported by OSMO. + * + * @param block Remote execution result callback block. + */ +- (void)getWarningInformationRecordsWithCompletion:(void (^)(NSArray *history, NSError *_Nullable error))block; + +/** + * Gets the battery's current state, which is one of seven battery states, which + * can be found at the top of DJIBattery.h. Need to check isSmartBattery method before using this method. + * Not supported by OSMO. + * + * @param block Remote execution result callback block. + */ +- (void)getCurrentWarningInformationWithCompletion:(void (^)(DJIBatteryWarningInformation *state, NSError *_Nullable error))block; + +/** + * Gets the battery's cell voltages. The NSArray named cellArray holds objects of type + * DJIBatteryCell. For the Inspire 1, since the battery has 6 cells, the array cellArray + * will have 6 objects, one for each battery cell. + * + * @param block Remote execution result callback block. + */ +- (void)getCellVoltagesWithCompletion:(void (^)(NSArray *cellArray, NSError *_Nullable error))block; + +//----------------------------------------------------------------- +#pragma mark Battery self discharge +//----------------------------------------------------------------- +/** + * Sets battery's custom self-discharge configuration in the range of [1, 10] days. + * For example, if the value for 'day' is set to 10, the battery will discharge over + * the course of 10 days. Need to check isSmartBattery method before using this method. + * Not supported by OSMO. + * + * @param day Day for self-discharge + * @param block Remote execution result error block. + */ +- (void)setSelfDischargeDay:(uint8_t)day withCompletion:(DJICompletionBlock)block; + +/** + * Gets the battery's custom self-discharge configuration. Need to check isSmartBattery method before using this method. + * Not supported by OSMO. + * + * @param result Remote execution result error block. + */ +- (void)getSelfDischargeDayWithCompletion:(void (^)(uint8_t day, NSError *_Nullable error))block; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJICamera.h b/DJISDK.framework/Headers/DJICamera.h new file mode 100644 index 0000000..91bf090 --- /dev/null +++ b/DJISDK.framework/Headers/DJICamera.h @@ -0,0 +1,1030 @@ +// +// DJICamera.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@class DJIMedia; +@class DJICamera; +@class DJICameraSystemState; +@class DJICameraPlaybackState; +@class DJICameraLensState; +@class DJIMediaManager; +@class DJIPlaybackManager; + +/*********************************************************************************/ +#pragma mark - DJICameraSDCardState +/*********************************************************************************/ + +/** + * This class provides the SD card's general information and current status. + * + */ +@interface DJICameraSDCardState : NSObject + +/** + * YES if there is an SD card error. + */ +@property(nonatomic, readonly) BOOL hasError; + +/** + * YES if the SD card is read only. + */ +@property(nonatomic, readonly) BOOL isReadOnly; + +/** + * YES if SD card filesystem format is invalid. + */ +@property(nonatomic, readonly) BOOL isInvalidFormat; + +/** + * YES if the SD card is formatted. + */ +@property(nonatomic, readonly) BOOL isFormatted; + +/** + * YES if the SD card is formatting. + */ +@property(nonatomic, readonly) BOOL isFormatting; +/** + * YES if the SD card cannot save any more media. + */ +@property(nonatomic, readonly) BOOL isFull; + +/** + * YES if the SD card is verified genuine. The SD card will not be valid if it is fake, + * which can be a problem if the SD card was purchased by a non-reputable retailer. + */ +@property(nonatomic, readonly) BOOL isVerified; + +/** + * YES if SD card is inserted in camera. + */ +@property(nonatomic, readonly) BOOL isInserted; + +/** + * Total space in Megabytes (MB) available on the SD card. + */ +@property(nonatomic, readonly) int totalSpaceInMegaBytes; + +/** + * Remaining space in Megabytes (MB) on the SD card. + */ +@property(nonatomic, readonly) int remainingSpaceInMegaBytes; + +/** + * Returns the number of pictures that can be taken with the remaining space available + * on the SD card. + */ +@property(nonatomic, readonly) int availableCaptureCount; + +/** + * Returns the number of seconds available for recording with the remaining space available + * in the SD card. + */ +@property(nonatomic, readonly) int availableRecordingTimeInSeconds; + +@end + +/*********************************************************************************/ +#pragma mark - DJICameraDelegate +/*********************************************************************************/ + +/** + * This protocol provides delegate methods to receive the updated video data, camera's current state and lens information. + * + */ +@protocol DJICameraDelegate + +@optional +/** + * Video data update callback. H.264 (also called MPEG-4 Part 10 Advanced Video Coding or MPEG-4 AVC) + * is a video coding format that is currently one of the most commonly used formats for the recording, + * compression, and distribution of video content. + * + * @param camera Camera that sends out the video data. + * @param videoBuffer H.264 video data buffer. Don't free the buffer after it has been used. The + * units for the video buffer are bytes. + * @param length Size of the address of the video data buffer in bytes. + */ +- (void)camera:(DJICamera *)camera didReceiveVideoData:(uint8_t *)videoBuffer length:(size_t)size; + +/** + * Updates the camera's current state. + * + * @param camera Camera that sends out the video data. + * @param systemState The camera's system state. + */ +- (void)camera:(DJICamera *)camera didUpdateSystemState:(DJICameraSystemState *)systemState; + +/** + * Tells the delegate that the lens information is updated. + * This protocol is available only when isChangeableLensSupported is YES. + * + * @param camera Camera that sends out the updatd lens information. + * @param lensState The camera's lens state. + */ +- (void)camera:(DJICamera *)camera didUpdateLensState:(DJICameraLensState *)lensState; + +@end + +/*********************************************************************************/ +#pragma mark - DJICamera +/*********************************************************************************/ + +/** + * This class contains media manager and playback manager to manage the Camera's media content. Also, it provides methods to change settings of the camera and perform + * actions of the camera. + */ +@interface DJICamera : DJIBaseComponent + +/** + * Delegate that recevies the information pushed by the camera + */ +@property(nonatomic, weak) id delegate; + +/** + * Media Manager is used for interaction when camera is in DJICameraModeMediaDownload. + * User can only access to the manager when isMediaDownloadModeSupported returns YES. + */ +@property(nonatomic, readonly) DJIMediaManager *mediaManager; + +/** + * Playback Manager is used for interaction when camera is in DJICameraModePlayback. + * User can only access to the manager when isPlaybackSupported returns YES. + */ +@property(nonatomic, readonly) DJIPlaybackManager *playbackManager; + +//----------------------------------------------------------------- +#pragma mark Camera work mode +//----------------------------------------------------------------- +/** + * Sets the camera's work mode to taking pictures, video, playback or download. See enum DJICameraMode in + * DJICameraSettingsDef.h to find details on camera work modes. Please note that you cannot change the mode + * when a certain task is executing, e.g. taking photo(s), recording video, downloading and saving files. + * + * @param mode Camera work mode. + * @param block Remote execution result error block. + */ +- (void)setCameraMode:(DJICameraMode)mode withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's current work mode. + * + * @param block Remote execution result callback block. + */ +- (void)getCameraModeWithCompletion:(void (^)(DJICameraMode, NSError *_Nullable))block; + +//----------------------------------------------------------------- +#pragma mark Shoot photos +//----------------------------------------------------------------- +/** + * Check if the current device supports Timelapse. + * Supported only by OSMO camera. + */ +- (BOOL)isTimeLapseSupported; + +/** + * Camera starts to take photo with one of the camera capture modes (shoot + * photo modes). + * + * Precondition: + * 1. Camera must be in ShootPhoto mode. + * 2. The SD card state should be checked before this method is used to + * ensure sufficient space exists. + * Post condition: + * If the capture mode is either Interval or Time-lapse, calling stopShootPhoto may be required for the camera to stop + * taking photos. + * + * @param shootMode Shoot photo mode for camera to start taking photos with. + * Check the enum named CameraShootPhotoMode in DJICameraSettingsDef to find all possible camera + * shoot modes. + * @param block The execution callback with the execution result returned. + */ +- (void)startShootPhoto:(DJICameraShootPhotoMode)shootMode withCompletion:(DJICompletionBlock)block; + +/** + * Camera stops taking photos. + * + * Precondition: + * 1. StartShootPhoto:withCompletion has been invoked and the shoot mode is either Interval or Time-lapse. + * 2. The shoot photo operation is still executing. + * + * @param block The execution callback with the execution result returned. + */ +- (void)stopShootPhotoWithCompletion:(DJICompletionBlock)block; + +//----------------------------------------------------------------- +#pragma mark Record video +//----------------------------------------------------------------- +/** + * Check if the current device supports Slow Motion video recording. + * Currently Slow Motion is supported only by the OSMO camera. + */ +- (BOOL)isSlowMotionSupported; + +/** + * Sets whether Slow Motion mode is enabled or not. + * When it is enabled, the resolution and frame rate will change to 1920x1080 120fps. + * When it is disabled, the reolution and frame rate will recover to previous setting. + * Supported only by OSMO camera. + * + * @param enabled Enable or disable Slow Motion video. + * @param block The execution callback with the execution result returned. + */ +- (void)setVideoSlowMotionEnabled:(BOOL)enabled withCompletion:(DJICompletionBlock)block; + +/** + * Gets whether Slow Motion mode is enabled or not. + * Supported only by the OSMO camera. + * + * @param block The execution callback with the value(s) returned. + */ +- (void)getVideoSlowMotionEnabledWithCompletion:(void (^)(BOOL enabled, NSError *_Nullable error))block; + +/** + * Starts recording video. Camera must be in DJICameraModeRecordVideo work mode. + */ +- (void)startRecordVideoWithCompletion:(DJICompletionBlock)block; + +/** + * Stops recording video. + */ +- (void)stopRecordVideoWithCompletion:(DJICompletionBlock)block; + +@end + +/*********************************************************************************/ +#pragma mark - DJICamera (CameraSettings) +/*********************************************************************************/ + +@interface DJICamera (CameraSettings) + +//----------------------------------------------------------------- +#pragma mark Camera basic settings +//----------------------------------------------------------------- + +/** + * Sets the camera's file index mode. The default value of DJICameraFileIndexMode is set to DJICameraFileIndexModeReset. + * + * @param fileIndex File index mode to be set for the camera's SD card. + * @param block Remote execution result error block. + */ +- (void)setFileIndexMode:(DJICameraFileIndexMode)fileIndex withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's file index mode. + * + * @param block Remote execution result callback block. + */ +- (void)getFileIndexModeWithCompletion:(void (^)(DJICameraFileIndexMode fileIndex, NSError *_Nullable error))block; + +//----------------------------------------------------------------- +#pragma mark Video related +//----------------------------------------------------------------- + +/** + * Sets the camera's video resolution and frame rate. + * + * @warning The supported resolutions and frame rates for the two different analog television standards PAL and NSTC are below: + * PAL:4096x2160_24fps + * 4096x2160_25fps + * 3840x2160_24fps + * 3840x2160_25fps + * 1920x1080_24fps + * 1920x1080_25fps + * 1920x1080_48fps + * 1920x1080_50fps + * 1280x720_24fps + * 1280x720_25fps + * 1280x720_48fps + * 1280x720_50fps + * NTSC:4096x2160_24fps + * 3840x2160_24fps + * 3840x2160_30fps + * 1920x1080_24fps + * 1920x1080_30fps + * 1920x1080_48fps + * 1920x1080_60fps + * 1280x720_24fps + * 1280x720_30fps + * 1280x720_48fps + * 1280x720_60fps + * + * @param resolution Resolution to be set for the video. + * @param rate Frame rate to be set for the video. + * @param block Remote execution result error block. + */ +- (void)setVideoResolution:(DJICameraVideoResolution)resolution andFrameRate:(DJICameraVideoFrameRate)rate withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's video resolution and frame rate values. + * + */ +- (void)getVideoResolutionAndFrameRateWithCompletion:(void (^)(DJICameraVideoResolution resolution, DJICameraVideoFrameRate rate, NSError *_Nullable error))block; + +/** + * Sets the camera's video file format. The default value is DJICameraVideoFileFormatMOV. + * + * @param format Video file format to be set for videos. + * @param block Remote execution result error block. + */ +- (void)setVideoFileFormat:(DJICameraVideoFileFormat)format withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's video file format. + * + * @param block Completion block to return the current video file format. + */ +- (void)getVideoFileFormatWithCompletion:(void (^)(DJICameraVideoFileFormat format, NSError *_Nullable error))block; + +/** + * Sets the camera's analog video standard. Setting the video standard to PAL or NTSC will limit the available resolutions and frame rates to those compatible with the chosen video standard. + * + * @param videoStandard Video standard value to be set for the camera. + * @param result Remote execution result error block. + */ +- (void)setVideoStandard:(DJICameraVideoStandard)videoStandard withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's video standard value. + */ +- (void)getVideoStandardWithCompletion:(void (^)(DJICameraVideoStandard videoStandard, NSError *_Nullable error))block; + +//----------------------------------------------------------------- +#pragma mark Photo related +//----------------------------------------------------------------- +/** + * Sets the camera's aspect ratio for photos. Check the enum named DJICameraPhotoAspectRatio + * in DJICameraSettingsDef.h to find all possible ratios. + * + * @param ratio Aspect ratio for photos to be taken by camera. + * @param block Remote execution result error block. + */ +- (void)setPhotoRatio:(DJICameraPhotoAspectRatio)ratio withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's aspect ratio for photos. + * + * @param block Remote execution result callback block. + */ +- (void)getPhotoRatioWithCompletion:(void (^)(DJICameraPhotoAspectRatio ratio, NSError *_Nullable error))block; + +/** + * Sets the camera's photo quality for JPEG images. Check the enum named DJICameraPhotoQuality in + * DJICameraSettingsDef.h to find all possible camera photo qualities. + * + * @param quality Camera photo quality to set to. + * @param block Remote execution result error block. + */ +- (void)setPhotoQuality:(DJICameraPhotoQuality)quality withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's photo quality. + * + * @param block Remote execution result callback block. + */ +- (void)getPhotoQualityWithCompletion:(void (^)(DJICameraPhotoQuality quality, NSError *_Nullable error))block; + +/** + * Sets the camera's photo file format. Check the enum named DJICameraPhotoFileFormat in + * DJICameraSettingsDef.h to find all possible photo formats the camera can be set to. + * + * @param photoFormat Photo file format used when the camera takes a photo. + * @param block Completion block. + */ +- (void)setPhotoFileFormat:(DJICameraPhotoFileFormat)photoFormat withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's photo file format. + * + * @param block Completion block. + */ +- (void)getPhotoFileFormatWithCompletion:(void (^)(DJICameraPhotoFileFormat photoFormat, NSError *_Nullable error))block; + +/** + * Sets burst shoot count for the camera, for the case when the user wants to use burst shoot. + * Check the enum named DJICameraPhotoBurstCount in DJICameraSettingsDef.h to find all possible + * burst count values the camera can be set to. + * + * @param count The number of photos to take in one burst shoot + * @param block Completion block. + */ +- (void)setPhotoBurstCount:(DJICameraPhotoBurstCount)count withCompletion:(DJICompletionBlock)block; + +/** + * Gets the burst count type. + * + * @param block Completion block. + */ +- (void)getPhotoBurstCountWithCompletion:(void (^)(DJICameraPhotoBurstCount count, NSError *_Nullable error))block; + +/** + * Sets the camera's AEB capture parameters. + * + * @param aebParam AEB capture parameters to be set for the camera. + * @param block Remote execution result error block. + */ +- (void)setPhotoAEBParam:(DJICameraPhotoAEBParam)aebParam withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's AEB capture parameters. + * + * @param block Remote execution result callback block. + */ +- (void)getPhotoAEBParamWithCompletion:(void (^)(DJICameraPhotoAEBParam aeb, NSError *_Nullable error))block; + +/** + * Sets the interval shoot parameters. The camera will capture a photo, wait a specified interval of time, + * take another photo, and continue in this manner until it has taken the required number of photos. + * + * @param count The number of photos to capture. The value should fall in [2, 255]. If the value of + * captureCount is set to 255, the camera will continue to take photos at the specified + * interval until stopShootPhotoWithCompletion is called. + * + * @param interval The time interval between when two photos are taken. + * The range for this parameter depends the photo file format(DJICameraPhotoFileFormat). + * When the file format is JPEG, the range is [2, 2^16-1] seconds. + * When the file format is RAW or RAW+JPEG, the range is [10, 2^16-1] seconds. + * Inspire PRO is an exception. The range for Inspire PRO is [5, 2^16-1] seconds for all formats. + */ +- (void)setPhotoIntervalParam:(DJICameraPhotoIntervalParam)param withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's interval shoot parameters. + * + * @param block Completion block. + */ +- (void)getPhotoIntervalParamWithCompletion:(void (^)(DJICameraPhotoIntervalParam captureParam, NSError *_Nullable error))block; + +/** + * Sets the TimeLapse parameters including interval, duration and file format when saving. + * + * Precondition: + * Camera should be in TimeLapse mode of CameraShootPhotoMode. + * Supported only by OSMO. + * + * @param interval The time between image captures. + * An integer falls in the range, [10, 8191]. The unit is 100ms. Please note that when + * the format is JPEG+Video, the minimum interval is 20(2 seconds). + * @param duration The time for the whole action. An integer falls in the range, [0, 2^31-1] seconds. + * If the value is set to be 0, it means that it shoots forever until invoking + * stopShootPhoto method. + * @param fileFormat A enum type of the file format to be used. + * Please refer to DJICameraPhotoTimeLapseFileFormat in DJICameraSettingsDef. + * @param block The execution block with the execution result returned. + * + */ +- (void)setPhotoTimeLapseInterval:(NSUInteger)interval duration:(NSUInteger)duration fileFormat:(DJICameraPhotoTimeLapseFileFormat)format withCompletion:(DJICompletionBlock)block; +/** + * Supported only by OSMO camera. + * Gets the TimeLapse parameters including interval, duration and file format when saving. + * + * Precondition: + * Camera should be in TimeLapse mode of CameraPhotoShootMode. + * + * @param block The execution callback with the value(s) returned. + */ +- (void)getPhotoTimeLapseIntervalDurationAndFileFormatWithCompletion:(void (^)(NSUInteger interval, NSUInteger duration, DJICameraPhotoTimeLapseFileFormat format, NSError *_Nullable error))block; + +//----------------------------------------------------------------- +#pragma mark Exposure Settings +//----------------------------------------------------------------- + +/** + * Sets the camera's exposure mode. Check the enum named DJICameraExposureMode in + * DJICameraSettingsDef.h to find all possible camera exposure modes. + * + * @param mode Camera exposure mode to set to. + * @param block Remote execution result error block. + */ +- (void)setExposureMode:(DJICameraExposureMode)mode withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's exposure mode. + * + * @param block Remote execution result callback block. + */ +- (void)getExposureModeWithCompletion:(void (^)(DJICameraExposureMode, NSError *_Nullable))block; + +/** + * Sets the camera's ISO value. Check the enum named DJICameraISO in + * DJICameraSettingsDef.h to find all possible ISO options that the camera can be set to. + * + * For all cameras except X5 the ISO value can only be set when the camera exposure mode is Manual mode. For X5, the ISO value can be set for all modes. Refer to setExposureMode:withCompletion: method for how to set exposure mode. + * + * @param iso ISO value to be set. + * @param block Completion block. + */ +- (void)setISO:(DJICameraISO)iso withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's ISO value. + * + * @param block Completion block. + */ +- (void)getISOWithCompletion:(void (^)(DJICameraISO iso, NSError *_Nullable error))block; + +/** + * Sets the camera shutter speed. For all available values shutterSpeed can be set to, check the + * top of DJICameraSettingsDef.h. + * + * The shutter speed should not be set slower than the video frame rate when the camera's mode is + * DJICameraModeRecordVideo. For example, if the video frame rate = 30fps, then the shutterSpeed must + * be <= 1/30. + * + * Precondition: Shutter speed can be set only when the camera exposure mode is either Shutter mode or Manual mode. + * + * @param shutterSpeed Shutter speed value to be set for the camera. + * @param block Remote execution result error block. + */ +- (void)setShutterSpeed:(DJICameraShutterSpeed)shutterSpeed withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's shutter speed. + * + * @param block Remote execution result callback block. + */ +- (void)getShutterSpeedWithCompletion:(void (^)(DJICameraShutterSpeed shutterSpeed, NSError *_Nullable error))block; + +/** + * Sets the camera's exposure metering. Check the enum named DJICameraMeteringMode in + * DJICameraSettingsDef.h to find all possible exposure metering the camera can be set to. + * + * @param meteringType Exposure metering to be set. + * @param block Completion block. + */ +- (void)setMeteringMode:(DJICameraMeteringMode)meteringType withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's exposure metering. + * + * @param block Completion block. + */ +- (void)getMeteringModeWithCompletion:(void (^)(DJICameraMeteringMode exposureMetering, NSError *_Nullable error))block; + +/** + * Sets the spot metering area index. The camera image is divided into 96 spots defined by 12 columns and 8 rows. + * The row index falls in [0,7] where the values increase top to bottom across the image. The column index falls + * in [0, 11], where the values increase left to right. + * In order to make the method work, The camera exposure mode should be 'Program', 'Shutter' or 'Aperture' and the + * exposure metering mode should be DJICameraMeteringModeSpot. + * + * @param rowIndex Spot metering area row index to be set. + * @param colIndex Spot metering area column index to be set. + * @param block Remote execution result error block. + */ +- (void)setSpotMeteringAreaRowIndex:(uint8_t)rowIndex andColIndex:(uint8_t)colIndex withCompletion:(DJICompletionBlock)block; + +/** + * Gets the spot metering area row index and column index. + */ +- (void)getSpotMeteringAreaRowIndexAndColIndexWithCompletion:(void (^)(uint8_t rowIndex, uint8_t colIndex, NSError *_Nullable error))block; + +/** + * Sets the camera's exposure compensation. Check the enum named DJICameraExposureCompensation + * in DJICameraSettingsDef.h to find all possible exposure compensations the camera can be set to. + * In order to use this function, the camera exposure mode should be 'shutter', 'program' or 'aperture'. + * + * @param compensationType Exposure compensation value to be set for the camera. + * @param block Completion block. + */ +- (void)setExposureCompensation:(DJICameraExposureCompensation)compensationType withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's exposure compensation. + * + * @param block Completion block. + */ +- (void)getExposureCompensationWithCompletion:(void (^)(DJICameraExposureCompensation exposureCompensation, NSError *_Nullable error))block; + +/** + * Sets whether or not the camera's AE (auto exposure) lock is locked or not. + * + * Post condition: + * If AE lock is enabled, spot metering area cannot be set. + * + * @param isLock YES if the camera AE lock is locked or unlocked. + * @param callback The execution callback with the execution result returned. + */ +- (void)setAELock:(BOOL)isLock withCompletion:(DJICompletionBlock)block; + +/** + * Gets if the camera's AE (auto exposure) lock is locked or not. + * + * @param block Remote execution result callback block. + */ +- (void)getAELockWithCompletion:(void (^)(BOOL isLocked, NSError *_Nullable error))block; + +//----------------------------------------------------------------- +#pragma mark White Balance +//----------------------------------------------------------------- + +/** + * Sets the camera’s white balance and color temperature. + * + * When the white balance is a preset value (values except CustomColorTemperature), the colorTemperature argument does not take effect. When the white balance is CustomColorTemperature, the colorTemperature value is used instead. Check the enum named DJICameraWhiteBalance in DJICameraSettingsDef.h to find all possible white balance options the camera can be set to. + * + * @param whiteBalance White balance value to be set. + * @param colorTemperature Color temperature value to be set in the range of [20, 100]. Real color temperature value(K) = value * 100. For example, 50 -> 5000K. + * @param block Completion block. + */ +- (void)setWhiteBalance:(DJICameraWhiteBalance)whiteBalance andColorTemperature:(uint8_t)colorTemperature withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's white balance and color temperature. + * + * @param block Completion block. + */ +- (void)getWhiteBalanceAndColorTemperatureWithCompletion:(void (^)(DJICameraWhiteBalance whiteBalance, uint8_t colorTemperature, NSError *_Nullable error))block; + +//----------------------------------------------------------------- +#pragma mark Other settings +//----------------------------------------------------------------- +/** + * Sets the camera's anti-flicker for video recording. + * + * Precondition: + * Please make sure the exposure mode is Program. + * + * @param antiFlickerType Anti-flicker value to set for the camera. Please check the enum DJICameraAntiFlicker + * to find all the possible anti-flicker type the camera can be set to. + * @param callback The execution callback with the execution result returned. + */ +- (void)setAntiFlicker:(DJICameraAntiFlicker)antiFlickerType withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's anti-flicker. + * + * @param block Completion block. + */ +- (void)getAntiFlickerWithCompletion:(void (^)(DJICameraAntiFlicker antiFlicker, NSError *_Nullable error))block; + +/** + * Sets the camera's sharpness. Check the enum named DJICameraSharpness + * in DJICameraSettingsDef.h to find all possible sharpnesss the camera can be set to. + * + * @param sharpness Sharpness value to be set for the camera. + * @param block Completion block. + */ +- (void)setSharpness:(DJICameraSharpness)sharpness withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's sharpness. + * + * @param block Completion block. + */ +- (void)getSharpnessWithCompletion:(void (^)(DJICameraSharpness sharpness, NSError *_Nullable error))block; + +/** + * Sets the camera's contrast. Check the enum named DJICameraContrast + * in DJICameraSettingsDef.h to find all possible contrasts the camera can be set to. + * + * @param contrast Contrast value to be set for the camera. + * @param block Completion block. + */ +- (void)setContrast:(DJICameraContrast)contrast withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's contrast. + * + * @param block Completion block. + */ +- (void)getContrastWithCompletion:(void (^)(DJICameraContrast contrast, NSError *_Nullable error))block; + +/** + * Sets the camera's saturation. The default value of the saturation value is 0. + * + * @param saturation Saturation value to be set in the range of [-3, 3]. + * @param block Remote execution result error block. + */ +- (void)setSaturation:(int8_t)saturation withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's saturation. + * + * @param block Remote execution result callback block. + */ +- (void)getSaturationWithCompletion:(void (^)(int8_t saturation, NSError *_Nullable error))block; + +/** + * Sets the camera's hue. The default value of the saturation value is 0. + * + * @param hue Hue value to be set in the range of [-3, 3]. + * @param block Remote execution result error block. + */ +- (void)setHue:(int8_t)hue withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's hue. + * + * @param block Remote execution result callback block. + */ +- (void)getHueWithCompletion:(void (^)(int8_t hue, NSError *_Nullable error))block; + +/** + * Sets the camera's digital filter. The default value is DJICameraDigitalFilterNone. + * For a list of all possible camera digital filters, check the enum named DJICameraDigitalFilter in + * DJICameraSettingsDef.h. + * + * @param filter Digital filter to be set to the camera. + * @param block Remote execution result error block. + */ +- (void)setDigitalFilter:(DJICameraDigitalFilter)filter withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's digital filter. + * + * @param block Remote execution result callback block. + */ +- (void)getDigitalFilterWithCompletion:(void (^)(DJICameraDigitalFilter filter, NSError *_Nullable error))block; + +/** + * Returns whether or not the device supports quick view. Quick view is an amount of time a photo is shown as a preview after it is taken and before the camera returns back to the live camera view. + * seconds. + */ +- (BOOL)isPhotoQuickViewSupported; + +/** + * Sets the camera's quick view duration. The valid range is [0, 10] seconds. When duration is 0, it means that the quick view + * is disabled. The default value is 0 second. + * It is not supported by Phantom 3 Standard. Please check isPhotoQuickViewSupported before using this method. + * + * @param duration Quick view duration to be set for the camera. + * @param block Remote execution result error block. + */ +- (void)setPhotoQuickViewDuration:(NSUInteger)duration withCompletion:(DJICompletionBlock)block; + +/** + * Gets the camera's quick view duration. + * + * @param block Remote execution result callback block. + */ +- (void)getPhotoQuickViewDurationWithCompletion:(void (^)(NSUInteger duration, NSError *_Nullable error))block; + +//----------------------------------------------------------------- +#pragma mark Audio Settings +//----------------------------------------------------------------- +/** + * Check if the current device supports audio recording. + * Currently audio recording is supported only by the OSMO camera. + */ +- (BOOL)isAudioRecordSupported; + +/** + * Enables audio recording when capturing video. + * Supported only by OSMO camera. + * + * @param enabled Enable or disable audio recording. + * @param block The execution callback with the execution result returned. + * + */ +- (void)setAudioRecordEnabled:(BOOL)enabled withCompletion:(DJICompletionBlock)block; + +/** + * Supported only by OSMO camera. + * Gets whether the audio record is enabled or not. + * + * @param block The execution callback with the value(s) returned. + */ +- (void)getAudioRecordEnabledWithCompletion:(void (^)(BOOL enabled, NSError *_Nullable error))block; + +//----------------------------------------------------------------- +#pragma mark Advanced Camera Settings +//----------------------------------------------------------------- +/** + * Gets whether the changeable lens is supported by the camera. + * Currently, a changeable lens is supported only by X5 camera. + */ +- (BOOL)isChangeableLensSupported; +/** + * Gets details of the installed lens. + * Supported only by X5 camera. + * It is available only when isChangeableLensSupported returns YES. + * + * @param callback The execution callback with the value(s) returned. + */ +- (void)getLensInformationWithCompletion:(void (^)(NSString *_Nullable info, NSError *_Nullable error))block; + +/** + * Gets whether the camera supports an adjustable aperture. + * Currently, adjustable aperture is supported only by X5 camera. + */ +- (BOOL)isAdjustableApertureSupported; + +/** + * Sets the aperture value. + * It is available only when isAdjustableApertureSupported returns YES. + * Supported only by X5 camera. + * + * Precondition: + * The exposure mode should be in Manual or AperturePriority. + * + * @param aperture The aperture to set. Check enum CameraLensFocusMode in DJICameraSettingsDef. + * @param block The execution callback with the execution result returned. + */ +- (void)setAperture:(DJICameraAperture)aperture withCompletion:(DJICompletionBlock)block; + +/** + * Gets the lens aperture. + * It is available only when isAdjustableApertureSupported returns YES. + * Supported only by X5 camera. + * + * @param block The execution callback with the value(s) returned. + */ +- (void)getApertureWithCompletion:(void (^)(DJICameraAperture aperture, NSError *_Nullable error))block; + +/** + * Gets whether the camera supports an adjustable focal point. + * Currently, adjustable focal point is supported only by X5 camera. + */ +- (BOOL)isAdjustableFocalPointSupported; + +/** + * Sets the lens focus mode. Check enum CameraLensFocusMode in DJICameraSettingsDef. + * It is available only when isAdjustableFocalPointSupported returns YES. + * Supported only by X5 camera. + * + * @param focusMode Focus mode to set. Please refer to DJICameraLensFocusMode for more detail. + * @param block The execution callback with the execution result returned. + */ +- (void)setLensFocusMode:(DJICameraLensFocusMode)focusMode withCompletion:(DJICompletionBlock)block; + +/** + * Gets the lens focus mode. Please check enum CameraLensFocusMode in DJICameraSettingsDef. + * It is available only when isAdjustableFocalPointSupported returns YES. + * Supported only by X5 camera. + * + * @param block The execution callback with the value(s) returned. + */ +- (void)getLensFocusModeWithCompletion:(void (^)(DJICameraLensFocusMode focusMode, NSError *_Nullable error))block; + +/** + * Sets the lens focus Target point. + * When the focus mode is auto, the target point is the focal point. + * When the focus mode is manual, the target point is the zoom out area if the focus assistant is enabled for + * the manual mode. + * It is available only when isAdjustableFocalPointSupported returns YES. + * Supported only by X5 camera. + * + * @param focusTarget The focus target to set. The range for x and y is from 0.0 to 1.0. The point [0.0, 0.0] + * represents the top-left angle of the screen. + * @param block The execution callback with the execution result returned. + * + */ +- (void)setLensFocusTarget:(CGPoint)focusTarget withCompletion:(DJICompletionBlock)block; + +/** + * Gets the lens focus Target point. + * It is available only when isAdjustableFocalPointSupported returns YES. + * Supported only by X5 camera. + * + * @param callback The execution callback with the value(s) returned. + */ +- (void)getLensFocusTargetWithCompletion:(void (^)(CGPoint focusTarget, NSError *_Nullable error))block; + +/** + * Sets whether the lens focus assistant is enabled or not. + * If the focus assistant is enabled, a specific area of the screen will zoom out during focusing. + * It is available only when isAdjustableFocalPointSupported returns YES. + * Supported only by X5 camera. + * + * @param enabledMF Sets whether the lens focus assistant under MF mode is enabled or not. + * @param enabledAF Sets whether the lens focus assistant under AF mode is enabled or not. + * @param block The execution callback with the execution result returned. + */ +- (void)setLensFocusAssistantEnabledForMF:(BOOL)MFenabled andAF:(BOOL)AFenabled withCompletion:(DJICompletionBlock)block; + +/** + * Gets whether the lens focus assistant is enabled or not. + * It is available only when isAdjustableFocalPointSupported returns YES. + * Supported only by X5 camera. + * + * @param block The execution callback with the value(s) returned. + * The first result stands for MF, the second result stands for AF. + */ +- (void)getLensFocusAssistantEnabledForMFAndAFWithCompletion:(void (^)(BOOL MFenabled, BOOL AFenabled, NSError *_Nullable error))block; + +/** + * Gets the lens focusing ring value's max value. + * It is available only when isAdjustableFocalPointSupported returns YES. + * Supported only by X5 camera. + * + * @param callback The execution callback with the value(s) returned. + */ +- (void)getLensFocusRingValueUpperBoundWithCompletion:(void (^)(NSUInteger upperBound, NSError *_Nullable error))block; + +/** + * Set the focal distance by simulating the focus ring adjustment. Value can have a range of [0, getLensFocusRingValueUpperBoundWithCompletion] which represents the closest possible focal distance and infinity. + * It is available only when isAdjustableFocalPointSupported returns YES. + * Supported only by X5 camera. + * + * @param value An integer value to adjust the focusing ring. + * The minimum value is 0, the maximum value depends on the installed lens. Please use method + * getLensFocusRingValueUpperBoundWithCompletion to ensure the input argument is valid. + * @param block The execution callback with the execution result returned. + * + */ +- (void)setLensFocusRingValue:(NSUInteger)value withCompletion:(DJICompletionBlock)block; + +/** + * Gets lens focus ring value. + * It is available only when isAdjustableFocalPointSupported returns YES. + * Supported only by X5 camera. + * + * @param callback The execution callback with the value(s) returned. + */ +- (void)getLensFocusRingValueWithCompletion:(void (^)(NSUInteger distance, NSError *_Nullable error))block; + +//----------------------------------------------------------------- +#pragma mark Save/load camera settings +//----------------------------------------------------------------- +/** + * Load the camera's factory settings.
+ * + * Post condition: + * The camera will reboot itself. + * + * @param callback The execution callback with the execution result returned. + */ +- (void)loadFactorySettings:(DJICompletionBlock)block; + +/** + * Saves the current camera settings permanently to the specified user. Check the enum named DJICameraCustomSettings in + * DJICameraSettingsDef.h to find all possible camera users. + * + * @param settings Camera user to store camera settings to. + * @param result Remote execution result error block. + */ +- (void)saveSettingsTo:(DJICameraCustomSettings)settings withCompletion:(DJICompletionBlock)block; + +/** + * Load camera settings from the specified user. + * + * @param settings Camera user to load camera settings from. + * @param result Remote execution result error block. + */ +- (void)loadSettingsFrom:(DJICameraCustomSettings)settings withCompletion:(DJICompletionBlock)block; + +@end + +/*********************************************************************************/ +#pragma mark - DJICamera (Media) +/*********************************************************************************/ + +@interface DJICamera (Media) +/** + * Check if the current device support Media Download Mode + */ +- (BOOL)isMediaDownloadModeSupported; + +@end + +/*********************************************************************************/ +#pragma mark - DJICamera (CameraPlayback) +/*********************************************************************************/ + +@interface DJICamera (CameraPlayback) + +/** + * Check if the current device supports Playback Mode + */ +- (BOOL)isPlaybackSupported; + +@end + +/*********************************************************************************/ +#pragma mark - DJISDCardOperations +/*********************************************************************************/ + +@interface DJICamera (SDCardOperations) + +/** + * Formats the SD card by deleting all the data on the SD card. This + * does not change any settings the user may have set on the SD card. + */ +- (void)formatSDCardWithCompletion:(DJICompletionBlock)block; + +/** + * Gets the current state of the SD card. For instance, accessing the sdInfo + * parameter of the block will tell you whether or not the SD card is inserted + * into the camera or how much memory is remaining. For more information on all + * possible current states of the SD card, refer to DJICameraSDCardState. + * + * @param block Remote execution result callback block. + */ +- (void)getSDCardInfoWithCompletion:(void (^)(DJICameraSDCardState *_Nullable sdInfo, NSError *_Nullable error))block; + +@end + + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJICameraLensState.h b/DJISDK.framework/Headers/DJICameraLensState.h new file mode 100644 index 0000000..6a40bee --- /dev/null +++ b/DJISDK.framework/Headers/DJICameraLensState.h @@ -0,0 +1,104 @@ +// +// DJICameraLensState.h +// DJISDK +// +// Copyright © 2015 DJI. All rights reserved. +// + +#import +#import "DJICameraSettingsDef.h" + +/** + * The type of the installed lens. + */ +typedef NS_ENUM (NSUInteger, DJILensType) { + /** + * The lens supports Auto Focus. + * For this type, DJI SDK can control the focus point. + */ + DJILensTypeAF, + /** + * The lens supports only Manual Focus. + * For this type, DJI SDK cannot control the focus point. + */ + DJILensTypeMF, + /** + * The lens type is unkown. + */ + DJILensTypeUnknown +}; + +/** + * The focusing status of the camera's lens. + */ +typedef NS_ENUM (NSUInteger, DJICameraLensFocusStatus) { + /** + * The lens is idle. No focus target has been set. + */ + DJICameraLensFocusStatusIdle = 0x00, + /** + * The lens is focusing to the target. + */ + DJICameraLensFocusStatusFocusing, + /** + * The lens succeeds to fucus on the target. + */ + DJICameraLensFocusStatusSuccess, + /** + * The lens fails to fucus on the target. + * It happens when the target is too near or the camera cannot distinguish the object to focus (e.g. a white w + * wall). + */ + DJICameraLensFocusStatusFailure +}; + +/** + * This class contains the information about the lens' current state, including lens type, focus status, focus mode, + * focus assistant state and AF switch state. + * + * Supported only by X5 camera. + */ +@interface DJICameraLensState : NSObject + +/** + * If the Lens is installed on the camera or not. + */ +@property(nonatomic, readonly) BOOL isLensInstalled; + +/** + * The installed lens type. If the lens is not installed, the value is undefined. + */ +@property(nonatomic, readonly) DJILensType lensType; + +/** + * The AF switch on the lens is on. If the lens is not installed, the value is undefined. + * If the property is YES, user can call setLensFocusMode and control the focal point with the SDK. + */ +@property(nonatomic, readonly) BOOL isAFSwitchOn; + +/** + * The current focus mode. If the lens is not installed, the value is undefined. + */ +@property(nonatomic, readonly) DJICameraLensFocusMode focusMode; + +/** + * The focus status of the lens. If the lens is not installed, the value is undefined. + */ +@property(nonatomic, readonly) DJICameraLensFocusStatus focusStatus; + +/** + * If the focus assistant enabled for Manual focus mode. If the lens is not installed, the value is undefined. + */ +@property(nonatomic, readonly) BOOL isFocusAssistantEnabledForMF; + +/** + * If the focus assistant enabled for Auto focus mode. If the lens is not installed, the value is undefined. + */ +@property(nonatomic, readonly) BOOL isFocusAssistantEnabledForAF; + +/** + * If the focus target is zooming out. If the lens is not installed, the value is undefined. + */ +@property(nonatomic, readonly) BOOL isFocusAssistantWorking; + +@end diff --git a/DJISDK.framework/Headers/DJICameraParameters.h b/DJISDK.framework/Headers/DJICameraParameters.h new file mode 100644 index 0000000..a95f3ab --- /dev/null +++ b/DJISDK.framework/Headers/DJICameraParameters.h @@ -0,0 +1,144 @@ +// +// DJICameraParameter.h +// DJISDK +// +// Copyright © 2015 DJI. All rights reserved. +// + +#import +#import "DJICameraSettingsDef.h" + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - Range Key of the change dictionary. +//CameraVideoResolutionAndFrameRateRange key +extern NSString *const DJISupportedCameraVideoResolutionAndFrameRateRange; +//CameraModeRange key +extern NSString *const DJISupportedCameraModeRange; +//CameraExposureModeRange key +extern NSString *const DJISupportedCameraExposureModeRange; +//CameraISORange key +extern NSString *const DJISupportedCameraISORange; +//CameraShutterSpeedRange key +extern NSString *const DJISupportedCameraShutterSpeedRange; +//CameraExposureCompensationRange key +extern NSString *const DJISupportedCameraExposureCompensationRange; +//CameraApertureRange key +extern NSString *const DJISupportedCameraApertureRange; + +@class DJICameraParameters; + +/** + * This protocol provides a method to get notified when the camera parameters' range changes. + */ +@protocol DJICameraParametersListener + +@optional + +/** + * When a parameter range is changed, the listener will receive this callback. + * + * @param parameters The parameters. + * @param change The new range and key. + */ +- (void)cameraParameters:(nonnull DJICameraParameters *)parameters change:(nonnull NSDictionary *)change; + +@end + +/** + * Some of the camera's parameters have dynamic ranges. DJICameraParameters provides the interface to query what the + * valid range is for a parameter. Type-casting is requried to get the corresponding enumerator value for each + * range element. + */ + +@interface DJICameraParameters : NSObject + ++ (nonnull instancetype)sharedInstance; + +/** + * Returns the current valid range for video resolution (DJICameraVideoResolution) and frame rate + * (DJICameraVideoFrameRate). Returns nil if current camera does not support any video resolution or frame rate + * setting or the camera is disconnected. + * + * @return Array of pairs. Each pair represents a valid DJICameraVideoResolution value and DJICameraVideoFrameRate + * value. + */ +- (nonnull NSArray *> *)supportedCameraVideoResolutionAndFrameRateRange; + +/** + * Returns the current valid range for camera mode (DJICameraMode). Returns nil if current camera has no supported + * camera mode or the camera is disconnected. + * + * @return Array of NSNumber. Each element represents one current supported camera mode. + */ +- (nonnull NSArray *)supportedCameraModeRange; + +/** + * Returns the current valid range for camera's exposure mode (DJICameraExposureMode). Returns nil if current + * camera does not support any exposure mode or the camera is disconnected. + * + * @return Array of NSNumber. Each element represent one current supported exposure mode. + */ +- (nonnull NSArray *)supportedCameraExposureModeRange; + +/** + * Returns the current valid range for camera's ISO (DJICameraISO). Returns nil if current camera does not support + * any ISO value or the camera is disconnected. + * + * @return Array of NSNumber. Each element represent one current supported ISO value. + */ +- (nonnull NSArray *)supportedCameraISORange; + +/** + * Returns the current valid range for camera's shutter speed (DJICameraShutterSpeed). Returns nil if current + * camera does not support any shutter speed value or the camera is disconnected. + * + * @return Array of NSNumber. Each element represent one current supported shutter speed value. + */ +- (nonnull NSArray *)supportedCameraShutterSpeedRange; + +/** + * Returns the current valid range for camera's exposure compensation (DJICameraExposureCompensation). Returns + * nil if current camera does not support any exposure compensation value or the camera is disconnected. + * + * @return Array of NSNumber. Each element represent one current supported exposure compensation value. + */ +- (nonnull NSArray *)supportedCameraExposureCompensationRange; + +/** + * Returns the current valid range for camera's aperture (DJICameraAperture). Returns nil if current camera does + * not support any aperture value or the camera is disconnected. + * + * @return Array of NSNumber. Each element represent one current supported aperture value. + */ +- (nonnull NSArray *)supportedCameraApertureRange; + +@end + +/** + * A category of DJICameraParameters. It provides methods to add or remove listeners for valid range change. + */ +@interface DJICameraParameters (Listener) + +/** + * Add listener to listen for the camera range change. + * + * @param listener listener + */ +- (void)addListener:(nonnull id)listener; + +/** + * Remove listener which is listening to the camera range change. + * + * @param listener listener + */ +- (void)removeListener:(nonnull id)listener; + +/** + * Remove all listeners. + */ +- (void)removeAllListeners; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJICameraPlaybackState.h b/DJISDK.framework/Headers/DJICameraPlaybackState.h new file mode 100644 index 0000000..ebdba25 --- /dev/null +++ b/DJISDK.framework/Headers/DJICameraPlaybackState.h @@ -0,0 +1,189 @@ +// +// DJICameraPlaybackState.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +/** + * Media file type + */ +typedef NS_ENUM (uint8_t, DJICameraPlaybackFileFormat){ + /** + * JPEG file + */ + DJICameraPlaybackFileFormatJPEG = 0x00, + /** + * DNG file + */ + DJICameraPlaybackFileFormatRAWDNG = 0x01, + /** + * Video file + */ + DJICameraPlaybackFileFormatVIDEO = 0x02, + /** + * The playback file format is unknown. + */ + DJICameraPlaybackFileFormatUnknown = 0xFF +}; + +/** + * A playback mode represents a task that the Playback manager is executing. + */ +typedef NS_ENUM (uint8_t, DJICameraPlaybackMode){ + /** + * Single file preview + */ + DJICameraPlaybackModeSingleFilePreview = 0x00, + /** + * Single photo zoomed + */ + DJICameraPlaybackModeSinglePhotoZoomMode = 0x01, + /** + * Single video play start + */ + DJICameraPlaybackModeSingleVideoPlaybackStart = 0x02, + /** + * Single video play pause + */ + DJICameraPlaybackModeSingleVideoPlaybackPause = 0x03, + /** + * Multiple file edit + */ + DJICameraPlaybackModeMultipleFilesEdit = 0x04, + /** + * Multiple file preview + */ + DJICameraPlaybackModeMultipleFilesPreview = 0x05, + /** + * Download file + */ + DJICameraPlaybackModeDownload = 0x06, + /** + * Unknown mode + */ + DJICameraPlaybackModeUnknown = 0xFF, +}; + +/** + * Status for a media file being deleted + */ +typedef NS_ENUM (uint8_t, DJICameraPlaybackDeletionStatus){ + /** + * Delete failed + */ + DJICameraPlaybackDeletionStatusFailure = 1, + /** + * Deleting + */ + DJICameraPlaybackDeletionStatusDeleting, + /** + * Delete Succeeded + */ + DJICameraPlaybackDeletionStatusSuccess, +}; + +/** + * This class provides the current state of the Playback manager, like numbers of thumbnail and media files, video duration, video play progress, file download state, etc. + */ +@interface DJICameraPlaybackState : NSObject + +/** + * The current mode of the Playback manager + */ +@property(nonatomic, readonly) DJICameraPlaybackMode playbackMode; + +/** + * The type of the current file. + * The value of this property is valid only when the playbackMode is DJICameraPlaybackModeSingleFilePreview, DJICameraPlaybackModeSingleVideoPlaybackStart nor DJICameraPlaybackModeSingleVideoPlaybackPause. + */ +@property(nonatomic, readonly) DJICameraPlaybackFileFormat mediaFileType; + +/** + * The total number of thumbnails for both the photos and videos being viewed on the page. The value of the property is valid when the playbackMode is DJICameraPlaybackModeMultipleFilesPreview or DJICameraPlaybackModeMultipleFilesEdit. + */ +@property(nonatomic, readonly) int numberOfThumbnails; + +/** + * The total number of media files on the SD card, including photos and videos. + * + */ +@property(nonatomic, readonly) int numberOfMediaFiles; + +/** + * The index of the current selected file. + * + */ +@property(nonatomic, readonly) int currentSelectedFileIndex; + +/** + * The duration in second of the playing video. The value of the property is valid only when playbackMode is DJICameraPlaybackModeSingleVideoPlaybackStart or DJICameraPlaybackModeSingleVideoPlaybackPaused. + */ +@property(nonatomic, readonly) int videoDuration; + +/** + * The progress in percentage of the playing video. The valid range is [0, 100]. + * The value the property is valid only when playbackMode is DJICameraPlaybackModeSingleVideoPlaybackStart or DJICameraPlaybackModeSingleVideoPlaybackPaused. + */ +@property(nonatomic, readonly) int videoPlayProgress; + +/** + * The played duration in second of the playing video. + * + * The value the property is valid only when playbackMode is DJICameraPlaybackModeSingleVideoPlaybackStart or DJICameraPlaybackModeSingleVideoPlaybackPaused. + */ +@property(nonatomic, readonly) int videoPlayPosition; + +/** + * The total number of the selected files. + * + * The value is valid while playbackMode is in DJICameraPlaybackModeMultipleFilesEdit. + */ +@property(nonatomic, readonly) int numberOfSelectedFiles; + +/** + * The total number of photos in the SD card. + * + */ +@property(nonatomic, readonly) int numberOfPhotos; + +/** + * The total number of videos in the SD card. + * + */ +@property(nonatomic, readonly) int numberOfVideos; + +/** + * The dimension of the previewing photo. The value of the property is valid only when playbackMode is DJICameraPlaybackModeSingleFilePreview and mediaFileType is DJICameraPlaybackFileFormatJPEG. + * + */ +@property(nonatomic, readonly) CGSize photoSize; + +/** + * The current status of a file when the user tries to delete it. + * + */ +@property(nonatomic, readonly) DJICameraPlaybackDeletionStatus fileDeleteStatus; + +/** + * YES if all the files on the current page are selected. + * + */ +@property(nonatomic, readonly) BOOL isAllFilesInPageSelected; + +/** + * YES if the previewing file is a valid photo or video. The value of the property is valid only when playbackMode is DJICameraPlaybackModeSingleFilePreview. + * + */ +@property(nonatomic, readonly) BOOL isSelectedFileValid; + +/** + * YES if the previewing file has been downloaded. The value of the property is valid only when playbackMode is DJICameraPlaybackModeSingleFilePreview. + * + */ +@property(nonatomic, readonly) BOOL isFileDownloaded; + +@end diff --git a/DJISDK.framework/Headers/DJICameraSettingsDef.h b/DJISDK.framework/Headers/DJICameraSettingsDef.h new file mode 100644 index 0000000..0d935db --- /dev/null +++ b/DJISDK.framework/Headers/DJICameraSettingsDef.h @@ -0,0 +1,1116 @@ +// +// DJICameraSettingsDef.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +DJI_API_EXTERN const int DJICameraFocusAreaRow; // 8 +DJI_API_EXTERN const int DJICameraFocusAreaColumn; // 12 +DJI_API_EXTERN const int DJICameraSpotMeteringAreaRow; // 8 +DJI_API_EXTERN const int DJICameraSpotMeteringAreaColumn; // 12 + +/*********************************************************************************/ +#pragma mark - Camera Modes +/*********************************************************************************/ + +//----------------------------------------------------------------- +#pragma mark DJICameraMode +//----------------------------------------------------------------- +/** + * Camera work modes. + */ +typedef NS_ENUM (NSUInteger, DJICameraMode){ + /** + * Capture mode. In this mode, the user can capture pictures. + */ + DJICameraModeShootPhoto = 0x00, + /** + * Record mode. In this mode, the user can record videos. + */ + DJICameraModeRecordVideo = 0x01, + /** + * Playback mode. In this mode, the user can preview photos and videos, and + * they can delete files. + * + * Not supported by OSMO, Phantom 3 Standard. + */ + DJICameraModePlayback = 0x02, + /** + * In this mode, user can download media to Mobile Device. + * + * Supported by Phantom 3 Professional, Phantom 3 Advanced, Phantom 3 Standard, X3. + */ + DJICameraModeMediaDownload = 0x03, + + /** + * The camera work mode is unknown. + */ + DJICameraModeUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraShootPhotoMode +//----------------------------------------------------------------- +/** + * Camera work mode ShootPhoto itself can have several modes. The default value is DJICameraShootPhotoModeSingle. + */ +typedef NS_ENUM (NSUInteger, DJICameraShootPhotoMode){ + /** + * Sets the camera to take a single photo. + */ + DJICameraShootPhotoModeSingle, + /** + * Sets the camera to take a HDR photo. + * Currently, X5 does not support HDR mode. + */ + DJICameraShootPhotoModeHDR, + /** + * Set the camera to take multiple photos at once. + */ + DJICameraShootPhotoModeBurst, + /** + * Automatic Exposure Bracketing (AEB) capture. In this mode you can + * quickly take multiple shots (the default is 3) at different exposures + * without having to manually change any settings between frames. + */ + DJICameraShootPhotoModeAEB, + /** + * Sets the camera to take a picture (or multiple pictures) continuously at a set time interval. + * The minimum interval for JPEG format of any quality is 2s. + * The minimum interval for Raw or Raw+JPEG format is 10s. + */ + DJICameraShootPhotoModeInterval, + /** + * Sets the camera to take a picture (or multiple pictures) continuously at a set time interval. + * The camera will merge the photo sequence and the output is a video. + * The minimum interval for Video only format is 1 s. + * The minimum interval for Video+Photo format is 2 s. + * Supported only by OSMO camera. + */ + DJICameraShootPhotoModeTimeLapse +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraExposureMode +//----------------------------------------------------------------- +/** + * Camera exposure modes. The default value is DJICameraExposureModeProgram. + * + * The different exposure modes define whether Aperture, Shutter Speed, ISO can + * be set automatically or manually. Exposure compensation can be changed in all modes + * except Manual mode where it is not settable. + * + * X5: + * Program Mode: Shutter: Auto Aperture: Auto ISO: Manual or Auto + * Shutter Priority: Shutter: Manual Aperture: Auto ISO: Manual or Auto + * Aperture Priority: Shutter: Auto Aperture: Manual ISO: Manual or Auto + * Manual Mode: Shutter: Manual Aperture: Manual ISO: Manual + * + * + * All other cameras: + * Program Mode: Shutter: Auto Aperture: Fixed ISO: Auto + * Shutter Priority: Shutter: Manual Aperture: Fixed ISO: Auto + * Aperture Priority: N/A + * Manual Mode: Shutter: Manual Aperture: Manual ISO: Manual + */ +typedef NS_ENUM (NSUInteger, DJICameraExposureMode){ + /** + * Program mode. + */ + DJICameraExposureModeProgram, + /** + * Shutter priority mode. + */ + DJICameraExposureModeShutter, + /** + * Aperture priority mode. + */ + DJICameraExposureModeAperture, + /** + * Manual mode. + */ + DJICameraExposureModeManual, + /** + * The camera exposure mode is unknown. + */ + DJICameraExposureModeUnknown = 0xFF +}; + +/*********************************************************************************/ +#pragma mark - Video Related +/*********************************************************************************/ + +//----------------------------------------------------------------- +#pragma mark DJICameraVideoFileFormat +//----------------------------------------------------------------- +/** + * Video storage formats. + */ +typedef NS_ENUM (NSUInteger, DJICameraVideoFileFormat){ + /** + * The video storage format is MOV. + */ + DJICameraVideoFileFormatMOV, + /** + * The video storage format is MP4. + */ + DJICameraVideoFileFormatMP4, + /** + * The video storage format is unknown. + */ + DJICameraVideoFileFormatUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraVideoResolution +//----------------------------------------------------------------- +/** + * Camera video resolution values. The resolutions available for a product can be found from supportedCameraVideoResolutionAndFrameRateRange. + */ +typedef NS_ENUM (NSUInteger, DJICameraVideoResolution){ + /** + * The camera's video resolution is 2704x1520. + */ + DJICameraVideoResolution2704x1520, + /** + * The camera's video resolution is 1280x720. + */ + DJICameraVideoResolution1280x720, + /** + * The camera's video resolution is 1920x1080. + */ + DJICameraVideoResolution1920x1080, + /** + * The camera's video resolution is 3840x2160. + */ + DJICameraVideoResolution3840x2160, + /** + * The camera's video resolution is 4096x2160. + */ + DJICameraVideoResolution4096x2160, + /** + * The camera's video resolution is unknown. + */ + DJICameraVideoResolutionUnknown, +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraVideoFrameRate +//----------------------------------------------------------------- +/** + * Camera video frame rate values. The frame rates available for a product can be found from supportedCameraVideoResolutionAndFrameRateRange. + */ +typedef NS_ENUM (NSUInteger, DJICameraVideoFrameRate){ + /** + * The camera's video frame rate is 24fps (frames per second). + */ + DJICameraVideoFrameRate24fps = 0x00, + /** + * The camera's video frame rate is 25fps (frames per second). + */ + DJICameraVideoFrameRate25fps, + /** + * The camera's video frame rate is 30fps (frames per second). + */ + DJICameraVideoFrameRate30fps, + /** + * The camera's video frame rate is 48fps (frames per second). + */ + DJICameraVideoFrameRate48fps, + /** + * The camera's video frame rate is 50fps (frames per second). + */ + DJICameraVideoFrameRate50fps, + /** + * The camera's video frame rate is 60fps (frames per second). + */ + DJICameraVideoFrameRate60fps, + /** + * The camera's video frame rate is 120fps (frames per second). + * The frame rate can only be used when Slow Motion enabled. + */ + DJICameraVideoFrameRate120fps, + /** + * The camera's video frame rate is unknown. + */ + DJICameraVideoFrameRateUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraVideoStandard +//----------------------------------------------------------------- +/** + * Video standard values. The default value is NTSC. + */ +typedef NS_ENUM (NSUInteger, DJICameraVideoStandard){ + /** + * The camera video standard value is set to PAL. + */ + DJICameraVideoStandardPAL, + /** + * The camera video standard value is set to NTSC. + */ + DJICameraVideoStandardNTSC, + /** + * The camera video standard value is unknown. + */ + DJICameraVideoStandardUnknown = 0xFF +}; + +/*********************************************************************************/ +#pragma mark - Photo related +/*********************************************************************************/ + +//----------------------------------------------------------------- +#pragma mark DJICameraPhotoFileFormat +//----------------------------------------------------------------- +/** + * Camera photo file formats. The default value is CameraPhotoJPEG. + */ +typedef NS_ENUM (NSUInteger, DJICameraPhotoFileFormat){ + /** + * The camera's photo storage format is RAW. + */ + DJICameraPhotoFileFormatRAW = 0x00, + /** + * The camera's photo storage format is JPEG. + */ + DJICameraPhotoFileFormatJPEG = 0x01, + /** + * The camera's photo storage format stores both the RAW and JPEG + * formats of the photo. + */ + DJICameraPhotoFileFormatRAWAndJPEG = 0x02, + /** + * The camera's photo storage format is unknown. + */ + DJICameraPhotoFileFormatUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraPhotoTimeLapseFileFormat +//----------------------------------------------------------------- +/** + * File format for camera when it is in time-lapse mode. The + * default file format is video. If video+JPEG is selected the minimum interval will be 2 seconds. + */ +typedef NS_ENUM (NSUInteger, DJICameraPhotoTimeLapseFileFormat) { + /** + * The camera in time-lapse mode will generate video + */ + DJICameraPhotoTimeLapseFileFormatVideo = 0x00, + /** + * The camera in time-lapse mode will generate video and JPEG + */ + DJICameraPhotoTimeLapseFileFormatVideoAndJPEG, + /** + * The file format is unknown + */ + DJICameraPhotoTimeLapseFileFormatUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraPhotoQuality +//----------------------------------------------------------------- +/** + * Photo quality of the JPEG image. Higher photo quality results in larger file size. + * The default value is CameraPhotoQualityExcellent. + */ +typedef NS_ENUM (NSUInteger, DJICameraPhotoQuality){ + /** + * The photo quality is normal. + */ + DJICameraPhotoQualityNormal, + /** + * The photo quality is fine. + */ + DJICameraPhotoQualityFine, + /** + * The photo quality is excellent. + */ + DJICameraPhotoQualityExcellent, + /** + * The photo quality is unknown. + */ + DJICameraPhotoQualityUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraPhotoAspectRatio +//----------------------------------------------------------------- +/** + * Photo aspect ratio, where the first value is the width and the + * second value is the height. The default value is CameraPhotoRatio4_3. + */ +typedef NS_ENUM (NSUInteger, DJICameraPhotoAspectRatio){ + /** + * The camera's photo ratio is 4 : 3. + */ + DJICameraPhotoAspectRatio4_3, + /** + * The camera's photo ratio is 16 : 9. + */ + DJICameraPhotoAspectRatio16_9, + /** + * The camera's photo ratio is unknown. + */ + DJICameraPhotoAspectRatioUnknown = 0xFF +}; + + +//----------------------------------------------------------------- +#pragma mark DJICameraPhotoBurstCount +//----------------------------------------------------------------- +/** + * The amount of photos taken in one burst shot (shooting photo in burst mode). + */ +typedef NS_ENUM (NSUInteger, DJICameraPhotoBurstCount){ + /** + * The camera burst shoot count is set to shoot 3 at once pictures when the camera + * shoots a photo. + */ + DJICameraPhotoBurstCount3 = 0x03, + /** + * The camera burst shoot count is set to capture 5 at once pictures when the camera + * takes a photo. + */ + DJICameraPhotoBurstCount5 = 0x05, + /** + * The camera burst shoot count is set to capture 7 at once pictures when the camera + * takes a photo. + */ + DJICameraPhotoBurstCount7 = 0x07, + /** + * The camera burst shoot count value is unknown. + */ + DJICameraPhotoBurstCountUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraPhotoAEBParam +//----------------------------------------------------------------- +/** + * AEB continue capture parameter values. + */ +typedef struct +{ + /** + * Exposure offset value. A value is mapped to an exposure offset. 2 = 0.3EV, 3 = 0.7EV, + * 4 = 1.0EV, 5 = 1.3EV, 6 = 1.7EV, 7 = 2.0EV, 8 = 2.3EV, 9 = 2.7EV, 10 = 3.0ev. + * The default value is 2.3ev. + * When captureCount is 3, the valid range for exposureOffset is [2, 10]. + * When captureCount is 5, the valid range for exposureOffset is [2, 5]. + */ + uint8_t exposureOffset; + /** + * The number of pictures to continuously take at one time. + * If the exposureOffest is larger than 5, the captureCount can only be 3. + * Otherwise, the value can only be 3 or 5. + * The default value is 3. + */ + uint8_t captureCount; +} DJICameraPhotoAEBParam; + +//----------------------------------------------------------------- +#pragma mark DJICameraPhotoIntervalParam +//----------------------------------------------------------------- +/** + * Sets the number of pictures, and the time interval between pictures for the Interval shoot photo mode. + */ +typedef struct +{ + /** + * The number of photos to capture. The value should fall in [2, 255]. + * If 255 is selected, then the camera will continue to take pictures until stopShootPhotoWithCompletion is called. + */ + uint8_t captureCount; + + /** + * The time interval between when two photos are taken. + * The range for this parameter depends the photo file format(DJICameraPhotoFileFormat). + * When the file format is JPEG, the range is [2, 2^16-1] seconds. + * For X5 when the file format is RAW or RAW+JPEG, the range is [5, 2^16-1] seconds, for all other + * products the range is [10, 2^16-1]. + */ + uint16_t timeIntervalInSeconds; +} DJICameraPhotoIntervalParam; + +/*********************************************************************************/ +#pragma mark - Camera advanced settings +/*********************************************************************************/ +//----------------------------------------------------------------- +#pragma mark DJICameraShutterSpeed +//----------------------------------------------------------------- +/** + * Camera's shutter speed options. + */ +typedef NS_ENUM (NSUInteger, DJICameraShutterSpeed) { + DJICameraShutterSpeed1_8000 = 0x00, // 1/8000 s + DJICameraShutterSpeed1_6400 = 0x01, // 1/6400 s + DJICameraShutterSpeed1_5000 = 0x02, // 1/5000 s + DJICameraShutterSpeed1_4000 = 0x03, // 1/4000 s + DJICameraShutterSpeed1_3200 = 0x04, // 1/3200 s + DJICameraShutterSpeed1_2500 = 0x05, // 1/2500 s + DJICameraShutterSpeed1_2000 = 0x06, // 1/2000 s + DJICameraShutterSpeed1_1600 = 0x07, // 1/1600 s + DJICameraShutterSpeed1_1250 = 0x08, // 1/1250 s + DJICameraShutterSpeed1_1000 = 0x09, // 1/1000 s + DJICameraShutterSpeed1_800 = 0x0A, // 1/800 s + DJICameraShutterSpeed1_640 = 0x0B, // 1/640 s + DJICameraShutterSpeed1_500 = 0x0C, // 1/500 s + DJICameraShutterSpeed1_400 = 0x0D, // 1/400 s + DJICameraShutterSpeed1_320 = 0x0E, // 1/320 s + DJICameraShutterSpeed1_240 = 0x0F, // 1/240 s + DJICameraShutterSpeed1_200 = 0x10, // 1/200 s + DJICameraShutterSpeed1_160 = 0x11, // 1/160 s + DJICameraShutterSpeed1_120 = 0x12, // 1/120 s + DJICameraShutterSpeed1_100 = 0x13, // 1/100 s + DJICameraShutterSpeed1_80 = 0x14, // 1/80 s + DJICameraShutterSpeed1_60 = 0x15, // 1/60 s + DJICameraShutterSpeed1_50 = 0x16, // 1/50 s + DJICameraShutterSpeed1_40 = 0x17, // 1/40 s + DJICameraShutterSpeed1_30 = 0x18, // 1/30 s + DJICameraShutterSpeed1_25 = 0x19, // 1/25 s + DJICameraShutterSpeed1_20 = 0x1A, // 1/20 s + DJICameraShutterSpeed1_15 = 0x1B, // 1/15 s + DJICameraShutterSpeed1_12p5 = 0x1C, // 1/12.5 s + DJICameraShutterSpeed1_10 = 0x1D, // 1/10 s + DJICameraShutterSpeed1_8 = 0x1E, // 1/8 s + DJICameraShutterSpeed1_6p25 = 0x1F, // 1/6.25 s + DJICameraShutterSpeed1_5 = 0x20, // 1/5 s + DJICameraShutterSpeed1_4 = 0x21, // 1/4 s + DJICameraShutterSpeed1_3 = 0x22, // 1/3 s + DJICameraShutterSpeed1_2p5 = 0x23, // 1/2.5 s + DJICameraShutterSpeed1_2 = 0x24, // 1/2 s + DJICameraShutterSpeed1_1p67 = 0x25, // 1/1.67 s + DJICameraShutterSpeed1_1p25 = 0x26, // 1/1.25 s + DJICameraShutterSpeed1p0 = 0x27, // 1.0 s + DJICameraShutterSpeed1p3 = 0x28, // 1.3 s + DJICameraShutterSpeed1p6 = 0x29, // 1.6 s + DJICameraShutterSpeed2p0 = 0x2A, // 2.0 s + DJICameraShutterSpeed2p5 = 0x2B, // 2.5 s + DJICameraShutterSpeed3p0 = 0x2C, // 3.0 s + DJICameraShutterSpeed3p2 = 0x2D, // 3.2 s + DJICameraShutterSpeed4p0 = 0x2E, // 4.0 s + DJICameraShutterSpeed5p0 = 0x2F, // 5.0 s + DJICameraShutterSpeed6p0 = 0x30, // 6.0 s + DJICameraShutterSpeed7p0 = 0x31, // 7.0 s + DJICameraShutterSpeed8p0 = 0x32, // 8.0 s + DJICameraShutterSpeed9p0 = 0x33, // 9.0 s + DJICameraShutterSpeed10p0 = 0x34, // 10.0 s + DJICameraShutterSpeed13p0 = 0x35, // 13.0 s + DJICameraShutterSpeed15p0 = 0x36, // 15.0 s + DJICameraShutterSpeed20p0 = 0x37, // 20.0 s + DJICameraShutterSpeed25p0 = 0x38, // 25.0 s + DJICameraShutterSpeed30p0 = 0x39, // 30.0 s + + DJICameraShutterSpeedUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraISO +//----------------------------------------------------------------- +/** + * Camera ISO values. + */ +typedef NS_ENUM (NSUInteger, DJICameraISO){ + /** + * The ISO value is automatically set. This cannot be used for all cameras when in Manual mode. + */ + DJICameraISOAuto = 0x00, + /** + * The ISO value is set to 100. + */ + DJICameraISO100 = 0x01, + /** + * The ISO value is set to 200. + */ + DJICameraISO200 = 0x02, + /** + * The ISO value is set to 400. + */ + DJICameraISO400 = 0x03, + /** + * The ISO value is set to 800. + */ + DJICameraISO800 = 0x04, + /** + * The ISO value is set to 1600. + */ + DJICameraISO1600 = 0x05, + /** + * The ISO value is set to 3200. + */ + DJICameraISO3200 = 0x06, + /** + * The ISO value is set to 6400. + */ + DJICameraISO6400 = 0x07, + /** + * The ISO value is set to 12800. + */ + DJICameraISO12800 = 0x08, + /** + * The ISO value is set to 25600. + */ + DJICameraISO25600 = 0x09, + /** + * The ISO value is set to an unknown value. + */ + DJICameraISOUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraAperture +//----------------------------------------------------------------- +/** + * Camera aperture values. Currently, only X5 and X5 Raw support + * this setting. + * + */ +typedef NS_ENUM (NSUInteger, DJICameraAperture) { + DJICameraApertureF1p7, // f/1.7 + DJICameraApertureF1p8, // f/1.8 + DJICameraApertureF2, // f/2 + DJICameraApertureF2p2, // f/2.2 + DJICameraApertureF2p5, // f/2.5 + DJICameraApertureF2p8, // f/2.8 + DJICameraApertureF3p2, // f/3.2 + DJICameraApertureF3p5, // f/3.5 + DJICameraApertureF4, // f/4 + DJICameraApertureF4p5, // f/4.5 + DJICameraApertureF5, // f/5 + DJICameraApertureF5p6, // f/5.6 + DJICameraApertureF6p3, // f/6.3 + DJICameraApertureF7p1, // f/7.1 + DJICameraApertureF8, // f/8 + DJICameraApertureF9, // f/9 + DJICameraApertureF10, // f/10 + DJICameraApertureF11, // f/11 + DJICameraApertureF13, // f/13 + DJICameraApertureF14, // f/14 + DJICameraApertureF16, // f/16 + DJICameraApertureF18, // f/18 + DJICameraApertureF20, // f/20 + DJICameraApertureF22, // f/22 + DJICameraApertureUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraWhiteBalance +//----------------------------------------------------------------- +/** + * Camera white balance. The default value is CameraWhiteBalanceAuto. + */ +typedef NS_ENUM (NSUInteger, DJICameraWhiteBalance){ + /** + * The camera's white balance is automatically set. + */ + DJICameraWhiteBalanceAuto = 0x00, + /** + * The camera's white balance is set to sunny. + */ + DJICameraWhiteBalanceSunny = 0x01, + /** + * The camera's white balance is set to cloudy. + */ + DJICameraWhiteBalanceCloudy = 0x02, + /** + * The camera's white balance is set to water surface. + */ + DJICameraWhiteBalanceWaterSuface = 0x03, + /** + * The camera's white balance is set to indoors and incandescent light. + */ + DJICameraWhiteBalanceIndoorsIncandescent = 0x04, + /** + * The camera's white balance is set to indoors and fluorescent light. + */ + DJICameraWhiteBalanceIndoorsFluorescent = 0x05, + /** + * The camera's white balance is set to custom color temperature. + * By using this white balance value, user can set a specific value for the + * color temperature. + */ + DJICameraWhiteBalanceCustomColorTemperature = 0x06, + /** + * The camera's white balance is unknown. + */ + DJICameraWhiteBalanceUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraMeteringMode +//----------------------------------------------------------------- +/** + * Camera exposure metering. The default value is CameraExposureMeteringCenter. + */ +typedef NS_ENUM (NSUInteger, DJICameraMeteringMode){ + /** + * The camera's exposure metering is set to the center. + */ + DJICameraMeteringModeCenter = 0x00, + /** + * The camera's exposure metering is set to average. + */ + DJICameraMeteringModeAverage = 0x01, + /** + * The camera's exposure metering is set to a single spot. + */ + DJICameraMeteringModeSpot = 0x02, + /** + * The camera's exposure metering is unknown. + */ + DJICameraMeteringModeUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraExposureCompensation +//----------------------------------------------------------------- +/** + * Camera exposure compensation. + */ +typedef NS_ENUM (NSUInteger, DJICameraExposureCompensation){ + /** + * The camera's exposure compensation is -5.0ev. + */ + DJICameraExposureCompensationN50 = 0x01, + /** + * The camera's exposure compensation is -4.7ev. + */ + DJICameraExposureCompensationN47, + /** + * The camera's exposure compensation is -4.3ev. + */ + DJICameraExposureCompensationN43, + /** + * The camera's exposure compensation is -4.0ev. + */ + DJICameraExposureCompensationN40, + /** + * The camera's exposure compensation is -3.7ev. + */ + DJICameraExposureCompensationN37, + /** + * The camera's exposure compensation is -3.3ev. + */ + DJICameraExposureCompensationN33, + /** + * The camera's exposure compensation is -3.0ev. + */ + DJICameraExposureCompensationN30, + /** + * The camera's exposure compensation is -2.7ev. + */ + DJICameraExposureCompensationN27, + /** + * The camera's exposure compensation is -2.3ev. + */ + DJICameraExposureCompensationN23, + /** + * The camera's exposure compensation is -2.0ev. + */ + DJICameraExposureCompensationN20, + /** + * The camera's exposure compensation is -1.7ev. + */ + DJICameraExposureCompensationN17, + /** + * The camera's exposure compensation is -1.3ev. + */ + DJICameraExposureCompensationN13, + /** + * The camera's exposure compensation is -1.0ev. + */ + DJICameraExposureCompensationN10, + /** + * The camera's exposure compensation is -0.7ev. + */ + DJICameraExposureCompensationN07, + /** + * The camera's exposure compensation is -0.3ev. + */ + DJICameraExposureCompensationN03, + /** + * The camera's exposure compensation is 0.0ev. + */ + DJICameraExposureCompensationN00, + /** + * The camera's exposure compensation is +0.3ev. + */ + DJICameraExposureCompensationP03, + /** + * The camera's exposure compensation is +0.7ev. + */ + DJICameraExposureCompensationP07, + /** + * The camera's exposure compensation is +1.0ev. + */ + DJICameraExposureCompensationP10, + /** + * The camera's exposure compensation is +1.3ev. + */ + DJICameraExposureCompensationP13, + /** + * The camera's exposure compensation is +1.7ev. + */ + DJICameraExposureCompensationP17, + /** + * The camera's exposure compensation is +2.0ev. + */ + DJICameraExposureCompensationP20, + /** + * The camera's exposure compensation is +2.3ev. + */ + DJICameraExposureCompensationP23, + /** + * The camera's exposure compensation is +2.7ev. + */ + DJICameraExposureCompensationP27, + /** + * The camera's exposure compensation is +3.0ev. + */ + DJICameraExposureCompensationP30, + /** + * The camera's exposure compensation is +3.3ev. + */ + DJICameraExposureCompensationP33, + /** + * The camera's exposure compensation is +3.7ev. + */ + DJICameraExposureCompensationP37, + /** + * The camera's exposure compensation is +4.0ev. + */ + DJICameraExposureCompensationP40, + /** + * The camera's exposure compensation is +4.3ev. + */ + DJICameraExposureCompensationP43, + /** + * The camera's exposure compensation is +4.7ev. + */ + DJICameraExposureCompensationP47, + /** + * The camera's exposure compensation is +5.0ev. + */ + DJICameraExposureCompensationP50, + /** + * The camera's exposure compensation is unknown. + */ + DJICameraExposureCompensationUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraAntiFlicker +//----------------------------------------------------------------- +/** + * Camera anti-flickers. The default value is CameraAntiFlicker50Hz. + */ +typedef NS_ENUM (NSUInteger, DJICameraAntiFlicker){ + /** + * The camera's anti-flicker is automatically set. + */ + DJICameraAntiFlickerAuto = 0x00, + /** + * The camera's anti-flicker is 60 Hz. + */ + DJICameraAntiFlicker60Hz = 0x01, + /** + * The camera's anti-flicker is 50 Hz. + */ + DJICameraAntiFlicker50Hz = 0x02, + /** + * The camera's anti-flicker is unknown. + */ + DJICameraAntiFlickerUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraSharpness +//----------------------------------------------------------------- +/** + * Camera sharpnesss. The default value is CameraSharpnessStandard. + */ +typedef NS_ENUM (NSUInteger, DJICameraSharpness){ + /** + * The camera's sharpness is set to standard. + */ + DJICameraSharpnessStandard = 0x00, + /** + * The camera's sharpness is set to hard. + */ + DJICameraSharpnessHard = 0x01, + /** + * The camera's sharpness is set to soft. + */ + DJICameraSharpnessSoft = 0x02, + /** + * The camera's sharpness is set to unknown. + */ + DJICameraSharpnessUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraContrast +//----------------------------------------------------------------- +/** + * Camera contrast. The default value is CameraContrastStandard. + */ +typedef NS_ENUM (NSUInteger, DJICameraContrast){ + /** + * The camera's contrast is set to standard. + */ + DJICameraContrastStandard = 0x00, + /** + * The camera's contrast is set to hard. + */ + DJICameraContrastHard = 0x01, + /** + * The camera's contrast is set to soft. + */ + DJICameraContrastSoft = 0x02, + /** + * The camera's contrast is unknown. + */ + DJICameraContrastUnknown = 0xFF +}; + +/*********************************************************************************/ +#pragma mark - Lens related +/*********************************************************************************/ + +//----------------------------------------------------------------- +#pragma mark DJICameraLensFocusMode +//----------------------------------------------------------------- +/** + * Camera focus mode. + * It is settable only when IsAdjustableFocalPointSupported returns YES and the physical AF switch on the camera is set to auto. + */ +typedef NS_ENUM (NSUInteger, DJICameraLensFocusMode){ + /* + * The camera's focus mode is set to manual. + * In this mode, user sets the focus ring value to adjust the focal distance. + */ + DJICameraLensFocusModeManual, + /* + * The camera's focus mode is set to auto. + * In this mode, user sets the lens focus target to adjust the focal point. + */ + DJICameraLensFocusModeAuto, + /* + * The camera's focus mode is unkown. + */ + DJICameraLensFocusModeUnknown = 0xFF +}; + +/*********************************************************************************/ +#pragma mark - Others +/*********************************************************************************/ + +//----------------------------------------------------------------- +#pragma mark DJICameraFileIndexMode +//----------------------------------------------------------------- +/** + * File index modes. + */ +typedef NS_ENUM (NSUInteger, DJICameraFileIndexMode){ + /** + * Camera will reset the newest file's index to be one larger than the largest number of photos + * taken on the SD card. + */ + DJICameraFileIndexModeReset, + /** + * Camera will set the newest file's index to the larger of either the maximum number of photos + * taken on the SD card or the camera. + */ + DJICameraFileIndexModeSequence, + /** + * The mode is unknown. + */ + DJICameraFileIndexModeUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraCustomSettings +//----------------------------------------------------------------- +/** + * Camera user settings. A user can save or load camera settings to or from the specified user. + */ +typedef NS_ENUM (NSUInteger, DJICameraCustomSettings){ + /** + * Default user. + */ + DJICameraCustomSettingsDefault, + /** + * Settings for user 1. + */ + DJICameraCustomSettingsProfile1, + /** + * Settings for user 2. + */ + DJICameraCustomSettingsProfile2, + /** + * Settings for user 3. + */ + DJICameraCustomSettingsProfile3, + /** + * Settings for user 4. + */ + DJICameraCustomSettingsProfile4, + /** + * The user is unknown. + */ + DJICameraCustomSettingsUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJICameraDigitalFilter +//----------------------------------------------------------------- +/** + * Camera digital filters. The default value is DJICameraDigitalFilterNone. + */ +typedef NS_ENUM (NSUInteger, DJICameraDigitalFilter){ + /** + * The digital filter is set to none or no filter. + */ + DJICameraDigitalFilterNone, + /** + * The digital filter is set to art. + */ + DJICameraDigitalFilterArt, + /** + * The digital filter is set to reminiscence. + */ + DJICameraDigitalFilterReminiscence, + /** + * The digital filter is set to inverse. + */ + DJICameraDigitalFilterInverse, + /** + * The digital filter is set to black and white. + */ + DJICameraDigitalFilterBlackAndWhite, + /** + * The digital filter is set to bright. + */ + DJICameraDigitalFilterBright, + /** + * The digital filter is set to movie. + */ + DJICameraDigitalFilterMovie, + /** + * This digital filter is currently not supported. + */ + DJICameraDigitalFilterPunk, + /** + * This digital filter is currently not supported. + */ + DJICameraDigitalFilterPopArt, + /** + * This digital filter is currently not supported. + */ + DJICameraDigitalFilterWedding, + /** + * This digital filter is currently not supported. + */ + DJICameraDigitalFilterTinyHole, + /** + * This digital filter is currently not supported. + */ + DJICameraDigitalFilterMiniature, + /** + * This digital filter is currently not supported. + */ + DJICameraDigitalFilterOilPainting, + /** + * This digital filter is currently not supported. + */ + DJICameraDigitalFilterWaterColor, + /** + * The digital filter is set to M31. + */ + DJICameraDigitalFilterM31, + /** + * The digital filter is set to delta. + */ + DJICameraDigitalFilterDelta, + /** + * The digital filter is set to kDX. + */ + DJICameraDigitalFilterkDX, + /** + * The digital filter is set to DK79. + */ + DJICameraDigitalFilterDK79, + /** + * The digital filter is set to prismo. + */ + DJICameraDigitalFilterPrismo, + /** + * The digital filter is set to jugo. + */ + DJICameraDigitalFilterJugo, + /** + * The digital filter is set to vision 4. + */ + DJICameraDigitalFilterVision4, + /** + * The digital filter is set to vision 6. + */ + DJICameraDigitalFilterVision6, + /** + * The digital filter is set to vision x. + */ + DJICameraDigitalFilterVisionX, + /** + * The digital filter is set to neutral. + */ + DJICameraDigitalFilterNeutral, + /** + * The digital filter is unknown. + */ + DJICameraDigitalFilterUnknown = 0xFF +}; + +//----------------------------------------------------------------- +#pragma mark DJIDownloadFileType +//----------------------------------------------------------------- +/** + * Download file types. This typedef is only supported for the Phantom 3 + * Professional and the Inspire 1. + */ +typedef NS_ENUM (NSUInteger, DJIDownloadFileType){ + /** + * The file to be download is a photo file type. + */ + DJIDownloadFileTypePhoto, + /** + * The file to be downloaded is a RAW type in DNG format. + */ + DJIDownloadFileTypeRAWDNG, + /** + * The file to be downloaded is a video file in 720P. + */ + DJIDownloadFileTypeVideo720P, + /** + * The file to be downloaded is a video file in 1080P. + */ + DJIDownloadFileTypeVideo1080P, + /** + * The file to be downloaded is a video file in 4K. + */ + DJIDownloadFileTypeVideo4K, + /** + * The file to be downloaded is unknown. + */ + DJIDownloadFileTypeUnknown +}; + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJICameraSystemState.h b/DJISDK.framework/Headers/DJICameraSystemState.h new file mode 100644 index 0000000..c0d4eec --- /dev/null +++ b/DJISDK.framework/Headers/DJICameraSystemState.h @@ -0,0 +1,75 @@ +// +// DJICameraSystemState.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +/** + * This class provides general information and current status of the camera. + */ +@interface DJICameraSystemState : NSObject + +/** + * YES when camera is performing any photo capture in any shootPhotoMode. Between photo capture in interval and time lapse mode, this property will be NO. The camera is shooting single photo. + * + */ +@property(nonatomic, readonly) BOOL isShootingSinglePhoto; + +/** + * YES when the camera is performing a photo capture in RAW or RAW+JPEG format. Between photo capture in interval and time lapse mode, this property will + * be NO. If saving the photo in JPEG only, this property will always be NO. + */ +@property(nonatomic, readonly) BOOL isShootingSinglePhotoInRAWFormat; + +/** + * YES when camera is performing an interval capture. Will be yes after startShootPhoto is called, and NO after stopShootPhoto is called. + */ +@property(nonatomic, readonly) BOOL isShootingIntervalPhoto; + +/** + * YES when camera is performing a burst capture. Will be yes after startShootPhoto is called, and NO after burst is complete. + * The camera is shooting burst photos. + */ +@property(nonatomic, readonly) BOOL isShootingBurstPhoto; + +/** + * YES if camera is recording video + */ +@property(nonatomic, readonly) BOOL isRecording; + +/** + * YES if camera is storing a photo. + * When isStoringPhoto is YES, user cannot change the camera mode or start to shoot another photo. + */ +@property(nonatomic, readonly) BOOL isStoringPhoto; + +/** + * YES if camera is too hot. + */ +@property(nonatomic, readonly) BOOL isCameraOverHeated; + +/** + * The camera's sensor error. + */ +@property(nonatomic, readonly) BOOL isCameraError; + +/** + * Indicate whether the camera is in usb mode. + */ +@property(nonatomic, readonly) BOOL isUSBMode; + +/** + * Current mode of the camera. + */ +@property(nonatomic, readonly) DJICameraMode mode; + +/** + * Time of current video being recorded by camera in seconds. + */ +@property(nonatomic, readonly) int currentVideoRecordingTimeInSeconds; + +@end \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJICompass.h b/DJISDK.framework/Headers/DJICompass.h new file mode 100644 index 0000000..a3969dd --- /dev/null +++ b/DJISDK.framework/Headers/DJICompass.h @@ -0,0 +1,79 @@ +// +// DJICompass.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM (NSUInteger, DJICompassCalibrationStatus){ + /** + * Compass not in calibration. + */ + DJICompassCalibrationStatusNone, + /** + * Compass horizontal calibration. User should hold the aircraft horizontally and rotate it 360 degree. + */ + DJICompassCalibrationStatusHorizontal, + /** + * Compass vertical calibration. User should hold the aircraft vertically, with the nose pointed towards the ground, and rotate aircraft 360 degrees. + */ + DJICompassCalibrationStatusVertical, + /** + * Compass calibration succeeded. + */ + DJICompassCalibrationStatusSucceeded, + /** + * Compass calibration failed. Make sure there are no magnets or metal objects near the compass and retry. + */ + DJICompassCalibrationStatusFailed, + /** + * Compass calibration status unknown. + */ + DJICompassCalibrationStatusUnknown, +}; + +/** + * This class contains important status of the compass of the product. Also it provides methods to calibrate the compass. + */ +@interface DJICompass : NSObject + +/** + * Represents the heading in degrees. True North is 0 degrees heading, positive heading is East of North, negative heading is West of North and heading bounds are [-180, 180]. + */ +@property(nonatomic, readonly) double heading; + +/** + * YES if the compass has error. If YES, the compass needs calibration. + */ +@property(nonatomic, readonly) BOOL hasError; + +/** + * YES if the compass is currently calibrating. + */ +@property(nonatomic, readonly) BOOL isCalibrating; + +/** + * Shows the calibration status. + */ +@property(nonatomic, readonly) DJICompassCalibrationStatus calibrationStatus; + +/** + * Starts compass calibration. Make sure there are no magnets or metal objects near the compass. + * + */ +- (void)startCalibrationWithCompletion:(DJICompletionBlock)completion; + +/** + * Stops compass calibration. + * + */ +- (void)stopCalibrationWithCompletion:(DJICompletionBlock)completion; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJICustomMission.h b/DJISDK.framework/Headers/DJICustomMission.h new file mode 100644 index 0000000..185343e --- /dev/null +++ b/DJISDK.framework/Headers/DJICustomMission.h @@ -0,0 +1,49 @@ +// +// DJICustomMission.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class DJIMissionStep; + +/** + * + * This class contains real-time status of the executing custom mission. + * + */ +@interface DJICustomMissionStatus : DJIMissionProgressStatus + +/** + * The mission step executing in currently. + */ +@property(nonatomic, readonly) DJIMissionStep *_Nullable currentExecutingStep; + +/** + * The execution progress status of current mission step. + */ +@property(nonatomic, readonly) DJIMissionProgressStatus *_Nullable progressStatus; + +@end + +/** + * The DJICustomMission class is a subclass of DJIMission. You can use it to create a custom mission that + * is made up of a sequence of mission steps. + * After the custom mission is uploaded and started, the sequence of mission steps will be executed. + * + */ +@interface DJICustomMission : DJIMission + +/** + * Create a custom mission with an array of DJIMissionStep objects. + * @see DJIMissionStep + */ +- (instancetype _Nullable)initWithSteps:(NSArray *_Nonnull)steps; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIFlightController.h b/DJISDK.framework/Headers/DJIFlightController.h new file mode 100644 index 0000000..d1b0a30 --- /dev/null +++ b/DJISDK.framework/Headers/DJIFlightController.h @@ -0,0 +1,484 @@ +// +// DJIFlightController.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import +#import +#import + +@class DJIFlightController; +@class DJIFlightLimitation; +@class DJILandingGear; +@class DJICompass; + +NS_ASSUME_NONNULL_BEGIN + +/** + * No fly zone. Check flysafe.dji.com for all no fly + * zones that are pre-set by DJI. A user or develepor + * is not allowed to set their own no fly zone. + * + * The zone radius is a radius around the no fly zone + * center coordinate that determines how large the + * no fly zone is around the center coordinate. + * + * Once the aircraft is 100 meters away from a no fly + * zone, the user should be continuously notified that + * the aircraft is approaching a no fly zone. If the + * aircraft enters a no fly zone, it will stop and hover + * at the border. + */ +//----------------------------------------------------------------- +#pragma mark DJINoFlyZone +//----------------------------------------------------------------- +typedef struct +{ + float zoneRadius; + CLLocationCoordinate2D zoneCenterCoordinate; +} DJINoFlyZone; + +//----------------------------------------------------------------- +#pragma mark DJIFlightControl +//----------------------------------------------------------------- + +/** + * Flight control coordinate system + */ +typedef NS_ENUM (uint8_t, DJIVirtualStickFlightCoordinateSystem){ + /** + * Ground coordinate system + */ + DJIVirtualStickFlightCoordinateSystemGround, + /** + * Body coordinate system + */ + DJIVirtualStickFlightCoordinateSystemBody, +}; + +/** + * Vertical control velocity MIN value -4 m/s in VirtualStickControlMode. Positive velocity is up. + */ +DJI_API_EXTERN const float DJIVirtualStickVerticalControlMinVelocity; +/** + * Vertical control velocity MAX value 4 m/s in VirtualStickControlMode. Positive velocity is up. + */ +DJI_API_EXTERN const float DJIVirtualStickVerticalControlMaxVelocity; + +/** + * Vertical control position MIN for VirtualStickVerticalControlModePosition. Currently set at 0m. + */ +DJI_API_EXTERN const float DJIVirtualStickVerticalControlMinPosition; +/** + * Vertical control position MAX for VirtualStickVerticalControlModePosition. Currently set at 500m. + */ +DJI_API_EXTERN const float DJIVirtualStickVerticalControlMaxPosition; + +/** + * Defines how vertical control values are interpreted by the aircraft. + */ +typedef NS_ENUM (uint8_t, DJIVirtualStickVerticalControlMode){ + /** + * Sets the Virtual Stick Control vertical control values to be a vertical velocity. + * Positive and negative vertical velocity is for the aircraft ascending and descending + * respectively. Maximum vertical velocity is defined as DJIVirtualStickVerticalControlMaxVelocity; + * Minimum vertical velocity is defined as DJIVirtualStickVerticalControlMinVelocity. + */ + DJIVirtualStickVerticalControlModeVelocity, + /** + * Sets the VirtualStickControlMode vertical control values to be an altitude. Maximum position is defined as DJIVirtualStickVerticalControlMaxPosition. + * Minimum position is defined as DJIVirtualStickVerticalControlMinPosition. + */ + DJIVirtualStickVerticalControlModePosition, +}; + +/** + * RollPitch control velocity MAX value 15m/s + */ +DJI_API_EXTERN const float DJIVirtualStickRollPitchControlMaxVelocity; +/** + * RollPitch control velocity MIN value -15m/s + */ +DJI_API_EXTERN const float DJIVirtualStickRollPitchControlMinVelocity; +/** + * RollPitch control angle MAX value 30 degree + */ +DJI_API_EXTERN const float DJIVirtualStickRollPitchControlMaxAngle; +/** + * RollPitch control angle MIN value -30 degree + */ +DJI_API_EXTERN const float DJIVirtualStickRollPitchControlMinAngle; + +/** + * Defines how manual roll and pitch values are interpreted by the aircraft. + */ +typedef NS_ENUM (uint8_t, DJIVirtualStickRollPitchControlMode){ + /** + * Sets the VirtualStickControlMode roll and pitch values to be an angle relative to + * a level aircraft. In the body coordinate system, positive and negative pitch angle is for the aircraft rotating about + * the y axis in positive direction or in negative direction respectively. Positive and negative roll angle is the positive direction or + * negative direction rotation angle about the x axis respectively. + * However in the ground coordinate system, positive and negative pitch angle is the angle value for the aircraft moving south and + * north respectively. Positive and negative roll angle is the angle when the aircraft is moving east and west respectively. + * Maximum angle is defined as DJIVirtualStickRollPitchControlMaxAngle; + * Minimum angle is defined as DJIVirtualStickRollPitchControlMinAngle; + */ + DJIVirtualStickRollPitchControlModeAngle, + /** + * Sets the VirtualStickControlMode roll and pitch values to be a velocity. + * In the body coordinate system, positive and negative pitch velocity is for the aircraft moving towards the positive direction or + * negative direction along the pitch axis/y axis respectively. Positive and negative roll velocity is when the aircraft is moving towards + * the positive direction or negative direction along the roll axis/x axis respectively. + * However, in the ground coordinate system, positive and negative pitch velocity is for the aircraft moving east and west respectively. + * Positive and negative roll velocity is when the aircraft is moving north and south respectively. + * Maximum velocity is defined as DJIVirtualStickRollPitchControlMaxVelocity; + * Minimum velocity is defined as DJIVirtualStickRollPitchControlMinVelocity. + */ + DJIVirtualStickRollPitchControlModeVelocity, +}; + +/** + * Yaw control angle MAX value 180 degree + */ +DJI_API_EXTERN const float DJIVirtualStickYawControlMaxAngle; +/** + * Yaw control angle MIN value -180 degree + */ +DJI_API_EXTERN const float DJIVirtualStickYawControlMinAngle; +/** + * Yaw control angular velocity MAX value 100 degree/s + */ +DJI_API_EXTERN const float DJIVirtualStickYawControlMaxAngularVelocity; +/** + * Yaw control angular velocity MIN value -100 degree/s + */ +DJI_API_EXTERN const float DJIVirtualStickYawControlMinAngularVelocity; + +/** + * Defines how manual yaw values are interpreted by the aircraft. + */ +typedef NS_ENUM (uint8_t, DJIVirtualStickYawControlMode){ + /** + * Sets the VirtualStickControlMode yaw values to be an angle relative to the front of the aircraft. + * Positive and negative yaw angle is for the aircraft rotating clockwise and counterclockwise + * respectively. Maximum yaw angle is defined as DJIVirtualStickYawControlMaxAngle; Minimum yaw + * angle is defined as DJIVirtualStickYawControlMinAngle; + */ + DJIVirtualStickYawControlModeAngle, + /** + * Sets the VirtualStickControlMode yaw values to be an angular velocity. Positive and negative + * angular velocity is for the aircraft rotating clockwise and counterclockwise respectively. Maximum + * yaw angular velocity is defined as DJIVirtualStickYawControlMaxAngularVelocity; Minimum yaw angular + * velocity is defined as DJIVirtualStickYawControlMinAngularVelocity; + */ + DJIVirtualStickYawControlModeAngularVelocity, +}; + + +/** + * Contains all the virtual stick control data needed to move the aircraft in all directions + */ +typedef struct +{ + /** + * Velocity (m/s) in Y axis or Angle (degrees) value for pitch. Use DJIVirtualStickRollPitchControlMode to + * set velocity or angle mode. Note that the argument has different meanings in different coordinate systems. + * Please refer to the Get Started Flight Controller User Guide to find more details. + */ + float pitch; + /** + * Velocity (m/s) in X axis or Angle (degrees) value for roll. Use DJIVirtualStickRollPitchControlMode to + * set velocity or angle mode. Note that the argument has different meanings in different coordinate systems. + * Please refer to the Get Started Flight Controller User Guide to find more details. + */ + float roll; + /** + * Angular Velocity (degrees/s) or Angle (degrees) value for yaw. + * Use DJIVirtualStickYawControlMode to set angular velocity or angle mode. + */ + float yaw; + /** + * Velocity (m/s) or Alititude (m) value for verticalControl. + * Use DJIVirtualStickVerticalControlMode to set velocity or altitude mode. + */ + float verticalThrottle; +} DJIVirtualStickFlightControlData; + +/*********************************************************************************/ +#pragma mark - DJIFlightControllerDelegate +/*********************************************************************************/ +/** + * + * This protocol provides delegate methods to update flight controller's current state. + * + */ +@protocol DJIFlightControllerDelegate + +@optional + +/** + * Callback function that updates the flight controller's current state data. This method gets + * called 10 times per second after startUpdatingFlightControllerCurrentState is called. + * + * @param fc Instance of the flight controller for which the data will be updated. + * @param state Current state of the flight controller. + */ +- (void)flightController:(DJIFlightController *)fc didUpdateSystemState:(DJIFlightControllerCurrentState *)state; + +/** + * Callback function that updates the data received from an external device (e.g. the onboard device). + * It is only supported for the Matrice 100. + * + * @param fc Instance of the flight controller for which the data will be updated. + * @param data Data received from an external device. The size of the data will not be larger + * than 100 bytes. + */ +- (void)flightController:(DJIFlightController *)fc didReceiveDataFromExternalDevice:(NSData *)data; + +@end + +/*********************************************************************************/ +#pragma mark - DJIFlightController +/*********************************************************************************/ + +/** + * This class contains components of the flight controller. Also, it provides methods to send different commands to the flight controller. + */ +@interface DJIFlightController : DJIBaseComponent + +/** + * Flight controller's delegate. + */ +@property(nonatomic, weak) id delegate; + +/** + * Flight limitation object. This object sets, gets and tracks state of the maximum flight height + * and radius allowed. + */ +@property(nonatomic, readonly) DJIFlightLimitation *flightLimitation; + +/** + * Landing Gear object. For products with moveable landing gear only. + */ +@property(nonatomic, readonly) DJILandingGear *landingGear; + +/** + * Compass object. + */ +@property(nonatomic, readonly) DJICompass *compass; + +/** + * Vertical control mode + */ +@property(nonatomic, assign) DJIVirtualStickVerticalControlMode verticalControlMode; +/** + * RollPitch control mode + */ +@property(nonatomic, assign) DJIVirtualStickRollPitchControlMode rollPitchControlMode; +/** + * Yaw control mode + */ +@property(nonatomic, assign) DJIVirtualStickYawControlMode yawControlMode; +/** + * RollPitch control coordinate system + */ +@property(nonatomic, assign) DJIVirtualStickFlightCoordinateSystem rollPitchCoordinateSystem; + +//----------------------------------------------------------------- +#pragma mark Methods +//----------------------------------------------------------------- +/** + * Starts aircraft takeoff. Takeoff is considered complete when the aircraft is hovering 1.2 meters (4 feet) + * above the ground. Completion block is called when aircraft crosses 0.5 meters (1.6 feet). + * + */ +- (void)takeoffWithCompletion:(DJICompletionBlock)completion; + +/** + * Stops aircraft takeoff. If called before takeoffWithCompletion is complete, the aircraft will cancel + * takeoff (takeoffWithCompletion completion block will return an error) and hover at the current height. + * + */ +- (void)cancelTakeoffWithCompletion:(DJICompletionBlock)completion; + +/** + * Starts auto-landing of the aircraft. Landing is considered complete once the aircraft lands on the ground, + * and powers down propellors to medium throttle. + * + */ +- (void)autoLandingWithCompletion:(DJICompletionBlock)completion; + +/** + * Stops auto-landing the aircraft. If called before startAutoLandingWithCompletion is complete, then the auto + * landing will be cancelled (startAutoLandingWithCompletion completeion block will return an error) and the + * aircraft will hover at its current location. + * + */ +- (void)cancelAutoLandingWithCompletion:(DJICompletionBlock)completion; + +/** + * Turns on the aircraft's motors. + * This method is not supported by the current firmware version. + */ +- (void)turnOnMotorsWithCompletion:(DJICompletionBlock)completion; + +/** + * Turns off the aircraft's motors. The method can only be called when the aircraft is on the ground. + */ +- (void)turnOffMotorsWithCompletion:(DJICompletionBlock)completion; + +/** + * The aircraft will start to go home. This method is considered complete once the aircraft has landed at + * its home position. + * + */ +- (void)goHomeWithCompletion:(DJICompletionBlock)completion; + +/** + * The aircraft will stop going home and will hover in place. goHomeWithCompletion completion block will immediately return an error. + * + */ +- (void)cancelGoHomeWithCompletion:(DJICompletionBlock)completion; + +/** + * Sets the home location of the aircraft. The home location is used as the + * location the aircraft goes to when commanded by goHomeWithCompletion, when the + * signal to the aircraft is lost or when the battery is below the lowBatteryWarning + * threashold. The user should be careful where they set a new home point location as in + * some scenarios the product will not be in control of the user when going to this location. + * A home location is valid if it is within 30m of initial take-off location, current aircraft's location or + * current remote controller's location as shown by RC GPS. + * + * @param homeLocation Home location latitude and longitude in degrees. + * @param completion Completion block. + */ +- (void)setHomeLocation:(CLLocationCoordinate2D)homePoint withCompletion:(DJICompletionBlock)completion; + +/** + * Sets the home location of the aircraft with the current location of the aircraft. + * See setHomeLocation:withCompletion: for details on when the home point is used + * + */ +- (void)setHomeLocationUsingAircraftCurrentLocationWithCompletion:(DJICompletionBlock)completion; + +/** + * Gets the home point of the aircraft. + * + */ +- (void)getHomeLocationWithCompletion:(void (^)(CLLocationCoordinate2D homePoint, NSError *_Nullable error))completion; + +/** + * Sets the minimum altitude relative to where the aircraft took off that the aircraft must be at before going + * home. This can be useful when the user foresees obstacles in the aircraft’s way. If the aircraft’s current + * altitude is higher than the minimum go home altitude, it will go home at its current altitude. + * The valid range for the altitude is from 20m to 500m. + * + * @param altitude Aircraft’s minimum go home altitude. + * @param completion Completion block. + */ +- (void)setGoHomeAltitude:(float)altitude withCompletion:(DJICompletionBlock)completion; + +/** + * Gets the minimum altitude the aircraft must be at before going home. + * + * @param completion Completion block. + */ +- (void)getGoHomeAltitudeWithCompletion:(void (^)(float altitude, NSError *_Nullable error))completion; + +/** + * Check if the onboard SDK device is available + */ +- (BOOL)isOnboardSDKDeviceAvailable; + +/** + * If there is a device connected to the aircraft using the Onboard SDK, then this method will send data to that device. The size of the data cannot be greater than 100 bytes, and will be sent in 40 byte increments every 14ms. This method is only supported on products that support the Onboard SDK (Matrice 100). + * + * @param data data to be sent to external device. + * @param completion Completion block. + * + */ +- (void)sendDataToOnboardSDKDevice:(NSData *)data withCompletion:(DJICompletionBlock)completion; + +/** + * Sets go home battery percentage threshold. The percentage must be in the range [25, 50]. + * + * @param percent Low bettery warning percentage. + * @param completion Completion block + */ +- (void)setGoHomeBatteryThreshold:(uint8_t)percent withCompletion:(DJICompletionBlock)completion; + +/** + * Gets go home battery percentage threshold. The value of the percent parameter will + * be in the range [25, 50]. + * + */ +- (void)getGoHomeBatteryThresholdWithCompletion:(void (^)(uint8_t percent, NSError *_Nullable error))completion; + +/** + * Sets the land immediately battery percentage threshold. The percentage must be in the + * range [10, 25]. + * + * @param percent Serious low bettery warning percentage. + * @param completion Completion block + */ +- (void)setLandImmediatelyBatteryThreshold:(uint8_t)percent withCompletion:(DJICompletionBlock)completion; + +/** + * Gets the land immediately battery percentage threshold. The value of the percent parameter will + * be in the range [10, 25]. + * + */ +- (void)getLandImmediatelyBatteryThresholdWithCompletion:(void (^)(uint8_t percent, NSError *_Nullable error))completion; + +@end + +@interface DJIFlightController (DJIFlightOrientationMode) + +/** + * Sets the aircraft flight orientation relative to Aircraft Heading, Course Lock or Home Lock. Additional information describing flight orientation is in the getting started guide. + * + */ +- (void)setFlightOrientationMode:(DJIFlightOrientationMode)type withCompletion:(DJICompletionBlock)completion; + +/** + * Locks the current heading of the aircraft as the Couse Lock. Used when Flight Orientation Mode is DJIFlightOrientationModeCourseLock. + * + */ +- (void)lockCourseUsingCurrentDirectionWithCompletion:(DJICompletionBlock)completion; + +@end + +@interface DJIFlightController (VirtualStickControlMode) + +/** + * Responds whether the virtual stick control interface can be used. If there is a mission running in mission manager, then this property will be NO. + */ +- (BOOL)isVirtualStickControlModeAvailable; + +/** + * Enables virtual stick control mode. By enabling virtual stick control mode, the aircraft can be controlled + * using sendVirtualStickFlightControlData:withCompletion: method. + * + */ +- (void)enableVirtualStickControlModeWithCompletion:(DJICompletionBlock)completion; + +/** + * Disables virtual stick control mode. + * + */ +- (void)disableVirtualStickControlModeWithCompletion:(DJICompletionBlock)completion; + +/** + * Sends flight control data using virtual stick commands. The property 'isVirtualStickControlModeAvailable' needs to be YES to use Virtual Stick Control. + * + * @param controlData Flight control data + * @param completion Completion block + */ +- (void)sendVirtualStickFlightControlData:(DJIVirtualStickFlightControlData)controlData withCompletion:(DJICompletionBlock)completion; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIFlightControllerCurrentState.h b/DJISDK.framework/Headers/DJIFlightControllerCurrentState.h new file mode 100644 index 0000000..b7208e0 --- /dev/null +++ b/DJISDK.framework/Headers/DJIFlightControllerCurrentState.h @@ -0,0 +1,460 @@ +// +// DJIFlightControllerCurrentState.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/*********************************************************************************/ +#pragma mark - Data Structs and Enums +/*********************************************************************************/ + +//----------------------------------------------------------------- +#pragma mark DJIAttitude +//----------------------------------------------------------------- +/** + * Aircraft attitude. The attitude of the aircraft is made up of the pitch, roll, and yaw. + */ +typedef struct +{ + double pitch; + double roll; + double yaw; +} DJIAttitude; + +//----------------------------------------------------------------- +#pragma mark DJIFlightControllerFlightMode +//----------------------------------------------------------------- +/** + * Flight controller flight modes. For more info, please refer to http://wiki.dji.com/en/index.php/Phantom_3_Professional-Aircraft + * + */ +typedef NS_ENUM (NSUInteger, DJIFlightControllerFlightMode){ + /** + * Manual mode. + */ + DJIFlightControllerFlightModeManual = 0, + /** + * Attitude mode. + */ + DJIFlightControllerFlightModeAtti = 1, + /** + * Attitude course lock mode. + */ + DJIFlightControllerFlightModeAttiCourseLock = 2, + /** + * Attitude hover mode. + */ + DJIFlightControllerFlightModeAttiHover = 3, + /** + * Hover mode. + */ + DJIFlightControllerFlightModeHover = 4, + /** + * GPS blake mode. + */ + DJIFlightControllerFlightModeGPSBlake = 5, + /** + * GPS Attitude mode. + */ + DJIFlightControllerFlightModeGPSAtti = 6, + /** + * GPS course lock mode. + */ + DJIFlightControllerFlightModeGPSCourseLock = 7, + /** + * GPS Home mode. + */ + DJIFlightControllerFlightModeGPSHomeLock = 8, + /** + * GPS hot point mode. + */ + DJIFlightControllerFlightModeGPSHotPoint = 9, + /** + * Assisted takeoff mode. + */ + DJIFlightControllerFlightModeAssistedTakeOff = 10, + /** + * Auto takeoff mode. + */ + DJIFlightControllerFlightModeAutoTakeOff = 11, + /** + * Auto landing mode. + */ + DJIFlightControllerFlightModeAutoLanding = 12, + /** + * Attitude landing mode. + */ + DJIFlightControllerFlightModeAttiLanding = 13, + /** + * GPS waypoint mode. + */ + DJIFlightControllerFlightModeGPSWaypoint = 14, + /** + * Go home mode. + */ + DJIFlightControllerFlightModeGoHome = 15, + /** + * Click go mode. + */ + DJIFlightControllerFlightModeClickGo = 16, + /** + * Joystick mode. + */ + DJIFlightControllerFlightModeJoystick = 17, + /** + * Attitude limited mode. + */ + DJIFlightControllerFlightModeAttiLimited = 23, + /** + * GPS attitude limited mode. + */ + DJIFlightControllerFlightModeGPSAttiLimited = 24, + /** + * GPS follow me mode. + */ + DJIFlightControllerFlightModeGPSFollowMe = 25, + /** + * The main controller flight mode is unknown. + */ + DJIFlightControllerFlightModeUnknown = 0xFF, +}; + +/*********************************************************************************/ +#pragma mark - DJIFlightOrientationMode +/*********************************************************************************/ + +/** + * Tells the aircraft how to interpret flight commands for forward, backward, left and right. + * Additional information should be seen in the getting started guide. + */ +typedef NS_ENUM (uint8_t, DJIFlightOrientationMode){ + /** + * The aicraft should move relative to a locked course heading. + */ + DJIFlightOrientationModeCourseLock, + /** + * The aicraft should move relative radially to the Home Point. + */ + DJIFlightOrientationModeHomeLock, + /** + * The aicraft should move relative to the front of the aircraft. + */ + DJIFlightOrientationModeDefaultAircraftHeading, +}; + +//----------------------------------------------------------------- +#pragma mark DJIFlightControllerNoFlyStatus +//----------------------------------------------------------------- +/** + * No fly status. Please refer to http://wiki.dji.com/en/index.php/Phantom_3_Professional-_Flight_Limits_and_No-Fly_Zones for more information on no fly zones. + */ +typedef NS_ENUM (NSUInteger, DJIFlightControllerNoFlyStatus){ + /** + * The aircraft is normally flying. + */ + DJIFlightControllerNoFlyStatusFlyingNormally, + /** + * The aircraft is in a no fly zone, so take off is prohibited. + */ + DJIFlightControllerNoFlyStatusTakeOffProhibited, + /** + * The aircraft is in a no fly zone, so it is executing a force landing. + */ + DJIFlightControllerNoFlyStatusForceAutoLanding, + /** + * The aircraft is within 100m of a no fly zone boundary. + */ + DJIFlightControllerNoFlyStatusApproachingNoFlyZone, + /** + * The aircraft has reached its max flying height. + */ + DJIFlightControllerNoFlyStatusReachMaxFlyingHeight, + /** + * The aircraft has reached its max flying distance. + */ + DJIFlightControllerNoFlyStatusReachMaxFlyingDistance, + /** + * Some no fly zones have several areas. A central area where no aircraft can fly or take off in, and then + * an intermediate area where flight height is restricted. This intermediate area can have a gradually + * relaxing height restriction as the aircraft moves further from the no fly zone center. If the aircarft + * is flying in this intermediate area, then the DJIFlightControllerNoFlyStatusHeightLimited enum will be used. + * + * Note, the no fly zone state update that alerts if an aircraft is within 100m of a no fly zone, will trigger to + * the outer most area of a multi-area no fly zone. + */ + DJIFlightControllerNoFlyStatusHeightLimited, + /** + * The aircraft's no fly status is unknown. + */ + DJIFlightControllerNoFlyStatusUnknownStatus, +}; + +//----------------------------------------------------------------- +#pragma mark DJIGPSSignalStatus +//----------------------------------------------------------------- +/** + * GPS signal levels, which are used to measure the signal quality. + */ +typedef NS_ENUM (uint8_t, DJIGPSSignalStatus){ + /** + * The GPS has almost no signal, which is very bad. + */ + DJIGPSSignalStatusLevel0, + /** + * The GPS signal is very weak. + */ + DJIGPSSignalStatusLevel1, + /** + * The GPS signal is weak. At this level, the aircraft's go home + * functionality will still work. + */ + DJIGPSSignalStatusLevel2, + /** + * The GPS signal is good. At this level, the aircraft can hover in + * the air. + */ + DJIGPSSignalStatusLevel3, + /** + * The GPS signal is very good. At this level, the aircraft + * can record the home point. + */ + DJIGPSSignalStatusLevel4, + /** + * The GPS signal is very strong. + */ + DJIGPSSignalStatusLevel5, + /** + * There is no GPS signal. + */ + DJIGPSSignalStatusNone, +}; + +//----------------------------------------------------------------- +#pragma mark DJIFlightControllerSmartGoHomeStatus +//----------------------------------------------------------------- +typedef struct +{ + /** + * The estimated remaining time, in seconds, it will take the aircraft to go home with 10% battery buffer remaining. + * This time includes landing the aircraft. + */ + NSUInteger remainingFlightTime; + + /** + * The estimated time, in seconds, needed for the aircraft to go home from its + * current location. + */ + NSUInteger timeNeededToGoHome; + + /** + * The estimated time, in seconds, needed for the aircraft to land from its current + * height. The time calculated will be for the aircraft to land, moving + * straight down, from its current height. + */ + NSUInteger timeNeededToLandFromCurrentHeight; + + /** + * The estimated battery percentage, in the range of [0 - 100], needed for the aircraft + * to go home and have 10% battery remaining. This includes landing of the aircraft. + */ + NSUInteger batteryPercentageNeededToGoHome; + + /** + * The battery percentage, in the range of [0 - 100], needed for the aircraft + * to land from its current height. The battery percentage needed will be for + * the aircraft to land, moving straight down, from its current height. + */ + NSUInteger batteryPercentageNeededToLandFromCurrentHeight; + + /** + * The maximum radius, in meters, an aircraft can fly from its home location + * and still make it all the way back home based on certain factors including + * altitude, distance, battery, etc. If the aircraft goes out farther than the + * max radius, it will fly as far back home as it can and land. + */ + float maxRadiusAircraftCanFlyAndGoHome; + + /** + * Returns whether or not the aircraft is requesting to go home. If the value of + * aircraftShouldGoHome is YES and the user does not respond after 10 seconds, + * the aircraft will automatically go back to its home location. This can be cancelled + * at any time with the cancelGoHome method (which will also clear aircraftShouldGoHome). It is recommended + * that an alert view is shown to the user when aircraftShouldGoHome returns YES. + * During this time, the Remote Controller will beep. + * + * The flight controller calculates whether or not the aircraft should go home based + * on the aircraft's altitude, distance, battery, etc. + * + * The two main situations in which aircraftShouldGoHome will return YES are if the + * aircraft's battery is too low or if the airacraft has flown too far away. + */ + BOOL aircraftShouldGoHome; +} DJIFlightControllerSmartGoHomeStatus; + +//----------------------------------------------------------------- +#pragma mark DJIAircraftPowerLevel +//----------------------------------------------------------------- +/** + * Remaining battery life state. This state describes the recommended action based on remaining battery life. + */ +typedef NS_ENUM (uint8_t, DJIAircraftRemainingBatteryState){ + /** + * Remaining battery life sufficient for normal flying. + */ + DJIAircraftRemainingBatteryStateNormal, + /** + * Remaining battery life sufficient to go home. + */ + DJIAircraftRemainingBatteryStateLow, + /** + * Remaining battery life sufficient to land immediately. + */ + DJIAircraftRemainingBatteryStateVeryLow, + /** + * Reserved for future use. + */ + DJIAircraftRemainingBatteryStateReserved, +}; + +/*********************************************************************************/ +#pragma mark - DJIFlightControllerCurrentState +/*********************************************************************************/ + +/** + * + * This class contains current state of the flight controller. + * + */ +@interface DJIFlightControllerCurrentState : NSObject + +/** + * GPS satellite count. + */ +@property(nonatomic, readonly) int satelliteCount; + +/** + * Home location of the aircraft as a coordinate. + */ +@property(nonatomic, readonly) CLLocationCoordinate2D homeLocation; + +/** + * Current location of the aircraft as a coordinate. + */ +@property(nonatomic, readonly) CLLocationCoordinate2D aircraftLocation; + +/** + * Current speed of the aircraft in the x direction in meters per second. + */ +@property(nonatomic, readonly) float velocityX; + +/** + * Current speed of the aircraft in the y direction in meters per second. + */ +@property(nonatomic, readonly) float velocityY; + +/** + * Current speed of the aircraft in the z direction in meters per second. + */ +@property(nonatomic, readonly) float velocityZ; + +/** + * Relative altitude of the aircraft relative to take off location, measured by the barometer, in meters. + */ +@property(nonatomic, readonly) float altitude; + +/** + * Attitude of the aircraft where the pitch, roll, and yaw values will be in the range of [-180, 180]. + * If the values of the pitch, roll, and yaw are 0, the aircraft will be hovering level with a True North heading. + */ +@property(nonatomic, readonly) DJIAttitude attitude; + +/** + * Recommended action based on remaining battery life. + */ +@property(nonatomic, readonly) DJIAircraftRemainingBatteryState remainingBattery; + +/** + * YES if aircraft is flying. + */ +@property(nonatomic, readonly) BOOL isFlying; + +/** + * Aircraft's current flight mode. + */ +@property(nonatomic, readonly) DJIFlightControllerFlightMode flightMode; + +/** + * Aircraft's current no fly status. + */ +@property(nonatomic, readonly) DJIFlightControllerNoFlyStatus noFlyStatus; + +/** + * No fly zone's center coordinate. + */ +@property(nonatomic, readonly) CLLocationCoordinate2D noFlyZoneCenter; + +/** + * No fly zone's radius in meters. + */ +@property(nonatomic, readonly) int noFlyZoneRadius; + +/** + * Aircraft’s smart go home data. If smart go home is enabled, all the + * smart go home data will be available in DJIFlightControllerSmartGoHomeStatus. + */ +@property(nonatomic, readonly) DJIFlightControllerSmartGoHomeStatus smartGoHomeStatus; + +/** + * Aircraft's current orientation mode. + */ +@property(nonatomic, readonly) DJIFlightOrientationMode orientationMode; + +/** + * Aircraft's current GPS signal quality. + */ +@property(nonatomic, readonly) DJIGPSSignalStatus gpsSignalStatus; + +/** + * YES if the signal lost between remote controller and aircraft fail safe is enabled. + */ +@property(nonatomic, readonly) BOOL isFailsafe; +/** + * YES if IMU is preheating. + */ +@property(nonatomic, readonly) BOOL isIMUPreheating; +/** + * YES if the ultrasonic sensor is being used. Variables that can impact the quality of the ultrasound measurement + * and whether it is used or not are height above ground and the type of ground (if it reflects sound waves well). + * Usually the ultrasonic sensor works when the aircraft is less than 8m above ground. + */ +@property(nonatomic, readonly) BOOL isUltrasonicBeingUsed; +/** + * Height of aircraft measured by the ultrasonic sensor in meters. The data will only be + * available if isUltrasonicBeingUsed returns YES. Height has a precision of 0.1m. + */ +@property(nonatomic, readonly) float ultrasonicHeight; +/** + * YES if vision sensor is being used. Variables that can impact the quality of the vision measurement + * and whether it is used or not are height above ground and the type of ground (if it has sufficiently rich texture). + * Usually the vision sensor works when the aircraft is less than 3m above ground. + */ +@property(nonatomic, readonly) BOOL isVisionSensorBeingUsed; +/** + * YES if motors are on. + */ +@property(nonatomic, readonly) BOOL areMotorsOn; + +/** + * Returns the flight mode as a string. For example, "P-GPS" or "P-Atti". + */ +@property(nonatomic, readonly) NSString *flightModeString; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIFlightLimitation.h b/DJISDK.framework/Headers/DJIFlightLimitation.h new file mode 100644 index 0000000..a4e89bc --- /dev/null +++ b/DJISDK.framework/Headers/DJIFlightLimitation.h @@ -0,0 +1,73 @@ +// +// DJIFlightLimitation.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * + * This class contains the flight status of the aircraft related to the flight limitation. Also, it provides methods to configure the flight limitation. + */ +@interface DJIFlightLimitation : NSObject + +/** + * YES if aircraft has reached max flight height. + */ +@property(nonatomic, readonly) BOOL hasReachedMaxFlightHeight; + +/** + * YES if aircraft aircraft has reached max flight radius. + */ +@property(nonatomic, readonly) BOOL hasReachedMaxFlightRadius; + +/** + * Sets max flight height limitation for aircraft. maxHeight value should be in range [20, 500] m + * + * @param maxHeight Maximum height for aircraft. + * @param completion Completion block. + */ +- (void)setMaxFlightHeight:(float)maxHeight withCompletion:(DJICompletionBlock)completion; + +/** + * Gets max flight height limitation from aircraft. + * + */ +- (void)getMaxFlightHeightWithCompletion:(void (^)(float height, NSError *_Nullable error))completion; + +/** + * Sets max flight radius limitation for aircraft. The radius is calculated from the home point. maxRadius value should be in range [15, 500] m. + * + * @param radius Maximum flight radius for aircraft. + * @param completion Completion block. + */ +- (void)setMaxFlightRadius:(float)maxRadius withCompletion:(DJICompletionBlock)completion; + +/** + * Gets max flight radius limitation from aircraft. + * + */ +- (void)getMaxFlightRadiusWithCompletion:(void (^)(float radius, NSError *_Nullable error))completion; + +/** + * Sets max flight radius limitation enabled. If enabled is NO, then there is no max flight radius limitation. + * + * @param enabled Max flight radius limitation enable. + * @param completion Completion block. + */ +- (void)setMaxFlightRadiusLimitationEnabled:(BOOL)enabled withCompletion:(DJICompletionBlock)completion; + +/** + * Gets max flight radius limitation enabled. + * + */ +- (void)getMaxFlightRadiusLimitationEnabledWithCompletion:(void (^)(BOOL enabled, NSError *_Nullable error))completion; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIFollowMeMission.h b/DJISDK.framework/Headers/DJIFollowMeMission.h new file mode 100644 index 0000000..df1a516 --- /dev/null +++ b/DJISDK.framework/Headers/DJIFollowMeMission.h @@ -0,0 +1,118 @@ +// +// DJIFollowMeMission.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import +#import "DJIMission.h" + +/** + * Aircraft's heading during a follow me mission. + */ +typedef NS_ENUM (uint8_t, DJIFollowMeHeading){ + /** + * Aircraft's heading will be controlled by the remote controller. + */ + DJIFollowMeHeadingControlledByRemoteController, + + /** + * Aircraft's heading remains toward the coordinate it is following. + */ + DJIFollowMeHeadingTowardFollowPosition, +}; + +/** + * All possible follow me mission execution states. + */ +typedef NS_ENUM (uint8_t, DJIFollowMeMissionExecutionState){ + /** + * The mission is currently being initialized (uploaded to the aircraft). + */ + DJIFollowMeMissionExecutionStateInitializing, + /** + * The aircraft is currently moving. + */ + DJIFollowMeMissionExecutionStateMoving, + /** + * The mission is currently waiting to continue. This will happen if the follow me coordinate is not updated in 6 seconds, or the GPS signal quality is poor or broken. + */ + DJIFollowMeMissionExecuteStateWaiting, +}; + +/** + * This class provides the real-time status of the executing follow-me mission. + */ +@interface DJIFollowMeMissionStatus : DJIMissionProgressStatus + +/** + * Returns the current execution state of the follow me mission. + */ +@property(nonatomic, readonly) DJIFollowMeMissionExecutionState executionState; + +/** + * Returns the horizontal distance in meters between the aircraft and the coordinate the + * aircraft needs to follow. + */ +@property(nonatomic, readonly) float horizontalDistance; + +@end + +/*********************************************************************************/ +#pragma mark - Mission +/*********************************************************************************/ + +/** + * The class represents a follow-me mission. User can use it to make the aircraft follow the GPS device, like remote controller with GPS signal or mobile device. + * + */ +@interface DJIFollowMeMission : DJIMission + +/*********************************************************************************/ +#pragma mark - Mission Presets +/*********************************************************************************/ + +/** + * User's initial coordinate. + */ +@property(nonatomic, assign) CLLocationCoordinate2D followMeCoordinate; + +/** + * User's initial altitude(above sea level). If not use altitude follow, set zero. + */ +@property(nonatomic, assign) float followMeAltitude; + +/** + * The aircraft's heading during the mission. + */ +@property(nonatomic, assign) DJIFollowMeHeading heading; + +/*********************************************************************************/ +#pragma mark - Mission Updates +/*********************************************************************************/ +/** + * Updates the coordinate that the aircraft will follow. Once the follow me mission is initialized, + * this method is used to continuously update the coordinate to follow. If the aircraft doesn't receive an update + * within 6 seconds, it will hover in position until the next update arrives. + * This is the only property or method in this class that can communicate with the aircraft during a mission. + * All other properties and methods are used offline to prepare the mission which is then uploaded to the aircraft. + * + * @param coordinate Coordinate the aricraft will follow. Should be within 200m horizontal distance of current location. + * @param completion Completion block. + * + */ ++ (void)updateFollowMeCoordinate:(CLLocationCoordinate2D)coordinate withCompletion:(DJICompletionBlock)completion; + +/** + * Updates the coordinate that the aircraft will follow with a customized altitude. + * + * @param coordinate Coordinate the aricraft will follow. Should be within 200m horizontal distance of current location. + * @param altitude The following altitude. + * @param completion Completion block. + * + */ ++ (void)updateFollowMeCoordinate:(CLLocationCoordinate2D)coordinate altitude:(float)altitude withCompletion:(DJICompletionBlock)completion; + +@end diff --git a/DJISDK.framework/Headers/DJIFollowMeStep.h b/DJISDK.framework/Headers/DJIFollowMeStep.h new file mode 100644 index 0000000..444b927 --- /dev/null +++ b/DJISDK.framework/Headers/DJIFollowMeStep.h @@ -0,0 +1,33 @@ +// +// DJIFollowMeStep.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class DJIFollowMeMission; + +/** + * This class represents a follow-me step for a custom mission. By creating an object of this class and adding it into + * a custom mission, a follow-me action will be performed during the custom mission. + * @see DJIFollowMeMission + */ +@interface DJIFollowMeStep : DJIMissionStep + +/** + * Inialized instance with a follow me mission and duration. + * + * @param mission Mission for follow me step. + * @param seconds Duration in seconds to this step. + * + * @return Return instance of DJIFollowMeStep. + */ +- (instancetype _Nullable)initWithFollowMeMission:(DJIFollowMeMission *_Nonnull)mission duration:(float)seconds; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJIGimbal.h b/DJISDK.framework/Headers/DJIGimbal.h new file mode 100644 index 0000000..7fdce54 --- /dev/null +++ b/DJISDK.framework/Headers/DJIGimbal.h @@ -0,0 +1,708 @@ +// +// DJIGimbal.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +@class DJIGimbal; + +NS_ASSUME_NONNULL_BEGIN + +/*********************************************************************************/ +#pragma mark - Data Structs and Enums +/*********************************************************************************/ + +//----------------------------------------------------------------- +#pragma mark DJIGimbalAttitude +//----------------------------------------------------------------- +/** + * The gimbal's attitude in degrees relative to the aircraft. + */ +typedef struct +{ + /** + * Pitch value. + */ + float pitch; + /** + * Roll value. + */ + float roll; + /** + * Yaw value. + */ + float yaw; +} DJIGimbalAttitude; + +//----------------------------------------------------------------- +#pragma mark DJIGimbalRotateDirection +//----------------------------------------------------------------- +/** + * Gimbal rotate direction. + */ +typedef NS_ENUM (uint8_t, DJIGimbalRotateDirection){ + /** + * Sets the gimbal to rotate clockwise. + */ + DJIGimbalRotateDirectionClockwise, + /** + * Sets the gimbal to rotate counter-clockwise. + */ + DJIGimbalRotateDirectionCounterClockwise, +}; + +//----------------------------------------------------------------- +#pragma mark DJIGimbalRotateAngleMode +//----------------------------------------------------------------- +/** + * The rotation angle of gimbal can be defined as either Absolute (relative to heading), or Relative (relative to it's current angle). + */ +typedef NS_ENUM (uint8_t, DJIGimbalRotateAngleMode){ + /** + * The angle value, when the gimbal is rotating, will be relative to the current angle. + */ + DJIGimbalAngleModeRelativeAngle, + /** + * The angle value, when the gimbal is rotating, will be relative to 0 degrees (aircraft heading). + */ + DJIGimbalAngleModeAbsoluteAngle, +}; + +//----------------------------------------------------------------- +#pragma mark DJIGimbalAngleRotation +//----------------------------------------------------------------- +/** + * Struct used to control the gimbal by angle (either absolutely or relatively). + */ +typedef struct +{ + /** + * Gimbal rotation is enabled. If enable is set to NO, you will not be able + * to rotate the gimbal. + */ + BOOL enabled; + /** + * Gimbal rotation angle in degrees. + */ + float angle; + /** + * Gimbal rotate direction + */ + DJIGimbalRotateDirection direction; +} DJIGimbalAngleRotation; + +//----------------------------------------------------------------- +#pragma mark DJIGimbalSpeedRotation +//----------------------------------------------------------------- +/** + * Struct used to control the gimbal by speed. + */ +typedef struct +{ + /** + * Gimbal rotation angle velocity in degree/second. + */ + float angleVelocity; + /** + * Gimbal rotate direction + */ + DJIGimbalRotateDirection direction; +} DJIGimbalSpeedRotation; + +//----------------------------------------------------------------- +#pragma mark DJIGimbalWorkMode +//----------------------------------------------------------------- +/** + * Gimbal work modes. + */ +typedef NS_ENUM (uint8_t, DJIGimbalWorkMode){ + /** + * The gimbal can move free of aircraft's yaw. This is only supported by the X3, X5 and X5R camera gimbals. In this mode, if the aircraft yaw changes, the camera will stay pointing in the same world direction. + */ + DJIGimbalWorkModeFreeMode, + /** + * The gimbal's work mode is FPV mode. In this mode, the gimbal yaw will follow the aircraft's heading, the gimbal roll will follow the RC's roll channel value. While the pitch will be available to move. + * Not supported by OSMO. + * + */ + DJIGimbalWorkModeFpvMode, + /** + * The gimbal's work mode is such that it will follow the yaw. In this mode, the gimbal yaw will be fixed, while pitch and roll will be available to move. + * + */ + DJIGimbalWorkModeYawFollowMode, + /** + * The gimbal's work mode is unknown. + */ + DJIGimbalWorkModeUnknown = 0xFF, +}; + +//----------------------------------------------------------------- +#pragma mark DJIGimbalUserConfigType +//----------------------------------------------------------------- +/** + * Gimbal User Config. This is only supported by OSMO gimbal. + * + * The gimbal has a feature called SmoothTrack + * SmoothTrack smooths out larger transitions in pitch and yaw (as opposed to keeping the camera pointed in the same direction at all times) + * SmoothTrack is used on two axes (yaw and pitch) and has three presets of fast, medium or slow which impact the tracking speed, deadband and acceleration settings. These settings can also be customized. + */ +typedef NS_ENUM (uint8_t, DJIGimbalUserConfigType){ + /** + * The gimbal's SmoothTrack will catch up with significant yaw and pitch changes with a fast speed. + */ + DJIGimbalUserConfigTypeFastSmoothTrack = 3, + /** + * The gimbal's SmoothTrack will catch up with significant yaw and pitch changes with a medium speed. + */ + DJIGimbalUserConfigTypeMediumSmoothTrack = 4, + /** + * The gimbal's SmoothTrack will catch up with significant yaw and pitch changes with a slow speed. + */ + DJIGimbalUserConfigTypeSlowSmoothTrack = 5, + /** + * The gimbal uses a custom configuration in memory slot 1 where the yaw and pitch speed, deadband and acceleration can be defined. + */ + DJIGimbalUserConfigTypeCustom1 = 0, + /** + * The gimbal uses a custom configuration in memory slot 2 where the yaw and pitch speed, deadband and acceleration can be defined. + */ + DJIGimbalUserConfigTypeCustom2 = 1, + /** + * The gimbal's user config type is unknown. + */ + DJIGimbalUserConfigTypeUnknown = 0xFF, + +}; + +//----------------------------------------------------------------- +#pragma mark DJIGimbalSmoothTrackSettings +//----------------------------------------------------------------- +/** + * Gimbal's SmoothTrack axis. This is only supported by the OSMO gimbal when using a Custom configuration in DJIGimbalUserConfigType. + */ +typedef NS_ENUM (uint8_t, DJIGimbalSmoothTrackAxis){ + /** + * The gimbal's SmoothTrack axis is yaw (also called pan for users). + */ + DJIGimbalSmoothTrackAxisYaw, + /** + * The gimbal's SmoothTrack axis is pitch (also called tilt for users). + */ + DJIGimbalSmoothTrackAxisPitch, + +}; + +//----------------------------------------------------------------- +#pragma mark DJIGimbalJoystick +//----------------------------------------------------------------- +/** + * Gimbal joystick axis. This is only supported by the OSMO gimbal when using a Custom configuration in DJIGimbalUserConfigType. + */ +typedef NS_ENUM (uint8_t, DJIGimbalJoystickAxis){ + /** + * The axis of gimbal's joystick direction is yaw. + */ + DJIGimbalJoystickAxisYaw, + /** + * The axis of gimbal's joystick direction is pitch. + */ + DJIGimbalJoystickAxisPitch, + +}; + +/*********************************************************************************/ +#pragma mark - DJIGimbalConstraints +/*********************************************************************************/ + +/** + * + * This class provides the constraints of the gimbal. These values + * are determined and change based on the aircraft and the type of + * gimbal on the aircraft. + * + */ +@interface DJIGimbalConstraints : NSObject + +/** + * Yes if pitch can be controlled. + */ +@property(nonatomic, readonly) BOOL isPitchAdjustable; + +/** + * Yes if roll can be controlled. + */ +@property(nonatomic, readonly) BOOL isRollAdjustable; + +/** + * Yes if yaw can be controlled. + */ +@property(nonatomic, readonly) BOOL isYawAdjustable; + +/** + * Returns the maximum angle the pitch can be set to. + */ +@property(nonatomic, readonly) float pitchStopMax; + +/** + * Returns the minimum angle the pitch can be set to. + */ +@property(nonatomic, readonly) float pitchStopMin; + +/** + * Returns the maximum angle the roll can be set to. + */ +@property(nonatomic, readonly) float rollStopMax; + +/** + * Returns the minimum angle the roll can be set to. + */ +@property(nonatomic, readonly) float rollStopMin; + +/** + * Returns the maximum angle the yaw can be set to. + */ +@property(nonatomic, readonly) float yawStopMax; + +/** + * Returns the minimum angle the yaw can be set to. + */ +@property(nonatomic, readonly) float yawStopMin; + +@end + +/*********************************************************************************/ +#pragma mark - DJIGimbalState +/*********************************************************************************/ + +/** + * This class provides the current state of the gimbal. + * + */ +@interface DJIGimbalState : NSObject +/** + * The current gimbal attitude in degrees. Roll, pitch and yaw are 0 if the gimbal is level with the aircraft and points in the forward direction of the aircraft. + */ +@property(nonatomic, readonly) DJIGimbalAttitude attitudeInDegrees; + +/** + * Returns the gimbal's roll fine-tune value. The range for the fine-tune value is + * [-10, 10] degrees. If the fine-tune value is negative, the gimbal will be fine tuned + * the specified number of degrees in the counterclockwise direction. + */ +@property(nonatomic, readonly) float rollFineTuneInDegrees; + +/** + * Returns the gimbal's current work mode. + */ +@property(nonatomic, readonly) DJIGimbalWorkMode workMode; + +/** + * Returns whether or not the attitude has been reset. If the gimbal is not in the + * original position, this value will return NO. + */ +@property(nonatomic, readonly) BOOL isAttitudeReset; + +/** + * Returns whether or not the gimbal calibration success + */ +@property(nonatomic, readonly) BOOL isCalibrationSuccessful; + +/** + * YES if the Gimbal is calibrating + */ +@property(nonatomic, readonly) BOOL isCalibrating; + +/** + * Returns whether or not the gimbal's pitch value is at its maximum. + */ +@property(nonatomic, readonly) BOOL isPitchAtStop; + +/** + * Returns whether or not the gimbal's roll value is at its maximum. + */ +@property(nonatomic, readonly) BOOL isRollAtStop; + +/** + * Returns whether or not the gimbal's yaw value is at its maximum. + */ +@property(nonatomic, readonly) BOOL isYawAtStop; + +@end + +/*********************************************************************************/ +#pragma mark - DJIGimbalUserConfigObject +/*********************************************************************************/ + +/** + * + * This class provides advanced configuration of the gimbal. By changing the configuration, user can + * adjust the responsivity of the gimbal. + * Currently, the advanced configuration is only supported by OSMO. + */ +@interface DJIGimbalConfig : NSObject + +/** + * Gimbal configuration type. There are three preset types: fast, medium and slow. + * When the configuration type to DJIGimbalUserConfigTypeCustom1 or DJIGimbalUserConfigTypeCustom2, user can change + * the configuration by calling methods related to smoothTracking. + */ +@property(nonatomic, readonly) DJIGimbalUserConfigType configType; + +/** + * YES if gimbal SmoothTrack is enabled for the yaw axis. + */ +@property(nonatomic, readonly) BOOL isSmoothTrackYawEnabled; + +/** + * YES if gimbal SmoothTrack is enabled for the pitch axis. + */ +@property(nonatomic, readonly) BOOL isSmoothTrackPitchEnabled; + +/** + * SmoothTrack yaw axis speed determines how fast the gimbal will catch up with the translated yaw handle movement. + * Range is [0,100]. + */ +@property(nonatomic, readonly) NSInteger smoothTrackYawSpeed; + +/** + * SmoothTrack pitch axis speed determines how fast the gimbal will catch up with the translated pitch handle movement. + * Range is [0,100]. + */ +@property(nonatomic, readonly) NSInteger smoothTrackPitchSpeed; + +/** + * A larger SmoothTrack yaw axis deadband requires more yaw handle movement to translate into gimbal motion. + * Range is [0,90] degrees. + */ +@property(nonatomic, readonly) NSInteger smoothTrackYawDeadband; + +/** + * A larger SmoothTrack pitch axis deadband requires more pitch handle movement to translate into gimbal motion. + * Range is [0,90] degrees. + */ +@property(nonatomic, readonly) NSInteger smoothTrackPitchDeadband; + +/** + * SmoothTrack yaw axis acceleration determines how closely the camera will follow the translated yaw handle movement. + * Range is [0,30]. + */ +@property(nonatomic, readonly) NSInteger smoothTrackYawAcceleration; + +/** + * SmoothTrack pitch axis acceleration determines how closely the camera will follow the translated pitch handle movement. + * Range is [0,30]. + */ +@property(nonatomic, readonly) NSInteger smoothTrackPitchAcceleration; + +/** + * Joystick yaw axis smoothing controls the deceleration of the gimbal. A small value will cause the gimbal to stop abruptly. + * Range is [0,30]. + */ +@property(nonatomic, readonly) NSInteger joystickYawSmoothing; + +/** + * Joystick pitch axis smoothing controls the deceleration of the gimbal. A small value will cause the gimbal to stop abruptly. + * Range is [0,30]. + */ +@property(nonatomic, readonly) NSInteger joystickPitchSmoothing; + +/** + * Joystick yaw axis speed. + * Range is [0,100]. + */ +@property(nonatomic, readonly) NSInteger joystickYawSpeed; + +/** + * Joystick pitch axis speed. + * Range is [0,100]. + */ +@property(nonatomic, readonly) NSInteger joystickPitchSpeed; + +@end + +/*********************************************************************************/ +#pragma mark - GimbalAttitudeResultBlock +/*********************************************************************************/ + +/** + * Typedef block to be invoked when the remote attitude data is successfully changed. + */ +typedef void (^GimbalAttitudeResultBlock)(DJIGimbalAttitude attitudeInDegrees); + +/*********************************************************************************/ +#pragma mark - DJIGimbalDelegate +/*********************************************************************************/ + +/** + * + * This protocol provides delegate methods to receive the updated state and user configuration. + * + */ +@protocol DJIGimbalDelegate + +@optional + +/** + * Updates the gimbal's current state. + */ +- (void)gimbalController:(DJIGimbal *)controller didUpdateGimbalState:(DJIGimbalState *)gimbalState; + +/** + * Update the gimbal's user config data. Method only supported for OSMO. + */ +- (void)gimbalController:(DJIGimbal *)controller didUpdateGimbalConfig:(DJIGimbalConfig *)gimbalConfig; + +@end + +/*********************************************************************************/ +#pragma mark - DJIGimbal +/*********************************************************************************/ + +/** + * + * This class provides multiple methods to control gimbal, like set gimbal work mode, rotate gimbal with angle, start gimbal auto calibration, etc. + */ +@interface DJIGimbal : DJIBaseComponent + +@property(nonatomic, weak) id delegate; + +/** + * Returns the latest gimbal attitude data and nil if none is available. + */ +@property(nonatomic, readonly) DJIGimbalAttitude attitudeInDegrees; + +/** + * Sets the completion time, in seconds, to complete an action to control the gimbal. If + * the method rotateGimbalWithAngleMode:pitch:roll:yaw:withCompletion is used to control the gimbal's absolute + * angle,this property will be used to determine in what duration of time the gimbal should + * rotate to its new position. For example, if the value of this property is set to 2.0 + * seconds, the gimbal will rotate to its target position in 2.0 seconds. + * Range is [0.1,25.5] seconds. + * + */ +@property(nonatomic, assign) double completionTimeForControlAngleAction; + +//----------------------------------------------------------------- +#pragma mark Set Gimbal Work Mode +//----------------------------------------------------------------- + +/** + * Sets the gimbal's work mode. See enum DJIGimbalWorkMode for modes. + * + * @param workMode Gimbal work mode to be set. + * @param block Remote execution result error block. + */ +- (void)setGimbalWorkMode:(DJIGimbalWorkMode)workMode withCompletion:(DJICompletionBlock)block; + +//----------------------------------------------------------------- +#pragma mark Gimbal Control +//----------------------------------------------------------------- + +/** + * Gets the gimbal's constraints including which axes are adjustable, and what the axis stops are. + * + * @return Gimbal's constraints. If the SDK and the aircraft have lost connection with each other, the + * method will return nil. + */ +- (nullable DJIGimbalConstraints *)getGimbalConstraints; + +/** + * Rotate the gimbal's pitch, roll, and yaw in Angle Mode. The direction can either be set to clockwise or counter-clockwise. + * + * For Phantom 3 Professional, Phantom 3 Advanced and Phantom 3 Standard, roll and yaw rotations are not available. For Inspire 1, Inspire Pro and M100, pitch, roll and yaw rotations are available. The range for roll rotation is [-15, 15]. For OSMO, roll rotation is not available. + * + * @param pitch Gimbal's pitch rotation. + * @param roll Gimbal's roll rotation. + * @param yaw Gimbal's yaw rotation. + * @param block Execution result error block. + */ +- (void)rotateGimbalWithAngleMode:(DJIGimbalRotateAngleMode)angleMode pitch:(DJIGimbalAngleRotation)pitch roll:(DJIGimbalAngleRotation)roll yaw:(DJIGimbalAngleRotation)yaw withCompletion:(DJICompletionBlock)block; + +/** + * Rotate the gimbal's pitch, roll, and yaw using speed. The direction can either be set to + * clockwise or counter-clockwise. + * For Phantom 3 Professional, Phantom 3 Advanced and Phantom 3 Standard, roll and yaw rotations are not available. + * For Inspire 1, Inspire Pro and M100, pitch, roll and yaw rotations are available. + * For OSMO, roll rotation is not available. The yaw angleVelocity of DJIGimbalSpeedRotation range is (0, 120). + * + * @param pitch Gimbal's pitch rotation. + * @param roll Gimbal's roll rotation. + * @param yaw Gimbal's yaw rotation. + * @param block Execution result error block. + */ +- (void)rotateGimbalBySpeedWithPitch:(DJIGimbalSpeedRotation)pitch roll:(DJIGimbalSpeedRotation)roll yaw:(DJIGimbalSpeedRotation)yaw withCompletion:(DJICompletionBlock)block; + +/** + * Resets the gimbal. The gimbal's pitch, roll, and yaw will be set to the origin, which is + * the standard position for the gimbal. + * + * @param block Remote execution result error block. + */ +- (void)resetGimbalWithCompletion:(DJICompletionBlock)block; + +//----------------------------------------------------------------- +#pragma mark Gimbal Calibration +//----------------------------------------------------------------- +/** + * Starts calibrating the gimbal. + * + * @param block Remote execution result error block. + */ +- (void)startGimbalAutoCalibrationWithCompletion:(DJICompletionBlock)block; + +/** + * The gimbal roll can be fine tuned with a custom offset. The range for the custom offset is + * [-10, 10] degrees. If the offset is negative, the gimbal will be fine tuned the specified + * number of degrees in the counterclockwise direction. + * + * @param offset Fine-tune offset in degrees to be tuned. + * @param block Completion block. + */ +- (void)fineTuneGimbalRollInDegrees:(float)offset withCompletion:(DJICompletionBlock)block; + +//----------------------------------------------------------------- +#pragma mark Gimbal User Config +//----------------------------------------------------------------- + +/** + * YES if gimbal supports a user config (OSMO only). + */ +- (BOOL)isUserConfigSupported; + +/** + * Sets gimbal user config type. + * + * @param userConfigType Gimbal User Configure type. + * @param block Set Gimbal User Config result block. + * + */ +- (void)setGimbalUserConfigType:(DJIGimbalUserConfigType)userConfigType withCompletion:(DJICompletionBlock)block; + +/** + * Gets gimbal user config type. + * + * @param block Get Gimbal User Config result block. + * + */ +- (void)getGimbalUserConfigTypeWithCompletion:(void (^)(DJIGimbalUserConfigType userConfigType, BOOL success))block; +; + +/** + * Enables a gimbal SmoothTrack axis. + * + * @param axis Gimbal axis. + * @param enabled YES if SmoothTrack is to be enabled on axis. + * @param block set if Gimbal SmoothTrack Adjustment is available to be customized in the specific direction result block. + * + */ +- (void)setGimbalSmoothTrackAxisEnabledOnAxis:(DJIGimbalSmoothTrackAxis)axis isEnabled:(BOOL)enabled withCompletion:(DJICompletionBlock)block; + +/** + * Gets whether an axis has SmoothTrack enabled. + * + * @param axis Gimbal axis. + * @param block get if Gimbal SmoothTrack Adjustment is available to be customized in the specific direction result block. + */ +- (void)getGimbalSmoothTrackAxisEnabledOnAxis:(DJIGimbalSmoothTrackAxis)axis withCompletion:(void (^)(BOOL isEnabled, BOOL success))block; + +/** + * Sets gimbal SmoothTrack catch up speed on an axis. SmoothTrack speed determines how fast the gimbal will catch up with a large, translated handle movement and has a range [0,100]. + * + * @param axis Gimbal axis. + * @param speed SmoothTrack speed [0,100]. + * @param block set Gimbal SmoothTrack Adjustment speed in specific direction result block. + */ +- (void)setGimbalSmoothTrackSpeedOnAxis:(DJIGimbalSmoothTrackAxis)axis speed:(NSInteger)speed withCompletion:(DJICompletionBlock)block; + +/** + * Gets gimbal SmoothTrack speed on an axis. SmoothTrack speed determines how fast the gimbal will catch up with a large, translated handle movement and will have a range [0,100]. + * + * @param axis Gimbal axis. + * @param block get Gimbal SmoothTrack Adjustment speed in specific direction result block. + */ +- (void)getGimbalSmoothTrackSpeedOnAxis:(DJIGimbalSmoothTrackAxis)axis withCompletion:(void (^)(NSInteger speed, BOOL success))block; + +/** + * Sets SmoothTrack deadband on an axis. A larger deadband requires more handle movement to translate into gimbal motion. Deadband has a range of [0,90] degrees. + * + * @param axis Gimbal axis. + * @param deadband SmoothTrack deadband [0,90]. + * @param block set Gimbal SmoothTrack Adjustment deadband in specific direction result block. + */ + +- (void)setGimbalSmoothTrackDeadbandOnAxis:(DJIGimbalSmoothTrackAxis)axis deadband:(NSInteger)deadband withCompletion:(DJICompletionBlock)block; + +/** + * Gets SmoothTrack deadband on an axis. A larger deadband requires more handle movement to translate into gimbal motion. Deadband has a range of [0,90] degrees. + * + * @param axis Gimbal axis. + * @param block get Gimbal SmoothTrack Adjustment deadband in specific direction result block. + */ + +- (void)getGimbalSmoothTrackDeadbandOnAxis:(DJIGimbalSmoothTrackAxis)axis withCompletion:(void (^)(NSInteger deadband, BOOL success))block; + +/** + * Sets SmoothTrack acceleration on an axis. Acceleration determines how closely the camera will follow the translated yaw handle movement and has a range of [0,30]. + * + * @param axis Gimbal axis. + * @param acceleration SmoothTrack acceleration [0,30]. + * @param block set Gimbal SmoothTrack Adjustment acceleration in specific direction result block. + */ + +- (void)setGimbalSmoothTrackAccelerationOnAxis:(DJIGimbalSmoothTrackAxis)axis acceleration:(NSInteger)acceleration withCompletion:(DJICompletionBlock)block; + +/** + * Gets SmoothTrack acceleration on an axis. Acceleration determines how closely the camera will follow the translated yaw handle movement and has a range of [0,30]. + * + * @param axis Gimbal axis. + * @param block get Gimbal SmoothTrack Adjustment acceleration in specific direction result block. + */ + +- (void)getGimbalSmoothTrackAccelerationOnAxis:(DJIGimbalSmoothTrackAxis)axis withCompletion:(void (^)(NSInteger acceleration, BOOL success))block; + +/** + * Sets joystick smoothing on an axis. Joystick smoothing controls the deceleration of the gimbal. A small value will cause the gimbal to stop abruptly. Smoothing has a range of [0,30]. + * + * + * @param axis Gimbal axis. + * @param smoothing Joystick Smoothing [0,30]. + * @param block set Gimbal Joystick Smoothing in specific direction result block. + */ + +- (void)setGimbalJoystickSmoothingOnAxis:(DJIGimbalJoystickAxis)axis smoothing:(NSInteger)smoothing withCompletion:(DJICompletionBlock)block; + +/** + * Gets joystick smoothing on an axis. Joystick smoothing controls the deceleration of the gimbal. A small value will cause the gimbal to stop abruptly. Smoothing has a range of [0,30]. + * + * @param axis Gimbal Joystick Direction. + * @param block get Gimbal Joystick Smoothing in specific direction result block. + */ + +- (void)getGimbalJoystickSmoothingOnAxis:(DJIGimbalJoystickAxis)axis withCompletion:(void (^)(NSInteger smoothing, BOOL success))block; + +/** + * Sets joystick speed on an axis. Speed has a range of [0,100]. + * + * @param axis Gimbal axis. + * @param speed Joystick speed [0,100]. + * @param block set Gimbal Joystick Speed in specific direction result block. + */ + +- (void)setGimbalJoystickSpeedOnAxis:(DJIGimbalJoystickAxis)axis speed:(NSInteger)speed withCompletion:(DJICompletionBlock)block; + +/** + * Gets joystick speed on an axis. Speed has a range of [0,100]. + * + * @param axis Gimbal Joystick Direction. + * @param block get Gimbal Joystick Speed in specific direction result block. + */ + +- (void)getGimbalJoystickSpeedOnAxis:(DJIGimbalJoystickAxis)axis withCompletion:(void (^)(NSInteger speed, BOOL success))block; + +@end +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIGimbalAttitudeStep.h b/DJISDK.framework/Headers/DJIGimbalAttitudeStep.h new file mode 100644 index 0000000..77ad916 --- /dev/null +++ b/DJISDK.framework/Headers/DJIGimbalAttitudeStep.h @@ -0,0 +1,39 @@ +// +// DJIGimbalAttitudeStep.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * Subclass of DJIMission Step, you can control gimbal attitude using this mission step. + * + */ +@interface DJIGimbalAttitudeStep : DJIMissionStep + +/** + * Completion time in seconds for gimbal go to target attitude from current attitude. Default is 1s. + */ +@property(nonatomic, assign) double completionTime; + +/** + * Target gimbal attitude. + */ +@property(nonatomic, readonly) DJIGimbalAttitude targetAttitude; + +/** + * Initialized instance with gimbal target attitude. + * + * @param attitude Gimbal target attitude. + * + * @return Instance of DJIGimbalAttitudeStep. + */ +- (instancetype _Nullable)initWithAttitude:(DJIGimbalAttitude)attitude; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIGoHomeStep.h b/DJISDK.framework/Headers/DJIGoHomeStep.h new file mode 100644 index 0000000..91a6baa --- /dev/null +++ b/DJISDK.framework/Headers/DJIGoHomeStep.h @@ -0,0 +1,20 @@ +// +// DJIGoHomeStep.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class represents a go-home step for a custom mission. By creating an object of this class and adding it into + * a custom mission, a go-home action will be performed during the custom mission execution. + */ +@interface DJIGoHomeStep : DJIMissionStep + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJIGoToStep.h b/DJISDK.framework/Headers/DJIGoToStep.h new file mode 100644 index 0000000..23d286e --- /dev/null +++ b/DJISDK.framework/Headers/DJIGoToStep.h @@ -0,0 +1,53 @@ +// +// DJIGoToStep.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class represents a go-to step for a custom mission. By creating an object of this class and adding it into + * a custom mission, the aircraft will go to the specific location during the custom mission execution. + */ +@interface DJIGoToStep : DJIMissionStep + +/** + * Flight speed of aircraft when going to the target location. Default is 8 m/s. + */ +@property(nonatomic, assign) float flightSpeed; + +/** + * Go to coordinate from current aircraft position. + * + * @param coorinate Target coorinate. + * + * @return Instance of DJIGoToStep. + */ +- (instancetype _Nullable)initWithCoordinate:(CLLocationCoordinate2D)coorinate; + +/** + * Go to altitude from current aircraft position. + * + * @param altitude Target altitude in meters. + * + * @return Instance of DJIGoToStep. + */ +- (instancetype _Nullable)initWithAltitude:(float)altitude; + +/** + * Go to coordinate and alitude (in meters) from current aircraft position. + * + * @param coorinate Target coordinate + * @param altitude Target altitude in meters + * + * @return Instance of DJIGoToStep. + */ +- (instancetype _Nullable)initWithCoordinate:(CLLocationCoordinate2D)coorinate altitude:(float)altitude; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJIHandheld.h b/DJISDK.framework/Headers/DJIHandheld.h new file mode 100644 index 0000000..607fc9f --- /dev/null +++ b/DJISDK.framework/Headers/DJIHandheld.h @@ -0,0 +1,53 @@ +// +// DJIHandheld.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +@class DJIFlightController; +@class DJIGimbal; +@class DJIBattery; +@class DJICamera; +@class DJIHandheldController; +@class DJIAirLink; + +NS_ASSUME_NONNULL_BEGIN + +/** + * + * This class contains the components of a handheld device. + */ +@interface DJIHandheld : DJIBaseProduct + +/** + * Returns an instance of the handheld device's camera. + */ +@property(nonatomic, readonly) DJICamera *_Nullable camera; + +/** + * Returns an instance of the handheld device's gimbal. + */ +@property(nonatomic, readonly) DJIGimbal *_Nullable gimbal; + +/** + * Returns an instance of the handheld device's battery. + */ +@property(nonatomic, readonly) DJIBattery *_Nullable battery; + +/** + * Returns an instance of the handheld device's handheldController. + */ +@property(nonatomic, readonly) DJIHandheldController *_Nullable handheldController; + +/** + * Returns an instance of the handheld's airLink. + */ +@property(nonatomic, readonly) DJIAirLink *_Nullable airLink; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJIHandheldController.h b/DJISDK.framework/Headers/DJIHandheldController.h new file mode 100644 index 0000000..9db561d --- /dev/null +++ b/DJISDK.framework/Headers/DJIHandheldController.h @@ -0,0 +1,112 @@ +// +// DJIHandheldController.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +@class DJIWiFiLink; + +NS_ASSUME_NONNULL_BEGIN + +//----------------------------------------------------------------- +#pragma mark DJIHandheldWiFiFrequency Type +//----------------------------------------------------------------- +/** + * Handheld WiFi Frequency Type. + */ +typedef NS_ENUM (uint8_t, DJIHandheldWiFiFrequencyType){ + /** + * The Handheld WiFi frequency is 2.4G + */ + DJIHandheldWiFiFrequency2Dot4G, + /** + * The Handheld WiFi frequency is 5.8G + */ + DJIHandheldWiFiFrequency5Dot8G, + +}; + +/** + * Handheld Power Mode + */ +typedef NS_ENUM (uint8_t, DJIHandheldPowerMode){ + /** + * The Handheld Power Mode is awake. + * For OSMO, when it is in this mode, all the components in DJIHandheld are accessible. + */ + DJIHandheldPowerModeAwake, + /** + * The Handheld Power Mode is sleeping. The handheld controller keeps the WiFi connection + * to the Mobile device alive but most other components are off. The power consumption is low + * in this mode. + * For OSMO, when it is in this mode, only the DJIHandheldController, DJIAirLink and DJIBattery + * are accessible. + */ + DJIHandheldPowerModeSleeping, + /** + * The Handheld Power Mode is power-off. Once this mode is set the delegate will receive this mode until the handheld device is + * shut down completely. + */ + DJIHandheldPowerModePowerOff, + /** + * The Handheld Power Mode in unkown. + */ + DJIHandheldPowerModeUnknown = 0xFF +}; + +@class DJIHandheldController; + +/*********************************************************************************/ +#pragma mark - DJIHandheldControllerDelegate +/*********************************************************************************/ + +/** + * + * This protocol provides a delegate method to receive the updated power mode of the handheld controller. + * + */ +@protocol DJIHandheldControllerDelegate + +@optional + +/** + * Tells the delegate that a handheld controller's power mode is updated. + * + * @param controller the handheld controller that updates the power mode + * @param powerMode handheld controller's current power mode + * + */ +- (void)handheldController:(DJIHandheldController *)controller didUpdatePowerMode:(DJIHandheldPowerMode)powerMode; + +@end + +/*********************************************************************************/ +#pragma mark - DJIHandheldController +/*********************************************************************************/ +/** + * + * This class contains interfaces to control a handheld device. You can make the handheld device enter sleep mode, awake from sleep mode or shut it down. + */ +@interface DJIHandheldController : DJIBaseComponent + +/** + * Returns the DJIHandheldController delegate + */ +@property(nonatomic, weak) id delegate; + +/** + * Set the power mode for handheld. + * + * @param mode The power mode to set. + * CAUTION: when the mode is DJIHandheldPowerModePowerOff, the handheld device will be shut down and + * the connection will be broken. User then needs to power on the device manually. + * @param block Remote execution result callback block. + */ +- (void)setHandheldPowerMode:(DJIHandheldPowerMode)mode withCompletion:(DJICompletionBlock)block; + +@end +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJIHotPointMission.h b/DJISDK.framework/Headers/DJIHotPointMission.h new file mode 100644 index 0000000..e0a7996 --- /dev/null +++ b/DJISDK.framework/Headers/DJIHotPointMission.h @@ -0,0 +1,179 @@ +// +// DJIHotPointMission.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import +#import "DJIMission.h" + +/** + * Maximum radius in meters of the circlular path the aircraft will fly around the point of interest. Currently 500m. + */ +DJI_API_EXTERN const float DJIHotPointMaxRadius; + +/** + * Minimum radius in meters of the circlular path the aircraft will fly around the point of interest. Currently 5m. + */ +DJI_API_EXTERN const float DJIHotPointMinRadius; + +/** + * Aircraft start point relative to hot point. + */ +typedef NS_ENUM (NSUInteger, DJIHotPointStartPoint){ + /** + * Start from the North. + */ + DJIHotPointStartPointNorth, + /** + * Start from the South. + */ + DJIHotPointStartPointSouth, + /** + * Start from the West. + */ + DJIHotPointStartPointWest, + /** + * Start from the East + */ + DJIHotPointStartPointEast, + /** + * Start the circle surrounding the hotpoint at the nearest point + * on the circle to the aircraft's current location. + */ + DJIHotPointStartPointNearest, +}; + +/** + * Heading of the aircraft while orbiting the hot point. + */ +typedef NS_ENUM (NSUInteger, DJIHotPointHeading){ + /** + * Heading is in the forward direction of travel along the circular path. + */ + DJIHotPointHeadingAlongCircleLookingForward, + /** + * Heading is in the backward direction of travel along the circular path. + */ + DJIHotPointHeadingAlongCircleLookingBackward, + /** + * Heading is toward the hotpoint. + */ + DJIHotPointHeadingTowardHotPoint, + /** + * Heading is in the direction of the vector defined by the hotpoint and the aircraft in the direction away from the hotpoint. + */ + DJIHotPointHeadingAwayFromHotPoint, + /** + * Heading is controlled by the remote controller. + */ + DJIHotPointHeadingControlledByRemoteController, + /** + * The heading remains as the heading of the aircraft when the mission started. + */ + DJIHotPointHeadingUsingInitialHeading +}; + +/** + * All possible hot point mission execution states. + */ +typedef NS_ENUM (uint8_t, DJIHotpointMissionExecutionState){ + /** + * The mission has been started and the aircraft is flying to the start point. + */ + DJIHotpointMissionExecutionStateInitializing, + /** + * The aircraft is currently moving. + */ + DJIHotpointMissionExecutionStateMoving, + /** + * The mission is currently paused by the user. + */ + DJIHotpointMissionExecutionStatePaused, +}; + +/** + * This class provides the real-time status of the executing hot-point mission. + * + */ +@interface DJIHotPointMissionStatus : DJIMissionProgressStatus + +/** + * Returns the current execution state of the hot point mission. + */ +@property(nonatomic, readonly) DJIHotpointMissionExecutionState executionState; + +/** + * The current horizontal distance between the aircraft and the hot point in meters. + */ +@property(nonatomic, readonly) float currentDistanceToHotpoint; + +@end + +/*********************************************************************************/ +#pragma mark - Mission +/*********************************************************************************/ + +/** + * The class represents a hotpoint mission, which can be executed by the mission manager. User can control the aircraft to fly around the hotpoint with specific radius and altitude. During the execution, user can also using the physical remote controller to modify its radius and speed. + * + */ +@interface DJIHotPointMission : DJIMission + +/*********************************************************************************/ +#pragma mark - Mission Presets +/*********************************************************************************/ +/** + * Sets the coordinate of the hot point. + */ +@property(nonatomic, assign) CLLocationCoordinate2D hotPoint; + +/** + * Sets the altitude of the hot point orbit in meters with range [5,120] meters. The altitude is relative + * to the ground altitude from which the aircraft took off. + */ +@property(nonatomic, assign) float altitude; + +/** + * Sets the circular flight path radius the aircraft will fly around the hotpoint. + * the hot point is. The value of this property should be in range of [DJIHotPointMinRadius, DJIHotPointMaxRadius] meters. + */ +@property(nonatomic, assign) float radius; + +/** + * YES if the aircraft is to travel around the hotpoint in the clockwise direction. + */ +@property(nonatomic, assign) BOOL isClockwise; + +/** + * Sets the angular velocity (in degrees/second) of the aircraft as it orbits the hot point. + * The default value is 20 degrees/s. + * The angular velocity is relative to the orbit radius. You can use the maxAngularVelocityForRadius:radius method + * to get the maximum supported angular velocity for a given radius. + */ +@property(nonatomic, assign) float angularVelocity; + +/** + * Aircraft's initial point on the circular flight path when starting the hot point mission. + */ +@property(nonatomic, assign) DJIHotPointStartPoint startPoint; + +/** + * Aircraft's heading while flying around the hot point. It can be pointed towards or away from the hot point, + * forwards or backwards along its flight route, or be controlled by the remote controller. + */ +@property(nonatomic, assign) DJIHotPointHeading heading; + +/** + * Returns the supported maximum angular velocity in degrees/second for the given + * hot point radius in meters. + * + * @param radius Hot point radius with range [5,500] meters to calculate maximum angular velocity. + * + * @return Returns the supported maximum angular velocity for the given radius. Will return 0 if an unsupported radius is input. + */ ++ (float)maxAngularVelocityForRadius:(float)radius; + +@end diff --git a/DJISDK.framework/Headers/DJIHotpointStep.h b/DJISDK.framework/Headers/DJIHotpointStep.h new file mode 100644 index 0000000..02d1f20 --- /dev/null +++ b/DJISDK.framework/Headers/DJIHotpointStep.h @@ -0,0 +1,31 @@ +// +// DJIHotpointStep.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class DJIHotPointMission; + +/** + * This class represents a hot-point step for a custom mission. By creating an object of this class and adding it into + * a custom mission, a hot-point action will be performed during the custom mission execution. + * @see DJIHotpointMission + */ +@interface DJIHotpointStep : DJIMissionStep + +/** + * Surrounding angle in degrees. The surrounding angle should be consistant with the hotpoint mission's + * direction (isClockwise), default is 360 degree if 'isClockwise' is YES or -360 degree if 'isClockwise' is NO. + */ +@property(nonatomic, assign) double surroundingAngle; + +- (instancetype _Nullable)initWithHotpointMission:(DJIHotPointMission *)mission; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJILBAirLink.h b/DJISDK.framework/Headers/DJILBAirLink.h new file mode 100644 index 0000000..db78593 --- /dev/null +++ b/DJISDK.framework/Headers/DJILBAirLink.h @@ -0,0 +1,596 @@ +// +// DJILBAirLink.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class DJILBAirLink; + +/** + * Define the air link max supported channel count + */ +#define DJI_LBAIRLINK_SUPPORTED_CHANNEL_COUNT (8) + +/*********************************************************************************/ +#pragma mark - DJISignalInformation +/*********************************************************************************/ + +/** + * This class contains signal status of a channel. + */ +@interface DJISignalInformation : NSObject + +/** + * Signal quality in percent [0, 100]. + */ +@property(nonatomic, readonly) int percent; + +/** + * Signal strength in dBm. + * + */ +@property(nonatomic, readonly) int power; + +@end + +/*********************************************************************************/ +#pragma mark - Data Struct +/*********************************************************************************/ + +/** + * Downlink channel selection mode (manual or automatic) for wireless link. + */ +typedef NS_ENUM (uint8_t, DJILBAirLinkChannelSelectionMode) { + /** + * Air link will automatically select the best physical channel based on the signal environment. + */ + DJILBAirLinkChannelSelectionModeAuto, + /** + * Manually select the physical channel. + */ + DJILBAirLinkChannelSelectionModeManual, + /** + * Unknown physical channel selection mode. + */ + DJILBAirLinkChannelSelectionModeUnknown, +}; + +/** + * OSD data units. + */ +typedef NS_ENUM (uint8_t, DJILBAirLinkOSDUnits) { + /** + * Imperial + */ + DJILBAirLinkOSDUnitsImperial, + /** + * Metric + */ + DJILBAirLinkOSDUnitsMetric, + /** + * Unknown + */ + DJILBAirLinkOSDUnitsUnknown, +}; + +/** + * Remote Controller port to output secondary video to (in addition to USB video sent to the Mobile Device). + */ +typedef NS_ENUM (uint8_t, DJILBAirLinkSecondaryVideoOutputPort) { + /** + * HDMI port + */ + DJILBAirLinkSecondaryVideoOutputPortHDMI, + /** + * SDI port + */ + DJILBAirLinkSecondaryVideoOutputPortSDI, + /** + * Unknown + */ + DJILBAirLinkSecondaryVideoOutputPortUnknown, +}; + +/** + * Define the combination of video sources to form the secondary output video. + */ +typedef NS_ENUM (uint8_t, DJILBAirLinkPIPDisplayMode) { + /** + * Displays the FPV Camera (HDMI or AV input to the air link Module). + */ + DJILBAirLinkPIPDisplayModeLB, + /** + * Displays the video from the HD Gimbal (Gimbal input to the air link Module). + */ + DJILBAirLinkPIPDisplayModeExt, + /** + * Displays the video from HD Gimbal camera as the main subject, and the HDMI or AV video from FPV camera in a mini window (Picture in Picture, or PIP). + */ + DJILBAirLinkPIPDisplayModePIPLB, + /** + * Displays the HDMI or AV output of the FPV camera as the main subject, and the video from the HD Gimbal in a mini window (Picture in Picture, or PIP). + */ + DJILBAirLinkPIPDisplayModePIPExt, + /** + * Unknown output mode. + */ + DJILBAirLinkPIPDisplayModeUnknown, +}; + +/** + * Secondary output video resolution and frame rate. + */ +typedef NS_ENUM (uint8_t, DJILBAirLinkSecondaryVideoFormat) { + /** + * 1080I + */ + DJILBAirLinkSecondaryVideoFormat1080I60FPS, + DJILBAirLinkSecondaryVideoFormat1080I50FPS, + /** + * 1080P + */ + DJILBAirLinkSecondaryVideoFormat1080P60FPS, + DJILBAirLinkSecondaryVideoFormat1080P50FPS, + DJILBAirLinkSecondaryVideoFormat1080P30FPS, + DJILBAirLinkSecondaryVideoFormat1080P25FPS, + DJILBAirLinkSecondaryVideoFormat1080P24FPS, + /** + * 720P + */ + DJILBAirLinkSecondaryVideoFormat720P60FPS, + DJILBAirLinkSecondaryVideoFormat720P50FPS, + DJILBAirLinkSecondaryVideoFormat720P30FPS, + DJILBAirLinkSecondaryVideoFormat720P25FPS, + /** + * Unknown + */ + DJILBAirLinkSecondaryVideoFormatUnknown, +}; + +/** + * PIP (Picture In Picture) position on the screen reltaive to the main subject video. + * + */ +typedef NS_ENUM (uint8_t, DJILBAirLinkPIPPosition) { + /** + * PIP is in the screen's top left. + */ + DJILBAirLinkPIPPositionTopLeft, + /** + * PIP is in the screen's top right. + */ + DJILBAirLinkPIPPositionTopRight, + /** + * PIP is in the screen's bottom left. + */ + DJILBAirLinkPIPPositionBottomLeft, + /** + * PIP is in the screen's bottom right. + */ + DJILBAirLinkPIPPositionBottomRight, + /** + * Unknown PIP position. + */ + DJILBAirLinkPIPPositionUnknown, +}; + +/** + * FPV Video can prioritize either quality or latency. + */ +typedef NS_ENUM (uint8_t, DJILBAirLinkFPVVideoQualityLatency) { + /** + * High quality priority. + */ + DJILBAirLinkFPVVideoQualityLatencyHighQuality, + /** + * Low latency priority. + */ + DJILBAirLinkFPVVideoQualityLatencyLowLatency, + /** + * Unknown transmission mode. + */ + DJILBAirLinkFPVVideoQualityLatencyUnknown, +}; + +/** + * Wireless downlink data rate. Lower rates are used for longer ranges, but will have lower video quality. + * + */ +typedef NS_ENUM (uint8_t, DJILBAirLinkDataRate) { + /** + * 4 Mbps (Potential range up to 3 km) + */ + DJILBAirLinkDataRate4Mbps, + /** + * 6 Mbps (Potential range up to 2 km) + */ + DJILBAirLinkDataRate6Mbps, + /** + * 8 Mbps (Potential range up to 1.5 km) + */ + DJILBAirLinkDataRate8Mbps, + /** + * 10 Mbps (Potential range up to 0.7 km) + */ + DJILBAirLinkDataRate10Mbps, + /** + * Unknown + */ + DJILBAirLinkDataRateUnknown +}; + +/** + * RSSI (Received Signal Strength Indicator) in dBm + * + */ +typedef struct +{ + /** + * RSSI with range [-100, -60] dBm + * + */ + int8_t rssi[DJI_LBAIRLINK_SUPPORTED_CHANNEL_COUNT]; +} DJILBAirLinkAllChannelSignalStrengths; + +/*********************************************************************************/ +#pragma mark - DJILBAirLinkDelegate +/*********************************************************************************/ + +/** + * This protocol provides delegate methods to recevie updated signal information for channels and updated video data from Lightbridge 2. + */ +@protocol DJILBAirLinkDelegate + +@optional + +/** + * Signal quality and strength information for current downlink channel on each Remote Controller antenna. + * + * @param lbAirLink LBAirLink Instance. + * @param antennas DJISignalInformation object. + */ +- (void)lbAirLink:(DJILBAirLink *_Nonnull)lbAirLink didUpdateRemoteControllerSignalInformation:(NSArray *_Nonnull)antennas; + +/** + * Signal quality and strength information for current uplink channel on each air link module antenna. + * + * @param lbAirLink lbAirLink Instance. + * @param antennas DJISignalInformation object. + */ +- (void)lbAirLink:(DJILBAirLink *_Nonnull)lbAirLink didUpdateLBAirLinkModuleSignalInformation:(NSArray *_Nonnull)antennas; + +/** + * Signal strength for all available downlink channels. + * + * @param lbAirLink LBAirLink Instance. + * @param freqPower Frequency power. + */ +- (void)lbAirLink:(DJILBAirLink *_Nonnull)lbAirLink didUpdateAllChannelSignalStrengths:(DJILBAirLinkAllChannelSignalStrengths)signalStrength; + +/** + * Callback for when the FPV video bandwidth percentage has changed. Each Remote Controller can create a secondary video from the FPV and HD Gimbal video downlink information. For the slave Remote Controllers it's important to know if the percentage bandwidth has changed so the right PIP display mode (DJIPIPDisplayMode) can be selected. For example, if the FPV video bandwidth goes to 100%, then DJIALPIPModeLB should be used. + * + * @param lbAirLink LBAirLink instance. + * @param bandwidthPercent Output bandwidth percentage. + */ +- (void)lbAirLink:(DJILBAirLink *_Nonnull)lbAirLink didFPVBandwidthPercentChanged:(float)bandwidthPercent; + +/** + * Tells the delegate that a updated Video data is received. + * + * @param lbAirLink LBAirLink Instance. + * @param data The received video data. + */ +- (void)lbAirLink:(DJILBAirLink *_Nonnull)lbAirLink didReceiveVideoData:(NSData *)data; + +@end + + +/*********************************************************************************/ +#pragma mark - DJILBAirLink +/*********************************************************************************/ + +/** + * This class contains methods to change settings of the Lightbridge Air Link. + */ +@interface DJILBAirLink : DJIBaseComponent + +@property(nonatomic, weak) id delegate; + +/** + * Sets downlink channel selection mode (automatic or manual). + * + * @param mode Channel selection mode for LBAirLink. + * @param completion Completion block. + */ +- (void)setChannelSelectionMode:(DJILBAirLinkChannelSelectionMode)mode withCompletion:(DJICompletionBlock)completion; + +/** + * Gets downlink channel selection mode. + * + * @param completion Completion block. + */ +- (void)getChannelSelectionModeWithCompletion:(void (^_Nullable)(DJILBAirLinkChannelSelectionMode mode, NSError *_Nullable error))completion; + +/** + * Sets fixed downlink channel. Channel selection mode should be set to DJILBAirLinkChannelSelectionModeManual. + * Channel can be between 1 and DJILBAirLinkSupportedChannelMax. + * + * @param channel Specific channel for the air link. + * @param completion Completion block. + + */ +- (void)setChannel:(int)channel withCompletion:(DJICompletionBlock)completion; + +/** + * Gets current downlink channel of air link. + * + * @param completion Completion block. + */ +- (void)getChannelWithCompletion:(void (^_Nullable)(int channel, NSError *_Nullable error))completion; + +/** + * Sets the downlink data rate (throughput). Higher data rates increase the quality of video transmission, but can only be used at shorter ranges. + * + * @param rate Fixed rate (throughput). + * @param completion Completion block. + */ +- (void)setDataRate:(DJILBAirLinkDataRate)rate withCompletion:(DJICompletionBlock)completion; + +/** + * Gets the current downlink data rate (throughput). + * + * @param completion Completion block. + */ +- (void)getDataRateWithCompletion:(void (^_Nullable)(DJILBAirLinkDataRate rate, NSError *_Nullable error))completion; + +/** + * Sets FPV video quality vs latency preference. This mode only effects the FPV camera and not the camera on the HD Gimbal. + * + * @param qualityLatency Quality vs Latency tradeoff for the FPV video + * @param completion Completion block. + */ +- (void)setFPVQualityLatency:(DJILBAirLinkFPVVideoQualityLatency)qualityLatency withCompletion:(DJICompletionBlock)completion; + +/** + * Gets FPV video quality vs latency preference. This mode only effects the FPV camera and not the camera on the HD Gimbal. + * + * @param completion Completion block. + */ +- (void)getFPVQualityLatencyWithCompletion:(void (^_Nullable)(DJILBAirLinkFPVVideoQualityLatency qualityLatency, NSError *_Nullable error))completion; + +/** + * Sets the percentage downlink video bandwidth dedicated to the FPV camera. The remaining percentage is dedicated to the camera on the HD Gimbal. Setting 100% dedicates all the video bandwidth to FPV. + * + * @param percent Percentage downlink bandwidth for FPV camera. + * @param completion Completion block. + */ +- (void)setFPVVideoBandwidthPercent:(float)percent withCompletion:(DJICompletionBlock)completion; + +/** + * Gets the percentage downlink video bandwidth dedicated to the FPV camera. The remaining percentage is dedicated to the camera on the HD Gimbal. Setting 100% dedicates all the video bandwidth to FPV. + * + */ +- (void)getFPVVideoBandwidthPercentWithCompletion:(void (^_Nullable)(float percent, NSError *_Nullable error))completion; + + +/*********************************************************************************/ +#pragma mark - Secondary Video Output +/*********************************************************************************/ + +/** + * Return whether secondary video output supported. + * + * @return Secondary video output support result + */ +- (BOOL)isSecondaryVideoOutputSupported; + +/** + * Enable secondary video output on Remote Controller. The remote controller outputs video to the Mobile Device by default. This will enable a secondary video stream to one of the Remote Controller's physical HDMI and SDI ports (set by setSecondaryVideoPort). + * + * @param enabled Enables secondary video output. + * @param completion Completion block. + */ +- (void)setSecondaryVideoOutputEnabled:(BOOL)enabled withCompletion:(DJICompletionBlock)completion; + +/** + * Gets whether secondary video output on Remote Controller is enabled. The Remote Controller outputs video to the Mobile Device by default, but a secondary video can be routed to its HDMI or SDI port. Use setSecondaryVideoOuputEnable to enable/disable and setSecondaryVideoOutputPort to choose the port. + * + * @param completion Completion block. + */ +- (void)getSecondaryVideoOutputEnabledWithCompletion:(void (^_Nullable)(BOOL enabled, NSError *_Nullable error))completion; + +/** + * Sets secondary video output port on Remote Controller. HDMI or SDI are possible. Only one port can be active at once. + * + * @param port Secondary video output port. + * @param completion Completion block. + */ +- (void)setSecondaryVideoOutputPort:(DJILBAirLinkSecondaryVideoOutputPort)port withCompletion:(DJICompletionBlock)completion; + +/** + * Gets secondary video output port on Remote Controller. HDMI or SDI are possible. Only one port can be active at once. + * + * @param completion Completion block. + */ +- (void)getSecondaryVideoOutputPortWithCompletion:(void (^_Nullable)(DJILBAirLinkSecondaryVideoOutputPort port, NSError *_Nullable error))completion; + +/** + * Sets the secondary video output Picture in Picture (PIP) display mode. The air link module can connect to both an FPV camera (through the HDMI and AV ports) and a camera mounted on the HD Gimbal (through the Gimbal port). The output video can then be a combination of the two video sources. Either a single video source can be displayed, or one can be displayed within the other (as a Picture in Picture, or PIP). If the mode is set incorrectly, then no output video will be displayed. For example, if only a FPV camera is connected, or the bandwidth for the 'LB' data (FPV) is set to 100 percent, then the only mode that will display data is the DJILBAirLinkPIPModeLB. + * + * @param pipDisplay Picture in Picture display mode. + * @param completion Completion block. + * + */ +- (void)setPIPDisplay:(DJILBAirLinkPIPDisplayMode)pipDisplay withCompletion:(DJICompletionBlock)completion; + +/** + * Gets the secondary video output Picture in Picture (PIP) display mode. The air link module can connect to both an FPV camera (through the HDMI and AV ports) and a camera mounted on the HD Gimbal (through the Gimbal port). The output video can then be a combination of the two video sources. Either a single video source can be displayed, or one can be displayed within the other (as a Picture in Picture, or PIP). + * + * @param completion Completion block. + * + */ +- (void)getPIPDisplayWithCompletion:(void (^_Nullable)(DJILBAirLinkPIPDisplayMode pipDisplay, NSError *_Nullable error))completion; + +/** + * Enables and disables OSD overlay on the secondary video. OSD is flight data like altitude, attitude etc. and can be overlayed on the PIP video. + * + * @param enabled Whether dispaly OSD on screen. + * @param completion Completion block. + * + */ +- (void)setDisplayOSDEnabled:(BOOL)enabled withCompletion:(DJICompletionBlock)completion; + +/** + * Gets whether OSD is overlayed on the video feed. + * + * @param completion Completion block. + * + */ +- (void)getDisplayOSDEnabledWithCompletion:(void (^_Nullable)(BOOL enabled, NSError *_Nullable error))completion; + +/** + * Sets OSD top margin in video pixels. + * + * @param margin Top margin of OSD, should be in range [0, 50] + * @param completion Completion block. + * + */ +- (void)setOSDTopMargin:(NSUInteger)margin withCompletion:(DJICompletionBlock)completion; + +/** + * Gets OSD top margin in video pixels. + * + * @param completion Completion block. + * + */ +- (void)getOSDTopMarginWithCompletion:(void (^_Nullable)(NSUInteger margin, NSError *_Nullable error))completion; + +/** + * Sets OSD left margin in video pixels. + * + * @param margin Left margin of OSD, should be in range [0, 50] + * @param completion Completion block. + * + */ +- (void)setOSDLeftMargin:(NSUInteger)margin withCompletion:(DJICompletionBlock)completion; + +/** + * Gets OSD left margin in video pixels. + * + * @param completion Completion block. + * + */ +- (void)getOSDLeftMarginWithCompletion:(void (^_Nullable)(NSUInteger margin, NSError *_Nullable error))completion; + +/** + * Sets OSD bottom margin in video pixels. + * + * @param margin Bottom margin of OSD, should be in range [0, 50] + * @param completion Completion block. + * + */ +- (void)setOSDBottomMargin:(NSUInteger)margin withCompletion:(DJICompletionBlock)completion; + +/** + * Gets OSD bottom margin in video pixels. + * + * @param completion Completion block. + * + */ +- (void)getOSDBottomMarginWithCompletion:(void (^_Nullable)(NSUInteger margin, NSError *_Nullable error))completion; + +/** + * Sets OSD right margin in video pixels. + * + * @param margin Right margin of OSD, should be in range [0, 50] + * @param completion Completion block. + * + */ +- (void)setOSDRightMargin:(NSUInteger)margin withCompletion:(DJICompletionBlock)completion; + +/** + * Gets OSD right margin in video pixels. + * + * @param completion Completion block. + * + */ +- (void)getOSDRightMarginWithCompletion:(void (^_Nullable)(NSUInteger margin, NSError *_Nullable error))completion; + +/** + * Sets OSD units to be metric or imperial. + * + * @param units OSD unit. + * @param completion Completion block. + * + */ +- (void)setOSDUnits:(DJILBAirLinkOSDUnits)units withCompletion:(DJICompletionBlock)completion; + +/** + * Gets OSD units as either metric or imperial. + * + * @param completion Completion block. + * + */ +- (void)getOSDUnitsWithCompletion:(void (^_Nullable)(DJILBAirLinkOSDUnits units, NSError *_Nullable error))completion; + +/** + * Sets Remote Controller HDMI video port output video format. + * + * @param outputFormat Video output format for HDMI port. + * @param completion Completion block. + * + */ +- (void)setHDMIOutputFormat:(DJILBAirLinkSecondaryVideoFormat)format withCompletion:(DJICompletionBlock)completion; + +/** + * Gets Remote Controller HDMI video port output video format. + * + * @param completion Completion block. + * + */ +- (void)getHDMIOutputFormatWithCompletion:(void (^_Nullable)(DJILBAirLinkSecondaryVideoFormat format, NSError *_Nullable error))completion; + +/** + * Sets Remote Controller SDI video port output video format. + * + * @param outputFormat Video output format for SDI port. + * @param completion Completion block. + * + */ +- (void)setSDIOutputFormat:(DJILBAirLinkSecondaryVideoFormat)format withCompletion:(DJICompletionBlock)completion; + +/** + * Gets Remote Controller SDI video port output video format. + * + * @param completion Completion block. + * + */ +- (void)getSDIOutputFormatWithCompletion:(void (^_Nullable)(DJILBAirLinkSecondaryVideoFormat format, NSError *_Nullable error))completion; + +/** + * Sets PIP (Picture In Picture) position relative to top left corner of the main subject video feed. + * + * + * @param position Position of PIP on the screen. + * @param completion Completion block. + * + */ +- (void)setPIPPosition:(DJILBAirLinkPIPPosition)position withCompletion:(DJICompletionBlock)completion; + +/** + * Gets PIP (Picture In Picture) position relative to top left corner of the main subject video feed. + * + * @param completion Completion block. + * + */ +- (void)getPIPPositionWithCompletion:(void (^_Nullable)(DJILBAirLinkPIPPosition position, NSError *_Nullable error))completion; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJILandingGear.h b/DJISDK.framework/Headers/DJILandingGear.h new file mode 100644 index 0000000..8cfdf14 --- /dev/null +++ b/DJISDK.framework/Headers/DJILandingGear.h @@ -0,0 +1,128 @@ +// +// DJILandingGear.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * Current state of the Landing Gear + */ +typedef NS_ENUM (uint8_t, DJILandingGearStatus){ + /** + * Landing Gear is in unknown state + */ + DJILandingGearStatusUnknown, + /** + * Landing Gear is fully deployed (ready for landing) + */ + DJILandingGearStatusDeployed, + /** + * Landing Gear is fully retracted (ready for flying) + */ + DJILandingGearStatusRetracted, + /** + * Landing Gear is deploying (getting ready for landing) + */ + DJILandingGearStatusDeploying, + /** + * Landing Gear is retracting (getting ready for flying) + */ + DJILandingGearStatusRetracting, + /** + * Landing Gear is stopped + */ + DJILandingGearStatusStopped, +}; + +/** + * Current Mode of the Landing Gear + */ +typedef NS_ENUM (uint8_t, DJILandingGearMode){ + /** + * Landing Gear can be deployed and retracted through function calls + */ + DJILandingGearModeNormal, + /** + * Landing Gear is in transport mode (either it is moving into, moving out of, or stopped in transport position) + */ + DJILandingGearModeTransport, + /** + * Landing Gear automatically transitions between deployed and retracted depending on altitude. During take-off, the transition point is 1.2m above ground. After take-off (during flight or when landing), the transition point is 0.5m above ground. + */ + DJILandingGearModeAuto, + /** + * Landing Gear is in an unknown mode + */ + DJILandingGearModeUnknown, +}; + +/** + * + * This class contains the state of the landing gear. It also provides methods to control the landing gear. + */ +@interface DJILandingGear : NSObject + +/** + * The current state/position of the landing gear. + */ +@property(nonatomic, readonly) DJILandingGearStatus status; + +/** + * The mode the landing gear is in. + */ +@property(nonatomic, readonly) DJILandingGearMode mode; + +/** + * YES if the landing gear is supported for the connected aircraft. + */ +- (BOOL)isLandingGearMovable; + +/** + * Turns on the self-adaptive landing gear. If self-adaptive landing gear is turned on the landing Gear automatically + * transitions between deployed and retracted depending on altitude. During take-off, the transition point is 1.2m above + * ground. After take-off (during flight or when landing), the transition point is 0.5m above ground. + */ +- (void)turnOnAutoLandingGearWithCompletion:(DJICompletionBlock)completion; + +/** + * Turns off the self-adaptive landing gear. If self-adaptive landing gear is turned off, + * the aircraft will not automatically lower and raise the landing gear when the aircraft + * is 0.5m above the ground. + * + */ +- (void)turnOffAutoLandingGearWithCompletion:(DJICompletionBlock)completion; + +/** + * Enters the transport mode. In transport mode, the landing gear will be in the same plane as the aircraft body, so that it can be easily transported. + * + * @attention If the gimbal is not removed or the ground is not flat, enter transport mode will fail. + */ +- (void)enterTransportModeWithCompletion:(DJICompletionBlock)completion; + +/** + * Exit transport mode. + * + */ +- (void)exitTransportModeWithCompletion:(DJICompletionBlock)completion; + +/** + * Retracts the landing gear. Should only be used when setLandingGearMode is DJILandingGearModeNormal. + * + */ +- (void)retractLandingGearWithCompletion:(DJICompletionBlock)completion; + +/** + * Deploys the landing gear. Should only be used when setLandingGearMode is DJILandingGearModeNormal. + * + */ +- (void)deployLandingGearWithCompletion:(DJICompletionBlock)completion; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIMedia.h b/DJISDK.framework/Headers/DJIMedia.h new file mode 100644 index 0000000..b2c95e7 --- /dev/null +++ b/DJISDK.framework/Headers/DJIMedia.h @@ -0,0 +1,137 @@ +// +// DJIMedia.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import "DJIBaseProduct.h" + +NS_ASSUME_NONNULL_BEGIN + +/*********************************************************************************/ +#pragma mark - DJIMediaType +/*********************************************************************************/ + +@class UIImage; +/** + * Media types. + */ +typedef NS_ENUM (NSUInteger, DJIMediaType){ + /** + * Unknown. + */ + DJIMediaTypeUnknown, + /** + * JPEG. + */ + DJIMediaTypeJPEG, + /** + * MP4. + */ + DJIMediaTypeMP4, + /** + * MOV. + */ + DJIMediaTypeMOV, + /** + * M4V. + */ + DJIMediaTypeM4V, + /** + * DNG. + */ + DJIMediaTypeRAWDNG, + /** + * Panorama + */ + DJIMediaTypePanorama, + +}; + +/*********************************************************************************/ +#pragma mark - DJIMedia +/*********************************************************************************/ + +/** + * This class contains the information about a multi-media file on the SD card. It also provides methods to fetch the data of the file. + */ +@interface DJIMedia : NSObject + +/** + * Returns the name of the media file. + */ +@property(nonatomic, readonly) NSString *fileName; + +/** + * Returns the size, in bytes, of the media file. + */ +@property(nonatomic, readonly) long long fileSizeInBytes; + +/** + * Returns the time when the media file was created as a string in + * the format "YYYY-MM-DD hh:mm:ss". + */ +@property(nonatomic, readonly) NSString *timeCreated; + +/** + * If the media file is a video, this property returns the duration + * of the video in seconds. Will be 0s if media file is a photo. + */ +@property(nonatomic, readonly) float durationInSeconds; + +/** + * Returns the type of media file. + */ +@property(nonatomic, readonly) DJIMediaType mediaType; + +/** + * Returns the thumbnail for this media. If this property returns nil, + * the user should call fetchThumbnailWithCompletion + */ +@property(nonatomic, readonly) UIImage *_Nullable thumbnail; + +/** + * Fetches this media's thumbnail from the SD card. This method can be used + * to fetch either a photo or a video, where the first frame of the video is + * the thumbnail that is fetched. + * It is not available if the media type is DJIMediaTypePanorama. + * + * @param block Completion block. + */ +- (void)fetchThumbnailWithCompletion:(DJICompletionBlock)block; + +/** + * Fetches this media's data from the SD card. The difference with fetching + * the media data and fetching the thumbnil is that fetching the thumbnail will + * return a low-resolution image of the actual picture while fetching the media + * data will return all data of a video or an image. + * + * @param block Data callback will be called when media data has been received + * from the SD card or an error has occurred. + */ +- (void)fetchMediaDataWithCompletion:(void (^)(NSData *_Nullable data, BOOL *_Nullable stop, NSError *_Nullable error))block; + +/** + * Fetch media's preview image. The preview image is a lower resolution (960 x 540) version of a still picture or + * the first frame of a video. The mediaType of this media object should be 'DJIMediaTypeJPG'. + * It is not available if the media type is DJIMediaTypePanorama. + * + * @param block Remote execute result callback. + */ +- (void)fetchPreviewImageWithCompletion:(void (^)(UIImage *image, NSError *_Nullable error))block; + + +/** + * Fetch sub media files. + * It is available only when the media type is DJIMediaTypePanorama. User should use this method to fetch the set + * of photos shot in a panorama mission. + * + * @param block Remote execute result callback. + */ +- (void)fetchSubMediaFileListWithCompletion:(void (^)(NSArray *_Nullable mediaList, NSError *_Nullable error))block; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIMediaManager.h b/DJISDK.framework/Headers/DJIMediaManager.h new file mode 100644 index 0000000..8f9e00c --- /dev/null +++ b/DJISDK.framework/Headers/DJIMediaManager.h @@ -0,0 +1,42 @@ +// +// DJIMediaManager.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class DJIMedia; + +/*********************************************************************************/ +#pragma mark - DJIMediaManager +/*********************************************************************************/ + +/** + * The media manager is used to interact with the file system in the SD card. + * By using the manager, user can get the meta data for all the multimedia + * files and access to each single multimedia file. + */ +@interface DJIMediaManager : NSObject + +/** + * Fetch media list from remote album. The camera's work mode should be set as DJICameraModeMediaDownload. + * + * @param block Remote execute result. Objects in mediaList are kind of class DJIMedia. + */ +- (void)fetchMediaListWithCompletion:(void (^)(NSArray *_Nullable mediaList, NSError *_Nullable error))block; + +/** + * Delete media from remote album. The camera's work mode should be set as DJICameraModeMediaDownload. + * + * @param media Media files to be deleted. + * @param block Remote execute result, 'deleteFailures' will contain media which failed to delete. + */ +- (void)deleteMedia:(NSArray *)media withCompletion:(void (^)(NSArray *_Nonnull deleteFailures, NSError *_Nullable error))block; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJIMission.h b/DJISDK.framework/Headers/DJIMission.h new file mode 100644 index 0000000..21b692e --- /dev/null +++ b/DJISDK.framework/Headers/DJIMission.h @@ -0,0 +1,55 @@ +// +// DJIMission.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import "DJIBaseProduct.h" + +NS_ASSUME_NONNULL_BEGIN + + +/** + * The class is an abstract class representing the progress of an executing mission. + */ +@interface DJIMissionProgressStatus : NSObject + +/** + * Error happens in mission execution. + */ +@property(nonatomic, readonly) NSError *_Nullable error; + +@end + +@class DJIMission; + +/** + * Returns the progress status from 0.0 to 1.0 + */ +typedef void (^_Nullable DJIMissionProgressHandler)(float progress); + +/** + * Download mission completion block. + * + * @param newMission New downloaded mission. + * @param error Error happens in downloading. + */ +typedef void (^_Nullable DJIMissionDownloadCompletionBlock)(DJIMission *_Nullable newMission, NSError *_Nullable error); + +/** + * The class is an abstract class representing a mission that can be executed by the mission manager. + */ +@interface DJIMission : NSObject + +/** + * Whether current mission can be paused. + * + * @return YES if mission can be paused. No if mission can not be paused. + */ +- (BOOL)isPausable; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIMissionManager.h b/DJISDK.framework/Headers/DJIMissionManager.h new file mode 100644 index 0000000..7e23e97 --- /dev/null +++ b/DJISDK.framework/Headers/DJIMissionManager.h @@ -0,0 +1,120 @@ +// +// DJIMissionManager.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import "DJIBaseProduct.h" +#import "DJIMission.h" + +NS_ASSUME_NONNULL_BEGIN + +@class DJIMissionManager; +@class DJIMission; +@class DJIMissionProgressStatus; + +/** + * This protocol provides methods to check mission execution status and result. + */ +@protocol DJIMissionManagerDelegate + +@optional + +/** + * Mission execution finished callback. + * + * @param manager Mission object + * @param error Show whether the mission was finished with error. + */ +- (void)missionManager:(DJIMissionManager *_Nonnull)manager didFinishMissionExecution:(NSError *_Nullable)error; + +/** + * Mission execution state update callback. + * Returns current mission and status. For the waypoint mission, it will include mission state, + * target waypoint index, waypoint execution state, as well as error if have. + * + * @param manager Mission object + * @param missionProgress Mission progress object + */ +- (void)missionManager:(DJIMissionManager *_Nonnull)manager missionProgressStatus:(DJIMissionProgressStatus *_Nonnull)missionProgress; + +@end + +/** + * This class manages the execution cycle for a mission. To execute a mission, normally user needs to first invoke prepareMission:withProgress:withCompletion to get the mission prepared. Then a user can call startMissionExecutionWithCompletion: to start the prepared mission. User can also pause, resume or stop an executing mission if the mission supports the operation. + * + */ +@interface DJIMissionManager : NSObject + +@property(nonatomic, weak) id delegate; + +/** + * YES if mission is ready to be executed. It is ready when the uploadMission method completes successfully. + */ +@property(nonatomic, readonly) BOOL isMissionReadyToExecute; + ++ (DJIMissionManager *_Nullable)sharedInstance; + +/** + * Prepares the mission for execution. For the waypoint mission, data needs to be uploaded to the aircraft (product) and the + * DJIMissionProgressHandler can be used to monitor upload progress. The follow-me, panorama, hotpoint and custom missions + * require much shorter time for the preparation phase. PrepareMission should fail if a mission is currently executing. + * + * @param mission Mission object + * @param preparationProgress Progress handler callback method to monitor preparation progress + * @param completion Completion block. + */ +- (void)prepareMission:(DJIMission *_Nonnull)mission withProgress:(DJIMissionProgressHandler)preparationProgress withCompletion:(DJICompletionBlock)completion; + +/** + * Downloads the current mission configuration data from aircraft. This method should only be called after a mission has been prepared. Only waypoint missions and hot point missions can be downloaded from the aircraft. + * + * + * @param downloadProgress Progress handler callback method to monitor download progress + * @param completion Completion block. + */ +- (void)downloadMissionWithProgress:(DJIMissionProgressHandler)downladProgress withCompletion:(DJIMissionDownloadCompletionBlock)completion; + +/** + * Starts mission execution. Should only be called after prepareMission is successfully called. + * For waypoint mission if the aircraft isn't flying, it will automatically take off and execute the mission. For hot point and follow me mission, the aircraft needs to be flying before the mission is started. For custom mission, the behaviour depends on the first mission step. + * + * @param completion Completion block. + */ +- (void)startMissionExecutionWithCompletion:(DJICompletionBlock)completion; + +/** + * Pauses the current mission being executed and the aircraft will hover in its current location. Current state + * will be saved until resumeMissionExecutionWithCompletion is called. + * Returns a system busy error if the MissionManager is uploading or downloading the mission. + * + * @param completion Completion block. + */ +- (void)pauseMissionExecutionWithCompletion:(DJICompletionBlock)completion; + +/** + * Resumes the currently paused mission. Returns a system busy error if the MissionManager is uploading or downloading the mission. + * + * @param completion Completion block. + */ +- (void)resumeMissionExecutionWithCompletion:(DJICompletionBlock)completion; + +/** + * Stops the current mission. The aircraft will hover in place. + * Returns a system busy error if the MissionManager is uploading or downloading the mission. + * + * @param completion Completion block. + */ +- (void)stopMissionExecutionWithCompletion:(DJICompletionBlock)completion; + +/** + * Returns current executing mission. This method is should only be called after the mission has started execution. + * + * @param Mission object of current mission. + */ +- (DJIMission *_Nullable)currentExecutingMission; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIMissionStep.h b/DJISDK.framework/Headers/DJIMissionStep.h new file mode 100644 index 0000000..20334da --- /dev/null +++ b/DJISDK.framework/Headers/DJIMissionStep.h @@ -0,0 +1,25 @@ +// +// DJIMissionStep.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import "DJIBaseProduct.h" +#import "DJIAircraft.h" +#import "DJIMission.h" +#import "DJIFlightControllerCurrentState.h" +#import "DJICameraSettingsDef.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * Abstract class for all mission steps. + * + */ +@interface DJIMissionStep : NSOperation + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIPanoramaMission.h b/DJISDK.framework/Headers/DJIPanoramaMission.h new file mode 100644 index 0000000..a2c4c86 --- /dev/null +++ b/DJISDK.framework/Headers/DJIPanoramaMission.h @@ -0,0 +1,80 @@ +// +// DJIPanoramaMission.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import "DJIMission.h" + +NS_ASSUME_NONNULL_BEGIN + +@class DJIMedia; + +/** + * Defines options for different types of modes for panorama mission. + */ +typedef NS_ENUM (NSUInteger, DJIPanoramaMode) { + /** + * 360 Degree Panorama mode + */ + DJIPanoramaModeFullCircle = 0, + /** + * 180 Degree Panorama mode. Also known as selfie mode in OSMO. + */ + DJIPanoramaModeHalfCircle, + /** + * Unknown mode. + */ + DJIPanoramaModeUnknown = 0xFF +}; + +/** + * This class provides the real-time status of an executing panorama mission. + */ +@interface DJIPanoramaMissionStatus : DJIMissionProgressStatus + +/** + * The total number of photos will be shot during the mission. + * In the full circle mode, the number should be 8. + * In the half circle mode, the number should be 5. + */ +@property(nonatomic, readonly) NSUInteger totalNumber; + +/** + * The number of photos that have been shot. + */ +@property(nonatomic, readonly) NSUInteger currentShotNumber; + +/** + * The number of photos that have been saved to SD card. + */ +@property(nonatomic, readonly) NSUInteger currentSavedNumber; + +@end + +/** + * User can use this mission to rotate camera 360 or 180 degrees to takes several photos. Then download the photos to render a panorama. Please note that + * photo stitching is not provided in the SDK. In full circle mode, 8 photos are taken. In half circle mode, 5 photos are taken. + */ +@interface DJIPanoramaMission : DJIMission + +/** + * Returns the current panorama mode of this mission. + */ +@property (nonatomic, readonly) DJIPanoramaMode panoramaMode; + +/** + * Initializer for the Panorama mission object with panorama mode. + */ +- (id)initWithPanoramaMode:(DJIPanoramaMode)mode; + +/** + * Retrieves the DJIMedia object for the recently finished panorama mission. Use `fetchSubMediaFileListWithCompletion:` method on the retrieved DJIMedia to + * retrieve the panorama photos. + */ +- (void)getPanoramaMediaFileWithCompletion:(void (^)(DJIMedia *_Nullable panoMedia, NSError *_Nullable error))block; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJIPlaybackManager.h b/DJISDK.framework/Headers/DJIPlaybackManager.h new file mode 100644 index 0000000..6263c00 --- /dev/null +++ b/DJISDK.framework/Headers/DJIPlaybackManager.h @@ -0,0 +1,172 @@ +// +// DJIPlaybackManager.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import "DJICameraSettingsDef.h" +#import + +NS_ASSUME_NONNULL_BEGIN + +@class DJIPlaybackManager; +@class DJICameraPlaybackState; + +typedef void (^DJIFileDownloadPreparingBlock)(NSString *_Nullable fileName, DJIDownloadFileType fileType, NSUInteger fileSize, BOOL *skip); +typedef void (^DJIFileDownloadingBlock)(NSData *_Nullable data, NSError *_Nullable error); +typedef void (^DJIFileDownloadCompletionBlock)(); + +/*********************************************************************************/ +#pragma mark - DJIPlaybackDelegate +/*********************************************************************************/ + +/** + * The protocol provides delegate method to receive the updated state of the playback manager. + */ +@protocol DJIPlaybackDelegate + +@required +/** + * Updates playback state of the camera. This update method will only be called when the camera's work + * mode is set to DJICameraModePlayback. + * + * @param playbackState Camera's playback state. + */ +- (void)playbackManager:(DJIPlaybackManager *)playbackManager didUpdatePlaybackState:(DJICameraPlaybackState *)playbackState; + +@end + +/*********************************************************************************/ +#pragma mark - DJIMediaManager +/*********************************************************************************/ + +/** + * The playback manager is used to interact with the playback system of the camera. + * By using the manager, user can control the playback system. + */ +@interface DJIPlaybackManager : NSObject + +@property(nonatomic, weak) id delegate; + +/** + * This enables the user to select, download and/or delete multiple media files when the camera is in Playback mode. + */ +- (void)enterMultipleEditMode; + +/** + * Exits multiple edit mode. + */ +- (void)exitMultipleEditMode; + +/** + * Selects or unselects a file at the specified index of the current page. This index is unrelated to filename, and used in multiple edit mode. + * + * @param index Index at which to select a file. + */ +- (void)toggleFileSelectionAtIndex:(int)index; + +/** + * Selects all the files on the SD card. + */ +- (void)selectAllFiles; + +/** + * Unselects all the files on the SD card. + */ +- (void)unselectAllFiles; + +/** + * Selects all the file(s) on the current page. + */ +- (void)selectAllFilesInPage; + +/** + * Unselects all the file(s) on the current page. + */ +- (void)unselectAllFilesInPage; + +/** + * Deletes all selected files from the SD card. + */ +- (void)deleteAllSelectedFiles; + +/** + * Downloads the selected files. When this method is called. The dataBlock gets called continuously until all the data is downloaded. + * The prepare and completion blocks are called once for each file being downloaded. In the prepareBlock, you can get the forthcoming file's info, like file name, file size, etc. + * + * If an error occurs before the downloading of any files, only the overallCompletionBlock will be called with an error returned. + * If an error occurs during the downloading of a file, both dataBlock and overallCompletionBlock will be called with an error returned. + * + * @param prepareBlock Callback to prepare each file for download. + * @param dataBlock Callback while a file is downloading. The dataBlock can be called multiple times for a file. + * @param fileCompletionBlock Callback after each file have been downloaded. + * @param finishBlock Callback after the downloading is finished. + */ +- (void)downloadSelectedFilesWithPreparation:(DJIFileDownloadPreparingBlock)prepareBlock process:(DJIFileDownloadingBlock)dataBlock fileCompletion:(DJIFileDownloadCompletionBlock)fileCompletionBlock overallCompletion:(DJICompletionBlock)overallCompletionBlock; + +/** + * Enables the user to preview multiple files when the camera is in Playback mode. + */ +- (void)enterMultiplePreviewMode; + +/** + * Goes to the next page when there are multiple pages. + */ +- (void)goToNextMultiplePreviewPage; + +/** + * Goes back to the previous page when there are multiple pages. + */ +- (void)goToPreviousMultiplePreviewPage; + +/** + * Enters single file preview mode for a file at the specified index. In order for this method to be called, + * the camera work mode should be DJICameraModePlayback. + * + * @param index File to be previewed at the specified index. + */ +- (void)enterSinglePreviewModeWithIndex:(uint8_t)index; + +/** + * Goes to the next page. + */ +- (void)goToNextSinglePreviewPage; + +/** + * Goes back to the previous page. + */ +- (void)goToPreviousSinglePreviewPage; + +/** + * Deletes the current file being previewed. + */ +- (void)deleteCurrentPreviewFile; + +/** + * Starts video playback. The selected file must be a video file. + */ +- (void)startVideoPlayback; + +/** + * Pause a video during playback. + */ +- (void)pauseVideoPlayback; + +/** + * Stops a video during playback + */ +- (void)stopVideoPlayback; + +/** + * Plays a video from the specified location. + * + * @param location Location from which to play the video must be in the range of [0, 100]. This + * value represents at what percent of the entire video it should start playing. + */ +- (void)setVideoPlaybackFromLocation:(uint8_t)location; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJIRecordVideoStep.h b/DJISDK.framework/Headers/DJIRecordVideoStep.h new file mode 100644 index 0000000..06f959f --- /dev/null +++ b/DJISDK.framework/Headers/DJIRecordVideoStep.h @@ -0,0 +1,42 @@ +// +// DJIRecordVideoStep.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class represents a step related to video-recording for a custom mission. By creating an object of this class and adding it into a custom mission, user can record video during the custom mission execution. + */ +@interface DJIRecordVideoStep : DJIMissionStep + +/** + * Initialized instance with duration. + * + * @param duration Duration in seconds for recording video. + * + * @return Instance of DJIRecordVideoStep + */ +- (instancetype _Nullable)initWithDuration:(double)duration; + +/** + * Initialized instance for start video recording only. + * + * @return Instance of DJIRecordVideoStep + */ +- (instancetype _Nullable)initWithStartRecordVideo; + +/** + * Initialized instance for stop video recording only. + * + * @return Instance of DJIRecordVideoStep + */ +- (instancetype _Nullable)initWithStopRecordVideo; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIRemoteController.h b/DJISDK.framework/Headers/DJIRemoteController.h new file mode 100644 index 0000000..c16428a --- /dev/null +++ b/DJISDK.framework/Headers/DJIRemoteController.h @@ -0,0 +1,1094 @@ +// +// DJIRemoteController.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +#define DJI_RC_CONTROL_CHANNEL_SIZE (4) + +NS_ASSUME_NONNULL_BEGIN + +/*********************************************************************************/ +#pragma mark - Data Structs and Enums +/*********************************************************************************/ + +#pragma pack(1) + +//----------------------------------------------------------------- +#pragma mark DJIRemoteControllerMode +//----------------------------------------------------------------- +/** + * Remote Controller mode of operation can be normal (single RC connected to aircraft), master, + * slave, or unknown + */ +typedef NS_ENUM (uint8_t, DJIRemoteControllerMode){ + /** + * Remote Controller is a master (will route a connected slave Remote Controller's commands to the aircraft). + */ + DJIRemoteControllerModeMaster, + /** + * Remote Controller is currently a slave Remote Controller (sends commands to aircraft through a master Remote Controller). + */ + DJIRemoteControllerModeSlave, + /** + * Remote Controller is unconnected to another Remote Controller. + */ + DJIRemoteControllerModeNormal, + /** + * The Remote Controller's mode is unknown. + */ + DJIRemoteControllerModeUnknown, +}; + +//----------------------------------------------------------------- +#pragma mark DJIRCID +//----------------------------------------------------------------- +/** + * Remote Controller's unique identification number. This is given to each Remote + * Controller during manufacture and cannot be changed. + */ +typedef uint32_t DJIRCID; + +//----------------------------------------------------------------- +#pragma mark DJIRCSignalQualityOfConnectedRC +//----------------------------------------------------------------- +/** + * Signal quality of a connected master or slave Remote Controller in percent [0, 100]. + */ +typedef uint8_t DJIRCSignalQualityOfConnectedRC; + +//----------------------------------------------------------------- +#pragma mark DJIRCControlStyle +//----------------------------------------------------------------- +/** + * Remote Controller's control style. + */ +typedef NS_OPTIONS (uint8_t, DJIRCControlStyle){ + /** + * Remote Controller uses Japanese controls (also known as Mode 1). In this mode the left stick controls Pitch + * and Yaw, and the right stick controls Throttle and Roll + */ + RCControlStyleJapanese, + /** + * Remote Controller uses American controls (also known as Mode 2). In this mode + * the left stick controls Throttle and Yaw, and the right stick controls Pitch and Roll. + */ + RCControlStyleAmerican, + /** + * Remote Controller uses Chinese controls (also know as Mode 3). In this mode the left stick controls Pitch and Roll, and the right stick controls Throttle and Yaw. + */ + RCControlStyleChinese, + /** + * Stick channel mapping for Roll, Pitch, Yaw and Throttle can be customized. + */ + RCControlStyleCustom, + /** + * Default Remote Controller controls and settings for slave + * Remote Controller. + */ + RCSlaveControlStyleDefault, + /** + * Slave remote controller stick channel mapping for Roll, Pitch, Yaw and + * Throttle can be customized. + */ + RCSlaveControlStyleCustom, + /** + * The Remote Controller's control style is + * unknown. + */ + RCControlStyleUnknown, +}; + +//----------------------------------------------------------------- +#pragma mark DJIRCControlChannelName +//----------------------------------------------------------------- +/** + * Remote Controller control channels. These will be used in RC Custom Control Style. Please refer to + * RCControlStyleCustom and RCSlaveControlStyleCustom. + * + */ +typedef NS_ENUM (uint8_t, DJIRCControlChannelName){ + /** + * Throttle control channel. + */ + DJIRCControlChannelNameThrottle, + /** + * Pitch control channel. + */ + DJIRCControlChannelNamePitch, + /** + * Roll control channel. + */ + DJIRCControlChannelNameRoll, + /** + * Yaw control channel. + */ + DJIRCControlChannelNameYaw, +}; + +//----------------------------------------------------------------- +#pragma mark DJIRCControlChannel +//----------------------------------------------------------------- +typedef struct +{ + /** + * Name of the control channel. The format of this + * is DJI_RC_CONTROL_CHANNEL_xxx. The default is American. + */ + DJIRCControlChannelName channel; + /** + * The control channel's settings will be reversed. + * For example, for throttle the joystick is moved up or + * down. If the control channel was reversed, the same motion + * that was once used for up would now move the aircraft + * down and the same motion that was once used for down would + * now move the aircraft up. + */ + BOOL reverse; +} DJIRCControlChannel; + +//----------------------------------------------------------------- +#pragma mark DJIRCControlMode +//----------------------------------------------------------------- +typedef struct +{ + /** + * The control style the Remote Controller is set to. + */ + DJIRCControlStyle controlStyle; + /** + * Setting controls for each of the channels. + */ + DJIRCControlChannel controlChannel[DJI_RC_CONTROL_CHANNEL_SIZE]; +} DJIRCControlMode; + +//----------------------------------------------------------------- +#pragma mark DJIRCRequestGimbalControlResult +//----------------------------------------------------------------- +/** + * Result when a slave Remote Controller requests permission to control the gimbal. + */ +typedef NS_OPTIONS (uint8_t, DJIRCRequestGimbalControlResult){ + /** + * The master Remote Controller agrees to the slave's request. + */ + RCRequestGimbalControlResultAgree, + /** + * The master Remote Controller denies the slave's request. If the slave Remote Controller wants to control the + * gimbal, it must send a request to master Remote Controller first. Then the master Remote Controller can decide to + * approve or deny the request. + */ + RCRequestGimbalControlResultDeny, + /** + * The slave Remote Controller's request timed out. + */ + RCRequestGimbalControlResultTimeout, + /** + * The master Remote Controller authorizes the slave request to control the gimbal. + */ + RCRequestGimbalControlResultAuthorized, + /** + * The slave Remote Controller's request is unknown. + */ + RCRequestGimbalControlResultUnknown, +}; + +//----------------------------------------------------------------- +#pragma mark DJIRCControlPermission +//----------------------------------------------------------------- +typedef struct +{ + /** + * TRUE if the Remote Controller has permission + * to control the gimbal yaw. + */ + bool hasGimbalYawControlPermission; + /** + * TRUE if the Remote Controller has permission + * to control the gimbal roll. + */ + bool hasGimbalRollControlPermission; + /** + * TRUE if the Remote Controller has permission + * to control the gimbal pitch. + */ + bool hasGimbalPitchControlPermission; + /** + * TRUE if the Remote Controller has permission + * to control camera playback. + */ + bool hasPlaybackControlPermission; + /** + * TRUE if the Remote Controller has permission + * to record video with the camera. + */ + bool hasRecordControlPermission; + /** + * TRUE if the Remote Controller has permission + * to take pictures with the camera. + */ + bool hasCaptureControlPermission; +} DJIRCControlPermission; + +//----------------------------------------------------------------- +#pragma mark DJIRCGimbalControlSpeed +//----------------------------------------------------------------- +typedef struct +{ + /** + * Gimbal's pitch speed with range [0,100]. + */ + uint8_t pitchSpeed; + /** + * Gimbal's roll speed with range [0,100]. + */ + uint8_t rollSpeed; + /** + * Gimbal's yaw speed with range [0,100]. + */ + uint8_t yawSpeed; +} DJIRCGimbalControlSpeed; + +//----------------------------------------------------------------- +#pragma mark DJIRCToAircraftPairingState +//----------------------------------------------------------------- +/** + * Remote Controller pairing state. + */ +typedef NS_ENUM (uint8_t, DJIRCToAircraftPairingState){ + /** + * The Remote Controller is not pairing. + */ + DJIRCToAircraftPairingStateNotParing, + /** + * The Remote Controller is currently pairing. + */ + DJIRCToAircraftPairingStateParing, + /** + * The Remote Controller's pairing was completed. + */ + DJIRCToAircraftPairingStateCompleted, + /** + * The Remote Controller's pairing state is unknown. + */ + DJIRCToAircraftPairingStateUnknown, +}; + +//----------------------------------------------------------------- +#pragma mark DJIRCJoinMasterResult +//----------------------------------------------------------------- +/** + * Result when a slave Remote Controller tries to join + * a master Remote Controller. + */ +typedef NS_ENUM (uint8_t, DJIRCJoinMasterResult){ + /** + * The slave Remote Controller's attempt to join + * the master Remote Controller was successful. + */ + DJIRCJoinMasterResultSuccessful, + /** + * The slave Remote Controller's attempt to join + * the master Remote Controller was unsuccessful + * due to a password error. + */ + DJIRCJoinMasterResultPasswordError, + /** + * The slave Remote Controller's attempt to join + * the master Remote Controller was rejected. + */ + DJIRCJoinMasterResultRejected, + /** + * The slave Remote Controller's attempt to join + * the master Remote Controller was unsuccesful + * because the master Remote Controller is at the + * maximum number of slaves it can have. + */ + DJIRCJoinMasterResultReachMaximum, + /** + * The slave Remote Controller's attempt to join + * the master Remote Controller was unsuccessful + * because the request timed out. + */ + DJIRCJoinMasterResultResponseTimeout, + /** + * The result of the slave Remote Controller's + * attempt to join the master Remote Controller + * is unknown. + */ + DJIRCJoinMasterResultUnknown +}; + +//----------------------------------------------------------------- +#pragma mark DJIRCBatteryInfo +//----------------------------------------------------------------- +typedef struct +{ + /** + * The remaining power in the Remote Controller's + * battery in milliamp hours (mAh). + */ + uint32_t remainingEnergyInMAh; + /** + * The remaining power in the Remote Controller's + * battery as a percentage in the range of [0, 100]. + */ + uint8_t remainingEnergyInPercent; +} DJIRCBatteryInfo; + +//----------------------------------------------------------------- +#pragma mark DJIRCGpsTime +//----------------------------------------------------------------- +/** + * Remote Controller's GPS time. + */ +typedef struct +{ + uint8_t hour; + uint8_t minute; + uint8_t second; + uint16_t year; + uint8_t month; + uint8_t day; +} DJIRCGpsTime; + +//----------------------------------------------------------------- +#pragma mark DJIRCGPSData +//----------------------------------------------------------------- +/** + * Remote Controller's GPS data. Only Inspire and M100 Remote Controllers have GPS. + */ +typedef struct +{ + /** + * The Remote Controller's GPS time. + */ + DJIRCGpsTime time; + /** + * The Remote Controller's GPS latitude + * in degrees. + */ + double latitude; + /** + * The Remote Controller's GPS longitude + * in degrees. + */ + double longitude; + /** + * The Remote Controller's speed in the East + * direction in meters/second. A negative speed means the Remote Controller is moving in the West direction. + */ + float speedEast; + /** + * The Remote Controller's speed in the North + * direction in meters/second. A negative speed means the Remote Controller is moving in the South direction. + */ + float speedNorth; + /** + * The number of GPS sattelites the Remote Controller sees. + */ + int satelliteCount; + /** + * The the margin of error, in meters, for the + * GPS location. + */ + float accuracy; + /** + * YES if the GPS data is valid. The data is not valid if there are too few satellites or the signal strength is too low. + */ + BOOL isValid; +} DJIRCGPSData; + +//----------------------------------------------------------------- +#pragma mark DJIRCGimbalControlDirection +//----------------------------------------------------------------- +/** + * Defines what the Gimbal Dial (upper left wheel on the Remote Controller) will control. + */ +typedef NS_ENUM (uint8_t, DJIRCGimbalControlDirection){ + /** + * The upper left wheel will control the gimbal's pitch. + */ + DJIRCGimbalControlDirectionPitch, + /** + * The upper left wheel will control the gimbal's roll. + */ + DJIRCGimbalControlDirectionRoll, + /** + * The upper left wheel will control the gimbal's yaw. + */ + DJIRCGimbalControlDirectionYaw, +}; + +//----------------------------------------------------------------- +#pragma mark DJIRCHardwareRightWheel +//----------------------------------------------------------------- +/** + * Current state of the Camera Settings Dial (upper right wheel on the Remote Controller). + */ +typedef struct +{ + /** + * YES if right wheel present. + */ + BOOL isPresent; + /** + * YES if wheel value has changed. + */ + BOOL wheelChanged; + /** + * YES if wheel is being pressed. + */ + BOOL wheelButtonDown; + /** + * YES if wheel is being turned in a clockwise direction. + */ + BOOL wheelDirection; + /** + * Wheel value in the range of [0, 1320]. The value represents the difference in an operation. + */ + uint8_t value; +} DJIRCHardwareRightWheel; + +//----------------------------------------------------------------- +#pragma mark DJIRCHardwareLeftWheel +//----------------------------------------------------------------- +typedef struct +{ + /** + * Gimbal Dial's (upper left wheel) value in the range of [-660,660] where 0 is untouched and positive is turned in the clockwise direction. + */ + int value; +} DJIRCHardwareLeftWheel; + +//----------------------------------------------------------------- +#pragma mark DJIRCHardwareTransformationSwitchState +//----------------------------------------------------------------- +/** + * Transformation Switch position states. + */ +typedef NS_ENUM (uint8_t, DJIRCHardwareTransformationSwitchState){ + /** + * Retract landing gear switch state + */ + DJIRCHardwareTransformationSwitchStateRetract, + /** + * Deploy landing gear switch state. + */ + DJIRCHardwareTransformationSwitchStateDeploy +}; + +//----------------------------------------------------------------- +#pragma mark DJIRCHardwareTransformSwitch +//----------------------------------------------------------------- +/** + * Transformation Switch position. The Transformation Switch is around the Return To Home Button on Inspire, Inspire 1 and M100 Remote Controllers, and controls the state of the aircraft's landing gear. + */ +typedef struct +{ + /** + * YES if Transformation Switch present. + */ + BOOL isPresent; + /** + * Current transformation switch state. + */ + DJIRCHardwareTransformationSwitchState transformationSwitchState; + +} DJIRCHardwareTransformationSwitch; + +//----------------------------------------------------------------- +#pragma mark DJIRCHardwareFlightModeSwitchState +//----------------------------------------------------------------- +typedef NS_ENUM (uint8_t, DJIRCHardwareFlightModeSwitchState){ + /** + * The Remote Controller's flight mode switch is set to the F (Function) mode on the left. Remote Controller must be in Function mode to enable Mission Manager functions from the Mobile Device. + */ + DJIRCHardwareFlightModeSwitchStateF, + /** + * The Remote Controller's flight mode switch is set to the A (Attitude) mode in the middle. Attitude mode does not use GPS and the vision system for hovering or flying, but uses the barometer to maintain alititude. If the GPS signal is strong enough, the aircraft can still return to home in this mode. + */ + DJIRCHardwareFlightModeSwitchStateA, + /** + * The Remote Controller's flight mode switch is set to the P (Positioning) mode on the right. Positioning mode can use both GPS and the vision system (when available) to fly and hover. + */ + DJIRCHardwareFlightModeSwitchStateP, +}; + +//----------------------------------------------------------------- +#pragma mark DJIRCHardwareFlightModeSwitch +//----------------------------------------------------------------- +/** + * The value of the Remote Controller's flight mode switch. + */ +typedef struct +{ + /** + * Value of the Remote Controller's flight mode switch. + */ + DJIRCHardwareFlightModeSwitchState mode; +} DJIRCHardwareFlightModeSwitch; + +//----------------------------------------------------------------- +#pragma mark DJIRCHardwareButton +//----------------------------------------------------------------- +/** + * Remote Controller has numerous momentary push buttons, which will use this state. + */ +typedef struct +{ + /** + * YES if Hardware button present. + */ + BOOL isPresent; + /** + * YES if button is pressed down. + */ + BOOL buttonDown; +} DJIRCHardwareButton; + +//----------------------------------------------------------------- +#pragma mark DJIRCHardwareJoystick +//----------------------------------------------------------------- +typedef struct +{ + /** + * Joystick's channel value in the range of [-660, 660]. This + * value may be different for the aileron, elevator, throttle, and rudder. + */ + int value; +} DJIRCHardwareJoystick; + +//----------------------------------------------------------------- +#pragma mark DJIRCHardwareState +//----------------------------------------------------------------- +/** + * Remote Controller's current state. + */ +typedef struct +{ + /** + * Current state of the joystick. + */ + DJIRCHardwareJoystick leftHorizontal; + DJIRCHardwareJoystick leftVertical; + DJIRCHardwareJoystick rightVertical; + DJIRCHardwareJoystick rightHorizontal; + + /** + * Current state of the upper left wheel on the Remote Controller (Gimbal Dial). + */ + DJIRCHardwareLeftWheel leftWheel; + + /** + * Current state of the upper right wheel on the Remote Controller (Camera Settings Dial). + */ + DJIRCHardwareRightWheel rightWheel; + + /** + * Current state of the Transformation Switch on the Remote Controller. + */ + DJIRCHardwareTransformationSwitch transformationSwitch; + + /** + * Current state of the Flight Mode Switch on the Remote Controller. + */ + DJIRCHardwareFlightModeSwitch flightModeSwitch; + + /** + * Current state of the Return To Home Button. + */ + DJIRCHardwareButton goHomeButton; + + /** + * Current state of the Video Recording Button. + */ + DJIRCHardwareButton recordButton; + + /** + * Current state of the Shutter Button. + */ + DJIRCHardwareButton shutterButton; + + /** + * Current state of the Playback Button. + */ + DJIRCHardwareButton playbackButton; + + /** + * Current state of custom button 1 (left Back Button). + */ + DJIRCHardwareButton customButton1; + + /** + * Current state of custom button 2 (right Back Button). + */ + DJIRCHardwareButton customButton2; +} DJIRCHardwareState; + +//----------------------------------------------------------------- +#pragma mark DJIRCRemoteFocusControlType +//----------------------------------------------------------------- +/** + * Remote Focus Control Type + */ +typedef NS_ENUM (uint8_t, DJIRCRemoteFocusControlType){ + /** + * Control Aperture + */ + DJIRCRemoteFocusControlTypeAperture, + /** + * Control Focal Length + */ + DJIRCRemoteFocusControlTypeFocalLength, +}; + +//----------------------------------------------------------------- +#pragma mark DJIRCRemoteFocusControlDirection +//----------------------------------------------------------------- +/** + * Remote Focus Control Direction + */ +typedef NS_ENUM (uint8_t, DJIRCRemoteFocusControlDirection){ + /** + * Clockwise + */ + DJIRCRemoteFocusControlDirectionClockwise, + /** + * CounterClockwise + */ + DJIRCRemoteFocusControlDirectionCounterClockwise, +}; + +//----------------------------------------------------------------- +#pragma mark DJIRCRemoteFocusState +//----------------------------------------------------------------- +/** + * Remote Controller's Remote Focus State + * + * The focus product has one dial (focus control) that controls two separate parts + * of the camera: focal length and aperture. However it can only control one of + * these at any one time and is an aboslute dial, meaning that a specific rotational + * position of the dial corresponds to a specific focal length or aperture. + * + * This means, whenever the dial control mode is changed, the dial first has to be + * reset to the new mode's previous dial position before the dial can be used to adjust + * the setting of the new mode. + * + * An example workflow: + * - Use dial to set an Aperture of f2.2 + - Change dial control mode to focal length (set DJIRCRemoteFocusControlType) + - Use the dial to change the focal length + - Change dial control mode back to aperture + - set DJIRCRemoteFocusControlType + - isFocusControlWorks will now be NO + - Adjust dial back to f2.2 + - DJIRCRemoteFocusControlDirection is the direction the dial should be rotated + - isFocusControlWorks will become YES when set back to f2.2 + - Now the dial can be used to adjust the aperture. + * + */ +typedef struct +{ + /** + * + * YES if the focus control works. The control can be either changing the Aperture or Focal Length. If it's NO, you need to follow the DJIRCRemoteFocusControlDirection to rotate the Remote Focus Device until it turns to YES again. + */ + BOOL isFocusControlWorks; + /** + * + * Remote Focus Control Type + */ + DJIRCRemoteFocusControlType controlType; + /** + * + * Remote Focus Control Direction, you need to use it with the isFocusControlWorks value. It will give you the correct rotation direction when isFocusControlWorks is NO. + */ + DJIRCRemoteFocusControlDirection direction; + +} DJIRCRemoteFocusState; + +#pragma pack() + +/*********************************************************************************/ +#pragma mark - DJIRCInfo +/*********************************************************************************/ + +/** + * This class contains the information of a remote controller. + */ +@interface DJIRCInfo : NSObject + +/** + * Remote Controller's unique identifier. + */ +@property(nonatomic, assign) DJIRCID identifier; + +/** + * Remote Controller's name. + */ +@property(nonatomic, strong) NSString *_Nullable name; + +/** + * Remote Controller's password. + */ +@property(nonatomic, strong) NSString *_Nullable password; + +/** + * Signal quality of a conneected master or slave Remote Controller. + */ +@property(nonatomic, assign) DJIRCSignalQualityOfConnectedRC signalQuality; + +/** + * Remote Controller's control permissions. + */ +@property(nonatomic, assign) DJIRCControlPermission controlPermission; + +/** + * Converts the Remote Controller's unique identifier from the property 'identifier' to a string. + * + * @return Remote Controller's identifier as a string. + */ +- (NSString *)RCIdentifier; + +@end + +/*********************************************************************************/ +#pragma mark - DJIRemoteControllerDelegate +/*********************************************************************************/ + +@class DJIRemoteController; + +/** + * This protocol provides delegate methods to receive the updated information related to the remote controller. + * + */ +@protocol DJIRemoteControllerDelegate + +@optional + +/** + * Callback function that updates the Remote Controller's current hardware state (e.g. the state of the physical buttons and joysticks). + * + * @param rc Instance of the Remote Controller for which the hardware state will be updated. + * @param state Current state of the Remote Controller's hardware state. + */ +- (void)remoteController:(DJIRemoteController *)rc didUpdateHardwareState:(DJIRCHardwareState)state; + +/** + * Callback function that updates the Remote Controller's current GPS data. + * + * @param rc Instance of the Remote Controller for which the GPS data will be updated. + * @param state Current state of the Remote Controller's GPS data. + */ +- (void)remoteController:(DJIRemoteController *)rc didUpdateGpsData:(DJIRCGPSData)gpsData; + +/** + * Callback function that updates the Remote Controller's current battery state. + * + * @param rc Instance of the Remote Controller for which the battery state will be updated. + * @param state Current state of the Remote Controller's battery state. + */ +- (void)remoteController:(DJIRemoteController *)rc didUpdateBatteryState:(DJIRCBatteryInfo)batteryInfo; + +/** + * Callback function that gets called when a slave Remote Controller makes a request to a master + * Remote Controller to control the gimbal using the method requestGimbalControlRightWithCallbackBlock. + * + * @param rc Instance of the Remote Controller. + * @param state Information of the slave making the request to the master Remote Controller. + */ +- (void)remoteController:(DJIRemoteController *)rc didReceiveGimbalControlRequestFromSlave:(DJIRCInfo *)slave; + +/** + * Callback function that updates the Remote Focus State, only support Focus product. If the isRCRemoteFocusCheckingSupported is YES, this delegate method will be called. + * + * @param rc Instance of the Remote Controller for which the battery state will be updated. + * @param state Current state of the Remote Focus state. + */ +- (void)remoteController:(DJIRemoteController *)rc didUpdateRemoteFocusState:(DJIRCRemoteFocusState)remoteFocusState; + +@end + +/*********************************************************************************/ +#pragma mark - DJIRemoteController +/*********************************************************************************/ + +@class DJIWiFiLink; + +/** + * The class represents the remote controller of the aircraft. It provides mothods to change the settings of the physical remote controller. For some products (e.g. Inspire 1 and Matric 100), the class provides methods to manager the slave/master mode of the remote controllers. + */ +@interface DJIRemoteController : DJIBaseComponent + +@property(nonatomic, weak) id delegate; + +/** + * Query method to check if the Remote Controller supports Remote Focus State Checking. + */ +- (BOOL)isRCRemoteFocusCheckingSupported; + +/** + * Sets the Remote Controller's name. + * + * @param name Remote controller name to be set. Six characters at most. + * @param completion Completion block. + */ +- (void)setRCName:(NSString *_Nonnull)name withCompletion:(DJICompletionBlock)completion; + +/** + * Gets the Remote Controller's name. + * + */ +- (void)getRCNameWithCompletion:(void (^)(NSString *_Nullable name, NSError *_Nullable error))completion; + +/** + * Sets the Remote Controller's password. + * + * @param password password Remote controller password to be set, using a string consisted by 4 digits. + * @param block Completion block. + */ +- (void)setRCPassword:(NSString *_Nonnull)password withCompletion:(DJICompletionBlock)completion; + +/** + * Gets the Remote Controller's password. + * + */ +- (void)getRCPasswordWithCompletion:(void (^)(NSString *_Nullable password, NSError *_Nullable error))completion; + +/** + * Sets the Remote Controller's control mode. + * + * @param mode Remote Controller control mode to be set. + * @param completion Completion block. + */ +- (void)setRCControlMode:(DJIRCControlMode)mode withCompletion:(DJICompletionBlock)completion; + +/** + * Gets the master Remote Controller's control mode. + * + */ +- (void)getRCControlModeWithCompletion:(void (^)(DJIRCControlMode mode, NSError *_Nullable error))completion; + +//----------------------------------------------------------------- +#pragma mark RC pairing +//----------------------------------------------------------------- +/** + * Enters pairing mode, where the Remote Controller starts pairing with the aircraft. + * This method is used when the Remote Controller no longer recognizes which aircraft + * it is paired with. + */ +- (void)enterRCToAircraftPairingModeWithCompletion:(DJICompletionBlock)completion; + +/** + * Exits pairing mode. + * + */ +- (void)exitRCToAircraftPairingModeWithCompletion:(DJICompletionBlock)completion; + +/** + * Gets the pairing status as the Remote Controller is pairing with the aircraft. + * + */ +- (void)getRCToAircraftPairingStateWithCompletion:(void (^)(DJIRCToAircraftPairingState state, NSError *_Nullable error))completion; + +//----------------------------------------------------------------- +#pragma mark RC gimbal control +//----------------------------------------------------------------- +/** + * Sets the gimbal's pitch speed for the Remote Controller's upper left wheel (Gimbal Dial). + * + * @param speed Speed to be set for the gimbal's pitch, which should in the range of [0, 100], + * where 0 represents very slow and 100 represents very fast. + * @param completion Completion block. + */ +- (void)setRCWheelGimbalSpeed:(uint8_t)speed withCompletion:(DJICompletionBlock)completion; + +/** + * Gets the gimbal's pitch speed for the Remote Controller's upper left wheel (Gimbal Dial). + * + */ +- (void)getRCWheelGimbalSpeedWithCompletion:(void (^)(uint8_t speed, NSError *_Nullable error))completion; + +/** + * Sets which of the gimbal directions the top left wheel (Gimbal Dial) on the Remote Controller will control. The + * three options (pitch, roll, and yaw) are outlined in the enum named DJIRCGimbalControlDirection + * in DJIRemoteControllerDef.h. + * + * @param direction Gimbal direction to be set that the top left wheel on the Remote Controller + * will control. + * @param completion Completion block. + */ +- (void)setRCControlGimbalDirection:(DJIRCGimbalControlDirection)direction withCompletion:(DJICompletionBlock)completion; + +/** + * Gets which of the gimbal directions the top left wheel (Gimbal Dial) on the Remote Controller will control. + * + */ +- (void)getRCControlGimbalDirectionWithCompletion:(void (^)(DJIRCGimbalControlDirection direction, NSError *_Nullable error))completion; + +//----------------------------------------------------------------- +#pragma mark RC custom buttons +//----------------------------------------------------------------- +/** + * Sets custom button's (Back Button's) tags, which can be used by the user to record user settings for a particular Remote Controller. Unlike all other buttons, switches and sticks on the Remote Controller, the custom buttons only send state to the Mobile Device and not the aircraft. + * + * @param tag1 Button 1's custom tag. + * @param tag2 Button 2's custom tag. + * @param completion Completion block. + */ +- (void)setRCCustomButton1Tag:(uint8_t)tag1 customButton2Tag:(uint8_t)tag2 withCompletion:(DJICompletionBlock)completion; + +/** + * Gets the custom button's (Back Button's) tags. + * + */ +- (void)getRCCustomButtonTagWithCompletion:(void (^)(uint8_t tag1, uint8_t tag2, NSError *_Nullable error))completion; + +//---------------------------------------------------------------- +#pragma mark RC master and slave mode +//----------------------------------------------------------------- + +/** + * Query method to check if the Remote Controller supports master/slave mode. + */ +- (BOOL)isMasterSlaveModeSupported; + +/** + * Sets the Remote Controller's mode. See DJIRemoteControllerMode enum for all possible Remote Controller modes. + * The master and slave modes are only supported for the Inspire 1, Inspire 1 Pro and M100. + * + * @param mode Mode of type DJIRemoteControllerMode to be set for the Remote Controller. + * @param completion Completion block. + */ +- (void)setRemoteControllerMode:(DJIRemoteControllerMode)mode withCompletion:(DJICompletionBlock)completion; + +/** + * Gets the Remote Controller's mode. + * + */ +- (void)getRemoteControllerModeWithCompletion:(void (^)(DJIRemoteControllerMode mode, BOOL isConnected, NSError *_Nullable error))completion; + +//----------------------------------------------------------------- +#pragma mark RC master and slave mode - Slave RC methods +//----------------------------------------------------------------- + +/** + * Used by a slave Remote Controller to join a master Remote Controller. If the master Remote Controller accepts the request, the master Remote Controller will control the aircraft and the slave Remote Controller will control the gimbal and/or be able to view the downlink video. + * + * @param hostId Master's unique identifier + * @param name Master's name + * @param password Master's password + * @param block Remote execution result callback block. + */ +- (void)joinMasterWithID:(DJIRCID)masterId masterName:(NSString *_Nonnull)masterName masterPassword:(NSString *_Nonnull)masterPassword withCompletion:(void (^)(DJIRCJoinMasterResult result, NSError *_Nullable error))completion; + +/** + * Returns the master Remote Controller's information, which includes the unique identifier, name, and password. + * + */ +- (void)getJoinedMasterNameAndPassword:(void (^)(DJIRCID masterId, NSString *_Nullable masterName, NSString *_Nullable masterPassword, NSError *_Nullable error))completion; + +/** + * Starts search by slave Remote Controller for nearby master Remote Controllers. To get the list of master Remote Controllers use getAvailableMastersWithCallbackBlock then call stopMasterRCSearchWithCompletion to end th search. + * + */ +- (void)startMasterRCSearchWithCompletion:(DJICompletionBlock)completion; + +/** + * Returns all available master Remote Controllers nearby. Before this method can be used, the method startMasterRCSearchWithCompletion needs to be called to start the search for master Remote Controllers. Once the list of masters is received, call stopMasterRCSearchWithCompletion to end the search. + * + */ +- (void)getAvailableMastersWithCompletion:(void (^)(NSArray *masters, NSError *_Nullable error))completion; + +/** + * Used by a slave Remote Controller to stop the search for nearby master Remote Controllers. + * + */ +- (void)stopMasterRCSearchWithCompletion:(DJICompletionBlock)completion; + +/** + * Returns the state of the master Remote Controller search. The search is initiated by the Mobile Device, but performed by the Remote Controller. Therefore, if the Mobile Device's application crashes while a search is ongoing, this method can be used to let the new instance of the application understand the Remote Controller state. + * + */ +- (void)getMasterRCSearchStateWithCompletion:(void (^)(BOOL isStarted, NSError *_Nullable error))completion; + +/** + * Removes a master Remote Controller from the current slave Remote Controller. + * + * @param masterId The connected master's identifier + * @param completion Completion block + */ +- (void)removeMaster:(DJIRCID)masterId withCompletion:(DJICompletionBlock)completion; + +/** + * Called by the slave Remote Controller to request gimbal control from the master Remote Controller. + * s + */ +- (void)requestGimbalControlRightWithCompletion:(void (^)(DJIRCRequestGimbalControlResult result, NSError *_Nullable error))completion; + +/** + * Sets the Remote Contoller's slave control mode. + * + * @param mode Control mode to be set. the mode's style should be RCSlaveControlStyleXXX + * @param completion Completion block + */ +- (void)setSlaveControlMode:(DJIRCControlMode)mode withCompletion:(DJICompletionBlock)completion; + +/** + * Gets the Remote Controller's slave control mode. + * + */ +- (void)getSlaveControlModeWithCompletion:(void (^)(DJIRCControlMode mode, NSError *_Nullable error))completion; + +/** + * Called by the slave Remote Controller to set the gimbal's pitch, roll, and yaw speed with range [0, 100]. + * + * @param speed Gimal's pitch, roll, and yaw speed with range [0, 100]. + * @param completion Completion block + */ +- (void)setSlaveJoystickControlGimbalSpeed:(DJIRCGimbalControlSpeed)speed withCompletion:(DJICompletionBlock)completion; + +/** + * Gets the current slave's gimbal's pitch, roll, and yaw speed with range [0, 100]. + * + */ +- (void)getSlaveJoystickControlGimbalSpeedWithCompletion:(void (^)(DJIRCGimbalControlSpeed speed, NSError *_Nullable error))completion; + + +//----------------------------------------------------------------- +#pragma mark RC master and slave mode - Master RC methods +//----------------------------------------------------------------- + +/** + * Used by the current master Remote Controller to get all the slaves connected to it. + * + * @param block Remote execution result callback block. The arrray of slaves contains objects + * of type DJIRCInfo. + */ +- (void)getSlaveListWithCompletion:(void (^)(NSArray *slaveList, NSError *_Nullable error))block; + +/** + * Removes a slave Remote Controller from the current master Remote Controller. + * + * @param slaveId Target slave to be remove. + * @param completion Completion block + */ +- (void)removeSlave:(DJIRCID)slaveId withCompletion:(DJICompletionBlock)completion; + +/** + * When a slave Remote Controller requests a master Remote Controller to control the gimbal, this + * method is used by a master Remote Controller to respond to the slave Remote Controller's request. + * + * @param requesterId The slave Remote Controller's identifier. + * @param isAgree YES if the master Remote Controller agrees to give the slave + * Remote Controller the right to control the gimbal. + */ +- (void)responseRequester:(DJIRCID)requesterId forGimbalControlRight:(BOOL)isAgree; + +@end +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIRemoteLogger.h b/DJISDK.framework/Headers/DJIRemoteLogger.h new file mode 100644 index 0000000..43056ac --- /dev/null +++ b/DJISDK.framework/Headers/DJIRemoteLogger.h @@ -0,0 +1,51 @@ +// +// DJIRemoteLogger.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +typedef NS_ENUM (NSUInteger, DJILogLevel) { + DJILogLevelOff = 0, + DJILogLevelError, + DJILogLevelWarn, + DJILogLevelDebug, + DJILogLevelInfo, + DJILogLevelVerbose + +}; + +/** + * This class provides class methods for you to get information of current log level. It also contains methods to configure the logger. + * + */ +@interface DJIRemoteLogger : NSObject + ++ (DJILogLevel)currentLogLevel; ++ (void)setCurrentLogLevel:(DJILogLevel)level; + +//Preferred method to configure the logger ++ (void)configureLoggerWithDeviceId:(NSString *)deviceID URLString:(NSString *)urlString showLogInConsole:(BOOL)showLogInConsole; ++ (void)resetLogger; + ++ (void)logWithLevel:(DJILogLevel)level + file:(const char *)file + function:(const char *)function + line:(NSUInteger)line + format:(NSString *)format, ...; + ++ (void)logWithLevel:(DJILogLevel)level + file:(const char *)file + function:(const char *)function + line:(NSUInteger)line + string:(NSString *)string; + + +@end + +#define DJILogError(frmt, ...) [DJIRemoteLogger logWithLevel : DJILogLevelError file : __FILE__ function : __PRETTY_FUNCTION__ line : __LINE__ format : (frmt), ## __VA_ARGS__] +#define DJILogWarn(frmt, ...) [DJIRemoteLogger logWithLevel : DJILogLevelWarn file : __FILE__ function : __PRETTY_FUNCTION__ line : __LINE__ format : (frmt), ## __VA_ARGS__] +#define DJILogInfo(frmt, ...) [DJIRemoteLogger logWithLevel : DJILogLevelInfo file : __FILE__ function : __PRETTY_FUNCTION__ line : __LINE__ format : (frmt), ## __VA_ARGS__] +#define DJILogDebug(frmt, ...) [DJIRemoteLogger logWithLevel : DJILogLevelDebug file : __FILE__ function : __PRETTY_FUNCTION__ line : __LINE__ format : (frmt), ## __VA_ARGS__] +#define DJILogVerbose(frmt, ...) [DJIRemoteLogger logWithLevel : DJILogLevelVerbose file : __FILE__ function : __PRETTY_FUNCTION__ line : __LINE__ format : (frmt), ## __VA_ARGS__] \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJISDK.h b/DJISDK.framework/Headers/DJISDK.h new file mode 100644 index 0000000..058af2e --- /dev/null +++ b/DJISDK.framework/Headers/DJISDK.h @@ -0,0 +1,117 @@ +// +// DJISDK.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import + +//! Project version number for DJISDK. +FOUNDATION_EXPORT double DJISDKVersionNumber; + +//! Project version string for DJISDK. +FOUNDATION_EXPORT const unsigned char DJISDKVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +/*********************************************************************************/ +#pragma mark - SDK Manager +/*********************************************************************************/ +#import + +/*********************************************************************************/ +#pragma mark - Products +/*********************************************************************************/ +#import +#import + +/*********************************************************************************/ +#pragma mark - Components +/*********************************************************************************/ +//----------------------------------------------------------------- +#pragma mark FlightController +//----------------------------------------------------------------- +#import +#import +#import +#import +#import + +//----------------------------------------------------------------- +#pragma mark RemoteController +//----------------------------------------------------------------- +#import + +//----------------------------------------------------------------- +#pragma mark Camera +//----------------------------------------------------------------- +#import +#import +#import +#import +#import +#import +#import +#import + +//----------------------------------------------------------------- +#pragma mark Gimbal +//----------------------------------------------------------------- +#import + +//----------------------------------------------------------------- +#pragma mark Battery +//----------------------------------------------------------------- +#import + +//----------------------------------------------------------------- +#pragma mark AirLink +//----------------------------------------------------------------- +#import +#import +#import + +//----------------------------------------------------------------- +#pragma mark Handheld Controller +//----------------------------------------------------------------- +#import + +/*********************************************************************************/ +#pragma mark - Abstract Classes +/*********************************************************************************/ +#import +#import + +/*********************************************************************************/ +#pragma mark - Missions +/*********************************************************************************/ +#import +#import +#import +#import +#import +#import +#import +#import + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +/*********************************************************************************/ +#pragma mark - Categories +/*********************************************************************************/ +#import + +/*********************************************************************************/ +#pragma mark - Remote Logger +/*********************************************************************************/ +#import \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJISDKManager.h b/DJISDK.framework/Headers/DJISDKManager.h new file mode 100644 index 0000000..694c4d6 --- /dev/null +++ b/DJISDK.framework/Headers/DJISDKManager.h @@ -0,0 +1,156 @@ +// +// DJISDKManager.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@class DJIAircraft; +@class DJIBaseProduct; + +/** + * This protocol provides delegate methods to receive the updated registration status and the change of the connected product. + * + */ +@protocol DJISDKManagerDelegate + +@required + +/** + * Callback delegate method after the application attempts to register. + * + * @param error nil if registration is successful. Otherwise it contains NSError object with error codes from DJISDKRegistrationError. + * + */ +- (void)sdkManagerDidRegisterAppWithError:(NSError *_Nullable)error; + +@optional +/** + * Called when the `product` property changed. + * + * @param oldProduct Old product object. Nil if starting up. + * @param newProduct New product object. Nil if the USB link or WiFi link between the product and phone is disconnected. + * + */ +- (void)sdkManagerProductDidChangeFrom:(DJIBaseProduct *_Nullable)oldProduct to:(DJIBaseProduct *_Nullable)newProduct; + +@end + +/** + * This protocol provides delegate methods to receive the updated connection status between the debug server, remote controller and debug client. + */ +@protocol DJISDKDebugServerDelegate + +@optional +/** + * Callback delegate method after the Debug server is started. + * + * @param isRCConnected is true if the RC is connected with the Debug server. + * @param isWifiConnected is true if the debug client is connected with the Debug server based on WiFi. + * + */ +- (void)sdkDebugServerWithRCConnectionStatus:(BOOL)isRCConnected andDebugClientConnectionStatus:(BOOL)isWifiConnected; + +@end + +/** + * This class contains methods to register the app, start or stop connection with the product, and use the DJI Bridge app and Remote Logger tools, etc. After the registration, user can access the connected product through DJISDKManager. Then user can start to control the components of the product. + */ +@interface DJISDKManager : NSObject + +/** + * Product connected to the mobile device. The product is accessible only after successful registration of the app. + * + * @return available DJIBaseProduct object. nil if no product is available. + */ ++ (__kindof DJIBaseProduct *_Nullable)product; + +/** + * The first time the app is initialized after installation, the app connects to a DJI Server through the internet to verify the Application Key. Subsequent app starts will use locally cached verification information to register the app. + * + * @param appKey Application key that was provided by DJI after the application was registered. + * @param delegate Registration result callback delegate + */ ++ (void)registerApp:(NSString *)appKey withDelegate:(id)delegate; + +/** + * Queue in which completion blocks are called. If left unset, completion blocks are called in main queue. + * + * @param completionBlockQueue dispatch queue. + */ ++ (void)setCompletionBlockQueue:(dispatch_queue_t)completionBlockQueue; + +/** + * Start a connection to the DJI product. This method should be called after successful registration of the app. `sdkManagerProductDidChangeFrom:to:` delegate method will be called if the connection succeeded. + * + * @return YES if the connection is started successfully. + */ ++ (BOOL)startConnectionToProduct; + +/** + * Disconnect the existing connection to the DJI product + */ ++ (void)stopConnectionToProduct; + +/** + * Set SDK to close the connection automatically when app enters the background and resume connection automatically when the app enters the foreground. Default is YES. + * + * @param isClose Close connection or not when app enter background. + */ ++ (void)closeConnectionWhenEnterBackground:(BOOL)isClose; + +/** + * Gets the DJI Mobile SDK Version + * + * @return SDK version as a string. + */ ++ (NSString *)getSDKVersion; + +/** + * Enter debug mode with debug id. + * + * @param debugId Debug id from the DJI Bridge App + */ ++ (void)enterDebugModeWithDebugId:(NSString *)debugId; + +/** + * Enter enable remote logging with log server URL. + * + * @param deviceID Optional device id to uniquely identify logs from an installation. + * @param url URL of the remote log server + */ ++ (void)enableRemoteLoggingWithDeviceID:(NSString *_Nullable)deviceID logServerURLString:(NSString *)url; + +@end + +/*********************************************************************************/ +#pragma mark - DJISDKManager (DebugServer) +/*********************************************************************************/ + +/** + * This class provides methods for you to start and stop SDK debug server. You can use them with DJI Bridge App for remote debugging. + */ +@interface DJISDKManager (DebugServer) +/** + * Start debug sever. + * + * @param completion block returns the IP address of the sever. + */ ++ (void)startSDKDebugServerWithCompletion:(void (^)(NSString *ipaddress))block; + +/** + * Register the delegate object to get the connection status of the debug server with the Remote controller and the debug client. + */ ++ (void)setDebugServerDelegate:(id)delegate; + +/** + * Stop the debug server and release the service objects used by the server. + */ ++ (void)stopSDKDebugServer; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIShootPhotoStep.h b/DJISDK.framework/Headers/DJIShootPhotoStep.h new file mode 100644 index 0000000..bcb734f --- /dev/null +++ b/DJISDK.framework/Headers/DJIShootPhotoStep.h @@ -0,0 +1,36 @@ +// +// DJIShootPhotoStep.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class represents a step related to photo-shooting for a custom mission. By creating an object of this class and adding it into a custom mission, user can shoot photo during the custom mission execution. + */ +@interface DJIShootPhotoStep : DJIMissionStep + +/** + * Initialized step for taking a single photo. + * + * @return Instance of DJIShootPhotoStep. + */ +- (instancetype _Nullable)initWithSingleShootPhoto; + +/** + * Initialized step for continous shoot photo. + * + * @param count Photo count. + * @param interval Time interval in seconds between shooting photos. + * + * @return Instance of DJIShootPhotoStep. + */ +- (instancetype _Nullable)initWithPhotoCount:(int)count timeInterval:(double)interval; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJITakeoffStep.h b/DJISDK.framework/Headers/DJITakeoffStep.h new file mode 100644 index 0000000..72bc75d --- /dev/null +++ b/DJISDK.framework/Headers/DJITakeoffStep.h @@ -0,0 +1,21 @@ +// +// DJITakeoffStep.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This class represents a take-off step for a custom mission. By creating an object of this class and adding it into + * a custom mission, a take-off action will be performed during the custom mission execution. + */ + +@interface DJITakeoffStep : DJIMissionStep + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJIWaypoint.h b/DJISDK.framework/Headers/DJIWaypoint.h new file mode 100644 index 0000000..94b36af --- /dev/null +++ b/DJISDK.framework/Headers/DJIWaypoint.h @@ -0,0 +1,230 @@ +// +// DJIWaypoint.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import +#import "DJIBaseProduct.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * Maximum number of actions a single waypoint can have. Currently, the maximum number supported is 15. + */ +DJI_API_EXTERN const int DJIMaxActionCount; + +/** + * Maximum number of times a single waypoint action can be repeated. Currently, the maximum number + * supported is 15. + */ +DJI_API_EXTERN const int DJIMaxActionRepeatTimes; + +/** + * How the aircraft will turn at a waypoint to transition between headings. + */ +typedef NS_ENUM (NSUInteger, DJIWaypointTurnMode){ + /** + * Changes the heading of the aircraft by rotating the aircraft clockwise. + */ + DJIWaypointTurnClockwise, + /** + * Changes the heading of the aircraft by rotating the aircraft anti-clockwise. + */ + DJIWaypointTurnCounterClockwise, +}; + +/** + * Waypoint action types. + * + */ +typedef NS_ENUM (NSUInteger, DJIWaypointActionType){ + /** + * Keeps the aircraft at the waypoint's location. The actionParam parameter + * will determine how much time in milliseconds the aircraft will stay at the + * location. This actionParam parameter can be set in the range of [0, 32767] milliseconds. + */ + DJIWaypointActionTypeStay, + /** + * Starts to shoot photo. The actionParam for the waypoint action will be ignored. + * The maximum time set to excute this waypoint action is 6 seconds. If the time, + * while executing the waypoint action, goes above 6 seconds, the aircraft will + * stop executing the waypoint action and will move on to the next waypoint action, + * if there is one. + * + */ + DJIWaypointActionTypeShootPhoto, + /** + * Starts recording. The actionParam for the waypoint action will be ignored. + * The maximum time set to excute this waypoint action is 6 seconds. If the time, + * while executing the waypoint action, goes above 6 seconds (e.g. in the case of the camera not being present) + * the aircraft will stop executing the waypoint action and will move on to the next waypoint action, + * if there is one. + */ + DJIWaypointActionTypeStartRecord, + /** + * Stops recording. The actionParam for the waypoint action will be ignored. + * The maximum time set to excute this waypoint action is 6 seconds. If the time, + * while executing the waypoint action, goes above 6 seconds (e.g. in the case of the camera not being present) + * the aircraft will stop executing the waypoint action and will move on to the next waypoint action, + * if there is one. + */ + DJIWaypointActionTypeStopRecord, + /** + * Rotates the aircraft's yaw. The rotationg direction will determined by the waypoint's + * turnMode property. The actionParam value must be in the range of [-180, 180] degrees. + */ + DJIWaypointActionTypeRotateAircraft, + /** + * Rotates the gimbal's pitch. The actionParam value should be in range [-90, 0] degrees. + */ + DJIWaypointActionTypeRotateGimbalPitch, +}; + +/** + * + * This class represents a waypoint action for DJIWaypoint. It determines what action is performed when the aircraft reaches the corresponding waypoint. + * + */ +@interface DJIWaypointAction : NSObject + +/** + * Waypoint action of type DJIWaypointActionType the aircraft will execute once the aircraft + * reaches the waypoint. Please find all the possible actions in the enum named + * DJIWaypointActionType above. + */ +@property(nonatomic, assign) DJIWaypointActionType actionType; + +/** + * Action parameter of a waypoint action. See enum DJIWaypointAction for details on which actions will use actionParam. + */ +@property(nonatomic, assign) int16_t actionParam; + +/** + * Initialize the class with a specific action type and corresponding parameter. + */ +- (id)initWithActionType:(DJIWaypointActionType)type param:(int16_t)param; + +@end + +/** + * The class represents a target point in the waypoint mission. For a waypoint mission, a flight route consists of multiple DJIWaypoint objects. User can also define the actions to perform for each DJIWaypoint. + * + */ +@interface DJIWaypoint : NSObject + +/** + * Waypoint coordinate latitude and longitude in degrees. + */ +@property(nonatomic, assign) CLLocationCoordinate2D coordinate; + +/** + * Altitude of the aircraft in meters when it reaches waypoint. The altitude of the + * aircraft is relative to the ground at the take-off location, has a range of [-200,500] and should not be larger than the aircraft's max limited altitude. If two adjacent waypoints have different alitutdes, then the alitude will gradually change as the aircraft flys between waypoints. + */ +@property(nonatomic, assign) float altitude; + +/** + * Heading the aircraft will rotate to by the time it reaches the waypoint. The aircraft heading will gradually change between two waypoints with different + * headings if the waypoint mission's headingMode is set to DJIWaypointMissionHeadingUsingWaypointHeading. Heading has a range of [-180, 180] degrees, where 0 represents True North. + */ +@property(nonatomic, assign) float heading; + +/** + * Dictates how many times the set of waypoint actions are repeated. The default value is one time and maximum is DJIMaxActionRepeatTimes. + */ +@property(nonatomic, assign) NSUInteger actionRepeatTimes; + +/** + * The maximum time set to excute all the waypoint actions for a waypoint. If the time, + * while executing the waypoint actions, goes above the time set, the aircraft will + * stop executing the waypoint actions for the current waypoint and will move on to + * the next waypoint. The value of this property must be in the range of [0, 999] seconds. + * The default value is 60 seconds. + */ +@property(nonatomic) int actionTimeoutInSeconds; + +/** + * Corner radius of the waypoint. When the flight path mode is DJIWaypointMissionFlightPathCurved + * the flight path near a waypoint will be a curve (rounded corner) with radius [0.2,1000]. When there is a corner radius, the aircraft will never go through the waypoint. By default, the radius is 0.2 m. + * The radius should not be larger than the three dimensional distance between any two of + * the three waypoints which make the corner. + */ +@property(nonatomic, assign) float cornerRadiusInMeters; + +/** + * Determines whether the aircraft will turn clockwise or anitclockwise when changing it's heading. + */ +@property(nonatomic) DJIWaypointTurnMode turnMode; + +/** + * Gimbal pitch angle when reached this waypoint. Property is used when DJIWaypointMission property 'rotateGimbalPitch' is YES. + * Value should in range [-90, 0] degree. + */ +@property(nonatomic, assign) float gimbalPitch; + +/** + * Array of all waypoint actions for the respective waypoint. The waypoint actions will + * be executed consecutively from the start of the array once the aircraft + * reaches the waypoint. + */ +@property(nonatomic, readonly) NSArray *waypointActions; + + +/** + * Initiate instance with specific waypoint. + */ +- (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate; + +/** + * Adds a waypoint action to a waypoint. The number of waypoint actions should not be + * larger than DJIMaxActionCount. The action will only be executed when the mission's + * flightPathMode property is set to DJIWaypointMissionFlightPathNormal and will be + * not be executed when the mission's flightPathMode property is set to + * DJIWaypointMissionFlightPathCurved. The maximum number of DJIWaypointAction you can add is 15. + * + * @param action Waypoint action to be added to the waypoint. + * + * @return Yes if the waypoint action has been added to the waypoint. NO if the waypoint action + * count is too high, or if the waypoint action was incorrectly setup. + */ +- (BOOL)addAction:(DJIWaypointAction *)action; + +/** + * Insert a waypoint action at index. + * + * @param action Waypoint action to be inserted to the waypoint. + * @param index Index of the inserted action + * + * @return Yes, if the waypoint action has been inserted. No if the waypoint action count is too high or index is invalid. + */ +- (BOOL)insertAction:(DJIWaypointAction *)action atIndex:(int)index; + +/** + * Removes the last waypoint action from the waypoint. + * + * @param action Waypoint action to be removed from the waypoint. + * @return YES if the waypoint action has been removed from the waypoint. + */ +- (BOOL)removeAction:(DJIWaypointAction *)action; + +/** + * Removes a waypoint action from the waypoint by index. After removal, all actions higher in index will + * be shifted down by one index. + * + * @param index Waypoint action to be removed at index. + * + * @return YES if waypoint action has been removed from the waypoint. + */ +- (BOOL)removeActionAtIndex:(int)index; + +/** + * Remove all the actions. + */ +- (void)removeAllActions; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJIWaypointMission.h b/DJISDK.framework/Headers/DJIWaypointMission.h new file mode 100644 index 0000000..f1d809f --- /dev/null +++ b/DJISDK.framework/Headers/DJIWaypointMission.h @@ -0,0 +1,327 @@ +// +// DJIWaypointMission.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import +#import "DJIMission.h" + +NS_ASSUME_NONNULL_BEGIN + +@class DJIWaypoint; + +/** + * Maximum number of waypoints allowed in a waypoint mission. This + * number has been set to 100. + */ +DJI_API_EXTERN const int DJIWaypointMissionMaximumWaypointCount; + +/** + * Minimum number of waypoints allowed in a waypoint mission. This + * number has been set to 2. + */ +DJI_API_EXTERN const int DJIWaypointMissionMinimumWaypointCount; + +/** + * Current waypoint mission state. + */ +typedef NS_ENUM (uint8_t, DJIWaypointMissionExecuteState){ + /** + * Waypoint mission is initializing, which means the mission has + * started and the aircraft is going to the first waypoint. + */ + DJIWaypointMissionExecuteStateInitializing, + /** + * Aircraft is currently moving toward the mission's next waypoint. happens when the 'flightPathMode' is set as DJIWaypointMissionFlightPathNormal. + */ + DJIWaypointMissionExecuteStateMoving, + /** + * Aircraft is currently moving. happens when the 'flightPathMode' is set as DJIWaypointMissionFlightPathCurved. + */ + DJIWaypointMissionExecuteStateCurveModeMoving, + /** + * Aircraft is currently turning. happens when the 'flightPathMode' is set as DJIWaypointMissionFlightPathCurved. + */ + DJIWaypointMissionExecuteStateCurveModeTurning, + /** + * Aircraft has reached a waypoint, has rotated to the new heading and is now processing actions. + * This state will be called before the waypoint actions starts executing and will occur for each waypoint action. + */ + DJIWaypointMissionExecuteStateBeginAction, + /** + * Aircraft is at a waypoint and is executing an action. + */ + DJIWaypointMissionExecuteStateDoingAction, + /** + * Aircraft is at a waypoint and has finished executing the current waypoint + * action. This state occurs once for each waypoint action. + */ + DJIWaypointMissionExecuteStateFinishedAction, + /** + * Aircraft is return to first waypoint. happens when the 'finishedAction' is set as DJIWaypointMissionFinishedGoFirstWaypoint + */ + DJIWaypointMissionExecuteStateReturnToFirstWaypoint +}; + +/** + * Actions for when the waypoint mission has finished. + */ +typedef NS_ENUM (uint8_t, DJIWaypointMissionFinishedAction){ + /** + * No further action will be taken on completion of mission. At this point, the aircraft can be controlled by the remote controller. + */ + DJIWaypointMissionFinishedNoAction, + /** + * The aicraft will go home when the mission is complete. + * If the aircraft is more than 20m away from the home point it will go home and land. + * Otherwise, it will land directly at the current location. + */ + DJIWaypointMissionFinishedGoHome, + /** + * The aircraft will land automatically at the last waypoint. + */ + DJIWaypointMissionFinishedAutoLand, + /** + * The aircraft will go back to its first waypoint and hover in position. + */ + DJIWaypointMissionFinishedGoFirstWaypoint, + /** + * When the aircraft reaches its final waypoint, it will hover without ending the mission. The joystick can still be used to pull the aircraft back along its previous waypoints. The only way this mission can end is if stopMission is called. + */ + DJIWaypointMissionFinishedContinueUntilStop +}; + +/** + * Current waypoint mission heading mode. + */ +typedef NS_ENUM (NSUInteger, DJIWaypointMissionHeadingMode){ + /** + * Aircraft's heading will always be in the direction of flight. + */ + DJIWaypointMissionHeadingAuto, + /** + * Aircraft's heading will be set to the initial take-off heading. + */ + DJIWaypointMissionHeadingUsingInitialDirection, + /** + * Aircraft's heading will be controlled by the remote controller. + */ + DJIWaypointMissionHeadingControledByRemoteController, + /** + * Aircraft's heading will gradually change between waypoints. + */ + DJIWaypointMissionHeadingUsingWaypointHeading, + /** + * Aircraft's heading will always toward point of interest. + */ + DJIWaypointMissionHeadingTowardPointOfInterest, +}; + +typedef NS_ENUM (NSUInteger, DJIWaypointMissionFlightPathMode){ + /** + * The flight path will be normal and the aircraft will + * move from one waypoint to the next in straight lines. + */ + DJIWaypointMissionFlightPathNormal, + /** + * The flight path will be curved and the aircraft will + * move from one waypoint to the next in a curved motion, + * adhering to the cornerRadiusInMeters, which is set in DJIWaypoint.h. + * + */ + DJIWaypointMissionFlightPathCurved +}; + +typedef NS_ENUM (NSInteger, DJIWaypointMissionGotoWaypointMode) { + /** + * Go to waypoint safely. Aircraft will rise to the same altitude of waypoint if current altitude is lower then the waypoint + * altitude. then go to waypoint coordinate from altitude, then go to altitude of waypoint. + */ + DJIWaypointMissionGotoWaypointSafely, + /** + * Go to waypoint frome current aircraft point to the waypoint directly. + */ + DJIWaypointMissionGotoWaypointPointToPoint, +}; + +/** + * This class provides the real-time status of an executing waypoint mission. + */ +@interface DJIWaypointMissionStatus : DJIMissionProgressStatus + +/** + * Index of the waypoint in the waypoint array for the mission that the aircraft will move to next. + */ +@property(nonatomic, readonly) NSInteger targetWaypointIndex; + +/** + * YES when aircraft reaches a waypoint. After waypoint actions and heading change is complete, the targetWaypointIndex will increment and this property will become NO. + */ +@property(nonatomic, readonly) BOOL isWaypointReached; + +/** + * Current execution state of the aircraft. + */ +@property(nonatomic, readonly) DJIWaypointMissionExecuteState execState; + +@end + +/*********************************************************************************/ +#pragma mark - Mission +/*********************************************************************************/ + +/** + * In the waypoint mission, the aircraft will travel between waypoints, execute actions at + * waypoints, and adjust heading and altitude between waypoints. + * + * The aircraft travels between waypoints automatically at a base speed. However, the user can change the speed by + * using the pitch joystick. If the stick is pushed up, the speed will increase. If the stick is pushed down, the speed + * will slow down. The stick can be pushed down to stop the aircraft and further pushed to start making the aircraft + * travel back along the path it came. When the aircraft is travelling through waypoints in the reverse order, it will + * not execute waypoint actions at each waypoint. If the stick is released, the aircraft will again travel through the + * waypoints in the original order, and continue to execute waypoint actions (even if executed previously). + * + * If the aircraft is pulled back along the waypoint mission all the way to the first waypoint, then it will hover in place + * until the stick is released enough for it to again progress through the mission from start to finish. + */ + +@interface DJIWaypointMission : DJIMission +/*********************************************************************************/ +#pragma mark - Mission Presets +/*********************************************************************************/ + +/** + * Number of waypoints in the waypoint mission. + */ +@property(nonatomic, readonly) int waypointCount; + +/** + * While the aircraft is travelling between waypoints, you can offset its speed by using the throttle joystick on the + * remote controller. maxFlightSpeed is this offset when the joystick is pushed to maximum deflection. For example, + * If maxFlightSpeed is 10 m/s, then pushing the throttle joystick all the way up will add 10 m/s to the aircraft speed, + * while pushing down will subtrace 10 m/s from the aircraft speed. If the remote controller stick is not at maximum + * deflection, then the offset speed will be interpolated between [0, maxFlightSpeed] with a resolution of 1000 steps. + * If the offset speed is negative, then the aircraft will fly backwards to previous waypoints. When it reaches the first + * waypoint, it will then hover in place until a positive speed is applied. + * maxFlightSpeed has a range of [2,15] m/s. + */ +@property(nonatomic, assign) float maxFlightSpeed; + +/** + * The base automatic speed of the aircraft as it moves between waypoints with range [-15, 15] m/s. + * + * The aircraft's actual speed is a combination of the base automatic speed, and the speed control + * given by the throttle joystick on the remote controller. + * + * If autoFlightSpeed >0: Actual speed is autoFlightSpeed + Joystick Speed (with combined max of maxFlightSpeed) + * If autoFlightSpeed =0: Actual speed is controlled only by the remote controller joystick. + * If autoFlightSpeed <0 and the aircraft is at the first waypoint, then the aircraft will hover in place until the speed is made positive by the remote controller joystick. + */ +@property(nonatomic, assign) float autoFlightSpeed; + +/** + * Action the aircraft will take when the waypoint mission is complete. + */ +@property(nonatomic, assign) DJIWaypointMissionFinishedAction finishedAction; + +/** + * Heading of the aircraft as it moves between waypoints. Default is DJIWaypointMissionHeadingAuto. + */ +@property(nonatomic, assign) DJIWaypointMissionHeadingMode headingMode; + +/** + * Flight path mode of the waypoint mission. + */ +@property(nonatomic, assign) DJIWaypointMissionFlightPathMode flightPathMode; + +/** + * Determines the aricraft how to go to first waypoint frome current position. Default is DJIWaypointMissionGotoWaypointSafely. + */ +@property(nonatomic, assign) DJIWaypointMissionGotoWaypointMode gotoFirstWaypointMode; + +/** + * Determines whether exit mission when RC signal lost. Default is NO. + */ +@property(nonatomic, assign) BOOL exitMissionOnRCSignalLost; + +/** + * Property is used when 'headingMode' is 'DJIWaypointMissionHeadingTowardPointOfInterest'. Aircraft will always heading to + * point while executing mission. Default is kCLLocationCoordinate2DInvalid. + */ +@property(nonatomic, assign) CLLocationCoordinate2D pointOfInterest; + +/** + * Whether the aircraft can rotate gimbal pitch when execute waypoint mission. If 'YES' then aircraft will control gimal pitch rotation between waypoints using 'gimbalPitch' of DJIWaypoint. + */ +@property(nonatomic, assign) BOOL rotateGimbalPitch; + +/** + * Repeat times for mission execution. Default is 1. + */ +@property(nonatomic, assign) int repeatTimes; + +/** + * Add a waypoint to the waypoint mission. The maximum number of waypoints should not larger than DJIWaypointMissionMaximumWaypointCount. A waypoint will only be valid if the distance (in three dimensions) between two adjacent waypoints is in range [0.5,2000] meters. + * + * @param Waypoint to be added to the waypoint mission. + */ +- (void)addWaypoint:(DJIWaypoint *_Nonnull)waypoint; + +/** + * Adds an array of waypoints to the waypoint mission. + * + * @param Array of waypoints to be added to the waypoint mission. + */ +- (void)addWaypoints:(NSArray *_Nonnull)waypoints; + +/** + * Removes a specific waypoint previously added. + * + * @param waypoint Waypoint object to be removed. + * + */ +- (void)removeWaypoint:(DJIWaypoint *_Nonnull)waypoint; + +/** + * Removes the waypoint at an index. + * + * @param index Index of waypoint to be removed from the waypoint mission from + * the array of all waypoints. + */ +- (void)removeWaypointAtIndex:(int)index; + +/** + * Removes all waypoints from the waypoint mission. + */ +- (void)removeAllWaypoints; + +/** + * Gets a waypoint at an index in the mission waypoint array. + * + * @param index Index of the waypoint wanting to be retrieved from the array of waypoints in the + * waypoint mission. + * + * @return Waypoint of type DJIWaypoint if the index exists. + */ +- (DJIWaypoint *_Nullable)getWaypointAtIndex:(int)index; + +/*********************************************************************************/ +#pragma mark - Mission Updates +/*********************************************************************************/ + +/** + * Set the flight speed while the mission is executing automatically (without manual joystick speed input). This is the only property or method in this class that can communicate with the aircraft during a mission. All other properties and methods are used offline to prepare the mission which is then uploaded to the aircraft. + * + * @param speed Auto flight speed to be set. The absolute value of the auto flight speed should be less than or equal to the maxFlightSpeed. It's range is then [-maxFlightSpeed, maxFlightSpeed] m/s. + * + * @param completion Completion block. + * + */ ++ (void)setAutoFlightSpeed:(float)speed withCompletion:(DJICompletionBlock)completion; + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/DJIWaypointStep.h b/DJISDK.framework/Headers/DJIWaypointStep.h new file mode 100644 index 0000000..ba598c6 --- /dev/null +++ b/DJISDK.framework/Headers/DJIWaypointStep.h @@ -0,0 +1,32 @@ +// +// DJIWaypointStep.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class DJIWaypointMission; + +/** + * This class represents a way-point step for a custom mission. By creating an object of this class and adding it into + * a custom mission, a way-point action will be performed during the custom mission. + * @see DJIWaypointMission + */ +@interface DJIWaypointStep : DJIMissionStep + +/** + * Initialized instance with a waypoint mission. + * + * @param mission Waypoint mission. + * + * @return Instance of DJIWaypointStep. + */ +- (instancetype _Nullable)initWithWaypointMission:(DJIWaypointMission *_Nonnull)mission; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Headers/DJIWiFiLink.h b/DJISDK.framework/Headers/DJIWiFiLink.h new file mode 100644 index 0000000..a241f20 --- /dev/null +++ b/DJISDK.framework/Headers/DJIWiFiLink.h @@ -0,0 +1,160 @@ +// +// DJIWiFiLink.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * WiFi frequency band + */ +typedef NS_ENUM (uint8_t, DJIWiFiFrequencyBand){ + /** + * The WiFi Frequency band is 2.4G + */ + DJIWiFiFrequencyBand2Dot4G, + /** + * The WiFi Frequency band is 5.8G + */ + DJIWiFiFrequencyBand5Dot8G, + /** + * The WiFi Frequency is unknown + */ + DJIWiFiFrequencyBandUnknown = 0xFF, + +}; + +/** + * WiFi Signal Quality - for OSMO only. WiFi Signal quality as measured by OSMO. + */ +typedef NS_ENUM (uint8_t, DJIWiFiSignalQuality) { + /** + * WiFi Signal Quality is good + */ + DJIWiFiSignalQualityGood = 0, + /** + * WiFi Signal Quality is medium. At this level, the video quality will be degraded compared to when the signal quality is good. + */ + DJIWiFiSignalQualityMedium = 1, + /** + * WiFi Signal Quality is bad. At this level, the video quality will be degraded compared to when the signal quality is medium. + */ + DJIWiFiSignalQualityBad = 2, + /** + * WiFi Signal Quality is Unknown + */ + DJIWiFiSignalQualityUnknown = 0xFF, +}; + +@class DJIWiFiLink; + +/** + * + * This protocol provides a delegate method to receive the updated WiFi signal quality. + * + */ +@protocol DJIWiFiLinkDelegate + +@optional + +/** + * Updates WiFi Signal Quality. + * + * @param link DJIWiFiLink object + * @param quality WiFi signal quality + * + */ +- (void)wifiLink:(DJIWiFiLink *_Nonnull)link didUpdatesWiFiSignalQuality:(DJIWiFiSignalQuality)quality; +@end + +//----------------------------------------------------------------- +#pragma mark WiFi Component +//----------------------------------------------------------------- + +/** + * This class provides methods to change the setting of the product's WiFi. You can also reboot the WiFi adapter inside product in order to make the new setting take effect. + */ +@interface DJIWiFiLink : NSObject + +/** + * Returns the DJIWiFiLink delegate. + */ +@property (nonatomic, weak) id delegate; + +/** + * Reboot WiFi. + * + * @param block Remote execution result error block. + */ +- (void)rebootWiFiWithCompletion:(DJICompletionBlock)block; + +//----------------------------------------------------------------- +#pragma mark SSID and Password +//----------------------------------------------------------------- +/** + * Gets WiFi SSID. + * + * @param block Remote execution result error block. + */ +- (void)getWiFiSSIDWithCompletion:(void (^)(NSString *ssid, NSError *_Nullable error))block; + +/** + * Sets WiFi SSID. + * + * @param ssid the WiFi ssid want to change. It should just include alphabet, number, space, '-' and should not be more than 30 characters. + * @param block Remote execution result error block. + * + */ +- (void)setWiFiSSID:(NSString *)ssid withCompletion:(DJICompletionBlock)block; + +/** + * Gets WiFi Password. + * + * @param block Remote execution result error block. + */ +- (void)getWiFiPasswordWithCompletion:(void (^)(NSString *password, NSError *_Nullable error))block; + +/** + * Sets WiFi Password. + * + * @param password The new WiFi password. It should be at least 8 characters and only includes alphabet characters and numbers. + * @param block Remote execution result error block. + */ +- (void)setWiFiPassword:(NSString *)password withCompletion:(DJICompletionBlock)block; + + +//----------------------------------------------------------------- +#pragma mark Frequency Band Selection +//----------------------------------------------------------------- +/** + * YES if product allows user to change WiFi frequency bands. + * Currently, only OSMO supports this feature. + */ +- (BOOL)isWiFiFrequencyBandEditable; + +/** + * Sets WiFi frequency band. + * It can be called only if isWiFiFrequencyBandEditable returns YES. + * + * @param frequencyBand WiFi frequency band to change to. + * @param block Remote execution result error block. + */ +- (void)setWiFiFrequencyBand:(DJIWiFiFrequencyBand)frequencyBand withCompletion:(DJICompletionBlock)block; + +/** + * Gets current WiFi frequency band. + * It can be called only if isWiFiFrequencyBandEditable returns YES. + * + * @param block Remote execution result error block. + */ +- (void)getWiFiFrequencyBandWithCompletion:(void (^)(DJIWiFiFrequencyBand frequencyBand, NSError *_Nullable error))block; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/DJISDK.framework/Headers/NSError+DJISDK.h b/DJISDK.framework/Headers/NSError+DJISDK.h new file mode 100644 index 0000000..cca4222 --- /dev/null +++ b/DJISDK.framework/Headers/NSError+DJISDK.h @@ -0,0 +1,540 @@ +// +// NSError+DJISDK.h +// DJISDK +// +// Copyright © 2015, DJI. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/*********************************************************************************/ +#pragma mark - Error Domains +/*********************************************************************************/ +/** + * SDK common error domain + */ +FOUNDATION_EXPORT NSString * _Nonnull const DJISDKErrorDomain; +/** + * SDK camera error domain + */ +FOUNDATION_EXPORT NSString *_Nonnull const DJISDKCameraErrorDomain; +/** + * SDK mission error domain + */ +FOUNDATION_EXPORT NSString *_Nonnull const DJISDKMissionErrorDomain; +/** + * SDK battery error domain + */ +FOUNDATION_EXPORT NSString *_Nonnull const DJISDKBatteryErrorDomain; +/** + * SDK gimbal error domain + */ +FOUNDATION_EXPORT NSString *_Nonnull const DJISDKGimbalErrorDomain; +/** + * SDK flight controller domain + */ +FOUNDATION_EXPORT NSString *_Nonnull const DJISDKFlightControllerErrorDomain; +/** + * SDK remote controller domain + */ +FOUNDATION_EXPORT NSString *_Nonnull const DJISDKRemoteControllerErrorDomain; +/** + * SDK registration error domain + */ +FOUNDATION_EXPORT NSString *_Nonnull const DJISDKRegistrationErrorDomain; + +//----------------------------------------------------------------- +#pragma mark DJISDKRegistrationError +//----------------------------------------------------------------- +typedef NS_ENUM (NSInteger, DJISDKRegistrationError){ + /** + * The application is not able to connect to the internet the first time it registers. + */ + DJISDKRegistrationErrorCouldNotConnectToInternet = -1L, + + /** + * The application key you provided is incorrect. + */ + DJISDKRegistrationErrorInvalidAppKey = -2L, + + /** + * The network you are trying to reach is busy, or the server is unreachable. + */ + DJISDKRegistrationErrorHTTPTimeout = -3L, + + /** + * The attempt to copy meta data from another registered device to the device that is + * currently connected is not allowed. For example, if a developer has two devices and + * the application is activated with the application key onto one of the devices, if the + * other device is plugged in and tries to register the application, this error will occur. + */ + DJISDKRegistrationErrorDeviceDoesNotMatch = -4L, + + /** + * The bundle identifier of your application does not match the bundle identifier you + * registered on the website when you applied to obtain an application key. + */ + DJISDKRegistrationErrorBundleIdDoesNotMatch = -5L, + + /** + * The application key is prohibited. This occurs when an application key that has already + * been released by DJI is revoked. Please contact DJI for assistance. + */ + DJISDKRegistrationErrorAppKeyProhibited = -6L, + + /** + * There is a maximum number of devices one application key can be used to activate. The + * maximum number of devices is given when an application is registered on the DJI developer + * website. This error will occur if the maximum number of activations has been reached. + */ + DJISDKRegistrationErrorMaxActivationCountReached = -7L, + + /** + * This error occurrs when an application key was given for a specific platform and is trying + * to be used to activate an application for another platform. For instance, if an application + * key was given for an iOS applicationa and is used to activate an Android application, this + * error will occur. + */ + DJISDKRegistrationErrorAppKeyInvalidPlatformError = -8L, + + /** + * The application key does not exist. Please make sure the application key you are entering + * is correct. + */ + DJISDKRegistrationErrorAppKeyDoesNotExist = -9L, + + /** + * There are two levels for the SDK framework, level 1 and level 2. If an application key was + * given under one level and is trying to be used to active an application using another level + * SDK framework, this error will occur. + */ + DJISDKRegistrationErrorAppKeyLevelNotPermitted = -10L, + + /** + * There is a server error. Please contact DJI for assistance. + */ + DJISDKRegistrationErrorServerParseFailure = -11L, + + /** + * There is a server error. Please contact DJI for assistance. + */ + DJISDKRegistrationErrorServerWriteError = -12L, + + /** + * There is a server error. Please contact DJI for assistance. + */ + DJISDKRegistrationErrorServerDataAbnormal = -13L, + + /** + * The activation data received from server + * valid. Please reconnect to the internet and try again. + */ + DJISDKRegistrationErrorInvalidMetaData = -14L, + + /** + * No application key was inputted. + */ + DJISDKRegistrationErrorEmptyAppKey = -15L, + + /** + * An unknown error occurred when the application was trying to register. Please contact DJI + * for assistance. + */ + DJISDKRegistrationErrorUnknown = -999L +}; + +//----------------------------------------------------------------- +#pragma mark DJISDKError +//----------------------------------------------------------------- +typedef NS_ENUM (NSInteger, DJISDKError){ + /** + * Feature not supported error. + */ + DJISDKErrorSDKFeatureNotSupported = -1000L, + /** + * Application not activated error. + */ + DJISDKErrorApplicationNotActivated = -1001L, + /** + * SDKLevel not permitted error + */ + DJISDKErrorSDKLevelNotPermitted = -1002L, + /** + * Timeout error. + */ + DJISDKErrorTimeout = -1003L, + /** + * System busy error + */ + DJISDKErrorSystemBusy = -1004L, + /** + * Parameters invalid error + */ + DJISDKErrorInvalidParameters = -1005L, + /** + * Get parameter failed error. + */ + DJISDKErrorParameterGetFailed = -1006L, + /** + * Set parameter failed error. + */ + DJISDKErrorParameterSetFailed = -1007L, + /** + * Command execute failed error. + */ + DJISDKErrorCommandExecutionFailed = -1008L, + /** + * Send data failed error. + */ + DJISDKErrorSendDataFailed = -1009L, + /** + * Connection to SDK failed error. + */ + DJISDKErrorConnectionToSDKFailed = -1010L, + /** + * Server data not ready. + */ + DJISDKErrorServerDataNotReady = -1011L, + /** + * Product unknown. + */ + DJISDKErrorProductUnknown = -1012L, + /** + * Product not support. + */ + DJISDKErrorProductNotSupport = -1013L, + /** + * Device not found. + */ + DJISDKErrorDeviceNotFound = -1014L, + /** + * The command is not supported by the current firmware version. + */ + DJISDKErrorNotSupportedByFirmware = -1015L, + /** + * Not defined error. + */ + DJISDKErrorNotDefined = -1999L, +}; + +//----------------------------------------------------------------- +#pragma mark DJISDKCameraError +//----------------------------------------------------------------- +typedef NS_ENUM (NSInteger, DJISDKCameraError){ + /** + * Not supported command or command not support in this firmware. + */ + DJISDKCameraErrorFirmwareDoesNotSupportCommand = -3000L, + /** + * Camera memory allocation failed error. + */ + DJISDKCameraErrorMemoryAllocationFailed = -3001L, + /** + * Camera busy or command could not execute in current state. + */ + DJISDKCameraErrorCommandCurrentlyNotEnabled = -3002L, + /** + * Camera time not synced. + */ + DJISDKCameraErrorTimeNotSynced = -3003L, + /** + * No SD card. + */ + DJISDKCameraErrorSDCardNotInserted = -3004L, + /** + * SD card full. + */ + DJISDKCameraErrorSDCardFull = -3005L, + /** + * SD card error. + */ + DJISDKCameraErrorSDCardError = -3006L, + /** + * Camera sensor error. + */ + DJISDKCameraErrorSensorError = -3007L, + /** + * Camera system error. + */ + DJISDKCameraErrorSystemError = -3008L, + /** + * Media type error. + */ + DJISDKCameraErrorMediaTypeError = -3009L, +}; + +//----------------------------------------------------------------- +#pragma mark DJISDKFlightControllerError +//----------------------------------------------------------------- +typedef NS_ENUM (NSInteger, DJISDKFlightControllerError) { + /** + * Mode error + */ + DJISDKFlightControllerErrorModeError = -4000L, + /** + * Aircraft too close to the home point. + */ + DJISDKFlightControllerErrorNearHomePoint = -4001L, + /** + * Aircraft currently running a mission + */ + DJISDKFlightControllerErrorRunningMission = -4002L, + /** + * Aircraft currently running virtual stick + */ + DJISDKFlightControllerErrorRunningVirtualStick = -4003L, + /** + * Aircraft not in the air. + */ + DJISDKFlightControllerErrorAircraftNotInTheAir = -4004L, + /** + * Aircraft flight limited. + */ + DJISDKFlightControllerErrorFlightLimited = -4005L, + /** + * Aircraft GPS weak + */ + DJISDKFlightControllerErrorBadGPS = -4006L, + /** + * Aircraft low battery + */ + DJISDKFlightControllerErrorLowBattery = -4007L, + /** + * Aircraft not record home point. + */ + DJISDKFlightControllerErrorHomePointNotRecord = -4008L, + /** + * Aircraft taking off + */ + DJISDKFlightControllerErrorTakingOff = -4009L, + /** + * Aircraft landing + */ + DJISDKFlightControllerErrorLanding = -4010L, + /** + * Aircraft going home + */ + DJISDKFlightControllerErrorGoingHome = -4011L, + /** + * Aircraft starting engine + */ + DJISDKFlightControllerErrorStartingEngine = -4012L, + /** + * Aircraft in a no fly zone. + */ + DJISDKFlightControllerErrorInNoFlyZone = -4013, + /** + * Compass calibration + */ + DJISDKFlightControllerErrorCompassCalibration = -4013L, + /** + * Gimbal not removed. + */ + DJISDKFlightControllerErrorGimbalNotRemoved = -4014L, + /** + * Try to turn off motors during flight. + */ + DJISDKFlightControllerErrorAircraftFlying = -4015L, + /** + * The new home point is too far. + */ + DJISDKFlightControllerErrorHomePointTooFar = -4016L, + /** + * The new home altitude is too low. + */ + DJISDKFlightControllerErrorGoHomeAltitudeTooLow = -4017L, + /** + * The new home altitude is too high. + */ + DJISDKFlightControllerErrorGoHomeAltitudeTooHigh = -4018L, + /** + * The remote controller's mode switch is not in correct mode. + */ + DJISDKFlightControllerErrorRemoteControllerModeError = -4019L, + /** + * The virtual stick control mode is not available. + */ + DJISDKFlightControllerErrorVirtualStickControlModeError = -4020L, +}; + +//----------------------------------------------------------------- +#pragma mark DJISDKMissionError +//----------------------------------------------------------------- +typedef NS_ENUM (NSInteger, DJISDKMissionError){ + /** + * Mode error. Remote controller's mode switch should be in 'F' mode. + */ + DJISDKMissionErrorModeError = -5000L, + /** + * Aircraft's GPS too weak. + */ + DJISDKMissionErrorAircraftBadGPS = -5001L, + /** + * Aircraft's battery too low. + */ + DJISDKMissionErrorAircraftLowBattery = -5002L, + /** + * Aircraft's not in the air. + */ + DJISDKMissionErrorAircraftNotInTheAir = -5003L, + /** + * Aircraft's altitude too high. + */ + DJISDKMissionErrorAircraftAltitudeTooHigh = -5004L, + /** + * Aircraft's altitude too low. + */ + DJISDKMissionErrorAircraftAltitudeTooLow = -5005L, + /** + * Aircraft is taking off. + */ + DJISDKMissionErrorAircraftTakingoff = -5006L, + /** + * Aircraft is landing + */ + DJISDKMissionErrorAircraftLanding = -5007L, + /** + * Aircraft is going home + */ + DJISDKMissionErrorAircraftGoingHome = -5008L, + /** + * Aircraft is starting engine. + */ + DJISDKMissionErrorAircraftStartingEngine = -5009L, + /** + * Aircraft's home point not record. + */ + DJISDKMissionErrorAircraftHomePointNotRecord = -5010L, + /** + * Aircraft lost the follow target. + */ + DJISDKMissionErrorAircraftLostFollowTarget = -5011L, + /** + * Aircraft is in novince mode. + */ + DJISDKMissionErrorAircraftInNoviceMode = -5012L, + /** + * Aircraft is in no fly zone. + */ + DJISDKMissionErrorAircraftInNoFlyZone = -5013L, + /** + * Aircraft flight limited. + */ + DJISDKMissionErrorAircraftFlightLimited = -5014L, + /** + * Aircraft is running a mission. + */ + DJISDKMissionErrorAircraftRunningMission = -5015L, + /** + * Aircraft no running mission. + */ + DJISDKMissionErrorAircraftNoRunningMission = -5016L, + /** + * Aircraft no mission. + */ + DJISDKMissionErrorAircraftNoMission = -5017L, + /** + * Aircraft is near to the home point. + */ + DJISDKMissionErrorAircraftNearHomePoint = -5018L, + /** + * Aircraft is too far away to the mission. + */ + DJISDKMissionErrorAircraftFarAwayMission = -5019L, + /** + * Mission's parameters is invalid. + */ + DJISDKMissionErrorMissionParametersInvalid = -5020L, + /** + * Mission's total distance is too large. + */ + DJISDKMissionErrorMissionTotalDistanceTooLarge = -5021L, + /** + * Mission need too much time to execute. + */ + DJISDKMissionErrorMissionNeedTooMuchTime = -5022L, + /** + * Mission resume failed. + */ + DJISDKMissionErrorMissionResumeFailed = -5023L, + /** + * Command can not be executed. + */ + DJISDKMissionErrorCommandCanNotExecute = -5024L, + /** + * Aircraft already in command state. duplicate execute a same command will has this error. + */ + DJISDKMissionErrorAircraftAlreadyInCommandState = -5025L, + /** + * Mission not prepare + */ + DJISDKMissionErrorMissionNotReady = -5026L, + /** + * Custom mission step can not be paused. + */ + DJISDKMissionErrorCustomMissionStepCannotPause = -5027L, + /** + * Custom mission is not initialized with the mission steps. The Steps array is empty. + */ + DJISDKMissionErrorCustomMissionStepsNotInitialized = -5028L, + /** + * Current mission step is initializing. + */ + DJISDKMissionErrorCustomMissionStepInitializing = -5029L, +}; + +/** + * NSError's DJISDK category. It contains methods to create custom NSErrors. + * + */ +@interface NSError (DJISDK) + +/** + * Get DJISDKError + * + * @param errorCode errorCode for DJISDKError + */ ++ (_Nullable instancetype)DJISDKErrorForCode:(NSInteger)errorCode; + +/** + * Get DJISDKCameraError + * + * @param errorCode errorCode for DJISDKCameraError + */ ++ (_Nullable instancetype)DJISDKCameraErrorForCode:(NSInteger)errorCode; + +/** + * Get DJISDKFlightControllerError + * + * @param errorCode errorCode for DJISDKFlightControllerError + */ ++ (_Nullable instancetype)DJISDKFlightControllerErrorForCode:(NSInteger)errorCode; + +/** + * Get DJISDKMissionError + * + * @param errorCode errorCode for DJISDKMissionError + */ ++ (_Nullable instancetype)DJISDKMissionErrorForCode:(NSInteger)errorCode; + +/** + * Get DJISDKRegistrationError + * + * @param errorCode errorCode for DJISDKRegistrationError + */ ++ (_Nullable instancetype)DJISDKRegistrationErrorForCode:(DJISDKRegistrationError)errorCode; + +/** + * Get DJISDKError + * + * @param errorCode errorCode for DJISDKError + * @param errorDomain domain for DJISDKError + * @param desc desc for DJISDKError + */ ++ (_Nullable instancetype)DJISDKErrorForCode:(NSInteger)errorCode domain:(NSString *_Nonnull)errorDomain desc:(const NSString *_Nonnull)desc; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/DJISDK.framework/Info.plist b/DJISDK.framework/Info.plist new file mode 100644 index 0000000..4106ab5 Binary files /dev/null and b/DJISDK.framework/Info.plist differ diff --git a/DJISDK.framework/Modules/module.modulemap b/DJISDK.framework/Modules/module.modulemap new file mode 100644 index 0000000..7e77ff9 --- /dev/null +++ b/DJISDK.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module DJISDK { + umbrella header "DJISDK.h" + + export * + module * { export * } +} diff --git a/DJISDK.framework/_CodeSignature/CodeResources b/DJISDK.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..c490941 --- /dev/null +++ b/DJISDK.framework/_CodeSignature/CodeResources @@ -0,0 +1,495 @@ + + + + + files + + Headers/DJIAirLink.h + + 3wOdEc1tntEETwLJO/Ic51zerqI= + + Headers/DJIAircraft.h + + JAyBbYO+MUJEw5z8Oy/WLRIdRWQ= + + Headers/DJIBaseComponent.h + + J3g/1mORHApjcWzqboxKtP64FHk= + + Headers/DJIBaseProduct.h + + XEb3v3ehbKBDdCYJyyKkVd1ay7E= + + Headers/DJIBattery.h + + Nrr+uxIZZERFSYq/uwE7sVtVrjk= + + Headers/DJICamera.h + + 5l69jejgtuK6zH6q6F4pX7Q3hS4= + + Headers/DJICameraLensState.h + + mT4Z1DQ12g8I24BUP0O4V5Zy69A= + + Headers/DJICameraParameters.h + + VRbvHF/WQgRFhr06hAWBgnGV2MY= + + Headers/DJICameraPlaybackState.h + + +ZmjHNqfai0Zuy4BQrBiOnNtTwk= + + Headers/DJICameraSettingsDef.h + + VAUPVRIGgGjpHsjwshg3OpFpA+E= + + Headers/DJICameraSystemState.h + + eOUDmKMzfuxKFSFcIdtTgFxL0C8= + + Headers/DJICompass.h + + FnXryfAZ8UAPzV1EKkyp2m+f8j8= + + Headers/DJICustomMission.h + + NGGdCdNkfilhkEy7AWOm7YqFumI= + + Headers/DJIFlightController.h + + PyIUyFUkJYKkwVCRf6EMmvtHOyY= + + Headers/DJIFlightControllerCurrentState.h + + N8vb+eAGUBV02dq49/Kq2Ou/vUU= + + Headers/DJIFlightLimitation.h + + BHe7G4SY1lxtZ1pw05bdtZiOBTw= + + Headers/DJIFollowMeMission.h + + xbEbyOHiYG8YTQVD37/wclshhWI= + + Headers/DJIFollowMeStep.h + + H0coXHR5S7vlaUpfw991JKM+T+M= + + Headers/DJIGimbal.h + + jXI+WUctmxIlUv+5GhNhQUHyRFc= + + Headers/DJIGimbalAttitudeStep.h + + Z4z9QaFcTOgGIEc/ILbt7FF0zdQ= + + Headers/DJIGoHomeStep.h + + eMyx+jlY4B/Wdsa019pVoVkROl4= + + Headers/DJIGoToStep.h + + LQpFFqd2Rk2XjhqdqWmzf+NR1cQ= + + Headers/DJIHandheld.h + + aCdYF5kFEMTIk2I0Th3XGIbn3no= + + Headers/DJIHandheldController.h + + gImV8L3/Ab7GW5mA3gISaa0BYdw= + + Headers/DJIHotPointMission.h + + SbrnOfOHQ8dWt0XPOfeIzKgdP3A= + + Headers/DJIHotpointStep.h + + umoKNL/k+3LADNjMjZgHTkygQpM= + + Headers/DJILBAirLink.h + + L7sMzzryaxw8HuMMa0DIV+h78+0= + + Headers/DJILandingGear.h + + wYJCEch3QVERMP0t/1IqmWgr15E= + + Headers/DJIMedia.h + + FgoR5s228bXtMFq2dH0tJtjrpmo= + + Headers/DJIMediaManager.h + + S6ZKtb5nq711/ak0joFLOZVjfGk= + + Headers/DJIMission.h + + K5QV2LL1fJIxy8/k4CiExpYO/5o= + + Headers/DJIMissionManager.h + + dvHdH5CbEqlWkKR7ReUxZKSBKq0= + + Headers/DJIMissionStep.h + + YekZKNJICZdvuzH0SjXll4OyR4w= + + Headers/DJIPanoramaMission.h + + Udyv85oWrbJxNqSCRd0MS/qJtBw= + + Headers/DJIPlaybackManager.h + + wxuK8fw5sVjquAYzTWBUGkcAO1c= + + Headers/DJIRecordVideoStep.h + + xtpCW5wAfdDUDJRgy3C5mBpwEMI= + + Headers/DJIRemoteController.h + + 28BKjVVMIQBY5rl5HUZA06/srdI= + + Headers/DJIRemoteLogger.h + + /Cg/4/5gkNu/RdmFrpFAJC5pwZg= + + Headers/DJISDK.h + + r/d6GE+7X4sNw2y+QhDKT4giXrw= + + Headers/DJISDKManager.h + + pugRwKaqk7B1whEWJJykUMVYXMI= + + Headers/DJIShootPhotoStep.h + + r1bvotHA/fP1HNKMJ9daMJSu9n8= + + Headers/DJITakeoffStep.h + + gbM0/gMMbpd/a65thfbJAZmX+ME= + + Headers/DJIWaypoint.h + + indZhpBjWCYw/3mO30rdjtlY+aQ= + + Headers/DJIWaypointMission.h + + 8bCoprUPFhEWMewqAnOkLTjxsuo= + + Headers/DJIWaypointStep.h + + FY+i1IFOHGeYkbAU3MH56WxieAw= + + Headers/DJIWiFiLink.h + + Rs232EdcEz5UKATyZ1/iAq2H9Us= + + Headers/NSError+DJISDK.h + + QrEJ7g4saqB20YejtEl8NEaAoKQ= + + Info.plist + + QxYUnr6bCp7PGPBBGstkAVeSVJI= + + Modules/module.modulemap + + +cOidGO3QhxEDWKlHfvJCT9cA/g= + + + files2 + + Headers/DJIAirLink.h + + 3wOdEc1tntEETwLJO/Ic51zerqI= + + Headers/DJIAircraft.h + + JAyBbYO+MUJEw5z8Oy/WLRIdRWQ= + + Headers/DJIBaseComponent.h + + J3g/1mORHApjcWzqboxKtP64FHk= + + Headers/DJIBaseProduct.h + + XEb3v3ehbKBDdCYJyyKkVd1ay7E= + + Headers/DJIBattery.h + + Nrr+uxIZZERFSYq/uwE7sVtVrjk= + + Headers/DJICamera.h + + 5l69jejgtuK6zH6q6F4pX7Q3hS4= + + Headers/DJICameraLensState.h + + mT4Z1DQ12g8I24BUP0O4V5Zy69A= + + Headers/DJICameraParameters.h + + VRbvHF/WQgRFhr06hAWBgnGV2MY= + + Headers/DJICameraPlaybackState.h + + +ZmjHNqfai0Zuy4BQrBiOnNtTwk= + + Headers/DJICameraSettingsDef.h + + VAUPVRIGgGjpHsjwshg3OpFpA+E= + + Headers/DJICameraSystemState.h + + eOUDmKMzfuxKFSFcIdtTgFxL0C8= + + Headers/DJICompass.h + + FnXryfAZ8UAPzV1EKkyp2m+f8j8= + + Headers/DJICustomMission.h + + NGGdCdNkfilhkEy7AWOm7YqFumI= + + Headers/DJIFlightController.h + + PyIUyFUkJYKkwVCRf6EMmvtHOyY= + + Headers/DJIFlightControllerCurrentState.h + + N8vb+eAGUBV02dq49/Kq2Ou/vUU= + + Headers/DJIFlightLimitation.h + + BHe7G4SY1lxtZ1pw05bdtZiOBTw= + + Headers/DJIFollowMeMission.h + + xbEbyOHiYG8YTQVD37/wclshhWI= + + Headers/DJIFollowMeStep.h + + H0coXHR5S7vlaUpfw991JKM+T+M= + + Headers/DJIGimbal.h + + jXI+WUctmxIlUv+5GhNhQUHyRFc= + + Headers/DJIGimbalAttitudeStep.h + + Z4z9QaFcTOgGIEc/ILbt7FF0zdQ= + + Headers/DJIGoHomeStep.h + + eMyx+jlY4B/Wdsa019pVoVkROl4= + + Headers/DJIGoToStep.h + + LQpFFqd2Rk2XjhqdqWmzf+NR1cQ= + + Headers/DJIHandheld.h + + aCdYF5kFEMTIk2I0Th3XGIbn3no= + + Headers/DJIHandheldController.h + + gImV8L3/Ab7GW5mA3gISaa0BYdw= + + Headers/DJIHotPointMission.h + + SbrnOfOHQ8dWt0XPOfeIzKgdP3A= + + Headers/DJIHotpointStep.h + + umoKNL/k+3LADNjMjZgHTkygQpM= + + Headers/DJILBAirLink.h + + L7sMzzryaxw8HuMMa0DIV+h78+0= + + Headers/DJILandingGear.h + + wYJCEch3QVERMP0t/1IqmWgr15E= + + Headers/DJIMedia.h + + FgoR5s228bXtMFq2dH0tJtjrpmo= + + Headers/DJIMediaManager.h + + S6ZKtb5nq711/ak0joFLOZVjfGk= + + Headers/DJIMission.h + + K5QV2LL1fJIxy8/k4CiExpYO/5o= + + Headers/DJIMissionManager.h + + dvHdH5CbEqlWkKR7ReUxZKSBKq0= + + Headers/DJIMissionStep.h + + YekZKNJICZdvuzH0SjXll4OyR4w= + + Headers/DJIPanoramaMission.h + + Udyv85oWrbJxNqSCRd0MS/qJtBw= + + Headers/DJIPlaybackManager.h + + wxuK8fw5sVjquAYzTWBUGkcAO1c= + + Headers/DJIRecordVideoStep.h + + xtpCW5wAfdDUDJRgy3C5mBpwEMI= + + Headers/DJIRemoteController.h + + 28BKjVVMIQBY5rl5HUZA06/srdI= + + Headers/DJIRemoteLogger.h + + /Cg/4/5gkNu/RdmFrpFAJC5pwZg= + + Headers/DJISDK.h + + r/d6GE+7X4sNw2y+QhDKT4giXrw= + + Headers/DJISDKManager.h + + pugRwKaqk7B1whEWJJykUMVYXMI= + + Headers/DJIShootPhotoStep.h + + r1bvotHA/fP1HNKMJ9daMJSu9n8= + + Headers/DJITakeoffStep.h + + gbM0/gMMbpd/a65thfbJAZmX+ME= + + Headers/DJIWaypoint.h + + indZhpBjWCYw/3mO30rdjtlY+aQ= + + Headers/DJIWaypointMission.h + + 8bCoprUPFhEWMewqAnOkLTjxsuo= + + Headers/DJIWaypointStep.h + + FY+i1IFOHGeYkbAU3MH56WxieAw= + + Headers/DJIWiFiLink.h + + Rs232EdcEz5UKATyZ1/iAq2H9Us= + + Headers/NSError+DJISDK.h + + QrEJ7g4saqB20YejtEl8NEaAoKQ= + + Modules/module.modulemap + + +cOidGO3QhxEDWKlHfvJCT9cA/g= + + + rules + + ^ + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^ + + weight + 20 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/DJISDK.framework/strip-frameworks.sh b/DJISDK.framework/strip-frameworks.sh new file mode 100644 index 0000000..bf45449 --- /dev/null +++ b/DJISDK.framework/strip-frameworks.sh @@ -0,0 +1,62 @@ +################################################################################ +# +# Copyright 2015 Realm Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +# This script strips all non-valid architectures from dynamic libraries in +# the application's `Frameworks` directory. +# +# The following environment variables are required: +# +# BUILT_PRODUCTS_DIR +# FRAMEWORKS_FOLDER_PATH +# VALID_ARCHS +# EXPANDED_CODE_SIGN_IDENTITY + + +# Signs a framework with the provided identity +code_sign() { + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1" + /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" +} + +echo "Stripping frameworks" +cd "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +for file in $(find . -type f -perm +111); do + # Skip non-dynamic libraries + if ! [[ "$(file "$file")" == *"dynamically linked shared library"* ]]; then + continue + fi + # Get architectures for current file + archs="$(lipo -info "${file}" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$file" "$file" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" != "" ]]; then + echo "Stripped $file of architectures:$stripped" + if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then + code_sign "${file}" + fi + fi +done diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..099edf4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) <2016> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH +THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/README.md b/README.md index 529d2d6..c155f28 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,23 @@ -# DJI-Bridge-App -The source code of DJI Bridge App project +# DJI Bridge App + +## What is This? + +This is an open source project for DJI Bridge App. + +The DJI Bridge App supports for native Xcode debugging with breakpoints. You can use it to debug your [DJI Mobile SDK](https://github.com/dji-sdk/Mobile-SDK-iOS) application for Phantom 3 Professional, Phantom 3 Advanced, Inspire 1, M100 and other products using USB/MFI connection between RC and your app. + +For more details, please check the [DJI Bridge App Tutorial](https://github.com/dji-dev/DJI-Mobile-SDK-Beta/tree/master/iOS/DJIBridgeAppDemo). + +## Prerequisites + +- Xcode 7.0+ or higher +- Deployment target of 8.0 or higher + +## What's More? + +If you want, you can customize your own Bridge app with [DJI Mobile SDK](https://github.com/dji-sdk/Mobile-SDK-iOS), please check the project's source code. + + +## License + +DJI Bridge App is released under the MIT license. See LICENSE for details.