@@ -0,0 +1,489 @@ | |||
// !$*UTF8*$! | |||
{ | |||
archiveVersion = 1; | |||
classes = { | |||
}; | |||
objectVersion = 50; | |||
objects = { | |||
/* Begin PBXBuildFile section */ | |||
E64A7F0D244068EC00D22B84 /* AiBrushBleSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E64A7F0C244068EC00D22B84 /* AiBrushBleSDK.framework */; }; | |||
E686EA6922DC7908003A3240 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E686EA6822DC7908003A3240 /* AppDelegate.m */; }; | |||
E686EA6C22DC7908003A3240 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E686EA6B22DC7908003A3240 /* ViewController.m */; }; | |||
E686EA6F22DC7908003A3240 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E686EA6D22DC7908003A3240 /* Main.storyboard */; }; | |||
E686EA7122DC7909003A3240 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E686EA7022DC7909003A3240 /* Assets.xcassets */; }; | |||
E686EA7422DC7909003A3240 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E686EA7222DC7909003A3240 /* LaunchScreen.storyboard */; }; | |||
E686EA7722DC7909003A3240 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E686EA7622DC7909003A3240 /* main.m */; }; | |||
E686EA8122DC7909003A3240 /* AiBrushBleSDKDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = E686EA8022DC7909003A3240 /* AiBrushBleSDKDemoUITests.m */; }; | |||
E686EA8C22DC794C003A3240 /* toothbrush_20170115_V1.3.img in Resources */ = {isa = PBXBuildFile; fileRef = E686EA8B22DC794C003A3240 /* toothbrush_20170115_V1.3.img */; }; | |||
E686EA9122DC79FE003A3240 /* AppTool.m in Sources */ = {isa = PBXBuildFile; fileRef = E686EA8F22DC79FE003A3240 /* AppTool.m */; }; | |||
/* End PBXBuildFile section */ | |||
/* Begin PBXContainerItemProxy section */ | |||
E686EA7D22DC7909003A3240 /* PBXContainerItemProxy */ = { | |||
isa = PBXContainerItemProxy; | |||
containerPortal = E686EA5C22DC7908003A3240 /* Project object */; | |||
proxyType = 1; | |||
remoteGlobalIDString = E686EA6322DC7908003A3240; | |||
remoteInfo = AiBrushBleSDKDemo; | |||
}; | |||
/* End PBXContainerItemProxy section */ | |||
/* Begin PBXFileReference section */ | |||
E64A7F0C244068EC00D22B84 /* AiBrushBleSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AiBrushBleSDK.framework; sourceTree = "<group>"; }; | |||
E686EA6422DC7908003A3240 /* AiBrushBleSDKDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AiBrushBleSDKDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; | |||
E686EA6722DC7908003A3240 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; | |||
E686EA6822DC7908003A3240 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; | |||
E686EA6A22DC7908003A3240 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; }; | |||
E686EA6B22DC7908003A3240 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; }; | |||
E686EA6E22DC7908003A3240 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; | |||
E686EA7022DC7909003A3240 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; | |||
E686EA7322DC7909003A3240 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; | |||
E686EA7522DC7909003A3240 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; | |||
E686EA7622DC7909003A3240 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; | |||
E686EA7C22DC7909003A3240 /* AiBrushBleSDKDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AiBrushBleSDKDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; | |||
E686EA8022DC7909003A3240 /* AiBrushBleSDKDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AiBrushBleSDKDemoUITests.m; sourceTree = "<group>"; }; | |||
E686EA8222DC7909003A3240 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; | |||
E686EA8B22DC794C003A3240 /* toothbrush_20170115_V1.3.img */ = {isa = PBXFileReference; lastKnownFileType = file; path = toothbrush_20170115_V1.3.img; sourceTree = "<group>"; }; | |||
E686EA8F22DC79FE003A3240 /* AppTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppTool.m; sourceTree = "<group>"; }; | |||
E686EA9022DC79FE003A3240 /* AppTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppTool.h; sourceTree = "<group>"; }; | |||
/* End PBXFileReference section */ | |||
/* Begin PBXFrameworksBuildPhase section */ | |||
E686EA6122DC7908003A3240 /* Frameworks */ = { | |||
isa = PBXFrameworksBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
E64A7F0D244068EC00D22B84 /* AiBrushBleSDK.framework in Frameworks */, | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
E686EA7922DC7909003A3240 /* Frameworks */ = { | |||
isa = PBXFrameworksBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
/* End PBXFrameworksBuildPhase section */ | |||
/* Begin PBXGroup section */ | |||
E686EA5B22DC7908003A3240 = { | |||
isa = PBXGroup; | |||
children = ( | |||
E686EA6622DC7908003A3240 /* AiBrushBleSDKDemo */, | |||
E686EA7F22DC7909003A3240 /* AiBrushBleSDKDemoUITests */, | |||
E686EA6522DC7908003A3240 /* Products */, | |||
); | |||
sourceTree = "<group>"; | |||
}; | |||
E686EA6522DC7908003A3240 /* Products */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
E686EA6422DC7908003A3240 /* AiBrushBleSDKDemo.app */, | |||
E686EA7C22DC7909003A3240 /* AiBrushBleSDKDemoUITests.xctest */, | |||
); | |||
name = Products; | |||
sourceTree = "<group>"; | |||
}; | |||
E686EA6622DC7908003A3240 /* AiBrushBleSDKDemo */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
E64A7F0C244068EC00D22B84 /* AiBrushBleSDK.framework */, | |||
E686EA9022DC79FE003A3240 /* AppTool.h */, | |||
E686EA8F22DC79FE003A3240 /* AppTool.m */, | |||
E686EA6722DC7908003A3240 /* AppDelegate.h */, | |||
E686EA6822DC7908003A3240 /* AppDelegate.m */, | |||
E686EA6A22DC7908003A3240 /* ViewController.h */, | |||
E686EA6B22DC7908003A3240 /* ViewController.m */, | |||
E686EA6D22DC7908003A3240 /* Main.storyboard */, | |||
E686EA7022DC7909003A3240 /* Assets.xcassets */, | |||
E686EA7222DC7909003A3240 /* LaunchScreen.storyboard */, | |||
E686EA7522DC7909003A3240 /* Info.plist */, | |||
E686EA7622DC7909003A3240 /* main.m */, | |||
E686EA8B22DC794C003A3240 /* toothbrush_20170115_V1.3.img */, | |||
); | |||
path = AiBrushBleSDKDemo; | |||
sourceTree = "<group>"; | |||
}; | |||
E686EA7F22DC7909003A3240 /* AiBrushBleSDKDemoUITests */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
E686EA8022DC7909003A3240 /* AiBrushBleSDKDemoUITests.m */, | |||
E686EA8222DC7909003A3240 /* Info.plist */, | |||
); | |||
path = AiBrushBleSDKDemoUITests; | |||
sourceTree = "<group>"; | |||
}; | |||
/* End PBXGroup section */ | |||
/* Begin PBXNativeTarget section */ | |||
E686EA6322DC7908003A3240 /* AiBrushBleSDKDemo */ = { | |||
isa = PBXNativeTarget; | |||
buildConfigurationList = E686EA8522DC790A003A3240 /* Build configuration list for PBXNativeTarget "AiBrushBleSDKDemo" */; | |||
buildPhases = ( | |||
E686EA6022DC7908003A3240 /* Sources */, | |||
E686EA6122DC7908003A3240 /* Frameworks */, | |||
E686EA6222DC7908003A3240 /* Resources */, | |||
); | |||
buildRules = ( | |||
); | |||
dependencies = ( | |||
); | |||
name = AiBrushBleSDKDemo; | |||
productName = AiBrushBleSDKDemo; | |||
productReference = E686EA6422DC7908003A3240 /* AiBrushBleSDKDemo.app */; | |||
productType = "com.apple.product-type.application"; | |||
}; | |||
E686EA7B22DC7909003A3240 /* AiBrushBleSDKDemoUITests */ = { | |||
isa = PBXNativeTarget; | |||
buildConfigurationList = E686EA8822DC790A003A3240 /* Build configuration list for PBXNativeTarget "AiBrushBleSDKDemoUITests" */; | |||
buildPhases = ( | |||
E686EA7822DC7909003A3240 /* Sources */, | |||
E686EA7922DC7909003A3240 /* Frameworks */, | |||
E686EA7A22DC7909003A3240 /* Resources */, | |||
); | |||
buildRules = ( | |||
); | |||
dependencies = ( | |||
E686EA7E22DC7909003A3240 /* PBXTargetDependency */, | |||
); | |||
name = AiBrushBleSDKDemoUITests; | |||
productName = AiBrushBleSDKDemoUITests; | |||
productReference = E686EA7C22DC7909003A3240 /* AiBrushBleSDKDemoUITests.xctest */; | |||
productType = "com.apple.product-type.bundle.ui-testing"; | |||
}; | |||
/* End PBXNativeTarget section */ | |||
/* Begin PBXProject section */ | |||
E686EA5C22DC7908003A3240 /* Project object */ = { | |||
isa = PBXProject; | |||
attributes = { | |||
LastUpgradeCheck = 1020; | |||
ORGANIZATIONNAME = IOT; | |||
TargetAttributes = { | |||
E686EA6322DC7908003A3240 = { | |||
CreatedOnToolsVersion = 10.2; | |||
}; | |||
E686EA7B22DC7909003A3240 = { | |||
CreatedOnToolsVersion = 10.2; | |||
TestTargetID = E686EA6322DC7908003A3240; | |||
}; | |||
}; | |||
}; | |||
buildConfigurationList = E686EA5F22DC7908003A3240 /* Build configuration list for PBXProject "AiBrushBleSDKDemo" */; | |||
compatibilityVersion = "Xcode 9.3"; | |||
developmentRegion = en; | |||
hasScannedForEncodings = 0; | |||
knownRegions = ( | |||
en, | |||
Base, | |||
); | |||
mainGroup = E686EA5B22DC7908003A3240; | |||
productRefGroup = E686EA6522DC7908003A3240 /* Products */; | |||
projectDirPath = ""; | |||
projectRoot = ""; | |||
targets = ( | |||
E686EA6322DC7908003A3240 /* AiBrushBleSDKDemo */, | |||
E686EA7B22DC7909003A3240 /* AiBrushBleSDKDemoUITests */, | |||
); | |||
}; | |||
/* End PBXProject section */ | |||
/* Begin PBXResourcesBuildPhase section */ | |||
E686EA6222DC7908003A3240 /* Resources */ = { | |||
isa = PBXResourcesBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
E686EA8C22DC794C003A3240 /* toothbrush_20170115_V1.3.img in Resources */, | |||
E686EA7422DC7909003A3240 /* LaunchScreen.storyboard in Resources */, | |||
E686EA7122DC7909003A3240 /* Assets.xcassets in Resources */, | |||
E686EA6F22DC7908003A3240 /* Main.storyboard in Resources */, | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
E686EA7A22DC7909003A3240 /* Resources */ = { | |||
isa = PBXResourcesBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
/* End PBXResourcesBuildPhase section */ | |||
/* Begin PBXSourcesBuildPhase section */ | |||
E686EA6022DC7908003A3240 /* Sources */ = { | |||
isa = PBXSourcesBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
E686EA6C22DC7908003A3240 /* ViewController.m in Sources */, | |||
E686EA7722DC7909003A3240 /* main.m in Sources */, | |||
E686EA6922DC7908003A3240 /* AppDelegate.m in Sources */, | |||
E686EA9122DC79FE003A3240 /* AppTool.m in Sources */, | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
E686EA7822DC7909003A3240 /* Sources */ = { | |||
isa = PBXSourcesBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
E686EA8122DC7909003A3240 /* AiBrushBleSDKDemoUITests.m in Sources */, | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
/* End PBXSourcesBuildPhase section */ | |||
/* Begin PBXTargetDependency section */ | |||
E686EA7E22DC7909003A3240 /* PBXTargetDependency */ = { | |||
isa = PBXTargetDependency; | |||
target = E686EA6322DC7908003A3240 /* AiBrushBleSDKDemo */; | |||
targetProxy = E686EA7D22DC7909003A3240 /* PBXContainerItemProxy */; | |||
}; | |||
/* End PBXTargetDependency section */ | |||
/* Begin PBXVariantGroup section */ | |||
E686EA6D22DC7908003A3240 /* Main.storyboard */ = { | |||
isa = PBXVariantGroup; | |||
children = ( | |||
E686EA6E22DC7908003A3240 /* Base */, | |||
); | |||
name = Main.storyboard; | |||
sourceTree = "<group>"; | |||
}; | |||
E686EA7222DC7909003A3240 /* LaunchScreen.storyboard */ = { | |||
isa = PBXVariantGroup; | |||
children = ( | |||
E686EA7322DC7909003A3240 /* Base */, | |||
); | |||
name = LaunchScreen.storyboard; | |||
sourceTree = "<group>"; | |||
}; | |||
/* End PBXVariantGroup section */ | |||
/* Begin XCBuildConfiguration section */ | |||
E686EA8322DC790A003A3240 /* Debug */ = { | |||
isa = XCBuildConfiguration; | |||
buildSettings = { | |||
ALWAYS_SEARCH_USER_PATHS = NO; | |||
CLANG_ANALYZER_NONNULL = YES; | |||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; | |||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; | |||
CLANG_CXX_LIBRARY = "libc++"; | |||
CLANG_ENABLE_MODULES = YES; | |||
CLANG_ENABLE_OBJC_ARC = YES; | |||
CLANG_ENABLE_OBJC_WEAK = YES; | |||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; | |||
CLANG_WARN_BOOL_CONVERSION = YES; | |||
CLANG_WARN_COMMA = YES; | |||
CLANG_WARN_CONSTANT_CONVERSION = YES; | |||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; | |||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | |||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES; | |||
CLANG_WARN_EMPTY_BODY = YES; | |||
CLANG_WARN_ENUM_CONVERSION = YES; | |||
CLANG_WARN_INFINITE_RECURSION = YES; | |||
CLANG_WARN_INT_CONVERSION = YES; | |||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; | |||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; | |||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; | |||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | |||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; | |||
CLANG_WARN_STRICT_PROTOTYPES = YES; | |||
CLANG_WARN_SUSPICIOUS_MOVE = YES; | |||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; | |||
CLANG_WARN_UNREACHABLE_CODE = YES; | |||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | |||
CODE_SIGN_IDENTITY = "iPhone Developer"; | |||
COPY_PHASE_STRIP = NO; | |||
DEBUG_INFORMATION_FORMAT = dwarf; | |||
ENABLE_STRICT_OBJC_MSGSEND = YES; | |||
ENABLE_TESTABILITY = YES; | |||
GCC_C_LANGUAGE_STANDARD = gnu11; | |||
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 = 12.2; | |||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; | |||
MTL_FAST_MATH = YES; | |||
ONLY_ACTIVE_ARCH = YES; | |||
SDKROOT = iphoneos; | |||
}; | |||
name = Debug; | |||
}; | |||
E686EA8422DC790A003A3240 /* Release */ = { | |||
isa = XCBuildConfiguration; | |||
buildSettings = { | |||
ALWAYS_SEARCH_USER_PATHS = NO; | |||
CLANG_ANALYZER_NONNULL = YES; | |||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; | |||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; | |||
CLANG_CXX_LIBRARY = "libc++"; | |||
CLANG_ENABLE_MODULES = YES; | |||
CLANG_ENABLE_OBJC_ARC = YES; | |||
CLANG_ENABLE_OBJC_WEAK = YES; | |||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; | |||
CLANG_WARN_BOOL_CONVERSION = YES; | |||
CLANG_WARN_COMMA = YES; | |||
CLANG_WARN_CONSTANT_CONVERSION = YES; | |||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; | |||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | |||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES; | |||
CLANG_WARN_EMPTY_BODY = YES; | |||
CLANG_WARN_ENUM_CONVERSION = YES; | |||
CLANG_WARN_INFINITE_RECURSION = YES; | |||
CLANG_WARN_INT_CONVERSION = YES; | |||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; | |||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; | |||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; | |||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | |||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; | |||
CLANG_WARN_STRICT_PROTOTYPES = YES; | |||
CLANG_WARN_SUSPICIOUS_MOVE = YES; | |||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; | |||
CLANG_WARN_UNREACHABLE_CODE = YES; | |||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | |||
CODE_SIGN_IDENTITY = "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 = gnu11; | |||
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 = 12.2; | |||
MTL_ENABLE_DEBUG_INFO = NO; | |||
MTL_FAST_MATH = YES; | |||
SDKROOT = iphoneos; | |||
VALIDATE_PRODUCT = YES; | |||
}; | |||
name = Release; | |||
}; | |||
E686EA8622DC790A003A3240 /* Debug */ = { | |||
isa = XCBuildConfiguration; | |||
buildSettings = { | |||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | |||
CODE_SIGN_STYLE = Automatic; | |||
DEVELOPMENT_TEAM = YEU77XR292; | |||
FRAMEWORK_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
"$(PROJECT_DIR)/AiBrushBleSDKDemo", | |||
); | |||
INFOPLIST_FILE = AiBrushBleSDKDemo/Info.plist; | |||
IPHONEOS_DEPLOYMENT_TARGET = 9.0; | |||
LD_RUNPATH_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
"@executable_path/Frameworks", | |||
); | |||
PRODUCT_BUNDLE_IDENTIFIER = com.pingwang.AiBrushBleSDK; | |||
PRODUCT_NAME = "$(TARGET_NAME)"; | |||
TARGETED_DEVICE_FAMILY = "1,2"; | |||
}; | |||
name = Debug; | |||
}; | |||
E686EA8722DC790A003A3240 /* Release */ = { | |||
isa = XCBuildConfiguration; | |||
buildSettings = { | |||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | |||
CODE_SIGN_STYLE = Automatic; | |||
DEVELOPMENT_TEAM = YEU77XR292; | |||
FRAMEWORK_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
"$(PROJECT_DIR)/AiBrushBleSDKDemo", | |||
); | |||
INFOPLIST_FILE = AiBrushBleSDKDemo/Info.plist; | |||
IPHONEOS_DEPLOYMENT_TARGET = 9.0; | |||
LD_RUNPATH_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
"@executable_path/Frameworks", | |||
); | |||
PRODUCT_BUNDLE_IDENTIFIER = com.pingwang.AiBrushBleSDK; | |||
PRODUCT_NAME = "$(TARGET_NAME)"; | |||
TARGETED_DEVICE_FAMILY = "1,2"; | |||
}; | |||
name = Release; | |||
}; | |||
E686EA8922DC790A003A3240 /* Debug */ = { | |||
isa = XCBuildConfiguration; | |||
buildSettings = { | |||
CODE_SIGN_STYLE = Automatic; | |||
DEVELOPMENT_TEAM = YEU77XR292; | |||
INFOPLIST_FILE = AiBrushBleSDKDemoUITests/Info.plist; | |||
LD_RUNPATH_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
"@executable_path/Frameworks", | |||
"@loader_path/Frameworks", | |||
); | |||
PRODUCT_BUNDLE_IDENTIFIER = com.pingwang.AiBrushBleSDKDemoUITests; | |||
PRODUCT_NAME = "$(TARGET_NAME)"; | |||
TARGETED_DEVICE_FAMILY = "1,2"; | |||
TEST_TARGET_NAME = AiBrushBleSDKDemo; | |||
}; | |||
name = Debug; | |||
}; | |||
E686EA8A22DC790A003A3240 /* Release */ = { | |||
isa = XCBuildConfiguration; | |||
buildSettings = { | |||
CODE_SIGN_STYLE = Automatic; | |||
DEVELOPMENT_TEAM = YEU77XR292; | |||
INFOPLIST_FILE = AiBrushBleSDKDemoUITests/Info.plist; | |||
LD_RUNPATH_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
"@executable_path/Frameworks", | |||
"@loader_path/Frameworks", | |||
); | |||
PRODUCT_BUNDLE_IDENTIFIER = com.pingwang.AiBrushBleSDKDemoUITests; | |||
PRODUCT_NAME = "$(TARGET_NAME)"; | |||
TARGETED_DEVICE_FAMILY = "1,2"; | |||
TEST_TARGET_NAME = AiBrushBleSDKDemo; | |||
}; | |||
name = Release; | |||
}; | |||
/* End XCBuildConfiguration section */ | |||
/* Begin XCConfigurationList section */ | |||
E686EA5F22DC7908003A3240 /* Build configuration list for PBXProject "AiBrushBleSDKDemo" */ = { | |||
isa = XCConfigurationList; | |||
buildConfigurations = ( | |||
E686EA8322DC790A003A3240 /* Debug */, | |||
E686EA8422DC790A003A3240 /* Release */, | |||
); | |||
defaultConfigurationIsVisible = 0; | |||
defaultConfigurationName = Release; | |||
}; | |||
E686EA8522DC790A003A3240 /* Build configuration list for PBXNativeTarget "AiBrushBleSDKDemo" */ = { | |||
isa = XCConfigurationList; | |||
buildConfigurations = ( | |||
E686EA8622DC790A003A3240 /* Debug */, | |||
E686EA8722DC790A003A3240 /* Release */, | |||
); | |||
defaultConfigurationIsVisible = 0; | |||
defaultConfigurationName = Release; | |||
}; | |||
E686EA8822DC790A003A3240 /* Build configuration list for PBXNativeTarget "AiBrushBleSDKDemoUITests" */ = { | |||
isa = XCConfigurationList; | |||
buildConfigurations = ( | |||
E686EA8922DC790A003A3240 /* Debug */, | |||
E686EA8A22DC790A003A3240 /* Release */, | |||
); | |||
defaultConfigurationIsVisible = 0; | |||
defaultConfigurationName = Release; | |||
}; | |||
/* End XCConfigurationList section */ | |||
}; | |||
rootObject = E686EA5C22DC7908003A3240 /* Project object */; | |||
} |
@@ -0,0 +1,7 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<Workspace | |||
version = "1.0"> | |||
<FileRef | |||
location = "self:AiBrushBleSDKDemo.xcodeproj"> | |||
</FileRef> | |||
</Workspace> |
@@ -0,0 +1,8 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |||
<plist version="1.0"> | |||
<dict> | |||
<key>IDEDidComputeMac32BitWarning</key> | |||
<true/> | |||
</dict> | |||
</plist> |
@@ -0,0 +1,14 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |||
<plist version="1.0"> | |||
<dict> | |||
<key>SchemeUserState</key> | |||
<dict> | |||
<key>AiBrushBleSDKDemo.xcscheme_^#shared#^_</key> | |||
<dict> | |||
<key>orderHint</key> | |||
<integer>0</integer> | |||
</dict> | |||
</dict> | |||
</dict> | |||
</plist> |
@@ -0,0 +1,51 @@ | |||
// | |||
// AiBrushBatteryStateModel.h | |||
// AiBrushBleSDK | |||
// | |||
// Created by iot_user on 2019/7/10. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#import <Foundation/Foundation.h> | |||
//charger(充电器) | |||
typedef NS_ENUM(NSUInteger, AiBrushChargeState) { | |||
AiBrushChargeStateNotUsed = 0x01, //No charger inserted(未插入充电器) | |||
AiBrushChargeStateIsUsed = 0x02, //Plug in the charger(插入充电器) | |||
}; | |||
//Battery status(电池状态) | |||
typedef NS_ENUM(NSUInteger, AiBrushBatteryState) { | |||
AiBrushBatteryStateNotFull = 0x01, //Battery is not full(电池未充满) | |||
AiBrushBatteryStateIsFull = 0x02, //Battery full(电池充满) | |||
}; | |||
//Power status(电量状态) | |||
typedef NS_ENUM(NSUInteger, AiBrushPowerState) { | |||
AiBrushPowerStateLowShutdown = 0x01, //Low power shutdown(低电关机) | |||
AiBrushPowerStateNormal = 0x02, //Normal battery(电量正常) | |||
AiBrushPowerStateLowPrompt = 0x03, //Low power prompt(低电提示) | |||
}; | |||
NS_ASSUME_NONNULL_BEGIN | |||
@interface AiBrushBatteryStateModel : NSObject | |||
//Charger status(充电器状态) | |||
@property (nonatomic, assign) AiBrushChargeState chargeState; | |||
//Battery status(电池状态) | |||
@property (nonatomic, assign) AiBrushBatteryState batteryState; | |||
//Battery status(电量状态) | |||
@property (nonatomic, assign) AiBrushPowerState powerState; | |||
//Voltage (unit: millivolt)(电压(单位:毫伏)) | |||
@property (nonatomic, assign) int voltage; | |||
//Peak current (unit: 10mA)(峰值电流(单位:10mA)) | |||
@property (nonatomic, assign) int peakCurrent; | |||
//Battery capacity (in mAH)(电池容量(单位 mAH)) | |||
@property (nonatomic, assign) int capacity; | |||
//Percentage of electricity (unit: %)(电量百分比(单位:%)) | |||
@property (nonatomic, assign) int percentCharge; | |||
@end | |||
NS_ASSUME_NONNULL_END |
@@ -0,0 +1,58 @@ | |||
// | |||
// AiBrushBleHeader.h | |||
// AiBrushBleSDK | |||
// | |||
// Created by iot_user on 2019/7/3. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#ifndef AiBrushBleHeader_h | |||
#define AiBrushBleHeader_h | |||
typedef NS_ENUM(NSUInteger, AiBrushBleState) { | |||
AiBrushBleStateUnavailable = 0 , //Bluetooth is not available(蓝牙不可用) | |||
AiBrushBleStateAvailable = 1 , //Bluetooth is available(蓝牙打开可用) | |||
AiBrushBleStateScaning = 2 , //Scanning...(正在扫描...) | |||
AiBrushBleStateStopScan = 3 , //Stop scanning(停止扫描) | |||
AiBrushBleStateWillConnect = 4 , //Will connect(将要连接) | |||
AiBrushBleStateConnectFail = 5 , //Connection error(连接出错) | |||
AiBrushBleStateDidConnect = 6 , //connection succeeded(连接成功) | |||
AiBrushBleStateDidDisconnect = 7 , //Disconnect(断开连接) | |||
AiBrushBleStateDidUpdateCharacteristicState = 8 , //Update feature status, in which you can send relevant settings to Bluetooth(更新特征状态,可在这个状态时发送相关设置给蓝牙) | |||
}; | |||
//Toothbrush type(牙刷类型) | |||
typedef NS_ENUM(NSUInteger, AiBrushVersionType) { | |||
AiBrushVersionTypeOther = 0, //Other general modules(其他通用模块) | |||
AiBrushVersionTypeBY01 = 1, //BY00,01 | |||
AiBrushVersionTypeBY02 = 2, //...2 | |||
AiBrushVersionTypeBY03 = 3, //... | |||
AiBrushVersionTypeBY04 = 4, //.. | |||
AiBrushVersionTypeBY05 = 5, //. | |||
AiBrushVersionTypeBY06 = 6, // | |||
}; | |||
//Set mode result(设置模式结果) | |||
typedef NS_ENUM(NSUInteger, AiBrushSetModeResult) { | |||
AiBrushSetModeResult_Suc = 0x01, //successfully(成功) | |||
AiBrushSetModeResult_Fail = 0x02, //failed(失败) | |||
AiBrushSetModeResult_NotSupport = 0x03,//unsupport(不支持) | |||
}; | |||
//app支持的刷牙模式 | |||
typedef NS_ENUM(NSUInteger, AiBrushSupportBrushMode) { | |||
AiBrushSupportBrushMode_Clean = 0x01,//Clean(清洁) | |||
AiBrushSupportBrushMode_White = 0x02,//White (美白) | |||
AiBrushSupportBrushMode_Massage = 0x03,//Massage(按摩) | |||
AiBrushSupportBrushMode_Sensitive = 0x04,//Sensitive(敏感) | |||
AiBrushSupportBrushMode_Preset = 0x05,//Preset(定制) | |||
AiBrushSupportBrushMode_Custom = 0x06,//Custom(自定义) | |||
AiBrushSupportBrushMode_Polish = 0x07,//Polish(抛光) | |||
AiBrushSupportBrushMode_GumCare = 0x08,//GumCare(牙龈护理) | |||
AiBrushSupportBrushMode_MouthwashCare = 0x09,//MouthwashCare(漱口护理) | |||
AiBrushSupportBrushMode_Mascare = 0x0A,//Mascare (保健) | |||
AiBrushSupportBrushMode_Soft = 0x0B,//Soft (舒缓) | |||
}; | |||
#endif /* AiBrushBleHeader_h */ |
@@ -0,0 +1,293 @@ | |||
// | |||
// AiBrushBleManager.h | |||
// AiBrushBleSDK | |||
// | |||
// Created by iot_user on 2019/7/3. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#import <Foundation/Foundation.h> | |||
#import "AiBrushPeripheralModel.h" | |||
#import "AiBrushBleHeader.h" | |||
#import "AiBrushWorkStateModel.h" | |||
#import "AiBrushBatteryStateModel.h" | |||
#import "AiBrushWorkDataModel.h" | |||
#import "AiBrushGsensorModel.h" | |||
#import "AiBrushStrengthModel.h" | |||
NS_ASSUME_NONNULL_BEGIN | |||
@protocol AiBrushBleManagerDelegate <NSObject> | |||
/** | |||
Callback Bluetooth current status(回调蓝牙当前状态) | |||
@param state Bluetooth status(蓝牙状态) | |||
*/ | |||
-(void)brushBleManagerUpdateBleState:(AiBrushBleState)state; | |||
/** | |||
Callback to all peripherals scanned(回调扫描到的所有外设) | |||
@param peripheralList Peripheral list(外设列表) | |||
*/ | |||
-(void)brushBleManagerScanedPeripherals:(NSArray<AiBrushPeripheralModel *> *)peripheralList; | |||
/** | |||
Reporting setup mode results(上报设置模式结果) | |||
@param result (结果) | |||
*/ | |||
-(void)brushBleManagerReceiveSetModeResult:(AiBrushSetModeResult)result; | |||
/** | |||
Reporting work status(上报工作状态) | |||
@param model Working state model(工作状态模型) | |||
*/ | |||
-(void)brushBleManagerReceiveWorkState:(AiBrushWorkStateModel *)model; | |||
/** | |||
Report power status(上报电源状态) | |||
@param model Power state model(电源状态模型) | |||
*/ | |||
-(void)brushBleManagerReceiveBatteryStateModel:(AiBrushBatteryStateModel *)model; | |||
/** | |||
Confirm receipt of disconnected Bluetooth connection request(确认收到断开蓝牙连接请求) | |||
*/ | |||
-(void)brushBleManagerReceiveDisconnectResult; | |||
/** | |||
Reporting device time(上报设备时间) | |||
@param time (时间) | |||
*/ | |||
-(void)brushBleManagerReceiveSystemTime:(int)time; | |||
/** | |||
Return to set device time results(返回设置设备时间结果) | |||
@param result (结果) | |||
1:Set device time to succeed(设置设备时间成功) | |||
2:Setting device time failed(设置设备时间失败) | |||
*/ | |||
-(void)brushBleManagerReceiveSetTimeResult:(int)result; | |||
/** | |||
Returns the number of historical data(返回历史数据条数) | |||
@param count Total historical data(历史数据总数) | |||
*/ | |||
-(void)brushBleManagerReceiveHistoryDataCount:(int)count; | |||
/** | |||
Cancel the reading of historical data operation results(取消读取历史数据操作结果) | |||
@param result (结果) | |||
1:Cancel the read successfully(取消读取成功) | |||
2:Cancel read failed(取消读取失败) | |||
*/ | |||
-(void)brushBleManagerReceiveCancelReadHistoryDataResult:(int)result; | |||
/** | |||
Delete historical data(删除历史数据) | |||
@param result (结果) | |||
1:successfully(删除成功) | |||
2:failed(删除失败) | |||
*/ | |||
-(void)brushBleManagerReceiveDeleteHistoryDataResult:(int)result; | |||
/** | |||
Callback historical data(回调历史数据) | |||
@param model Historical data model(历史数据模型) | |||
*/ | |||
-(void)brushBleManagerReceiveHistoryDataModel:(AiBrushWorkDataModel *)model; | |||
/** | |||
Callback work data(回调工作数据) | |||
@param model Data model(数据模型) | |||
*/ | |||
-(void)brushBleManagerReceiveWorkDataModel:(AiBrushWorkDataModel *)model; | |||
/** | |||
Reporting Sensor data(上报 Sensor 数据) | |||
@param model (数据模型) | |||
*/ | |||
-(void)brushBleManagerReceiveGsensorDataModel:(AiBrushGsensorModel *)model; | |||
/** | |||
Reporting strength data(上报力度相关数据) | |||
@param model (数据模型) | |||
*/ | |||
-(void)brushBleManagerReceiveStrengthDataModel:(AiBrushStrengthModel *)model; | |||
/** | |||
Report button to confirm the app connection status | |||
1----Key action confirmation App connection is valid, 2----App requires button confirmation, 3----App is valid without key confirmation(上报按键确认 App 连接状态 | |||
1----按键动作确认 App 连接有效,2----App 需要按键确认,3----App 有效不需要按键确认) | |||
@param state (连接状态) | |||
*/ | |||
-(void)brushBleManagerReceiveConnectState:(int)state; | |||
/** | |||
Callback brushing mode gear(回调刷牙模式档位) | |||
@param oneGear (一级档位) | |||
@param twoGear (二级档位) | |||
*/ | |||
- (void)brushBleManagerReturnOneGearMode:(NSArray<NSNumber *> *)oneGear twoGearMode:(NSArray<NSNumber *> *)twoGear; | |||
/** | |||
Set DID results(设置DID结果) | |||
@param result (结果) | |||
YES:successfully(成功) | |||
NO:failed(失败) | |||
*/ | |||
-(void)brushBleManagerReturnSetDIDResult:(BOOL)result; | |||
/** | |||
Set the Name result(设置Name结果) | |||
@param result (结果) | |||
YES:successfully(成功) | |||
NO:failed(失败) | |||
*/ | |||
-(void)brushBleManagerReturnSetNameResult:(BOOL)result; | |||
/** | |||
Return to OTA upgrade progress(返回OTA升级进度) | |||
@param progress (升级进度) | |||
*/ | |||
-(void)brushBleManagerReturnOTAUpdateProgress:(double)progress; | |||
/** | |||
Return OTA upgrade results(返回OTA升级结果) | |||
@param result (结果) | |||
*/ | |||
-(void)brushBleManagerOTAUpdateResult:(BOOL)result; | |||
@end | |||
@interface AiBrushBleManager : NSObject | |||
// | |||
@property (nonatomic, weak) id<AiBrushBleManagerDelegate> delegate; | |||
//Bluetooth is available(蓝牙是否可用) | |||
@property (nonatomic, assign, readonly) BOOL isOn; | |||
//Bluetooth status(蓝牙状态) | |||
@property (nonatomic, assign, readonly) AiBrushBleState state; | |||
//当前是否在工作 | |||
@property (nonatomic, assign,readonly) BOOL isWorking; | |||
//Version(版本号) | |||
@property (nonatomic, copy ,readonly) NSString *version; | |||
//Toothbrush version type(牙刷版本类型) | |||
@property (nonatomic, assign, readonly) AiBrushVersionType versionType; | |||
//Bluetooth is connected(蓝牙是否连接) | |||
@property (nonatomic, assign, readonly) BOOL isConnect; | |||
//First gear position of the toothbrush(牙刷的一级档位) | |||
@property (nonatomic, copy,readonly) NSArray<NSNumber *> *oneGearArray; | |||
//Second gear of the toothbrush(牙刷的二级档位) | |||
@property (nonatomic, copy,readonly) NSArray<NSNumber *> *twoGearArray; | |||
+(void)setAppKey:(NSString *)key appSecret:(NSString *)secret; | |||
// | |||
+(instancetype)shareManager; | |||
//Get the version number(获取版本号) | |||
-(NSString *)sdkVersion; | |||
//Start scanning(开始扫描) | |||
-(void)startScan; | |||
//Stop scanning(停止扫描) | |||
-(void)stopScan; | |||
//Connecting device(连接设备) | |||
-(void)connectPeripheral:(CBPeripheral *)peripheral; | |||
-(void)connectPeripheralWithMac:(NSString *)mac; | |||
//Disconnect(断开连接) | |||
-(void)disconnectPeripheral; | |||
/** | |||
Set brushing mode | |||
For details on the mode settings, please see the agreement description.(设置刷牙模式 | |||
关于模式设置的详细资料,请查看协议说明) | |||
@param byte Must pass 4 bytes of data(必须传4个byte的数据) | |||
*/ | |||
-(void)setBrushModeWithByte:(Byte[_Nonnull])byte; | |||
/** | |||
Query work status(查询工作状态) | |||
*/ | |||
-(void)queryWorkState; | |||
/** | |||
Query power status(查询电源状态) | |||
*/ | |||
-(void)queryBatteryState; | |||
/** | |||
Switching work status(切换工作状态) | |||
*/ | |||
-(void)changeWorkState; | |||
/** | |||
Query device time(查询设备时间) | |||
*/ | |||
-(void)querySystemTime; | |||
/** | |||
Set system time(设置系统时间) | |||
*/ | |||
-(void)setSystemTime; | |||
/** | |||
Reading historical data(读取历史数据) | |||
*/ | |||
-(void)queryHistoryData; | |||
/** | |||
Cancel reading historical data(取消读取历史数据) | |||
*/ | |||
-(void)cancelReadHistoryData; | |||
/** | |||
Delete historical data(删除历史数据) | |||
*/ | |||
-(void)deleteHistoryData; | |||
//Request gear information(请求档位信息) | |||
-(void)queryGear; | |||
//Set theid:0~65535, please refer to "蓝牙电动牙刷厂商型号列表"(设置did:0~65535,请参考《蓝牙电动牙刷厂商型号列表》) | |||
-(void)setDID:(int)did; | |||
//Set the Bluetooth name(设置蓝牙名称) | |||
-(void)setName:(NSString *)name; | |||
/** | |||
OTA upgrade(OTA升级) | |||
@param fileStr file path(文件路径) | |||
*/ | |||
- (void)OTAUpdate:(NSURL *)fileStr; | |||
/** | |||
Restart the device after the upgrade is successful.(升级成功后重启设备) | |||
*/ | |||
- (void)rebootDevice; | |||
@end | |||
NS_ASSUME_NONNULL_END |
@@ -0,0 +1,34 @@ | |||
// | |||
// AiBrushGsensorModel.h | |||
// AiBrushBleSDK | |||
// | |||
// Created by iot_user on 2019/7/11. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#import <Foundation/Foundation.h> | |||
NS_ASSUME_NONNULL_BEGIN | |||
@interface AiBrushGsensorModel : NSObject | |||
//Gsensor X | |||
@property (nonatomic, assign) int16_t x; | |||
//Gsensor Y | |||
@property (nonatomic, assign) int16_t y; | |||
//Gsensor Z | |||
@property (nonatomic, assign) int16_t z; | |||
//Gsensor X | |||
@property (nonatomic, assign) int16_t xChange; | |||
//Gsensor Y | |||
@property (nonatomic, assign) int16_t yChange; | |||
//Gsensor Z | |||
@property (nonatomic, assign) int16_t zChange; | |||
//Gsensor XYZ | |||
@property (nonatomic, assign) int16_t xyzChange; | |||
//Gsensor XYZ | |||
@property (nonatomic, assign) Byte xyzDirection; | |||
@end | |||
NS_ASSUME_NONNULL_END |
@@ -0,0 +1,32 @@ | |||
// | |||
// AiBrushPeripheralModel.h | |||
// AiBrushBleSDK | |||
// | |||
// Created by iot_user on 2019/7/3. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#import <Foundation/Foundation.h> | |||
#import <CoreBluetooth/CoreBluetooth.h> | |||
NS_ASSUME_NONNULL_BEGIN | |||
@interface AiBrushPeripheralModel : NSObject | |||
@property (nonatomic, assign) int productType;//Product category: 00,01,02~07(产品类别:00,01,02~07) | |||
@property (nonatomic, assign) int year; | |||
@property (nonatomic, assign) int month; | |||
@property (nonatomic, assign) int day; | |||
@property (nonatomic, copy) NSString *version; //Firmware version number 2.0(固件版本号2.0) | |||
@property (nonatomic, assign) int vendorID;//Manufacturer ID | |||
@property (nonatomic, assign) int classID;//Model number | |||
@property (nonatomic, copy) NSString *macAddress;//MAC address | |||
@property (nonatomic, strong) CBPeripheral *peripheral; | |||
@property (nonatomic, assign) int rssi; | |||
@property (nonatomic, copy) NSString *peripheralName; | |||
@end | |||
NS_ASSUME_NONNULL_END |
@@ -0,0 +1,34 @@ | |||
// | |||
// AiBrushStrengthModel.h | |||
// AiBrushBleSDK | |||
// | |||
// Created by iot_user on 2019/7/11. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#import <Foundation/Foundation.h> | |||
NS_ASSUME_NONNULL_BEGIN | |||
@interface AiBrushStrengthModel : NSObject | |||
//voltage(电压) | |||
@property (nonatomic, assign) int voltage; | |||
//frequency(频率) | |||
@property (nonatomic, assign) Byte frequency; | |||
//duty(占空比) | |||
@property (nonatomic, assign) Byte duty; | |||
//measure Value(测量值) | |||
@property (nonatomic, assign) int measureValue; | |||
//theory Value(理论值) | |||
@property (nonatomic, assign) int theoryValue; | |||
//initial Value(初始值) | |||
@property (nonatomic, assign) int initialValue; | |||
//Measured value and theoretical value error(测量值与理论值误差) | |||
@property (nonatomic, assign) Byte error; | |||
//Excessive pressure sign(压力过大标志) | |||
@property (nonatomic, assign) Byte mark; | |||
@end | |||
NS_ASSUME_NONNULL_END |
@@ -0,0 +1,76 @@ | |||
// | |||
// AiBrushWorkDataModel.h | |||
// AiBrushBleSDK | |||
// | |||
// Created by iot_user on 2019/7/11. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#import <Foundation/Foundation.h> | |||
#import "AiBrushBleHeader.h" | |||
NS_ASSUME_NONNULL_BEGIN | |||
@interface AiBrushWorkDataModel : NSObject | |||
/** | |||
Data number(数据编号) | |||
-1:Representation is work data(表示是工作数据) | |||
Other: indicates historical data(其他:表示是历史数据) | |||
*/ | |||
@property (nonatomic, assign) int dataNumber; | |||
/** | |||
Brushing mode(刷牙模式) | |||
*/ | |||
@property (nonatomic, assign) AiBrushSupportBrushMode brushMode; | |||
//Custom mode or frequency(自定义模式或频率) | |||
/* | |||
When brushMode = AiBrushSupportBrushMode_Preset, it is represented as a custom number (1~5 corresponds to custom mode 1 - 5); | |||
When brushMode = AiBrushSupportBrushMode_Custom, it is expressed as frequency (1~8 files corresponding to 180HZ-320HZ); | |||
0x00 means default | |||
(当 brushMode = AiBrushSupportBrushMode_Preset 时,表示为自定义编号(1~5 对应自定义模式 1 - 5); | |||
当 brushMode = AiBrushSupportBrushMode_Custom 时,表示为频率(1~8 档对应 180HZ-320HZ); | |||
为0x00表示默认) | |||
*/ | |||
@property (nonatomic, assign) Byte modeOrFrequency; | |||
//Duty cycle (1~8 file corresponds to 30%-100%), 0x00 means default(占空比(1~8 档对应 30%-100%),为0x00表示默认) | |||
@property (nonatomic, assign) Byte duty; | |||
//work time(工作时长) | |||
//持续时间(单位:S):0x01----60s,0x02----70s,0x03----80s,0x04----90s,0x05----100s,......,0x18----290s,0x19----300s; | |||
@property (nonatomic, assign) Byte workTime; | |||
/** | |||
Start time (unit: s)(开始时间(单位:s)) | |||
*/ | |||
@property (nonatomic, assign) int startTime; | |||
/** | |||
work time(工作时长) | |||
*/ | |||
@property (nonatomic, assign) int workDuration; | |||
/** | |||
Excessive force(力度过大次数) | |||
*/ | |||
@property (nonatomic, assign) int strengthCount; | |||
/** | |||
Excessive strength(力度过大时长) | |||
*/ | |||
@property (nonatomic, assign) int strengthTime; | |||
/** | |||
Length of brushing on the left(左边刷牙时长) | |||
*/ | |||
@property (nonatomic, assign) int leftTime; | |||
/** | |||
Brushing time on the right(右边刷牙时长) | |||
*/ | |||
@property (nonatomic, assign) int rightTime; | |||
@end | |||
NS_ASSUME_NONNULL_END |
@@ -0,0 +1,61 @@ | |||
// | |||
// AiBrushWorkStateModel.h | |||
// AiBrushBleSDK | |||
// | |||
// Created by iot_user on 2019/7/9. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#import <Foundation/Foundation.h> | |||
#import "AiBrushBleHeader.h" | |||
//Working status(工作状态) | |||
typedef NS_ENUM(NSUInteger, AiBrushWorkState) { | |||
AiBrushWorkStateInit = 0x00, //Work initialization(工作初始化) | |||
AiBrushWorkStateStart = 0x01, //Work start(工作启动) | |||
AiBrushWorkStateEnd = 0x02, //End of work(工作结束) | |||
AiBrushWorkStateLowPower = 0x03, //Low power, no opening(低电,禁止开启) | |||
AiBrushWorkStateInCharge = 0x04, //Do not turn on during charging(充电中,禁止开启) | |||
}; | |||
//Efforts(力度) | |||
typedef NS_ENUM(NSUInteger, AiBrushEffortsType) { | |||
AiBrushEffortsTypeNormal = 0x00, //Normal strength(力度正常) | |||
AiBrushEffortsTypeTooMuch = 0x01, //Too strong(力度过大) | |||
}; | |||
//工作节点 | |||
typedef NS_ENUM(NSUInteger, AiBrushWorkNodeType) { | |||
AiBrushWorkNodeTypePhaseOneBegin = 0x00, //Phase 1 start(阶段一起始) | |||
AiBrushWorkNodeTypePhaseTwoBegin = 0x01, //Phase 2 start(阶段二起始) | |||
AiBrushWorkNodeTypePhaseThreeBegin = 0x02, //Phase 3 start(阶段三起始) | |||
AiBrushWorkNodeTypePhaseFourBegin = 0x03, //Phase 4 start(阶段四起始) | |||
AiBrushWorkNodeTypePhaseEnd = 0x04, //End of phase(阶段结束) | |||
}; | |||
NS_ASSUME_NONNULL_BEGIN | |||
@interface AiBrushWorkStateModel : NSObject | |||
//Working status(工作状态) | |||
@property (nonatomic, assign) AiBrushWorkState workState; | |||
//Brushing mode(刷牙模式) | |||
@property (nonatomic, assign) AiBrushSupportBrushMode brushMode; | |||
//Custom mode or frequency(自定义模式或频率) | |||
/* | |||
When brushMode = AiBrushSupportBrushMode_Preset, it is represented as a custom number (1~5 corresponds to custom mode 1 - 5); | |||
When brushMode = AiBrushSupportBrushMode_Custom, it is expressed as frequency (1~8 files corresponding to 180HZ-320HZ); | |||
( 当 brushMode = AiBrushSupportBrushMode_Preset 时,表示为自定义编号(1~5 对应自定义模式 1 - 5); | |||
当 brushMode = AiBrushSupportBrushMode_Custom 时,表示为频率(1~8 档对应 180HZ-320HZ);) | |||
*/ | |||
@property (nonatomic, assign) Byte modeOrFrequency; | |||
//Duty cycle (1~8 files corresponds to 30%-100%)(占空比(1~8 档对应 30%-100%)) | |||
@property (nonatomic, assign) Byte duty; | |||
//持续时间(单位:S):0x01----60s,0x02----70s,0x03----80s,0x04----90s,0x05----100s,......,0x18----290s,0x19----300s; | |||
@property (nonatomic, assign) Byte workTime; | |||
//Strength type(力度) | |||
@property (nonatomic, assign) AiBrushEffortsType effortsType; | |||
//Working node(工作节点) | |||
@property (nonatomic, assign) AiBrushWorkNodeType nodeType; | |||
@end | |||
NS_ASSUME_NONNULL_END |
@@ -0,0 +1,17 @@ | |||
// | |||
// AppDelegate.h | |||
// AiBrushBleSDKDemo | |||
// | |||
// Created by iot_user on 2019/7/15. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#import <UIKit/UIKit.h> | |||
@interface AppDelegate : UIResponder <UIApplicationDelegate> | |||
@property (strong, nonatomic) UIWindow *window; | |||
@end | |||
@@ -0,0 +1,53 @@ | |||
// | |||
// AppDelegate.m | |||
// AiBrushBleSDKDemo | |||
// | |||
// Created by iot_user on 2019/7/15. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#import "AppDelegate.h" | |||
#import <AiBrushBleSDK/AiBrushBleManager.h> | |||
@interface AppDelegate () | |||
@end | |||
@implementation AppDelegate | |||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |||
// Override point for customization after application launch. | |||
[AiBrushBleManager setAppKey:@"577d111949f5f239" appSecret:@"00859f5eb4de23078295757f12"]; | |||
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 invalidate graphics rendering callbacks. 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 active 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 |
@@ -0,0 +1,23 @@ | |||
// | |||
// AppTool.h | |||
// AiBrushBleSDK | |||
// | |||
// Created by iot_user on 2019/7/8. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#import <Foundation/Foundation.h> | |||
#import <UIKit/UIKit.h> | |||
#define TopMargin ([AppTool getKeyWindowSafeAreaInsets].top) | |||
#define BtmMargin ([AppTool getKeyWindowSafeAreaInsets].bottom) | |||
NS_ASSUME_NONNULL_BEGIN | |||
@interface AppTool : NSObject | |||
+ (UIEdgeInsets)getKeyWindowSafeAreaInsets; | |||
@end | |||
NS_ASSUME_NONNULL_END |
@@ -0,0 +1,31 @@ | |||
// | |||
// AppTool.m | |||
// AiBrushBleSDK | |||
// | |||
// Created by iot_user on 2019/7/8. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#import "AppTool.h" | |||
#import "AppDelegate.h" | |||
@implementation AppTool | |||
+ (UIEdgeInsets)getKeyWindowSafeAreaInsets { | |||
UIEdgeInsets edge = UIEdgeInsetsZero; | |||
if (@available(iOS 11.0, *)) { | |||
edge = [UIApplication sharedApplication].keyWindow.safeAreaInsets; //iOS11以后刘海屏返回44 | |||
if (edge.top == 0) {//ios11以后的非刘海屏返回20 | |||
edge.top = 20; | |||
} | |||
} else {//ios11之前是没有刘海屏的,故直接返回20 | |||
edge = UIEdgeInsetsMake(20, 0, 0, 0); | |||
} | |||
return edge; | |||
} | |||
@end |
@@ -0,0 +1,98 @@ | |||
{ | |||
"images" : [ | |||
{ | |||
"idiom" : "iphone", | |||
"size" : "20x20", | |||
"scale" : "2x" | |||
}, | |||
{ | |||
"idiom" : "iphone", | |||
"size" : "20x20", | |||
"scale" : "3x" | |||
}, | |||
{ | |||
"idiom" : "iphone", | |||
"size" : "29x29", | |||
"scale" : "2x" | |||
}, | |||
{ | |||
"idiom" : "iphone", | |||
"size" : "29x29", | |||
"scale" : "3x" | |||
}, | |||
{ | |||
"idiom" : "iphone", | |||
"size" : "40x40", | |||
"scale" : "2x" | |||
}, | |||
{ | |||
"idiom" : "iphone", | |||
"size" : "40x40", | |||
"scale" : "3x" | |||
}, | |||
{ | |||
"idiom" : "iphone", | |||
"size" : "60x60", | |||
"scale" : "2x" | |||
}, | |||
{ | |||
"idiom" : "iphone", | |||
"size" : "60x60", | |||
"scale" : "3x" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"size" : "20x20", | |||
"scale" : "1x" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"size" : "20x20", | |||
"scale" : "2x" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"size" : "29x29", | |||
"scale" : "1x" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"size" : "29x29", | |||
"scale" : "2x" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"size" : "40x40", | |||
"scale" : "1x" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"size" : "40x40", | |||
"scale" : "2x" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"size" : "76x76", | |||
"scale" : "1x" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"size" : "76x76", | |||
"scale" : "2x" | |||
}, | |||
{ | |||
"idiom" : "ipad", | |||
"size" : "83.5x83.5", | |||
"scale" : "2x" | |||
}, | |||
{ | |||
"idiom" : "ios-marketing", | |||
"size" : "1024x1024", | |||
"scale" : "1x" | |||
} | |||
], | |||
"info" : { | |||
"version" : 1, | |||
"author" : "xcode" | |||
} | |||
} |
@@ -0,0 +1,6 @@ | |||
{ | |||
"info" : { | |||
"version" : 1, | |||
"author" : "xcode" | |||
} | |||
} |
@@ -0,0 +1,25 @@ | |||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> | |||
<dependencies> | |||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/> | |||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | |||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | |||
</dependencies> | |||
<scenes> | |||
<!--View Controller--> | |||
<scene sceneID="EHf-IW-A2E"> | |||
<objects> | |||
<viewController id="01J-lp-oVM" sceneMemberID="viewController"> | |||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> | |||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | |||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> | |||
</view> | |||
</viewController> | |||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> | |||
</objects> | |||
<point key="canvasLocation" x="53" y="375"/> | |||
</scene> | |||
</scenes> | |||
</document> |
@@ -0,0 +1,24 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> | |||
<dependencies> | |||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/> | |||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | |||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | |||
</dependencies> | |||
<scenes> | |||
<!--View Controller--> | |||
<scene sceneID="tne-QT-ifu"> | |||
<objects> | |||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController"> | |||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> | |||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | |||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> | |||
</view> | |||
</viewController> | |||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> | |||
</objects> | |||
</scene> | |||
</scenes> | |||
</document> |
@@ -0,0 +1,45 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |||
<plist version="1.0"> | |||
<dict> | |||
<key>CFBundleDevelopmentRegion</key> | |||
<string>$(DEVELOPMENT_LANGUAGE)</string> | |||
<key>CFBundleExecutable</key> | |||
<string>$(EXECUTABLE_NAME)</string> | |||
<key>CFBundleIdentifier</key> | |||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | |||
<key>CFBundleInfoDictionaryVersion</key> | |||
<string>6.0</string> | |||
<key>CFBundleName</key> | |||
<string>$(PRODUCT_NAME)</string> | |||
<key>CFBundlePackageType</key> | |||
<string>APPL</string> | |||
<key>CFBundleShortVersionString</key> | |||
<string>1.0</string> | |||
<key>CFBundleVersion</key> | |||
<string>1</string> | |||
<key>LSRequiresIPhoneOS</key> | |||
<true/> | |||
<key>NSBluetoothAlwaysUsageDescription</key> | |||
<string></string> | |||
<key>UILaunchStoryboardName</key> | |||
<string>LaunchScreen</string> | |||
<key>UIMainStoryboardFile</key> | |||
<string>Main</string> | |||
<key>UIRequiredDeviceCapabilities</key> | |||
<array> | |||
<string>armv7</string> | |||
</array> | |||
<key>UISupportedInterfaceOrientations</key> | |||
<array> | |||
<string>UIInterfaceOrientationPortrait</string> | |||
</array> | |||
<key>UISupportedInterfaceOrientations~ipad</key> | |||
<array> | |||
<string>UIInterfaceOrientationPortrait</string> | |||
<string>UIInterfaceOrientationPortraitUpsideDown</string> | |||
<string>UIInterfaceOrientationLandscapeLeft</string> | |||
<string>UIInterfaceOrientationLandscapeRight</string> | |||
</array> | |||
</dict> | |||
</plist> |
@@ -0,0 +1,15 @@ | |||
// | |||
// ViewController.h | |||
// AiBrushBleSDK | |||
// | |||
// Created by iot_user on 2019/7/3. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#import <UIKit/UIKit.h> | |||
@interface ViewController : UIViewController | |||
@end | |||
@@ -0,0 +1,373 @@ | |||
// | |||
// ViewController.m | |||
// AiBrushBleSDK | |||
// | |||
// Created by iot_user on 2019/7/3. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#import "ViewController.h" | |||
#import <AiBrushBleSDK/AiBrushBleManager.h> | |||
#import "AppTool.h" | |||
@interface ViewController ()<AiBrushBleManagerDelegate,UITableViewDelegate,UITableViewDataSource> | |||
@property (nonatomic, strong) UITableView *tableView; | |||
@property (nonatomic, copy) NSArray<AiBrushPeripheralModel *> *devices; | |||
@property (nonatomic, strong) UIView *headerView; | |||
@property (nonatomic, strong) UIView *barView; | |||
@property (nonatomic, strong) UIView *footerView; | |||
@end | |||
@implementation ViewController | |||
- (void)viewDidLoad { | |||
[super viewDidLoad]; | |||
[AiBrushBleManager shareManager].delegate = self; | |||
[[AiBrushBleManager shareManager] startScan]; | |||
// | |||
[self.view addSubview:self.barView]; | |||
// | |||
[self.view addSubview:self.tableView]; | |||
} | |||
#pragma mark ============ AiBrushBleManagerDelegate ============== | |||
-(void)brushBleManagerOTAUpdateResult:(BOOL)result{ | |||
NSLog(@"brushBleManagerOTAUpdateResult = %d",result); | |||
} | |||
-(void)brushBleManagerReturnOTAUpdateProgress:(double)progress{ | |||
NSLog(@"brushBleManagerReturnOTAUpdateProgress = %f",progress); | |||
} | |||
-(void)brushBleManagerReturnSetDIDResult:(BOOL)result{ | |||
NSLog(@"brushBleManagerReturnSetDIDResult = %d",result); | |||
} | |||
-(void)brushBleManagerReturnSetNameResult:(BOOL)result{ | |||
NSLog(@"brushBleManagerReturnSetNameResult = %d",result); | |||
} | |||
-(void)brushBleManagerReturnOneGearMode:(NSArray<NSNumber *> *)oneGear twoGearMode:(NSArray<NSNumber *> *)twoGear{ | |||
NSLog(@"oneGear = %@-----twoGear = %@",oneGear,twoGear); | |||
} | |||
-(void)brushBleManagerReceiveConnectState:(int)state{ | |||
NSLog(@"brushBleManagerReceiveConnectState = %d",state); | |||
if (state == 1 || state == 3) { | |||
//获取第档位信息 | |||
[[AiBrushBleManager shareManager] queryGear]; | |||
} | |||
} | |||
-(void)brushBleManagerReceiveStrengthDataModel:(AiBrushStrengthModel *)model{ | |||
NSLog(@"brushBleManagerReceiveStrengthDataModel = %@",model.description); | |||
} | |||
-(void)brushBleManagerReceiveGsensorDataModel:(AiBrushGsensorModel *)model{ | |||
NSLog(@"x=%d---y=%d---z=%d---xChange=%d---yChange=%d---zChange=%d",model.x,model.y,model.z,model.xChange,model.yChange,model.zChange); | |||
} | |||
-(void)brushBleManagerReceiveWorkDataModel:(AiBrushWorkDataModel *)model{ | |||
NSLog(@"dataNumber:%d---leftTime:%d---brushMode:%lu---duty:%d---workTime:%d---startTime:%d---workDuration:%d",model.dataNumber,model.leftTime,(unsigned long)model.brushMode,model.duty,model.workTime,model.startTime,model.workDuration); | |||
} | |||
-(void)brushBleManagerReceiveHistoryDataModel:(AiBrushWorkDataModel *)model{ | |||
NSLog(@"dataNumber:%d---leftTime:%d---brushMode:%lu---duty:%d---workTime:%d---startTime:%d---workDuration:%d",model.dataNumber,model.leftTime,(unsigned long)model.brushMode,model.duty,model.workTime,model.startTime,model.workDuration); | |||
} | |||
-(void)brushBleManagerReceiveHistoryDataCount:(int)count{ | |||
NSLog(@"brushBleManagerReceiveHistoryDataCount = %d",count); | |||
} | |||
-(void)brushBleManagerReceiveSetTimeResult:(int)result{ | |||
NSLog(@"brushBleManagerReceiveSetTimeResult = %d",result); | |||
} | |||
-(void)brushBleManagerReceiveSystemTime:(int)time{ | |||
NSLog(@"brushBleManagerReceiveSystemTime = %d",time); | |||
} | |||
-(void)brushBleManagerReceiveDisconnectResult{ | |||
NSLog(@"断开连接"); | |||
} | |||
-(void)brushBleManagerReceiveBatteryStateModel:(AiBrushBatteryStateModel *)model{ | |||
NSLog(@"brushBleManagerReceiveBatteryStateModel = voltage:%d--peakCurrent:%d--percentCharge:%d",model.voltage,model.peakCurrent,model.percentCharge); | |||
} | |||
-(void)brushBleManagerReceiveWorkState:(AiBrushWorkStateModel *)model{ | |||
NSLog(@"brushBleManagerReceiveWorkState = workState:%d--brushMode:%lu--modeOrFrequency:%d--workTime:%d--duty:%d",model.workState,(unsigned long)model.brushMode,model.modeOrFrequency,model.workTime,model.duty); | |||
} | |||
-(void)brushBleManagerReceiveSetModeResult:(AiBrushSetModeResult)result{ | |||
NSLog(@"SetModeResult = %lu",(unsigned long)result); | |||
} | |||
-(void)brushBleManagerUpdateBleState:(AiBrushBleState)state{ | |||
if (state == AiBrushBleStateAvailable) { | |||
self.tableView.tableHeaderView = [UIView new]; | |||
self.tableView.tableFooterView = [UIView new]; | |||
[self.tableView reloadData]; | |||
}else if (state == AiBrushBleStateUnavailable){ | |||
self.devices = nil; | |||
self.tableView.tableHeaderView = self.headerView; | |||
self.tableView.tableFooterView = [UIView new]; | |||
[self.tableView reloadData]; | |||
}else if (state == AiBrushBleStateDidUpdateCharacteristicState){ | |||
self.devices = nil; | |||
self.tableView.tableFooterView = self.footerView; | |||
self.tableView.tableHeaderView = [UIView new]; | |||
[self.tableView reloadData]; | |||
}else if (state == AiBrushBleStateConnectFail || state == AiBrushBleStateDidDisconnect){ | |||
[[AiBrushBleManager shareManager] startScan]; | |||
self.tableView.tableHeaderView = [UIView new]; | |||
self.tableView.tableFooterView = [UIView new]; | |||
self.devices = nil; | |||
[self.tableView reloadData]; | |||
} | |||
} | |||
-(void)brushBleManagerScanedPeripherals:(NSArray<AiBrushPeripheralModel *> *)peripheralList{ | |||
NSLog(@"brushBleManagerScanedPeripherals = %ld",peripheralList.count); | |||
self.devices = peripheralList; | |||
[self.tableView reloadData]; | |||
} | |||
#pragma mark ============ tableView代理 ============== | |||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ | |||
return self.devices.count; | |||
} | |||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ | |||
return 50; | |||
} | |||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ | |||
static NSString *cellID = @"cellID"; | |||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; | |||
if (!cell) { | |||
cell = [[UITableViewCell alloc] initWithStyle:(UITableViewCellStyleValue1) reuseIdentifier:cellID]; | |||
} | |||
AiBrushPeripheralModel *model = self.devices[indexPath.row]; | |||
cell.textLabel.text = model.peripheralName; | |||
cell.detailTextLabel.text = model.macAddress; | |||
return cell; | |||
} | |||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ | |||
AiBrushPeripheralModel *model = self.devices[indexPath.row]; | |||
[[AiBrushBleManager shareManager] connectPeripheral:model.peripheral]; | |||
} | |||
- (UITableView *)tableView{ | |||
if (_tableView == nil) { | |||
_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.barView.frame), self.view.frame.size.width, self.view.frame.size.height-self.barView.frame.size.height)]; | |||
_tableView.delegate = self; | |||
_tableView.dataSource = self; | |||
} | |||
return _tableView; | |||
} | |||
-(UIView *)headerView{ | |||
if (_headerView == nil) { | |||
_headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, self.tableView.frame.size.height)]; | |||
UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, _headerView.frame.size.width, _headerView.frame.size.height)]; | |||
lable.text = @"请打开蓝牙"; | |||
lable.textColor = [UIColor redColor]; | |||
lable.font = [UIFont systemFontOfSize:35]; | |||
lable.textAlignment = NSTextAlignmentCenter; | |||
[_headerView addSubview:lable]; | |||
} | |||
return _headerView; | |||
} | |||
- (UIView *)barView{ | |||
if (_barView == nil) { | |||
_barView = [[UIView alloc] init]; | |||
_barView.frame = CGRectMake(0, 0, self.view.frame.size.width, 44+TopMargin); | |||
UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, _barView.frame.size.width, _barView.frame.size.height)]; | |||
lable.text = @"扫描到的设备"; | |||
lable.textColor = [UIColor blackColor]; | |||
lable.font = [UIFont systemFontOfSize:18]; | |||
lable.textAlignment = NSTextAlignmentCenter; | |||
[_barView addSubview:lable]; | |||
} | |||
return _barView; | |||
} | |||
-(void)button1Action:(UIButton *)sender{ | |||
[[AiBrushBleManager shareManager] setDID:100]; | |||
} | |||
-(void)button2Action:(UIButton *)sender{ | |||
NSArray *titles = @[@"Clean",@"White",@"Massage",@"Sensitive",@"Custom",@"Polish",@"GumCare",@"Refresh",@"Mascare",@"Soft"]; | |||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Pick Mode" message:nil preferredStyle:(UIAlertControllerStyleAlert)]; | |||
for (int i=0; i<titles.count; i++) { | |||
UIAlertAction *action = [UIAlertAction actionWithTitle:titles[i] style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) { | |||
Byte mode = 0x01; | |||
if (i==0) { | |||
mode = 0x01; | |||
}else if (i==1){ | |||
mode = 0x02; | |||
}else if (i==2){ | |||
mode = 0x03; | |||
}else if (i==3){ | |||
mode = 0x04; | |||
}else if (i==4){ | |||
mode = 0x06; | |||
}else if (i==5){ | |||
mode = 0x07; | |||
}else if (i==6){ | |||
mode = 0x08; | |||
}else if (i==7){ | |||
mode = 0x09; | |||
}else if (i==8){ | |||
mode = 0x0a; | |||
}else if (i==9){ | |||
mode = 0x0b; | |||
} | |||
[self setBrushMode:mode]; | |||
}]; | |||
[alert addAction:action]; | |||
} | |||
[self presentViewController:alert animated:YES completion:nil]; | |||
} | |||
-(void)setBrushMode:(Byte)mode{ | |||
// Byte b[4] = {0x03,0x00,0x00,0x16}; | |||
// | |||
// [[AiBrushBleManager shareManager] setBrushModeWithByte:b]; | |||
if (mode == 0x06){ | |||
Byte b[4] = {0x06,0x02,0x03,0x16}; | |||
[[AiBrushBleManager shareManager] setBrushModeWithByte:b]; | |||
}else{ | |||
if ([[AiBrushBleManager shareManager].oneGearArray containsObject:[NSNumber numberWithChar:mode]]) { | |||
Byte dataByte[] = {mode,0x00,0x00,0x16}; | |||
[[AiBrushBleManager shareManager] setBrushModeWithByte:dataByte]; | |||
}else{ | |||
if (mode == 0x07 || mode == 0x08 || mode == 0x09 || mode == 0x0A || mode == 0x0B ) { | |||
if ([AiBrushBleManager shareManager].versionType == AiBrushVersionTypeBY01 || [AiBrushBleManager shareManager].versionType == AiBrushVersionTypeBY02 || [AiBrushBleManager shareManager].versionType == AiBrushVersionTypeBY03 || [AiBrushBleManager shareManager].versionType == AiBrushVersionTypeBY04) { | |||
Byte modeIDByte=0x00; | |||
if (mode == 0x07) { | |||
modeIDByte = 0x01; | |||
}else if (mode == 0x08){ | |||
modeIDByte = 0x02; | |||
}else if (mode == 0x09){ | |||
modeIDByte = 0x03; | |||
}else if (mode == 0x0A){ | |||
modeIDByte = 0x04; | |||
}else if (mode == 0x0B){ | |||
modeIDByte = 0x05; | |||
} | |||
Byte dataByte[] = {0x05,modeIDByte,0x00,0x16}; | |||
[[AiBrushBleManager shareManager] setBrushModeWithByte:dataByte]; | |||
}else{ | |||
Byte dataByte[] = {mode,0x00,0x00,0x16}; | |||
[[AiBrushBleManager shareManager] setBrushModeWithByte:dataByte]; | |||
} | |||
}else{ | |||
Byte dataByte[] = {mode,0x00,0x00,0x16}; | |||
[[AiBrushBleManager shareManager] setBrushModeWithByte:dataByte]; | |||
} | |||
} | |||
} | |||
} | |||
-(void)button3Action:(UIButton *)sender{ | |||
[[AiBrushBleManager shareManager] queryWorkState]; | |||
} | |||
-(void)button4Action:(UIButton *)sender{ | |||
[[AiBrushBleManager shareManager] queryBatteryState]; | |||
} | |||
-(void)button5Action:(UIButton *)sender{ | |||
[[AiBrushBleManager shareManager] changeWorkState]; | |||
} | |||
-(void)button6Action:(UIButton *)sender{ | |||
[[AiBrushBleManager shareManager] disconnectPeripheral]; | |||
} | |||
-(void)button7Action:(UIButton *)sender{ | |||
[[AiBrushBleManager shareManager] querySystemTime]; | |||
} | |||
-(void)button8Action:(UIButton *)sender{ | |||
[[AiBrushBleManager shareManager] setSystemTime]; | |||
} | |||
-(void)button9Action:(UIButton *)sender{ | |||
[[AiBrushBleManager shareManager] queryHistoryData]; | |||
} | |||
-(void)button10Action:(UIButton *)sender{ | |||
[[AiBrushBleManager shareManager] setName:@"Elink"]; | |||
} | |||
-(void)button11Action:(UIButton *)sender{ | |||
//获取本地img文件 | |||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |||
NSString *publicDocumentsDir = [paths objectAtIndex:0]; | |||
NSError *error; | |||
NSFileManager *fm = [NSFileManager defaultManager]; | |||
NSString *currentPath; | |||
currentPath = [publicDocumentsDir stringByAppendingPathComponent:@"toothbrush_20170115_V1.3.img"]; | |||
BOOL isExist = [fm fileExistsAtPath:currentPath]; | |||
if (!isExist) { | |||
NSString *backUpdapath = [[NSBundle mainBundle] pathForResource:@"toothbrush_20170115_V1.3" ofType:@"img"]; | |||
BOOL cp = [fm copyItemAtPath:backUpdapath toPath:currentPath error:&error]; | |||
if (cp) { | |||
NSLog(@"数据库拷贝成功==%@",currentPath); | |||
NSURL *url = [NSURL URLWithString:currentPath]; | |||
[[AiBrushBleManager shareManager] OTAUpdate:url]; | |||
}else{ | |||
NSLog(@"数据库拷贝失败"); | |||
} | |||
}else{ | |||
NSURL *url = [NSURL URLWithString:currentPath]; | |||
[[AiBrushBleManager shareManager] OTAUpdate:url]; | |||
} | |||
} | |||
-(UIView *)footerView{ | |||
if (_footerView == nil) { | |||
_footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, self.tableView.frame.size.height)]; | |||
// | |||
UIButton *button1 = [self createButtonWithTitle:@"Set DID" withFrame:CGRectMake(10, 10, 100, 30)]; | |||
[button1 addTarget:self action:@selector(button1Action:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[_footerView addSubview:button1]; | |||
// | |||
UIButton *button2 = [self createButtonWithTitle:@"Set Mode" withFrame:CGRectMake(120, 10, 100, 30)]; | |||
[button2 addTarget:self action:@selector(button2Action:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[_footerView addSubview:button2]; | |||
// | |||
// | |||
UIButton *button3 = [self createButtonWithTitle:@"Query work state" withFrame:CGRectMake(240, 10, 100, 30)]; | |||
[button3 addTarget:self action:@selector(button3Action:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[_footerView addSubview:button3]; | |||
// | |||
UIButton *button4 = [self createButtonWithTitle:@"Query battery state" withFrame:CGRectMake(10, 50, 100, 30)]; | |||
[button4 addTarget:self action:@selector(button4Action:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[_footerView addSubview:button4]; | |||
// | |||
UIButton *button5 = [self createButtonWithTitle:@"Switch Work State" withFrame:CGRectMake(120, 50, 100, 30)]; | |||
[button5 addTarget:self action:@selector(button5Action:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[_footerView addSubview:button5]; | |||
// | |||
UIButton *button6 = [self createButtonWithTitle:@"Disconnect" withFrame:CGRectMake(240, 50, 100, 30)]; | |||
[button6 addTarget:self action:@selector(button6Action:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[_footerView addSubview:button6]; | |||
// | |||
UIButton *button7 = [self createButtonWithTitle:@"Query system time" withFrame:CGRectMake(10, 90, 100, 30)]; | |||
[button7 addTarget:self action:@selector(button7Action:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[_footerView addSubview:button7]; | |||
// | |||
UIButton *button8 = [self createButtonWithTitle:@"Set system time" withFrame:CGRectMake(120, 90, 100, 30)]; | |||
[button8 addTarget:self action:@selector(button8Action:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[_footerView addSubview:button8]; | |||
// | |||
UIButton *button9 = [self createButtonWithTitle:@"Query History Count" withFrame:CGRectMake(240, 90, 100, 30)]; | |||
[button9 addTarget:self action:@selector(button9Action:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[_footerView addSubview:button9]; | |||
// | |||
// | |||
UIButton *button10 = [self createButtonWithTitle:@"Set Name" withFrame:CGRectMake(10, 130, 100, 30)]; | |||
[button10 addTarget:self action:@selector(button10Action:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[_footerView addSubview:button10]; | |||
// | |||
UIButton *button11 = [self createButtonWithTitle:@"OTA Update" withFrame:CGRectMake(120, 130, 100, 30)]; | |||
[button11 addTarget:self action:@selector(button11Action:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[_footerView addSubview:button11]; | |||
} | |||
return _footerView; | |||
} | |||
-(UIButton *)createButtonWithTitle:(NSString *)title withFrame:(CGRect)frame{ | |||
UIButton *button = [UIButton buttonWithType:(UIButtonTypeCustom)]; | |||
button.frame = frame; | |||
[button setTitle:title forState:(UIControlStateNormal)]; | |||
[button setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)]; | |||
button.titleLabel.font = [UIFont systemFontOfSize:15]; | |||
button.backgroundColor = [UIColor redColor]; | |||
button.titleLabel.adjustsFontSizeToFitWidth = YES; | |||
button.titleLabel.numberOfLines=2; | |||
button.titleLabel.textAlignment = NSTextAlignmentCenter; | |||
return button; | |||
} | |||
@end |
@@ -0,0 +1,16 @@ | |||
// | |||
// main.m | |||
// AiBrushBleSDKDemo | |||
// | |||
// Created by iot_user on 2019/7/15. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#import <UIKit/UIKit.h> | |||
#import "AppDelegate.h" | |||
int main(int argc, char * argv[]) { | |||
@autoreleasepool { | |||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); | |||
} | |||
} |
@@ -0,0 +1,38 @@ | |||
// | |||
// AiBrushBleSDKDemoUITests.m | |||
// AiBrushBleSDKDemoUITests | |||
// | |||
// Created by iot_user on 2019/7/15. | |||
// Copyright © 2019 IOT. All rights reserved. | |||
// | |||
#import <XCTest/XCTest.h> | |||
@interface AiBrushBleSDKDemoUITests : XCTestCase | |||
@end | |||
@implementation AiBrushBleSDKDemoUITests | |||
- (void)setUp { | |||
// Put setup code here. This method is called before the invocation of each test method in the class. | |||
// In UI tests it is usually best to stop immediately when a failure occurs. | |||
self.continueAfterFailure = NO; | |||
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. | |||
[[[XCUIApplication alloc] init] launch]; | |||
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. | |||
} | |||
- (void)tearDown { | |||
// Put teardown code here. This method is called after the invocation of each test method in the class. | |||
} | |||
- (void)testExample { | |||
// Use recording to get started writing UI tests. | |||
// Use XCTAssert and related functions to verify your tests produce the correct results. | |||
} | |||
@end |
@@ -0,0 +1,22 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |||
<plist version="1.0"> | |||
<dict> | |||
<key>CFBundleDevelopmentRegion</key> | |||
<string>$(DEVELOPMENT_LANGUAGE)</string> | |||
<key>CFBundleExecutable</key> | |||
<string>$(EXECUTABLE_NAME)</string> | |||
<key>CFBundleIdentifier</key> | |||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | |||
<key>CFBundleInfoDictionaryVersion</key> | |||
<string>6.0</string> | |||
<key>CFBundleName</key> | |||
<string>$(PRODUCT_NAME)</string> | |||
<key>CFBundlePackageType</key> | |||
<string>BNDL</string> | |||
<key>CFBundleShortVersionString</key> | |||
<string>1.0</string> | |||
<key>CFBundleVersion</key> | |||
<string>1</string> | |||
</dict> | |||
</plist> |