ソースを参照

Initial commit

main
zp 1年前
コミット
cba956aa75
63個のファイルの変更4640行の追加0行の削除
  1. 733
    0
      healthRingDemo.xcodeproj/project.pbxproj
  2. 7
    0
      healthRingDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  3. 8
    0
      healthRingDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  4. 6
    0
      healthRingDemo.xcodeproj/xcuserdata/zhoupeng.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  5. 14
    0
      healthRingDemo.xcodeproj/xcuserdata/zhoupeng.xcuserdatad/xcschemes/xcschememanagement.plist
  6. バイナリ
      healthRingDemo/AICareComponentRingBleSDK.framework/AICareComponentRingBleSDK
  7. 13
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Headers/AICareComponentRingBleSDK_Version.h
  8. 14
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Headers/AILinkBleSDK_Version.h
  9. 46
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Headers/BM40BleProtocol.h
  10. 89
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Headers/DialogOTATool.h
  11. 41
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELAILinkBleManager+SmartRing.h
  12. 74
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELAILinkBleManager+WIFI.h
  13. 170
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELAILinkBleManager.h
  14. 141
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELAILinkBleManagerProtocol.h
  15. 37
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELAILinkPeripheral.h
  16. 125
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELExSupportDeviceType.h
  17. 516
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELSDKHeader.h
  18. 63
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELSmartRingBleHeader.h
  19. 124
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELSmartRingBleParser.h
  20. 146
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELSmartRingManager.h
  21. 37
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Headers/NELBleManagerHeader.h
  22. バイナリ
      healthRingDemo/AICareComponentRingBleSDK.framework/Info.plist
  23. 6
    0
      healthRingDemo/AICareComponentRingBleSDK.framework/Modules/module.modulemap
  24. 14
    0
      healthRingDemo/AppDelegate.h
  25. 40
    0
      healthRingDemo/AppDelegate.m
  26. 11
    0
      healthRingDemo/Assets.xcassets/AccentColor.colorset/Contents.json
  27. 13
    0
      healthRingDemo/Assets.xcassets/AppIcon.appiconset/Contents.json
  28. 6
    0
      healthRingDemo/Assets.xcassets/Contents.json
  29. 25
    0
      healthRingDemo/Base.lproj/LaunchScreen.storyboard
  30. 83
    0
      healthRingDemo/Base.lproj/Main.storyboard
  31. 36
    0
      healthRingDemo/ELDemoDeviceModel.h
  32. 35
    0
      healthRingDemo/ELDemoDeviceModel.m
  33. 25
    0
      healthRingDemo/ELDemoScanVC.h
  34. 140
    0
      healthRingDemo/ELDemoScanVC.m
  35. 70
    0
      healthRingDemo/ELDemoScanVC.xib
  36. 25
    0
      healthRingDemo/Info.plist
  37. バイナリ
      healthRingDemo/RingTestDemoVC/BR01H1S1.0.0_20230923.img
  38. バイナリ
      healthRingDemo/RingTestDemoVC/BR01H1S1.0.0_20240125.img
  39. バイナリ
      healthRingDemo/RingTestDemoVC/JFH_01_1234a_APP-202304062057-0x1000.bin
  40. バイナリ
      healthRingDemo/RingTestDemoVC/JFH_01_1234a_APP-202308280947-0xd622.bin
  41. バイナリ
      healthRingDemo/RingTestDemoVC/JFH_01_1234a_APP-202309231223-0xf1d8.bin
  42. バイナリ
      healthRingDemo/RingTestDemoVC/JFH_01_1234a_APP-202401021530-0xa8b3.bin
  43. 21
    0
      healthRingDemo/RingTestDemoVC/RingTestDemoVC.h
  44. 374
    0
      healthRingDemo/RingTestDemoVC/RingTestDemoVC.m
  45. 322
    0
      healthRingDemo/RingTestDemoVC/RingTestDemoVC.xib
  46. 15
    0
      healthRingDemo/SceneDelegate.h
  47. 57
    0
      healthRingDemo/SceneDelegate.m
  48. 26
    0
      healthRingDemo/View/ELDemoButton.h
  49. 94
    0
      healthRingDemo/View/ELDemoButton.m
  50. 27
    0
      healthRingDemo/View/ELDemoView.h
  51. 70
    0
      healthRingDemo/View/ELDemoView.m
  52. 40
    0
      healthRingDemo/View/ELDeviceScanCell.h
  53. 39
    0
      healthRingDemo/View/ELDeviceScanCell.m
  54. 171
    0
      healthRingDemo/View/ELDeviceScanCell.xib
  55. 32
    0
      healthRingDemo/View/ELDeviceTypeCell.h
  56. 39
    0
      healthRingDemo/View/ELDeviceTypeCell.m
  57. 121
    0
      healthRingDemo/View/ELDeviceTypeCell.xib
  58. 14
    0
      healthRingDemo/ViewController.h
  59. 108
    0
      healthRingDemo/ViewController.m
  60. 18
    0
      healthRingDemo/main.m
  61. 36
    0
      healthRingDemoTests/healthRingDemoTests.m
  62. 46
    0
      healthRingDemoUITests/healthRingDemoUITests.m
  63. 37
    0
      healthRingDemoUITests/healthRingDemoUITestsLaunchTests.m

+ 733
- 0
healthRingDemo.xcodeproj/project.pbxproj ファイルの表示

@@ -0,0 +1,733 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 56;
objects = {

/* Begin PBXBuildFile section */
4022F2882BA2CC7200891BEF /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4022F2872BA2CC7200891BEF /* AppDelegate.m */; };
4022F28B2BA2CC7200891BEF /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4022F28A2BA2CC7200891BEF /* SceneDelegate.m */; };
4022F28E2BA2CC7200891BEF /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4022F28D2BA2CC7200891BEF /* ViewController.m */; };
4022F2912BA2CC7200891BEF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4022F28F2BA2CC7200891BEF /* Main.storyboard */; };
4022F2932BA2CC7300891BEF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4022F2922BA2CC7300891BEF /* Assets.xcassets */; };
4022F2962BA2CC7300891BEF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4022F2942BA2CC7300891BEF /* LaunchScreen.storyboard */; };
4022F2992BA2CC7300891BEF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4022F2982BA2CC7300891BEF /* main.m */; };
4022F2A32BA2CC7300891BEF /* healthRingDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4022F2A22BA2CC7300891BEF /* healthRingDemoTests.m */; };
4022F2AD2BA2CC7300891BEF /* healthRingDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4022F2AC2BA2CC7300891BEF /* healthRingDemoUITests.m */; };
4022F2AF2BA2CC7300891BEF /* healthRingDemoUITestsLaunchTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4022F2AE2BA2CC7300891BEF /* healthRingDemoUITestsLaunchTests.m */; };
4022F2D52BA2CD7900891BEF /* ELDemoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4022F2BD2BA2CD7900891BEF /* ELDemoView.m */; };
4022F2D62BA2CD7900891BEF /* ELDeviceTypeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4022F2BE2BA2CD7900891BEF /* ELDeviceTypeCell.m */; };
4022F2D72BA2CD7900891BEF /* ELDemoButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 4022F2BF2BA2CD7900891BEF /* ELDemoButton.m */; };
4022F2D82BA2CD7900891BEF /* ELDeviceTypeCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4022F2C12BA2CD7900891BEF /* ELDeviceTypeCell.xib */; };
4022F2D92BA2CD7900891BEF /* ELDeviceScanCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4022F2C22BA2CD7900891BEF /* ELDeviceScanCell.m */; };
4022F2DA2BA2CD7900891BEF /* ELDeviceScanCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4022F2C52BA2CD7900891BEF /* ELDeviceScanCell.xib */; };
4022F2DB2BA2CD7900891BEF /* ELDemoScanVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 4022F2C62BA2CD7900891BEF /* ELDemoScanVC.m */; };
4022F2DC2BA2CD7900891BEF /* ELDemoDeviceModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4022F2C72BA2CD7900891BEF /* ELDemoDeviceModel.m */; };
4022F2DD2BA2CD7900891BEF /* BR01H1S1.0.0_20230923.img in Resources */ = {isa = PBXBuildFile; fileRef = 4022F2CB2BA2CD7900891BEF /* BR01H1S1.0.0_20230923.img */; };
4022F2DE2BA2CD7900891BEF /* BR01H1S1.0.0_20240125.img in Resources */ = {isa = PBXBuildFile; fileRef = 4022F2CC2BA2CD7900891BEF /* BR01H1S1.0.0_20240125.img */; };
4022F2DF2BA2CD7900891BEF /* JFH_01_1234a_APP-202309231223-0xf1d8.bin in Resources */ = {isa = PBXBuildFile; fileRef = 4022F2CD2BA2CD7900891BEF /* JFH_01_1234a_APP-202309231223-0xf1d8.bin */; };
4022F2E02BA2CD7900891BEF /* JFH_01_1234a_APP-202304062057-0x1000.bin in Resources */ = {isa = PBXBuildFile; fileRef = 4022F2CE2BA2CD7900891BEF /* JFH_01_1234a_APP-202304062057-0x1000.bin */; };
4022F2E12BA2CD7900891BEF /* JFH_01_1234a_APP-202401021530-0xa8b3.bin in Resources */ = {isa = PBXBuildFile; fileRef = 4022F2CF2BA2CD7900891BEF /* JFH_01_1234a_APP-202401021530-0xa8b3.bin */; };
4022F2E22BA2CD7900891BEF /* JFH_01_1234a_APP-202308280947-0xd622.bin in Resources */ = {isa = PBXBuildFile; fileRef = 4022F2D02BA2CD7900891BEF /* JFH_01_1234a_APP-202308280947-0xd622.bin */; };
4022F2E32BA2CD7900891BEF /* RingTestDemoVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 4022F2D12BA2CD7900891BEF /* RingTestDemoVC.m */; };
4022F2E42BA2CD7900891BEF /* RingTestDemoVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4022F2D22BA2CD7900891BEF /* RingTestDemoVC.xib */; };
4022F2E52BA2CD7900891BEF /* ELDemoScanVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4022F2D32BA2CD7900891BEF /* ELDemoScanVC.xib */; };
402947A02BA44E3400822888 /* AICareComponentRingBleSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4029479F2BA44E3400822888 /* AICareComponentRingBleSDK.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
4022F29F2BA2CC7300891BEF /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 4022F27B2BA2CC7200891BEF /* Project object */;
proxyType = 1;
remoteGlobalIDString = 4022F2822BA2CC7200891BEF;
remoteInfo = healthRingDemo;
};
4022F2A92BA2CC7300891BEF /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 4022F27B2BA2CC7200891BEF /* Project object */;
proxyType = 1;
remoteGlobalIDString = 4022F2822BA2CC7200891BEF;
remoteInfo = healthRingDemo;
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
4022F2ED2BA2D86300891BEF /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
4022F2832BA2CC7200891BEF /* healthRingDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = healthRingDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
4022F2862BA2CC7200891BEF /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
4022F2872BA2CC7200891BEF /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
4022F2892BA2CC7200891BEF /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = "<group>"; };
4022F28A2BA2CC7200891BEF /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = "<group>"; };
4022F28C2BA2CC7200891BEF /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
4022F28D2BA2CC7200891BEF /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
4022F2902BA2CC7200891BEF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
4022F2922BA2CC7300891BEF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4022F2952BA2CC7300891BEF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4022F2972BA2CC7300891BEF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4022F2982BA2CC7300891BEF /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
4022F29E2BA2CC7300891BEF /* healthRingDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = healthRingDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4022F2A22BA2CC7300891BEF /* healthRingDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = healthRingDemoTests.m; sourceTree = "<group>"; };
4022F2A82BA2CC7300891BEF /* healthRingDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = healthRingDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4022F2AC2BA2CC7300891BEF /* healthRingDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = healthRingDemoUITests.m; sourceTree = "<group>"; };
4022F2AE2BA2CC7300891BEF /* healthRingDemoUITestsLaunchTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = healthRingDemoUITestsLaunchTests.m; sourceTree = "<group>"; };
4022F2BC2BA2CD7900891BEF /* ELDeviceScanCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELDeviceScanCell.h; sourceTree = "<group>"; };
4022F2BD2BA2CD7900891BEF /* ELDemoView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELDemoView.m; sourceTree = "<group>"; };
4022F2BE2BA2CD7900891BEF /* ELDeviceTypeCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELDeviceTypeCell.m; sourceTree = "<group>"; };
4022F2BF2BA2CD7900891BEF /* ELDemoButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELDemoButton.m; sourceTree = "<group>"; };
4022F2C02BA2CD7900891BEF /* ELDemoView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELDemoView.h; sourceTree = "<group>"; };
4022F2C12BA2CD7900891BEF /* ELDeviceTypeCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ELDeviceTypeCell.xib; sourceTree = "<group>"; };
4022F2C22BA2CD7900891BEF /* ELDeviceScanCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELDeviceScanCell.m; sourceTree = "<group>"; };
4022F2C32BA2CD7900891BEF /* ELDeviceTypeCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELDeviceTypeCell.h; sourceTree = "<group>"; };
4022F2C42BA2CD7900891BEF /* ELDemoButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELDemoButton.h; sourceTree = "<group>"; };
4022F2C52BA2CD7900891BEF /* ELDeviceScanCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ELDeviceScanCell.xib; sourceTree = "<group>"; };
4022F2C62BA2CD7900891BEF /* ELDemoScanVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELDemoScanVC.m; sourceTree = "<group>"; };
4022F2C72BA2CD7900891BEF /* ELDemoDeviceModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELDemoDeviceModel.m; sourceTree = "<group>"; };
4022F2C82BA2CD7900891BEF /* ELDemoDeviceModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELDemoDeviceModel.h; sourceTree = "<group>"; };
4022F2CA2BA2CD7900891BEF /* RingTestDemoVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RingTestDemoVC.h; sourceTree = "<group>"; };
4022F2CB2BA2CD7900891BEF /* BR01H1S1.0.0_20230923.img */ = {isa = PBXFileReference; lastKnownFileType = file; path = BR01H1S1.0.0_20230923.img; sourceTree = "<group>"; };
4022F2CC2BA2CD7900891BEF /* BR01H1S1.0.0_20240125.img */ = {isa = PBXFileReference; lastKnownFileType = file; path = BR01H1S1.0.0_20240125.img; sourceTree = "<group>"; };
4022F2CD2BA2CD7900891BEF /* JFH_01_1234a_APP-202309231223-0xf1d8.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = "JFH_01_1234a_APP-202309231223-0xf1d8.bin"; sourceTree = "<group>"; };
4022F2CE2BA2CD7900891BEF /* JFH_01_1234a_APP-202304062057-0x1000.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = "JFH_01_1234a_APP-202304062057-0x1000.bin"; sourceTree = "<group>"; };
4022F2CF2BA2CD7900891BEF /* JFH_01_1234a_APP-202401021530-0xa8b3.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = "JFH_01_1234a_APP-202401021530-0xa8b3.bin"; sourceTree = "<group>"; };
4022F2D02BA2CD7900891BEF /* JFH_01_1234a_APP-202308280947-0xd622.bin */ = {isa = PBXFileReference; lastKnownFileType = archive.macbinary; path = "JFH_01_1234a_APP-202308280947-0xd622.bin"; sourceTree = "<group>"; };
4022F2D12BA2CD7900891BEF /* RingTestDemoVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RingTestDemoVC.m; sourceTree = "<group>"; };
4022F2D22BA2CD7900891BEF /* RingTestDemoVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RingTestDemoVC.xib; sourceTree = "<group>"; };
4022F2D32BA2CD7900891BEF /* ELDemoScanVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ELDemoScanVC.xib; sourceTree = "<group>"; };
4022F2D42BA2CD7900891BEF /* ELDemoScanVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELDemoScanVC.h; sourceTree = "<group>"; };
4029479F2BA44E3400822888 /* AICareComponentRingBleSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AICareComponentRingBleSDK.framework; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
4022F2802BA2CC7200891BEF /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
402947A02BA44E3400822888 /* AICareComponentRingBleSDK.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
4022F29B2BA2CC7300891BEF /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
4022F2A52BA2CC7300891BEF /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
4022F27A2BA2CC7200891BEF = {
isa = PBXGroup;
children = (
4022F2852BA2CC7200891BEF /* healthRingDemo */,
4022F2A12BA2CC7300891BEF /* healthRingDemoTests */,
4022F2AB2BA2CC7300891BEF /* healthRingDemoUITests */,
4022F2842BA2CC7200891BEF /* Products */,
);
sourceTree = "<group>";
};
4022F2842BA2CC7200891BEF /* Products */ = {
isa = PBXGroup;
children = (
4022F2832BA2CC7200891BEF /* healthRingDemo.app */,
4022F29E2BA2CC7300891BEF /* healthRingDemoTests.xctest */,
4022F2A82BA2CC7300891BEF /* healthRingDemoUITests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
4022F2852BA2CC7200891BEF /* healthRingDemo */ = {
isa = PBXGroup;
children = (
4022F2862BA2CC7200891BEF /* AppDelegate.h */,
4022F2872BA2CC7200891BEF /* AppDelegate.m */,
4022F2892BA2CC7200891BEF /* SceneDelegate.h */,
4022F28A2BA2CC7200891BEF /* SceneDelegate.m */,
4022F28C2BA2CC7200891BEF /* ViewController.h */,
4022F28D2BA2CC7200891BEF /* ViewController.m */,
4022F2C82BA2CD7900891BEF /* ELDemoDeviceModel.h */,
4022F2C72BA2CD7900891BEF /* ELDemoDeviceModel.m */,
4022F2D42BA2CD7900891BEF /* ELDemoScanVC.h */,
4022F2C62BA2CD7900891BEF /* ELDemoScanVC.m */,
4022F2D32BA2CD7900891BEF /* ELDemoScanVC.xib */,
4022F2C92BA2CD7900891BEF /* RingTestDemoVC */,
4022F2BB2BA2CD7900891BEF /* View */,
4022F28F2BA2CC7200891BEF /* Main.storyboard */,
4029479F2BA44E3400822888 /* AICareComponentRingBleSDK.framework */,
4022F2922BA2CC7300891BEF /* Assets.xcassets */,
4022F2942BA2CC7300891BEF /* LaunchScreen.storyboard */,
4022F2972BA2CC7300891BEF /* Info.plist */,
4022F2982BA2CC7300891BEF /* main.m */,
);
path = healthRingDemo;
sourceTree = "<group>";
};
4022F2A12BA2CC7300891BEF /* healthRingDemoTests */ = {
isa = PBXGroup;
children = (
4022F2A22BA2CC7300891BEF /* healthRingDemoTests.m */,
);
path = healthRingDemoTests;
sourceTree = "<group>";
};
4022F2AB2BA2CC7300891BEF /* healthRingDemoUITests */ = {
isa = PBXGroup;
children = (
4022F2AC2BA2CC7300891BEF /* healthRingDemoUITests.m */,
4022F2AE2BA2CC7300891BEF /* healthRingDemoUITestsLaunchTests.m */,
);
path = healthRingDemoUITests;
sourceTree = "<group>";
};
4022F2BB2BA2CD7900891BEF /* View */ = {
isa = PBXGroup;
children = (
4022F2BC2BA2CD7900891BEF /* ELDeviceScanCell.h */,
4022F2BD2BA2CD7900891BEF /* ELDemoView.m */,
4022F2BE2BA2CD7900891BEF /* ELDeviceTypeCell.m */,
4022F2BF2BA2CD7900891BEF /* ELDemoButton.m */,
4022F2C02BA2CD7900891BEF /* ELDemoView.h */,
4022F2C12BA2CD7900891BEF /* ELDeviceTypeCell.xib */,
4022F2C22BA2CD7900891BEF /* ELDeviceScanCell.m */,
4022F2C32BA2CD7900891BEF /* ELDeviceTypeCell.h */,
4022F2C42BA2CD7900891BEF /* ELDemoButton.h */,
4022F2C52BA2CD7900891BEF /* ELDeviceScanCell.xib */,
);
path = View;
sourceTree = "<group>";
};
4022F2C92BA2CD7900891BEF /* RingTestDemoVC */ = {
isa = PBXGroup;
children = (
4022F2CB2BA2CD7900891BEF /* BR01H1S1.0.0_20230923.img */,
4022F2CC2BA2CD7900891BEF /* BR01H1S1.0.0_20240125.img */,
4022F2CD2BA2CD7900891BEF /* JFH_01_1234a_APP-202309231223-0xf1d8.bin */,
4022F2CE2BA2CD7900891BEF /* JFH_01_1234a_APP-202304062057-0x1000.bin */,
4022F2CF2BA2CD7900891BEF /* JFH_01_1234a_APP-202401021530-0xa8b3.bin */,
4022F2D02BA2CD7900891BEF /* JFH_01_1234a_APP-202308280947-0xd622.bin */,
4022F2CA2BA2CD7900891BEF /* RingTestDemoVC.h */,
4022F2D12BA2CD7900891BEF /* RingTestDemoVC.m */,
4022F2D22BA2CD7900891BEF /* RingTestDemoVC.xib */,
);
path = RingTestDemoVC;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
4022F2822BA2CC7200891BEF /* healthRingDemo */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4022F2B22BA2CC7300891BEF /* Build configuration list for PBXNativeTarget "healthRingDemo" */;
buildPhases = (
4022F27F2BA2CC7200891BEF /* Sources */,
4022F2802BA2CC7200891BEF /* Frameworks */,
4022F2812BA2CC7200891BEF /* Resources */,
4022F2ED2BA2D86300891BEF /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = healthRingDemo;
productName = healthRingDemo;
productReference = 4022F2832BA2CC7200891BEF /* healthRingDemo.app */;
productType = "com.apple.product-type.application";
};
4022F29D2BA2CC7300891BEF /* healthRingDemoTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4022F2B52BA2CC7300891BEF /* Build configuration list for PBXNativeTarget "healthRingDemoTests" */;
buildPhases = (
4022F29A2BA2CC7300891BEF /* Sources */,
4022F29B2BA2CC7300891BEF /* Frameworks */,
4022F29C2BA2CC7300891BEF /* Resources */,
);
buildRules = (
);
dependencies = (
4022F2A02BA2CC7300891BEF /* PBXTargetDependency */,
);
name = healthRingDemoTests;
productName = healthRingDemoTests;
productReference = 4022F29E2BA2CC7300891BEF /* healthRingDemoTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
4022F2A72BA2CC7300891BEF /* healthRingDemoUITests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4022F2B82BA2CC7300891BEF /* Build configuration list for PBXNativeTarget "healthRingDemoUITests" */;
buildPhases = (
4022F2A42BA2CC7300891BEF /* Sources */,
4022F2A52BA2CC7300891BEF /* Frameworks */,
4022F2A62BA2CC7300891BEF /* Resources */,
);
buildRules = (
);
dependencies = (
4022F2AA2BA2CC7300891BEF /* PBXTargetDependency */,
);
name = healthRingDemoUITests;
productName = healthRingDemoUITests;
productReference = 4022F2A82BA2CC7300891BEF /* healthRingDemoUITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
4022F27B2BA2CC7200891BEF /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastUpgradeCheck = 1420;
TargetAttributes = {
4022F2822BA2CC7200891BEF = {
CreatedOnToolsVersion = 14.2;
};
4022F29D2BA2CC7300891BEF = {
CreatedOnToolsVersion = 14.2;
TestTargetID = 4022F2822BA2CC7200891BEF;
};
4022F2A72BA2CC7300891BEF = {
CreatedOnToolsVersion = 14.2;
TestTargetID = 4022F2822BA2CC7200891BEF;
};
};
};
buildConfigurationList = 4022F27E2BA2CC7200891BEF /* Build configuration list for PBXProject "healthRingDemo" */;
compatibilityVersion = "Xcode 14.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 4022F27A2BA2CC7200891BEF;
productRefGroup = 4022F2842BA2CC7200891BEF /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
4022F2822BA2CC7200891BEF /* healthRingDemo */,
4022F29D2BA2CC7300891BEF /* healthRingDemoTests */,
4022F2A72BA2CC7300891BEF /* healthRingDemoUITests */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
4022F2812BA2CC7200891BEF /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4022F2DD2BA2CD7900891BEF /* BR01H1S1.0.0_20230923.img in Resources */,
4022F2DE2BA2CD7900891BEF /* BR01H1S1.0.0_20240125.img in Resources */,
4022F2DA2BA2CD7900891BEF /* ELDeviceScanCell.xib in Resources */,
4022F2DF2BA2CD7900891BEF /* JFH_01_1234a_APP-202309231223-0xf1d8.bin in Resources */,
4022F2D82BA2CD7900891BEF /* ELDeviceTypeCell.xib in Resources */,
4022F2962BA2CC7300891BEF /* LaunchScreen.storyboard in Resources */,
4022F2932BA2CC7300891BEF /* Assets.xcassets in Resources */,
4022F2E52BA2CD7900891BEF /* ELDemoScanVC.xib in Resources */,
4022F2E22BA2CD7900891BEF /* JFH_01_1234a_APP-202308280947-0xd622.bin in Resources */,
4022F2E02BA2CD7900891BEF /* JFH_01_1234a_APP-202304062057-0x1000.bin in Resources */,
4022F2E42BA2CD7900891BEF /* RingTestDemoVC.xib in Resources */,
4022F2912BA2CC7200891BEF /* Main.storyboard in Resources */,
4022F2E12BA2CD7900891BEF /* JFH_01_1234a_APP-202401021530-0xa8b3.bin in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
4022F29C2BA2CC7300891BEF /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
4022F2A62BA2CC7300891BEF /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
4022F27F2BA2CC7200891BEF /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4022F2E32BA2CD7900891BEF /* RingTestDemoVC.m in Sources */,
4022F2D62BA2CD7900891BEF /* ELDeviceTypeCell.m in Sources */,
4022F2DC2BA2CD7900891BEF /* ELDemoDeviceModel.m in Sources */,
4022F28E2BA2CC7200891BEF /* ViewController.m in Sources */,
4022F2D52BA2CD7900891BEF /* ELDemoView.m in Sources */,
4022F2D92BA2CD7900891BEF /* ELDeviceScanCell.m in Sources */,
4022F2882BA2CC7200891BEF /* AppDelegate.m in Sources */,
4022F2D72BA2CD7900891BEF /* ELDemoButton.m in Sources */,
4022F2DB2BA2CD7900891BEF /* ELDemoScanVC.m in Sources */,
4022F2992BA2CC7300891BEF /* main.m in Sources */,
4022F28B2BA2CC7200891BEF /* SceneDelegate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
4022F29A2BA2CC7300891BEF /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4022F2A32BA2CC7300891BEF /* healthRingDemoTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
4022F2A42BA2CC7300891BEF /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4022F2AD2BA2CC7300891BEF /* healthRingDemoUITests.m in Sources */,
4022F2AF2BA2CC7300891BEF /* healthRingDemoUITestsLaunchTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
4022F2A02BA2CC7300891BEF /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 4022F2822BA2CC7200891BEF /* healthRingDemo */;
targetProxy = 4022F29F2BA2CC7300891BEF /* PBXContainerItemProxy */;
};
4022F2AA2BA2CC7300891BEF /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 4022F2822BA2CC7200891BEF /* healthRingDemo */;
targetProxy = 4022F2A92BA2CC7300891BEF /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
4022F28F2BA2CC7200891BEF /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
4022F2902BA2CC7200891BEF /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
4022F2942BA2CC7300891BEF /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
4022F2952BA2CC7300891BEF /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
4022F2B02BA2CC7300891BEF /* 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++20";
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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
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;
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 = 16.2;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
4022F2B12BA2CC7300891BEF /* 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++20";
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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
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;
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 = 16.2;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
4022F2B32BA2CC7300891BEF /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = ZS5NB5WV7X;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/healthRingDemo",
"$(PROJECT_DIR)",
);
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = healthRingDemo/Info.plist;
INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = OPEN;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = com.ellinkthings.healthringsdk.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
4022F2B42BA2CC7300891BEF /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = ZS5NB5WV7X;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/healthRingDemo",
"$(PROJECT_DIR)",
);
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = healthRingDemo/Info.plist;
INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = OPEN;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = com.ellinkthings.healthringsdk.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
4022F2B62BA2CC7300891BEF /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = ZS5NB5WV7X;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = newtast.healthRingDemoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/healthRingDemo.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/healthRingDemo";
};
name = Debug;
};
4022F2B72BA2CC7300891BEF /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = ZS5NB5WV7X;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = newtast.healthRingDemoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/healthRingDemo.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/healthRingDemo";
};
name = Release;
};
4022F2B92BA2CC7300891BEF /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = ZS5NB5WV7X;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = newtast.healthRingDemoUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = healthRingDemo;
};
name = Debug;
};
4022F2BA2BA2CC7300891BEF /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = ZS5NB5WV7X;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = newtast.healthRingDemoUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = healthRingDemo;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
4022F27E2BA2CC7200891BEF /* Build configuration list for PBXProject "healthRingDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4022F2B02BA2CC7300891BEF /* Debug */,
4022F2B12BA2CC7300891BEF /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4022F2B22BA2CC7300891BEF /* Build configuration list for PBXNativeTarget "healthRingDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4022F2B32BA2CC7300891BEF /* Debug */,
4022F2B42BA2CC7300891BEF /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4022F2B52BA2CC7300891BEF /* Build configuration list for PBXNativeTarget "healthRingDemoTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4022F2B62BA2CC7300891BEF /* Debug */,
4022F2B72BA2CC7300891BEF /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4022F2B82BA2CC7300891BEF /* Build configuration list for PBXNativeTarget "healthRingDemoUITests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4022F2B92BA2CC7300891BEF /* Debug */,
4022F2BA2BA2CC7300891BEF /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 4022F27B2BA2CC7200891BEF /* Project object */;
}

+ 7
- 0
healthRingDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata ファイルの表示

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

+ 8
- 0
healthRingDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ファイルの表示

@@ -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>

+ 6
- 0
healthRingDemo.xcodeproj/xcuserdata/zhoupeng.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist ファイルの表示

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "FA83FEAF-FD72-4C19-8723-C770C7B47B06"
type = "1"
version = "2.0">
</Bucket>

+ 14
- 0
healthRingDemo.xcodeproj/xcuserdata/zhoupeng.xcuserdatad/xcschemes/xcschememanagement.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>healthRingDemo.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>

バイナリ
healthRingDemo/AICareComponentRingBleSDK.framework/AICareComponentRingBleSDK ファイルの表示


+ 13
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Headers/AICareComponentRingBleSDK_Version.h ファイルの表示

@@ -0,0 +1,13 @@
//
// AICareComponentRingBleSDK_Version.h
// AICareComponentRingBleSDK
//
// Created by 周鹏 on 2024/3/14.
//
#ifndef AICareComponentRingBleSDK_Version
#define AICareComponentRingBleSDK_Version

//版本号 SDK Version
#define AICareComponentRingBleSDKVersion @"1.0.0" // 20231211

#endif /* AILinkBleSDK_Version_h */

+ 14
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Headers/AILinkBleSDK_Version.h ファイルの表示

@@ -0,0 +1,14 @@
//
// AILinkBleSDK_Version.h
// Pods
//
// Created by LarryZhang on 2023/2/9.
//

#ifndef AILinkBleSDK_Version_h
#define AILinkBleSDK_Version_h

//版本号 SDK Version
#define AiLinkBleSDKVersion @"1.7.3" // 20231211

#endif /* AILinkBleSDK_Version_h */

+ 46
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Headers/BM40BleProtocol.h ファイルの表示

@@ -0,0 +1,46 @@
//
// BM40BleProtocol.h
// AILinkBleSDK_Example
//
// Created by LarryZhang on 2023/7/28.
// Copyright © 2023 zhengzida. All rights reserved.
//

#import <Foundation/Foundation.h>
@class ELAILinkBleManager;

NS_ASSUME_NONNULL_BEGIN


typedef NS_ENUM(NSUInteger, BM40BleCmdCode) {
BM40BleCmdCodePageWriteOnly97 = 0x97,
BM40BleCmdCodeAllErase98 = 0x98,
BM40BleCmdCodePagesReadChecksum81 = 0x81,
};

typedef NS_ENUM(NSUInteger, BM40BleCmdAck) {
BM40BleCmdAckCmdDoneA4 = 0xA4,
BM40BleCmdAckPagesCsTrueA5 = 0xA5,
BM40BleCmdAckPagesCsFailA6 = 0xA6,
};

@interface BM40BleProtocol : NSObject

+ (NSData *)startOTA:(ELAILinkBleManager *)manager;
+ (NSData *)endOTA:(ELAILinkBleManager *)manager;

+ (NSData *)eraseAll:(ELAILinkBleManager *)manager size:(UInt16)size;

+ (NSData *)pageWrite:(ELAILinkBleManager *)manager data:(NSData *)data address:(UInt16)address;

+ (NSData *)pageReadChecksum:(ELAILinkBleManager *)manager pageChecksum:(UInt8)pageChecksum address:(UInt16)address;

+ (UInt8)checksum:(Byte *)bytes length:(UInt8)length;

@end

NS_ASSUME_NONNULL_END

+ 89
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Headers/DialogOTATool.h ファイルの表示

@@ -0,0 +1,89 @@
//
// DialogOTATool.h
// Aibrush
//
// Created by steven wu on 2020/8/12.
// Copyright © 2020 taolei. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>

//OTA专用的服务UUID,连接上外设后读取peripheral.services数组包含这个UUID,就支持OTA升级
#define OTA_SERVICE_UUID 0xFEF5
///如下5个特征值都是OTA升级不同阶段,用来向蓝牙写数据使用的
#define OTA_MEM_DEV_UUID @"8082CAA8-41A6-4021-91C6-56F9B954CC34"
#define OTA_GPIO_MAP_UUID @"724249F0-5EC3-4B5F-8804-42345AF08651"
#define OTA_PATCH_LEN_UUID @"9D84B9A3-000C-49D8-9183-855B673FDA31"
#define OTA_PATCH_DATA_UUID @"457871E8-D516-4CA1-9116-57D0B17B9CB2"
///Dialog有2种OTA升级模式,好牙使用SPOTA,下面这个是SPOTA-Notify特征值
#define OTA_SERV_STATUS_UUID @"5F78DF94-798C-46F5-990A-B3EB6A065C88"
//Dialog的另一种SUOTA升级Notify特征值,好牙暂未使用
//#define OTA_MEM_INFO_UUID @"6C53DB25-47A1-45FE-A022-7C92FB334FD4"


#define memoryType 0x13
#define memoryBank 0
#define spiMOSIAddress 0x06
#define spiMISOAddress 0x05
#define spiCSAddress 0X03
#define spiSCKAddress 0x00

typedef enum {
// Value zero must not be used !! Notifications are sent when status changes.
AiBrush_SRV_STARTED = 0x01, // Valid memory device has been configured by initiator. No sleep state while in this mode
AiBrush_CMP_OK = 0x02, // SPOTA process completed successfully.
AiBrush_SRV_EXIT = 0x03, // Forced exit of SPOTAR service.
AiBrush_CRC_ERR = 0x04, // Overall Patch Data CRC failed
AiBrush_PATCH_LEN_ERR = 0x05, // Received patch Length not equal to PATCH_LEN characteristic value
AiBrush_EXT_MEM_WRITE_ERR= 0x06, // External Mem Error (Writing to external device failed)
AiBrush_INT_MEM_ERR = 0x07, // Internal Mem Error (not enough space for Patch)
AiBrush_INVAL_MEM_TYPE = 0x08, // Invalid memory device
AiBrush_APP_ERROR = 0x09, // Application error
// SUOTAR application specific error codes
AiBrush_IMG_STARTED = 0x10, // SPOTA started for downloading image (SUOTA application)
AiBrush_INVAL_IMG_BANK = 0x11, // Invalid image bank
AiBrush_INVAL_IMG_HDR = 0x12, // Invalid image header
AiBrush_INVAL_IMG_SIZE = 0x13, // Invalid image size
AiBrush_INVAL_PRODUCT_HDR= 0x14, // Invalid product header
AiBrush_SAME_IMG_ERR = 0x15, // Same Image Error
AiBrush_EXT_MEM_READ_ERR = 0x16, // Failed to read from external memory device
} AiBrush_STATUS_VALUES;


@protocol DialogOTAToolDelegate <NSObject>

/*
*返回升级进度至主界面
return update progress to mainscreen
如果progress=1;则写入失败
*/
- (void)returnUpdateProgress:(double)progress;
/*
*返回升级结果至主界面
*/
- (void)returnUpdateResult:(BOOL)isSuccess errorMsg:(NSString*)errorMsg ;
@end



@interface DialogOTATool : NSObject

+ (instancetype)shared;

@property (nonatomic, weak) id <DialogOTAToolDelegate> delegate;

- (void)OTAupdate:(NSString *)fileStr;
- (void)rebootDevice;

///如下4个方法:在你的蓝牙中心管理者中调用,用法请参考“好牙”App
@property (nonatomic, weak) CBPeripheral *peripheral;
- (void)analyzeBleValueForCharacteristic:(CBCharacteristic *)characteristic;
- (void)judgeIfDoStepForOTA;
//- (void)judgeIfOTAService:(CBService *)service andOpenOTANotifyForPeripheral:(CBPeripheral *)peripheral;
- (void)judgeIfOTACharacteristics:(NSArray *)characteristics andOpenOTANotifyForPeripheral:(CBPeripheral *)peripheral;

@end


+ 41
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELAILinkBleManager+SmartRing.h ファイルの表示

@@ -0,0 +1,41 @@
//
// ELAILinkBleManager+SmartRing.h
// Elink
//
// Created by 周鹏 on 2023/7/31.
// Copyright © 2023 iot_iMac. All rights reserved.
//

#import "ELAILinkBleManager.h"

NS_ASSUME_NONNULL_BEGIN
@interface ELAILinkBleManager (SmartRing)

//APP 获取设备基础信息(Type:01)
- (NSData *)smartRingGetStatus;
/* 设置体检模式,打开 */
-(NSData *)smartRingSetCheck;
/* 设置体检模式,关闭 */
-(NSData *)smartRingCloseCheck;
/* 设置/获取日常检测周期 */
-(NSData *)smartRingSetDetectionPeriodWithInterval:(NSInteger)interval;
/* 获取历史记录 */
-(NSData *)smartRingReocrdWithType:(NSInteger)type;
//APP获取设备状态(Type:06)
- (NSData *)smartRingGetDeviceStatus;
//设置Unix时间(Type:07)
- (NSData *)smartRingSetUnix;
/* 获取日常检测周期开关 */
- (NSData *)smartRingGetAutoCheckOpen;
/* 设置日常检测周期开关 */
- (NSData *)smartRingSetAutoCheckOpen:(BOOL)open;
/* 获取JF传感器信息 */
- (NSData *)smartRingGetJFInfo;
/* 设置RRI */
- (NSData *)smartRingSetRRIWithType:(NSInteger)type;
/* 获取RRI */
- (NSData *)smartRingGetRRI;

@end

NS_ASSUME_NONNULL_END

+ 74
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELAILinkBleManager+WIFI.h ファイルの表示

@@ -0,0 +1,74 @@
//
// ELAILinkBleManager+WIFI.h
// AILinkBleSDK
//
// Created by LarryZhang on 2023/3/31.
//

#import "ELAILinkBleManager.h"

NS_ASSUME_NONNULL_BEGIN

@interface ELAILinkBleManager (WIFI)

//============ Bluetooth WIFI calling method(蓝牙WIFI 设置命令) ==============

/**
WIFI initiate connection and disconnect(WIFI 发起连接、断开连接)
@param connect YES: initiate connection NO: disconnect(YES:发起连接 NO:断开连接)
*/
- (void)bleWifiSetupWifiConnect:(BOOL)connect;

/**
Set WIFI access URL(设置WIFI访问URL)
@param url url(Not more than 56chars(不超过56chars))
*/
- (void)bleWifiSetURL:(NSString *)url;

/**
Set Wifi access port number(设置Wifi访问端口号)
@param port 端口号
*/
- (void)bleWifiSetPort:(int)port;

/**
Set WIFI access path(设置WIFI访问path)
@param path path(Not more than 56chars(不超过56chars))
*/
- (void)bleWifiSetPath:(NSString *)path;

//Get WIFI access URL(设置WIFI访问URL)
- (void)bleWifiGetURL;

//Get Wifi access port number(设置Wifi访问端口号)
- (void)bleWifiGetPort;

//Get WIFI access path(设置WIFI访问path)
- (void)bleWifiGetPath;


/**
Set DTIM interval(设置DTIM间隔)
@param interval 间隔
*/
- (void)bleWifiSetDTIMInterval:(int)interval;

/**
Set WIFI password(设置WIFI密码)
@param pwd WIFI password (8 ~ 56 chars)(WIFI密码(8~56 个chars))
*/
- (void)bleWifiSetWifiPwd:(NSString *)pwd;

/**
Set up connected WIFI(设置连接的WIFI)
@param macData wifi MAC (little endian)(wifi的MAC(小端序))
*/
- (void)bleWifiSetConnectWifiMac:(NSData *)macData;

//解析
- (void)parseA6WifiPacket:(NSData *)packet;

@end


NS_ASSUME_NONNULL_END

+ 170
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELAILinkBleManager.h ファイルの表示

@@ -0,0 +1,170 @@
//
// ELAILinkBleManager.h
//
// Created by LarryZhang on 2022/8/13.
// Copyright © 2022 iot_iMac. All rights reserved.
//


#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>

#import "NELBleManagerHeader.h"
#import "ELSDKHeader.h"
#import "AILinkBleSDK_Version.h"

#import "ELAILinkBleManagerProtocol.h"
#import "ELAILinkPeripheral.h"

NS_ASSUME_NONNULL_BEGIN

@class ELAILinkPeripheral;
@class ELBleWifiDetailModel;

@protocol ELAILinkBleWifiDelegate;
@protocol ELAILinkBleManagerDelegate;

@interface ELAILinkBleManager : NSObject

//不是必须使用单例
+ (instancetype)sharedManager;
- (NSString *)sdkVersion;
+ (NSString *)sdkVersion;

//扫描状态
@property(nonatomic, assign, readonly, getter=isScanning) BOOL scanning;

//BLE设备连接状态
@property(nonatomic, assign, readonly) NELBleManagerConnectState connectState;

@property(nonatomic, strong, readonly) CBCentralManager *central;

@property (nonatomic, weak) id<ELAILinkBleManagerDelegate> delegate DEPRECATED_MSG_ATTRIBUTE("use 'ailinkDelegate' only");

@property (nonatomic, weak) id<ELAILinkBleManagerDelegate> ailinkDelegate;

//Bluetooth wifi proxy(蓝牙wifi代理)
@property (nonatomic, weak) id<ELAILinkBleWifiDelegate> bleWifiDelegate;

//模块版本号
@property (nonatomic, copy) NSString *bmVersion;
@property (nonatomic, copy) NSString *bmVersionPro;
//电池状态
@property (nonatomic, assign) struct ELBatteryStruct battery;
//单位列表
@property (nonatomic, strong) NSArray<NSNumber *> *weightArray;
@property (nonatomic, strong) NSArray<NSNumber *> *heightArray;
@property (nonatomic, strong) NSArray<NSNumber *> *temperatureArray;
@property (nonatomic, strong) NSArray<NSNumber *> *bloodPressureArray;
@property (nonatomic, strong) NSArray<NSNumber *> *pressureArray;
@property (nonatomic, strong) NSArray<NSNumber *> *bloodSugarUnitArray;
@property (nonatomic, strong) NSArray<NSNumber *> *volumeUnitArray;

//SDK 自动重连超时 0~5秒,仅指定设备可使用此功能,其他设备可能会引起逻辑问题
@property (nonatomic, assign) NSInteger reconnectionTimeout;

@end

#pragma mark - scan
@interface ELAILinkBleManager (scan)

- (void)scanAll;
- (void)scanFilterWithCidArray:(NSArray<NSNumber *> *)cidArray;
- (void)scanFilterWithMacArray:(NSArray<NSString *> *)macArray;
- (void)scanFilterWithCidArray:(NSArray<NSNumber *> *)cidArray macArray:(NSArray<NSString *> *)macArray;
- (void)scanAllowDuplicatesFilterWithCidArray:(NSArray<NSNumber *> *)cidArray macArray:(NSArray *)macArray;

// 获取当前连接到系统的 peripheral 设备的列表(如被其它程序连接着)
- (NSArray<CBPeripheral *> *)retrieveConnectedPeripherals;

//NELBleManager
- (void)stopScan;

@end

#pragma mark - connect
@interface ELAILinkBleManager (connect)

//- (void)connectPeripheral:(CBPeripheral *)peripheral;

- (void)disconnectPeripheral;

- (void)connectAILinkPeripheral:(ELAILinkPeripheral * _Nonnull)ailinkPeripheral;

- (ELAILinkPeripheral * _Nullable)currentAILinkPeripheral;

@end

#pragma mark - send
@interface ELAILinkBleManager (send)

- (void)sendA7Payload:(NSData *)payload;
- (void)sendA7PayloadNoEncryption:(NSData *)payload;
- (void)sendA6Payload:(NSData *)payload;

/// base method of 'sendA7Payload' & 'sendA6Payload'
- (void)sendCmd:(NSData *)cmdData;

//最大发送数据长度
- (NSUInteger)maximumWriteValueLength;
//最大发送A7 payload长度
- (NSUInteger)maximumWriteA7PayloadLength;
//最大发送A6 payload长度
- (NSUInteger)maximumWriteA6PayloadLength;

//发送队列发送周期
- (void)configWriteDataQueueInterval:(CGFloat)interval;

@end

#pragma mark - Open
@interface ELAILinkBleManager (Open)

//解析指令 外部开放 Method
- (void)processA7Data:(NSMutableData *)rawData withMac:(NSData *)mac withCid:(UInt16)cid;
- (void)processA6Data:(NSMutableData *)rawData;

//生成数据包 外部开放 Method
- (NSData * _Nullable)makePacketA7Payload:(NSData *)payload withMac:(NSData *)mac withCid:(UInt16)cid;
- (NSData * _Nullable)makePacketA6Payload:(NSData *)payload;

@end

#pragma mark - A6Method
@interface ELAILinkBleManager (A6Method)

/**
Get Bluetooth information(获取蓝牙信息)
@param type ELInetGetCmdType (ELInetGetCmdTypeGetHandshake除外)
*/
- (void)getBluetoothInfoWithELInetGetCmdType:(ELInetGetCmdType)type;

/**
Sync the current time of phone to BLE(设置手机本地时间给蓝牙模块,只在蓝牙体脂秤等需要蓝牙模块保存历史记录时才调用)
@param enable
NO: In addition to the ability to turn off the time function, you can save part of the current (default)(除能,关闭时间功能,可省部分电流(默认))
YES:Enable, turn on the timer function timer(使能,开启计时功能定时器)
*/
- (void)syncBleNowDate:(BOOL)enable;

///仅WIFI秤调用,同步世界时间(0时区)到wifi-ble模块
- (void)syncBleGMTNowDate:(BOOL)enable;

///同步手机本地时间给mcu,每次连接成功后会自动调用
- (void)syncMCUNowDate;

///同步手机时间戳给设备 //0x45
- (void)syncUnixTimestamp;

///查询mqtt链接状态 CMD=0xC5
- (void)checkMqttState;

#pragma mark - 发现服务
- (void)discoverServiceWithUUIDString:(NSString *)UUIDString;

#pragma mark - 设置已发现特征notifyValue
- (void)setCharacteristicsNotifyValue:(BOOL)enabled;

@end

NS_ASSUME_NONNULL_END

+ 141
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELAILinkBleManagerProtocol.h ファイルの表示

@@ -0,0 +1,141 @@
//
// ELAILinkBleManagerProtocol.h
// AILinkBleSDK
//
// Created by LarryZhang on 2023/3/31.
//

#import "ELAILinkBleManager.h"

@class ELAILinkPeripheral, ELBleWifiDetailModel, ELAILinkBleManager;

NS_ASSUME_NONNULL_BEGIN

#pragma mark - ELAILinkBleManagerDelegate

@protocol ELAILinkBleManagerDelegate <NSObject>

@optional
//扫描
- (void)managerDidUpdateState:(CBCentralManager *)central;

- (void)managerScanState:(BOOL)scanning;

- (void)managerDidDiscoverPeripheral:(ELAILinkPeripheral *)peripheral;

- (void)managerDidDiscoverMorePeripheral:(NSDictionary<NSUUID *, ELAILinkPeripheral *> *)peripherals;

//连接
- (void)managerDidConnectPeripheral:(CBPeripheral *)peripheral;

- (void)managerDidFailToConnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error;

- (void)managerDidDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error;

- (void)managerDidUpdateConnect:(NELBleManagerConnectState)state;

//服务 & 特征
- (void)peripheralDidDiscoverServices:(NSArray<CBService *> *)services;

- (void)peripheralDidDiscoverCharacteristicsForService:(NSArray<CBCharacteristic *> *)characteristics;

- (void)peripheralDidUpdateNotificationStateForCharacteristic:(CBCharacteristic *)characteristic;

- (void)peripheralDidUpdateValueForCharacteristic:(CBCharacteristic *)characteristic;

- (void)didWriteValueForCharacteristic:(CBCharacteristic *)characteristic;

- (void)peripheralDidReadRSSI:(nonnull NSNumber *)RSSI;


@optional

//A7数据 payload
- (void)aiLinkBleReceiveA7Data:(NSData *)payload;
- (void)aiLinkBleReceiveA7Data:(NSData *)payload withMac:(NSData *)mac DEPRECATED_MSG_ATTRIBUTE("use 'aiLinkBleReceiveA7Data:aILinkPeripheral' instead");
- (void)aiLinkBleReceiveA7Data:(NSData *)packet aILinkPeripheral:(ELAILinkPeripheral *)aILinkPeripheral;
- (void)aiLinkBleReceiveA7Data:(NSData *)rawData manager:(ELAILinkBleManager *)manager;

//A6数据 packet
- (void)aiLinkBleReceiveA6Data:(NSData *)packet;
- (void)aiLinkBleReceiveA6Data:(NSData *)packet withMac:(NSData *)mac DEPRECATED_MSG_ATTRIBUTE("use 'aiLinkBleReceiveA6Data:aILinkPeripheral' instead");
- (void)aiLinkBleReceiveA6Data:(NSData *)packet aILinkPeripheral:(ELAILinkPeripheral *)aILinkPeripheral;
- (void)aiLinkBleReceiveA6Data:(NSData *)rawData manager:(ELAILinkBleManager *)manager;

//原始数据
- (void)aiLinkBleReceiveRawData:(NSData *)rawData aILinkPeripheral:(ELAILinkPeripheral *)aILinkPeripheral;
- (void)aiLinkBleReceiveRawData:(NSData *)rawData manager:(ELAILinkBleManager *)manager;

@end

#pragma mark - Bluetooth Wifi protocol(蓝牙Wifi协议)

@protocol ELAILinkBleWifiDelegate <NSObject>

@optional

/**
Callback Wifi details(回调Wifi详情)
@param model 模型
*/
- (void)bleWifiReceiveWifiDetailModel:(ELBleWifiDetailModel *)model;

/**
Scan nearby wifi results(扫描附近wifi结果)
@param count Number of nearby wifi(附近wifi数量)
*/
- (void)bleWifiReceiveScanedWifiCount:(int)count;

/**
Callback Wifi MAC address(回调Wifi MAC地址)
@param macData mac
*/
- (void)bleWifiReceiveWifiMacData:(NSData *_Nullable)macData;

/**
Callback WIFI password(回调WIFI密码)
@param pwd password(密码)
*/
- (void)bleWifiReceiveWifiPwd:(NSString *)pwd;

/**
Get DTIM interval (unit: ms)(获取DTIM间隔(单位:ms))
@param interval Interval (unit: ms)(间隔(单位:ms))
*/
- (void)bleWifiReceiveWifiDTIMInterval:(NSInteger)interval;

/**
Returns the visited URL(返回访问的url)
@param url url
*/
- (void)bleWifiReceiveURL:(NSString *)url;

/**
Call back wifi port number(回调wifi的端口号)
@param port 端口号
*/
- (void)bleWifiReceivePort:(UInt16)port;

//Returns the visited path(返回访问的path)
- (void)bleWifiReceivePath:(NSString *)path;

/**
Set or query the callback of the instruction execution result(设置指令蓝牙WIFI响应回调方法)
只支持蓝牙Wifi部分枚举
@param type Type of setting (设置的类型)
@param result Set result(设置的结果)
*/
- (void)bleWifiReceiceResponseType:(ELInetSetCmdType)type result:(ELSetBluetoothResponseType)result;

/**
获取会话码(deviceId)
@param code (deviceId) deviceId(0 means no:为0时表示不存在)
*/
- (void)bleWifiReceiveWifiSNCode:(int)code;

/** 返回wifi名称 */
- (void)bleWifiName:(NSString *)wifiName;

@end

NS_ASSUME_NONNULL_END

+ 37
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELAILinkPeripheral.h ファイルの表示

@@ -0,0 +1,37 @@
//
// ELAILinkPeripheral.h
// AILinkBleSDK
//
// Created by LarryZhang on 2023/3/31.
//

#import <Foundation/Foundation.h>

@class CBPeripheral;

NS_ASSUME_NONNULL_BEGIN

@interface ELAILinkPeripheral : NSObject

@property (nonatomic, strong) CBPeripheral *peripheral;

@property (nonatomic, strong) NSDictionary *advertisementData;

@property (nonatomic, strong) NSNumber *RSSI;

@property (nonatomic, assign) NSTimeInterval timestamp;

@property (nonatomic, copy) NSString *macAddressString;
@property (nonatomic, strong) NSData *macData;

@property (nonatomic, assign) UInt16 cid;

@property (nonatomic, assign) UInt16 vid;

@property (nonatomic, assign) UInt16 pid;

@property (nonatomic, strong) NSUUID *identifier;

@end

NS_ASSUME_NONNULL_END

+ 125
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELExSupportDeviceType.h ファイルの表示

@@ -0,0 +1,125 @@
//
// ELExSupportDeviceType.h
// AILinkSDKDemo
//
// Created by iot_user on 2023/4/11.
// Copyright © 2019 IOT. All rights reserved.
//

#ifndef ELExSupportDeviceType_h
#define ELExSupportDeviceType_h

/****
ELSupportDeviceType 将转移到 App 层更新维护,不再SDK中更新2023/4/11
****/

//Device types supported by Elink: Please communicate with the hardware to set(Elink支持的设备类型:请与硬件沟通后设置)
typedef NS_ENUM(NSUInteger, ELSupportDeviceType) {
ELSupportDeviceTypeUnkonwn = 0x0000 , //unknown(未知)
ELSupportDeviceTypeBlood = 0x0001 , //sphygmomanometer(血压计)
ELSupportDeviceTypeForehead = 0x0002 , //Temperature gun(额温枪)
ELSupportDeviceTypeThermometer = 0x0003 , //thermometer(体温计)
ELSupportDeviceTypeBabyScale = 0x0004 , //Baby scale(婴儿秤)
ELSupportDeviceTypeHeightGauge = 0x0005 , //Height meter(身高仪)
ELSupportDeviceTypeSmartLock = 0x000B , //Smart door lock(智能门锁)
ELSupportDeviceTypeRemoteControl = 0x000C , //Internal projection vision tester(内投影视力检查仪)
ELSupportDeviceTypeWheelMonitor = 0x000D , //TPMS(胎压转接板)
ELSupportDeviceTypeBodyFatScale = 0x000E , //Body fat scale(体脂秤)
ELSupportDeviceTypeSmatLockRemote = 0x0010 , //Smart door lock remote control(智能门锁遥控器)
ELSupportDeviceTypeBLE_WIFIScale = 0x0011 , //Ble and wifi Scale(蓝牙Wifi体脂秤)
ELSupportDeviceTypeBLE_WIFIToothbrush = 0x0012, //Bluetooth and wifi toothbrush(蓝牙wifi牙刷)
ELSupportDeviceTypeBLE_EightScale = 0x0013 , //Eight electrode scale(八电极蓝牙秤)
ELSupportDeviceTypeAnemometer = 0x0014 , //anemometer(风速计),0x0014
ELSupportDeviceTypeClampMeter = 0x0015 , //clamp meter(钳表)
ELSupportDeviceTypeWatch = 0x001D , //华盛达手表
ELSupportDeviceTypeBloodSugar = 0x001C , //blood sugar(血糖仪)
ELSupportDeviceTypeInfThermt = 0x0020 , //Infrared Thermometer(红外测温仪)
ELSupportDeviceTypeOximeter = 0x0021 , //Oximeter (血氧仪)
ELSupportDeviceTypeFaceMask = 0x0022 , //face mask(智能口罩)
ELSupportDeviceTypeCoffeeScale = 0x0024 , //咖啡秤
ELSupportDeviceTypeHeightBodyFatScale = 0x0026 , //身高体脂秤
ELSupportDeviceTypeHeightScale = 0x0028 , //身高体重仪,CID:40 (0x0028)
ELSupportDeviceTypeFoodThermometer = 0x002B, //Food Thermometer(食品温度计)
ELSupportDeviceTypeBLEToothbrush = 0x002D, //Bluetooth toothbrush(蓝牙牙刷)
ELSupportDeviceTypeHygrothermograph = 0x002E , //温湿度计
ELSupportDeviceTypeSkip = 0x002F , //跳绳
ELSupportDeviceTypeBLE_BfrEightScale = 0x0032, //MCU会计算体脂信息的八电极蓝牙秤
ELSupportDeviceTypeElectricScooter= 0x0033 , //滑板车
ELSupportDeviceTypeNutritionScale = 0x0034 , //营养秤(蓝牙连接)
ELSupportDeviceType_WiFi_Hygrothermograph = 0x0036 , //wifi温湿度计
ELSupportDeviceTypeAiFreshNutritionScale = 0x0037 , //好营养营养秤(蓝牙连接)
ELSupportDeviceTypeBLE_WIFIBlood = 0x0038 , //Bluetooth and wifi Blood(蓝牙wifi智能血压计)
ELSupportDeviceTypeFasciaGun = 0x003B , //筋膜枪
ELSupportDeviceType_4G_Hygrothermograph = 0x003A , //4g温湿度计
ELSupportDeviceTypeAutomaticThermometer = 0x003D , //61 //测温仪(蓝牙)
ELSupportDeviceType_BraceletWatch = 0x003E, //Leap手环
ELSupportDeviceTypeMeatProbe = 0x003F, //食物探针
ELSupportDeviceTypeVictorClampMeter = 0x0040, //Victor钳表
ELSupportDeviceTypeVictorNoiseMeter = 0x0043, //胜利噪音计
ELSupportDeviceTypeVictorAnemometer = 0x0044, //胜利风速计
ELSupportDeviceTypeVictorLuxMeter = 0x0045, //胜利照度计
ELSupportDeviceTypeAirDetector = 0x0048, //环境气体检测仪
ELSupportDeviceTypeTPMS智能胎压 = 0x0049, //智能胎压
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智能仪表
ELSupportDeviceType双频八电极体脂秤 = 0x0052, //双频八电极体脂秤
ELSupportDeviceTypeAirDetectorLite = 0x0053, //环境气体检测仪 不支持MQTT
ELSupportDeviceTypeHPLuxMeter = 0x0054, //华普照度计
ELSupportDeviceTypeMeatProbeBox = 0x0055, //食物探针充电盒
ELSupportDeviceTypeBodyScale = 0x0056, //Body scale(no body fat) 体重秤(无体脂)
ELSupportDeviceTypeSmartRing = 0x005D, //0x5D 智能戒指

ELSupportDeviceTypeAIFitScale = 0x005E, //好身材体脂秤(蓝牙连接)
ELSupportDeviceTypeBroadcastScale = (0xffff +0x01) , //655536 Broadcast body fat scale(AILink广播体脂秤)
ELSupportDeviceTypeBroadcastHeightGauge = (0xffff + 0x03) , //65538 广播身高仪
ELSupportDeviceTypeBroadcastScale_Lingyang = (0xffff +0x16) , //65557 凌阳广播体脂秤
ELSupportDeviceTypeBroadcastBodyScale = (0xFFFF + 0x07) , //Broadcast body scale AILink广播体重秤(无体脂)
ELSupportDeviceTypeBroadcastNutritionFoodScale = (0xffff + 0x04) , //65539 广播营养秤
ELSupportDeviceTypeBroadcastHygrothermograph = (0xffff + 0x06) , //65541 广播温湿度计
ELSupportDeviceTypeBroadcastScale_OKOK = (0xffff + 0x08) , //65543 OKOK广播体脂秤
ELSupportDeviceTypeBroadcastScale_T6 = (0xffff + 0x09) , //65544 T6广播体脂秤

};

#endif /* ELExSupportDeviceType_h */

+ 516
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELSDKHeader.h ファイルの表示

@@ -0,0 +1,516 @@
//
// ELSDKHeader.h
// AILinkSDKDemo
//
// Created by iot_user on 2019/5/10.
// Copyright © 2019 IOT. All rights reserved.
//

#ifndef ELSDKHeader_h
#define ELSDKHeader_h

#import "ELExSupportDeviceType.h"

//Bluetooth command type(蓝牙指令类型)
typedef NS_ENUM(NSUInteger, ELInetBleDataType) {
ELInetBleDataPackHead_A6 = 0xA6,
ELInetBleDataPackTail_6A = 0x6A,
ELInetBleDataPackHead_A7 = 0xA7,
ELInetBleDataPackTail_7A = 0x7A,
};

//The type of instruction acquired by Inet(Inet获取的指令类型)
typedef NS_ENUM(NSUInteger, ELInetGetCmdType) {
ELInetGetCmdTypeGetName = 0x02, //-Get the Bluetooth name(获取蓝牙名称)
ELInetGetCmdTypeGetBroadcastInterval = 0x06, //-Get broadcast interval (unit: ms)(获取广播间隔时间(单位:ms))
ELInetGetCmdTypeGetConnectedInterval = 0x08, //-Get Bluetooth connection interval(获取蓝牙连接间隔)
ELInetGetCmdTypeGetTransmittingPower = 0x0A, //-Get Bluetooth transmit power(获取蓝牙发射功率)
ELInetGetCmdTypeGetSerialPortbaudRate = 0x0C, //-Get the serial port baud rate(获取串口波特率)
ELInetGetCmdTypeGetMACAddress = 0x0D, //-Read MAC address value(读取MAC地址值)
ELInetGetCmdTypeGetBMVersion = 0x0E, //-Read the BM module software and hardware version number(读取BM模块软硬件版本号)
ELInetGetCmdTypeGetMCUVersion = 0x10, //-Obtain the MCU software and hardware version number(获取MCU软硬件版本号)
ELInetGetCmdTypeGetMACAddressType = 0x12, //-Get the big endian or little endian of the Mac address in the broadcast manufacturer's custom data(获取广播厂家自定义数据中Mac地址的大端序或小端序)
ELInetGetCmdTypeGetUUID = 0x14, //-Get service and feature UUID(获取服务和特征UUID)
ELInetGetCmdTypeGetMCUMode = 0x16, //-Get master-slave mode(获取主从模式)
ELInetGetCmdTypeGetAutoSleepTime = 0x18, //-Get automatic sleep time value(获取自动睡眠时间值)
ELInetGetCmdTypeGetMCUDate = 0x1C, //-Get the current time of the system(获取系统当前时间)
ELInetGetCmdTypeGetC_V_P_ID = 0x1E, //-Read CID, VID, PID(读取CID、VID、PID)
ELInetGetCmdTypeGetCommunicationMode = 0x20, //-Get module communication mode(获取模块通信模式)
ELInetGetCmdTypeGetConnectState = 0x26, //-Get Bluetooth and WiFi connection status(获取蓝牙和WiFi连接状态)
ELInetGetCmdTypeGetConnectStateFailCode = 0xAB, //- WiFi connection error 连接失败原因
ELInetGetCmdTypeGetBatteryState = 0x28, //-Get MCU battery status(获取MCU电池状态)
ELInetGetCmdTypeGetHandshake = 0x24, //-Encrypted handshake data returned by Bluetooth(蓝牙返回的加密的握手数据)
ELInetGetCmdTypeGetBodyFatScaleA6Data = 0x2B, //-Body fat scale 0x2B stands for A6 protocol (see the second level instructions for details)(体脂秤0x2B代表A6协议(具体见二级指令))
ELInetGetCmdTypeReadDeviceSupportUnit = 0x2C, //-APP reads the MCU end unit instruction(APP读取MCU端单位指令)
ELInetGetCmdTypeGetSendKeyState = 0x31, //-APP reads the result of sending the decoding key(APP读取下发解码秘钥的结果)
ELInetGetCmdTypeGetSmartLockA6Data = 0x34, //-Door lock 0x34 represents the A6 protocol (see the second level command for details)(门锁0x34代表A6协议(具体见二级指令))
ELInetGetCmdTypeGetBasicInfoData = 0x36, //Obtain basic device information data(获取设备基本信息数据)
ELInetGetCmdTypeSyncMCUNowDate = 0x38, //MCU request sync the current time of the system(MCU请求设置手机时间给MCU)
ELInetGetCmdTypeGetBMVersionPro = 0x46, //增强版-Read the BM module software and hardware version number(读取BM模块软硬件版本号)
#pragma mark ============ Begin 蓝牙Wifi ==============
ELInetGetCmdTypeBleWifiGetNearbyWifi = 0x80, //Get nearby Wifi(获取附近Wifi)
ELInetGetCmdTypeBleWifiReceiveWifiName = 0x81, //Reply to wifi name(回复wifi名字)
ELInetGetCmdTypeBleWifiReceiveWifiMac = 0x82, //Reply to wifi mac(回复wifi mac)
ELInetGetCmdTypeBleWifiReceiveScanResult = 0x83, //Reply to scan Wifi result(回复扫描Wifi结果)
ELInetGetCmdTypeBleWifiGetWifiMac = 0x85, //Get Wifi Mac address(获取Wifi的Mac地址)
ELInetGetCmdTypeBleWifiGetWifiPwd = 0x87, //Get Wifi password(获取Wifi密码)
ELInetGetCmdTypeBleWifiGetDTIMInterval = 0x8A, //Get DTIM interval(获取DTIM间隔)
ELInetGetCmdTypeBleWifiSetIpAddress = 0x8B, //Set the access ip address(设置访问的ip地址
ELInetGetCmdTypeBleWifiGetURL = 0x8C, //Get visited sites(获取访问的网站)
ELInetGetCmdTypeBleWifiSetPort = 0x8D, //set acces port number
ELInetGetCmdTypeBleWifiGetPort = 0x8E, //Get access port number(获取访问的端口号)
ELInetGetCmdTypeBleWifiGetSNNumber = 0x93, //Get SN number (session code:deviceId)(获取SN号(会话码:设备ID))
ELInetGetCmdTypeBleWifiName = 0x94, //获取wifi名称
ELInetGetCmdTypeBleWifiSetPathAddress = 0x96, //Set access path(设置访问的路径
ELInetGetCmdTypeBleWifiGetPathAddress = 0x97, //get access path
#pragma mark ============End 蓝牙Wifi ==============
ELInetGetCmdTypeRequestAuthorize = 0x7F, //Request device authorization (请求设备授权)
ELInetGetCmdTypeToothbrushA6Data = 0xC0, //A6 data for toothbrush(牙刷专用A6数据,详情请见协议的2级指令)(See the second order for details)
#pragma mark ============ mqtt ==============
ELInetGetCmdTypeCheckMqttState = 0xC5, //查询mqtt链接状态 CMD=0xC5
ELInetGetDevOfflineHistory = 0xF1, //获取离线历史记录
};
//Instruction type set by Inet(Inet设置的指令类型)
typedef NS_ENUM(NSUInteger, ELInetSetCmdType) {
ELInetSetCmdTypeSetName = 0x01, //Set the broadcast name(设置广播名称)
ELInetSetCmdTypeSetBroadcastInterval = 0x05, //Set the broadcast interval(设置广播间隔时间)
ELInetSetCmdTypeSetConnectedInterval = 0x07, //Set the connection interval(设置连接间隔)
ELInetSetCmdTypeSetTransmittingPower = 0x09, //Set the transmit power(设置发射功率)
ELInetSetCmdTypeSetSerialPortbaudRate = 0x0B, //Set the serial port baud rate(设置串口波特率)
ELInetSetCmdTypeSetMCUVersion = 0x0F, //Set the MCU software and hardware version number(设置MCU软硬件版本号)
ELInetSetCmdTypeSetMACAddressType = 0x11, //Set the big endian or little endian of the Mac address in the broadcast manufacturer's custom data.(设置广播厂家自定义数据中Mac地址的大端序或小端序)
ELInetSetCmdTypeSetUUID = 0x13, //Set the module's service and feature UUID(设置模块的服务和特征UUID)
ELInetSetCmdTypeSetMCUMode = 0x15, //Set the master-slave mode of the module(设置模块的主从模式)
ELInetSetCmdTypeSetAutoSleepTime = 0x17, //Set the module's automatic sleep time without connection(设置模块无连接的自动休眠时间)
ELInetSetCmdTypeSetGotoSleep = 0x19, //Set to sleep(设置进入睡眠)
ELInetSetCmdTypeSetMCUWakeUp = 0x1A, //Set module wake up(设置模块唤醒)
ELInetSetCmdTypeSyncBleNowDate = 0x1B, //Set the current time of the system(设置手机时间给蓝牙模块Type:1B、1C)
ELInetSetCmdTypeSetC_V_P_ID = 0x1D, //Set CID, VID, PID(设置CID、VID、PID)
ELInetSetCmdTypeSetCommunicationMode = 0x1F, //Set module serial port mode, I2C mode, SPI mode(设置模块串口模式、I2C模式、SPI模式)
ELInetSetCmdTypeSetMCURestart = 0x21, //Set module restart(设置模块重启)
ELInetSetCmdTypeSetFactoryDataReset = 0x22, //Set factory reset(设置恢复出厂设置)
ELInetSetCmdTypeSetHandshake = 0x23, //Encrypted handshake data returned by Bluetooth(蓝牙返回的加密的握手数据)
ELInetSetCmdTypeSetConnectState = 0x25, //Set the Bluetooth connection status(设置蓝牙连接状态)
ELInetSetCmdTypeSetMCUPowerState = 0x27, //上报电池状态
ELInetSetCmdTypeSetKey = 0x31, //APP sends the decoding key(APP下发解码秘钥)
ELInetSetCmdTypeSetSmartLockA6Data = 0x34, //Door lock 0x34 represents the A6 protocol (see the second level command for details)(门锁0x34代表A6协议(具体见二级指令))
ELInetSetCmdTypeSetBasicInfoData = 0x35, //Obtain basic device information data(获取设备基本信息数据)
ELInetSetCmdTypeSyncMCUNowDate = 0x37, //Sync the current time of the system(设置手机时间给MCU)
ELInetSetCmdTypeDevcieRequestUnixTime = 0x44, //Device request the current time stamp(设备请求手机时间戳)
ELInetSetCmdTypeSyncUnixTimeToDevice = 0x45, //Sync the current time stamp of the Device(同步手机时间戳给设备)
#pragma mark ============ 蓝牙Wifi ==============
ELInetSetCmdTypeBleWifiSetWifiMac = 0x84, //设置WIFI Mac地址
ELInetSetCmdTypeBleWifiSetWifiPwd = 0x86, //设置WIFI 密码
ELInetSetCmdTypeBleWifiSetConnectWifi = 0x88, //设置设备连接WIFI
ELInetSetCmdTypeBleWifiSetDTIMInterval = 0x89, //设置DTIM间隔
ELInetSetCmdTypeBleWifiSetWifiURL = 0x8B, //设置访问的URL
ELInetSetCmdTypeBleWifiSetWifiPort = 0x8D, //设置端口号
};

//Response to Bluetooth after device(给蓝牙进行设置后的响应)
typedef NS_ENUM(NSUInteger, ELSetBluetoothResponseType) {
ELSetBluetoothResponseTypeSuccess =0 , //success(成功)
ELSetBluetoothResponseTypeFailure =1 , //failure(失败)
ELSetBluetoothResponseTypeNoSupport =2 , //not support(不支持)
};

//Communication mode(通信模式)
typedef NS_ENUM(NSInteger, ELCommunicationModeType) {
ELCommunicationModeTypeSerialPort = 0, //Serial port mode(串口模式)
ELCommunicationModeTypeI2C = 1, //I2C mode(I2C模式)
ELCommunicationModeTypeSPI = 2, //SPI mode( SPI模式)
};
//Battery charge status (电池充电状态)
typedef NS_ENUM(NSUInteger, ELBatteryChargingState) {
ELBatteryChargingStateDefault = 0x00, //No charging (default)(没有充电(默认))
ELBatteryChargingStateWorking = 0x01, //charging(充电中)
ELBatteryChargingStateComplete = 0x02, //full charge(充满电)
ELBatteryChargingStateException = 0x03, //Abnormal charging(充电异常)
ELBatteryChargingStatePowerLow = 0x04, //Low battery(电量过低)
};


//CID,VID,PID
struct ELDIDStruct {
ELSupportDeviceType deviceType; //CID
int vendorID; //VID
int productID; //PID
};
//Battery charging state and power structur(电池充电状态和电量的结构体)
struct ELBatteryStruct {
ELBatteryChargingState state; //charging(充电状态)
int power; //Electricity(电量)(0—100%)
};
//Connection interval structure(连接间隔时间的结构体)
struct ELConnectIntervalStruct {
int interval; //Connection interval, unit: ms; range: 20-2000(连接间隔,单位:ms;范围:20-2000)
int latency; //Slave delay, value: 0-4(从设备延时,取值:0-4)
int timeout; //Connection timeout, unit: ms; Range: 1000~6000(连接超时,单位:ms; 范围: 1000~6000)
};

struct ELUUIDStruct {
char *serviceUUID; //Service UUID(服务UUID)
char *writeUUID; //For APP to send data to MCU (write)(用于 APP 下发数据到 MCU(write))
char *notifyUUID; //Used for MCU data transfer to APP (notify)(用于 MCU 数据传输到 APP (notify))
};

struct ELAutoSleepTimeStruct {
int sleepTime; //Automatic sleep time, unit: s(自动睡眠时间,单位:s)
int open; //Whether to enable low frequency broadcast after sleep: 0: not open, 1: open(睡眠后是否开启低频广播: 0:不开启 ,1:开启)
int interval; //Low frequency broadcast interval, unit: ms; range 20~2000(低频广播间隔,单位 :ms ;范围 20~2000)
};
//WiFi连接状态
typedef NS_ENUM(NSUInteger, BleWiFiConnectState) {
/// 0:没配网,没有连接,0: No connection
BleWiFiConnectStateNoWiFi = 0,
/// 1:尝试连接热点,但是失败1: Attempt to connect to the hotspot, but failed
BleWiFiConnectStateConnectFail = 1 ,
/// 2:连接热点,热点无网络,2: Connected to the hotspot, the hotspot has no network
BleWiFiConnectStateNoNetwork = 2 ,
/// 3:连接热点,热点有网络,3: Connected to the hotspot, the hotspot has a network
BleWiFiConnectStateSuccess = 3 ,
/// 4:有热点信息,未连接,4: There is hotspot information, not connected
BleWiFiConnectStateNoConnect = 4 ,
/// 5:ap信号差,连接失败
BleWiFiConnectStatePoorApSignal = 5 ,
/// 6:密码错误
BleWiFiConnectStatePasswordWrong = 6 ,
/// 7:获取不到IP,连接失败
BleWiFiConnectStateCantGetIP = 7 ,
};

//连网失败原因,对于温湿度计来说,如果 BleWiFiConnectState 状态为1,则需要判断该值,牙刷的话byte位够长,可以直接判断BleWiFiConnectState
typedef NS_ENUM(NSUInteger, BleWiFiConnectServerFaildState) {
BleWiFiConnectServerFaildState_Unknow = 0 ,
BleWiFiConnectServerFaildState_ApSignal = 1 ,
BleWiFiConnectServerFaildState_PwdWrong = 2 ,
BleWiFiConnectServerFaildState_CantGetIP = 3 ,
};


struct ELMCUStateStruct {
int connectState; //Connection status: 0: no connection 1: connected(蓝牙连接状态: 0:无连接 1:已连接 2:配对完成)
BleWiFiConnectState wifiState; //
int workState; //Working status: 0: Wake 1: Go to sleep 2: Module is ready(工作状态: 0:唤醒 1:进入休眠 2:模块准备就绪)
BleWiFiConnectServerFaildState faildState;
};

//重构
//BLE状态
typedef NS_ENUM(Byte, WMBleState) {
WMBleStateNoConnection = 0,//无连接
WMBleStateConnected = 1,//已连接
WMBleStatePaired = 2,//配对完成
WMBleStateMax = 0xFF
};
//wifi状态
typedef NS_ENUM(Byte, WMWiFiState) {
WMWiFiStateNotSetAP = 0, //未配置AP
WMWiFiStateConnectAPFail = 1, //连接AP失败,连接时密码错误、AP信号不好、主动断开都会是这个状态
WMWiFiStateConnectServerFail = 2, //与服务器通讯失败
WMWiFiStateConnectedAP = 3, //成功连接上AP
WMWiFiStateConnectingAP = 4, //正在连接AP
WMWiFiStateMax = 0xFF
};
//工作状态
typedef NS_ENUM(Byte, WMWorkState) {
WMWorkStateWakeup = 0,//唤醒
WMWorkStateSleep = 1,//进入休眠
WMWorkStateReady = 2,//模块准备就绪
WMWorkStateMax = 0xFF
};
//WiFi连接失败原因
typedef NS_ENUM(Byte, WMWorkStateFailCode) {
WMWorkStateFailCodeUnknow = 0,//未知原因
WMWorkStateFailCodeAPSignalBad = 1,//AP信号差
WMWorkStateFailCodeWrongPassword = 2,//密码错误
WMWorkStateFailCodeNoIP = 3,//获取不到IP
WMWorkStateFailCodeMax = 0xFF
};
typedef struct {
WMBleState bleState;
WMWiFiState wifiState;
WMWorkState workState;
WMWorkStateFailCode failCode;
} ELWMStateStruct, ELWMStateStruct;


#pragma mark - AiLink unit

/** Type key of unit string(单位字符串的type key) */
#define ELDeviceUnitTypeKey @"type"
/** supportUnit key */
#define ELDeviceUnitSupportUnitKey @"supportUnit"

/** Ailink unit */
typedef NS_ENUM(NSInteger, ELDeviceUnitType) {
/** Weight(重量) */
ELDeviceUnitType_Weight = 1 ,
/** length(长度) */
ELDeviceUnitType_Height = 2 ,
/** temperature(温度) */
ELDeviceUnitType_Temperature = 3 ,
/** Pressure(血压) */
ELDeviceUnitType_BloodPressure = 4 ,
/** Tire pressure(轮胎胎压压力) */
ELDeviceUnitType_Pressure = 5 ,
/**Blood sugar(血糖单位)*/
ELDeviceUnitType_BloodSugar = 6 ,
/**体积(体积单位)*/
ELDeviceUnitType_Volume = 7 ,
/**营养秤专用单位*/
ELDeviceUnitType_Nutrition = 8 ,
};

#define AiLinkBleWeightUnit_KG_Str @"kg"
#define AiLinkBleWeightUnit_Jin_Str @"斤"
#define AiLinkBleWeightUnit_LB_OZ_Str @"lb:oz"
#define AiLinkBleWeightUnit_OZ_Str @"oz"
#define AiLinkBleWeightUnit_ST_LB_Str @"st:lb"
#define AiLinkBleWeightUnit_G_Str @"g"
#define AiLinkBleWeightUnit_LB_Str @"lb"
#define AiLinkBleWeightUnit_ML_Str @"ml"
#define AiLinkBleWeightUnit_FL_OZ_Str @"fl.oz"
#define AiLinkBleWeightUnit_CC_Str @"cc"
#define AiLinkBleWeightUnit_L_Str @"l"
#define AiLinkBleWeightUnit_GAL_Str @"gal"

#define AiLinkBleWeightUnitStrDic(key) [@{AiLinkBleWeightUnit_KG_Str:@(ELDeviceWeightUnit_KG),AiLinkBleWeightUnit_Jin_Str:@(ELDeviceWeightUnit_JIN),AiLinkBleWeightUnit_LB_OZ_Str:@(ELDeviceWeightUnit_LB_OZ),AiLinkBleWeightUnit_OZ_Str:@(ELDeviceWeightUnit_OZ),AiLinkBleWeightUnit_ST_LB_Str:@(ELDeviceWeightUnit_ST_LB),AiLinkBleWeightUnit_G_Str:@(ELDeviceWeightUnit_G),AiLinkBleWeightUnit_LB_Str:@(ELDeviceWeightUnit_LB)}[key] integerValue]

//#define AiLinkBleWeightUnitDic @{@(ELDeviceWeightUnit_KG):AiLinkBleWeightUnit_KG_Str,@(ELDeviceWeightUnit_JIN):AiLinkBleWeightUnit_Jin_Str,@(ELDeviceWeightUnit_LB_OZ):AiLinkBleWeightUnit_LB_OZ_Str,@(ELDeviceWeightUnit_OZ):AiLinkBleWeightUnit_OZ_Str,@(ELDeviceWeightUnit_ST_LB):AiLinkBleWeightUnit_ST_LB_Str,@(ELDeviceWeightUnit_G):AiLinkBleWeightUnit_G_Str,@(ELDeviceWeightUnit_LB):AiLinkBleWeightUnit_LB_Str}
#define AiLinkBleWeightUnitDic @{@(ELDeviceWeightUnit_KG):AiLinkBleWeightUnit_KG_Str,@(ELDeviceWeightUnit_JIN):AiLinkBleWeightUnit_Jin_Str,@(ELDeviceWeightUnit_LB_OZ):AiLinkBleWeightUnit_LB_OZ_Str,@(ELDeviceWeightUnit_OZ):AiLinkBleWeightUnit_OZ_Str,@(ELDeviceWeightUnit_ST_LB):AiLinkBleWeightUnit_ST_LB_Str,@(ELDeviceWeightUnit_G):AiLinkBleWeightUnit_G_Str,@(ELDeviceWeightUnit_LB):AiLinkBleWeightUnit_LB_Str, @(ELDeviceWeightUnit_ML):AiLinkBleWeightUnit_ML_Str, @(ELDeviceWeightUnit_FLOZ):AiLinkBleWeightUnit_FL_OZ_Str, @(ELDeviceWeightUnit_CC):AiLinkBleWeightUnit_CC_Str, @(ELDeviceWeightUnit_L):AiLinkBleWeightUnit_L_Str, @(ELDeviceWeightUnit_GAL):AiLinkBleWeightUnit_GAL_Str}

/** AiLink Weight unit(体重单位)*/
typedef NS_ENUM(NSInteger, ELDeviceWeightUnit) {
/** kg */
ELDeviceWeightUnit_KG = 0x00 ,
/** 斤 */
ELDeviceWeightUnit_JIN = 0x01 ,
/** lb:oz */
ELDeviceWeightUnit_LB_OZ = 0x02 ,
/** oz */
ELDeviceWeightUnit_OZ = 0x03 ,
/** st:lb */
ELDeviceWeightUnit_ST_LB = 0x04 ,
/** g */
ELDeviceWeightUnit_G = 0x05 ,
/** lb */
ELDeviceWeightUnit_LB = 0x06 ,
//体积 咖啡秤有ml单位 所以协议增加体积部分
/** ml */
ELDeviceWeightUnit_ML = 0x10 ,
/** fl.oz */
ELDeviceWeightUnit_FLOZ = 0x20 ,
/** cc */
ELDeviceWeightUnit_CC = 0x30 ,
/** l */
ELDeviceWeightUnit_L = 0x40 ,
/** gal */
ELDeviceWeightUnit_GAL = 0x50 ,
/** Unsupported unit */
ELDeviceWeightUnit_Fail = 0xFF ,
};

#define AiLinkBleHeightUnit_CMStr @"cm"
#define AiLinkBleHeightUnit_InchStr @"inch"//@"in"//
#define AiLinkBleHeightUnit_FeetStr @"feet"//@"ft"//

#define AiLinkBleHeightUnitDic @{@(ELDeviceHeightUnit_CM):AiLinkBleHeightUnit_CMStr,@(ELDeviceHeightUnit_Inch):AiLinkBleHeightUnit_InchStr,@(ELDeviceHeightUnit_FT_IN):AiLinkBleHeightUnit_FeetStr}
/** AiLink Length unit(长度单位) */
typedef NS_ENUM(NSInteger, ELDeviceHeightUnit) {
/** cm */
ELDeviceHeightUnit_CM = 0x00 ,
/** inch */
ELDeviceHeightUnit_Inch = 0x01 ,
/** feet:inch */
ELDeviceHeightUnit_FT_IN = 0x02 ,
//
ELDeviceHeightUnit_M = 0x03 ,
/** Unsupported unit */
ELDeviceHeightUnit_Fail = 0xFF ,
};

#define AiLinkBleSpeedUnit_M_S @"m/s"
#define AiLinkBleSpeedUnit_KM_H @"km/h"
#define AiLinkBleSpeedUnit_FT_Min @"ft/min"
#define AiLinkBleSpeedUnit_Knots @"knots"
#define AiLinkBleSpeedUnit_MPH @"MPH"

#define AiLinkBleSpeedUnitDic @{@(ELDeviceSpeedUnit_M_S):AiLinkBleSpeedUnit_M_S,@(ELDeviceSpeedUnit_KM_H):AiLinkBleSpeedUnit_KM_H,@(ELDeviceSpeedUnit_FT_Min):AiLinkBleSpeedUnit_FT_Min,@(ELDeviceSpeedUnit_Knots):AiLinkBleSpeedUnit_Knots,@(ELDeviceSpeedUnit_MPH):AiLinkBleSpeedUnit_MPH}

/** AiLink速度单位 */
typedef NS_ENUM(NSInteger, ELDeviceSpeedUnit) {
/** m/s */
ELDeviceSpeedUnit_M_S = 0x00 ,
/** km/h */
ELDeviceSpeedUnit_KM_H = 0x01 ,
/** ft/min */
ELDeviceSpeedUnit_FT_Min = 0x02 ,
/** knots(节,海里/小时,1节=1海里/小时=1.852公里/小时) */
ELDeviceSpeedUnit_Knots = 0x03 ,
/** MPH(1 迈= 1.609344 千米/小时) */
ELDeviceSpeedUnit_MPH = 0x04 ,
/** Unsupported unit */
ELDeviceSpeedUnit_Fail = 0xFF ,
};

#define AiLinkBleTempUnit_CStr @"℃"

#define AiLinkBleTempUnit_FStr @"℉"

#define AiLinkBleTempUnitDic @{@(ELDeviceTemperatureUnit_C):AiLinkBleTempUnit_CStr,@(ELDeviceTemperatureUnit_F):AiLinkBleTempUnit_FStr}
/** AiLink Temperature unit(温度单位)*/
typedef NS_ENUM(NSInteger, ELDeviceTemperatureUnit) {
/** ℃ */
ELDeviceTemperatureUnit_C = 0x00 ,
/** ℉ */
ELDeviceTemperatureUnit_F = 0x01 ,
/** Unsupported unit */
ELDeviceTemperatureUnit_Fail = 0xFF ,
};

#define AiLinkBloodUnit_mmHgStr @"mmHg"
#define AiLinkBloodUnit_kPaStr @"kPa"

#define AiLinkBloodUnitDic @{\
@(ELDeviceBloodPressureUnit_mmhg):AiLinkBloodUnit_mmHgStr,\
@(ELDeviceBloodPressureUnit_kPa):AiLinkBloodUnit_kPaStr\
}
/** AiLink Blood pressure unit(血压单位) */
typedef NS_ENUM(NSInteger, ELDeviceBloodPressureUnit) {
/** mmhg */
ELDeviceBloodPressureUnit_mmhg = 0x00 ,
/** kPa */
ELDeviceBloodPressureUnit_kPa ,
/** Unsupported unit */
ELDeviceBloodPressureUnit_Fail ,
};

#define AiLinkBlePressureUnit_BarStr @"Bar"
#define AiLinkBlePressureUnit_PsiStr @"Psi"
#define AiLinkBlePressureUnit_KpaStr @"Kpa"

#define AiLinkBlePressureUnitDic @{@(ELDevicePressureUnit_Bar):AiLinkBlePressureUnit_BarStr,@(ELDevicePressureUnit_Psi):AiLinkBlePressureUnit_PsiStr,@(ELDevicePressureUnit_kPa):AiLinkBlePressureUnit_KpaStr}
/** AiLink Tire tire pressure unit(轮胎胎压单位) */
typedef NS_ENUM(NSInteger, ELDevicePressureUnit) {
/** kPa */
ELDevicePressureUnit_kPa = 0x00 ,
/** Psi */
ELDevicePressureUnit_Psi = 0x01 ,
/** Bar */
ELDevicePressureUnit_Bar = 0x02 ,
/** Unsupported unit */
ELDevicePressureUnit_Fail ,
};

#define AiLinkBleBloodSugarUnit_mmolStr @"mmol/L"
#define AiLinkBleBloodSugarUnit_mgStr @"mg/dL"

#define AiLinkBleBloodSugarUnitDic @{@(ELDeviceBloodSugarUnit_mmol_L):AiLinkBleBloodSugarUnit_mmolStr,@(ELDeviceBloodSugarUnit_mg_dL):AiLinkBleBloodSugarUnit_mgStr,}

typedef NS_ENUM(NSUInteger, ELDeviceBloodSugarUnit) {
ELDeviceBloodSugarUnit_mmol_L = 0x01,//mmol/L 毫摩尔/升
ELDeviceBloodSugarUnit_mg_dL = 0x02,//mg/dL 毫克/分升
ELDeviceBloodSugarUnit_Fail ,
};


#define AiLinkBleVolumeUnit_mlStr @"ml"
#define AiLinkBleVolumeUnit_flozStr @"fl.oz"
#define AiLinkBleVolumeUnit_ccStr @"cc"
#define AiLinkBleVolumeUnit_lStr @"l"
#define AiLinkBleVolumeUnit_galStr @"gal"

#define AiLinkBleVolumeUnitDic @{@(ELDeviceVolumeUnit_ML):AiLinkBleVolumeUnit_mlStr, @(ELDeviceVolumeUnit_FLOZ):AiLinkBleVolumeUnit_flozStr, @(ELDeviceVolumeUnit_CC):AiLinkBleVolumeUnit_ccStr, @(ELDeviceVolumeUnit_L):AiLinkBleVolumeUnit_lStr, @(ELDeviceVolumeUnit_GAL):AiLinkBleVolumeUnit_galStr}
/** AiLink Temperature unit(温度单位)*/
typedef NS_ENUM(NSInteger, ELDeviceVolumeUnit) {
/** ml */
ELDeviceVolumeUnit_ML = 0x00 ,
/** fl.oz */
ELDeviceVolumeUnit_FLOZ = 0x01 ,
/** cc */
ELDeviceVolumeUnit_CC = 0x02 ,
/** l */
ELDeviceVolumeUnit_L = 0x03 ,
/** gal */
ELDeviceVolumeUnit_GAL = 0x04 ,
/** Unsupported unit */
ELDeviceVolumeUnit_Fail = 0xFF ,
};

/** AiLink Nutrition unit(营养秤专用单位)*/
typedef NS_ENUM(NSInteger, ELDeviceNutritionUnit) {
/** g */
ELDeviceNutritionUnit_G = 0x00 ,
/** ml */
ELDeviceNutritionUnit_ML = 0x01 ,
/** lb.oz */
ELDeviceNutritionUnit_LBOZ = 0x02 ,
/** oz */
ELDeviceNutritionUnit_OZ = 0x03 ,
/** kg */
ELDeviceNutritionUnit_KG = 0x04 ,
/** jin */
ELDeviceNutritionUnit_JIN = 0x05 ,
/** 牛奶ml */
ELDeviceNutritionUnit_MILK_ML = 0x06 ,
/** 水ml */
ELDeviceNutritionUnit_WATER_ML = 0x07 ,
/** 牛奶floz */
ELDeviceNutritionUnit_MILK_FLOZ = 0x08 ,
/** 水floz */
ELDeviceNutritionUnit_WATER_FLOZ = 0x09 ,
/** lb. */
ELDeviceNutritionUnit_LB = 0x0A ,

/** Unsupported unit */
ELDeviceNutritionUnit_Fail = 0xFF ,
};


#pragma mark ============ 枚举 ==============
typedef NS_ENUM(NSUInteger, ELBluetoothState) {
ELBluetoothStateUnavailable, //Bluetooth is not available(蓝牙不可用)0
ELBluetoothStateAvailable, //Bluetooth available(蓝牙可用)1
ELBluetoothStateStopScan, //Stop scanning(停止扫描)2
ELBluetoothStateScaning, //Scanning(正在扫描)3
ELBluetoothStateWillConnect, //Will connect(将要连接)4
ELBluetoothStateDidConnect, //Already connected(已经连接)5
ELBluetoothStateConnectFail, //Connection error(连接出错)6
ELBluetoothStateDidDiscoverCharacteristics, //Peripheral feature callback(外设特征回调)7
ELBluetoothStateDidDisconnect, //Disconnect(断开连接)8
ELBluetoothStateDidValidationPass, //approved(通过验证)9
ELBluetoothStateFailedValidation, //Failed verification(未通过验证)10
ELBluetoothStateUnauthorized = 0XFF , //No Bluetooth permission (没有蓝牙权限)
};

//sex(性别)
typedef NS_ENUM(NSUInteger, ELBluetoothUserSex) {
ELBluetoothUserSex_Woman = 0x00,//female(女)
ELBluetoothUserSex_Man = 0x01,//male(男)
};
//设备授权结果
typedef NS_ENUM(NSUInteger, ELBluetoothDeviceAuthorizeResult) {
ELBluetoothDeviceAuthorizeResultNoAuth =0,//No(没有)
ELBluetoothDeviceAuthorizeResultAuthorized ,//Authorized(已经授权)
ELBluetoothDeviceAuthorizeResultNoNeed ,//No authorization required(不需要授权)
ELBluetoothDeviceAuthorizeResultSuccess ,//Authorization succeeded(授权成功)
};


#endif /* ELSDKHeader_h */

+ 63
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELSmartRingBleHeader.h ファイルの表示

@@ -0,0 +1,63 @@
//
// ELSmartRingBleHeader.h
// Elink
//
// Created by 周鹏 on 2023/7/31.
// Copyright © 2023 iot_iMac. All rights reserved.
//

#ifndef ELSmartRingBleHeader_h
#define ELSmartRingBleHeader_h


typedef NS_ENUM(UInt8, ELSmartRingCMD) {
ELSmartRingCMDGetStatus_Type01 = 0x01, //0x01:Type:APP 获取设备状态
ELSmartRingCMDSetCheck_Type02 = 0x02, //0x02:Type:设置体检模式
ELSmartRingCMDCheckData_Type03 = 0x03, //0x03:Type:体检模式数据
//
ELSmartRingCMDDetectionPeriod_Type04 = 0x04, //0x04:Type:P设置/获取日常检测周期
ELSmartRingCMDReocrd_Type05 = 0x05,// 获取日常检测历史记录
ELSmartRingCMDDeviceStatus_Type06 = 0x06,// APP获取设备状态
ELSmartRingCMDSetUnix_Type07 = 0x45,// 设置Unix时间
ELSmartRingCMDSetAutoCheckOpen_Type08 = 0x09,// /* 设置/获取日常检测周期开关 */

ELSmartRingCMDGetJFInfo_Type09 = 0x08,// /* 获取JF传感器信息 */

ELSmartRingCMDSetRRI_Type010 = 0x0b,// /* APP 设置定时监测rri 数量 */
ELSmartRingCMDHaveRecord_Type011 = 0x0c,// /* 设备产生历史记录提示 */

};




typedef NS_ENUM(UInt8, ELSmartRingCMDReocrd) {
ELSmartRingCMDReocrd_Start = 0x00, //0x00:开始获取历史数据
ELSmartRingCMDReocrd_Next = 0x01, //0x01:接收到一帧,请发下一帧
ELSmartRingCMDReocrd_End = 0x02, //0x02:数据接收完毕
ELSmartRingCMDReocrd_delete = 0x03, //0x03:删除历史记录
};

typedef NS_ENUM(UInt8, ELSmartRingDeviceStatus) {
ELSmartRingDeviceStatus_failed = 0x00, //历史时间未就绪(未获取unix时间)
ELSmartRingDeviceStatus_wait = 0x01, //历史时间正在处理中(已获取unix时间,在处理历史数据)
ELSmartRingDeviceStatus_success = 0x02, //历史时间已就绪(此状态才可获取设备历史记录)
};
#endif /* ELSmartRingBleHeader_h */

+ 124
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELSmartRingBleParser.h ファイルの表示

@@ -0,0 +1,124 @@
//
// ELSmartRingBleParser.h
// Elink
//
// Created by 周鹏 on 2023/7/31.
// Copyright © 2023 iot_iMac. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ELSmartRingBleHeader.h"
#import "ELSDKHeader.h"
NS_ASSUME_NONNULL_BEGIN

@class ELSmartRingBleModel;

@protocol ELSmartRingBleParserDelegate;

@interface ELSmartRingBleParser : NSObject

@property (nonatomic, weak) id<ELSmartRingBleParserDelegate> delegate;

- (void)parseA7Payload:(NSData *)payloadData;


@end

@protocol ELSmartRingBleParserDelegate <NSObject>

@optional



//:APP 获取设备状态
- (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser DeviceStatus:(ELSmartRingDeviceStatus)deviceStatus Battery:(struct ELBatteryStruct)battery wearStatue:(NSInteger)wearStatue; //wearStatue 佩戴状况 0x00:无功能0x01:静置状态0x02:非静置状态

//MCU 设置体检模式(Type:03)
- (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser SetCheck:(ELSmartRingBleModel *)smartRingBleModel;


//日常检测周期(Type:04)
- (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser
DetectionPeriod:(NSUInteger)interval;

//日常检测历史记录(Type:05)
- (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser record:(ELSmartRingBleModel *)smartRingBleModel isEnd:(BOOL)isEnd; // isEnd 有时候收多组数据 判断是否时最后一组;

//日常检测周期(Type:08)
- (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser
AutoCheck:(BOOL)open;



///* 获取JF传感器信息 */(Type:09)
- (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser
GetJFInfo:(NSString *)info;

///* 获取RRI */(Type:10)
- (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser
RRI:(NSInteger)RRI;

///* 设备产生数据提示*/(Type:11)
- (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser
haveRecord:(NSInteger)haveRecord;

@end

@interface ELSmartRingBleModel : NSObject

//设备状态数据协议版本:0x01
@property (nonatomic, assign) UInt8 version;

//时间戳
@property (nonatomic, assign) long long recordTime;//毫秒

//总条数
@property (nonatomic, assign) long long totle;
//当前条数
@property (nonatomic, assign) long long nowIndex;

//实时数据 体检数据
@property (nonatomic, assign) UInt8 checkType;

//数据内容:数据内容长度会根据MTU大小更变(实时包、体检包)
@property (nonatomic, strong) NSData *contentData;

//心率波形数据
@property (nonatomic, strong) NSArray *acdataArray;
//心率
@property (nonatomic, assign) UInt8 htrate;
//血氧
@property (nonatomic, assign) UInt8 spo;
//微循环
@property (nonatomic, assign) UInt8 bk;
//收缩压
@property (nonatomic, assign) UInt8 sbp;
//舒张压
@property (nonatomic, assign) UInt8 dbp;
//心输出
@property (nonatomic, assign) UInt8 cardiacOutput;
//外周阻力
@property (nonatomic, assign) UInt8 Rv;
//呼吸率
@property (nonatomic, assign) UInt8 rr;

//心律变异性 SDNN的正常范围为40-100ms,
@property (nonatomic, assign) UInt8 sdann;
//心律变异性 RMSSD正常值在(27±l 2)ms
@property (nonatomic, assign) UInt8 rmssd;

//心律变异性 NN50
@property (nonatomic, assign) UInt8 nn50;
//心律变异性 pnn50
@property (nonatomic, assign) UInt8 pnn50;

//rra
@property (nonatomic, strong) NSArray *rraArray;

@property (nonatomic, assign) BOOL isDataValid; //数据是否有效


@end


NS_ASSUME_NONNULL_END

+ 146
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Headers/ELSmartRingManager.h ファイルの表示

@@ -0,0 +1,146 @@
//
// ELSmartRingManager.h
// Elink
//
// Created by 周鹏 on 2023/11/17.
// Copyright © 2023 iot_iMac. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ELAILinkBleManager+SmartRing.h"
#import "ELSmartRingBleHeader.h"
#import "ELSmartRingBleParser.h"
#import "AICareComponentRingBleSDK_Version.h"

NS_ASSUME_NONNULL_BEGIN

@class ELSmartRingBleModel;
@protocol ELSmartRingManagerDelegate;
@interface ELSmartRingManager : NSObject

/* 蓝牙连接状态*/
@property (nonatomic, assign) NELBleManagerConnectState bleConnectState;

@property (nonatomic, assign) CBManagerState centralState;
//电池状态
@property (nonatomic, assign) struct ELBatteryStruct battery;

@property (nonatomic, weak) id<ELSmartRingManagerDelegate> delegate;

//监测间隔
@property (nonatomic, assign) NSInteger interval;

//日常监测 type RRI
@property (nonatomic, assign) NSInteger RRIType;

//佩戴状态
@property (nonatomic, assign) NSInteger wearStatue;
//判断是否开启日常监测
@property (nonatomic, assign) BOOL isOpenMonitoring;

//
@property (nonatomic, copy) NSString *bmVersion;

+ (instancetype)sharedManager;
- (NSString *)sdkVersion;
+ (NSString *)sdkVersion;

- (void)scanAll;
- (void)scanFilterWithCidArray:(NSArray<NSNumber *> *_Nonnull)cidArray;
- (void)scanFilterWithMacArray:(NSArray<NSString *> *_Nonnull)macArray;
- (void)scanFilterWithCidArray:(NSArray<NSNumber *> *_Nonnull)cidArray macArray:(NSArray<NSString *> *_Nonnull)macArray;
- (void)stopScan;
- (void)connectAILinkPeripheral:(ELAILinkPeripheral *)ailinkPeripheral;

-(void)smartRingGetDeviceStatus;//获取设备状态,电量和佩戴状况

-(void)smartRingReocrdWithType:(NSInteger)type;//获取日常检测历史记录 //0 开始获取 1 继续获取 2 结束获取 3 删除历史记录

-(void)smartRingSetUnix;//设置Unix时间
-(void)syncMCUNowDate; // 同步时间到设备

-(void)smartRingGetVersion;//获取Bleversion

-(void)smartRingGetAutoCheckOpen;//获取日常检测是否关闭
-(void)smartRingSetAutoCheckOpen:(BOOL)open;//APP启动/关闭日常检测

-(void)smartRingStartCheck;//开始体检
-(void)smartRingCloseCheck;//结束体检

-(void)smartRingSetDetectionPeriodWith:(NSInteger)interval;//APP设置/获取日常检测周期 0获取 其他为设置时间 单位(分钟)

-(void)smartRingGetJFInfo;//获取Mcu版本信息

-(void)startBleOTAWithPath:(NSString *)path;//开始升级

-(void)startMcuOTAWithPath:(NSString *)path;//开始升级

-(void)smartRingGetRRI;//获取体检模式
-(void)smartRingSetRRIWithType:(NSInteger)type;//设置体检模式 0 全面模式 72条RRI 1 快速模式 30条RRI

- (void)disconnectPeripheral;

@end

@protocol ELSmartRingManagerDelegate <NSObject>

@optional


//设备固件bmVersion
- (void)smartRingManager:(ELSmartRingManager *)smartRingManager getBmVersion:(NSString *)bmVersion;

//蓝牙状态
- (void)smartRingManager:(ELSmartRingManager *)smartRingManager managerDidUpdateState:(CBCentralManager *)central;

// 扫描到设备
- (void)smartRingManager:(ELSmartRingManager *)smartRingManager managerDidDiscoverPeripheral:(ELAILinkPeripheral *)peripheral;

//:连接状态
- (void)smartRingManager:(ELSmartRingManager *)smartRingManager ConnectState:(NELBleManagerConnectState)bleConnectState;


//:APP 获取设备状态,电量和佩戴状况
-(void)smartRingManager:(ELSmartRingManager *)smartRingManager DeviceStatus:(ELSmartRingDeviceStatus)deviceStatus Battery:(struct ELBatteryStruct)battery wearStatue:(NSInteger)wearStatue; //0x00:无功能 0x01:静置状态 x02:非静置状态


///* 获取RRI */(Type:10)
-(void)smartRingManager:(ELSmartRingManager *)smartRingManager RRI:(NSInteger)RRI;

//日常检测周期(Type:08)开关
-(void)smartRingManager:(ELSmartRingManager *)smartRingManager AutoCheck:(BOOL)open;
//日常检测历史记录(Type:05)//日常检测历史记录(Type:05) 一次有可给能两条数据 isEnd为Yes 表示当次记录返回结束 可以获取下一条数据 isEnd为 NO 代表 当前记录没有返回结束
-(void)smartRingManager:(ELSmartRingManager *)smartRingManager record:(ELSmartRingBleModel *)smartRingBleModel isEnd:(BOOL)isEnd;

//设备产生历史记录提示
-(void)smartRingManager:(ELSmartRingManager *)smartRingManager haveRecord:(NSInteger)haveRecord;

//MCU 设置体检模式(Type:03)
- (void)smartRingManager:(ELSmartRingManager *)smartRingManager SetCheck:(ELSmartRingBleModel *)smartRingBleModel;


//日常检测周期(Type:04)
- (void)smartRingManager:(ELSmartRingManager *)smartRingManager
DetectionPeriod:(NSUInteger)interval;

//日常检测历史记录(Type:05)
- (void)smartRingReloadRecord; // isEnd 有时候收多组数据 判断是否时最后一组;

//version
- (void)smartRingGetVersionWith:(NSString *)version; // ;

//* 获取JF传感器信息 */(Type:09)
-(void)smartRingManager:(ELSmartRingManager *)smartRingManager GetJFInfo:(NSString *)info;

//OTA下载成功

//OTA 进度
- (void)smartRingOTAUpdateProgress:(double)progress;

//OTA 失败或成功回调
- (void)smartRingOTAUpdateResult:(BOOL)isSuccess errorMsg:(NSString*)errorMsg;

@end


NS_ASSUME_NONNULL_END

+ 37
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Headers/NELBleManagerHeader.h ファイルの表示

@@ -0,0 +1,37 @@
//
// NELBleManagerHeader.h
// Elink
//
// Created by LarryZhang on 2022/9/15.
// Copyright © 2022 iot_iMac. All rights reserved.
//

#ifndef NELBleManagerHeader_h
#define NELBleManagerHeader_h


typedef NS_ENUM(NSInteger, NELBleManagerConnectState) {
NELBleManagerConnectStateUnknown = 0x00,
NELBleManagerConnectStateDisconnected = 0x01,
NELBleManagerConnectStateFailed = 0x02,
NELBleManagerConnectStateConnecting = 0x03,
NELBleManagerConnectStateConnected = 0x04,
NELBleManagerConnectStateHandShaking = 0x05,
NELBleManagerConnectStatePassed = 0x06,
NELBleManagerConnectStateFailedValidation = 0x0F,
NELBleManagerConnectStateCentralScanning = 0x80,
NELBleManagerConnectStateCentralUnknown = 0xF0,
NELBleManagerConnectStateCentralResetting = 0xF1,
NELBleManagerConnectStateCentralUnsupported = 0xF2,
NELBleManagerConnectStateCentralUnauthorized = 0xF3,
NELBleManagerConnectStateCentralPowerOff = 0xF4,
NELBleManagerConnectStateCentralPowerOn = 0xF5,
};

#endif /* NELBleManagerHeader_h */

バイナリ
healthRingDemo/AICareComponentRingBleSDK.framework/Info.plist ファイルの表示


+ 6
- 0
healthRingDemo/AICareComponentRingBleSDK.framework/Modules/module.modulemap ファイルの表示

@@ -0,0 +1,6 @@
framework module AICareComponentRingBleSDK {
umbrella header "AICareComponentRingBleSDK-umbrella.h"

export *
module * { export * }
}

+ 14
- 0
healthRingDemo/AppDelegate.h ファイルの表示

@@ -0,0 +1,14 @@
//
// AppDelegate.h
// healthRingDemo
//
// Created by 周鹏 on 2024/3/14.
//

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>


@end


+ 40
- 0
healthRingDemo/AppDelegate.m ファイルの表示

@@ -0,0 +1,40 @@
//
// AppDelegate.m
// healthRingDemo
//
// Created by 周鹏 on 2024/3/14.
//

#import "AppDelegate.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
return YES;
}


#pragma mark - UISceneSession lifecycle


- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role];
}


- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<UISceneSession *> *)sceneSessions {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}


@end

+ 11
- 0
healthRingDemo/Assets.xcassets/AccentColor.colorset/Contents.json ファイルの表示

@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

+ 13
- 0
healthRingDemo/Assets.xcassets/AppIcon.appiconset/Contents.json ファイルの表示

@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

+ 6
- 0
healthRingDemo/Assets.xcassets/Contents.json ファイルの表示

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

+ 25
- 0
healthRingDemo/Base.lproj/LaunchScreen.storyboard ファイルの表示

@@ -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" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<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>

+ 83
- 0
healthRingDemo/Base.lproj/Main.storyboard ファイルの表示

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="jBB-a1-WxC">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EeU-wr-321">
<objects>
<viewController id="Cjx-Xl-elN" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="ogO-EC-EAe"/>
<viewControllerLayoutGuide type="bottom" id="EiO-wA-A7U"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="40S-Pw-MbQ">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="vnD-vJ-Vs3">
<rect key="frame" x="0.0" y="120" width="393" height="698"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<connections>
<outlet property="dataSource" destination="Cjx-Xl-elN" id="TKQ-Ml-ymG"/>
<outlet property="delegate" destination="Cjx-Xl-elN" id="42s-lH-k7I"/>
</connections>
</tableView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Version" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aZ9-Yb-NA5">
<rect key="frame" x="32" y="103" width="329" height="12"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" white="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<viewLayoutGuide key="safeArea" id="Xoc-se-Zff"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="aZ9-Yb-NA5" firstAttribute="top" secondItem="ogO-EC-EAe" secondAttribute="bottom" id="42u-7w-S42"/>
<constraint firstAttribute="trailingMargin" secondItem="aZ9-Yb-NA5" secondAttribute="trailing" constant="16" id="6Qx-Ol-wnD"/>
<constraint firstAttribute="trailing" secondItem="vnD-vJ-Vs3" secondAttribute="trailing" id="J9B-MM-DZk"/>
<constraint firstItem="vnD-vJ-Vs3" firstAttribute="leading" secondItem="40S-Pw-MbQ" secondAttribute="leading" id="ONX-si-9Wg"/>
<constraint firstItem="EiO-wA-A7U" firstAttribute="top" secondItem="vnD-vJ-Vs3" secondAttribute="bottom" id="e4v-gg-RDW"/>
<constraint firstItem="vnD-vJ-Vs3" firstAttribute="top" secondItem="aZ9-Yb-NA5" secondAttribute="bottom" constant="5" id="lcp-o5-Ozw"/>
<constraint firstItem="aZ9-Yb-NA5" firstAttribute="leading" secondItem="40S-Pw-MbQ" secondAttribute="leadingMargin" constant="16" id="s8E-jo-lSR"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="8JJ-2E-JRg"/>
<connections>
<outlet property="tableView" destination="vnD-vJ-Vs3" id="pM6-mW-MVf"/>
<outlet property="versionLabel" destination="aZ9-Yb-NA5" id="QNE-j6-i9a"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="vwh-Y6-n7Q" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="304.80000000000001" y="432.26600985221677"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="3rV-6H-LOs">
<objects>
<navigationController id="jBB-a1-WxC" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="4Ay-6y-CPg">
<rect key="frame" x="0.0" y="59" width="393" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="Cjx-Xl-elN" kind="relationship" relationship="rootViewController" id="I1w-z4-l9K"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="7eB-dZ-u0d" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-412" y="423"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>

+ 36
- 0
healthRingDemo/ELDemoDeviceModel.h ファイルの表示

@@ -0,0 +1,36 @@
//
// ELDemoDeviceModel.h
// AILinkBleSDK_Example
//
// Created by LarryZhang on 2023/2/4.
// Copyright © 2023 zhengzida. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface ELDemoDeviceModel : NSObject

@property (nonatomic, copy) NSString *index;

@property (nonatomic, copy) NSString *imageName;

@property (nonatomic, copy) NSString *titleText;

@property (nonatomic, copy) NSString *subtitleText;

@property (nonatomic, copy) NSString *entryVCName;

@property (nonatomic, strong) NSArray<NSNumber *> *cids;

@property (nonatomic, assign) BOOL newType;


+ (instancetype)modelWithIndex:(NSString *)index imageName:(NSString *)imageName title:(NSString *)title subtitle:(NSString *)subtitle entryVCName:(NSString *)entryVCName;

+ (instancetype)modelWithIndex:(NSString *)index imageName:(NSString *)imageName title:(NSString *)title subtitle:(NSString *)subtitle entryVCName:(NSString *)entryVCName cids:(NSArray<NSNumber *> *)cids;

@end

NS_ASSUME_NONNULL_END

+ 35
- 0
healthRingDemo/ELDemoDeviceModel.m ファイルの表示

@@ -0,0 +1,35 @@
//
// ELDemoDeviceModel.m
// AILinkBleSDK_Example
//
// Created by LarryZhang on 2023/2/4.
// Copyright © 2023 zhengzida. All rights reserved.
//

#import "ELDemoDeviceModel.h"

@implementation ELDemoDeviceModel

+ (instancetype)modelWithIndex:(NSString *)index imageName:(NSString *)imageName title:(NSString *)title subtitle:(NSString *)subtitle entryVCName:(NSString *)entryVCName {
return [self modelWithIndex:index imageName:imageName title:title subtitle:subtitle entryVCName:entryVCName cids:@[] newType:NO];
}

+ (instancetype)modelWithIndex:(NSString *)index imageName:(NSString *)imageName title:(NSString *)title subtitle:(NSString *)subtitle entryVCName:(NSString *)entryVCName cids:(NSArray<NSNumber *> *)cids {
return [self modelWithIndex:index imageName:imageName title:title subtitle:subtitle entryVCName:entryVCName cids:cids newType:YES];
}

+ (instancetype)modelWithIndex:(NSString *)index imageName:(NSString *)imageName title:(NSString *)title subtitle:(NSString *)subtitle entryVCName:(NSString *)entryVCName cids:(NSArray<NSNumber *> *)cids newType:(BOOL)newType {
ELDemoDeviceModel *model = [[ELDemoDeviceModel alloc] init];
model.index = index;
model.imageName = imageName;
model.titleText = title;
model.subtitleText = subtitle;
model.entryVCName = entryVCName;
model.cids = cids;
model.newType = newType;
return model;
}


@end

+ 25
- 0
healthRingDemo/ELDemoScanVC.h ファイルの表示

@@ -0,0 +1,25 @@
//
// ELDemoScanVC.h
// AILinkBleSDK_Example
//
// Created by LarryZhang on 2022/12/12.
// Copyright © 2022 zhengzida. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@class ELAILinkPeripheral, ELDemoDeviceModel;

@interface ELDemoScanVC : UIViewController

@property (nonatomic, copy) NSArray<NSNumber *> *cids;

@property (nonatomic, copy) void (^selectedBlock)(ELAILinkPeripheral *per);

@property (nonatomic, strong) ELDemoDeviceModel *demoDeviceModel;

@end

NS_ASSUME_NONNULL_END

+ 140
- 0
healthRingDemo/ELDemoScanVC.m ファイルの表示

@@ -0,0 +1,140 @@
//
// ELDemoScanVC.m
// AILinkBleSDK_Example
//
// Created by LarryZhang on 2022/12/12.
// Copyright © 2022 zhengzida. All rights reserved.
//

#import "ELDemoScanVC.h"
#import "ELDeviceScanCell.h"
#import "ELDemoDeviceModel.h"
#import <AICareComponentRingBleSDK/ELSmartRingManager.h>
#import <AICareComponentRingBleSDK/NELBleManagerHeader.h>


@interface ELDemoScanVC () <UITableViewDelegate, UITableViewDataSource,ELSmartRingManagerDelegate>

@property (weak, nonatomic) IBOutlet UILabel *bleStatusLabel;

@property (weak, nonatomic) IBOutlet UITableView *tableView;

@property (nonatomic, strong) ELSmartRingManager *smartRingManager;



@property (nonatomic, strong) NSMutableArray<ELAILinkPeripheral *> *peripheralArray;

@end

@implementation ELDemoScanVC

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
self.bleStatusLabel.text = @"";
[self initBle];
}

- (void)dealloc {
[self deinitBle];
}

- (IBAction)closeAction:(id)sender {
[self dismissViewControllerAnimated:YES completion:nil];
}

#pragma mark - UITableViewDelegate, UITableViewDataSource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.peripheralArray.count;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 88;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
ELDeviceScanCell *cell = [ELDeviceScanCell subsribeCell];
ELAILinkPeripheral *per = self.peripheralArray[indexPath.row];
cell.iconImageView.image = [UIImage imageNamed:self.demoDeviceModel.imageName];
cell.cidValueLabel.text = [NSString stringWithFormat:@"0x%02X", per.cid];
cell.vidValueLabel.text = [NSString stringWithFormat:@"0x%02X", per.vid];
cell.pidValueLabel.text = [NSString stringWithFormat:@"0x%02X", per.pid];
cell.macValueLabel.text = per.macAddressString;
cell.rssiValueLabel.text = [NSString stringWithFormat:@"%@", per.RSSI];
return cell;

}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
ELAILinkPeripheral *per = self.peripheralArray[indexPath.row];
if (self.selectedBlock) {
self.selectedBlock(per);
}
[self dismissViewControllerAnimated:YES completion:nil];
}

#pragma mark - ELAILinkBleManagerDelegate

- (void)initBle {
[ELSmartRingManager sharedManager].delegate = self;
[self scanBle];
// self.bleManager = [[ELAILinkBleManager alloc] init];
// self.bleManager.ailinkDelegate = self;
}

- (void)scanBle {
self.peripheralArray = [NSMutableArray array];
[[ELSmartRingManager sharedManager] scanFilterWithCidArray:self.cids];
}

- (void)deinitBle {
}

-(void)smartRingManager:(ELSmartRingManager *)smartRingManager managerDidUpdateState:(CBCentralManager *)central
{
NSLog(@"%s state:%@", __func__, @(central.state));
if (central.state == CBManagerStatePoweredOn) {
[self scanBle];
} else if (central.state == CBManagerStatePoweredOff) {
}
}

-(void)smartRingManager:(ELSmartRingManager *)smartRingManager managerDidDiscoverPeripheral:(ELAILinkPeripheral *)peripheral
{
NSLog(@"managerDidDiscoverPeripheral cid:%02x vid:%02x pid:%02x mac:%@", peripheral.cid, peripheral.vid, peripheral.pid, peripheral.macAddressString);
for (int i=0; i<self.peripheralArray.count; i++) {
ELAILinkPeripheral *per = self.peripheralArray[i];
if ([per.macData isEqualToData:peripheral.macData]) {
self.peripheralArray[i] = per;
[self.tableView reloadData];
return;
}
}
[self.peripheralArray addObject:peripheral];
[self.peripheralArray sortUsingComparator:^NSComparisonResult(ELAILinkPeripheral * _Nonnull obj1, ELAILinkPeripheral * _Nonnull obj2) {
if (obj1.RSSI.integerValue < obj2.RSSI.integerValue) return NSOrderedDescending;
else if (obj1.RSSI.integerValue > obj2.RSSI.integerValue) return NSOrderedAscending;
return NSOrderedSame;
}];
[self.tableView reloadData];
}
-(void)smartRingManager:(ELSmartRingManager *)smartRingManager ConnectState:(NELBleManagerConnectState)bleConnectState
{
}



@end

+ 70
- 0
healthRingDemo/ELDemoScanVC.xib ファイルの表示

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ELDemoScanVC">
<connections>
<outlet property="bleStatusLabel" destination="Ybe-Ap-Q9L" id="nbT-JV-dhq"/>
<outlet property="tableView" destination="guQ-UM-oLs" id="9b4-OQ-WZJ"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="未连接" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ybe-Ap-Q9L">
<rect key="frame" x="181" y="48" width="52" height="24"/>
<constraints>
<constraint firstAttribute="height" constant="24" id="J7P-vQ-HmX"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="guQ-UM-oLs">
<rect key="frame" x="16" y="76" width="382" height="786"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<connections>
<outlet property="dataSource" destination="-1" id="bJk-1J-HcP"/>
<outlet property="delegate" destination="-1" id="j9q-p5-i9W"/>
</connections>
</tableView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PpK-TD-AgH">
<rect key="frame" x="359" y="45" width="39" height="30"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Close"/>
<connections>
<action selector="closeAction:" destination="-1" eventType="touchUpInside" id="Bad-fP-LJE"/>
</connections>
</button>
</subviews>
<viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="PpK-TD-AgH" secondAttribute="trailing" constant="16" id="HdE-rT-Xc2"/>
<constraint firstItem="Ybe-Ap-Q9L" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" constant="4" id="Uil-bO-taW"/>
<constraint firstItem="guQ-UM-oLs" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" constant="16" id="Wsg-Ym-zrL"/>
<constraint firstItem="PpK-TD-AgH" firstAttribute="centerY" secondItem="Ybe-Ap-Q9L" secondAttribute="centerY" id="g3C-U0-Psn"/>
<constraint firstItem="Ybe-Ap-Q9L" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="hcz-AH-plH"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="guQ-UM-oLs" secondAttribute="trailing" constant="16" id="m3e-0M-cgt"/>
<constraint firstItem="guQ-UM-oLs" firstAttribute="top" secondItem="Ybe-Ap-Q9L" secondAttribute="bottom" constant="4" id="tRc-oW-CER"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="bottom" secondItem="guQ-UM-oLs" secondAttribute="bottom" id="wbV-fW-OAh"/>
</constraints>
<point key="canvasLocation" x="139" y="152"/>
</view>
</objects>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>

+ 25
- 0
healthRingDemo/Info.plist ファイルの表示

@@ -0,0 +1,25 @@
<?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>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
</dict>
</plist>

バイナリ
healthRingDemo/RingTestDemoVC/BR01H1S1.0.0_20230923.img ファイルの表示


バイナリ
healthRingDemo/RingTestDemoVC/BR01H1S1.0.0_20240125.img ファイルの表示


バイナリ
healthRingDemo/RingTestDemoVC/JFH_01_1234a_APP-202304062057-0x1000.bin ファイルの表示


バイナリ
healthRingDemo/RingTestDemoVC/JFH_01_1234a_APP-202308280947-0xd622.bin ファイルの表示


バイナリ
healthRingDemo/RingTestDemoVC/JFH_01_1234a_APP-202309231223-0xf1d8.bin ファイルの表示


バイナリ
healthRingDemo/RingTestDemoVC/JFH_01_1234a_APP-202401021530-0xa8b3.bin ファイルの表示


+ 21
- 0
healthRingDemo/RingTestDemoVC/RingTestDemoVC.h ファイルの表示

@@ -0,0 +1,21 @@
//
// RingTestDemoVC.h
// AICareComponentRingBleSDK
//
// Created by zp on 03/11/2024.
// Copyright (c) 2024 zp. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@class ELAILinkPeripheral;

@interface RingTestDemoVC : UIViewController

@property (nonatomic, strong) ELAILinkPeripheral *per;

@end

NS_ASSUME_NONNULL_END

+ 374
- 0
healthRingDemo/RingTestDemoVC/RingTestDemoVC.m ファイルの表示

@@ -0,0 +1,374 @@
//
// RingTestDemoVC.m
// AICareComponentRingBleSDK
//
// Created by zp on 03/011/2024.
// Copyright (c) 2024 zp. All rights reserved.
//

#import "RingTestDemoVC.h"
#import <AICareComponentRingBleSDK/ELSmartRingManager.h>
@interface RingTestDemoVC () <ELSmartRingManagerDelegate>

@property (weak, nonatomic) IBOutlet UILabel *bleStatusLabel;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;

@property (weak, nonatomic) IBOutlet UITextView *logTextView;

@property (weak, nonatomic) IBOutlet UILabel *filenameLabel;

@property (weak, nonatomic) IBOutlet UILabel *BleVersionLabel;
@property (weak, nonatomic) IBOutlet UILabel *McuVersionLabel;
@property (weak, nonatomic) IBOutlet UISwitch *AutoSwitch;


@property (nonatomic, strong) ELSmartRingManager *smartRingManager;

@property (nonatomic, assign) NELBleManagerConnectState bleConnectState;

@property (nonatomic, strong) NSData *fileData;

@property (nonatomic, assign) UInt16 address;

@property (nonatomic, copy) NSString *filename;
@property (nonatomic, copy) NSString *filepath;

@end

@implementation RingTestDemoVC

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
self.bleStatusLabel.text = @"";
self.nameLabel.text = @"";
[self initBle];
}

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
}

- (void)dealloc {
[self deinitBle];
}


#pragma mark - Action


- (IBAction)getDeviceStatusAction:(id)sender {
[[ELSmartRingManager sharedManager] smartRingGetDeviceStatus];
}

- (IBAction)startBleOTAAction:(id)sender {
NSString *fileName = @"BR01H1S1.0.0_20230923.img";
// NSString *fileName = @"BR01H1S1.0.0_20240125.img";
NSString *path =[[NSBundle bundleForClass:[self class]] pathForResource:fileName ofType:nil];
_filenameLabel.text = fileName;
[[ELSmartRingManager sharedManager] startBleOTAWithPath:path];
}

- (IBAction)startMcuOTAAction:(id)sender
{
NSString *fileName = @"JFH_01_1234a_APP-202401021530-0xa8b3.bin";

// NSString *fileName = @"JFH_01_1234a_APP-202309231223-0xf1d8.bin";
NSString *path =[[NSBundle bundleForClass:[self class]] pathForResource:fileName ofType:nil];
_filenameLabel.text = fileName;
[[ELSmartRingManager sharedManager] startMcuOTAWithPath:path];
}
-(IBAction)setAutoCheckAction:(UISwitch *)sender
{
if (sender.on == YES){
[[ELSmartRingManager sharedManager] smartRingSetAutoCheckOpen:YES];
}else {
[[ELSmartRingManager sharedManager] smartRingSetAutoCheckOpen:NO];

}
}

- (IBAction)getDetectionPeriodAction:(id)sender {
[[ELSmartRingManager sharedManager] smartRingSetDetectionPeriodWith:0];
}
- (IBAction)setDetectionPeriod15Action:(id)sender {
[[ELSmartRingManager sharedManager] smartRingSetDetectionPeriodWith:15];
}
- (IBAction)setDetectionPeriod30Action:(id)sender {
[[ELSmartRingManager sharedManager] smartRingSetDetectionPeriodWith:30];
}
- (IBAction)setDetectionPeriod60Action:(id)sender {
[[ELSmartRingManager sharedManager] smartRingSetDetectionPeriodWith:60];
}

- (IBAction)getAutoCheckAction:(id)sender {
[[ELSmartRingManager sharedManager] smartRingGetAutoCheckOpen];
}


- (IBAction)startCheckAction:(id)sender {
[[ELSmartRingManager sharedManager] smartRingStartCheck];
}

- (IBAction)endCheckAction:(id)sender {
[[ELSmartRingManager sharedManager] smartRingCloseCheck];
}


- (IBAction)getRRIAction:(id)sender {
//获取RRI数 通过RRI数控制监测模式
[[ELSmartRingManager sharedManager] smartRingGetRRI];
}
- (IBAction)setRRI72Action:(id)sender {
//默认 模式 0 全面模式 1 快速模式
[[ELSmartRingManager sharedManager] smartRingSetRRIWithType:0];
}
- (IBAction)setRRI30Action:(id)sender {
//默认 模式 0 全面模式 1 快速模式
[[ELSmartRingManager sharedManager] smartRingSetRRIWithType:1];
}

- (IBAction)getRecordAction:(id)sender {
//获取日常检测历史记录 //0 开始获取 1 继续获取 2 结束获取 3 删除历史记录
[[ELSmartRingManager sharedManager] smartRingReocrdWithType:0];
}

- (IBAction)getBleVersionAction:(id)sender {
[[ELSmartRingManager sharedManager] smartRingGetVersion];
}

- (IBAction)getMcuVersionAction:(id)sender {
[[ELSmartRingManager sharedManager] smartRingGetJFInfo];
}


- (IBAction)customWriteAction:(id)sender {
}

- (IBAction)clearAction:(id)sender {
self.logTextView.text = @"";

}

- (IBAction)shareLogAction:(id)sender {
}
#pragma mark - BleManagerDelegate

- (void)initBle {
[ELSmartRingManager sharedManager].delegate = self;
[[ELSmartRingManager sharedManager] stopScan];
[[ELSmartRingManager sharedManager] connectAILinkPeripheral:self.per];
}
- (void)scanBle {
}

- (void)connect:(ELAILinkPeripheral *)peripheral {

}

- (void)deinitBle {

[ELSmartRingManager sharedManager].delegate = nil;
[[ELSmartRingManager sharedManager] disconnectPeripheral];
}


-(void)smartRingManager:(ELSmartRingManager *)smartRingManager managerDidDiscoverPeripheral:(ELAILinkPeripheral *)peripheral
{
if ([peripheral.peripheral.identifier isEqual:self.per.peripheral.identifier]) {
[[ELSmartRingManager sharedManager] stopScan];
[[ELSmartRingManager sharedManager] connectAILinkPeripheral:peripheral];
}
}
-(void)smartRingManager:(ELSmartRingManager *)smartRingManager managerDidUpdateState:(CBCentralManager *)central
{
NSLog(@"%s state:%@", __func__, @(central.state));

if (central.state == CBManagerStatePoweredOn) {
self.bleConnectState = NELBleManagerConnectStateCentralScanning;

} else if (central.state == CBManagerStatePoweredOff) {
self.bleConnectState = NELBleManagerConnectStateCentralPowerOff;
}
}

-(void)smartRingManager:(ELSmartRingManager *)smartRingManager ConnectState:(NELBleManagerConnectState)bleConnectState
{
NSLog(@"%s ConnectState :%@", __func__, @(bleConnectState));

self.bleConnectState = bleConnectState;
if (bleConnectState == ELBluetoothStateUnavailable) {
} else if (bleConnectState == NELBleManagerConnectStatePassed) {

// 同步时间到设备
[[ELSmartRingManager sharedManager] syncMCUNowDate];
// 获取蓝牙版本号
[[ELSmartRingManager sharedManager] smartRingGetVersion];
// 获取Mcu版本号
[[ELSmartRingManager sharedManager] smartRingGetJFInfo];
//获取设备信息
[[ELSmartRingManager sharedManager] smartRingGetDeviceStatus];
//获取日常监测是否开启
[[ELSmartRingManager sharedManager] smartRingGetAutoCheckOpen];
//获取监测间隔时间
[[ELSmartRingManager sharedManager] smartRingSetDetectionPeriodWith:0];
//获取监测模式返回rri数
[[ELSmartRingManager sharedManager] smartRingGetRRI];
//
}else if (bleConnectState == NELBleManagerConnectStateDisconnected)
{
}
}

-(void)smartRingManager:(ELSmartRingManager *)smartRingManager DeviceStatus:(ELSmartRingDeviceStatus)deviceStatus Battery:(struct ELBatteryStruct)battery wearStatue:(NSInteger)wearStatue
{
NSLog(@"%s DeviceStatus :%@", __func__, @(deviceStatus));
[self addLog:[NSString stringWithFormat:@"%s deviceStatus :%@ battery :%d wearStatue :%@", __func__, @(deviceStatus),battery.power,@(wearStatue)]];

if(deviceStatus == ELSmartRingDeviceStatus_failed)
{
///历史时间未就绪(未获取unix时间) 需要 先获取unix时间
[[ELSmartRingManager sharedManager] smartRingSetUnix];
}else if (deviceStatus == ELSmartRingDeviceStatus_success)
{
// 历史时间已就绪(此状态才可获取设备历史记录)
}

}

-(void)smartRingManager:(ELSmartRingManager *)smartRingManager AutoCheck:(BOOL)open
{
NSLog(@"%s AutoCheck :%@", __func__, @(open));
[self addLog:[NSString stringWithFormat:@"%s open:%@", __func__,@(open)]];
self.AutoSwitch.on = open;
}

-(void)smartRingManager:(ELSmartRingManager *)smartRingManager DetectionPeriod:(NSUInteger)interval
{
NSLog(@"%s DetectionPeriod :%@", __func__, @(interval));
[self addLog:[NSString stringWithFormat:@"%s interval:%@", __func__,@(interval)]];

}

- (void)smartRingManager:(ELSmartRingManager *)smartRingManager getBmVersion:(NSString *)bmVersion
{
NSLog(@"%s getBmVersion :%@", __func__,bmVersion);
[self addLog:[NSString stringWithFormat:@"%s bmVersion:%@", __func__,bmVersion]];
self.BleVersionLabel.text = bmVersion;

}

-(void)smartRingManager:(ELSmartRingManager *)smartRingManager GetJFInfo:(NSString *)info
{
NSLog(@"%s GetJFInfo :%@", __func__, info);
[self addLog:[NSString stringWithFormat:@"%s GetJFInfo:%@", __func__,info]];
self.McuVersionLabel.text = info;
}

//返回 RRI 条数 默认为 72条 是全面数据 30条为快速数据
-(void)smartRingManager:(ELSmartRingManager *)smartRingManager RRI:(NSInteger)RRI
{
NSLog(@"%s RRI :%@", __func__, @(RRI));
[self addLog:[NSString stringWithFormat:@"%s RRI:%@", __func__,@(RRI)]];


}

//
-(void)smartRingManager:(ELSmartRingManager *)smartRingManager record:(ELSmartRingBleModel *)smartRingBleModel isEnd:(BOOL)isEnd
{
NSLog(@"%s record :%@", __func__, @(isEnd));
[self addLog:[NSString stringWithFormat:@"%s record:%@ isEnd:%@", __func__,smartRingBleModel,@(isEnd)]];
// nowIndex == totle 表示当前为最后一页 isEnd 为no 表示 当前页还有记录数据 为 yes表示为当前页最后一条数据
if (smartRingBleModel.nowIndex < smartRingBleModel.totle )
{
if (isEnd ==YES) {
//当前页获记录取完 获取下一页记录
[[ELSmartRingManager sharedManager] smartRingReocrdWithType:1];
}
}else {
//历史记录全部获取完成
if (isEnd ==YES) {
//结束获取
[[ELSmartRingManager sharedManager] smartRingReocrdWithType:2];
//删除历史记录
[[ELSmartRingManager sharedManager] smartRingReocrdWithType:3];
}
}
}

-(void)smartRingManager:(ELSmartRingManager *)smartRingManager haveRecord:(NSInteger)haveRecord
{
NSLog(@"%s haveRecord :%@", __func__, @(haveRecord));
[self addLog:[NSString stringWithFormat:@"%s haveRecord:%@ ", __func__,@(haveRecord)]];

}

-(void)smartRingManager:(ELSmartRingManager *)smartRingManager SetCheck:(ELSmartRingBleModel *)smartRingBleModel
{
NSLog(@"%s SetCheck :%@", __func__, smartRingBleModel);
[self addLog:[NSString stringWithFormat:@"%s smartRingBleModel:%@ ", __func__,smartRingBleModel]];

}


-(void)smartRingOTAUpdateProgress:(double)progress
{
NSLog(@"%s progress :%@", __func__, @(progress));
[self addLog:[NSString stringWithFormat:@"%s progress:%@ ", __func__,@(progress)]];

}
//ble OTA 升级成功后需要充电重新激活戒指
-(void)smartRingOTAUpdateResult:(BOOL)isSuccess errorMsg:(NSString *)errorMsg
{
NSLog(@"%s isSuccess :%@ errorMsg :%@", __func__, @(isSuccess),errorMsg);
[self addLog:[NSString stringWithFormat:@"%s isSuccess:%@ errorMsg :%@", __func__,@(isSuccess),errorMsg]];


}

#pragma mark - addLog

- (void)addLog:(NSString *)log {
[self addLog:log newline:YES];
}

- (void)addWithoutNewlineLog:(NSString *)log {
[self addLog:log newline:NO];
}

- (void)addLog:(NSString *)log newline:(BOOL)newline {
NSDateFormatter *format = [[NSDateFormatter alloc] init];
format.dateFormat = @"HH:mm:ss.SSS";
NSString *time = [format stringFromDate:[NSDate date]];
if (newline) {
self.logTextView.text = [self.logTextView.text stringByAppendingFormat:@"%@ %@\n", time, log];
} else {
self.logTextView.text = [self.logTextView.text stringByAppendingFormat:@"%@ %@ ", time, log];
}
[self.logTextView scrollRangeToVisible:NSMakeRange(self.logTextView.text.length, 1)];
}


@end

+ 322
- 0
healthRingDemo/RingTestDemoVC/RingTestDemoVC.xib ファイルの表示

@@ -0,0 +1,322 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="RingTestDemoVC">
<connections>
<outlet property="AutoSwitch" destination="lF2-t0-7Xg" id="Rxa-CY-6Ur"/>
<outlet property="BleVersionLabel" destination="Ge8-hR-xpL" id="SyC-6a-CUl"/>
<outlet property="McuVersionLabel" destination="QzN-Rd-IBu" id="MWc-6e-Fi7"/>
<outlet property="bleStatusLabel" destination="Rgz-Ge-utp" id="h2s-vl-sLn"/>
<outlet property="filenameLabel" destination="xEL-Xq-ozr" id="hFL-Op-hme"/>
<outlet property="logTextView" destination="Txf-5E-hsN" id="Azk-gu-Gls"/>
<outlet property="nameLabel" destination="WAL-LB-efb" id="r9L-kX-2HA"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="K5I-eH-HGA">
<rect key="frame" x="16" y="540" width="31" height="30"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="清空"/>
<connections>
<action selector="clearAction:" destination="-1" eventType="touchUpInside" id="o2p-MO-8pL"/>
</connections>
</button>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lwE-Xr-Dac">
<rect key="frame" x="346" y="540" width="31" height="30"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="分享"/>
<connections>
<action selector="shareLogAction:" destination="-1" eventType="touchUpInside" id="aLe-00-nz6"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Stauts" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Rgz-Ge-utp">
<rect key="frame" x="0.0" y="63" width="393" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Name" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WAL-LB-efb">
<rect key="frame" x="348.66666666666669" y="63" width="40.333333333333314" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="I1h-EM-UuI" userLabel="log View">
<rect key="frame" x="8" y="578" width="377" height="240"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" indicatorStyle="white" editable="NO" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Txf-5E-hsN">
<rect key="frame" x="0.0" y="0.0" width="377" height="240"/>
<color key="backgroundColor" systemColor="labelColor"/>
<color key="textColor" systemColor="opaqueSeparatorColor"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Light" family="Helvetica Neue" pointSize="10"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="Txf-5E-hsN" secondAttribute="bottom" id="CLf-PD-bjv"/>
<constraint firstItem="Txf-5E-hsN" firstAttribute="top" secondItem="I1h-EM-UuI" secondAttribute="top" id="RHZ-uy-ZqR"/>
<constraint firstAttribute="height" constant="240" id="tIV-Tj-sO9"/>
<constraint firstItem="Txf-5E-hsN" firstAttribute="leading" secondItem="I1h-EM-UuI" secondAttribute="leading" id="vQ7-WS-tPk"/>
<constraint firstAttribute="trailing" secondItem="Txf-5E-hsN" secondAttribute="trailing" id="wsr-Tq-aYp"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="8"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="azE-ss-L4B" userLabel="功能 View">
<rect key="frame" x="0.0" y="93" width="393" height="439"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="U2W-tX-U1Z">
<rect key="frame" x="24" y="8" width="93.333333333333314" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="设备状态"/>
<connections>
<action selector="getDeviceStatusAction:" destination="-1" eventType="touchUpInside" id="pgE-AU-scR"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MNm-EU-G2q">
<rect key="frame" x="24" y="105" width="93.333333333333343" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="监测间隔"/>
<connections>
<action selector="getDetectionPeriodAction:" destination="-1" eventType="touchUpInside" id="wPg-6V-Nd5"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7tV-LN-Ahy">
<rect key="frame" x="24" y="59" width="128" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="获取历史记录"/>
<connections>
<action selector="getRecordAction:" destination="-1" eventType="touchUpInside" id="wMi-he-lyu"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="文件名:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yjv-bo-uHm">
<rect key="frame" x="24" y="334" width="70" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="-" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xEL-Xq-ozr">
<rect key="frame" x="37" y="361" width="332" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nar-LV-XAV">
<rect key="frame" x="24" y="153" width="115" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="开始BleOTA"/>
<connections>
<action selector="startBleOTAAction:" destination="-1" eventType="touchUpInside" id="BI4-1s-3vR"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="J0u-s2-dGj">
<rect key="frame" x="226" y="8" width="94" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="监测开关"/>
<connections>
<action selector="getAutoCheckAction:" destination="-1" eventType="touchUpInside" id="rVm-Rf-ZJy"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3e5-a3-xgi">
<rect key="frame" x="164" y="59" width="94" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="开始体检"/>
<connections>
<action selector="startCheckAction:" destination="-1" eventType="touchUpInside" id="3HC-av-Qaf"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fHr-1P-fIh">
<rect key="frame" x="275" y="58" width="94" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="结束体检"/>
<connections>
<action selector="endCheckAction:" destination="-1" eventType="touchUpInside" id="ote-Hf-uny"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MiO-No-KFd">
<rect key="frame" x="149" y="153" width="124" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="开始McuOTA"/>
<connections>
<action selector="startMcuOTAAction:" destination="-1" eventType="touchUpInside" id="GOf-fM-VE0"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="-" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ge8-hR-xpL">
<rect key="frame" x="37" y="246" width="332" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="-" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QzN-Rd-IBu">
<rect key="frame" x="37" y="310" width="332" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lF2-t0-7Xg">
<rect key="frame" x="322" y="10" width="49" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<connections>
<action selector="setAutoCheckAction:" destination="-1" eventType="valueChanged" id="I7I-ld-Rij"/>
</connections>
</switch>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="idY-tz-Mtg">
<rect key="frame" x="214" y="105" width="80" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="30分钟"/>
<connections>
<action selector="setDetectionPeriod30Action:" destination="-1" eventType="touchUpInside" id="eLh-5K-JwZ"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="feb-Qf-rch">
<rect key="frame" x="130" y="105" width="77" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="15分钟"/>
<connections>
<action selector="setDetectionPeriod15Action:" destination="-1" eventType="touchUpInside" id="8PS-P7-kDr"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aY3-ex-ZWu">
<rect key="frame" x="300" y="105" width="80" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="60分钟"/>
<connections>
<action selector="setDetectionPeriod60Action:" destination="-1" eventType="touchUpInside" id="FHN-Dp-FkC"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="EG6-Wy-FZe">
<rect key="frame" x="23" y="203" width="104" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="BleVersion"/>
<connections>
<action selector="getBleVersionAction:" destination="-1" eventType="touchUpInside" id="buT-A6-dmF"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rLA-QP-JMf">
<rect key="frame" x="23" y="268" width="114" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="McuVersion"/>
<connections>
<action selector="getMcuVersionAction:" destination="-1" eventType="touchUpInside" id="oVb-mw-Y4Z"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mDO-P1-1UC">
<rect key="frame" x="285" y="152" width="94" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="监测模式"/>
<connections>
<action selector="getRRIAction:" destination="-1" eventType="touchUpInside" id="Q1f-xw-wLV"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uhX-kB-IUS">
<rect key="frame" x="179" y="202" width="94" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="全面模式"/>
<connections>
<action selector="setRRI72Action:" destination="-1" eventType="touchUpInside" id="q5j-gO-ElT"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="az2-XH-ot0">
<rect key="frame" x="285" y="202" width="94" height="35"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="快速模式"/>
<connections>
<action selector="setRRI30Action:" destination="-1" eventType="touchUpInside" id="1CD-aw-Ckq"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemGroupedBackgroundColor"/>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="Rgz-Ge-utp" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="26n-ac-URx"/>
<constraint firstItem="K5I-eH-HGA" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" constant="16" id="43e-FM-L00"/>
<constraint firstItem="Rgz-Ge-utp" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="Cuz-sL-8PR"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="bottom" secondItem="I1h-EM-UuI" secondAttribute="bottom" id="Dfj-32-bLS"/>
<constraint firstItem="I1h-EM-UuI" firstAttribute="top" secondItem="K5I-eH-HGA" secondAttribute="bottom" constant="8" symbolic="YES" id="EN4-TU-LIY"/>
<constraint firstItem="azE-ss-L4B" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="JlE-Dp-hIX"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="WAL-LB-efb" secondAttribute="trailing" constant="4" id="MhU-Hs-w4k"/>
<constraint firstItem="Rgz-Ge-utp" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" constant="4" id="NV7-q2-a68"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="I1h-EM-UuI" secondAttribute="trailing" constant="8" id="Ulp-Zv-w68"/>
<constraint firstItem="K5I-eH-HGA" firstAttribute="top" secondItem="azE-ss-L4B" secondAttribute="bottom" constant="8" symbolic="YES" id="WRu-in-ogB"/>
<constraint firstItem="WAL-LB-efb" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" constant="4" id="XIl-gr-jVM"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="lwE-Xr-Dac" secondAttribute="trailing" constant="16" id="aZt-4V-Vkm"/>
<constraint firstItem="azE-ss-L4B" firstAttribute="top" secondItem="Rgz-Ge-utp" secondAttribute="bottom" constant="12" id="fYB-Uh-Fpd"/>
<constraint firstItem="I1h-EM-UuI" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" constant="8" id="mGL-Xz-QuQ"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="Rgz-Ge-utp" secondAttribute="trailing" id="myT-ol-sQQ"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="azE-ss-L4B" secondAttribute="trailing" id="tzl-FC-TVu"/>
<constraint firstItem="I1h-EM-UuI" firstAttribute="top" secondItem="lwE-Xr-Dac" secondAttribute="bottom" constant="8" symbolic="YES" id="zvN-yN-K2g"/>
</constraints>
<point key="canvasLocation" x="52.671755725190835" y="19.718309859154932"/>
</view>
</objects>
<resources>
<systemColor name="labelColor">
<color red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="opaqueSeparatorColor">
<color red="0.77647058823529413" green="0.77647058823529413" blue="0.78431372549019607" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemGroupedBackgroundColor">
<color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>

+ 15
- 0
healthRingDemo/SceneDelegate.h ファイルの表示

@@ -0,0 +1,15 @@
//
// SceneDelegate.h
// healthRingDemo
//
// Created by 周鹏 on 2024/3/14.
//

#import <UIKit/UIKit.h>

@interface SceneDelegate : UIResponder <UIWindowSceneDelegate>

@property (strong, nonatomic) UIWindow * window;

@end


+ 57
- 0
healthRingDemo/SceneDelegate.m ファイルの表示

@@ -0,0 +1,57 @@
//
// SceneDelegate.m
// healthRingDemo
//
// Created by 周鹏 on 2024/3/14.
//

#import "SceneDelegate.h"

@interface SceneDelegate ()

@end

@implementation SceneDelegate


- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
}


- (void)sceneDidDisconnect:(UIScene *)scene {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}


- (void)sceneDidBecomeActive:(UIScene *)scene {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}


- (void)sceneWillResignActive:(UIScene *)scene {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
}


- (void)sceneWillEnterForeground:(UIScene *)scene {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
}


- (void)sceneDidEnterBackground:(UIScene *)scene {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
}


@end

+ 26
- 0
healthRingDemo/View/ELDemoButton.h ファイルの表示

@@ -0,0 +1,26 @@
//
// ELDemoButton.h
// AILinkBleSDK_Example
//
// Created by LarryZhang on 2023/2/4.
// Copyright © 2023 zhengzida. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

IB_DESIGNABLE
@interface ELDemoButton : UIButton

@property (nonatomic, assign) IBInspectable CGFloat cornerRadius;
@property (nonatomic, assign) IBInspectable CGFloat borderWidth;
@property (nonatomic, strong) IBInspectable UIColor *borderColor;
@property (nonatomic, strong) IBInspectable UIColor *mainColor;

@property (nonatomic, assign) IBInspectable BOOL disabled;
@property (nonatomic, assign) IBInspectable BOOL lighted;

@end

NS_ASSUME_NONNULL_END

+ 94
- 0
healthRingDemo/View/ELDemoButton.m ファイルの表示

@@ -0,0 +1,94 @@
//
// ELDemoButton.m
// AILinkBleSDK_Example
//
// Created by LarryZhang on 2023/2/4.
// Copyright © 2023 zhengzida. All rights reserved.
//

#import "ELDemoButton.h"

@interface ELDemoButton ()

@property (nonatomic, strong) UIColor *bgColor;

@end

@implementation ELDemoButton

- (void)setCornerRadius:(CGFloat)cornerRadius {
self.layer.masksToBounds = YES;
self.layer.cornerRadius = cornerRadius;
}

- (void)setBorderWidth:(CGFloat)borderWidth {
self.layer.borderWidth = borderWidth;
}

- (void)setBorderColor:(UIColor *)borderColor {
self.layer.borderColor = borderColor.CGColor;
}

- (CGFloat)cornerRadius {
return self.layer.cornerRadius;
}

- (CGFloat)borderWidth {
return self.layer.borderWidth;
}

- (UIColor *)borderColor {
return [UIColor colorWithCGColor:self.layer.borderColor];
}

- (UIColor *)mainColor {
if (_mainColor == nil) {
_mainColor = UIColor.blueColor;
}
return _mainColor;
}

- (void)setDisabled:(BOOL)disabled {
_disabled = disabled;
self.enabled = !disabled;
if (disabled) {
self.bgColor = UIColor.clearColor;
} else {
self.lighted = self.lighted;
}
}

- (void)setLighted:(BOOL)lighted {
_lighted = lighted;
if (lighted) {
self.bgColor = self.mainColor;
} else {
self.bgColor = UIColor.clearColor;
}
}

- (void)setBgColor:(UIColor *)bgColor {
_bgColor = bgColor;
self.backgroundColor = bgColor;
if (bgColor == UIColor.clearColor) {
[self setTitleColor:self.mainColor forState:UIControlStateNormal];
} else if ([self isDeepColor:bgColor]) {
[self setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
} else {
[self setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
}
}

- (BOOL)isDeepColor:(UIColor *)color {
CIColor *ciColor = [CIColor colorWithCGColor:color.CGColor];
CGFloat r = ciColor.red * 255;
CGFloat g = ciColor.green * 255;
CGFloat b = ciColor.blue * 255;
CGFloat y = r * 0.299 + g * 0.587 + b * 0.114;
if (y >= 192) {
return false;
}
return true;
}

@end

+ 27
- 0
healthRingDemo/View/ELDemoView.h ファイルの表示

@@ -0,0 +1,27 @@
//
// ELDemoView.h
// AILinkBleSDK_Example
//
// Created by LarryZhang on 2023/2/6.
// Copyright © 2023 zhengzida. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

IB_DESIGNABLE
@interface ELDemoView : UIView

@property (nonatomic, assign) IBInspectable CGFloat cornerRadius;
@property (nonatomic, assign) IBInspectable CGFloat borderWidth;
@property (nonatomic, strong) IBInspectable UIColor *borderColor;

@property (nonatomic, assign) IBInspectable CGFloat shadowRadius;
@property (nonatomic, assign) IBInspectable CGFloat shadowOpacity;
@property (nonatomic, assign) IBInspectable CGSize shadowOffset;
@property (nonatomic, strong) IBInspectable UIColor *shadowColor;

@end

NS_ASSUME_NONNULL_END

+ 70
- 0
healthRingDemo/View/ELDemoView.m ファイルの表示

@@ -0,0 +1,70 @@
//
// ELDemoView.m
// AILinkBleSDK_Example
//
// Created by LarryZhang on 2023/2/6.
// Copyright © 2023 zhengzida. All rights reserved.
//

#import "ELDemoView.h"

@implementation ELDemoView

- (void)setCornerRadius:(CGFloat)cornerRadius {
self.layer.cornerRadius = cornerRadius;
}

- (void)setBorderWidth:(CGFloat)borderWidth {
self.layer.borderWidth = borderWidth;
}

- (void)setBorderColor:(UIColor *)borderColor {
self.layer.borderColor = borderColor.CGColor;
}

- (CGFloat)cornerRadius {
return self.layer.cornerRadius;
}

- (CGFloat)borderWidth {
return self.layer.borderWidth;
}

- (UIColor *)borderColor {
return [UIColor colorWithCGColor:self.layer.borderColor];
}

- (void)setShadowRadius:(CGFloat)shadowRadius {
self.layer.shadowRadius = shadowRadius;
}

- (void)setShadowOpacity:(CGFloat)shadowOpacity {
self.layer.shadowOpacity = shadowOpacity;
}

- (void)setShadowOffset:(CGSize)shadowOffset {
self.layer.shadowOffset = shadowOffset;
}

- (void)setShadowColor:(UIColor *)shadowColor {
self.layer.shadowColor = shadowColor.CGColor;
}

- (CGFloat)shadowRadius {
return self.layer.shadowRadius;
}

- (CGFloat)shadowOpacity {
return self.layer.shadowOpacity;
}

- (CGSize)shadowOffset {
return self.layer.shadowOffset;
}

- (UIColor *)shadowColor {
return [UIColor colorWithCGColor:self.layer.shadowColor];
}


@end

+ 40
- 0
healthRingDemo/View/ELDeviceScanCell.h ファイルの表示

@@ -0,0 +1,40 @@
//
// ELDeviceScanCell.h
// AILinkBleSDK_Example
//
// Created by LarryZhang on 2022/12/12.
// Copyright © 2022 zhengzida. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface ELDeviceScanCell : UITableViewCell

@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;

@property (weak, nonatomic) IBOutlet UILabel *cidValueLabel;

@property (weak, nonatomic) IBOutlet UILabel *vidValueLabel;

@property (weak, nonatomic) IBOutlet UILabel *pidValueLabel;


@property (weak, nonatomic) IBOutlet UILabel *macValueLabel;

@property (weak, nonatomic) IBOutlet UILabel *rssiValueLabel;


@property (weak, nonatomic) IBOutlet UILabel *timeValueLabel;



//复用机制
+ (instancetype)subsribeCell:(UITableView *)tableView;
//不使用复用机制
+ (instancetype)subsribeCell;

@end

NS_ASSUME_NONNULL_END

+ 39
- 0
healthRingDemo/View/ELDeviceScanCell.m ファイルの表示

@@ -0,0 +1,39 @@
//
// ELDeviceScanCell.m
// AILinkBleSDK_Example
//
// Created by LarryZhang on 2022/12/12.
// Copyright © 2022 zhengzida. All rights reserved.
//

#import "ELDeviceScanCell.h"

@implementation ELDeviceScanCell

+ (instancetype)subsribeCell:(UITableView *)tableView {
NSString *identifier = NSStringFromClass([self class]);
id cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if (cell == nil) {
UINib *nib = [UINib nibWithNibName:identifier bundle:nil];
[tableView registerNib:nib forCellReuseIdentifier:identifier];
cell = [tableView dequeueReusableCellWithIdentifier:identifier];
}
return cell;
}

+ (instancetype)subsribeCell {
return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:self options:nil].firstObject;
}

- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];

// Configure the view for the selected state
}

@end

+ 171
- 0
healthRingDemo/View/ELDeviceScanCell.xib ファイルの表示

@@ -0,0 +1,171 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="103" id="KGk-i7-Jjw" customClass="ELDeviceScanCell">
<rect key="frame" x="0.0" y="0.0" width="366" height="103"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="366" height="103"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jOU-QB-C99">
<rect key="frame" x="8" y="4" width="350" height="95"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Hkv-dE-Igc">
<rect key="frame" x="8" y="8" width="79" height="79"/>
<constraints>
<constraint firstAttribute="width" secondItem="Hkv-dE-Igc" secondAttribute="height" id="ZqG-XM-136"/>
</constraints>
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="L4D-es-cDG">
<rect key="frame" x="95" y="8" width="255.5" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="CID: " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cKy-Zu-0Fz">
<rect key="frame" x="0.0" y="0.0" width="31.5" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0x003F" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="81b-7G-z0Y">
<rect key="frame" x="31.499999999999996" y="0.0" width="49.5" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" VID: " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hWx-D7-NLc">
<rect key="frame" x="81" y="0.0" width="38.5" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0x0002" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EUS-Jq-QBt">
<rect key="frame" x="119.5" y="0.0" width="50" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" PID: " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hCl-Ub-6Yf">
<rect key="frame" x="169.5" y="0.0" width="38" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0x0001" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wpb-lM-MpP">
<rect key="frame" x="207.5" y="0.0" width="48" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="20" id="TUS-52-hBR"/>
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mU8-MW-7fB">
<rect key="frame" x="95" y="32" width="228" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="MAC: " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pZN-Pt-0bV">
<rect key="frame" x="0.0" y="0.0" width="39" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="11:22:33:44:55:66" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="o0x-d6-np1">
<rect key="frame" x="39" y="0.0" width="119.5" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" RSSI: " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2rJ-Tx-jYu">
<rect key="frame" x="158.5" y="0.0" width="45.5" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="-60" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2BX-yo-yit">
<rect key="frame" x="204" y="0.0" width="24" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="20" id="Qx2-3j-kzF"/>
</constraints>
</stackView>
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JMw-hs-LJD">
<rect key="frame" x="95" y="56" width="93" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="time: " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NPZ-PU-Wgh">
<rect key="frame" x="0.0" y="0.0" width="36" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="19:22:32" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gJs-v4-5Mw">
<rect key="frame" x="36" y="0.0" width="57" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="20" id="aNI-fv-u2p"/>
</constraints>
</stackView>
</subviews>
<color key="backgroundColor" systemColor="systemGray6Color"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="Hkv-dE-Igc" secondAttribute="bottom" constant="8" id="72I-PI-aGJ"/>
<constraint firstItem="mU8-MW-7fB" firstAttribute="top" secondItem="L4D-es-cDG" secondAttribute="bottom" constant="4" id="Eic-Aj-eFs"/>
<constraint firstItem="Hkv-dE-Igc" firstAttribute="top" secondItem="jOU-QB-C99" secondAttribute="top" constant="8" id="Evu-8R-B2z"/>
<constraint firstItem="mU8-MW-7fB" firstAttribute="leading" secondItem="L4D-es-cDG" secondAttribute="leading" id="Jb4-2d-uKb"/>
<constraint firstItem="Hkv-dE-Igc" firstAttribute="leading" secondItem="jOU-QB-C99" secondAttribute="leading" constant="8" id="TCg-9d-hjG"/>
<constraint firstItem="L4D-es-cDG" firstAttribute="leading" secondItem="Hkv-dE-Igc" secondAttribute="trailing" constant="8" id="U9p-ZT-aUT"/>
<constraint firstItem="L4D-es-cDG" firstAttribute="top" secondItem="Hkv-dE-Igc" secondAttribute="top" id="aqk-o1-EXK"/>
<constraint firstItem="JMw-hs-LJD" firstAttribute="top" secondItem="mU8-MW-7fB" secondAttribute="bottom" constant="4" id="vuE-pP-vVW"/>
<constraint firstItem="JMw-hs-LJD" firstAttribute="leading" secondItem="L4D-es-cDG" secondAttribute="leading" id="w8f-p7-CiT"/>
<constraint firstItem="Hkv-dE-Igc" firstAttribute="centerY" secondItem="jOU-QB-C99" secondAttribute="centerY" id="yST-qL-Y70"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<constraints>
<constraint firstItem="jOU-QB-C99" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="4" id="JE1-Dv-6P4"/>
<constraint firstAttribute="bottom" secondItem="jOU-QB-C99" secondAttribute="bottom" constant="4" id="Yhz-FT-hXr"/>
<constraint firstItem="jOU-QB-C99" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="8" id="aSY-Cn-g0v"/>
<constraint firstAttribute="trailing" secondItem="jOU-QB-C99" secondAttribute="trailing" constant="8" id="u9q-bB-TXK"/>
</constraints>
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="cidValueLabel" destination="81b-7G-z0Y" id="6kk-Wn-3hP"/>
<outlet property="iconImageView" destination="Hkv-dE-Igc" id="bCs-6i-Lry"/>
<outlet property="macValueLabel" destination="o0x-d6-np1" id="PR0-ri-dWY"/>
<outlet property="pidValueLabel" destination="wpb-lM-MpP" id="iLP-YQ-Rzg"/>
<outlet property="rssiValueLabel" destination="2BX-yo-yit" id="mip-f9-Hmg"/>
<outlet property="timeValueLabel" destination="gJs-v4-5Mw" id="7Ft-vy-Gc6"/>
<outlet property="vidValueLabel" destination="EUS-Jq-QBt" id="GTb-fk-wQk"/>
</connections>
<point key="canvasLocation" x="169.56521739130437" y="171.09375"/>
</tableViewCell>
</objects>
<resources>
<systemColor name="systemGray6Color">
<color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>

+ 32
- 0
healthRingDemo/View/ELDeviceTypeCell.h ファイルの表示

@@ -0,0 +1,32 @@
//
// ELDeviceTypeCell.h
// AILinkBleSDK_Example
//
// Created by LarryZhang on 2022/12/12.
// Copyright © 2022 zhengzida. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface ELDeviceTypeCell : UITableViewCell

@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;

@property (weak, nonatomic) IBOutlet UILabel *indexLabel;

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@property (weak, nonatomic) IBOutlet UILabel *subtitleLabel;



//复用机制
+ (instancetype)subsribeCell:(UITableView *)tableView;
//不使用复用机制
+ (instancetype)subsribeCell;

@end

NS_ASSUME_NONNULL_END

+ 39
- 0
healthRingDemo/View/ELDeviceTypeCell.m ファイルの表示

@@ -0,0 +1,39 @@
//
// ELDeviceTypeCell.m
// AILinkBleSDK_Example
//
// Created by LarryZhang on 2022/12/12.
// Copyright © 2022 zhengzida. All rights reserved.
//

#import "ELDeviceTypeCell.h"

@implementation ELDeviceTypeCell

+ (instancetype)subsribeCell:(UITableView *)tableView {
NSString *identifier = NSStringFromClass([self class]);
id cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if (cell == nil) {
UINib *nib = [UINib nibWithNibName:identifier bundle:nil];
[tableView registerNib:nib forCellReuseIdentifier:identifier];
cell = [tableView dequeueReusableCellWithIdentifier:identifier];
}
return cell;
}

+ (instancetype)subsribeCell {
return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:self options:nil].firstObject;
}

- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];

// Configure the view for the selected state
}

@end

+ 121
- 0
healthRingDemo/View/ELDeviceTypeCell.xib ファイルの表示

@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="103" id="KGk-i7-Jjw" customClass="ELDeviceTypeCell">
<rect key="frame" x="0.0" y="0.0" width="366" height="103"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="366" height="103"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jOU-QB-C99">
<rect key="frame" x="8" y="4" width="350" height="95"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Hkv-dE-Igc">
<rect key="frame" x="8" y="8" width="79" height="79"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" secondItem="Hkv-dE-Igc" secondAttribute="height" id="ZqG-XM-136"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="8"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="L4D-es-cDG">
<rect key="frame" x="95" y="8" width="15.5" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="01" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cKy-Zu-0Fz">
<rect key="frame" x="0.0" y="0.0" width="15.5" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="20" id="TUS-52-hBR"/>
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mU8-MW-7fB">
<rect key="frame" x="95" y="32" width="71.5" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Baby Scale" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pZN-Pt-0bV">
<rect key="frame" x="0.0" y="0.0" width="71.5" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="20" id="Qx2-3j-kzF"/>
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JMw-hs-LJD">
<rect key="frame" x="95" y="56" width="43" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="婴儿秤" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NPZ-PU-Wgh">
<rect key="frame" x="0.0" y="0.0" width="43" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="20" id="aNI-fv-u2p"/>
</constraints>
</stackView>
</subviews>
<color key="backgroundColor" systemColor="systemGray6Color"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="Hkv-dE-Igc" secondAttribute="bottom" constant="8" id="72I-PI-aGJ"/>
<constraint firstItem="mU8-MW-7fB" firstAttribute="top" secondItem="L4D-es-cDG" secondAttribute="bottom" constant="4" id="Eic-Aj-eFs"/>
<constraint firstItem="Hkv-dE-Igc" firstAttribute="top" secondItem="jOU-QB-C99" secondAttribute="top" constant="8" id="Evu-8R-B2z"/>
<constraint firstItem="mU8-MW-7fB" firstAttribute="leading" secondItem="L4D-es-cDG" secondAttribute="leading" id="Jb4-2d-uKb"/>
<constraint firstItem="Hkv-dE-Igc" firstAttribute="leading" secondItem="jOU-QB-C99" secondAttribute="leading" constant="8" id="TCg-9d-hjG"/>
<constraint firstItem="L4D-es-cDG" firstAttribute="leading" secondItem="Hkv-dE-Igc" secondAttribute="trailing" constant="8" id="U9p-ZT-aUT"/>
<constraint firstItem="L4D-es-cDG" firstAttribute="top" secondItem="Hkv-dE-Igc" secondAttribute="top" id="aqk-o1-EXK"/>
<constraint firstItem="JMw-hs-LJD" firstAttribute="top" secondItem="mU8-MW-7fB" secondAttribute="bottom" constant="4" id="vuE-pP-vVW"/>
<constraint firstItem="JMw-hs-LJD" firstAttribute="leading" secondItem="L4D-es-cDG" secondAttribute="leading" id="w8f-p7-CiT"/>
<constraint firstItem="Hkv-dE-Igc" firstAttribute="centerY" secondItem="jOU-QB-C99" secondAttribute="centerY" id="yST-qL-Y70"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="12"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="jOU-QB-C99" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="4" id="JE1-Dv-6P4"/>
<constraint firstAttribute="bottom" secondItem="jOU-QB-C99" secondAttribute="bottom" constant="4" id="Yhz-FT-hXr"/>
<constraint firstItem="jOU-QB-C99" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="8" id="aSY-Cn-g0v"/>
<constraint firstAttribute="trailing" secondItem="jOU-QB-C99" secondAttribute="trailing" constant="8" id="u9q-bB-TXK"/>
</constraints>
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="iconImageView" destination="Hkv-dE-Igc" id="bCs-6i-Lry"/>
<outlet property="indexLabel" destination="cKy-Zu-0Fz" id="Cet-01-MGs"/>
<outlet property="subtitleLabel" destination="NPZ-PU-Wgh" id="sjP-GB-NwI"/>
<outlet property="titleLabel" destination="pZN-Pt-0bV" id="3aE-gw-p9F"/>
</connections>
<point key="canvasLocation" x="169.56521739130437" y="171.09375"/>
</tableViewCell>
</objects>
<resources>
<systemColor name="systemGray6Color">
<color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>

+ 14
- 0
healthRingDemo/ViewController.h ファイルの表示

@@ -0,0 +1,14 @@
//
// ViewController.h
// healthRingDemo
//
// Created by 周鹏 on 2024/3/14.
//

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController


@end


+ 108
- 0
healthRingDemo/ViewController.m ファイルの表示

@@ -0,0 +1,108 @@
//
// ViewController.m
// healthRingDemo
//
// Created by 周鹏 on 2024/3/14.
//

#import "ViewController.h"
#import "ELDeviceTypeCell.h"
#import "ELDemoDeviceModel.h"
#import "ELDemoScanVC.h"

#import <AICareComponentRingBleSDK/ELSmartRingManager.h>
#import "RingTestDemoVC.h"


@interface ViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (weak, nonatomic) IBOutlet UITableView *tableView;

@property (weak, nonatomic) IBOutlet UILabel *versionLabel;

@property (nonatomic, strong) NSArray *deviceArray;

@end

@implementation ViewController

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.title = [NSString stringWithFormat:@"%@", @"智能戒指蓝牙SDK"];
self.versionLabel.text = [NSString stringWithFormat:@"SDK ver: %@ \nDemo ver: %@", ELSmartRingManager.sdkVersion, self.class.appVersion];
self.deviceArray = @[
[ELDemoDeviceModel modelWithIndex:@"00" imageName:@"ailink_connected_ic" title:@"智能戒指 Test" subtitle:@"1.0" entryVCName:NSStringFromClass(RingTestDemoVC.class) cids:@[@(0x005D)]]];
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}



- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.deviceArray.count;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 88;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
ELDemoDeviceModel *device = self.deviceArray[indexPath.row];
ELDeviceTypeCell *cell = [ELDeviceTypeCell subsribeCell:tableView];
cell.indexLabel.text = device.index;
cell.titleLabel.text = device.titleText;
cell.subtitleLabel.text = device.subtitleText;
cell.iconImageView.image = [UIImage imageNamed:device.imageName];
return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
ELDemoDeviceModel *device = self.deviceArray[indexPath.row];
if (device.newType) {
ELDemoScanVC *vc = [[ELDemoScanVC alloc] init];
vc.cids = device.cids;
vc.demoDeviceModel = device;
// vc.modalPresentationStyle = UIModalPresentationFullScreen;
[self.navigationController presentViewController:vc animated:YES completion:^{
NSLog(@"");
}];
__weak typeof(self) weakSelf = self;
vc.selectedBlock = ^(ELAILinkPeripheral * _Nonnull per) {
UIViewController *vc = [[NSClassFromString(device.entryVCName) alloc] init];
vc.title = [NSString stringWithFormat:@"%@_%@", device.titleText, device.subtitleText];
[vc setValue:per forKey:@"per"];
[weakSelf.navigationController pushViewController:vc animated:YES];
};
} else {
UIViewController *vc = [[NSClassFromString(device.entryVCName) alloc] init];
vc.title = [NSString stringWithFormat:@"%@_%@", device.titleText, device.subtitleText];
[self.navigationController pushViewController:vc animated:YES];
}
}

+ (NSString *)appName {
NSDictionary *dic = [[NSBundle mainBundle] infoDictionary];
NSString *appName = [dic objectForKey:@"CFBundleDisplayName"];
return appName;
}

+ (NSString *)appVersion {
NSDictionary *dic = [[NSBundle mainBundle] infoDictionary];
NSString * version = [dic objectForKey:@"CFBundleShortVersionString"];
return version;
}


@end

+ 18
- 0
healthRingDemo/main.m ファイルの表示

@@ -0,0 +1,18 @@
//
// main.m
// healthRingDemo
//
// Created by 周鹏 on 2024/3/14.
//

#import <UIKit/UIKit.h>
#import "AppDelegate.h"

int main(int argc, char * argv[]) {
NSString * appDelegateClassName;
@autoreleasepool {
// Setup code that might create autoreleased objects goes here.
appDelegateClassName = NSStringFromClass([AppDelegate class]);
}
return UIApplicationMain(argc, argv, nil, appDelegateClassName);
}

+ 36
- 0
healthRingDemoTests/healthRingDemoTests.m ファイルの表示

@@ -0,0 +1,36 @@
//
// healthRingDemoTests.m
// healthRingDemoTests
//
// Created by 周鹏 on 2024/3/14.
//

#import <XCTest/XCTest.h>

@interface healthRingDemoTests : XCTestCase

@end

@implementation healthRingDemoTests

- (void)setUp {
// Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

- (void)testExample {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}

- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}

@end

+ 46
- 0
healthRingDemoUITests/healthRingDemoUITests.m ファイルの表示

@@ -0,0 +1,46 @@
//
// healthRingDemoUITests.m
// healthRingDemoUITests
//
// Created by 周鹏 on 2024/3/14.
//

#import <XCTest/XCTest.h>

@interface healthRingDemoUITests : XCTestCase

@end

@implementation healthRingDemoUITests

- (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;

// 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 {
// UI tests must launch the application that they test.
XCUIApplication *app = [[XCUIApplication alloc] init];
[app launch];

// Use XCTAssert and related functions to verify your tests produce the correct results.
}

- (void)testLaunchPerformance {
if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *)) {
// This measures how long it takes to launch your application.
[self measureWithMetrics:@[[[XCTApplicationLaunchMetric alloc] init]] block:^{
[[[XCUIApplication alloc] init] launch];
}];
}
}

@end

+ 37
- 0
healthRingDemoUITests/healthRingDemoUITestsLaunchTests.m ファイルの表示

@@ -0,0 +1,37 @@
//
// healthRingDemoUITestsLaunchTests.m
// healthRingDemoUITests
//
// Created by 周鹏 on 2024/3/14.
//

#import <XCTest/XCTest.h>

@interface healthRingDemoUITestsLaunchTests : XCTestCase

@end

@implementation healthRingDemoUITestsLaunchTests

+ (BOOL)runsForEachTargetApplicationUIConfiguration {
return YES;
}

- (void)setUp {
self.continueAfterFailure = NO;
}

- (void)testLaunch {
XCUIApplication *app = [[XCUIApplication alloc] init];
[app launch];

// Insert steps here to perform after app launch but before taking a screenshot,
// such as logging into a test account or navigating somewhere in the app

XCTAttachment *attachment = [XCTAttachment attachmentWithScreenshot:XCUIScreen.mainScreen.screenshot];
attachment.name = @"Launch Screen";
attachment.lifetime = XCTAttachmentLifetimeKeepAlways;
[self addAttachment:attachment];
}

@end

読み込み中…
キャンセル
保存