@@ -7,7 +7,10 @@ | |||
objects = { | |||
/* Begin PBXBuildFile section */ | |||
78DC38C729278F790080E0D9 /* libBhBodyComposition120.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78DC38C529278F790080E0D9 /* libBhBodyComposition120.a */; }; | |||
78350BB329D2826900456695 /* libHTBodyfat_SDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78350BB129D2826900456695 /* libHTBodyfat_SDK.a */; }; | |||
78350BB729D282A300456695 /* libBhBodyComposition120.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78350BB429D282A300456695 /* libBhBodyComposition120.a */; }; | |||
78350BBB29D2869000456695 /* BodyScaleVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 78350BB929D2869000456695 /* BodyScaleVC.m */; }; | |||
78350BBD29D28C1200456695 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 78350BBC29D28C1200456695 /* README.md */; }; | |||
78DC4DE32990FB2E006C6911 /* ELDemoScanVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 78DC4DDE2990FB2E006C6911 /* ELDemoScanVC.xib */; }; | |||
78DC4DE42990FB2E006C6911 /* ELDemoDeviceModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 78DC4DDF2990FB2E006C6911 /* ELDemoDeviceModel.m */; }; | |||
78DC4DE52990FB2E006C6911 /* ELDemoScanVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 78DC4DE02990FB2E006C6911 /* ELDemoScanVC.m */; }; | |||
@@ -51,7 +54,6 @@ | |||
9557263D276C38CD003BFBAC /* ThermometerConnectViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 955725FD276C38CD003BFBAC /* ThermometerConnectViewController.m */; }; | |||
9557263E276C38CD003BFBAC /* EightScaleScanViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 95572600276C38CD003BFBAC /* EightScaleScanViewController.m */; }; | |||
9557263F276C38CD003BFBAC /* EightScaleConnectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 95572601276C38CD003BFBAC /* EightScaleConnectionViewController.m */; }; | |||
95572640276C38CD003BFBAC /* libHTBodyfat_SDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 95572605276C38CD003BFBAC /* libHTBodyfat_SDK.a */; }; | |||
95572641276C38CD003BFBAC /* ELEightScaleRecordModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 95572606276C38CD003BFBAC /* ELEightScaleRecordModel.m */; }; | |||
95572642276C38CD003BFBAC /* ELEightScaleAlgorithmTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 95572608276C38CD003BFBAC /* ELEightScaleAlgorithmTool.m */; }; | |||
95572643276C38CD003BFBAC /* BodyFatScaleScanViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9557260B276C38CD003BFBAC /* BodyFatScaleScanViewController.m */; }; | |||
@@ -105,9 +107,14 @@ | |||
/* End PBXContainerItemProxy section */ | |||
/* Begin PBXFileReference section */ | |||
78DC38C429278F790080E0D9 /* BhBodyCompositionAllBody50KHz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BhBodyCompositionAllBody50KHz.h; sourceTree = "<group>"; }; | |||
78DC38C529278F790080E0D9 /* libBhBodyComposition120.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libBhBodyComposition120.a; sourceTree = "<group>"; }; | |||
78DC38C629278F790080E0D9 /* BhBodyCompositionEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BhBodyCompositionEnum.h; sourceTree = "<group>"; }; | |||
78350BB129D2826900456695 /* libHTBodyfat_SDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libHTBodyfat_SDK.a; sourceTree = "<group>"; }; | |||
78350BB229D2826900456695 /* HTBodyfat_SDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTBodyfat_SDK.h; sourceTree = "<group>"; }; | |||
78350BB429D282A300456695 /* libBhBodyComposition120.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libBhBodyComposition120.a; sourceTree = "<group>"; }; | |||
78350BB529D282A300456695 /* BhBodyCompositionEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BhBodyCompositionEnum.h; sourceTree = "<group>"; }; | |||
78350BB629D282A300456695 /* BhBodyCompositionAllBody50KHz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BhBodyCompositionAllBody50KHz.h; sourceTree = "<group>"; }; | |||
78350BB929D2869000456695 /* BodyScaleVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BodyScaleVC.m; sourceTree = "<group>"; }; | |||
78350BBA29D2869000456695 /* BodyScaleVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BodyScaleVC.h; sourceTree = "<group>"; }; | |||
78350BBC29D28C1200456695 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; }; | |||
78DC4DDE2990FB2E006C6911 /* ELDemoScanVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ELDemoScanVC.xib; sourceTree = "<group>"; }; | |||
78DC4DDF2990FB2E006C6911 /* ELDemoDeviceModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELDemoDeviceModel.m; sourceTree = "<group>"; }; | |||
78DC4DE02990FB2E006C6911 /* ELDemoScanVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELDemoScanVC.m; sourceTree = "<group>"; }; | |||
@@ -189,8 +196,6 @@ | |||
95572600276C38CD003BFBAC /* EightScaleScanViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EightScaleScanViewController.m; sourceTree = "<group>"; }; | |||
95572601276C38CD003BFBAC /* EightScaleConnectionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EightScaleConnectionViewController.m; sourceTree = "<group>"; }; | |||
95572602276C38CD003BFBAC /* ELEightScaleAlgorithmTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELEightScaleAlgorithmTool.h; sourceTree = "<group>"; }; | |||
95572604276C38CD003BFBAC /* HTBodyfat_SDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTBodyfat_SDK.h; sourceTree = "<group>"; }; | |||
95572605276C38CD003BFBAC /* libHTBodyfat_SDK.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libHTBodyfat_SDK.a; sourceTree = "<group>"; }; | |||
95572606276C38CD003BFBAC /* ELEightScaleRecordModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELEightScaleRecordModel.m; sourceTree = "<group>"; }; | |||
95572607276C38CD003BFBAC /* EightScaleScanViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EightScaleScanViewController.h; sourceTree = "<group>"; }; | |||
95572608276C38CD003BFBAC /* ELEightScaleAlgorithmTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELEightScaleAlgorithmTool.m; sourceTree = "<group>"; }; | |||
@@ -282,9 +287,9 @@ | |||
isa = PBXFrameworksBuildPhase; | |||
buildActionMask = 2147483647; | |||
files = ( | |||
95572640276C38CD003BFBAC /* libHTBodyfat_SDK.a in Frameworks */, | |||
78350BB329D2826900456695 /* libHTBodyfat_SDK.a in Frameworks */, | |||
952D19A1276DE80000ED3A0C /* AILinkBleSDK.framework in Frameworks */, | |||
78DC38C729278F790080E0D9 /* libBhBodyComposition120.a in Frameworks */, | |||
78350BB729D282A300456695 /* libBhBodyComposition120.a in Frameworks */, | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
}; | |||
@@ -298,6 +303,45 @@ | |||
/* End PBXFrameworksBuildPhase section */ | |||
/* Begin PBXGroup section */ | |||
78350BB029D280D300456695 /* DeviceDemo */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
955725E0276C38CC003BFBAC /* 04_BabyScale */, | |||
955725BA276C38CC003BFBAC /* 05_BloodPressure */, | |||
955725E5276C38CC003BFBAC /* 06_HeightGuage */, | |||
9557261E276C38CD003BFBAC /* 07_RemoteControl */, | |||
95572614276C38CD003BFBAC /* 08_Forehead */, | |||
955725F9276C38CD003BFBAC /* 09_Thermometer */, | |||
955725CC276C38CC003BFBAC /* 10_WheelMonitor */, | |||
9557260A276C38CD003BFBAC /* 11_BodyFatScale */, | |||
78350BB829D2869000456695 /* 11B_BodyScale */, | |||
955725C4276C38CC003BFBAC /* 12_BroadcastScale */, | |||
955725FE276C38CD003BFBAC /* 13_EightScale */, | |||
95572619276C38CD003BFBAC /* 14_WifiBleToothbrush */, | |||
955725D4276C38CC003BFBAC /* 15_WifiBleBodyFatScale */, | |||
955725EA276C38CC003BFBAC /* 16_Oximeter */, | |||
955725C7276C38CC003BFBAC /* 17_BloodSugar */, | |||
955725DB276C38CC003BFBAC /* 18_CoffeeScale */, | |||
9557260F276C38CD003BFBAC /* 19_FoodThermometer */, | |||
955725D1276C38CC003BFBAC /* 20_BroadcastNutritionScale */, | |||
955725EF276C38CC003BFBAC /* 21_NutritionScale */, | |||
955725BF276C38CC003BFBAC /* 22_AiFreshNutritionScale */, | |||
955725F4276C38CD003BFBAC /* 23_FaceMask */, | |||
95565B742786EA3B000265EA /* 24_Skip */, | |||
78DC4DF72990FC10006C6911 /* 25_HeightBodyFatScale */, | |||
); | |||
path = DeviceDemo; | |||
sourceTree = "<group>"; | |||
}; | |||
78350BB829D2869000456695 /* 11B_BodyScale */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
78350BBA29D2869000456695 /* BodyScaleVC.h */, | |||
78350BB929D2869000456695 /* BodyScaleVC.m */, | |||
); | |||
path = 11B_BodyScale; | |||
sourceTree = "<group>"; | |||
}; | |||
788D913626A1849C0009489E /* Frameworks */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
@@ -316,9 +360,9 @@ | |||
78DC38C329278F790080E0D9 /* BhBodyComposition120 */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
78DC38C429278F790080E0D9 /* BhBodyCompositionAllBody50KHz.h */, | |||
78DC38C629278F790080E0D9 /* BhBodyCompositionEnum.h */, | |||
78DC38C529278F790080E0D9 /* libBhBodyComposition120.a */, | |||
78350BB629D282A300456695 /* BhBodyCompositionAllBody50KHz.h */, | |||
78350BB529D282A300456695 /* BhBodyCompositionEnum.h */, | |||
78350BB429D282A300456695 /* libBhBodyComposition120.a */, | |||
); | |||
path = BhBodyComposition120; | |||
sourceTree = "<group>"; | |||
@@ -348,7 +392,7 @@ | |||
78DC4DF92990FC10006C6911 /* HeightBodyFatScaleVC.xib */, | |||
); | |||
name = 25_HeightBodyFatScale; | |||
path = AILinkBleSDKDemo/25_HeightBodyFatScale; | |||
path = AILinkBleSDKDemo/DeviceDemo/25_HeightBodyFatScale; | |||
sourceTree = SOURCE_ROOT; | |||
}; | |||
95565B742786EA3B000265EA /* 24_Skip */ = { | |||
@@ -534,8 +578,8 @@ | |||
95572603276C38CD003BFBAC /* HTBodyfat_SDK */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
95572604276C38CD003BFBAC /* HTBodyfat_SDK.h */, | |||
95572605276C38CD003BFBAC /* libHTBodyfat_SDK.a */, | |||
78350BB229D2826900456695 /* HTBodyfat_SDK.h */, | |||
78350BB129D2826900456695 /* libHTBodyfat_SDK.a */, | |||
); | |||
path = HTBodyfat_SDK; | |||
sourceTree = "<group>"; | |||
@@ -637,9 +681,9 @@ | |||
958B4E76263C08E700476BAE /* AiLinkSuper */ = { | |||
isa = PBXGroup; | |||
children = ( | |||
958B4E79263C08E800476BAE /* AilinkSuperConnectViewController.h */, | |||
958B4E77263C08E700476BAE /* AilinkSuperConnectViewController.m */, | |||
958B4E78263C08E700476BAE /* AiLinkSuperViewController.h */, | |||
958B4E79263C08E800476BAE /* AilinkSuperConnectViewController.h */, | |||
958B4E7A263C08E800476BAE /* AiLinkSuperViewController.m */, | |||
); | |||
path = AiLinkSuper; | |||
@@ -701,6 +745,7 @@ | |||
E622E252243F1CA5003C319D = { | |||
isa = PBXGroup; | |||
children = ( | |||
78350BBC29D28C1200456695 /* README.md */, | |||
E622E25D243F1CA5003C319D /* AILinkBleSDKDemo */, | |||
E622E279243F1CA6003C319D /* AILinkBleSDKDemoUITests */, | |||
E622E25C243F1CA5003C319D /* Products */, | |||
@@ -721,28 +766,7 @@ | |||
isa = PBXGroup; | |||
children = ( | |||
788D914026A2E5380009489E /* SDK */, | |||
955725E0276C38CC003BFBAC /* 04_BabyScale */, | |||
955725BA276C38CC003BFBAC /* 05_BloodPressure */, | |||
955725E5276C38CC003BFBAC /* 06_HeightGuage */, | |||
9557261E276C38CD003BFBAC /* 07_RemoteControl */, | |||
95572614276C38CD003BFBAC /* 08_Forehead */, | |||
955725F9276C38CD003BFBAC /* 09_Thermometer */, | |||
955725CC276C38CC003BFBAC /* 10_WheelMonitor */, | |||
9557260A276C38CD003BFBAC /* 11_BodyFatScale */, | |||
955725C4276C38CC003BFBAC /* 12_BroadcastScale */, | |||
955725FE276C38CD003BFBAC /* 13_EightScale */, | |||
95572619276C38CD003BFBAC /* 14_WifiBleToothbrush */, | |||
955725D4276C38CC003BFBAC /* 15_WifiBleBodyFatScale */, | |||
955725EA276C38CC003BFBAC /* 16_Oximeter */, | |||
955725C7276C38CC003BFBAC /* 17_BloodSugar */, | |||
955725DB276C38CC003BFBAC /* 18_CoffeeScale */, | |||
9557260F276C38CD003BFBAC /* 19_FoodThermometer */, | |||
955725D1276C38CC003BFBAC /* 20_BroadcastNutritionScale */, | |||
955725EF276C38CC003BFBAC /* 21_NutritionScale */, | |||
955725BF276C38CC003BFBAC /* 22_AiFreshNutritionScale */, | |||
955725F4276C38CD003BFBAC /* 23_FaceMask */, | |||
95565B742786EA3B000265EA /* 24_Skip */, | |||
78DC4DF72990FC10006C6911 /* 25_HeightBodyFatScale */, | |||
78350BB029D280D300456695 /* DeviceDemo */, | |||
958B4E74263C08E700476BAE /* Others */, | |||
958B4E67263C08E700476BAE /* Tools */, | |||
E622E26A243F1CA6003C319D /* Assets.xcassets */, | |||
@@ -849,6 +873,7 @@ | |||
E622E26E243F1CA6003C319D /* LaunchScreen.storyboard in Resources */, | |||
E622E26B243F1CA6003C319D /* Assets.xcassets in Resources */, | |||
78DC4DF62990FB40006C6911 /* ELDeviceScanCell.xib in Resources */, | |||
78350BBD29D28C1200456695 /* README.md in Resources */, | |||
78DC4DFC2990FC10006C6911 /* HeightBodyFatScaleVC.xib in Resources */, | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
@@ -890,6 +915,7 @@ | |||
95572626276C38CD003BFBAC /* AiFreshNutritionScaleConnectionViewController.m in Sources */, | |||
9557262F276C38CD003BFBAC /* ELBfsWifiConnectTableViewCell.m in Sources */, | |||
95572623276C38CD003BFBAC /* BloodConnectViewController.m in Sources */, | |||
78350BBB29D2869000456695 /* BodyScaleVC.m in Sources */, | |||
95572649276C38CD003BFBAC /* ToothbrushScanViewController.m in Sources */, | |||
95572638276C38CD003BFBAC /* NutritionScaleScanViewController.m in Sources */, | |||
958B4EB5263C08E800476BAE /* MASViewConstraint.m in Sources */, | |||
@@ -1091,7 +1117,7 @@ | |||
buildSettings = { | |||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | |||
CODE_SIGN_STYLE = Automatic; | |||
CURRENT_PROJECT_VERSION = 20230209; | |||
CURRENT_PROJECT_VERSION = 20230327; | |||
DEVELOPMENT_TEAM = YEU77XR292; | |||
FRAMEWORK_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
@@ -1110,8 +1136,10 @@ | |||
"$(PROJECT_DIR)/AILinkBleSDKDemo/EightScale/HTBodyfat_SDK", | |||
"$(PROJECT_DIR)/AILinkBleSDKDemo/13_EightScale/HTBodyfat_SDK", | |||
"$(PROJECT_DIR)/AILinkBleSDKDemo/13_EightScale/BhBodyComposition120", | |||
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/HTBodyfat_SDK", | |||
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/BhBodyComposition120", | |||
); | |||
MARKETING_VERSION = 1.5.10_beta01; | |||
MARKETING_VERSION = 1.5.11; | |||
OTHER_LDFLAGS = "-ObjC"; | |||
PRODUCT_BUNDLE_IDENTIFIER = com.pingwang.AILinkBleSDKDemo; | |||
PRODUCT_NAME = "$(TARGET_NAME)"; | |||
@@ -1124,7 +1152,7 @@ | |||
buildSettings = { | |||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | |||
CODE_SIGN_STYLE = Automatic; | |||
CURRENT_PROJECT_VERSION = 20230209; | |||
CURRENT_PROJECT_VERSION = 20230327; | |||
DEVELOPMENT_TEAM = YEU77XR292; | |||
FRAMEWORK_SEARCH_PATHS = ( | |||
"$(inherited)", | |||
@@ -1143,8 +1171,10 @@ | |||
"$(PROJECT_DIR)/AILinkBleSDKDemo/EightScale/HTBodyfat_SDK", | |||
"$(PROJECT_DIR)/AILinkBleSDKDemo/13_EightScale/HTBodyfat_SDK", | |||
"$(PROJECT_DIR)/AILinkBleSDKDemo/13_EightScale/BhBodyComposition120", | |||
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/HTBodyfat_SDK", | |||
"$(PROJECT_DIR)/AILinkBleSDKDemo/DeviceDemo/13_EightScale/BhBodyComposition120", | |||
); | |||
MARKETING_VERSION = 1.5.10_beta01; | |||
MARKETING_VERSION = 1.5.11; | |||
OTHER_LDFLAGS = "-ObjC"; | |||
PRODUCT_BUNDLE_IDENTIFIER = com.pingwang.AILinkBleSDKDemo; | |||
PRODUCT_NAME = "$(TARGET_NAME)"; |
@@ -24,6 +24,9 @@ | |||
#import "ELAILinkBleManager+MeatProbe.h" | |||
#import "ELMeatProbeBleModel.h" | |||
#import "ELMeatProbeBleTool.h" | |||
#import "ELAILinkBleManager+MeatProbeBox.h" | |||
#import "ELMeatProbeBoxBleModel.h" | |||
#import "ELMeatProbeBoxBleParser.h" | |||
#import "ELAILinkBleManager+NoiseMeter.h" | |||
#import "ELNoiseMeterBleFunctionModel.h" | |||
#import "ELNoiseMeterBleHeader.h" | |||
@@ -80,7 +83,6 @@ | |||
#import "ELCoffeeScaleBleDataModel.h" | |||
#import "ELCoffeeScaleBleHeader.h" | |||
#import "ELCoffeeScaleBleManager.h" | |||
#import "AILinkBleSDK_Version.h" | |||
#import "ELBlePublicTool.h" | |||
#import "ELBluetoothManager+BleWifi.h" | |||
#import "ELBluetoothManager+BleWifi_Callback.h" | |||
@@ -140,6 +142,7 @@ | |||
#import "ELWheelMonitorBleHeader.h" | |||
#import "ELWheelMonitorBleManager.h" | |||
#import "ELWheelMonitorBleModel.h" | |||
#import "AILinkBleSDK_Version.h" | |||
#import "ELBleDisposeDataTool.h" | |||
#import "ELBleWifiDetailModel.h" | |||
#import "ELSDKHeader.h" |
@@ -9,6 +9,6 @@ | |||
#define AILinkBleSDK_Version_h | |||
//版本号 SDK Version | |||
#define AiLinkBleSDKVersion @"1.5.10_beta01" //20230209 优化牙刷 | |||
#define AiLinkBleSDKVersion @"1.5.11" //20230327 增加 蓝牙体重秤 | |||
#endif /* AILinkBleSDK_Version_h */ |
@@ -0,0 +1,16 @@ | |||
// | |||
// ELAILinkBleManager+MeatProbeBox.h | |||
// AILinkBleSDK | |||
// | |||
// Created by LarryZhang on 2023/2/16. | |||
// | |||
#import "ELAILinkBleManager.h" | |||
NS_ASSUME_NONNULL_BEGIN | |||
@interface ELAILinkBleManager (MeatProbeBox) | |||
@end | |||
NS_ASSUME_NONNULL_END |
@@ -5,10 +5,9 @@ | |||
// Created by LarryZhang on 2022/12/21. | |||
// | |||
#import "ELAILinkBleManager.h" | |||
#import "ELTLVModel.h" | |||
#import "ELNoiseMeterBleHeader.h" | |||
#import "ELNoiseMeterBleParser.h" | |||
#import <AILinkBleSDK/ELAILinkBleManager.h> | |||
@class ELTLVModel; | |||
NS_ASSUME_NONNULL_BEGIN | |||
@@ -11,6 +11,7 @@ | |||
#import "NELBleManagerHeader.h" | |||
#import "ELSDKHeader.h" | |||
#import "AILinkBleSDK_Version.h" | |||
NS_ASSUME_NONNULL_BEGIN | |||
@@ -24,6 +25,8 @@ NS_ASSUME_NONNULL_BEGIN | |||
//不是必须使用单例 | |||
+ (instancetype)sharedManager; | |||
- (NSString *)sdkVersion; | |||
+ (NSString *)sdkVersion; | |||
@property(nonatomic, assign, readonly, getter=isScanning) BOOL scanning; | |||
@@ -73,7 +76,7 @@ NS_ASSUME_NONNULL_BEGIN | |||
#pragma mark - connect | |||
@interface ELAILinkBleManager (connect) | |||
- (void)connectPeripheral:(CBPeripheral *)peripheral; | |||
//- (void)connectPeripheral:(CBPeripheral *)peripheral; | |||
- (void)disconnectPeripheral; | |||
@@ -141,6 +144,13 @@ NS_ASSUME_NONNULL_BEGIN | |||
@end | |||
#pragma mark - specialMethod | |||
@interface ELAILinkBleManager (specialMethod) | |||
- (BOOL)specialMethodWithCid:(UInt16)cid vid:(UInt16)vid pid:(UInt16)pid secret:(NSString *)secret; | |||
@end | |||
#pragma mark - BleWifi | |||
@interface ELAILinkBleManager (BleWifi) | |||
//============ Bluetooth WIFI calling method(蓝牙WIFI 设置命令) ============== | |||
@@ -149,37 +159,37 @@ NS_ASSUME_NONNULL_BEGIN | |||
WIFI initiate connection and disconnect(WIFI 发起连接、断开连接) | |||
@param connect YES: initiate connection NO: disconnect(YES:发起连接 NO:断开连接) | |||
*/ | |||
-(void)bleWifiSetupWifiConnect:(BOOL)connect; | |||
- (void)bleWifiSetupWifiConnect:(BOOL)connect; | |||
/** | |||
Set WIFI access URL(设置WIFI访问URL) | |||
@param url url(Not more than 56chars(不超过56chars)) | |||
*/ | |||
-(void)bleWifiSetWifiURL:(NSString *)url; | |||
- (void)bleWifiSetWifiURL:(NSString *)url; | |||
/** | |||
Set Wifi access port number(设置Wifi访问端口号) | |||
@param port 端口号 | |||
*/ | |||
-(void)bleWifiSetPort:(int)port; | |||
- (void)bleWifiSetPort:(int)port; | |||
/** | |||
Set DTIM interval(设置DTIM间隔) | |||
@param interval 间隔 | |||
*/ | |||
-(void)bleWifiSetDTIMInterval:(int)interval; | |||
- (void)bleWifiSetDTIMInterval:(int)interval; | |||
/** | |||
Set WIFI password(设置WIFI密码) | |||
@param pwd WIFI password (8 ~ 56 chars)(WIFI密码(8~56 个chars)) | |||
*/ | |||
-(void)bleWifiSetWifiPwd:(NSString *)pwd; | |||
- (void)bleWifiSetWifiPwd:(NSString *)pwd; | |||
/** | |||
Set up connected WIFI(设置连接的WIFI) | |||
@param macData wifi MAC (little endian)(wifi的MAC(小端序)) | |||
*/ | |||
-(void)bleWifiSetConnectWifiMac:(NSData *)macData; | |||
- (void)bleWifiSetConnectWifiMac:(NSData *)macData; | |||
@end | |||
@@ -223,11 +233,15 @@ NS_ASSUME_NONNULL_BEGIN | |||
//A7数据 payload | |||
- (void)aiLinkBleReceiveA7Data:(NSData *)payload; | |||
- (void)aiLinkBleReceiveA7Data:(NSData *)payload withMac:(NSData *)mac; | |||
- (void)aiLinkBleReceiveA7Data:(NSData *)payload withMac:(NSData *)mac DEPRECATED_MSG_ATTRIBUTE("use 'aiLinkBleReceiveA7Data:aILinkPeripheral' instead"); | |||
- (void)aiLinkBleReceiveA7Data:(NSData *)packet aILinkPeripheral:(ELAILinkPeripheral *)aILinkPeripheral; | |||
//A6数据 packet | |||
- (void)aiLinkBleReceiveA6Data:(NSData *)packet; | |||
- (void)aiLinkBleReceiveA6Data:(NSData *)packet withMac:(NSData *)mac; | |||
- (void)aiLinkBleReceiveA6Data:(NSData *)packet withMac:(NSData *)mac DEPRECATED_MSG_ATTRIBUTE("use 'aiLinkBleReceiveA6Data:aILinkPeripheral' instead"); | |||
- (void)aiLinkBleReceiveA6Data:(NSData *)packet aILinkPeripheral:(ELAILinkPeripheral *)aILinkPeripheral; | |||
- (void)aiLinkBleReceiveRawData:(NSData *)rawData aILinkPeripheral:(ELAILinkPeripheral *)aILinkPeripheral; | |||
@end | |||
@@ -240,43 +254,43 @@ NS_ASSUME_NONNULL_BEGIN | |||
Callback Wifi details(回调Wifi详情) | |||
@param model 模型 | |||
*/ | |||
-(void)bleWifiReceiveWifiDetailModel:(ELBleWifiDetailModel *_Nonnull)model; | |||
- (void)bleWifiReceiveWifiDetailModel:(ELBleWifiDetailModel *_Nonnull)model; | |||
/** | |||
Scan nearby wifi results(扫描附近wifi结果) | |||
@param count Number of nearby wifi(附近wifi数量) | |||
*/ | |||
-(void)bleWifiReceiveScanedWifiCount:(int)count; | |||
- (void)bleWifiReceiveScanedWifiCount:(int)count; | |||
/** | |||
Callback Wifi MAC address(回调Wifi MAC地址) | |||
@param macData mac | |||
*/ | |||
-(void)bleWifiReceiveWifiMacData:(NSData *_Nullable)macData; | |||
- (void)bleWifiReceiveWifiMacData:(NSData *_Nullable)macData; | |||
/** | |||
Callback WIFI password(回调WIFI密码) | |||
@param pwd password(密码) | |||
*/ | |||
-(void)bleWifiReceiveWifiPwd:(NSString *_Nonnull)pwd; | |||
- (void)bleWifiReceiveWifiPwd:(NSString *_Nonnull)pwd; | |||
/** | |||
Get DTIM interval (unit: ms)(获取DTIM间隔(单位:ms)) | |||
@param interval Interval (unit: ms)(间隔(单位:ms)) | |||
*/ | |||
-(void)bleWifiReceiveWifiDTIMInterval:(NSInteger)interval; | |||
- (void)bleWifiReceiveWifiDTIMInterval:(NSInteger)interval; | |||
/** | |||
Returns the visited URL(返回访问的url) | |||
@param url url | |||
*/ | |||
-(void)bleWifiReceiveWifiAccessURL:(NSString *_Nonnull)url; | |||
- (void)bleWifiReceiveWifiAccessURL:(NSString *_Nonnull)url; | |||
/** | |||
Call back wifi port number(回调wifi的端口号) | |||
@param port 端口号 | |||
*/ | |||
-(void)bleWifiReceiveWifiPort:(int)port; | |||
- (void)bleWifiReceiveWifiPort:(int)port; | |||
/** | |||
Set or query the callback of the instruction execution result(设置指令蓝牙WIFI响应回调方法) | |||
@@ -284,13 +298,13 @@ Callback WIFI password(回调WIFI密码) | |||
@param type Type of setting (设置的类型) | |||
@param result Set result(设置的结果) | |||
*/ | |||
-(void)bleWifiReceiceResponseType:(ELInetSetCmdType)type result:(ELSetBluetoothResponseType)result; | |||
- (void)bleWifiReceiceResponseType:(ELInetSetCmdType)type result:(ELSetBluetoothResponseType)result; | |||
/** | |||
获取会话码(deviceId) | |||
@param code (deviceId) deviceId(0 means no:为0时表示不存在) | |||
*/ | |||
-(void)bleWifiReceiveWifiSNCode:(int)code; | |||
- (void)bleWifiReceiveWifiSNCode:(int)code; | |||
/** 返回wifi名称 */ | |||
- (void)bleWifiName:(NSString *)wifiName; |
@@ -0,0 +1,16 @@ | |||
// | |||
// ELMeatProbeBoxBleModel.h | |||
// AILinkBleSDK | |||
// | |||
// Created by LarryZhang on 2023/2/16. | |||
// | |||
#import <Foundation/Foundation.h> | |||
NS_ASSUME_NONNULL_BEGIN | |||
@interface ELMeatProbeBoxBleModel : NSObject | |||
@end | |||
NS_ASSUME_NONNULL_END |
@@ -0,0 +1,16 @@ | |||
// | |||
// ELMeatProbeBoxBleParser.h | |||
// AILinkBleSDK | |||
// | |||
// Created by LarryZhang on 2023/2/16. | |||
// | |||
#import <Foundation/Foundation.h> | |||
NS_ASSUME_NONNULL_BEGIN | |||
@interface ELMeatProbeBoxBleParser : NSObject | |||
@end | |||
NS_ASSUME_NONNULL_END |
@@ -27,10 +27,11 @@ NS_ASSUME_NONNULL_BEGIN | |||
@property (nonatomic, assign) BOOL supportMeasurementLevelSwitch; | |||
//0x04:Max/Min模式 1 | |||
@property (nonatomic, assign) BOOL supportMaxMinModel; | |||
@property (nonatomic, assign) BOOL supportMaxMinMode; | |||
//0x05:时间加权(Fast/Slow) 1 | |||
@property (nonatomic, assign) BOOL supportTimeWeightedFastSlow; | |||
@property (nonatomic, assign) BOOL supportTimeWeightedFast; | |||
@property (nonatomic, assign) BOOL supportTimeWeightedSlow; | |||
//0x06:数值保持(hold) 1 | |||
@property (nonatomic, assign) BOOL supportValueHold; |
@@ -24,7 +24,7 @@ typedef NS_ENUM(NSUInteger, ELNoiseMeterTLVType) { | |||
ELNoiseMeterTLVTypeFrequencyWeightingAC = 0x01, //0x01:频率计权A/C | |||
ELNoiseMeterTLVTypeTotalMeasuringRange = 0x02, //0x02:测量总范围 | |||
ELNoiseMeterTLVTypeMeasurementLevelSwitch = 0x03, //0x03:测量等级切换 | |||
ELNoiseMeterTLVTypeMaxMinModel = 0x04, //0x04:Max/Min模式 | |||
ELNoiseMeterTLVTypeMaxMinMode = 0x04, //0x04:Max/Min模式 | |||
ELNoiseMeterTLVTypeTimeWeightedFastSlow = 0x05, //0x05:时间加权(Fast/Slow) | |||
ELNoiseMeterTLVTypeValueHold = 0x06, //0x06:数值保持(hold) | |||
ELNoiseMeterTLVTypeAlarm = 0x07, //0x07:报警 |
@@ -6,26 +6,44 @@ | |||
// | |||
#import <Foundation/Foundation.h> | |||
#import "ELSDKHeader.h" | |||
#import "ELNoiseMeterBleHeader.h" | |||
#import "ELNoiseMeterBleFunctionModel.h" | |||
#import "ELNoiseMeterBleStatusModel.h" | |||
#import "ELNoiseMeterBleSettingModel.h" | |||
NS_ASSUME_NONNULL_BEGIN | |||
@class ELNoiseMeterBleFunctionModel; | |||
@class ELNoiseMeterBleStatusModel; | |||
@class ELNoiseMeterBleSettingModel; | |||
@protocol ELNoiseMeterBleParserDelegate; | |||
@interface ELNoiseMeterBleParser : NSObject | |||
typedef void(^noiseMeterDidUpdateDataBlock)(ELNoiseMeterBleCMD cmd, ELNoiseMeterTLVType type); | |||
@property (nonatomic, weak) id<ELNoiseMeterBleParserDelegate> delegate; | |||
/// 设备返回支持功能列表Model | |||
@property (nonatomic, strong) ELNoiseMeterBleFunctionModel *functionModel; | |||
/// 设备返回状态Model | |||
@property (nonatomic, strong) ELNoiseMeterBleStatusModel *statusModel; | |||
/// 获取参数Model | |||
@property (nonatomic, strong) ELNoiseMeterBleSettingModel *settingModel; | |||
- (void)parseData:(NSData *)payload callback:(noiseMeterDidUpdateDataBlock)calllback; | |||
- (void)parseData:(NSData *)payload; | |||
@end | |||
@protocol ELNoiseMeterBleParserDelegate <NSObject> | |||
/// MCU主控回应设备功能列表 | |||
- (void)noiseMeterBleParser:(ELNoiseMeterBleParser *)bleParser returnFunctionWithTlvType:(ELNoiseMeterTLVType)tlvType; | |||
/// MCU主控回应设备状态 | |||
- (void)noiseMeterBleParser:(ELNoiseMeterBleParser *)bleParser returnStatusWithTlvType:(ELNoiseMeterTLVType)tlvType; | |||
/// MCU主控回应设备参数 | |||
- (void)noiseMeterBleParser:(ELNoiseMeterBleParser *)bleParser returnSettingWithTlvType:(ELNoiseMeterTLVType)tlvType; | |||
@end | |||
@@ -21,13 +21,13 @@ NS_ASSUME_NONNULL_BEGIN | |||
@property (nonatomic, assign) NSInteger measurementLevelMax; | |||
//0x04:Max/Min模式 1 | |||
@property (nonatomic, assign) NSInteger maxMinModel; | |||
@property (nonatomic, assign) NSInteger maxMinMode; | |||
//0x05:时间加权(Fast/Slow) 1 | |||
@property (nonatomic, assign) NSInteger timeWeightedFastSlowModel; | |||
@property (nonatomic, assign) NSInteger timeWeightedFastSlowMode; | |||
//0x06:数值保持(hold) 3 | |||
@property (nonatomic, assign) NSInteger valueHoldModel; | |||
@property (nonatomic, assign) NSInteger valueHoldMode; | |||
@property (nonatomic, assign) NSInteger valueHoldValue; | |||
//0x07:报警 3 |
@@ -20,13 +20,13 @@ NS_ASSUME_NONNULL_BEGIN | |||
@property (nonatomic, assign) NSInteger measurementLevelMax; | |||
//0x04:Max/Min模式 1 | |||
@property (nonatomic, assign) NSInteger maxMinModel; | |||
@property (nonatomic, assign) NSInteger maxMinMode; | |||
//0x05:时间加权(Fast/Slow) 1 | |||
@property (nonatomic, assign) NSInteger timeWeightedFastSlowModel; | |||
@property (nonatomic, assign) NSInteger timeWeightedFastSlowMode; | |||
//0x06:数值保持(hold) 3 | |||
@property (nonatomic, assign) NSInteger valueHoldModel; | |||
@property (nonatomic, assign) NSInteger valueHoldMode; | |||
@property (nonatomic, assign) NSInteger valueHoldValue; | |||
//0x07:报警 2 |
@@ -139,6 +139,7 @@ typedef NS_ENUM(NSUInteger, ELSupportDeviceType) { | |||
ELSupportDeviceTypeCoffeeScale = 0x0024 , //咖啡秤 | |||
ELSupportDeviceTypeHeightBodyFatScale = 0x0026 , //身高体脂秤 | |||
ELSupportDeviceTypeHeightScale = 0x0028 , //身高体重仪,CID:40 (0x0028) | |||
ELSupportDeviceTypeFoodThermometer = 0x002B, //Food Thermometer(食品温度计) | |||
@@ -176,10 +177,16 @@ typedef NS_ENUM(NSUInteger, ELSupportDeviceType) { | |||
ELSupportDeviceType电动自行车 = 0x004A, //电动自行车 | |||
ELSupportDeviceType电动自行车4G = 0x004B, //电动自行车 4G | |||
ELSupportDeviceType电动车 = 0x004C, //电动车 | |||
ELSupportDeviceType电动车4G = 0x004D, //电动车 4G | |||
ELSupportDeviceType电动平衡车 = 0x004E, //电动平衡车 | |||
ELSupportDeviceType电动平衡车4G = 0x004F, //电动平衡车 4G | |||
ELSupportDeviceTypeBLEWiFiNoiseMeter = 0x0050, //噪音计(WiFi+BLE) | |||
ELSupportDeviceType智能仪表 = 0x0051, //CM01-C02智能仪表 | |||
@@ -187,9 +194,12 @@ typedef NS_ENUM(NSUInteger, ELSupportDeviceType) { | |||
ELSupportDeviceType双频八电极体脂秤 = 0x0052, //双频八电极体脂秤 | |||
ELSupportDeviceTypeAirDetectorLite = 0x0053, //环境气体检测仪 不支持MQTT | |||
// ELSupportDeviceType54 = 0x0054, | |||
// ELSupportDeviceType55 = 0x0055, | |||
// ELSupportDeviceType56 = 0x0056, | |||
ELSupportDeviceType华普照度计 = 0x0054, //华普照度计 | |||
ELSupportDeviceTypeMeatProbeBox = 0x0055, //食物探针充电盒 | |||
ELSupportDeviceTypeBodyScale = 0x0056, //Body scale(no body fat) 体重秤(无体脂) | |||
// ELSupportDeviceType57 = 0x0057, | |||
// ELSupportDeviceType58 = 0x0058, | |||
// ELSupportDeviceType59 = 0x0059, |
@@ -0,0 +1,21 @@ | |||
// | |||
// BodyScaleVC.h | |||
// AILinkBleSDKSourceCode | |||
// | |||
// Created by LarryZhang on 2023/3/27. | |||
// Copyright © 2020 IOT. All rights reserved. | |||
// | |||
#import <UIKit/UIKit.h> | |||
@class ELAILinkPeripheral; | |||
NS_ASSUME_NONNULL_BEGIN | |||
@interface BodyScaleVC : UIViewController | |||
@property (nonatomic, strong) ELAILinkPeripheral *per; | |||
@end | |||
NS_ASSUME_NONNULL_END |
@@ -0,0 +1,391 @@ | |||
// | |||
// BodyScaleVC.m | |||
// AILinkBleSDKSourceCode | |||
// | |||
// Created by LarryZhang on 2023/3/27. | |||
// Copyright © 2020 IOT. All rights reserved. | |||
// | |||
#import <AILinkBleSDK/ELAILinkBleManager.h> | |||
#import <AILinkBleSDK/ELBluetoothManager+Settings.h> | |||
#import <AILinkBleSDK/ELBodyFatScaleBleManager.h> | |||
#import <AILinkBleSDK/ELBodyFatScaleBleUserModel.h> | |||
#import <AILinkBleSDK/ELBodyFatScaleBleWeightModel.h> | |||
#import "BodyScaleVC.h" | |||
#import "Masonry.h" | |||
#import <AILinkBleSDK/ELUnitConvertTool.h> | |||
#import <AILinkBleSDK/OEMAlgorithmSDK.h> | |||
@interface BodyScaleVC () <ELBluetoothManagerDelegate, ELBodyFatScaleBleDelegate> | |||
@property (nonatomic, strong) UITextView *textView; | |||
@property (nonatomic, copy) NSArray<NSNumber *> *units; | |||
@end | |||
@implementation BodyScaleVC | |||
- (void)viewDidLoad { | |||
[super viewDidLoad]; | |||
self.view.backgroundColor = [UIColor whiteColor]; | |||
[ELBodyFatScaleBleManager shareManager].delegate = self; | |||
[ELBodyFatScaleBleManager shareManager].bodyFatScaleDelegate = self; | |||
[[ELBodyFatScaleBleManager shareManager] startScan]; | |||
[self setupUIView]; | |||
} | |||
- (void)viewWillDisappear:(BOOL)animated { | |||
[super viewWillDisappear:animated]; | |||
[[ELBodyFatScaleBleManager shareManager] disconnectPeripheral]; | |||
} | |||
- (void)dealloc { | |||
} | |||
#pragma mark - Init UI | |||
- (void)setupUIView { | |||
UIButton *button1 = [UIButton buttonWithType:(UIButtonTypeCustom)]; | |||
[button1 setTitle:@"Get BM Version" forState:(UIControlStateNormal)]; | |||
button1.tag = 1; | |||
button1.titleLabel.adjustsFontSizeToFitWidth = YES; | |||
button1.titleLabel.numberOfLines = 2; | |||
button1.backgroundColor = [UIColor blackColor]; | |||
[button1 addTarget:self action:@selector(buttonAction:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[self.view addSubview:button1]; | |||
[button1 mas_makeConstraints:^(MASConstraintMaker *make) { | |||
make.left.mas_equalTo(10); | |||
make.top.mas_equalTo(100); | |||
make.width.mas_equalTo(100); | |||
make.height.mas_equalTo(40); | |||
}]; | |||
UIButton *button2 = [UIButton buttonWithType:(UIButtonTypeCustom)]; | |||
[button2 setTitle:@"Get C V P ID" forState:(UIControlStateNormal)]; | |||
button2.tag = 2; | |||
button2.titleLabel.adjustsFontSizeToFitWidth = YES; | |||
button2.titleLabel.numberOfLines = 2; | |||
button2.backgroundColor = [UIColor blackColor]; | |||
[button2 addTarget:self action:@selector(buttonAction:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[self.view addSubview:button2]; | |||
[button2 mas_makeConstraints:^(MASConstraintMaker *make) { | |||
make.left.equalTo(button1.mas_right).mas_offset(10); | |||
make.top.mas_equalTo(100); | |||
make.width.mas_equalTo(100); | |||
make.height.mas_equalTo(40); | |||
}]; | |||
UIButton *button3 = [UIButton buttonWithType:(UIButtonTypeCustom)]; | |||
[button3 setTitle:@"Get Name" forState:(UIControlStateNormal)]; | |||
button3.tag = 3; | |||
button3.titleLabel.adjustsFontSizeToFitWidth = YES; | |||
button3.titleLabel.numberOfLines = 2; | |||
button3.backgroundColor = [UIColor blackColor]; | |||
[button3 addTarget:self action:@selector(buttonAction:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[self.view addSubview:button3]; | |||
[button3 mas_makeConstraints:^(MASConstraintMaker *make) { | |||
make.left.equalTo(button2.mas_right).mas_offset(10); | |||
make.top.mas_equalTo(100); | |||
make.width.mas_equalTo(100); | |||
make.height.mas_equalTo(40); | |||
}]; | |||
// | |||
UIButton *button4 = [UIButton buttonWithType:(UIButtonTypeCustom)]; | |||
[button4 setTitle:@"Set Name" forState:(UIControlStateNormal)]; | |||
button4.tag = 4; | |||
button4.titleLabel.adjustsFontSizeToFitWidth = YES; | |||
button4.titleLabel.numberOfLines = 2; | |||
button4.backgroundColor = [UIColor blackColor]; | |||
[button4 addTarget:self action:@selector(buttonAction:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[self.view addSubview:button4]; | |||
[button4 mas_makeConstraints:^(MASConstraintMaker *make) { | |||
make.left.mas_equalTo(10); | |||
make.top.equalTo(button1.mas_bottom).mas_offset(10); | |||
make.width.mas_equalTo(100); | |||
make.height.mas_equalTo(40); | |||
}]; | |||
// | |||
UIButton *button5 = [UIButton buttonWithType:(UIButtonTypeCustom)]; | |||
[button5 setTitle:@"Change unit" forState:(UIControlStateNormal)]; | |||
button5.tag = 5; | |||
button5.titleLabel.adjustsFontSizeToFitWidth = YES; | |||
button5.titleLabel.numberOfLines = 2; | |||
button5.backgroundColor = [UIColor blackColor]; | |||
[button5 addTarget:self action:@selector(buttonAction:) forControlEvents:(UIControlEventTouchUpInside)]; | |||
[self.view addSubview:button5]; | |||
[button5 mas_makeConstraints:^(MASConstraintMaker *make) { | |||
make.left.equalTo(button4.mas_right).mas_offset(10); | |||
make.top.equalTo(button1.mas_bottom).mas_offset(10); | |||
make.width.mas_equalTo(100); | |||
make.height.mas_equalTo(40); | |||
}]; | |||
// | |||
self.textView = [[UITextView alloc] init]; | |||
self.textView.backgroundColor = [UIColor blackColor]; | |||
self.textView.text = @"Log"; | |||
self.textView.textColor = [UIColor redColor]; | |||
[self.view addSubview:self.textView]; | |||
[self.textView mas_makeConstraints:^(MASConstraintMaker *make) { | |||
make.left.mas_equalTo(10); | |||
make.right.bottom.mas_equalTo(-10); | |||
make.top.equalTo(button5.mas_bottom).mas_offset(10); | |||
}]; | |||
} | |||
#pragma mark - Action | |||
- (void)buttonAction:(UIButton *)sender { | |||
if ([ELBodyFatScaleBleManager shareManager].state != ELBluetoothStateDidValidationPass) { | |||
[self addLog:@"Disconnected"]; | |||
return; | |||
} | |||
[self addLog:sender.titleLabel.text]; | |||
NSInteger tag = sender.tag; | |||
if (tag == 1) { | |||
//getBluetoothInfoWithELInetGetCmdType是获取设备信息的方法 | |||
[[ELBodyFatScaleBleManager shareManager] getBluetoothInfoWithELInetGetCmdType:(ELInetGetCmdTypeGetBMVersion)]; | |||
} else if (tag == 2) { | |||
[[ELBodyFatScaleBleManager shareManager] getBluetoothInfoWithELInetGetCmdType:(ELInetGetCmdTypeGetC_V_P_ID)]; | |||
} else if (tag == 3) { | |||
[[ELBodyFatScaleBleManager shareManager] getBluetoothInfoWithELInetGetCmdType:(ELInetGetCmdTypeGetName)]; | |||
} else if (tag == 4) { | |||
[[ELBodyFatScaleBleManager shareManager] setBluetoothName:@"AILink"]; | |||
} else if (tag == 5) { | |||
if (self.units.count == 0) { | |||
[self addLog:@"No units obtained"]; | |||
return; | |||
} | |||
// [[ELBodyFatScaleBleManager shareManager] changeBodyFatScaleUnit:(ELDeviceWeightUnit_KG)]; | |||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Change Unit" message:@"" preferredStyle:(UIAlertControllerStyleAlert)]; | |||
for (int i = 0; i < self.units.count; i++) { | |||
UIAlertAction *action = [UIAlertAction actionWithTitle:AiLinkBleWeightUnitDic[self.units[i]] | |||
style:(UIAlertActionStyleDefault) | |||
handler:^(UIAlertAction *_Nonnull action) { | |||
[[ELBodyFatScaleBleManager shareManager] changeBodyFatScaleUnit:self.units[i].integerValue]; | |||
}]; | |||
[alert addAction:action]; | |||
} | |||
[self presentViewController:alert animated:YES completion:nil]; | |||
} | |||
} | |||
#pragma mark - ELBodyFatScaleBleDelegate | |||
- (void)bodyFatScaleManagerScanDevices:(NSArray<ELPeripheralModel *> *)scaleDevices { | |||
for (ELPeripheralModel *per in scaleDevices) { | |||
if ([per.macAddress isEqualToString:self.per.macAddressString]) { | |||
[[ELBodyFatScaleBleManager shareManager] stopScan]; | |||
[[ELBodyFatScaleBleManager shareManager] connectPeripheral:per]; | |||
} | |||
} | |||
} | |||
- (void)bodyFatScaleManagerUpdateState:(ELBluetoothState)state { | |||
switch (state) { | |||
case ELBluetoothStateUnavailable: { | |||
self.title = @"Please open the bluetooth"; | |||
} | |||
break; | |||
case ELBluetoothStateAvailable: { | |||
self.title = @"Bluetooth is open"; | |||
} | |||
break; | |||
case ELBluetoothStateScaning: { | |||
self.title = @"Scaning"; | |||
} | |||
break; | |||
case ELBluetoothStateConnectFail: { | |||
self.title = @"Connect fail"; | |||
} | |||
break; | |||
case ELBluetoothStateDidDisconnect: { | |||
self.title = @"Disconnected"; | |||
} | |||
break; | |||
case ELBluetoothStateDidValidationPass: { | |||
self.title = @"Connected"; | |||
//获取设备支持的单位 | |||
[[ELBodyFatScaleBleManager shareManager] getBluetoothInfoWithELInetGetCmdType:(ELInetGetCmdTypeReadDeviceSupportUnit)]; | |||
//将你自己设置的单位发给秤 | |||
ELDeviceWeightUnit unit = ELDeviceWeightUnit_KG; | |||
[[ELBodyFatScaleBleManager shareManager] changeBodyFatScaleUnit:unit]; | |||
} | |||
break; | |||
case ELBluetoothStateFailedValidation: { | |||
self.title = @"Illegal equipment"; | |||
} | |||
break; | |||
case ELBluetoothStateWillConnect: | |||
self.title = @"Connecting"; | |||
break; | |||
default: | |||
break; | |||
} | |||
} | |||
- (void)bluetoothManagerReceiceResponseType:(ELInetSetCmdType)type result:(ELSetBluetoothResponseType)result { | |||
if (type == ELInetSetCmdTypeSetName) { | |||
if (result == ELSetBluetoothResponseTypeSuccess) { | |||
[self addLog:@"Set name Success "]; | |||
} else if (result == ELSetBluetoothResponseTypeFailure) { | |||
[self addLog:@"Set name failure "]; | |||
} else if (result == ELSetBluetoothResponseTypeNoSupport) { | |||
[self addLog:@"Set name unsupport "]; | |||
} | |||
} | |||
} | |||
- (void)bluetoothManagerReceiceName:(NSString *)name { | |||
[self addLog:name]; | |||
} | |||
- (void)bluetoothManagerReceiveDID:(struct ELDIDStruct)did { | |||
[self addLog:[NSString stringWithFormat:@"CID = %lu, VID = %d, PID = %d", (unsigned long)did.deviceType, did.vendorID, did.productID]]; | |||
} | |||
- (void)bluetoothManagerReceiveBMVersion:(NSString *)bmVersion { | |||
[self addLog:bmVersion]; | |||
} | |||
- (void)bluetoothManagerBackDeviceSupportUnitWithWeight:(NSArray<NSNumber *> *)weightArray Height:(NSArray<NSNumber *> *)heightArray Temperature:(NSArray<NSNumber *> *)temperatureArray BloodPressure:(NSArray<NSNumber *> *)bloodPressureArray Pressure:(NSArray<NSNumber *> *)pressureArray { | |||
//这里只要体重数据 | |||
self.units = weightArray; | |||
} | |||
/** | |||
Callback to set unit result(回调设置单位结果) | |||
@param result 结果 | |||
*/ | |||
- (void)bodyFatScaleManagerCallBackSetUnitResult:(ELSetBluetoothResponseType)result { | |||
switch (result) { | |||
case ELSetBluetoothResponseTypeSuccess: { | |||
[self addLog:@"Change Unit Success"]; | |||
} | |||
break; | |||
case ELSetBluetoothResponseTypeFailure: { | |||
[self addLog:@"Change Unit Failure"]; | |||
} | |||
break; | |||
case ELSetBluetoothResponseTypeNoSupport: { | |||
[self addLog:@"Unsupport Change Unit"]; | |||
} | |||
break; | |||
default: | |||
break; | |||
} | |||
} | |||
/** | |||
Return weight and body fat model(返回重量及体脂model) | |||
*/ | |||
- (void)bodyFatScaleManagerCallBackWeight:(ELBodyFatScaleBleWeightModel *)weightModel state:(BodyFatScaleMeasureStatus)status { | |||
switch (status) { | |||
case BodyFatScaleMeasureStatus_Unstable: { | |||
[self addLog:[NSString stringWithFormat:@"Unstable data weight = %ld unit = %@ point = %ld", weightModel.weight, AiLinkBleWeightUnitDic[@(weightModel.weightUnit)], weightModel.weightPoint]]; | |||
} | |||
break; | |||
case BodyFatScaleMeasureStatus_Stable: { | |||
[self addLog:[NSString stringWithFormat:@"Stable data weight = %ld unit = %@ point = %ld", weightModel.weight, AiLinkBleWeightUnitDic[@(weightModel.weightUnit)], weightModel.weightPoint]]; | |||
} | |||
break; | |||
case BodyFatScaleMeasureStatus_Failed: { | |||
[self addLog:@"Test failure"]; | |||
} | |||
break; | |||
case BodyFatScaleMeasureStatus_Complete: { | |||
[self addLog:[NSString stringWithFormat:@"Tested weight = %ld unit = %@ point = %ld", weightModel.weight, AiLinkBleWeightUnitDic[@(weightModel.weightUnit)], weightModel.weightPoint]]; | |||
NSLog(@"weightModel:%@", weightModel); | |||
//App算法 | |||
[self algorithmWithBleModel:weightModel user:self.getOneUser]; | |||
} | |||
break; | |||
default: | |||
break; | |||
} | |||
} | |||
- (void)algorithmWithBleModel:(ELBodyFatScaleBleWeightModel *)weightModel user:(ELBodyFatScaleBleUserModel *)user { | |||
NSString *weightKg = [ELUnitConvertTool getWeightShowStrWithTargetUnit:ELDeviceWeightUnit_KG bleWeightInt:weightModel.weight bleWeightUnit:weightModel.weightUnit bleWeightPoint:weightModel.weightPoint]; | |||
OEMAlgorithmModel *algorithmModel = [OEMAlgorithmSDK getBodyfatWithWeight:weightKg.floatValue adc:(int)weightModel.adc sex:user.sex age:(int)user.age height:(int)user.height]; | |||
NSLog(@"algorithmModel.bmi:%@", algorithmModel.bmi); | |||
} | |||
/** | |||
Return error code(返回错误码) | |||
@param code 错误码 | |||
1:超重 | |||
*/ | |||
- (void)bodyFatScaleManagerCallBackErrorCode:(NSInteger)code { | |||
[self addLog:[NSString stringWithFormat:@"error code = %ld", code]]; | |||
} | |||
#pragma mark - private | |||
- (void)addLog:(NSString *)log { | |||
self.textView.text = [NSString stringWithFormat:@"%@\n%@", log, self.textView.text]; | |||
} | |||
- (NSArray<ELBodyFatScaleBleUserModel *> *)get8Users { | |||
NSMutableArray *users = [[NSMutableArray alloc] init]; | |||
for (int i = 0; i < 8; i++) { | |||
ELBodyFatScaleBleUserModel *user = [[ELBodyFatScaleBleUserModel alloc] init]; | |||
user.createTime = [[NSDate date] timeIntervalSince1970]; | |||
user.usrID = i; | |||
user.role = i % 4; | |||
user.sex = i % 2; | |||
user.age = 26 + i; | |||
user.height = 170 + i; | |||
user.weight = 600 + i; | |||
user.adc = 560 + i; | |||
[users addObject:user]; | |||
} | |||
return users.copy; | |||
} | |||
- (ELBodyFatScaleBleUserModel *)getOneUser { | |||
ELBodyFatScaleBleUserModel *user = [[ELBodyFatScaleBleUserModel alloc] init]; | |||
user.createTime = [[NSDate date] timeIntervalSince1970]; | |||
user.usrID = 0; | |||
user.role = BodyFatScaleRole_Ordinary; | |||
user.sex = ELBluetoothUserSex_Woman; | |||
user.age = 26; | |||
user.height = 170; | |||
user.weight = 600; | |||
user.adc = 560; | |||
return user; | |||
} | |||
@end |