summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/ios
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ihealth-sdk/ios')
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary.xcodeproj/project.pbxproj849
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary.xcodeproj/project.xcworkspace/contents.xcworkspacedata7
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist8
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM3SModule.h20
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM3SModule.m788
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM4Module.h19
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM4Module.m854
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5Module.h19
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5Module.m542
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5ProfileModule.h128
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5ProfileModule.m87
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/AMProfileModule.h18
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/AMProfileModule.m248
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1Module.h22
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1Module.m236
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1ProfileModule.h18
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1ProfileModule.m84
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SModule.h20
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SModule.m224
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SProfileModule.h61
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SProfileModule.m50
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5Module.h23
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5Module.m643
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SModule.h19
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SModule.m529
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SProfileModule.h85
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SProfileModule.m84
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BGProfileModule.h65
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BGProfileModule.m69
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP3LModule.h19
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP3LModule.m226
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP550BTModule.h23
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP550BTModule.m318
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5Module.h23
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5Module.m501
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5SModule.h19
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5SModule.m426
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7Module.h23
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7Module.m521
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7SModule.h19
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7SModule.m284
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BPProfileModule.h83
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BPProfileModule.m182
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMModule.h19
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMModule.m370
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMProfileModule.h50
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMProfileModule.m47
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABI.h82
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABIController.h28
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABPM.h144
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABPMController.h25
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3.h188
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3Controller.h29
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3SController_V2.h29
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3S_V2.h227
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM4.h223
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM4Controller.h31
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM5.h335
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM5Controller.h30
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM5Header.h20
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AMHeader.h27
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AMMacroFile.h1171
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1.h53
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1Controller.h46
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1S.h64
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1SController.h25
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG3.h83
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG3Controller.h28
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5.h158
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5Controller.h28
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5S.h294
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5SController.h29
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGController.h32
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGDevice.h42
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGHeader.h23
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGMacroFile.h507
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3.h77
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3Controller.h27
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3L.h58
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3LController.h30
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5.h32
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5C.h131
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5CController.h25
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5Controller.h25
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5S.h97
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5SController.h27
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5SRW.h101
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5SRWController.h26
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7.h141
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7Controller.h25
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7S.h106
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7SController.h32
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPAV10Device.h15
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPBTLEDevice.h17
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPBV10Device.h20
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPContinua.h56
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPContinuaController.h30
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPController.h40
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPDevice.h131
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPHeader.h54
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPLoopMeasureSettingModel.h120
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPM1AE.h80
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPMacroFile.h247
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPV24Device.h16
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPV25Device.h17
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ConnectDeviceController.h27
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUController.h160
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUDeviceFirmwareInfo.h56
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUHeader.h19
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUMacro.h264
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUServerFirmwareInfo.h48
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3.h94
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3Controller.h30
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3USB.h145
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3USBController.h31
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECGHeader.h20
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECGMacroFile.h84
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HFSmartLink.h88
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HFSmartLinkDeviceInfo.h14
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2.h64
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2Controller.h25
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2S.h399
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2SController.h27
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS3.h63
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS3Controller.h32
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS4.h64
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS4Controller.h26
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS5.h141
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS5Controller.h38
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HSHeader.h25
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HSMacroFile.h709
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HealthHeader.h67
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HealthUser.h126
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBindEnum.h49
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBlueDataResponse.h66
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBlueEnum.h213
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothBaseModel.h112
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothEngine.h283
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothManager.h166
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothServices.h75
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOCalculateBluetoothModel.h263
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOCommonMacro.h89
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDODataExchangeModel.h128
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDODataMigrationManager.h79
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOErrorCodeToStr.h19
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOFoundationCommand.h1178
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOGetInfoBluetoothModel.h1924
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOLogEnum.h165
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOPeripheralModel.h59
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDORecordDeviceLog.h56
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSetInfoBluetoothModel.h1760
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncActivityDataModel.h207
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncBpDataModel.h191
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncEnum.h316
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncGpsDataModel.h133
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncHeartRateDataModel.h442
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncManager.h161
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncPressureDataModel.h158
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSleepDataModel.h224
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSpo2DataModel.h175
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSportDataModel.h221
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSwimDataModel.h188
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOTranEnum.h93
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOTransferFileManager.h116
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOWatchDialInfoModel.h95
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOWatchDialManager.h75
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOWeightBluetoothModel.h124
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IHSDKCloudUser.h104
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/KN550BT.h115
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/KN550BTController.h32
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ManageDeviceController.h34
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13B.h33
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13BController.h28
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13BHeader.h16
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13BMacroFile.h34
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO1.h82
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO1Controller.h29
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO3.h96
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO3Controller.h29
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/POHeader.h20
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/POMacroFile.h142
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PT3SBT.h167
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PT3SBTController.h27
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PT3SBTMacroFile.h92
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKFlowUpdateDevice.h196
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKInfo.h30
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKUpdateDevice.h235
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ScanDeviceController.h47
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3.h104
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3Controller.h30
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3Macro.h17
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/TS28B.h26
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/TS28BController.h142
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/TS28BHeader.h15
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/iHealthHS6.h174
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/libiHealthSDK2.7.5.abin0 -> 74566552 bytes
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGModule.h17
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGModule.m245
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGProfileModule.h75
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGProfileModule.m76
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGUSBModule.h18
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGUSBModule.m258
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2Module.h19
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2Module.m277
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SModule.h19
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SModule.m1052
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SProfileModule.h169
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SProfileModule.m167
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS4SModule.h20
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS4SModule.m257
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6Module.h25
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6Module.m339
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6ProfileModule.h51
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6ProfileModule.m70
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HSProfileModule.h60
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HSProfileModule.m79
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BModule.h20
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BModule.m103
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BProfileModule.h36
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BProfileModule.m39
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1Module.h19
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1Module.m167
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1ProfileModule.h20
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1ProfileModule.m58
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO3Module.h19
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO3Module.m260
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/POProfileModule.h24
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/POProfileModule.m48
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTModule.h19
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTModule.m347
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTProfileModule.h52
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTProfileModule.m49
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/RNBGMacro.h60
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BModule.h21
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BModule.m116
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BProfileModule.h38
-rw-r--r--libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BProfileModule.m40
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/iHealthDeviceManagerModule.h27
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/iHealthDeviceManagerModule.m1338
239 files changed, 35574 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary.xcodeproj/project.pbxproj b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary.xcodeproj/project.pbxproj
new file mode 100755
index 0000000..410724b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary.xcodeproj/project.pbxproj
@@ -0,0 +1,849 @@
1// !$*UTF8*$!
2{
3 archiveVersion = 1;
4 classes = {
5 };
6 objectVersion = 46;
7 objects = {
8
9/* Begin PBXBuildFile section */
10 182D028B1DE57A2F00E9B783 /* iHealthDeviceManagerModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 182D028A1DE57A2F00E9B783 /* iHealthDeviceManagerModule.m */; };
11 183FB1681FF508300040009B /* BTMProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 183FB1661FF5082F0040009B /* BTMProfileModule.m */; };
12 183FB1691FF508300040009B /* BTMModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 183FB1671FF5082F0040009B /* BTMModule.m */; };
13 1875101F1DE5E374005E66B1 /* BPProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 1875101E1DE5E374005E66B1 /* BPProfileModule.m */; };
14 187510221DE5E399005E66B1 /* BP550BTModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 187510211DE5E399005E66B1 /* BP550BTModule.m */; };
15 187510251DE5E3CA005E66B1 /* BP7SModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 187510241DE5E3CA005E66B1 /* BP7SModule.m */; };
16 187510281DE5E3E3005E66B1 /* BP5Module.m in Sources */ = {isa = PBXBuildFile; fileRef = 187510271DE5E3E3005E66B1 /* BP5Module.m */; };
17 1875102B1DE5E3FB005E66B1 /* BP3LModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 1875102A1DE5E3FB005E66B1 /* BP3LModule.m */; };
18 1875102E1DE5E411005E66B1 /* AMProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 1875102D1DE5E410005E66B1 /* AMProfileModule.m */; };
19 187510311DE5E424005E66B1 /* AM4Module.m in Sources */ = {isa = PBXBuildFile; fileRef = 187510301DE5E424005E66B1 /* AM4Module.m */; };
20 187510341DE5E439005E66B1 /* AM3SModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 187510331DE5E439005E66B1 /* AM3SModule.m */; };
21 18B752C41FFF61C500DE2629 /* ECGModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 18B752C31FFF61C500DE2629 /* ECGModule.m */; };
22 18B752C91FFF67DE00DE2629 /* ECGProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 18B752C81FFF67DE00DE2629 /* ECGProfileModule.m */; };
23 18B752CC1FFF67F100DE2629 /* ECGUSBModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 18B752CB1FFF67F100DE2629 /* ECGUSBModule.m */; };
24 3F31C42B21ABE80400811B02 /* HS2Module.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F31C42A21ABE80400811B02 /* HS2Module.m */; };
25 4565653F26E0BDE7007DA850 /* AM5Module.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565653D26E0BDE6007DA850 /* AM5Module.m */; };
26 4565654026E0BDE7007DA850 /* AM5ProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565653E26E0BDE7007DA850 /* AM5ProfileModule.m */; };
27 456565E426E0C90D007DA850 /* iHealthSDK2.7.5.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 456565E326E0C90D007DA850 /* iHealthSDK2.7.5.a */; };
28 45A72D18256E5FCB00825201 /* BP7Module.m in Sources */ = {isa = PBXBuildFile; fileRef = 45A72D16256E5FCB00825201 /* BP7Module.m */; };
29 8CCCE9B21E5ADF49007F7FE4 /* PO3Module.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CCCE9AF1E5ADF49007F7FE4 /* PO3Module.m */; };
30 8CCCE9B31E5ADF49007F7FE4 /* POProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CCCE9B11E5ADF49007F7FE4 /* POProfileModule.m */; };
31 8CCCE9E31E5E7C58007F7FE4 /* HS6ProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CCCE9E21E5E7C58007F7FE4 /* HS6ProfileModule.m */; };
32 9F3D8E1B1E0B6CDB00BA44B1 /* BG1Module.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F3D8E121E0B6CDB00BA44B1 /* BG1Module.m */; };
33 9F3D8E1C1E0B6CDB00BA44B1 /* BG1ProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F3D8E141E0B6CDB00BA44B1 /* BG1ProfileModule.m */; };
34 9F3D8E1E1E0B6CDB00BA44B1 /* BG5Module.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F3D8E181E0B6CDB00BA44B1 /* BG5Module.m */; };
35 9F3D8E1F1E0B6CDB00BA44B1 /* BGProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F3D8E1A1E0B6CDB00BA44B1 /* BGProfileModule.m */; };
36 AF1B3F141DF9482100DFDB23 /* HS4SModule.m in Sources */ = {isa = PBXBuildFile; fileRef = AF1B3F111DF9482100DFDB23 /* HS4SModule.m */; };
37 AF1B3F151DF9482100DFDB23 /* HSProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = AF1B3F131DF9482100DFDB23 /* HSProfileModule.m */; };
38 AF1B3F3A1DFE72BD00DFDB23 /* HS6Module.m in Sources */ = {isa = PBXBuildFile; fileRef = AF1B3F391DFE72BD00DFDB23 /* HS6Module.m */; };
39 CE6054B025482CC90059E83A /* BG5SModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60549C25482CC70059E83A /* BG5SModule.m */; };
40 CE6054B125482CC90059E83A /* BP5SModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60549D25482CC70059E83A /* BP5SModule.m */; };
41 CE6054B225482CC90059E83A /* BG1SModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60549F25482CC80059E83A /* BG1SModule.m */; };
42 CE6054B325482CC90059E83A /* BG5SProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CE6054A025482CC80059E83A /* BG5SProfileModule.m */; };
43 CE6054B425482CC90059E83A /* NT13BProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CE6054A225482CC80059E83A /* NT13BProfileModule.m */; };
44 CE6054B525482CC90059E83A /* TS28BModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CE6054A525482CC80059E83A /* TS28BModule.m */; };
45 CE6054B625482CC90059E83A /* HS2SProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CE6054A625482CC80059E83A /* HS2SProfileModule.m */; };
46 CE6054B725482CC90059E83A /* NT13BModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CE6054A825482CC80059E83A /* NT13BModule.m */; };
47 CE6054B825482CC90059E83A /* BG1SProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CE6054AA25482CC80059E83A /* BG1SProfileModule.m */; };
48 CE6054B925482CC90059E83A /* HS2SModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CE6054AB25482CC90059E83A /* HS2SModule.m */; };
49 CE6054BA25482CC90059E83A /* TS28BProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CE6054AE25482CC90059E83A /* TS28BProfileModule.m */; };
50 CE6054C025482E590059E83A /* PO1Module.m in Sources */ = {isa = PBXBuildFile; fileRef = CE6054BD25482E580059E83A /* PO1Module.m */; };
51 CE6054C125482E590059E83A /* PO1ProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CE6054BF25482E590059E83A /* PO1ProfileModule.m */; };
52 CEEE2D0D2548F6E4007AC7E4 /* PT3SBTProfileModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CEEE2D0B2548F6E4007AC7E4 /* PT3SBTProfileModule.m */; };
53 CEEE2D0E2548F6E4007AC7E4 /* PT3SBTModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CEEE2D0C2548F6E4007AC7E4 /* PT3SBTModule.m */; };
54/* End PBXBuildFile section */
55
56/* Begin PBXCopyFilesBuildPhase section */
57 182D01F81DE565EC00E9B783 /* CopyFiles */ = {
58 isa = PBXCopyFilesBuildPhase;
59 buildActionMask = 2147483647;
60 dstPath = "include/$(PRODUCT_NAME)";
61 dstSubfolderSpec = 16;
62 files = (
63 );
64 runOnlyForDeploymentPostprocessing = 0;
65 };
66/* End PBXCopyFilesBuildPhase section */
67
68/* Begin PBXFileReference section */
69 182D01FA1DE565EC00E9B783 /* libReactNativeIOSLibrary.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReactNativeIOSLibrary.a; sourceTree = BUILT_PRODUCTS_DIR; };
70 182D02891DE57A2F00E9B783 /* iHealthDeviceManagerModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iHealthDeviceManagerModule.h; sourceTree = "<group>"; };
71 182D028A1DE57A2F00E9B783 /* iHealthDeviceManagerModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iHealthDeviceManagerModule.m; sourceTree = "<group>"; };
72 183FB1641FF5082E0040009B /* BTMModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTMModule.h; sourceTree = "<group>"; };
73 183FB1651FF5082F0040009B /* BTMProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTMProfileModule.h; sourceTree = "<group>"; };
74 183FB1661FF5082F0040009B /* BTMProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTMProfileModule.m; sourceTree = "<group>"; };
75 183FB1671FF5082F0040009B /* BTMModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BTMModule.m; sourceTree = "<group>"; };
76 1875101D1DE5E374005E66B1 /* BPProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BPProfileModule.h; sourceTree = "<group>"; };
77 1875101E1DE5E374005E66B1 /* BPProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BPProfileModule.m; sourceTree = "<group>"; };
78 187510201DE5E399005E66B1 /* BP550BTModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP550BTModule.h; sourceTree = "<group>"; };
79 187510211DE5E399005E66B1 /* BP550BTModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BP550BTModule.m; sourceTree = "<group>"; };
80 187510231DE5E3CA005E66B1 /* BP7SModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP7SModule.h; sourceTree = "<group>"; };
81 187510241DE5E3CA005E66B1 /* BP7SModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BP7SModule.m; sourceTree = "<group>"; };
82 187510261DE5E3E3005E66B1 /* BP5Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP5Module.h; sourceTree = "<group>"; };
83 187510271DE5E3E3005E66B1 /* BP5Module.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BP5Module.m; sourceTree = "<group>"; };
84 187510291DE5E3FB005E66B1 /* BP3LModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP3LModule.h; sourceTree = "<group>"; };
85 1875102A1DE5E3FB005E66B1 /* BP3LModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BP3LModule.m; sourceTree = "<group>"; };
86 1875102C1DE5E410005E66B1 /* AMProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AMProfileModule.h; sourceTree = "<group>"; };
87 1875102D1DE5E410005E66B1 /* AMProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AMProfileModule.m; sourceTree = "<group>"; };
88 1875102F1DE5E424005E66B1 /* AM4Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AM4Module.h; sourceTree = "<group>"; };
89 187510301DE5E424005E66B1 /* AM4Module.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AM4Module.m; sourceTree = "<group>"; };
90 187510321DE5E439005E66B1 /* AM3SModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AM3SModule.h; sourceTree = "<group>"; };
91 187510331DE5E439005E66B1 /* AM3SModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AM3SModule.m; sourceTree = "<group>"; };
92 18B752C21FFF61C500DE2629 /* ECGModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ECGModule.h; sourceTree = "<group>"; };
93 18B752C31FFF61C500DE2629 /* ECGModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ECGModule.m; sourceTree = "<group>"; };
94 18B752C71FFF67DE00DE2629 /* ECGProfileModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ECGProfileModule.h; sourceTree = "<group>"; };
95 18B752C81FFF67DE00DE2629 /* ECGProfileModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ECGProfileModule.m; sourceTree = "<group>"; };
96 18B752CA1FFF67F100DE2629 /* ECGUSBModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ECGUSBModule.h; sourceTree = "<group>"; };
97 18B752CB1FFF67F100DE2629 /* ECGUSBModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ECGUSBModule.m; sourceTree = "<group>"; };
98 3F31C42921ABE80400811B02 /* HS2Module.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HS2Module.h; sourceTree = "<group>"; };
99 3F31C42A21ABE80400811B02 /* HS2Module.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HS2Module.m; sourceTree = "<group>"; };
100 4565653B26E0BDE6007DA850 /* AM5Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AM5Module.h; sourceTree = "<group>"; };
101 4565653C26E0BDE6007DA850 /* AM5ProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AM5ProfileModule.h; sourceTree = "<group>"; };
102 4565653D26E0BDE6007DA850 /* AM5Module.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AM5Module.m; sourceTree = "<group>"; };
103 4565653E26E0BDE7007DA850 /* AM5ProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AM5ProfileModule.m; sourceTree = "<group>"; };
104 4565654F26E0C90A007DA850 /* IDOSyncBpDataModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOSyncBpDataModel.h; sourceTree = "<group>"; };
105 4565655026E0C90A007DA850 /* BPContinua.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BPContinua.h; sourceTree = "<group>"; };
106 4565655126E0C90A007DA850 /* IDOWeightBluetoothModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOWeightBluetoothModel.h; sourceTree = "<group>"; };
107 4565655226E0C90A007DA850 /* ScanDeviceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScanDeviceController.h; sourceTree = "<group>"; };
108 4565655326E0C90A007DA850 /* AM5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AM5.h; sourceTree = "<group>"; };
109 4565655426E0C90A007DA850 /* ECGHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ECGHeader.h; sourceTree = "<group>"; };
110 4565655526E0C90A007DA850 /* HS5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HS5.h; sourceTree = "<group>"; };
111 4565655626E0C90A007DA850 /* DFUHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFUHeader.h; sourceTree = "<group>"; };
112 4565655726E0C90A007DA850 /* AM5Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AM5Header.h; sourceTree = "<group>"; };
113 4565655826E0C90A007DA850 /* HS2SController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HS2SController.h; sourceTree = "<group>"; };
114 4565655926E0C90A007DA850 /* IDODataExchangeModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDODataExchangeModel.h; sourceTree = "<group>"; };
115 4565655A26E0C90A007DA850 /* BP5CController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP5CController.h; sourceTree = "<group>"; };
116 4565655B26E0C90A007DA850 /* BPController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BPController.h; sourceTree = "<group>"; };
117 4565655C26E0C90A007DA850 /* HS3Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HS3Controller.h; sourceTree = "<group>"; };
118 4565655D26E0C90A007DA850 /* IDOGetInfoBluetoothModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOGetInfoBluetoothModel.h; sourceTree = "<group>"; };
119 4565655E26E0C90A007DA850 /* BPBTLEDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BPBTLEDevice.h; sourceTree = "<group>"; };
120 4565655F26E0C90A007DA850 /* NT13B.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NT13B.h; sourceTree = "<group>"; };
121 4565656026E0C90A007DA850 /* BP7Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP7Controller.h; sourceTree = "<group>"; };
122 4565656126E0C90A007DA850 /* BPAV10Device.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BPAV10Device.h; sourceTree = "<group>"; };
123 4565656226E0C90A007DA850 /* BGMacroFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BGMacroFile.h; sourceTree = "<group>"; };
124 4565656326E0C90A007DA850 /* AM5Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AM5Controller.h; sourceTree = "<group>"; };
125 4565656426E0C90A007DA850 /* BG3Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG3Controller.h; sourceTree = "<group>"; };
126 4565656526E0C90A007DA850 /* PT3SBT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PT3SBT.h; sourceTree = "<group>"; };
127 4565656626E0C90A007DA850 /* HSMacroFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSMacroFile.h; sourceTree = "<group>"; };
128 4565656726E0C90A007DA850 /* IDOCalculateBluetoothModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOCalculateBluetoothModel.h; sourceTree = "<group>"; };
129 4565656826E0C90A007DA850 /* AMMacroFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AMMacroFile.h; sourceTree = "<group>"; };
130 4565656926E0C90A007DA850 /* IDOTransferFileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOTransferFileManager.h; sourceTree = "<group>"; };
131 4565656A26E0C90A007DA850 /* SDKFlowUpdateDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDKFlowUpdateDevice.h; sourceTree = "<group>"; };
132 4565656B26E0C90A007DA850 /* BPDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BPDevice.h; sourceTree = "<group>"; };
133 4565656C26E0C90A007DA850 /* POHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = POHeader.h; sourceTree = "<group>"; };
134 4565656D26E0C90A007DA850 /* SDKUpdateDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDKUpdateDevice.h; sourceTree = "<group>"; };
135 4565656E26E0C90A007DA850 /* BP5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP5.h; sourceTree = "<group>"; };
136 4565656F26E0C90A007DA850 /* BPHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BPHeader.h; sourceTree = "<group>"; };
137 4565657026E0C90A007DA850 /* ABIController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABIController.h; sourceTree = "<group>"; };
138 4565657126E0C90A007DA850 /* TS28B.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TS28B.h; sourceTree = "<group>"; };
139 4565657226E0C90A007DA850 /* HFSmartLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HFSmartLink.h; sourceTree = "<group>"; };
140 4565657326E0C90A007DA850 /* BP5SController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP5SController.h; sourceTree = "<group>"; };
141 4565657426E0C90A007DA850 /* ConnectDeviceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConnectDeviceController.h; sourceTree = "<group>"; };
142 4565657526E0C90A007DA850 /* BG5S.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG5S.h; sourceTree = "<group>"; };
143 4565657626E0C90A007DA850 /* BP5S.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP5S.h; sourceTree = "<group>"; };
144 4565657726E0C90A007DA850 /* THV3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = THV3.h; sourceTree = "<group>"; };
145 4565657826E0C90A007DA850 /* BG1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG1.h; sourceTree = "<group>"; };
146 4565657926E0C90A007DA850 /* BG1SController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG1SController.h; sourceTree = "<group>"; };
147 4565657A26E0C90A007DA850 /* HS5Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HS5Controller.h; sourceTree = "<group>"; };
148 4565657B26E0C90A007DA850 /* BG5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG5.h; sourceTree = "<group>"; };
149 4565657C26E0C90A007DA850 /* ManageDeviceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ManageDeviceController.h; sourceTree = "<group>"; };
150 4565657D26E0C90A007DA850 /* BGDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BGDevice.h; sourceTree = "<group>"; };
151 4565657E26E0C90A007DA850 /* IDOErrorCodeToStr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOErrorCodeToStr.h; sourceTree = "<group>"; };
152 4565657F26E0C90A007DA850 /* THV3Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = THV3Controller.h; sourceTree = "<group>"; };
153 4565658026E0C90A007DA850 /* BP5SRWController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP5SRWController.h; sourceTree = "<group>"; };
154 4565658126E0C90A007DA850 /* BG1S.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG1S.h; sourceTree = "<group>"; };
155 4565658226E0C90A007DA850 /* HS2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HS2.h; sourceTree = "<group>"; };
156 4565658326E0C90A007DA850 /* PO1Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PO1Controller.h; sourceTree = "<group>"; };
157 4565658426E0C90A007DA850 /* BGHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BGHeader.h; sourceTree = "<group>"; };
158 4565658526E0C90A007DA850 /* DFUController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFUController.h; sourceTree = "<group>"; };
159 4565658626E0C90A007DA850 /* PO3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PO3.h; sourceTree = "<group>"; };
160 4565658726E0C90A007DA850 /* BP3LController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP3LController.h; sourceTree = "<group>"; };
161 4565658826E0C90A007DA850 /* IDOSyncHeartRateDataModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOSyncHeartRateDataModel.h; sourceTree = "<group>"; };
162 4565658926E0C90A007DA850 /* NT13BHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NT13BHeader.h; sourceTree = "<group>"; };
163 4565658A26E0C90A007DA850 /* BG5Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG5Controller.h; sourceTree = "<group>"; };
164 4565658B26E0C90A007DA850 /* AM3Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AM3Controller.h; sourceTree = "<group>"; };
165 4565658C26E0C90A007DA850 /* BPM1AE.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BPM1AE.h; sourceTree = "<group>"; };
166 4565658D26E0C90A007DA850 /* ABPM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABPM.h; sourceTree = "<group>"; };
167 4565658E26E0C90A007DA850 /* IDOLogEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOLogEnum.h; sourceTree = "<group>"; };
168 4565658F26E0C90A007DA850 /* IDOSyncGpsDataModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOSyncGpsDataModel.h; sourceTree = "<group>"; };
169 4565659026E0C90A007DA850 /* HealthHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HealthHeader.h; sourceTree = "<group>"; };
170 4565659126E0C90A007DA850 /* IDOSyncPressureDataModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOSyncPressureDataModel.h; sourceTree = "<group>"; };
171 4565659226E0C90A007DA850 /* IDOSyncSwimDataModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOSyncSwimDataModel.h; sourceTree = "<group>"; };
172 4565659326E0C90A007DA850 /* HSHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSHeader.h; sourceTree = "<group>"; };
173 4565659426E0C90A007DA850 /* DFUMacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFUMacro.h; sourceTree = "<group>"; };
174 4565659526E0C90A007DA850 /* IDOTranEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOTranEnum.h; sourceTree = "<group>"; };
175 4565659626E0C90A007DA850 /* BG5SController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG5SController.h; sourceTree = "<group>"; };
176 4565659726E0C90A007DA850 /* AM3S_V2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AM3S_V2.h; sourceTree = "<group>"; };
177 4565659826E0C90A007DA850 /* IDOCommonMacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOCommonMacro.h; sourceTree = "<group>"; };
178 4565659926E0C90A007DA850 /* IDORecordDeviceLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDORecordDeviceLog.h; sourceTree = "<group>"; };
179 4565659A26E0C90A007DA850 /* ABPMController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABPMController.h; sourceTree = "<group>"; };
180 4565659B26E0C90A007DA850 /* NT13BMacroFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NT13BMacroFile.h; sourceTree = "<group>"; };
181 4565659C26E0C90A007DA850 /* POMacroFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = POMacroFile.h; sourceTree = "<group>"; };
182 4565659D26E0C90A007DA850 /* IDOSyncEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOSyncEnum.h; sourceTree = "<group>"; };
183 4565659E26E0C90A007DA850 /* AM3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AM3.h; sourceTree = "<group>"; };
184 4565659F26E0C90A007DA850 /* IDOSyncSpo2DataModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOSyncSpo2DataModel.h; sourceTree = "<group>"; };
185 456565A026E0C90A007DA850 /* KN550BTController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KN550BTController.h; sourceTree = "<group>"; };
186 456565A126E0C90A007DA850 /* IDODataMigrationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDODataMigrationManager.h; sourceTree = "<group>"; };
187 456565A226E0C90A007DA850 /* BP7S.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP7S.h; sourceTree = "<group>"; };
188 456565A326E0C90B007DA850 /* PO3Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PO3Controller.h; sourceTree = "<group>"; };
189 456565A426E0C90B007DA850 /* HS3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HS3.h; sourceTree = "<group>"; };
190 456565A526E0C90B007DA850 /* AM4Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AM4Controller.h; sourceTree = "<group>"; };
191 456565A626E0C90B007DA850 /* BPV25Device.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BPV25Device.h; sourceTree = "<group>"; };
192 456565A726E0C90B007DA850 /* PT3SBTMacroFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PT3SBTMacroFile.h; sourceTree = "<group>"; };
193 456565A826E0C90B007DA850 /* HS2Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HS2Controller.h; sourceTree = "<group>"; };
194 456565A926E0C90B007DA850 /* BP7SController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP7SController.h; sourceTree = "<group>"; };
195 456565AA26E0C90B007DA850 /* BPContinuaController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BPContinuaController.h; sourceTree = "<group>"; };
196 456565AB26E0C90B007DA850 /* BP3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP3.h; sourceTree = "<group>"; };
197 456565AC26E0C90B007DA850 /* IDOPeripheralModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOPeripheralModel.h; sourceTree = "<group>"; };
198 456565AD26E0C90B007DA850 /* AMHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AMHeader.h; sourceTree = "<group>"; };
199 456565AE26E0C90B007DA850 /* BP3Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP3Controller.h; sourceTree = "<group>"; };
200 456565AF26E0C90B007DA850 /* ECGMacroFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ECGMacroFile.h; sourceTree = "<group>"; };
201 456565B026E0C90B007DA850 /* BPV24Device.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BPV24Device.h; sourceTree = "<group>"; };
202 456565B126E0C90B007DA850 /* ECG3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ECG3.h; sourceTree = "<group>"; };
203 456565B226E0C90B007DA850 /* IDOBluetoothManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOBluetoothManager.h; sourceTree = "<group>"; };
204 456565B326E0C90B007DA850 /* BPMacroFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BPMacroFile.h; sourceTree = "<group>"; };
205 456565B426E0C90B007DA850 /* IDOBlueDataResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOBlueDataResponse.h; sourceTree = "<group>"; };
206 456565B526E0C90B007DA850 /* ECG3USBController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ECG3USBController.h; sourceTree = "<group>"; };
207 456565B626E0C90B007DA850 /* AM3SController_V2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AM3SController_V2.h; sourceTree = "<group>"; };
208 456565B726E0C90B007DA850 /* NT13BController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NT13BController.h; sourceTree = "<group>"; };
209 456565B826E0C90B007DA850 /* ECG3USB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ECG3USB.h; sourceTree = "<group>"; };
210 456565B926E0C90B007DA850 /* BP7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP7.h; sourceTree = "<group>"; };
211 456565BA26E0C90B007DA850 /* BGController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BGController.h; sourceTree = "<group>"; };
212 456565BB26E0C90B007DA850 /* PT3SBTController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PT3SBTController.h; sourceTree = "<group>"; };
213 456565BC26E0C90B007DA850 /* iHealthHS6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iHealthHS6.h; sourceTree = "<group>"; };
214 456565BD26E0C90B007DA850 /* AM4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AM4.h; sourceTree = "<group>"; };
215 456565BE26E0C90B007DA850 /* BP5SRW.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP5SRW.h; sourceTree = "<group>"; };
216 456565BF26E0C90B007DA850 /* BG3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG3.h; sourceTree = "<group>"; };
217 456565C026E0C90B007DA850 /* IDOWatchDialInfoModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOWatchDialInfoModel.h; sourceTree = "<group>"; };
218 456565C126E0C90B007DA850 /* DFUServerFirmwareInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFUServerFirmwareInfo.h; sourceTree = "<group>"; };
219 456565C226E0C90B007DA850 /* ABI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABI.h; sourceTree = "<group>"; };
220 456565C326E0C90B007DA850 /* IDOBluetoothEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOBluetoothEngine.h; sourceTree = "<group>"; };
221 456565C426E0C90B007DA850 /* IDOSyncSportDataModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOSyncSportDataModel.h; sourceTree = "<group>"; };
222 456565C526E0C90B007DA850 /* HS4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HS4.h; sourceTree = "<group>"; };
223 456565C626E0C90B007DA850 /* BPBV10Device.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BPBV10Device.h; sourceTree = "<group>"; };
224 456565C726E0C90B007DA850 /* IDOBluetoothBaseModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOBluetoothBaseModel.h; sourceTree = "<group>"; };
225 456565C826E0C90B007DA850 /* IDOFoundationCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOFoundationCommand.h; sourceTree = "<group>"; };
226 456565C926E0C90B007DA850 /* TS28BController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TS28BController.h; sourceTree = "<group>"; };
227 456565CA26E0C90B007DA850 /* IDOWatchDialManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOWatchDialManager.h; sourceTree = "<group>"; };
228 456565CB26E0C90B007DA850 /* IDOSyncSleepDataModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOSyncSleepDataModel.h; sourceTree = "<group>"; };
229 456565CC26E0C90B007DA850 /* HealthUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HealthUser.h; sourceTree = "<group>"; };
230 456565CD26E0C90B007DA850 /* IDOSetInfoBluetoothModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOSetInfoBluetoothModel.h; sourceTree = "<group>"; };
231 456565CE26E0C90B007DA850 /* IDOSyncManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOSyncManager.h; sourceTree = "<group>"; };
232 456565CF26E0C90B007DA850 /* BG1Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG1Controller.h; sourceTree = "<group>"; };
233 456565D026E0C90B007DA850 /* IDOBindEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOBindEnum.h; sourceTree = "<group>"; };
234 456565D126E0C90B007DA850 /* HFSmartLinkDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HFSmartLinkDeviceInfo.h; sourceTree = "<group>"; };
235 456565D226E0C90B007DA850 /* BP5Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP5Controller.h; sourceTree = "<group>"; };
236 456565D326E0C90B007DA850 /* THV3Macro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = THV3Macro.h; sourceTree = "<group>"; };
237 456565D426E0C90B007DA850 /* HS2S.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HS2S.h; sourceTree = "<group>"; };
238 456565D526E0C90B007DA850 /* IDOBluetoothServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOBluetoothServices.h; sourceTree = "<group>"; };
239 456565D626E0C90B007DA850 /* PO1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PO1.h; sourceTree = "<group>"; };
240 456565D726E0C90B007DA850 /* HS4Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HS4Controller.h; sourceTree = "<group>"; };
241 456565D826E0C90B007DA850 /* IDOBlueEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOBlueEnum.h; sourceTree = "<group>"; };
242 456565D926E0C90B007DA850 /* BP5C.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP5C.h; sourceTree = "<group>"; };
243 456565DA26E0C90B007DA850 /* TS28BHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TS28BHeader.h; sourceTree = "<group>"; };
244 456565DB26E0C90B007DA850 /* BP3L.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP3L.h; sourceTree = "<group>"; };
245 456565DC26E0C90B007DA850 /* IHSDKCloudUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IHSDKCloudUser.h; sourceTree = "<group>"; };
246 456565DD26E0C90B007DA850 /* DFUDeviceFirmwareInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFUDeviceFirmwareInfo.h; sourceTree = "<group>"; };
247 456565DE26E0C90B007DA850 /* ECG3Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ECG3Controller.h; sourceTree = "<group>"; };
248 456565DF26E0C90B007DA850 /* IDOSyncActivityDataModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDOSyncActivityDataModel.h; sourceTree = "<group>"; };
249 456565E026E0C90B007DA850 /* KN550BT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KN550BT.h; sourceTree = "<group>"; };
250 456565E126E0C90B007DA850 /* SDKInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDKInfo.h; sourceTree = "<group>"; };
251 456565E226E0C90B007DA850 /* BPLoopMeasureSettingModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BPLoopMeasureSettingModel.h; sourceTree = "<group>"; };
252 456565E326E0C90D007DA850 /* iHealthSDK2.7.5.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = iHealthSDK2.7.5.a; sourceTree = "<group>"; };
253 45A72D16256E5FCB00825201 /* BP7Module.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BP7Module.m; sourceTree = "<group>"; };
254 45A72D17256E5FCB00825201 /* BP7Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP7Module.h; sourceTree = "<group>"; };
255 8CCCE9AE1E5ADF49007F7FE4 /* PO3Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PO3Module.h; sourceTree = "<group>"; };
256 8CCCE9AF1E5ADF49007F7FE4 /* PO3Module.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PO3Module.m; sourceTree = "<group>"; };
257 8CCCE9B01E5ADF49007F7FE4 /* POProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = POProfileModule.h; sourceTree = "<group>"; };
258 8CCCE9B11E5ADF49007F7FE4 /* POProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = POProfileModule.m; sourceTree = "<group>"; };
259 8CCCE9E11E5E7C58007F7FE4 /* HS6ProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HS6ProfileModule.h; sourceTree = "<group>"; };
260 8CCCE9E21E5E7C58007F7FE4 /* HS6ProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HS6ProfileModule.m; sourceTree = "<group>"; };
261 9F3D8E111E0B6CDB00BA44B1 /* BG1Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG1Module.h; sourceTree = "<group>"; };
262 9F3D8E121E0B6CDB00BA44B1 /* BG1Module.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BG1Module.m; sourceTree = "<group>"; };
263 9F3D8E131E0B6CDB00BA44B1 /* BG1ProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG1ProfileModule.h; sourceTree = "<group>"; };
264 9F3D8E141E0B6CDB00BA44B1 /* BG1ProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BG1ProfileModule.m; sourceTree = "<group>"; };
265 9F3D8E171E0B6CDB00BA44B1 /* BG5Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG5Module.h; sourceTree = "<group>"; };
266 9F3D8E181E0B6CDB00BA44B1 /* BG5Module.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BG5Module.m; sourceTree = "<group>"; };
267 9F3D8E191E0B6CDB00BA44B1 /* BGProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BGProfileModule.h; sourceTree = "<group>"; };
268 9F3D8E1A1E0B6CDB00BA44B1 /* BGProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BGProfileModule.m; sourceTree = "<group>"; };
269 AF1B3F101DF9482100DFDB23 /* HS4SModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HS4SModule.h; sourceTree = "<group>"; };
270 AF1B3F111DF9482100DFDB23 /* HS4SModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HS4SModule.m; sourceTree = "<group>"; };
271 AF1B3F121DF9482100DFDB23 /* HSProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HSProfileModule.h; sourceTree = "<group>"; };
272 AF1B3F131DF9482100DFDB23 /* HSProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HSProfileModule.m; sourceTree = "<group>"; };
273 AF1B3F381DFE72BD00DFDB23 /* HS6Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HS6Module.h; sourceTree = "<group>"; };
274 AF1B3F391DFE72BD00DFDB23 /* HS6Module.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HS6Module.m; sourceTree = "<group>"; };
275 CE60549A25482CC70059E83A /* TS28BModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TS28BModule.h; sourceTree = "<group>"; };
276 CE60549B25482CC70059E83A /* HS2SModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HS2SModule.h; sourceTree = "<group>"; };
277 CE60549C25482CC70059E83A /* BG5SModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BG5SModule.m; sourceTree = "<group>"; };
278 CE60549D25482CC70059E83A /* BP5SModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BP5SModule.m; sourceTree = "<group>"; };
279 CE60549E25482CC80059E83A /* BG1SModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG1SModule.h; sourceTree = "<group>"; };
280 CE60549F25482CC80059E83A /* BG1SModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BG1SModule.m; sourceTree = "<group>"; };
281 CE6054A025482CC80059E83A /* BG5SProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BG5SProfileModule.m; sourceTree = "<group>"; };
282 CE6054A125482CC80059E83A /* NT13BModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NT13BModule.h; sourceTree = "<group>"; };
283 CE6054A225482CC80059E83A /* NT13BProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NT13BProfileModule.m; sourceTree = "<group>"; };
284 CE6054A325482CC80059E83A /* TS28BProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TS28BProfileModule.h; sourceTree = "<group>"; };
285 CE6054A425482CC80059E83A /* NT13BProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NT13BProfileModule.h; sourceTree = "<group>"; };
286 CE6054A525482CC80059E83A /* TS28BModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TS28BModule.m; sourceTree = "<group>"; };
287 CE6054A625482CC80059E83A /* HS2SProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HS2SProfileModule.m; sourceTree = "<group>"; };
288 CE6054A725482CC80059E83A /* HS2SProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HS2SProfileModule.h; sourceTree = "<group>"; };
289 CE6054A825482CC80059E83A /* NT13BModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NT13BModule.m; sourceTree = "<group>"; };
290 CE6054A925482CC80059E83A /* BG1SProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG1SProfileModule.h; sourceTree = "<group>"; };
291 CE6054AA25482CC80059E83A /* BG1SProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BG1SProfileModule.m; sourceTree = "<group>"; };
292 CE6054AB25482CC90059E83A /* HS2SModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HS2SModule.m; sourceTree = "<group>"; };
293 CE6054AC25482CC90059E83A /* BG5SModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG5SModule.h; sourceTree = "<group>"; };
294 CE6054AD25482CC90059E83A /* BG5SProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BG5SProfileModule.h; sourceTree = "<group>"; };
295 CE6054AE25482CC90059E83A /* TS28BProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TS28BProfileModule.m; sourceTree = "<group>"; };
296 CE6054AF25482CC90059E83A /* BP5SModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BP5SModule.h; sourceTree = "<group>"; };
297 CE6054BC25482E580059E83A /* PO1Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PO1Module.h; sourceTree = "<group>"; };
298 CE6054BD25482E580059E83A /* PO1Module.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PO1Module.m; sourceTree = "<group>"; };
299 CE6054BE25482E590059E83A /* PO1ProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PO1ProfileModule.h; sourceTree = "<group>"; };
300 CE6054BF25482E590059E83A /* PO1ProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PO1ProfileModule.m; sourceTree = "<group>"; };
301 CEEE2D092548F6E4007AC7E4 /* PT3SBTModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PT3SBTModule.h; sourceTree = "<group>"; };
302 CEEE2D0A2548F6E4007AC7E4 /* PT3SBTProfileModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PT3SBTProfileModule.h; sourceTree = "<group>"; };
303 CEEE2D0B2548F6E4007AC7E4 /* PT3SBTProfileModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PT3SBTProfileModule.m; sourceTree = "<group>"; };
304 CEEE2D0C2548F6E4007AC7E4 /* PT3SBTModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PT3SBTModule.m; sourceTree = "<group>"; };
305 EC8A298C1ED6DCD400143F47 /* RNBGMacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBGMacro.h; sourceTree = "<group>"; };
306/* End PBXFileReference section */
307
308/* Begin PBXFrameworksBuildPhase section */
309 182D01F71DE565EC00E9B783 /* Frameworks */ = {
310 isa = PBXFrameworksBuildPhase;
311 buildActionMask = 2147483647;
312 files = (
313 456565E426E0C90D007DA850 /* iHealthSDK2.7.5.a in Frameworks */,
314 );
315 runOnlyForDeploymentPostprocessing = 0;
316 };
317/* End PBXFrameworksBuildPhase section */
318
319/* Begin PBXGroup section */
320 182D01F11DE565EC00E9B783 = {
321 isa = PBXGroup;
322 children = (
323 182D01FC1DE565EC00E9B783 /* ReactNativeIOSLibrary */,
324 182D01FB1DE565EC00E9B783 /* Products */,
325 );
326 sourceTree = "<group>";
327 };
328 182D01FB1DE565EC00E9B783 /* Products */ = {
329 isa = PBXGroup;
330 children = (
331 182D01FA1DE565EC00E9B783 /* libReactNativeIOSLibrary.a */,
332 );
333 name = Products;
334 sourceTree = "<group>";
335 };
336 182D01FC1DE565EC00E9B783 /* ReactNativeIOSLibrary */ = {
337 isa = PBXGroup;
338 children = (
339 EC8A298C1ED6DCD400143F47 /* RNBGMacro.h */,
340 9F3D8E111E0B6CDB00BA44B1 /* BG1Module.h */,
341 9F3D8E121E0B6CDB00BA44B1 /* BG1Module.m */,
342 9F3D8E131E0B6CDB00BA44B1 /* BG1ProfileModule.h */,
343 9F3D8E141E0B6CDB00BA44B1 /* BG1ProfileModule.m */,
344 9F3D8E171E0B6CDB00BA44B1 /* BG5Module.h */,
345 9F3D8E181E0B6CDB00BA44B1 /* BG5Module.m */,
346 9F3D8E191E0B6CDB00BA44B1 /* BGProfileModule.h */,
347 9F3D8E1A1E0B6CDB00BA44B1 /* BGProfileModule.m */,
348 AF1B3F101DF9482100DFDB23 /* HS4SModule.h */,
349 AF1B3F111DF9482100DFDB23 /* HS4SModule.m */,
350 3F31C42921ABE80400811B02 /* HS2Module.h */,
351 3F31C42A21ABE80400811B02 /* HS2Module.m */,
352 AF1B3F381DFE72BD00DFDB23 /* HS6Module.h */,
353 AF1B3F391DFE72BD00DFDB23 /* HS6Module.m */,
354 8CCCE9E11E5E7C58007F7FE4 /* HS6ProfileModule.h */,
355 8CCCE9E21E5E7C58007F7FE4 /* HS6ProfileModule.m */,
356 AF1B3F121DF9482100DFDB23 /* HSProfileModule.h */,
357 AF1B3F131DF9482100DFDB23 /* HSProfileModule.m */,
358 CE60549E25482CC80059E83A /* BG1SModule.h */,
359 CE60549F25482CC80059E83A /* BG1SModule.m */,
360 CE6054A925482CC80059E83A /* BG1SProfileModule.h */,
361 CE6054AA25482CC80059E83A /* BG1SProfileModule.m */,
362 CE6054AC25482CC90059E83A /* BG5SModule.h */,
363 CE60549C25482CC70059E83A /* BG5SModule.m */,
364 CE6054AD25482CC90059E83A /* BG5SProfileModule.h */,
365 CE6054A025482CC80059E83A /* BG5SProfileModule.m */,
366 CE6054AF25482CC90059E83A /* BP5SModule.h */,
367 CE60549D25482CC70059E83A /* BP5SModule.m */,
368 CE60549B25482CC70059E83A /* HS2SModule.h */,
369 CE6054AB25482CC90059E83A /* HS2SModule.m */,
370 CE6054A725482CC80059E83A /* HS2SProfileModule.h */,
371 CE6054A625482CC80059E83A /* HS2SProfileModule.m */,
372 CE6054A125482CC80059E83A /* NT13BModule.h */,
373 CE6054A825482CC80059E83A /* NT13BModule.m */,
374 CE6054A425482CC80059E83A /* NT13BProfileModule.h */,
375 CE6054A225482CC80059E83A /* NT13BProfileModule.m */,
376 CE60549A25482CC70059E83A /* TS28BModule.h */,
377 CE6054A525482CC80059E83A /* TS28BModule.m */,
378 CE6054A325482CC80059E83A /* TS28BProfileModule.h */,
379 CE6054AE25482CC90059E83A /* TS28BProfileModule.m */,
380 182D02891DE57A2F00E9B783 /* iHealthDeviceManagerModule.h */,
381 182D028A1DE57A2F00E9B783 /* iHealthDeviceManagerModule.m */,
382 18B752C21FFF61C500DE2629 /* ECGModule.h */,
383 18B752C31FFF61C500DE2629 /* ECGModule.m */,
384 18B752C71FFF67DE00DE2629 /* ECGProfileModule.h */,
385 18B752C81FFF67DE00DE2629 /* ECGProfileModule.m */,
386 18B752CA1FFF67F100DE2629 /* ECGUSBModule.h */,
387 18B752CB1FFF67F100DE2629 /* ECGUSBModule.m */,
388 CE6054BC25482E580059E83A /* PO1Module.h */,
389 CE6054BD25482E580059E83A /* PO1Module.m */,
390 CE6054BE25482E590059E83A /* PO1ProfileModule.h */,
391 CE6054BF25482E590059E83A /* PO1ProfileModule.m */,
392 8CCCE9AE1E5ADF49007F7FE4 /* PO3Module.h */,
393 8CCCE9AF1E5ADF49007F7FE4 /* PO3Module.m */,
394 8CCCE9B01E5ADF49007F7FE4 /* POProfileModule.h */,
395 8CCCE9B11E5ADF49007F7FE4 /* POProfileModule.m */,
396 CEEE2D092548F6E4007AC7E4 /* PT3SBTModule.h */,
397 CEEE2D0C2548F6E4007AC7E4 /* PT3SBTModule.m */,
398 CEEE2D0A2548F6E4007AC7E4 /* PT3SBTProfileModule.h */,
399 CEEE2D0B2548F6E4007AC7E4 /* PT3SBTProfileModule.m */,
400 183FB1641FF5082E0040009B /* BTMModule.h */,
401 183FB1671FF5082F0040009B /* BTMModule.m */,
402 183FB1651FF5082F0040009B /* BTMProfileModule.h */,
403 183FB1661FF5082F0040009B /* BTMProfileModule.m */,
404 1875101D1DE5E374005E66B1 /* BPProfileModule.h */,
405 1875101E1DE5E374005E66B1 /* BPProfileModule.m */,
406 187510201DE5E399005E66B1 /* BP550BTModule.h */,
407 187510211DE5E399005E66B1 /* BP550BTModule.m */,
408 187510231DE5E3CA005E66B1 /* BP7SModule.h */,
409 187510241DE5E3CA005E66B1 /* BP7SModule.m */,
410 187510261DE5E3E3005E66B1 /* BP5Module.h */,
411 187510271DE5E3E3005E66B1 /* BP5Module.m */,
412 45A72D17256E5FCB00825201 /* BP7Module.h */,
413 45A72D16256E5FCB00825201 /* BP7Module.m */,
414 187510291DE5E3FB005E66B1 /* BP3LModule.h */,
415 1875102A1DE5E3FB005E66B1 /* BP3LModule.m */,
416 1875102C1DE5E410005E66B1 /* AMProfileModule.h */,
417 1875102D1DE5E410005E66B1 /* AMProfileModule.m */,
418 1875102F1DE5E424005E66B1 /* AM4Module.h */,
419 187510301DE5E424005E66B1 /* AM4Module.m */,
420 187510321DE5E439005E66B1 /* AM3SModule.h */,
421 187510331DE5E439005E66B1 /* AM3SModule.m */,
422 4565653B26E0BDE6007DA850 /* AM5Module.h */,
423 4565653D26E0BDE6007DA850 /* AM5Module.m */,
424 4565653C26E0BDE6007DA850 /* AM5ProfileModule.h */,
425 4565653E26E0BDE7007DA850 /* AM5ProfileModule.m */,
426 187510351DE5E6A5005E66B1 /* Communication_SDK */,
427 );
428 path = ReactNativeIOSLibrary;
429 sourceTree = "<group>";
430 };
431 187510351DE5E6A5005E66B1 /* Communication_SDK */ = {
432 isa = PBXGroup;
433 children = (
434 4565654E26E0C90A007DA850 /* Headers */,
435 456565E326E0C90D007DA850 /* iHealthSDK2.7.5.a */,
436 );
437 path = Communication_SDK;
438 sourceTree = "<group>";
439 };
440 4565654E26E0C90A007DA850 /* Headers */ = {
441 isa = PBXGroup;
442 children = (
443 4565654F26E0C90A007DA850 /* IDOSyncBpDataModel.h */,
444 4565655026E0C90A007DA850 /* BPContinua.h */,
445 4565655126E0C90A007DA850 /* IDOWeightBluetoothModel.h */,
446 4565655226E0C90A007DA850 /* ScanDeviceController.h */,
447 4565655326E0C90A007DA850 /* AM5.h */,
448 4565655426E0C90A007DA850 /* ECGHeader.h */,
449 4565655526E0C90A007DA850 /* HS5.h */,
450 4565655626E0C90A007DA850 /* DFUHeader.h */,
451 4565655726E0C90A007DA850 /* AM5Header.h */,
452 4565655826E0C90A007DA850 /* HS2SController.h */,
453 4565655926E0C90A007DA850 /* IDODataExchangeModel.h */,
454 4565655A26E0C90A007DA850 /* BP5CController.h */,
455 4565655B26E0C90A007DA850 /* BPController.h */,
456 4565655C26E0C90A007DA850 /* HS3Controller.h */,
457 4565655D26E0C90A007DA850 /* IDOGetInfoBluetoothModel.h */,
458 4565655E26E0C90A007DA850 /* BPBTLEDevice.h */,
459 4565655F26E0C90A007DA850 /* NT13B.h */,
460 4565656026E0C90A007DA850 /* BP7Controller.h */,
461 4565656126E0C90A007DA850 /* BPAV10Device.h */,
462 4565656226E0C90A007DA850 /* BGMacroFile.h */,
463 4565656326E0C90A007DA850 /* AM5Controller.h */,
464 4565656426E0C90A007DA850 /* BG3Controller.h */,
465 4565656526E0C90A007DA850 /* PT3SBT.h */,
466 4565656626E0C90A007DA850 /* HSMacroFile.h */,
467 4565656726E0C90A007DA850 /* IDOCalculateBluetoothModel.h */,
468 4565656826E0C90A007DA850 /* AMMacroFile.h */,
469 4565656926E0C90A007DA850 /* IDOTransferFileManager.h */,
470 4565656A26E0C90A007DA850 /* SDKFlowUpdateDevice.h */,
471 4565656B26E0C90A007DA850 /* BPDevice.h */,
472 4565656C26E0C90A007DA850 /* POHeader.h */,
473 4565656D26E0C90A007DA850 /* SDKUpdateDevice.h */,
474 4565656E26E0C90A007DA850 /* BP5.h */,
475 4565656F26E0C90A007DA850 /* BPHeader.h */,
476 4565657026E0C90A007DA850 /* ABIController.h */,
477 4565657126E0C90A007DA850 /* TS28B.h */,
478 4565657226E0C90A007DA850 /* HFSmartLink.h */,
479 4565657326E0C90A007DA850 /* BP5SController.h */,
480 4565657426E0C90A007DA850 /* ConnectDeviceController.h */,
481 4565657526E0C90A007DA850 /* BG5S.h */,
482 4565657626E0C90A007DA850 /* BP5S.h */,
483 4565657726E0C90A007DA850 /* THV3.h */,
484 4565657826E0C90A007DA850 /* BG1.h */,
485 4565657926E0C90A007DA850 /* BG1SController.h */,
486 4565657A26E0C90A007DA850 /* HS5Controller.h */,
487 4565657B26E0C90A007DA850 /* BG5.h */,
488 4565657C26E0C90A007DA850 /* ManageDeviceController.h */,
489 4565657D26E0C90A007DA850 /* BGDevice.h */,
490 4565657E26E0C90A007DA850 /* IDOErrorCodeToStr.h */,
491 4565657F26E0C90A007DA850 /* THV3Controller.h */,
492 4565658026E0C90A007DA850 /* BP5SRWController.h */,
493 4565658126E0C90A007DA850 /* BG1S.h */,
494 4565658226E0C90A007DA850 /* HS2.h */,
495 4565658326E0C90A007DA850 /* PO1Controller.h */,
496 4565658426E0C90A007DA850 /* BGHeader.h */,
497 4565658526E0C90A007DA850 /* DFUController.h */,
498 4565658626E0C90A007DA850 /* PO3.h */,
499 4565658726E0C90A007DA850 /* BP3LController.h */,
500 4565658826E0C90A007DA850 /* IDOSyncHeartRateDataModel.h */,
501 4565658926E0C90A007DA850 /* NT13BHeader.h */,
502 4565658A26E0C90A007DA850 /* BG5Controller.h */,
503 4565658B26E0C90A007DA850 /* AM3Controller.h */,
504 4565658C26E0C90A007DA850 /* BPM1AE.h */,
505 4565658D26E0C90A007DA850 /* ABPM.h */,
506 4565658E26E0C90A007DA850 /* IDOLogEnum.h */,
507 4565658F26E0C90A007DA850 /* IDOSyncGpsDataModel.h */,
508 4565659026E0C90A007DA850 /* HealthHeader.h */,
509 4565659126E0C90A007DA850 /* IDOSyncPressureDataModel.h */,
510 4565659226E0C90A007DA850 /* IDOSyncSwimDataModel.h */,
511 4565659326E0C90A007DA850 /* HSHeader.h */,
512 4565659426E0C90A007DA850 /* DFUMacro.h */,
513 4565659526E0C90A007DA850 /* IDOTranEnum.h */,
514 4565659626E0C90A007DA850 /* BG5SController.h */,
515 4565659726E0C90A007DA850 /* AM3S_V2.h */,
516 4565659826E0C90A007DA850 /* IDOCommonMacro.h */,
517 4565659926E0C90A007DA850 /* IDORecordDeviceLog.h */,
518 4565659A26E0C90A007DA850 /* ABPMController.h */,
519 4565659B26E0C90A007DA850 /* NT13BMacroFile.h */,
520 4565659C26E0C90A007DA850 /* POMacroFile.h */,
521 4565659D26E0C90A007DA850 /* IDOSyncEnum.h */,
522 4565659E26E0C90A007DA850 /* AM3.h */,
523 4565659F26E0C90A007DA850 /* IDOSyncSpo2DataModel.h */,
524 456565A026E0C90A007DA850 /* KN550BTController.h */,
525 456565A126E0C90A007DA850 /* IDODataMigrationManager.h */,
526 456565A226E0C90A007DA850 /* BP7S.h */,
527 456565A326E0C90B007DA850 /* PO3Controller.h */,
528 456565A426E0C90B007DA850 /* HS3.h */,
529 456565A526E0C90B007DA850 /* AM4Controller.h */,
530 456565A626E0C90B007DA850 /* BPV25Device.h */,
531 456565A726E0C90B007DA850 /* PT3SBTMacroFile.h */,
532 456565A826E0C90B007DA850 /* HS2Controller.h */,
533 456565A926E0C90B007DA850 /* BP7SController.h */,
534 456565AA26E0C90B007DA850 /* BPContinuaController.h */,
535 456565AB26E0C90B007DA850 /* BP3.h */,
536 456565AC26E0C90B007DA850 /* IDOPeripheralModel.h */,
537 456565AD26E0C90B007DA850 /* AMHeader.h */,
538 456565AE26E0C90B007DA850 /* BP3Controller.h */,
539 456565AF26E0C90B007DA850 /* ECGMacroFile.h */,
540 456565B026E0C90B007DA850 /* BPV24Device.h */,
541 456565B126E0C90B007DA850 /* ECG3.h */,
542 456565B226E0C90B007DA850 /* IDOBluetoothManager.h */,
543 456565B326E0C90B007DA850 /* BPMacroFile.h */,
544 456565B426E0C90B007DA850 /* IDOBlueDataResponse.h */,
545 456565B526E0C90B007DA850 /* ECG3USBController.h */,
546 456565B626E0C90B007DA850 /* AM3SController_V2.h */,
547 456565B726E0C90B007DA850 /* NT13BController.h */,
548 456565B826E0C90B007DA850 /* ECG3USB.h */,
549 456565B926E0C90B007DA850 /* BP7.h */,
550 456565BA26E0C90B007DA850 /* BGController.h */,
551 456565BB26E0C90B007DA850 /* PT3SBTController.h */,
552 456565BC26E0C90B007DA850 /* iHealthHS6.h */,
553 456565BD26E0C90B007DA850 /* AM4.h */,
554 456565BE26E0C90B007DA850 /* BP5SRW.h */,
555 456565BF26E0C90B007DA850 /* BG3.h */,
556 456565C026E0C90B007DA850 /* IDOWatchDialInfoModel.h */,
557 456565C126E0C90B007DA850 /* DFUServerFirmwareInfo.h */,
558 456565C226E0C90B007DA850 /* ABI.h */,
559 456565C326E0C90B007DA850 /* IDOBluetoothEngine.h */,
560 456565C426E0C90B007DA850 /* IDOSyncSportDataModel.h */,
561 456565C526E0C90B007DA850 /* HS4.h */,
562 456565C626E0C90B007DA850 /* BPBV10Device.h */,
563 456565C726E0C90B007DA850 /* IDOBluetoothBaseModel.h */,
564 456565C826E0C90B007DA850 /* IDOFoundationCommand.h */,
565 456565C926E0C90B007DA850 /* TS28BController.h */,
566 456565CA26E0C90B007DA850 /* IDOWatchDialManager.h */,
567 456565CB26E0C90B007DA850 /* IDOSyncSleepDataModel.h */,
568 456565CC26E0C90B007DA850 /* HealthUser.h */,
569 456565CD26E0C90B007DA850 /* IDOSetInfoBluetoothModel.h */,
570 456565CE26E0C90B007DA850 /* IDOSyncManager.h */,
571 456565CF26E0C90B007DA850 /* BG1Controller.h */,
572 456565D026E0C90B007DA850 /* IDOBindEnum.h */,
573 456565D126E0C90B007DA850 /* HFSmartLinkDeviceInfo.h */,
574 456565D226E0C90B007DA850 /* BP5Controller.h */,
575 456565D326E0C90B007DA850 /* THV3Macro.h */,
576 456565D426E0C90B007DA850 /* HS2S.h */,
577 456565D526E0C90B007DA850 /* IDOBluetoothServices.h */,
578 456565D626E0C90B007DA850 /* PO1.h */,
579 456565D726E0C90B007DA850 /* HS4Controller.h */,
580 456565D826E0C90B007DA850 /* IDOBlueEnum.h */,
581 456565D926E0C90B007DA850 /* BP5C.h */,
582 456565DA26E0C90B007DA850 /* TS28BHeader.h */,
583 456565DB26E0C90B007DA850 /* BP3L.h */,
584 456565DC26E0C90B007DA850 /* IHSDKCloudUser.h */,
585 456565DD26E0C90B007DA850 /* DFUDeviceFirmwareInfo.h */,
586 456565DE26E0C90B007DA850 /* ECG3Controller.h */,
587 456565DF26E0C90B007DA850 /* IDOSyncActivityDataModel.h */,
588 456565E026E0C90B007DA850 /* KN550BT.h */,
589 456565E126E0C90B007DA850 /* SDKInfo.h */,
590 456565E226E0C90B007DA850 /* BPLoopMeasureSettingModel.h */,
591 );
592 path = Headers;
593 sourceTree = "<group>";
594 };
595/* End PBXGroup section */
596
597/* Begin PBXNativeTarget section */
598 182D01F91DE565EC00E9B783 /* ReactNativeIOSLibrary */ = {
599 isa = PBXNativeTarget;
600 buildConfigurationList = 182D02031DE565EC00E9B783 /* Build configuration list for PBXNativeTarget "ReactNativeIOSLibrary" */;
601 buildPhases = (
602 182D01F61DE565EC00E9B783 /* Sources */,
603 182D01F71DE565EC00E9B783 /* Frameworks */,
604 182D01F81DE565EC00E9B783 /* CopyFiles */,
605 );
606 buildRules = (
607 );
608 dependencies = (
609 );
610 name = ReactNativeIOSLibrary;
611 productName = ReactNativeIOSLibrary;
612 productReference = 182D01FA1DE565EC00E9B783 /* libReactNativeIOSLibrary.a */;
613 productType = "com.apple.product-type.library.static";
614 };
615/* End PBXNativeTarget section */
616
617/* Begin PBXProject section */
618 182D01F21DE565EC00E9B783 /* Project object */ = {
619 isa = PBXProject;
620 attributes = {
621 KnownAssetTags = (
622 New,
623 );
624 LastUpgradeCheck = 0810;
625 ORGANIZATIONNAME = daiqingquan;
626 TargetAttributes = {
627 182D01F91DE565EC00E9B783 = {
628 CreatedOnToolsVersion = 8.1;
629 ProvisioningStyle = Automatic;
630 };
631 };
632 };
633 buildConfigurationList = 182D01F51DE565EC00E9B783 /* Build configuration list for PBXProject "ReactNativeIOSLibrary" */;
634 compatibilityVersion = "Xcode 3.2";
635 developmentRegion = English;
636 hasScannedForEncodings = 0;
637 knownRegions = (
638 English,
639 en,
640 );
641 mainGroup = 182D01F11DE565EC00E9B783;
642 productRefGroup = 182D01FB1DE565EC00E9B783 /* Products */;
643 projectDirPath = "";
644 projectRoot = "";
645 targets = (
646 182D01F91DE565EC00E9B783 /* ReactNativeIOSLibrary */,
647 );
648 };
649/* End PBXProject section */
650
651/* Begin PBXSourcesBuildPhase section */
652 182D01F61DE565EC00E9B783 /* Sources */ = {
653 isa = PBXSourcesBuildPhase;
654 buildActionMask = 2147483647;
655 files = (
656 18B752C91FFF67DE00DE2629 /* ECGProfileModule.m in Sources */,
657 9F3D8E1C1E0B6CDB00BA44B1 /* BG1ProfileModule.m in Sources */,
658 8CCCE9E31E5E7C58007F7FE4 /* HS6ProfileModule.m in Sources */,
659 1875102E1DE5E411005E66B1 /* AMProfileModule.m in Sources */,
660 183FB1681FF508300040009B /* BTMProfileModule.m in Sources */,
661 CE6054BA25482CC90059E83A /* TS28BProfileModule.m in Sources */,
662 CE6054B625482CC90059E83A /* HS2SProfileModule.m in Sources */,
663 1875102B1DE5E3FB005E66B1 /* BP3LModule.m in Sources */,
664 CE6054B925482CC90059E83A /* HS2SModule.m in Sources */,
665 182D028B1DE57A2F00E9B783 /* iHealthDeviceManagerModule.m in Sources */,
666 CE6054B325482CC90059E83A /* BG5SProfileModule.m in Sources */,
667 4565653F26E0BDE7007DA850 /* AM5Module.m in Sources */,
668 4565654026E0BDE7007DA850 /* AM5ProfileModule.m in Sources */,
669 8CCCE9B21E5ADF49007F7FE4 /* PO3Module.m in Sources */,
670 AF1B3F151DF9482100DFDB23 /* HSProfileModule.m in Sources */,
671 CE6054B425482CC90059E83A /* NT13BProfileModule.m in Sources */,
672 187510251DE5E3CA005E66B1 /* BP7SModule.m in Sources */,
673 CE6054B025482CC90059E83A /* BG5SModule.m in Sources */,
674 9F3D8E1B1E0B6CDB00BA44B1 /* BG1Module.m in Sources */,
675 1875101F1DE5E374005E66B1 /* BPProfileModule.m in Sources */,
676 CE6054B125482CC90059E83A /* BP5SModule.m in Sources */,
677 3F31C42B21ABE80400811B02 /* HS2Module.m in Sources */,
678 CE6054B725482CC90059E83A /* NT13BModule.m in Sources */,
679 187510221DE5E399005E66B1 /* BP550BTModule.m in Sources */,
680 CE6054C025482E590059E83A /* PO1Module.m in Sources */,
681 CEEE2D0E2548F6E4007AC7E4 /* PT3SBTModule.m in Sources */,
682 8CCCE9B31E5ADF49007F7FE4 /* POProfileModule.m in Sources */,
683 9F3D8E1F1E0B6CDB00BA44B1 /* BGProfileModule.m in Sources */,
684 187510341DE5E439005E66B1 /* AM3SModule.m in Sources */,
685 CE6054C125482E590059E83A /* PO1ProfileModule.m in Sources */,
686 18B752CC1FFF67F100DE2629 /* ECGUSBModule.m in Sources */,
687 183FB1691FF508300040009B /* BTMModule.m in Sources */,
688 9F3D8E1E1E0B6CDB00BA44B1 /* BG5Module.m in Sources */,
689 CEEE2D0D2548F6E4007AC7E4 /* PT3SBTProfileModule.m in Sources */,
690 18B752C41FFF61C500DE2629 /* ECGModule.m in Sources */,
691 CE6054B525482CC90059E83A /* TS28BModule.m in Sources */,
692 AF1B3F141DF9482100DFDB23 /* HS4SModule.m in Sources */,
693 AF1B3F3A1DFE72BD00DFDB23 /* HS6Module.m in Sources */,
694 45A72D18256E5FCB00825201 /* BP7Module.m in Sources */,
695 CE6054B825482CC90059E83A /* BG1SProfileModule.m in Sources */,
696 187510311DE5E424005E66B1 /* AM4Module.m in Sources */,
697 CE6054B225482CC90059E83A /* BG1SModule.m in Sources */,
698 187510281DE5E3E3005E66B1 /* BP5Module.m in Sources */,
699 );
700 runOnlyForDeploymentPostprocessing = 0;
701 };
702/* End PBXSourcesBuildPhase section */
703
704/* Begin XCBuildConfiguration section */
705 182D02011DE565EC00E9B783 /* Debug */ = {
706 isa = XCBuildConfiguration;
707 buildSettings = {
708 ALWAYS_SEARCH_USER_PATHS = NO;
709 CLANG_ANALYZER_NONNULL = YES;
710 CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
711 CLANG_CXX_LIBRARY = "libc++";
712 CLANG_ENABLE_MODULES = YES;
713 CLANG_ENABLE_OBJC_ARC = YES;
714 CLANG_WARN_BOOL_CONVERSION = YES;
715 CLANG_WARN_CONSTANT_CONVERSION = YES;
716 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
717 CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
718 CLANG_WARN_EMPTY_BODY = YES;
719 CLANG_WARN_ENUM_CONVERSION = YES;
720 CLANG_WARN_INFINITE_RECURSION = YES;
721 CLANG_WARN_INT_CONVERSION = YES;
722 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
723 CLANG_WARN_SUSPICIOUS_MOVES = YES;
724 CLANG_WARN_UNREACHABLE_CODE = YES;
725 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
726 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
727 COPY_PHASE_STRIP = NO;
728 DEBUG_INFORMATION_FORMAT = dwarf;
729 ENABLE_STRICT_OBJC_MSGSEND = YES;
730 ENABLE_TESTABILITY = YES;
731 GCC_C_LANGUAGE_STANDARD = gnu99;
732 GCC_DYNAMIC_NO_PIC = NO;
733 GCC_NO_COMMON_BLOCKS = YES;
734 GCC_OPTIMIZATION_LEVEL = 0;
735 GCC_PREPROCESSOR_DEFINITIONS = (
736 "DEBUG=1",
737 "$(inherited)",
738 );
739 GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
740 GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
741 GCC_WARN_UNDECLARED_SELECTOR = YES;
742 GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
743 GCC_WARN_UNUSED_FUNCTION = YES;
744 GCC_WARN_UNUSED_VARIABLE = YES;
745 IPHONEOS_DEPLOYMENT_TARGET = 8.0;
746 MTL_ENABLE_DEBUG_INFO = YES;
747 ONLY_ACTIVE_ARCH = YES;
748 SDKROOT = iphoneos;
749 };
750 name = Debug;
751 };
752 182D02021DE565EC00E9B783 /* Release */ = {
753 isa = XCBuildConfiguration;
754 buildSettings = {
755 ALWAYS_SEARCH_USER_PATHS = NO;
756 CLANG_ANALYZER_NONNULL = YES;
757 CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
758 CLANG_CXX_LIBRARY = "libc++";
759 CLANG_ENABLE_MODULES = YES;
760 CLANG_ENABLE_OBJC_ARC = YES;
761 CLANG_WARN_BOOL_CONVERSION = YES;
762 CLANG_WARN_CONSTANT_CONVERSION = YES;
763 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
764 CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
765 CLANG_WARN_EMPTY_BODY = YES;
766 CLANG_WARN_ENUM_CONVERSION = YES;
767 CLANG_WARN_INFINITE_RECURSION = YES;
768 CLANG_WARN_INT_CONVERSION = YES;
769 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
770 CLANG_WARN_SUSPICIOUS_MOVES = YES;
771 CLANG_WARN_UNREACHABLE_CODE = YES;
772 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
773 "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
774 COPY_PHASE_STRIP = NO;
775 DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
776 ENABLE_NS_ASSERTIONS = NO;
777 ENABLE_STRICT_OBJC_MSGSEND = YES;
778 GCC_C_LANGUAGE_STANDARD = gnu99;
779 GCC_NO_COMMON_BLOCKS = YES;
780 GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
781 GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
782 GCC_WARN_UNDECLARED_SELECTOR = YES;
783 GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
784 GCC_WARN_UNUSED_FUNCTION = YES;
785 GCC_WARN_UNUSED_VARIABLE = YES;
786 IPHONEOS_DEPLOYMENT_TARGET = 8.0;
787 MTL_ENABLE_DEBUG_INFO = NO;
788 SDKROOT = iphoneos;
789 VALIDATE_PRODUCT = YES;
790 };
791 name = Release;
792 };
793 182D02041DE565EC00E9B783 /* Debug */ = {
794 isa = XCBuildConfiguration;
795 buildSettings = {
796 HEADER_SEARCH_PATHS = "$(SRCROOT)/../../react-native/React/**";
797 LIBRARY_SEARCH_PATHS = (
798 "$(inherited)",
799 "$(PROJECT_DIR)/ReactNativeIOSLibrary/Communication_SDK",
800 "$(PROJECT_DIR)/ReactNativeIOSLibrary",
801 );
802 MODULEMAP_PRIVATE_FILE = "";
803 OTHER_LDFLAGS = "-ObjC";
804 PRODUCT_NAME = "$(TARGET_NAME)";
805 SKIP_INSTALL = YES;
806 };
807 name = Debug;
808 };
809 182D02051DE565EC00E9B783 /* Release */ = {
810 isa = XCBuildConfiguration;
811 buildSettings = {
812 HEADER_SEARCH_PATHS = "$(SRCROOT)/../../react-native/React/**";
813 LIBRARY_SEARCH_PATHS = (
814 "$(inherited)",
815 "$(PROJECT_DIR)/ReactNativeIOSLibrary/Communication_SDK",
816 "$(PROJECT_DIR)/ReactNativeIOSLibrary",
817 );
818 MODULEMAP_PRIVATE_FILE = "";
819 OTHER_LDFLAGS = "-ObjC";
820 PRODUCT_NAME = "$(TARGET_NAME)";
821 SKIP_INSTALL = YES;
822 };
823 name = Release;
824 };
825/* End XCBuildConfiguration section */
826
827/* Begin XCConfigurationList section */
828 182D01F51DE565EC00E9B783 /* Build configuration list for PBXProject "ReactNativeIOSLibrary" */ = {
829 isa = XCConfigurationList;
830 buildConfigurations = (
831 182D02011DE565EC00E9B783 /* Debug */,
832 182D02021DE565EC00E9B783 /* Release */,
833 );
834 defaultConfigurationIsVisible = 0;
835 defaultConfigurationName = Release;
836 };
837 182D02031DE565EC00E9B783 /* Build configuration list for PBXNativeTarget "ReactNativeIOSLibrary" */ = {
838 isa = XCConfigurationList;
839 buildConfigurations = (
840 182D02041DE565EC00E9B783 /* Debug */,
841 182D02051DE565EC00E9B783 /* Release */,
842 );
843 defaultConfigurationIsVisible = 0;
844 defaultConfigurationName = Release;
845 };
846/* End XCConfigurationList section */
847 };
848 rootObject = 182D01F21DE565EC00E9B783 /* Project object */;
849}
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100755
index 0000000..fbca893
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<Workspace
3 version = "1.0">
4 <FileRef
5 location = "self:ReactNativeIOSLibrary.xcodeproj">
6 </FileRef>
7</Workspace>
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0">
4<dict>
5 <key>IDEDidComputeMac32BitWarning</key>
6 <true/>
7</dict>
8</plist>
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM3SModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM3SModule.h
new file mode 100755
index 0000000..f1f40ed
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM3SModule.h
@@ -0,0 +1,20 @@
1//
2// AM3SModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16
17
18@interface AM3SModule : RCTEventEmitter<RCTBridgeModule>
19
20@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM3SModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM3SModule.m
new file mode 100644
index 0000000..f6fcff4
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM3SModule.m
@@ -0,0 +1,788 @@
1//
2// AM3SModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "AM3SModule.h"
10#import "AMProfileModule.h"
11#import "AMMacroFile.h"
12#import "AM3SController_V2.h"
13#import "AM3S_V2.h"
14
15#define EVENT_NOTIFY @"event_notify_am3s"
16
17@implementation AM3SModule
18
19RCT_EXPORT_MODULE()
20- (NSArray<NSString *> *)supportedEvents {
21 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
22 @"event_device_connected", @"event_device_connect_failed",
23 @"event_device_disconnect", @"event_authenticate_result",
24 @"event_notify_ts28b", @"event_notify_bg1",
25 @"action_connect_result_for_bg1"];
26}
27
28- (NSDictionary *)constantsToExport
29{
30 return @{
31 @"Event_Notify": EVENT_NOTIFY
32
33 };
34}
35+ (BOOL)requiresMainQueueSetup
36{
37 return YES;
38}
39#pragma mark
40#pragma mark - Init
41-(id)init
42{
43 if (self=[super init])
44 {
45
46 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(DeviceConnectForAM3S:) name:AM3SConnectNoti object:nil];
47 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(DeviceDisConnectForAM3S:) name:AM3SDisConnectNoti object:nil];
48
49 [AM3SController_V2 shareIHAM3SController];
50
51 }
52 return self;
53}
54
55-(AM3S_V2*)getAM3SWithMac:(NSString*)mac{
56
57 AM3SController_V2 *controller = [AM3SController_V2 shareIHAM3SController];
58 NSArray *amDeviceArray = [controller getAllCurrentAM3SInstace];
59
60 for(AM3S_V2 *tempAM3S in amDeviceArray){
61 if([mac isEqualToString:tempAM3S.serialNumber]){
62
63 return tempAM3S;
64 break;
65 }
66 }
67
68 return nil;
69}
70
71#pragma mark
72#pragma mark - Notification
73#pragma mark - AM3S
74
75-(void)DeviceConnectForAM3S:(NSNotification *)tempNoti{
76 AM3SController_V2 *controller = [AM3SController_V2 shareIHAM3SController];
77 NSArray *amDeviceArray = [controller getAllCurrentAM3SInstace];
78
79 AM3S_V2 *AMInstance = [amDeviceArray objectAtIndex:0];
80}
81
82-(void)DeviceDisConnectForAM3S:(NSNotification *)tempNoti{
83 AM3SController_V2 *controller = [AM3SController_V2 shareIHAM3SController];
84
85
86}
87#pragma mark - Method
88
89
90#pragma mark-获取连接设备
91RCT_EXPORT_METHOD(getAllConnectedDevices){
92
93
94 NSArray*am3sarray= [[AM3SController_V2 shareIHAM3SController] getAllCurrentAM3SInstace];
95
96 NSMutableArray*deviceMacArray=[NSMutableArray array];
97
98 for (int i=0; i<[am3sarray count]; i++) {
99
100 AM3S_V2*am3s=[am3sarray objectAtIndex:i];
101
102 [deviceMacArray addObject:am3s.serialNumber];
103
104 }
105
106 NSDictionary* deviceInfo = @{@"action":@"ACTION_GET_ALL_CONNECTED_DEVICES",@"devices":deviceMacArray};
107
108 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
109
110
111}
112
113
114#pragma mark-恢复出厂
115RCT_EXPORT_METHOD(reset:(nonnull NSString *)mac){
116
117 if ([self getAM3SWithMac:mac]!=nil) {
118
119 [[self getAM3SWithMac:mac] commandAM3SResetDevice:^(BOOL resetSuc) {
120
121 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"reset_am",@"reset":[NSNumber numberWithInteger:resetSuc]};
122 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
123
124 } withErrorBlock:^(AM3SErrorID errorID) {
125
126 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
127 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
128 }];
129 }
130}
131#pragma mark - 得到用户ID
132RCT_EXPORT_METHOD(getUserId:(nonnull NSString *)mac){
133
134 if ([self getAM3SWithMac:mac]!=nil) {
135
136 [[self getAM3SWithMac:mac] commandAM3SGetDeviceUserID:^(unsigned int userID) {
137
138 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"userid_am",@"userid":[NSNumber numberWithInteger:userID]};
139 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
140
141 } withErrorBlock:^(AM3SErrorID errorID) {
142
143 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
144 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
145 }];
146
147 }
148}
149#pragma mark - 设置用户ID
150RCT_EXPORT_METHOD(setUserId:(nonnull NSString *)mac :(nonnull NSNumber *)uesrID){
151
152 if ([self getAM3SWithMac:mac]!=nil) {
153
154 [[self getAM3SWithMac:mac] commandAM3SSetUserID:uesrID withFinishResult:^(BOOL resetSuc) {
155
156 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_userid_success_am"};
157 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
158
159 } withErrorBlock:^(AM3SErrorID errorID) {
160 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
161 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
162 }];
163 }
164}
165#pragma mark - 同步时间
166RCT_EXPORT_METHOD(syncRealTime:(nonnull NSString *)mac){
167
168 if ([self getAM3SWithMac:mac]!=nil) {
169
170 [[self getAM3SWithMac:mac] commandAM3SSyncTime:^(BOOL resetSuc) {
171
172 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_sync_time_success_am"};
173 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
174 } withErrorBlock:^(AM3SErrorID errorID) {
175
176 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
177 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
178 }];
179 }
180}
181#pragma mark - 设置用户信息
182RCT_EXPORT_METHOD(setUserInfo:(nonnull NSString *)mac :(nonnull NSNumber *)age :(nonnull NSNumber *)height :(nonnull NSNumber *)weight :(nonnull NSNumber *)gender :(nonnull NSNumber *)unit :(nonnull NSNumber *)target :(nonnull NSNumber *)activityLevel){
183
184 if ([self getAM3SWithMac:mac]!=nil) {
185
186 HealthUser *myUser = [[HealthUser alloc]init];
187 myUser.age = age;
188 myUser.sex = UserSex_Male;
189 myUser.height = height;
190 myUser.weight = weight;
191 myUser.activityLevel = activityLevel;
192
193 NSDictionary *dic = [[NSMutableDictionary alloc]init];
194 [[self getAM3SWithMac:mac] commandAM3SSetUserInfo:myUser withUnit:unit withActiveGoal:target withSetUserInfoFinishResult:^(BOOL resetSuc) {
195
196 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_userinfo_success_am"};
197 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
198
199 } withSetBMR:^(BOOL resetSuc) {
200
201
202 } withErrorBlock:^(AM3SErrorID errorID) {
203
204 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
205 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
206 }];
207 }
208}
209#pragma mark - 得到用户信息
210RCT_EXPORT_METHOD(getUserInfo:(nonnull NSString *)mac){
211
212 if ([self getAM3SWithMac:mac]!=nil) {
213
214 [[self getAM3SWithMac:mac] commandAM3SGetUserInfo:^(NSDictionary *userInfo) {
215
216 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"get_userinfo_am",@"age":[userInfo valueForKey:@"Age"],@"step":[userInfo valueForKey:@"Step"],@"height":[userInfo valueForKey:@"Height"],@"gender":[userInfo valueForKey:@"Gender"],@"weight":[userInfo valueForKey:@"Weight"],@"unit":[userInfo valueForKey:@"Unit"],@"target1":[userInfo valueForKey:@"TotalStep1"],@"target2":[userInfo valueForKey:@"TotalStep2"],@"target3":[userInfo valueForKey:@"TotalStep3"]};
217
218 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
219
220 } withErrorBlock:^(AM3SErrorID errorID) {
221
222 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
223 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
224 }];
225 }
226}
227#pragma mark - 得到闹钟个数
228RCT_EXPORT_METHOD(getAlarmClockNum:(nonnull NSString *)mac){
229
230 if ([self getAM3SWithMac:mac]!=nil) {
231
232 [[self getAM3SWithMac:mac] commandAM3SGetTotoalAlarmInfo:^(NSMutableArray *totoalAlarmArray) {
233
234 NSMutableArray * IDArray = [[NSMutableArray alloc]init];
235
236 if (totoalAlarmArray.count > 0){
237
238 for (NSDictionary *dic in totoalAlarmArray) {
239 [IDArray addObject:[dic valueForKey:@"AlarmId"]];
240 }
241 }
242
243 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"get_alarmnum_am",@"alarmclocknumber":[NSNumber numberWithInt:IDArray.count],@"alarmclocknumberid":IDArray};
244 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
245
246 } withErrorBlock:^(AM3SErrorID errorID) {
247
248 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
249 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
250 }];
251 }
252}
253#pragma mark - 得到闹钟信息
254RCT_EXPORT_METHOD(getAlarmClockDetail:(nonnull NSString *)mac :(nonnull NSArray *)alarmIDS){
255
256 if ([self getAM3SWithMac:mac]!=nil) {
257
258 [[self getAM3SWithMac:mac] commandAM3SGetTotoalAlarmInfo:^(NSMutableArray *totoalAlarmArray) {
259
260 NSMutableArray * alarmInfoArray = [[NSMutableArray alloc]init];
261
262 if (totoalAlarmArray.count > 0){
263
264 for (NSDictionary *dic in totoalAlarmArray) {
265
266
267 NSMutableDictionary *alartDic = [[NSMutableDictionary alloc]init];
268
269 for (NSNumber * alarmID in alarmIDS) {
270
271 NSNumber *deviceAlarmID = [dic valueForKey:@"AlarmId"];
272
273 if(deviceAlarmID.intValue == alarmID.intValue){
274
275 [alartDic setValue:[dic valueForKey:@"AlarmId"] forKey:@"alarmid"];
276
277 NSDate *date = [dic valueForKey:@"Time"];
278 NSDateFormatter *dateFormater=[[NSDateFormatter alloc]init];
279 [dateFormater setTimeZone:[NSTimeZone defaultTimeZone]];
280 [dateFormater setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];
281 [dateFormater setDateFormat:@"HH:mm"];
282 NSString *dateString = [dateFormater stringFromDate:date];
283
284 [alartDic setValue:dateString forKey:@"time"];
285 [alartDic setValue:[dic valueForKey:@"IsRepeat"] forKey:@"repeat"];
286
287 NSMutableDictionary * weekDic = [[NSMutableDictionary alloc]init];
288 [weekDic setValue:[[dic valueForKey:@"Week"] objectAtIndex:0] forKey:@"sun"];
289 [weekDic setValue:[[dic valueForKey:@"Week"] objectAtIndex:1] forKey:@"mon"];
290 [weekDic setValue:[[dic valueForKey:@"Week"] objectAtIndex:2] forKey:@"tue"];
291 [weekDic setValue:[[dic valueForKey:@"Week"] objectAtIndex:3] forKey:@"wed"];
292 [weekDic setValue:[[dic valueForKey:@"Week"] objectAtIndex:4] forKey:@"thu"];
293 [weekDic setValue:[[dic valueForKey:@"Week"] objectAtIndex:5] forKey:@"fri"];
294 [weekDic setValue:[[dic valueForKey:@"Week"] objectAtIndex:6] forKey:@"sat"];
295
296 [alartDic setValue:weekDic forKey:@"get_alarm_week"];
297 [alartDic setValue:[dic valueForKey:@"Switch"] forKey:@"switch"];
298 [alarmInfoArray addObject:alartDic];
299
300 }
301 }
302 }
303
304 }
305 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"get_alarminfo_am",@"alarmclockdetail":alarmInfoArray};
306 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
307
308 } withErrorBlock:^(AM3SErrorID errorID) {
309 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
310 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
311 }];
312 }
313}
314#pragma mark - 设置闹钟信息
315RCT_EXPORT_METHOD(setAlarmClock:(nonnull NSString *)mac :(nonnull NSNumber *)alarmID :(nonnull NSNumber *)hour :(nonnull NSNumber *)min :(nonnull NSNumber*)isRepeat :(nonnull NSArray *)weekArray :(nonnull NSNumber *)isOn){
316
317 if ([self getAM3SWithMac:mac]!=nil) {
318
319 if(alarmID.integerValue < 0 || alarmID.integerValue > 3 ||
320 hour.integerValue > 23 || hour.integerValue < 0 ||
321 min.integerValue > 59 || min.integerValue < 0){
322
323 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:400]};
324 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
325 return;
326 }
327
328 NSDateFormatter *formater=[[NSDateFormatter alloc]init];
329 [formater setTimeZone:[NSTimeZone defaultTimeZone]];
330 [formater setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];
331 [formater setDateFormat:@"HH-mm"];
332 NSString * timeStr = [NSString stringWithFormat:@"%@-%@",hour,min];
333 NSDate *date = [formater dateFromString:timeStr];
334
335
336 NSDictionary *dic = [[NSDictionary alloc]initWithObjectsAndKeys:alarmID,@"AlarmId",date,@"Time",isRepeat,@"IsRepeat",weekArray,@"Week",isOn,@"Switch", nil];
337
338
339 [[self getAM3SWithMac:mac] commandAM3SSetAlarmDictionary:dic withFinishResult:^(BOOL resetSuc) {
340 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_alarminfo_success_am"};
341
342 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
343
344 } withErrorBlock:^(AM3SErrorID errorID) {
345 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
346 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
347 }];
348 }
349}
350#pragma mark - 删除闹钟信息
351RCT_EXPORT_METHOD(deleteAlarmClock:(nonnull NSString *)mac :(nonnull NSNumber *)alarmID){
352
353 if ([self getAM3SWithMac:mac]!=nil) {
354
355 [[self getAM3SWithMac:mac] commandAM3SDeleteAlarmID:alarmID withFinishResult:^(BOOL resetSuc) {
356
357 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"delete_alarm_success_am"};
358 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
359
360 } withErrorBlock:^(AM3SErrorID errorID) {
361 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
362 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
363 }];
364 }
365}
366#pragma mark - 查询提醒信息
367RCT_EXPORT_METHOD(getActivityRemind:(nonnull NSString *)mac){
368
369 if ([self getAM3SWithMac:mac]!=nil) {
370
371 [[self getAM3SWithMac:mac] commandAM3SGetReminderInfo:^(NSArray *remindInfo) {
372
373 NSDictionary *dic = [remindInfo objectAtIndex:0];
374
375 NSDate *date = [dic valueForKey:@"Time"];
376 NSDateFormatter *dateFormater=[[NSDateFormatter alloc]init];
377 [dateFormater setTimeZone:[NSTimeZone defaultTimeZone]];
378 [dateFormater setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];
379 [dateFormater setDateFormat:@"HH:mm"];
380 NSString *dateString = [dateFormater stringFromDate:date];
381
382
383 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"get_activity_remind_am",@"time":dateString,@"switch":[dic valueForKey:@"Switch"]};
384
385 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
386
387 } withErrorBlock:^(AM3SErrorID errorID) {
388 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
389 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
390 }];
391 }
392}
393#pragma mark - 设置提醒信息
394RCT_EXPORT_METHOD(setActivityRemind:(nonnull NSString *)mac :(nonnull NSNumber *)hour :(nonnull NSNumber *)min :(nonnull NSNumber *)isOn){
395
396 if ([self getAM3SWithMac:mac]!=nil) {
397
398 if(hour.integerValue > 23 || hour.integerValue < 0 ||
399 min.integerValue > 59 || min.integerValue < 0){
400
401 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:400]};
402 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
403 return;
404 }
405
406 NSDateFormatter *formater=[[NSDateFormatter alloc]init];
407 [formater setTimeZone:[NSTimeZone defaultTimeZone]];
408 [formater setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];
409 [formater setDateFormat:@"HH-mm"];
410 NSString * timeStr = [NSString stringWithFormat:@"%@-%@",hour,min];
411 NSDate *date = [formater dateFromString:timeStr];
412
413
414 NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:date,@"Time",isOn,@"Switch", nil];
415
416 [[self getAM3SWithMac:mac] commandAM3SSetReminderDictionary:dic withFinishResult:^(BOOL resetSuc) {
417
418 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_activityremind_success_am"};
419 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
420 } withErrorBlock:^(AM3SErrorID errorID) {
421 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
422 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
423 }];
424 }
425}
426#pragma mark - 同步运动
427RCT_EXPORT_METHOD(syncActivityData:(nonnull NSString *)mac){
428
429 if ([self getAM3SWithMac:mac]!=nil) {
430
431 [[self getAM3SWithMac:mac] commandAM3SStartSyncActiveData:^(NSDictionary *startDataDictionary) {
432
433
434
435 } withActiveHistoryData:^(NSArray *historyDataArray) {
436
437 NSMutableArray *lastArray = [[NSMutableArray alloc]init];
438 for (NSDictionary *dic in historyDataArray) {
439
440 NSMutableDictionary * lastDic = [[NSMutableDictionary alloc]init];
441
442
443 NSDateFormatter *dateFormat = nil;
444
445 if (dateFormat == nil) {
446 dateFormat = [[NSDateFormatter alloc] init];
447 [dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//设定时间格式,这里可以设置成自己需要的格式
448 }
449
450 NSString *locationString=[dateFormat stringFromDate:[dic valueForKey:AMDate]];
451
452 [lastDic setValue:locationString forKey:@"time"];
453
454 [lastDic setValue:[dic valueForKey:AMStepSize] forKey:@"stepsize"];
455 [lastDic setValue:[dic valueForKey:AMCalorie] forKey:@"calorie"];
456 [lastDic setValue:[dic valueForKey:AMStepNum] forKey:@"step"];
457 [lastDic setValue:[dic valueForKey:@"dataID"] forKey:@"dataID"];
458 [lastArray addObject:lastDic];
459 }
460
461 NSDictionary *dictionary = [NSDictionary dictionaryWithObject:lastArray forKey:@"activity_each_data"];
462 NSArray *array = [NSArray arrayWithObjects:dictionary, nil];
463
464 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"sync_activity_data_am",@"activity":array};
465
466 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
467
468 } withActiveFinishTransmission:^{
469
470
471 } withErrorBlock:^(AM3SErrorID errorID) {
472 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
473 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
474 }];
475 }
476}
477#pragma mark - 同步睡眠
478RCT_EXPORT_METHOD(syncSleepData:(nonnull NSString *)mac){
479
480 if ([self getAM3SWithMac:mac]!=nil) {
481
482 [[self getAM3SWithMac:mac] commandAM3SStartSyncSleepData:^(NSDictionary *startDataDictionary) {
483
484
485 } withSleepHistoryData:^(NSArray *historyDataArray) {
486
487 NSMutableArray *lastArray = [[NSMutableArray alloc]init];
488
489
490 for (NSArray *array in historyDataArray) {
491
492 for (NSDictionary *dic in array) {
493
494 NSMutableDictionary * lastDic = [[NSMutableDictionary alloc]init];
495 NSDateFormatter *dateFormat = nil;
496
497 if (dateFormat == nil) {
498 dateFormat = [[NSDateFormatter alloc] init];
499 [dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//设定时间格式,这里可以设置成自己需要的格式
500 }
501
502 NSString *locationString=[dateFormat stringFromDate:[dic valueForKey:AMDate]];
503
504 [lastDic setValue:locationString forKey:@"time"]; [lastDic setValue:[dic valueForKey:@"SleepData"] forKey:@"level"];
505 [lastDic setValue:[dic valueForKey:@"dataID"] forKey:@"dataID"];
506 [lastArray addObject:lastDic];
507
508 }
509 }
510
511 NSDictionary *dictionary = [NSDictionary dictionaryWithObject:lastArray forKey:@"sleep_each_data"];
512 NSArray *array = [NSArray arrayWithObjects:dictionary, nil];
513
514 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"sync_sleep_data_am",@"sleep":array};
515
516
517 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
518
519
520 } withSleepFinishTransmission:^{
521
522 } withErrorBlock:^(AM3SErrorID errorID) {
523 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
524 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
525 }];
526 }
527}
528#pragma mark - 同步阶段性
529RCT_EXPORT_METHOD(syncStageReportData:(nonnull NSString *)mac){
530
531 if ([self getAM3SWithMac:mac]!=nil) {
532
533 [[self getAM3SWithMac:mac] commandAM3SStartSyncStageData:^(NSArray *measureDataArray) {
534
535 NSMutableArray *lastArray = [[NSMutableArray alloc]init];
536
537
538 NSPredicate *pre = [NSPredicate predicateWithFormat:@"ReportState == 1"];
539 NSArray *workoutArray = [measureDataArray filteredArrayUsingPredicate:pre];
540 if (workoutArray.count != 0)
541 {
542 for (NSDictionary *dic in workoutArray) {
543
544 NSMutableDictionary *dictionary = [[NSMutableDictionary alloc]init];
545 [dictionary setValue:@"stage_data_type_workout" forKey:@"type"];
546
547 NSDateFormatter *dateFormat = nil;
548
549 if (dateFormat == nil) {
550 dateFormat = [[NSDateFormatter alloc] init];
551 [dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//设定时间格式,这里可以设置成自己需要的格式
552 }
553
554 NSString *locationString=[dateFormat stringFromDate:[dic valueForKey:Work_outMeasureDate]];
555
556
557
558 [dictionary setValue:locationString forKey:@"stoptime"];
559 [dictionary setValue:[dic valueForKey:Work_outTimeNumber] forKey:@"usedtime"];
560 [dictionary setValue:[dic valueForKey:Work_outStepNumber] forKey:@"stage_data_workout_step"];
561 [dictionary setValue:[dic valueForKey:Work_outLengthNumber] forKey:@"stage_data_distance"];
562 [dictionary setValue:[dic valueForKey:Work_outCalories] forKey:@"calorie"];
563 [dictionary setValue:[dic valueForKey:@"dataID"] forKey:@"dataID"];
564 [lastArray addObject:dictionary];
565 }
566 }
567
568 NSPredicate *predicateSleep = [NSPredicate predicateWithFormat:@"ReportState == 2"];
569 NSArray *sleepArray = [measureDataArray filteredArrayUsingPredicate:predicateSleep];
570 if (sleepArray.count != 0)
571 {
572 for (NSDictionary *dic in sleepArray) {
573
574
575
576
577 NSMutableDictionary *dictionary = [[NSMutableDictionary alloc]init];
578 [dictionary setValue:@"sleep" forKey:@"type"];
579
580
581 NSDateFormatter *dateFormat = nil;
582
583 if (dateFormat == nil) {
584 dateFormat = [[NSDateFormatter alloc] init];
585 [dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//设定时间格式,这里可以设置成自己需要的格式
586 }
587
588 NSString *locationString=[dateFormat stringFromDate:[dic valueForKey:Sleep_summaryMeasureDate]];
589
590
591 [dictionary setValue:locationString forKey:@"stoptime"];
592 [dictionary setValue:[dic valueForKey:Sleep_summarySleepTime] forKey:@"usedtime"];
593 [dictionary setValue:[dic valueForKey:Sleep_summarysleepEfficiency] forKey:@"sleepefficiency"];
594 [dictionary setValue:[dic valueForKey:Sleep_summarysleepAddMinute] forKey:@"is50min"];
595 [lastArray addObject:dictionary];
596 }
597
598 }
599
600 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"sync_stage_data_am",@"stage_data":lastArray};
601 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
602
603
604 } withStageDataFinishTransmission:^(BOOL resetSuc) {
605
606
607
608
609 } withErrorBlock:^(AM3SErrorID errorID) {
610
611 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
612 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
613 }];
614 }
615}
616#pragma mark - 同步阶实时数据
617RCT_EXPORT_METHOD(syncRealData:(nonnull NSString *)mac){
618
619 if ([self getAM3SWithMac:mac]!=nil) {
620
621 [[self getAM3SWithMac:mac] commandAM3SStartSyncCurrentActiveData:^(NSDictionary *activeDictionary) {
622
623 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"sync_real_data_am",@"step":[activeDictionary valueForKey:@"Step"],@"calorie":[activeDictionary valueForKey:@"Calories"],@"totalcalories":[activeDictionary valueForKey:@"TotalCalories"]};
624 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
625
626 } withErrorBlock:^(AM3SErrorID errorID) {
627 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
628 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
629 }];
630 }
631}
632#pragma mark - 查询状态
633RCT_EXPORT_METHOD(queryAMState:(nonnull NSString *)mac){
634
635 if ([self getAM3SWithMac:mac]!=nil) {
636
637 __block NSInteger index;
638
639 [[self getAM3SWithMac:mac] commandAM3SGetDeviceStateInfo:^(AM3SQueryState queryState) {
640
641 index = queryState;
642
643 } withBattery:^(NSNumber *battery) {
644
645 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"query_state_am",@"query_state":[NSNumber numberWithInteger:index],@"battery":battery};
646 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
647
648 } withErrorBlock:^(AM3SErrorID errorID) {
649 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
650 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
651 }];
652 }
653}
654#pragma mark - 设置BMR
655RCT_EXPORT_METHOD(setUserBmr:(nonnull NSString *)mac :(nonnull NSNumber *)bmr){
656
657 if ([self getAM3SWithMac:mac]!=nil) {
658
659 [[self getAM3SWithMac:mac] commandAM3SSetBMR:bmr withFinishResult:^(BOOL resetSuc) {
660
661 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_bmr_success_am"};
662
663 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
664
665 } withErrorBlock:^(AM3SErrorID errorID) {
666 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
667 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
668 }];
669 }
670}
671#pragma mark - 随机数
672RCT_EXPORT_METHOD(sendRandom:(nonnull NSString *)mac){
673
674 if ([self getAM3SWithMac:mac]!=nil) {
675
676 [[self getAM3SWithMac:mac] commandAM3SSetRandomNumber:^(NSString *randomNumString) {
677
678 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"get_random_am",@"random":randomNumString};
679 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
680 } withErrorBlock:^(AM3SErrorID errorID) {
681 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
682 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
683 }];
684 }
685}
686#pragma mark - 断开
687RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
688
689 if ([self getAM3SWithMac:mac]!=nil) {
690
691 [[self getAM3SWithMac:mac] commandAM3SDisconnect:^(BOOL resetSuc) {
692
693 NSDictionary* deviceInfo = @{@"mac":mac};
694 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
695 } withErrorBlock:^(AM3SErrorID errorID) {
696 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
697 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
698 }];
699 }
700}
701
702
703
704
705#pragma mark-设置小时制
706RCT_EXPORT_METHOD(setHourMode:(nonnull NSString *)mac :(nonnull NSNumber*)hourMode){
707
708 if ([self getAM3SWithMac:mac]!=nil) {
709
710 AM3STimeFormatAndNation formatAndNation;
711 formatAndNation = hourMode.intValue;
712
713 [[self getAM3SWithMac:mac]commandAM3SSetTimeFormatAndNation:hourMode.intValue withFinishResult:^(BOOL resetSuc) {
714 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_hour_mode_success_am"};
715
716 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
717
718 } withErrorBlock:^(AM3SErrorID errorID) {
719 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
720 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
721 }];
722 }
723}
724#pragma mark-得到小时制
725RCT_EXPORT_METHOD(getHourMode:(nonnull NSString *)mac){
726
727 if ([self getAM3SWithMac:mac]!=nil) {
728
729 [[self getAM3SWithMac:mac] commandAM3SGetTimeFormatAndNation:^(AM3STimeFormatAndNation timeFormatAndNation) {
730
731 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"get_hour_mode_am",@"hourtype":[NSNumber numberWithInt:timeFormatAndNation]};
732 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
733 } withErrorBlock:^(AM3SErrorID errorID) {
734 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
735 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
736 }];
737 }
738}
739
740#pragma mark-设置图片
741RCT_EXPORT_METHOD(setPicture:(nonnull NSString *)mac :(nonnull NSNumber *)index){
742
743 if ([self getAM3SWithMac:mac]!=nil) {
744
745
746 if((index.intValue !=0) && (index.intValue !=1)){
747
748 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:400]};
749 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
750 return;
751 }
752
753
754 AM3SPicture piction;
755 piction = index.intValue;
756
757 [[self getAM3SWithMac:mac] commandAM3SSetPicture:piction withFinishResult:^(BOOL resetSuc) {
758
759 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_picture_success_am"};
760 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
761 } withErrorBlock:^(AM3SErrorID errorID) {
762 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
763 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
764 }];
765 }
766}
767
768#pragma mark-得到图片
769RCT_EXPORT_METHOD(getPicture:(nonnull NSString *)mac){
770
771 if ([self getAM3SWithMac:mac]!=nil) {
772
773 [[self getAM3SWithMac:mac] commandAM3SGetPicture:^(AM3SPicture picture) {
774
775 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"get_picture_am",@"get_picture_am":[NSNumber numberWithInt:picture]};
776 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
777 } withErrorBlock:^(AM3SErrorID errorID) {
778 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
779 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
780 }];
781 }
782}
783
784
785
786
787
788@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM4Module.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM4Module.h
new file mode 100755
index 0000000..3057818
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM4Module.h
@@ -0,0 +1,19 @@
1//
2// AM4Module.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16
17@interface AM4Module : RCTEventEmitter<RCTBridgeModule>
18
19@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM4Module.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM4Module.m
new file mode 100644
index 0000000..6bb6e96
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM4Module.m
@@ -0,0 +1,854 @@
1//
2// AM4Module.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "AM4Module.h"
10#import "AMProfileModule.h"
11#import "AMMacroFile.h"
12#import "AM4Controller.h"
13#import "AM4.h"
14
15#define EVENT_NOTIFY @"event_notify_am4"
16
17@implementation AM4Module
18
19RCT_EXPORT_MODULE()
20- (NSArray<NSString *> *)supportedEvents {
21 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
22 @"event_device_connected", @"event_device_connect_failed",
23 @"event_device_disconnect", @"event_authenticate_result",
24 @"event_notify_ts28b", @"event_notify_bg1",
25 @"action_connect_result_for_bg1"];
26}
27
28- (NSDictionary *)constantsToExport
29{
30 return @{
31 @"Event_Notify": EVENT_NOTIFY
32
33 };
34
35
36}
37+ (BOOL)requiresMainQueueSetup
38{
39 return YES;
40}
41#pragma mark
42#pragma mark - Init
43-(id)init
44{
45 if (self=[super init])
46 {
47
48 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(DeviceConnectForAM4:) name:AM4ConnectNoti object:nil];
49 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(DeviceDisConnectForAM4:) name:AM4DisConnectNoti object:nil];
50
51 [AM4Controller shareIHAM4Controller];
52
53 }
54 return self;
55}
56
57-(AM4*)getAM4WithMac:(NSString*)mac{
58
59 AM4Controller *controller = [AM4Controller shareIHAM4Controller];
60 NSArray *amDeviceArray = [controller getAllCurrentAM4Instace];
61
62 for(AM4 *tempAM4 in amDeviceArray){
63 if([mac isEqualToString:tempAM4.serialNumber]){
64
65 return tempAM4;
66 break;
67 }
68 }
69
70 return nil;
71}
72
73#pragma mark
74#pragma mark - Notification
75#pragma mark - AM4
76
77-(void)DeviceConnectForAM4:(NSNotification *)tempNoti{
78 AM4Controller *controller = [AM4Controller shareIHAM4Controller];
79 NSArray *amDeviceArray = [controller getAllCurrentAM4Instace];
80
81 AM4 *AMInstance = [amDeviceArray objectAtIndex:0];
82
83}
84
85-(void)DeviceDisConnectForAM4:(NSNotification *)tempNoti{
86 AM4Controller *controller = [AM4Controller shareIHAM4Controller];
87
88
89}
90
91#pragma mark-获取连接设备
92RCT_EXPORT_METHOD(getAllConnectedDevices){
93
94
95 NSArray*am4array= [[AM4Controller shareIHAM4Controller] getAllCurrentAM4Instace];
96
97 NSMutableArray*deviceMacArray=[NSMutableArray array];
98
99 for (int i=0; i<[am4array count]; i++) {
100
101 AM4*am4=[am4array objectAtIndex:i];
102
103 [deviceMacArray addObject:am4.serialNumber];
104
105 }
106
107 NSDictionary* deviceInfo = @{@"action":@"ACTION_GET_ALL_CONNECTED_DEVICES",@"devices":deviceMacArray};
108
109 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
110
111
112}
113
114
115#pragma mark - 恢复出厂
116RCT_EXPORT_METHOD(reset:(nonnull NSString *)mac){
117
118 if ([self getAM4WithMac:mac]!=nil) {
119
120 [[self getAM4WithMac:mac] commandAM4ResetDevice:^(BOOL resetSuc) {
121
122 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"reset_am",@"reset":[NSNumber numberWithInteger:resetSuc]};
123 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
124
125 } withErrorBlock:^(AM4ErrorID errorID) {
126
127 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
128 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
129 }];
130 }
131}
132
133#pragma mark-得到用户ID
134RCT_EXPORT_METHOD(getUserId:(nonnull NSString *)mac){
135
136 if ([self getAM4WithMac:mac]!=nil) {
137
138 [[self getAM4WithMac:mac] commandAM4GetDeviceUserID:^(unsigned int userID) {
139
140 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"userid_am",@"userid":[NSNumber numberWithInteger:userID]};
141 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
142
143 } withErrorBlock:^(AM4ErrorID errorID) {
144
145 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
146 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
147 }];
148
149 }
150}
151
152#pragma mark-设置用户ID
153RCT_EXPORT_METHOD(setUserId:(nonnull NSString *)mac :(nonnull NSNumber *)uesrID){
154
155 if ([self getAM4WithMac:mac]!=nil) {
156
157 [[self getAM4WithMac:mac] commandAM4SetUserID:uesrID withFinishResult:^(BOOL resetSuc) {
158
159 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_userid_success_am"};
160 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
161
162 } withErrorBlock:^(AM4ErrorID errorID) {
163 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
164 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
165 }];
166 }
167}
168
169#pragma mark-同步时间
170RCT_EXPORT_METHOD(syncRealTime:(nonnull NSString *)mac){
171
172 if ([self getAM4WithMac:mac]!=nil) {
173
174 [[self getAM4WithMac:mac] commandAM4SyncTime:^(BOOL resetSuc) {
175
176 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_sync_time_success_am"};
177 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
178 } withErrorBlock:^(AM4ErrorID errorID) {
179
180 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
181 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
182 }];
183 }
184}
185
186#pragma mark-设置用户信息
187RCT_EXPORT_METHOD(setUserInfo:(nonnull NSString *)mac :(nonnull NSNumber *)age :(nonnull NSNumber *)height :(nonnull NSNumber *)weight :(nonnull NSNumber *)gender :(nonnull NSNumber *)unit :(nonnull NSNumber *)target :(nonnull NSNumber *)activityLevel :(nonnull NSNumber *)min){
188
189 if ([self getAM4WithMac:mac]!=nil) {
190
191 HealthUser *myUser = [[HealthUser alloc]init];
192 myUser.age = age;
193 myUser.sex = UserSex_Male;
194 myUser.height = height;
195 myUser.weight = weight;
196 myUser.activityLevel = activityLevel;
197
198 NSDictionary *dic = [[NSMutableDictionary alloc]init];
199 [[self getAM4WithMac:mac] commandAM4SetUserInfo:myUser withUnit:unit withActiveGoal:target withSwimmingGoal:min withSetUserInfoFinishResult:^(BOOL resetSuc) {
200
201 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_userinfo_success_am"};
202 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
203
204 } withSetBMR:^(BOOL resetSuc) {
205
206
207 } withErrorBlock:^(AM4ErrorID errorID) {
208
209 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
210 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
211 }];
212 }
213}
214#pragma mark-得到用户信息
215RCT_EXPORT_METHOD(getUserInfo:(nonnull NSString *)mac){
216
217 if ([self getAM4WithMac:mac]!=nil) {
218
219 [[self getAM4WithMac:mac] commandAM4GetUserInfo:^(NSDictionary *userInfo) {
220
221 NSNumber *swimGoal = [userInfo valueForKey:@"SwimmingGoal"];
222 if (swimGoal != nil || swimGoal == 0){
223 swimGoal = @0;
224 }
225
226 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"get_userinfo_am",@"age":[userInfo valueForKey:@"Age"],@"step":[userInfo valueForKey:@"Step"],@"height":[userInfo valueForKey:@"Height"],@"gender":[userInfo valueForKey:@"Gender"],@"weight":[userInfo valueForKey:@"Weight"],@"unit":[userInfo valueForKey:@"Unit"],@"target1":[userInfo valueForKey:@"TotalStep1"],@"target2":[userInfo valueForKey:@"TotalStep2"],@"target3":[userInfo valueForKey:@"TotalStep3"],@"swim_target":swimGoal};
227
228 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
229
230 } withErrorBlock:^(AM4ErrorID errorID) {
231
232 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
233 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
234 }];
235 }
236}
237
238#pragma mark-得到闹钟数量
239RCT_EXPORT_METHOD(getAlarmClockNum:(nonnull NSString *)mac){
240
241 if ([self getAM4WithMac:mac]!=nil) {
242
243 [[self getAM4WithMac:mac] commandAM4GetTotoalAlarmInfo:^(NSMutableArray *totoalAlarmArray) {
244
245 NSMutableArray * IDArray = [[NSMutableArray alloc]init];
246
247 if (totoalAlarmArray.count > 0){
248
249 for (NSDictionary *dic in totoalAlarmArray) {
250 [IDArray addObject:[dic valueForKey:@"AlarmId"]];
251 }
252 }
253
254 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"get_alarmnum_am",@"alarmclocknumber":[NSNumber numberWithInt:IDArray.count],@"alarmclocknumberid":IDArray};
255 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
256
257 } withErrorBlock:^(AM4ErrorID errorID) {
258
259 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
260 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
261 }];
262 }
263}
264
265#pragma mark-查闹钟信息
266RCT_EXPORT_METHOD(getAlarmClockDetail:(nonnull NSString *)mac :(nonnull NSArray *)alarmIDS){
267
268 if ([self getAM4WithMac:mac]!=nil) {
269
270 [[self getAM4WithMac:mac] commandAM4GetTotoalAlarmInfo:^(NSMutableArray *totoalAlarmArray) {
271
272 NSMutableArray * alarmInfoArray = [[NSMutableArray alloc]init];
273
274 if (totoalAlarmArray.count > 0){
275
276 for (NSDictionary *dic in totoalAlarmArray) {
277
278
279 NSMutableDictionary *alartDic = [[NSMutableDictionary alloc]init];
280
281 for (NSNumber * alarmID in alarmIDS) {
282
283 NSNumber *deviceAlarmID = [dic valueForKey:@"AlarmId"];
284
285 if(deviceAlarmID.intValue == alarmID.intValue){
286
287 [alartDic setValue:[dic valueForKey:@"AlarmId"] forKey:@"alarmid"];
288
289 NSDate *date = [dic valueForKey:@"Time"];
290 NSDateFormatter *dateFormater=[[NSDateFormatter alloc]init];
291 [dateFormater setTimeZone:[NSTimeZone defaultTimeZone]];
292 [dateFormater setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];
293 [dateFormater setDateFormat:@"HH:mm"];
294 NSString *dateString = [dateFormater stringFromDate:date];
295
296 [alartDic setValue:dateString forKey:@"time"];
297 [alartDic setValue:[dic valueForKey:@"IsRepeat"] forKey:@"repeat"];
298
299 NSMutableDictionary * weekDic = [[NSMutableDictionary alloc]init];
300 [weekDic setValue:[[dic valueForKey:@"Week"] objectAtIndex:0] forKey:@"sun"];
301 [weekDic setValue:[[dic valueForKey:@"Week"] objectAtIndex:1] forKey:@"mon"];
302 [weekDic setValue:[[dic valueForKey:@"Week"] objectAtIndex:2] forKey:@"tue"];
303 [weekDic setValue:[[dic valueForKey:@"Week"] objectAtIndex:3] forKey:@"wed"];
304 [weekDic setValue:[[dic valueForKey:@"Week"] objectAtIndex:4] forKey:@"thu"];
305 [weekDic setValue:[[dic valueForKey:@"Week"] objectAtIndex:5] forKey:@"fri"];
306 [weekDic setValue:[[dic valueForKey:@"Week"] objectAtIndex:6] forKey:@"sat"];
307
308 [alartDic setValue:weekDic forKey:@"get_alarm_week"];
309 [alartDic setValue:[dic valueForKey:@"Switch"] forKey:@"switch"];
310 [alarmInfoArray addObject:alartDic];
311
312 }
313 }
314 }
315
316 }
317
318 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"get_alarminfo_am",@"alarmclockdetail":alarmInfoArray};
319 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
320
321 } withErrorBlock:^(AM4ErrorID errorID) {
322 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
323 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
324 }];
325 }
326}
327
328#pragma mark-设置闹钟
329RCT_EXPORT_METHOD(setAlarmClock:(nonnull NSString *)mac :(nonnull NSNumber *)alarmID :(nonnull NSNumber *)hour :(nonnull NSNumber *)min :(nonnull NSNumber*)isRepeat :(nonnull NSArray *)weekArray :(nonnull NSNumber *)isOn){
330
331 if ([self getAM4WithMac:mac]!=nil) {
332
333 if(alarmID.integerValue < 0 || alarmID.integerValue > 3 ||
334 hour.integerValue > 23 || hour.integerValue < 0 ||
335 min.integerValue > 59 || min.integerValue < 0){
336
337 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:400]};
338 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
339 return;
340 }
341
342 NSDateFormatter *formater=[[NSDateFormatter alloc]init];
343 [formater setTimeZone:[NSTimeZone defaultTimeZone]];
344 [formater setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];
345 [formater setDateFormat:@"HH-mm"];
346 NSString * timeStr = [NSString stringWithFormat:@"%@-%@",hour,min];
347 NSDate *date = [formater dateFromString:timeStr];
348
349
350 NSDictionary *dic = [[NSDictionary alloc]initWithObjectsAndKeys:alarmID,@"AlarmId",date,@"Time",isRepeat,@"IsRepeat",weekArray,@"Week",isOn,@"Switch", nil];
351
352 [[self getAM4WithMac:mac] commandAM4SetAlarmDictionary:dic withFinishResult:^(BOOL resetSuc) {
353 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_alarminfo_success_am"};
354
355 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
356
357 } withErrorBlock:^(AM4ErrorID errorID) {
358 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
359 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
360 }];
361 }
362}
363
364#pragma mark-删除闹钟
365RCT_EXPORT_METHOD(deleteAlarmClock:(nonnull NSString *)mac :(nonnull NSNumber *)alarmID){
366
367 if ([self getAM4WithMac:mac]!=nil) {
368
369 [[self getAM4WithMac:mac] commandAM4DeleteAlarmID:alarmID withFinishResult:^(BOOL resetSuc) {
370
371 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"delete_alarm_success_am"};
372 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
373
374 } withErrorBlock:^(AM4ErrorID errorID) {
375 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
376 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
377 }];
378 }
379}
380
381#pragma mark-得闹钟信息
382RCT_EXPORT_METHOD(getActivityRemind:(nonnull NSString *)mac){
383
384 if ([self getAM4WithMac:mac]!=nil) {
385
386 [[self getAM4WithMac:mac] commandAM4GetReminderInfo:^(NSArray *remindInfo) {
387
388 NSDictionary *dic = [remindInfo objectAtIndex:0];
389
390 NSDate *date = [dic valueForKey:@"Time"];
391 NSDateFormatter *dateFormater=[[NSDateFormatter alloc]init];
392 [dateFormater setTimeZone:[NSTimeZone defaultTimeZone]];
393 [dateFormater setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];
394 [dateFormater setDateFormat:@"HH:mm"];
395 NSString *dateString = [dateFormater stringFromDate:date];
396
397
398 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"get_activity_remind_am",@"time":dateString,@"switch":[dic valueForKey:@"Switch"]};
399
400 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
401
402 } withErrorBlock:^(AM4ErrorID errorID) {
403 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
404 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
405 }];
406 }
407}
408
409#pragma mark-设置提醒
410RCT_EXPORT_METHOD(setActivityRemind:(nonnull NSString *)mac :(nonnull NSNumber *)hour :(nonnull NSNumber *)min :(nonnull NSNumber *)isOn){
411
412 if ([self getAM4WithMac:mac]!=nil) {
413
414
415
416 if(hour.integerValue > 23 || hour.integerValue < 0 ||
417 min.integerValue > 59 || min.integerValue < 0){
418
419 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:400]};
420 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
421 return;
422 }
423
424
425
426 NSDateFormatter *formater=[[NSDateFormatter alloc]init];
427 [formater setTimeZone:[NSTimeZone defaultTimeZone]];
428 [formater setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];
429 [formater setDateFormat:@"HH-mm"];
430 NSString * timeStr = [NSString stringWithFormat:@"%@-%@",hour,min];
431 NSDate *date = [formater dateFromString:timeStr];
432
433
434 NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:date,@"Time",isOn,@"Switch", nil];
435
436 [[self getAM4WithMac:mac] commandAM4SetReminderDictionary:dic withFinishResult:^(BOOL resetSuc) {
437
438 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_activityremind_success_am"};
439 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
440 } withErrorBlock:^(AM4ErrorID errorID) {
441 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
442 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
443 }];
444 }
445}
446
447#pragma mark - 运动数据
448RCT_EXPORT_METHOD(syncActivityData:(nonnull NSString *)mac){
449
450 if ([self getAM4WithMac:mac]!=nil) {
451
452 [[self getAM4WithMac:mac] commandAM4StartSyncActiveData:^(NSDictionary *startDataDictionary) {
453
454
455
456 } withActiveHistoryData:^(NSArray *historyDataArray) {
457
458 NSMutableArray *lastArray = [[NSMutableArray alloc]init];
459 for (NSDictionary *dic in historyDataArray) {
460
461 NSMutableDictionary * lastDic = [[NSMutableDictionary alloc]init];
462
463
464 NSDateFormatter *dateFormat = nil;
465
466 if (dateFormat == nil) {
467 dateFormat = [[NSDateFormatter alloc] init];
468 [dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//设定时间格式,这里可以设置成自己需要的格式
469 }
470
471 NSString *locationString=[dateFormat stringFromDate:[dic valueForKey:AMDate]];
472
473 [lastDic setValue:locationString forKey:@"time"];
474 [lastDic setValue:[dic valueForKey:AMStepSize] forKey:@"stepsize"];
475 [lastDic setValue:[dic valueForKey:AMCalorie] forKey:@"calorie"];
476 [lastDic setValue:[dic valueForKey:AMStepNum] forKey:@"step"];
477 [lastDic setValue:[dic valueForKey:@"dataID"] forKey:@"dataID"];
478 [lastArray addObject:lastDic];
479 }
480
481 NSDictionary *dictionary = [NSDictionary dictionaryWithObject:lastArray forKey:@"activity_each_data"];
482 NSArray *array = [NSArray arrayWithObjects:dictionary, nil];
483
484 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"sync_activity_data_am",@"activity":array};
485
486 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
487
488 } withActiveFinishTransmission:^{
489
490
491 } withErrorBlock:^(AM4ErrorID errorID) {
492 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
493 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
494 }];
495 }
496}
497#pragma mark - 睡眠数据
498RCT_EXPORT_METHOD(syncSleepData:(nonnull NSString *)mac){
499
500 if ([self getAM4WithMac:mac]!=nil) {
501
502 [[self getAM4WithMac:mac] commandAM4StartSyncSleepData:^(NSDictionary *startDataDictionary) {
503
504
505 } withSleepHistoryData:^(NSArray *historyDataArray) {
506
507 NSMutableArray *lastArray = [[NSMutableArray alloc]init];
508
509
510 for (NSArray *array in historyDataArray) {
511
512 for (NSDictionary *dic in array) {
513
514 NSMutableDictionary * lastDic = [[NSMutableDictionary alloc]init];
515
516
517 NSDateFormatter *dateFormat = nil;
518
519 if (dateFormat == nil) {
520 dateFormat = [[NSDateFormatter alloc] init];
521 [dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//设定时间格式,这里可以设置成自己需要的格式
522 }
523
524 NSString *locationString=[dateFormat stringFromDate:[dic valueForKey:AMDate]];
525
526 [lastDic setValue:locationString forKey:@"time"];
527
528
529 [lastDic setValue:[dic valueForKey:@"SleepData"] forKey:@"level"];
530 [lastDic setValue:[dic valueForKey:@"dataID"] forKey:@"dataID"];
531 [lastArray addObject:lastDic];
532
533 }
534 }
535
536 NSDictionary *dictionary = [NSDictionary dictionaryWithObject:lastArray forKey:@"sleep_each_data"];
537 NSArray *array = [NSArray arrayWithObjects:dictionary, nil];
538
539 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"sync_sleep_data_am",@"sleep":array};
540
541 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
542
543
544 } withSleepFinishTransmission:^{
545
546 } withErrorBlock:^(AM4ErrorID errorID) {
547 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
548 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
549 }];
550 }
551}
552
553#pragma mark-阶段性数据
554RCT_EXPORT_METHOD(syncStageReportData:(nonnull NSString *)mac){
555
556 if ([self getAM4WithMac:mac]!=nil) {
557
558 [[self getAM4WithMac:mac] commandAM4StartSyncStageData:^(NSArray *measureDataArray) {
559
560 NSMutableArray *lastArray = [[NSMutableArray alloc]init];
561
562
563 NSPredicate *pre = [NSPredicate predicateWithFormat:@"ReportState == 1"];
564 NSArray *workoutArray = [measureDataArray filteredArrayUsingPredicate:pre];
565 if (workoutArray.count != 0)
566 {
567 for (NSDictionary *dic in workoutArray) {
568
569 NSMutableDictionary *dictionary = [[NSMutableDictionary alloc]init];
570 [dictionary setValue:@"stage_data_type_workout" forKey:@"type"];
571
572
573 NSDateFormatter *dateFormat = nil;
574
575 if (dateFormat == nil) {
576 dateFormat = [[NSDateFormatter alloc] init];
577 [dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//设定时间格式,这里可以设置成自己需要的格式
578 }
579
580 NSString *locationString=[dateFormat stringFromDate:[dic valueForKey:Work_outMeasureDate]];
581
582
583
584
585 [dictionary setValue:locationString forKey:@"stoptime"];
586 [dictionary setValue:[dic valueForKey:Work_outTimeNumber] forKey:@"usedtime"];
587 [dictionary setValue:[dic valueForKey:Work_outStepNumber] forKey:@"stage_data_workout_step"];
588 [dictionary setValue:[dic valueForKey:Work_outLengthNumber] forKey:@"stage_data_distance"];
589 [dictionary setValue:[dic valueForKey:Work_outCalories] forKey:@"calorie"];
590 [dictionary setValue:[dic valueForKey:@"dataID"] forKey:@"dataID"];
591 [lastArray addObject:dictionary];
592 }
593 }
594
595 NSPredicate *predicateSwim = [NSPredicate predicateWithFormat:@"ReportState == 0"];
596 NSArray *swimArray = [measureDataArray filteredArrayUsingPredicate:predicateSwim];
597 if (swimArray.count != 0)
598 {
599 for (NSDictionary *dic in swimArray) {
600
601 NSMutableDictionary *dictionary = [[NSMutableDictionary alloc]init];
602 [dictionary setValue:@"swim" forKey:@"type"];
603
604
605 NSDateFormatter *dateFormat = nil;
606
607 if (dateFormat == nil) {
608 dateFormat = [[NSDateFormatter alloc] init];
609 [dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//设定时间格式,这里可以设置成自己需要的格式
610 }
611
612 NSString *locationString=[dateFormat stringFromDate:[dic valueForKey:AM4SwimmingMeasureDate]];
613
614
615 [dictionary setValue:locationString forKey:@"stoptime"];
616 [dictionary setValue:[dic valueForKey:AM4SwimmingTimeNumber] forKey:@"usedtime"];
617 [dictionary setValue:[dic valueForKey:AM4SwimmingTimes] forKey:@"number of strokes"];
618 [dictionary setValue:[dic valueForKey:AM4Swimmingcalories] forKey:@"calorie"];
619 [dictionary setValue:[dic valueForKey:AM4SwimmingAct] forKey:@"swimming stroke"];
620 [dictionary setValue:[dic valueForKey:AM4SwimmingCircleCount] forKey:@"number of turns"];
621 [dictionary setValue:[dic valueForKey:AM4SwimmingPoollength] forKey:@"stage_data_swimpool_length"];
622 [dictionary setValue:[dic valueForKey:AM4EnterSwimmingTime] forKey:@"stage_data_cutindif"];
623 [dictionary setValue:[dic valueForKey:AM4OutSwimmingTime] forKey:@"stage_data_cutoutdif"];
624 [dictionary setValue:[dic valueForKey:AM4SwimmingProcessMark] forKey:@"stage_data_processflag"];
625 [dictionary setValue:[dic valueForKey:@"dataID"] forKey:@"dataID"];
626
627 [lastArray addObject:dictionary];
628 }
629
630 }
631
632 NSPredicate *predicateSleep = [NSPredicate predicateWithFormat:@"ReportState == 2"];
633 NSArray *sleepArray = [measureDataArray filteredArrayUsingPredicate:predicateSleep];
634 if (sleepArray.count != 0)
635 {
636 for (NSDictionary *dic in sleepArray) {
637
638 NSMutableDictionary *dictionary = [[NSMutableDictionary alloc]init];
639 [dictionary setValue:@"sleep" forKey:@"type"];
640
641
642 NSDateFormatter *dateFormat = nil;
643
644 if (dateFormat == nil) {
645 dateFormat = [[NSDateFormatter alloc] init];
646 [dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//设定时间格式,这里可以设置成自己需要的格式
647 }
648
649 NSString *locationString=[dateFormat stringFromDate:[dic valueForKey:Sleep_summaryMeasureDate]];
650
651
652 [dictionary setValue:locationString forKey:@"stoptime"];
653 [dictionary setValue:[dic valueForKey:Sleep_summarySleepTime] forKey:@"usedtime"];
654 [dictionary setValue:[dic valueForKey:Sleep_summarysleepEfficiency] forKey:@"sleepefficiency"];
655 [dictionary setValue:[dic valueForKey:Sleep_summarysleepAddMinute] forKey:@"is50min"];
656 [lastArray addObject:dictionary];
657 }
658
659 }
660
661 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"sync_stage_data_am",@"stage_data":lastArray};
662
663 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
664
665
666 } withStageDataFinishTransmission:^(BOOL resetSuc) {
667
668
669
670
671 } withErrorBlock:^(AM4ErrorID errorID) {
672
673 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
674 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
675 }];
676 }
677}
678
679#pragma mark - 实时数据
680RCT_EXPORT_METHOD(syncRealData:(nonnull NSString *)mac){
681
682 if ([self getAM4WithMac:mac]!=nil) {
683
684 [[self getAM4WithMac:mac] commandAM4StartSyncCurrentActiveData:^(NSDictionary *activeDictionary) {
685
686 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"sync_real_data_am",@"step":[activeDictionary valueForKey:@"Step"],@"calorie":[activeDictionary valueForKey:@"Calories"],@"totalcalories":[activeDictionary valueForKey:@"TotalCalories"]};
687 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
688
689 } withErrorBlock:^(AM4ErrorID errorID) {
690 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
691 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
692 }];
693 }
694}
695
696#pragma mark - 查询状态
697RCT_EXPORT_METHOD(queryAMState:(nonnull NSString *)mac){
698
699 if ([self getAM4WithMac:mac]!=nil) {
700
701 __block NSInteger index;
702
703 [[self getAM4WithMac:mac] commandAM4GetDeviceStateInfo:^(AM4QueryState queryState) {
704
705 index = queryState;
706
707 } withBattery:^(NSNumber *battery) {
708
709 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"query_state_am",@"query_state":[NSNumber numberWithInteger:index],@"battery":battery};
710 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
711
712 } withErrorBlock:^(AM4ErrorID errorID) {
713 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
714 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
715 }];
716 }
717}
718
719#pragma mark - 设置BMR
720RCT_EXPORT_METHOD(setUserBmr:(nonnull NSString *)mac :(nonnull NSNumber *)bmr){
721
722 if ([self getAM4WithMac:mac]!=nil) {
723
724 [[self getAM4WithMac:mac] commandAM4SetBMR:bmr withFinishResult:^(BOOL resetSuc) {
725
726 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_bmr_success_am"};
727
728 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
729
730 } withErrorBlock:^(AM4ErrorID errorID) {
731 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
732 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
733 }];
734 }
735}
736
737#pragma mark-发随机数
738RCT_EXPORT_METHOD(sendRandom:(nonnull NSString *)mac){
739
740 if ([self getAM4WithMac:mac]!=nil) {
741
742 [[self getAM4WithMac:mac] commandAM4SetRandomNumber:^(NSString *randomNumString) {
743
744 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"get_random_am",@"random":randomNumString};
745 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
746 } withErrorBlock:^(AM4ErrorID errorID) {
747 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
748 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
749 }];
750 }
751}
752
753#pragma mark-断开
754RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
755
756 if ([self getAM4WithMac:mac]!=nil) {
757
758 [[self getAM4WithMac:mac] commandAM4Disconnect:^(BOOL resetSuc) {
759
760 NSDictionary* deviceInfo = @{@"mac":mac};
761 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
762 } withErrorBlock:^(AM4ErrorID errorID) {
763 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
764 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
765 }];
766 }
767}
768
769#pragma mark-设置游泳
770RCT_EXPORT_METHOD(setSwimPara:(nonnull NSString *)mac :(nonnull BOOL *)isOpen :(nonnull NSNumber *)poolLength :(nonnull NSNumber *)hours :(nonnull NSNumber *)minutes :(nonnull NSNumber *)unit ){
771
772 if ([self getAM4WithMac:mac]!=nil) {
773
774 NSDateFormatter *formater=[[NSDateFormatter alloc]init];
775 [formater setTimeZone:[NSTimeZone defaultTimeZone]];
776 [formater setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];
777 [formater setDateFormat:@"HH-mm"];
778 NSString * timeStr = [NSString stringWithFormat:@"%@-%@",hours,minutes];
779 NSDate *date = [formater dateFromString:timeStr];
780
781
782 [[self getAM4WithMac:mac] commandAM4SetSwimmingState:isOpen withSwimmingPoolLength:poolLength withNOSwimmingTime:date withUnit:unit.integerValue withFinishResult:^(BOOL resetSuc) {
783
784 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_swiminfo_am"};
785 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
786 } withErrorBlock:^(AM4ErrorID errorID) {
787
788 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
789 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
790
791 }];
792 }
793}
794
795#pragma mark-获取游泳信息
796RCT_EXPORT_METHOD(checkSwimPara:(nonnull NSString *)mac){
797
798 if ([self getAM4WithMac:mac]!=nil) {
799
800 [[self getAM4WithMac:mac] commandAM4GetSwimmingInfo:^(BOOL swimmingIsOpen, NSNumber *swimmingLaneLength, NSNumber *NOSwimmingTime, AM4SwimmingUnit unit) {
801
802 int hour = NOSwimmingTime.intValue / 60;
803 int min = NOSwimmingTime.intValue % 60;
804
805 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"get_swiminfo_am",@"get_swimlane_length":swimmingLaneLength,@"get_swim_unit_am":[NSNumber numberWithInt:unit],@"get_swim_switch_am":@"swimmingIsOpen",@"get_swim_cutout_hour_am":[NSNumber numberWithInt:hour],@"get_swim_cutout_min_am":[NSNumber numberWithInt:min]};
806
807 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
808 } withErrorBlock:^(AM4ErrorID errorID) {
809 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
810 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
811 }];
812 }
813}
814
815#pragma mark-设置时间制
816RCT_EXPORT_METHOD(setHourMode:(nonnull NSString *)mac :(nonnull NSNumber *)hourMode){
817
818 if ([self getAM4WithMac:mac]!=nil) {
819
820 AM4TimeFormatAndNation formatAndNation;
821 formatAndNation = hourMode.intValue;
822
823 [[self getAM4WithMac:mac] commandAM4SetTimeFormatAndNation:formatAndNation withFinishResult:^(BOOL resetSuc) {
824
825 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"set_hour_mode_success_am"};
826 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
827
828 } withErrorBlock:^(AM4ErrorID errorID) {
829
830 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
831 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
832 }];
833
834 }
835}
836
837#pragma mark-得到时间制
838RCT_EXPORT_METHOD(getHourMode:(nonnull NSString *)mac){
839
840 if ([self getAM4WithMac:mac]!=nil) {
841
842 [[self getAM4WithMac:mac] commandAM4GetTimeFormatAndNation:^(AM4TimeFormatAndNation timeFormatAndNation) {
843
844 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"get_hour_mode_am",@"hourtype":[NSNumber numberWithInt:timeFormatAndNation]};
845 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
846 } withErrorBlock:^(AM4ErrorID errorID) {
847 NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"error_am",@"error":[NSNumber numberWithInteger:errorID]};
848 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
849 }];
850 }
851}
852
853
854@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5Module.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5Module.h
new file mode 100755
index 0000000..c9b327b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5Module.h
@@ -0,0 +1,19 @@
1//
2// AM5Module.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16@interface AM5Module : RCTEventEmitter<RCTBridgeModule>
17
18
19@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5Module.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5Module.m
new file mode 100644
index 0000000..24751a1
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5Module.m
@@ -0,0 +1,542 @@
1//
2// AM5Module.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "AM5Module.h"
10#import "AM5.h"
11#import "AM5Controller.h"
12#import "AM5ProfileModule.h"
13#import "AM5Header.h"
14@implementation AM5Module{
15
16
17 NSMutableDictionary*resultDic;
18
19}
20
21#define EVENT_NOTIFY @"event_notify_am5"
22#define kMAC_KEY @"mac"
23#define kACTION_KEY @"action"
24
25
26RCT_EXPORT_MODULE()
27- (NSArray<NSString *> *)supportedEvents {
28 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
29 @"event_device_connected", @"event_device_connect_failed",
30 @"event_device_disconnect", @"event_authenticate_result",
31 @"event_notify_ts28b", @"event_notify_bg1",
32 @"action_connect_result_for_bg1"];
33}
34
35
36
37#pragma mark
38#pragma mark - constantsToExport
39- (NSDictionary *)constantsToExport
40{
41 return @{ @"Event_Notify": EVENT_NOTIFY };
42
43}
44
45+ (BOOL)requiresMainQueueSetup
46{
47 return YES;
48}
49
50-(void)dealloc{
51 [[NSNotificationCenter defaultCenter]removeObserver:self];
52}
53
54-(AM5*)getAM5WithMac:(NSString*)mac{
55
56 AM5Controller *controller = [AM5Controller shareAM5Controller];
57 NSArray *poDeviceArray = [controller getAllCurrentAM5Instace];
58
59 for(AM5 *tempAM5 in poDeviceArray){
60 if([mac isEqualToString:tempAM5.serialNumber]){
61
62 return tempAM5;
63 break;
64 }
65 }
66
67 return nil;
68}
69
70#pragma mark
71#pragma mark - Method
72
73RCT_EXPORT_METHOD(getAllConnectedDevices){
74
75
76 NSArray*AM5array= [[AM5Controller shareAM5Controller] getAllCurrentAM5Instace];
77
78 NSMutableArray*deviceMacArray=[NSMutableArray array];
79
80 for (int i=0; i<[AM5array count]; i++) {
81
82 AM5*am5=[AM5array objectAtIndex:i];
83
84 [deviceMacArray addObject:am5.serialNumber];
85
86 }
87
88 NSDictionary* deviceInfo = @{kACTION_KEY:kACTION_GET_ALL_CONNECTED_DEVICES,@"devices":deviceMacArray};
89
90 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
91
92
93}
94
95#pragma mark 绑定
96RCT_EXPORT_METHOD(bindDevice:(nonnull NSString *)mac){
97
98
99 if ([self getAM5WithMac:mac]) {
100 __weak typeof(self) weakSelf = self;
101
102
103 [[self getAM5WithMac:mac] commandBindingDevice:^(BOOL result) {
104
105 NSLog(@"BindingDevice:%d",result);
106
107 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
108 kMAC_KEY:mac,
109 kACTION_KEY:kACTION_USER_BIND,
110 OPERATION_STATUS:@3,
111 TYPE:@"AM5",
112 ERROR_DESCRIPTION:@"no error"
113 }];
114
115 } DiaposeErrorBlock:^(AM5DeviceError errorID) {
116
117 }];
118
119
120}
121
122}
123#pragma mark 解除绑定
124RCT_EXPORT_METHOD(unBindDevice:(nonnull NSString *)mac){
125
126
127 if ([self getAM5WithMac:mac]) {
128 __weak typeof(self) weakSelf = self;
129
130
131 [[self getAM5WithMac:mac] commandUnBindingDevice:^(BOOL result) {
132
133 NSLog(@"BindingDevice:%d",result);
134
135 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
136 kMAC_KEY:mac,
137 kACTION_KEY:kACTION_USER_UNBIND,
138 OPERATION_STATUS:@3,
139 TYPE:@"AM5",
140 ERROR_DESCRIPTION:@"no error"
141 }];
142
143 } DiaposeErrorBlock:^(AM5DeviceError errorID) {
144
145 }];
146
147
148}
149
150}
151
152#pragma mark 获取设备信息
153RCT_EXPORT_METHOD(getBasicInfo:(nonnull NSString *)mac){
154//Mode:Device mode BatteryStatus:Battery status BatteryLevel:Battery level RebootFlag:Whether to restart BindTimeStr:Binding timestamp BindState:Binding status
155
156 if ([self getAM5WithMac:mac]) {
157 __weak typeof(self) weakSelf = self;
158
159
160 [[self getAM5WithMac:mac] commandGetDeviceInfo:^(NSMutableDictionary *DeviceInfo) {
161
162 NSLog(@"DeviceINfo:%@",DeviceInfo);
163 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
164 kMAC_KEY:mac,
165 kACTION_KEY:kACTION_BASIC_INFO,
166 TYPE:@"AM5",
167 BASIC_BATTSTATUS:[DeviceInfo valueForKey:@"BatteryStatus"],
168 BASIC_DEIVCEID:@"7041",
169 BASIC_ENERGE:[DeviceInfo valueForKey:@"BatteryLevel"],
170 BASIC_FIRMWAREVERSION:@"40",
171 BASIC_MODE:[DeviceInfo valueForKey:@"Mode"],
172 BASIC_PAIRFLAG:[DeviceInfo valueForKey:@"BindState"],
173 BASIC_REBOOT:[DeviceInfo valueForKey:@"RebootFlag"],
174
175 }];
176
177 } DiaposeErrorBlock:^(AM5DeviceError errorID) {
178
179
180
181 }];
182
183
184}
185
186}
187
188#pragma mark 设置时间
189RCT_EXPORT_METHOD(setTime:(nonnull NSString *)mac){
190
191
192 if ([self getAM5WithMac:mac]) {
193 __weak typeof(self) weakSelf = self;
194
195
196 [[self getAM5WithMac:mac] commandSetCurrentTime:^(BOOL result) {
197 if (result==YES) {
198 NSLog(@"SetCurrentTimeSucess");
199 }else{
200
201 NSLog(@"SetCurrentTimeFaild");
202 }
203
204 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
205 kMAC_KEY:mac,
206 kACTION_KEY:kACTION_SET_TIME,
207 TYPE:@"AM5",
208 RESULT:@1
209 }];
210
211
212 } DiaposeErrorBlock:^(AM5DeviceError errorID) {
213
214 }];
215
216
217}
218
219}
220#pragma mark 设置用户信息
221RCT_EXPORT_METHOD(setUserInfo:(nonnull NSString *)mac :(nonnull NSNumber *)year:(nonnull NSNumber *)month:(nonnull NSNumber *)day:(nonnull NSNumber *)weight:(nonnull NSNumber *)height :(nonnull NSNumber *)gender){
222
223 if ([self getAM5WithMac:mac]) {
224
225 __weak typeof(self) weakSelf = self;
226
227 IDOSetUserInfoBuletoothModel * userModel= [IDOSetUserInfoBuletoothModel currentModel];
228
229 userModel.year=[year integerValue];
230
231 userModel.month=[month integerValue];
232
233 userModel.day=[day integerValue];
234
235 userModel.weight=[weight integerValue];
236
237 userModel.height=[height integerValue];
238
239 userModel.gender=[gender integerValue];
240
241
242 [[self getAM5WithMac:mac] commandSetUserInfo:userModel setResult:^(BOOL result) {
243
244 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
245 kMAC_KEY:mac,
246 kACTION_KEY:kACTION_SET_USER_INFO,
247 TYPE:@"AM5",
248 RESULT:@1
249 }];
250
251 } DiaposeErrorBlock:^(AM5DeviceError errorID) {
252
253 }];
254
255
256 }
257}
258
259#pragma mark 设置单位
260RCT_EXPORT_METHOD(setUnit:(nonnull NSString *)mac :(nonnull NSNumber *)type :(nonnull NSNumber *)unit){
261
262 if ([self getAM5WithMac:mac]) {
263
264 __weak typeof(self) weakSelf = self;
265
266 IDOSetUnitInfoBluetoothModel * unitInfo = [IDOSetUnitInfoBluetoothModel currentModel];
267
268 if ([type intValue]==0) {
269 unitInfo.distanceUnit =[unit integerValue];
270 }else if ([type intValue]==1) {
271 unitInfo.weightUnit =[unit integerValue];
272 }else {
273 unitInfo.tempUnit =[unit integerValue];
274 }
275
276 [[self getAM5WithMac:mac] commandSetUnit:unitInfo setResult:^(BOOL result) {
277
278 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
279 kMAC_KEY:mac,
280 kACTION_KEY:kACTION_SET_UNIT,
281 TYPE:@"AM5",
282 RESULT:@1
283 }];
284
285 } DiaposeErrorBlock:^(AM5DeviceError errorID) {
286
287 }];
288
289 }
290}
291
292#pragma mark Hand Wear Mode
293RCT_EXPORT_METHOD(setHandWearMode:(nonnull NSString *)mac :(nonnull NSNumber *)model){
294
295 if ([self getAM5WithMac:mac]) {
296
297 __weak typeof(self) weakSelf = self;
298
299 IDOSetLeftOrRightInfoBuletoothModel * leftOrRightModel = [IDOSetLeftOrRightInfoBuletoothModel currentModel];
300
301 if ([model intValue]==1) {
302 leftOrRightModel.isRight=YES;
303 }else{
304
305 leftOrRightModel.isRight=NO;
306 }
307
308
309
310 [[self getAM5WithMac:mac] commandSetLeftRightHand:leftOrRightModel setResult:^(BOOL result) {
311
312 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
313 kMAC_KEY:mac,
314 kACTION_KEY:kACTION_SET_HAND_WEAR_MODE,
315 TYPE:@"AM5",
316 RESULT:@1
317 }];
318
319 } DiaposeErrorBlock:^(AM5DeviceError errorID) {
320
321 }];
322
323 }
324}
325
326#pragma mark 获取live数据
327RCT_EXPORT_METHOD(getLiveData:(nonnull NSString *)mac){
328
329//Step:Step count Calorie:Calorie Distances:distance ActiveTime:Duration of activity HeartRate:Heart rate
330 if ([self getAM5WithMac:mac]) {
331
332 __weak typeof(self) weakSelf = self;
333
334 [[self getAM5WithMac:mac] commandGetLiveData:^(NSMutableDictionary *liveDataDic) {
335
336 NSLog(@"liveDataDic:%@",liveDataDic);
337
338 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
339 kMAC_KEY:mac,
340 kACTION_KEY:kACTION_LIVE_DATA,
341 TYPE:@"AM5",
342 LIVE_DATA_HEARTRATE:[liveDataDic valueForKey:@"HeartRate"],
343 LIVE_DATA_STEP:[liveDataDic valueForKey:@"Step"],
344 LIVE_DATA_CALORIE:[liveDataDic valueForKey:@"Calorie"],
345 LIVE_DATA_DISTANCES:[liveDataDic valueForKey:@"Distances"],
346 LIVE_DATA_ACTIVETIME:[liveDataDic valueForKey:@"ActiveTime"],
347 }];
348
349 } DiaposeErrorBlock:^(AM5DeviceError errorID) {
350
351 }];
352
353 }
354}
355
356#pragma mark Sync health data from device
357
358//syncActivityDataDic
359//{
360// head = {
361// day = 3;
362// "items_count" = 96;
363// "key_word" = 0;
364// length = 16;
365// "minute_offset" = 0;
366// month = 9;
367// "packets_count" = 34;
368// "per_minute" = 15;
369// reserved = 0;
370// serial = 1;
371// "total_active_time" = 0;
372// "total_cal" = 0;
373// "total_distances" = 0;
374// "total_step" = 0;
375// year = 2021;
376// };
377// items = (
378// {
379// "active_time" = 0;
380// calories = 0;
381// distance = 0;
382// mode = 0;
383// "sport_count" = 0;
384// },
385// {
386// "active_time" = 0;
387// calories = 0;
388// distance = 0;
389// mode = 0;
390// "sport_count" = 0;
391// },
392// {
393// "active_time" = 0;
394// calories = 0;
395// distance = 0;
396// mode = 0;
397// "sport_count" = 0;
398// },
399//
400// );
401// type = "sport_step";
402//}
403//
404//syncHeartRateDataDic:{
405// head = {
406// "aerobic_mins" = 0;
407// "aerobic_threshold" = 154;
408// "anaerobic_mins" = 0;
409// "anaerobic_threshold" = 0;
410// "burn_fat_mins" = 0;
411// "burn_fat_threshold" = 132;
412// day = 3;
413// "items_count" = 0;
414// length = 16;
415// "limit_mins" = 0;
416// "limit_threshold" = 198;
417// "minute_offset" = 0;
418// month = 9;
419// "packets_count" = 2;
420// serial = 1;
421// "silent_heart_rate" = 62;
422// "user_max_hr" = 0;
423// "warm_up_mins" = 0;
424// "warm_up_threshold" = 0;
425// year = 2021;
426// };
427// items = (
428// );
429// "offset_type" = minute;
430// type = "heart_rate";
431//}
432//
433//syncSleepDataDic:{
434// head = {
435// day = 0;
436// "deep_sleep_count" = 0;
437// "deep_sleep_minute" = 0;
438// "end_time_hour" = 0;
439// "end_time_minute" = 0;
440// "items_count" = 0;
441// length = 16;
442// "light_sleep_count" = 0;
443// "ligth_sleep_minute" = 0;
444// month = 0;
445// "packet_count" = 2;
446// serial = 1;
447// "sleep_item_count" = 0;
448// "sleep_score" = 0;
449// "total_minute" = 0;
450// "wake_count" = 0;
451// year = 0;
452// };
453// items = (
454// );
455// type = sleep;
456//}
457
458RCT_EXPORT_METHOD(syncHealthData:(nonnull NSString *)mac){
459
460 if ([self getAM5WithMac:mac]) {
461
462 __weak typeof(self) weakSelf = self;
463
464 [[self getAM5WithMac:mac] commandSyncData:^(NSDictionary *syncDataDic) {
465
466 NSLog(@"syncHeartRateDataDic:%@",syncDataDic);
467
468 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
469 kMAC_KEY:mac,
470 kACTION_KEY:kACTION_SYNC_HEALTH_DATA_HEART_RATE,
471 TYPE:@"AM5",
472 DATA:syncDataDic,
473 }];
474
475 } syncSleepData:^(NSDictionary *syncDataDic) {
476
477 NSLog(@"syncSleepDataDic:%@",syncDataDic);
478
479 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
480 kMAC_KEY:mac,
481 kACTION_KEY:kACTION_SYNC_HEALTH_DATA_SLEEP,
482 TYPE:@"AM5",
483 DATA:syncDataDic,
484 }];
485
486 } syncActivityData:^(NSDictionary *syncDataDic) {
487
488 NSLog(@"syncActivityDataDic:%@",syncDataDic);
489
490 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
491 kMAC_KEY:mac,
492 kACTION_KEY:kACTION_SYNC_HEALTH_DATA_SPORT,
493 TYPE:@"AM5",
494 DATA:syncDataDic,
495 }];
496
497 } syncDataProgress:^(NSNumber *syncDataProgress) {
498
499 NSLog(@"syncDataProgress:%@",syncDataProgress);
500
501 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
502 kMAC_KEY:mac,
503 kACTION_KEY:kACTION_SYNC_HEALTH_DATA,
504 TYPE:@"AM5",
505 PROGRESS:syncDataProgress,
506 OPERATION_STATUS:@3,
507 }];
508
509 } syncDataSuccess:^{
510
511 NSLog(@"syncDataSuccess");
512
513 } DiaposeErrorBlock:^(AM5DeviceError errorID) {
514
515 }];
516
517 }
518}
519
520
521RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
522
523
524 if ([self getAM5WithMac:mac]!=nil) {
525
526 [[self getAM5WithMac:mac] commandAM5Disconnect];
527
528 }else{
529
530
531
532 }
533
534
535
536}
537
538
539
540
541
542@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5ProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5ProfileModule.h
new file mode 100755
index 0000000..bdbb511
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5ProfileModule.h
@@ -0,0 +1,128 @@
1//
2// AM5ProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15@interface AM5ProfileModule : NSObject<RCTBridgeModule>
16
17
18#define kACTION_ERROR @"ACTION_ERROR"
19
20#define ERROR_NUM @"ERROR_NUM"
21
22#define ERROR_DESCRIPTION @"description"
23
24#define kACTION_USER_BIND @"action_user_bind"
25
26#define kACTION_USER_UNBIND @"action_user_unbind"
27
28#define kACTION_FUNCTION_SUPPORT @"ACTION_FUNCTION_SUPPORT"
29
30#define kACTION_BASIC_INFO @"action_basic_info"
31
32#define MAC_ADDRESS @"mac"
33
34#define BASIC_BATTSTATUS @"battStatus"
35
36#define BASIC_DEIVCEID @"deivceId"
37
38#define BASIC_ENERGE @"energe"
39
40#define BASIC_FIRMWAREVERSION @"firmwareVersion"
41
42#define BASIC_MODE @"mode"
43
44#define BASIC_PAIRFLAG @"pairFlag"
45
46#define BASIC_REBOOT @"reboot"
47
48#define kACTION_LIVE_DATA @"action_live_data"
49
50#define LIVE_DATA_HEARTRATE @"heartRate"
51
52#define LIVE_DATA_STEP @"totalStep"
53
54#define LIVE_DATA_DISTANCES @"totalDistances"
55
56#define LIVE_DATA_ACTIVETIME @"activeTime"
57
58#define LIVE_DATA_CALORIE @"calorie"
59
60
61#define kACTION_ACTIVITY_COUNT @"action_live_count"
62
63#define kACTION_SET_TIME @"TIME"
64
65#define kACTION_SET_ALARM @"action_basic_info"
66
67#define kACTION_SET_GOAL @"action_basic_info"
68
69#define kACTION_SET_LONG_SIT @"action_basic_info"
70
71#define kACTION_SET_USER_INFO @"USER_INFO"
72
73#define kACTION_SET_UNIT @"UNIT"
74
75#define kACTION_SET_HAND_WEAR_MODE @"HAND_MODE"
76
77#define kACTION_SET_UP_HAND_GESTURE @"action_basic_info"
78
79#define kACTION_SET_HEART_RATE_INTERVAL @"action_basic_info"
80
81#define kACTION_SET_HEART_RATE_MEASURE_MODE @"action_basic_info"
82
83#define kACTION_SET_ONE_KEY_RESET @"action_basic_info"
84
85#define kACTION_SET_NOT_DISTURB @"action_basic_info"
86
87#define kACTION_SET_SPORT_MODE @"action_basic_info"
88
89#define OPERATION_RESULT @"action_basic_info"
90
91#define OPERATION_ACTION @"action_basic_info"
92
93#define kACTION_NOTICE_COMMING_CALL @"action_basic_info"
94
95#define kACTION_NOTICE_COMMING_CALL_STOP @"action_basic_info"
96
97#define kACTION_NOTICE_NEW_MESSAGE @"action_basic_info"
98
99#define kACTION_SYNC_ACTIVITY @"action_basic_info"
100
101#define kACTION_SYNC_ACTIVITY_DATA @"action_basic_info"
102
103#define kACTION_SYNC_CONFIG @"action_basic_info"
104
105#define kACTION_SYNC_HEALTH_DATA @"action_sync_health_data"
106
107#define kACTION_SYNC_HEALTH_DATA_SPORT @"action_sync_health_data_sport"
108
109#define kACTION_SYNC_HEALTH_DATA_SLEEP @"action_sync_health_data_sleep"
110
111#define kACTION_SYNC_HEALTH_DATA_HEART_RATE @"action_sync_health_data_heart_rate"
112
113#define kACTION_SYNC_HEALTH_DATA_BLOOD_PRESSURE @"action_basic_info"
114
115#define OPERATION_STATUS @"status"
116
117#define TYPE @"type"
118
119#define DATA @"data"
120
121#define PROGRESS @"PROGRESS"
122
123#define RESULT @"result"
124
125
126#define kACTION_GET_ALL_CONNECTED_DEVICES @"ACTION_GET_ALL_CONNECTED_DEVICES"
127
128@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5ProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5ProfileModule.m
new file mode 100755
index 0000000..9003665
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AM5ProfileModule.m
@@ -0,0 +1,87 @@
1//
2// Am5ProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "AM5ProfileModule.h"
10
11@implementation AM5ProfileModule
12
13
14RCT_EXPORT_MODULE()
15
16#pragma mark
17#pragma mark - constantsToExport
18
19
20- (NSDictionary *)constantsToExport
21{
22 return @{
23 @"ACTION_ERROR":kACTION_ERROR,
24 @"ERROR_NUM":ERROR_NUM,
25 @"ERROR_DESCRIPTION":ERROR_DESCRIPTION,
26 @"ACTION_USER_BIND":kACTION_USER_BIND,
27 @"ACTION_USER_UNBIND":kACTION_USER_UNBIND,
28 @"ACTION_FUNCTION_SUPPORT":kACTION_FUNCTION_SUPPORT,
29 @"ACTION_BASIC_INFO":kACTION_BASIC_INFO,
30 @"ACTION_MAC_ADDRESS":MAC_ADDRESS,
31 @"MAC_ADDRESS":MAC_ADDRESS,
32 @"BASIC_BATTSTATUS":BASIC_BATTSTATUS,
33 @"BASIC_DEIVCEID":BASIC_DEIVCEID,
34 @"BASIC_ENERGE":BASIC_ENERGE,
35 @"BASIC_FIRMWAREVERSION":BASIC_FIRMWAREVERSION,
36 @"BASIC_MODE":BASIC_MODE,
37 @"BASIC_PAIRFLAG":BASIC_PAIRFLAG,
38 @"BASIC_REBOOT":BASIC_REBOOT,
39 @"ACTION_LIVE_DATA":kACTION_LIVE_DATA,
40 @"HEARTRATE":LIVE_DATA_HEARTRATE,
41 @"STEP":LIVE_DATA_STEP,
42 @"DISTANCES":LIVE_DATA_DISTANCES,
43 @"ACTIVETIME":LIVE_DATA_ACTIVETIME,
44 @"CALORIE":LIVE_DATA_CALORIE,
45 @"ACTION_ACTIVITY_COUNT":kACTION_ACTIVITY_COUNT,
46 @"ACTION_SET_TIME":kACTION_SET_TIME,
47 @"ACTION_SET_ALARM":kACTION_SET_ALARM,
48 @"ACTION_SET_GOAL":kACTION_SET_GOAL,
49 @"ACTION_SET_LONG_SIT":kACTION_SET_LONG_SIT,
50 @"ACTION_SET_USER_INFO":kACTION_SET_USER_INFO,
51 @"ACTION_SET_UNIT":kACTION_SET_UNIT,
52 @"ACTION_SET_HAND_WEAR_MODE":kACTION_SET_HAND_WEAR_MODE,
53 @"ACTION_SET_UP_HAND_GESTURE":kACTION_SET_UP_HAND_GESTURE,
54 @"ACTION_SET_HEART_RATE_INTERVAL":kACTION_SET_HEART_RATE_INTERVAL,
55 @"ACTION_SET_HEART_RATE_MEASURE_MODE":kACTION_SET_HEART_RATE_MEASURE_MODE,
56 @"ACTION_SET_ONE_KEY_RESET":kACTION_SET_ONE_KEY_RESET,
57 @"ACTION_SET_NOT_DISTURB":kACTION_SET_NOT_DISTURB,
58 @"ACTION_SET_SPORT_MODE":kACTION_SET_SPORT_MODE,
59 @"OPERATION_RESULT":OPERATION_RESULT,
60 @"OPERATION_ACTION":OPERATION_ACTION,
61 @"ACTION_NOTICE_COMMING_CALL":kACTION_NOTICE_COMMING_CALL,
62 @"ACTION_NOTICE_COMMING_CALL_STOP":kACTION_NOTICE_COMMING_CALL_STOP,
63 @"ACTION_NOTICE_NEW_MESSAGE":kACTION_NOTICE_NEW_MESSAGE,
64 @"ACTION_SYNC_ACTIVITY":kACTION_SYNC_ACTIVITY,
65 @"ACTION_SYNC_ACTIVITY_DATA":kACTION_SYNC_ACTIVITY_DATA,
66 @"ACTION_SYNC_CONFIG":kACTION_SYNC_CONFIG,
67 @"ACTION_SYNC_HEALTH_DATA":kACTION_SYNC_HEALTH_DATA,
68 @"ACTION_SYNC_HEALTH_DATA_SPORT":kACTION_SYNC_HEALTH_DATA_SPORT,
69 @"ACTION_SYNC_HEALTH_DATA_SLEEP":kACTION_SYNC_HEALTH_DATA_SLEEP,
70 @"ACTION_SYNC_HEALTH_DATA_HEART_RATE":kACTION_SYNC_HEALTH_DATA_HEART_RATE,
71 @"ACTION_SYNC_HEALTH_DATA_BLOOD_PRESSURE":kACTION_SYNC_HEALTH_DATA_BLOOD_PRESSURE,
72 @"OPERATION_STATUS":OPERATION_STATUS,
73 @"PROGRESS":PROGRESS,
74 @"TYPE":TYPE,
75 @"DATA":DATA,
76 @"RESULT":RESULT,
77 @"ACTION_GET_ALL_CONNECTED_DEVICES":kACTION_ERROR,
78 };
79};
80
81
82+ (BOOL)requiresMainQueueSetup
83{
84 return YES;
85}
86
87@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AMProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AMProfileModule.h
new file mode 100755
index 0000000..f27c20b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AMProfileModule.h
@@ -0,0 +1,18 @@
1//
2// AMProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15
16@interface AMProfileModule : NSObject<RCTBridgeModule>
17
18@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AMProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AMProfileModule.m
new file mode 100755
index 0000000..4f6a4be
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/AMProfileModule.m
@@ -0,0 +1,248 @@
1//
2// AMProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "AMProfileModule.h"
10
11@implementation AMProfileModule
12
13RCT_EXPORT_MODULE()
14
15#pragma mark
16#pragma mark - constantsToExport
17
18- (NSDictionary *)constantsToExport
19
20{
21 return @{
22
23 @"ACTION_ERROR_AM":@"error_am",
24
25
26 @"ACTION_RESET_AM":@"reset_am",
27 @"ACTION_USERID_AM":@"userid_am",
28 @"ACTION_SET_USERID_SUCCESS_AM":@"set_userid_success_am",
29 @"ACTION_SYNC_TIME_SUCCESS_AM":@"set_sync_time_success_am",
30 @"ACTION_SET_USERINFO_SUCCESS_AM":@"set_userinfo_success_am",
31 @"ACTION_GET_USERINFO_AM":@"get_userinfo_am",
32 @"ACTION_GET_ALARMNUM_AM":@"get_alarmnum_am",
33 @"ACTION_GET_ALARMINFO_AM":@"get_alarminfo_am",
34 @"ACTION_SET_ALARMINFO_SUCCESS_AM":@"set_alarminfo_success_am",
35 @"ACTION_DELETE_ALARM_SUCCESS_AM":@"delete_alarm_success_am",
36 @"ACTION_GET_ACTIVITY_REMIND_AM":@"get_activity_remind_am",
37 @"ACTION_SET_ACTIVITYREMIND_SUCCESS_AM":@"set_activityremind_success_am",
38 @"ACTION_SYNC_ACTIVITY_DATA_AM":@"sync_activity_data_am",
39 @"ACTION_SYNC_SLEEP_DATA_AM":@"sync_sleep_data_am",
40 @"ACTION_SYNC_STAGE_DATA_AM":@"sync_stage_data_am",
41 @"ACTION_SYNC_REAL_DATA_AM":@"sync_real_data_am",
42 @"ACTION_QUERY_STATE_AM":@"query_state_am",
43 @"ACTION_SET_BMR_SUCCESS_AM":@"set_bmr_success_am",
44 @"ACTION_GET_RANDOM_AM":@"get_random_am",
45 @"ACTION_SET_SWIMINFO_AM":@"set_swiminfo_am",
46 @"ACTION_GET_SWIMINFO_AM":@"get_swiminfo_am",
47 @"ACTION_SET_HOUR_MODE_SUCCESS_AM":@"set_hour_mode_success_am",
48 @"ACTION_GET_HOUR_MODE_AM":@"get_hour_mode_am",
49
50
51 @"ACTION_SET_DEVICE_MODE_AM":@"set_device_mode_am",
52 @"ACTION_SET_PICTURE_SUCCESS_AM":@"set_picture_success_am",
53 @"ACTION_GET_PICTURE_AM":@"get_picture_am",
54
55 @"ACTION_CLOUD_BINDING_AM_SUCCESS":@"cloud_bind_am_success",
56 @"ACTION_CLOUD_BINDING_AM_FAIL":@"cloud_bind_am_fail",
57 @"ACTION_CLOUD_UNBINDING_AM_SUCCESS":@"cloud_unbind_am_success",
58 @"ACTION_CLOUD_UNBINDING_AM_FAIL":@"cloud_unbind_am_fail",
59 @"ACTION_CLOUD_SEARCH_AM":@"cloud_search_am",
60 @"ACTION_CLOUD_SEARCH_FAIL_AM":@"cloud_search_fail",
61 @"ACTION_GET_ALL_CONNECTED_DEVICES":@"ACTION_GET_ALL_CONNECTED_DEVICES",
62
63
64
65 @"ERROR_NUM_AM":@"error",
66 @"ERROR_DESCRIPTION_AM":@"description",
67
68
69 @"ERROR_ID_ILLEGAL_ARGUMENT":@"ERROR_ID_ILLEGAL_ARGUMENT",
70 @"ERROR_ID_VERSION_NOT_SUPPORT":@"ERROR_ID_VERSION_NOT_SUPPORT",
71
72 @"RESET_AM":@"reset",
73 @"USERID_AM":@"userid",
74 @"GET_USER_AGE_AM":@"age",
75 @"GET_USER_STEP_AM":@"step",
76 @"GET_USER_HEIGHT_AM":@"height",
77 @"GET_USER_SEX_AM":@"gender",
78 @"GET_USER_WEIGHT_AM":@"weight",
79 @"GET_USER_UNIT_AM":@"unit",
80 @"GET_USER_TARGET1_AM":@"target1",
81 @"GET_USER_TARGET2_AM":@"target2",
82 @"GET_USER_TARGET3_AM":@"target3",
83 @"GET_USER_SWIMTARGET_AM":@"swim_target",
84 @"GET_ALARMNUM_AM":@"alarmclocknumber",
85 @"GET_ALARMNUM_ID_AM":@"alarmclocknumberid",
86 @"GET_ALARM_CLOCK_DETAIL":@"alarmclockdetail",
87 @"GET_ALARM_ID_AM":@"alarmid",
88 @"GET_ALARM_TIME_AM":@"time",
89 @"GET_ALARM_ISREPEAT_AM":@"repeat",
90 @"GET_ALARM_WEEK_AM":@"get_alarm_week",
91 @"GET_ALARM_WEEK_SUNDAY_AM":@"sun",
92 @"GET_ALARM_WEEK_MONDAY_AM":@"mon",
93 @"GET_ALARM_WEEK_TUESDAY_AM":@"tue",
94 @"GET_ALARM_WEEK_WEDNESDAY_AM":@"wed",
95 @"GET_ALARM_WEEK_THURSDAY_AM":@"thu",
96 @"GET_ALARM_WEEK_FRIDAY_AM":@"fri",
97 @"GET_ALARM_WEEK_SATURDAY_AM":@"sat",
98 @"GET_ALARM_ISON_AM":@"switch",
99 @"GET_ACTIVITY_REMIND_TIME_AM":@"time",
100 @"GET_ACTIVITY_REMIND_ISON_AM":@"switch",
101 @"SYNC_ACTIVITY_DATA_AM":@"activity",
102 @"SYNC_ACTIVITY_DATA_TIME_AM":@"time",
103 @"SYNC_ACTIVITY_DATA_STEP_AM":@"step",
104 @"SYNC_ACTIVITY_DATA_STEP_LENGTH_AM":@"stepsize",
105 @"SYNC_ACTIVITY_DATA_CALORIE_AM":@"calorie",
106 @"SYNC_ACTIVITY_EACH_DATA_AM":@"activity_each_data",
107 @"DATAID":@"dataID",
108 @"SYNC_SLEEP_DATA_AM":@"sleep",
109 @"SYNC_SLEEP_DATA_TIME_AM":@"time",
110 @"SYNC_SLEEP_DATA_LEVEL_AM":@"level",
111 @"SYNC_SLEEP_EACH_DATA_AM":@"sleep_each_data",
112 @"SYNC_STAGE_DATA_AM":@"stage_data",
113 @"SYNC_STAGE_DATA_TYPE_WORKOUT_AM":@"stage_data_type_workout",
114 @"SYNC_STAGE_DATA_TYPE_AM":@"type",
115 @"SYNC_STAGE_DATA_WORKOUT_STEP_AM":@"stage_data_workout_step",
116 @"SYNC_STAGE_DATA_STOP_TIME_AM":@"stoptime",
117 @"SYNC_STAGE_DATA_USED_TIME_AM":@"usedtime",
118 @"SYNC_STAGE_DATA_DISTANCE_AM":@"stage_data_distance",
119 @"SYNC_STAGE_DATA_CALORIE_AM":@"calorie",
120 @"SYNC_STAGE_DATA_SWIM_CUTINDIF_AM":@"stage_data_cutindif",
121 @"SYNC_STAGE_DATA_TYPE_SWIM_AM":@"swim",
122 @"SYNC_STAGE_DATA_SWIM_PULL_TIMES_AM":@"number of strokes",
123 @"SYNC_STAGE_DATA_SWIM_STROKE_AM":@"swimming stroke",
124 @"SYNC_STAGE_DATA_SWIM_TURNS_AM":@"number of turns",
125 @"SYNC_STAGE_DATA_SWIMPOOL_LENGTH_AM":@"stage_data_swimpool_length",
126 @"SYNC_STAGE_DATA_SWIM_CUTOUTDIF_AM":@"stage_data_cutoutdif",
127 @"SYNC_STAGE_DATA_SWIM_PROCESSFLAG_AM":@"stage_data_processflag",
128 @"SYNC_STAGE_DATA_TYPE_SLEEP_AM":@"sleep",
129 @"SYNC_STAGE_DATA_SLEEP_EFFICIENCY_AM":@"sleepefficiency",
130 @"SYNC_STAGE_DATA_SLEEP_IS50MIN_AM":@"is50min",
131 @"SYNC_STAGE_DATA_TYPE_PAGE_VIEW_SUMMARY":@"page_view_summary",
132 @"SYNC_STAGE_DATA_VIEW_SUMMARY_DATE_AM":@"stage_data_view_summary_date",
133 @"SYNC_STAGE_DATA_VIEW_SUMMARY_STEP_AM":@"stage_data_view_summary_step",
134 @"SYNC_STAGE_DATA_VIEW_SUMMARY_DISTANCE_AM":@"stage_data_view_summary_distance",
135 @"SYNC_STAGE_DATA_VIEW_SUMMARY_CALORIE_AM":@"stage_data_view_summary_calorie",
136 @"SYNC_STAGE_DATA_VIEW_SUMMARY_TARGET_AM":@"stage_data_view_summary_target",
137 @"SYNC_STAGE_DATA_VIEW_SUMMARY_SWIM_AM":@"stage_data_view_summary_swim",
138 @"SYNC_REAL_STEP_AM":@"step",
139 @"SYNC_REAL_CALORIE_AM":@"calorie",
140 @"SYNC_REAL_TOTALCALORIE_AM":@"totalcalories",
141 @"QUERY_STATE_AM":@"query_state",
142 @"QUERY_BATTERY_AM":@"battery",
143 @"GET_RANDOM_AM":@"random",
144 @"GET_SWIMLANE_LENGTH_AM":@"get_swimlane_length",
145 @"GET_SWIM_UNIT_AM":@"get_swim_unit_am",
146 @"GET_SWIM_SWITCH_AM":@"get_swim_switch_am",
147 @"GET_SWIM_CUTOUT_HOUR_AM":@"get_swim_cutout_hour_am",
148 @"GET_SWIM_CUTOUT_MINUTE_AM":@"get_swim_cutout_min_am",
149 @"GET_PICTURE_AM":@"get_picture_am",
150
151
152
153 @"AM_SET_MALE":@1,
154 @"AM_SET_FEMALE":@0,
155 @"AM_SET_UNIT_METRIC":@1,
156 @"AM_SET_UNIT_IMPERIAL_STANDARD":@0,
157 @"AM_SET_12_HOUR_MODE":@0,
158 @"AM_SET_24_HOUR_MODE":@1,
159 @"AM_SET_EUROPE_12_HOUR_MODE":@3,
160 @"AM_SET_EUROPE_24_HOUR_MODE":@5,
161 @"AM_SET_EXCEPT_EUROPE_12_HOUR_MODE":@2,
162 @"AM_SET_EXCEPT_EUROPE_24_HOUR_MODE":@4,
163 @"GET_HOUR_MODE_AM":@"hourtype",
164 @"AM_DEVICE_MODE_SLEEP":@0,
165 @"AM_DEVICE_MODE_ACTIVITY":@1,
166 @"AM_DEVICE_MODE_FLIGHT":@2,
167 @"AM_DEVICE_MODE_DRIVING":@3,
168 };
169};
170
171
172
173
174+ (BOOL)requiresMainQueueSetup
175{
176 return YES;
177}
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1Module.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1Module.h
new file mode 100755
index 0000000..79622cb
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1Module.h
@@ -0,0 +1,22 @@
1//
2// BG1Module.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16@interface BG1Module : RCTEventEmitter<RCTBridgeModule>
17
18
19
20
21
22@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1Module.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1Module.m
new file mode 100644
index 0000000..c5c33d3
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1Module.m
@@ -0,0 +1,236 @@
1//
2// BG1Module.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "BG1Module.h"
10#import "BG1ProfileModule.h"
11#import "BGMacroFile.h"
12#import "BG1Controller.h"
13#import "BG1.h"
14#define EVENT_NOTIFY @"event_notify_bg1"
15
16@implementation BG1Module
17
18
19RCT_EXPORT_MODULE()
20- (NSArray<NSString *> *)supportedEvents {
21 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
22 @"event_device_connected", @"event_device_connect_failed",
23 @"event_device_disconnect", @"event_authenticate_result",
24 @"event_notify_ts28b", @"event_notify_bg1",
25 @"action_connect_result_for_bg1"];
26}
27
28
29- (NSDictionary *)constantsToExport
30{
31 return @{
32 @"Event_Notify":@"event_notify_bg1",
33
34 };
35}
36+ (BOOL)requiresMainQueueSetup
37{
38 return YES;
39}
40
41#pragma mark
42#pragma mark - Init
43-(id)init
44{
45 if (self=[super init])
46 {
47
48 [BG1Controller shareBG1Controller];
49
50 }
51 return self;
52}
53
54
55
56-(BG1*)getBG1Instance{
57
58 BG1Controller *controller = [BG1Controller shareBG1Controller];
59 BG1 *bg1Instance = [controller getCurrentBG1Instance];
60 if(bg1Instance != nil)
61 {
62 return bg1Instance;
63 }
64 else
65 {
66 return nil;
67 }
68
69}
70
71
72#pragma mark
73#pragma mark - Method
74
75
76RCT_EXPORT_METHOD(sendCode:(nonnull NSString *)QR:(nonnull NSNumber *)codeType:(nonnull NSNumber *)testType){
77
78
79 if ([self getBG1Instance]!=nil) {
80
81 if (QR ==nil || QR.length<30) {
82 NSDictionary* deviceInfo = @{@"mac":@"",@"action":@"action_measure_error_for_bg1",@"action_measure_error_for_bg1":@400,@"description":@"Parameter input error."};
83 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
84
85 return;
86 }
87
88 NSDictionary *codeDic = [[self getBG1Instance]codeStripStrAnalysis:QR];
89 NSNumber *bottleID = [codeDic objectForKey:@"bottleId"];
90 NSDate *dueDate = [codeDic objectForKey:@"overDate"];
91 NSNumber *remainNum = [codeDic objectForKey:@"stripNum"];
92
93 BGMeasureMode bgMeasureModel = BGMeasureMode_Blood;
94 if(codeType.integerValue == 2)
95 {
96 bgMeasureModel = BGMeasureMode_NoBlood;
97 }
98
99 BGCodeMode bgCodeModel =BGCodeMode_GOD;
100 if(codeType.integerValue == 2)
101 {
102 bgCodeModel = BGCodeMode_GDH;
103 }
104 [[self getBG1Instance] commandBG1MeasureMode:bgMeasureModel withCodeMode:bgCodeModel withCodeString:QR withSendCodeResultBlock:^{
105
106 NSDictionary* deviceInfo = @{@"mac":@"",@"action":@"action_sendcode_result_for_bg1",@"set_bottle_message":@true};
107 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
108
109 } withStripInBlock:^{
110
111 NSDictionary* deviceInfo = @{@"mac":@"",@"action":@"action_measure_strip_in_for_bg1"};
112 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
113
114 } withBloodBlock:^{
115
116 NSDictionary* deviceInfo = @{@"mac":@"",@"action":@"action_measure_get_blood_for_bg1"};
117 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
118
119 } withResultBlock:^(NSDictionary *result) {
120
121 NSDate *measureDate = [result objectForKey:@"Date"];
122
123 //将时间格式转化成字符串,适配plugin和react native
124 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
125 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
126 NSString *dateStr = [mydateFormatter stringFromDate:measureDate];
127
128 NSDictionary *resultDic = [NSDictionary dictionaryWithObjectsAndKeys:dateStr,@"date",[result objectForKey:@"Result"],@"value",[result objectForKey:@"dataID"],@"dataID", nil];
129
130 NSDictionary* deviceInfo = @{@"mac":@"",@"action":@"action_measure_result_for_bg1",@"result":resultDic};
131 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
132
133 } withStripOutBlock:^{
134
135 NSDictionary* deviceInfo = @{@"mac":@"",@"action":@"action_measure_strip_out_for_bg1"};
136 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
137
138 } withErrorBlock:^(BG1Error errorID) {
139
140
141 NSString *descriptionStr = @"";
142
143 switch (errorID) {
144 case BG1Error_LowBattery:
145 descriptionStr=@"Battery is low.";
146 break;
147 case BG1Error_ResultOutOfMeasurementRage:
148 descriptionStr=@"Glucose test result is out of the measurement range.";
149 break;
150 case BG1Error_UnvalidReferenceVoltage:
151 descriptionStr=@"2.5V reference voltage error, not normal measurement, please repeat the test.";
152 break;
153 case BG1Error_StripUsed:
154 descriptionStr=@"Strip is used or unknown moisture detected, discard the test strip and repeat the test with a new strip.";
155 break;
156 case BG1Error_CodeError:
157 descriptionStr=@"CODE value check error. This error need let user scan code and call the send code function again,no alert need to show.";
158 break;
159 case BG1Error_RoomTemperatureOutOfRange1:
160 case BG1Error_RoomTemperatureOutOfRange2:
161 descriptionStr=@"The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.";
162 break;
163 case BG1Error_ResultLow:
164 descriptionStr=@"Glucose test result is low.";
165 break;
166 case BG1Error_ResultHigh:
167 descriptionStr=@"Glucose test result is high.";
168 break;
169 case BG1Error_DisConnented:
170 descriptionStr=@"BG disConnented.";
171 break;
172 case BG1Error_SleepingMode:
173 descriptionStr=@"BG sleeping mode.";
174 break;
175 case BG1Error_ParameterError:
176 descriptionStr=@"Parameter input error.";
177 break;
178 default:
179 descriptionStr=@"BG unknown.";
180 break;
181 }
182
183 NSDictionary* deviceInfo = @{@"mac":@"",@"action":@"action_measure_error_for_bg1",@"action_measure_error_for_bg1":[NSNumber numberWithInt:errorID],@"description":descriptionStr};
184 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
185
186 }];
187
188
189
190
191
192 }else{
193
194 NSDictionary* deviceInfo = @{@"mac":@"",@"action":@"action_measure_error_for_bg1",@"action_measure_error_for_bg1":@100,@"description":@"BG disConnented." };
195 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
196
197 }
198
199}
200
201
202
203
204
205RCT_EXPORT_METHOD(getBottleInfoFromQR:(nonnull NSString *)QR){
206
207
208 if ([self getBG1Instance]!=nil) {
209
210 NSDictionary *codeDic = [[self getBG1Instance]codeStripStrAnalysis:QR];
211 NSDate *tempDate = [codeDic objectForKey:@"DueDate"];
212
213 //将时间格式转化成字符串,适配plugin和react native
214 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
215 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
216 NSTimeZone *dongBaTimeZone = [NSTimeZone timeZoneForSecondsFromGMT:8*60*60];
217 [mydateFormatter setTimeZone:dongBaTimeZone];
218 NSString *dateStr = [mydateFormatter stringFromDate:tempDate];
219
220 NSNumber *bottleID = [codeDic objectForKey:@"BottleID"];
221 NSNumber *remainNum = [codeDic objectForKey:@"StripNum"];
222
223 NSDictionary* deviceInfo = @{@"mac":@"",@"action":@"action_code_analysis_bg",@"stripNum":remainNum,@"overDate":dateStr,@"bottleId":bottleID};
224 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
225
226 }else{
227
228 NSDictionary* deviceInfo = @{@"mac":@"",@"action":@"action_measure_error_for_bg1",@"action_measure_error_for_bg1":@100,@"description":@"BG disConnented."};
229 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
230
231 }
232
233}
234
235
236@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1ProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1ProfileModule.h
new file mode 100755
index 0000000..02bf97f
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1ProfileModule.h
@@ -0,0 +1,18 @@
1//
2// BG1ProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15@interface BG1ProfileModule : NSObject<RCTBridgeModule>
16
17
18@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1ProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1ProfileModule.m
new file mode 100755
index 0000000..c7410a0
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1ProfileModule.m
@@ -0,0 +1,84 @@
1//
2// BG1ProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "BG1ProfileModule.h"
10
11@implementation BG1ProfileModule
12
13
14RCT_EXPORT_MODULE()
15
16#pragma mark
17#pragma mark - constantsToExport
18
19
20- (NSDictionary *)constantsToExport
21{
22 return @{
23
24 @"ACTION_ERROR_BG":@"action_measure_error",
25 @"ACTION_GET_BATTERY":@"action_battery_bg",
26 @"ACTION_KEEP_LINK":@"action_keep_link",
27 @"ACTION_SET_TIME":@"action_set_time",
28 @"ACTION_SET_UNIT":@"action_set_unit",
29 @"ACTION_START_MEASURE":@"action_start_measure",
30 @"ACTION_GET_OFFLINEDATA_COUNT":@"action_historicalnum_bg",
31 @"ACTION_GET_OFFLINEDATA":@"action_historicaldata_bg",
32 @"ACTION_DELETE_OFFLINEDATA":@"action_delete_historical_data",
33 @"ACTION_SET_BOTTLEMESSAGE":@"action_set_bottle_message_success",
34 @"ACTION_GET_BOTTLEMESSAGE":@"action_get_codeinfo",
35 @"ACTION_SET_BOTTLEID":@"action_set_bottle_message_success",
36 @"ACTION_GET_BOTTLEID":@"action_get_bottleid",
37
38 @"ACTION_BG1_SENDCODE_RESULT":@"action_sendcode_result_for_bg1",
39 @"ACTION_BG1_MEASURE_ERROR":@"action_measure_error_for_bg1",
40 @"ACTION_BG1_MEASURE_STRIP_IN":@"action_measure_strip_in_for_bg1",
41 @"ACTION_BG1_MEASURE_GET_BLOOD":@"action_measure_get_blood_for_bg1",
42 @"ACTION_BG1_MEASURE_RESULT":@"action_measure_result_for_bg1",
43 @"ACTION_BG1_MEASURE_STRIP_OUT":@"action_measure_strip_out_for_bg1",
44 @"ACTION_BG1_MEASURE_STANDBY":@"action_measure_standby_for_bg1",
45 @"ACTION_CODE_ANALYSIS":@"action_code_analysis_bg",
46
47
48 @"BG1_SENDCODE_RESULT":@"sendcode_result_for_bg1",
49 @"BG1_MEASURE_ERROR":@"action_measure_error_for_bg1",
50 @"BG1_MEASURE_RESULT":@"measure_result_for_bg1",
51 @"DATA_ID":@"dataID",
52
53 @"STRIP_NUM_BG":@"stripNum",
54 @"STRIP_EXPIRETIME_BG":@"overDate",
55 @"BOTTLEID_BG":@"bottleId",
56
57
58 @"ERROR_NUM_BG":@"error",
59 @"GET_BATTERY":@"battery",
60 @"KEEP_LINK":@"keep_link",
61 @"SET_TIME":@"set_time",
62 @"SET_UNIT":@"set_unit",
63 @"START_MEASURE":@"start_measure",
64 @"GET_OFFLINEDATA_COUNT":@"count",
65 @"GET_OFFLINEDATA":@"his_data_bg",
66 @"DELETE_OFFLINEDATA":@"delete_historical_data",
67 @"GET_USENUM":@"usenum",
68 @"SET_BOTTLEMESSAGE":@"set_bottle_message",
69 @"GET_BOTTLEID":@"bottleid",
70 @"SET_BOTTLEID":@"set_bottle_message"
71
72
73
74
75 };
76};
77
78+ (BOOL)requiresMainQueueSetup
79{
80 return YES;
81}
82
83
84@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SModule.h
new file mode 100644
index 0000000..f7a3d09
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SModule.h
@@ -0,0 +1,20 @@
1//
2// BG1SModule.h
3// ReactNativeIOSLibrary
4//
5// Created by user on 2019/11/12.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTEventEmitter.h>
12#else
13#import "RCTEventEmitter.h"
14#endif
15
16@interface BG1SModule : RCTEventEmitter<RCTBridgeModule>
17
18@end
19
20
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SModule.m
new file mode 100644
index 0000000..f841037
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SModule.m
@@ -0,0 +1,224 @@
1//
2// BG1SModule.m
3// ReactNativeIOSLibrary
4//
5// Created by user on 2019/11/12.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import "BG1SModule.h"
10#import "BG1S.h"
11#import "BG1SController.h"
12#import "BG1SProfileModule.h"
13
14#import "BGHeader.h"
15
16@implementation BG1SModule
17RCT_EXPORT_MODULE()
18- (NSArray<NSString *> *)supportedEvents {
19 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
20 @"event_device_connected", @"event_device_connect_failed",
21 @"event_device_disconnect", @"event_authenticate_result",
22 @"event_notify_ts28b", @"event_notify_bg1",
23 @"action_connect_result_for_bg1"];
24}
25
26
27- (NSDictionary *)constantsToExport
28{
29 return @{ @"Event_Notify": BG1S_EVENT_NOTIFY ,
30
31 };
32}
33
34+ (BOOL)requiresMainQueueSetup
35{
36 return YES;
37}
38
39
40-(BG1S*)getDeviceWithMac:(NSString*)mac{
41
42 BG1SController *controller = [BG1SController shareIHBG1SController];
43 NSArray *BG1SDeviceArray = [controller getAllCurrentBG1SInstace];
44
45 for(BG1S *tempDevice in BG1SDeviceArray){
46 if([mac isEqualToString:tempDevice.serialNumber]){
47
48 return tempDevice;
49 }
50 }
51 return nil;
52}
53
54RCT_EXPORT_METHOD(getAllConnectedDevices){
55
56
57 NSArray*BG1SDeviceArray= [[BG1SController shareIHBG1SController] getAllCurrentBG1SInstace];
58
59 NSMutableArray*deviceMacArray=[NSMutableArray array];
60
61 for (int i=0; i<[BG1SDeviceArray count]; i++) {
62
63 BG1S *BG1S = [BG1SDeviceArray objectAtIndex:i];
64
65 [deviceMacArray addObject:BG1S.serialNumber];
66
67 }
68
69 NSDictionary* deviceInfo = @{BG1S_ACTION:kACTION_GET_ALL_CONNECTED_DEVICES,BG1S_DEVICE:deviceMacArray};
70
71 [self sendEventWithName:BG1S_EVENT_NOTIFY body:deviceInfo];
72}
73
74RCT_EXPORT_METHOD(measure:(nonnull NSString *)mac measureMode:(nonnull NSNumber *)testType){
75
76
77 if ([self getDeviceWithMac:mac] != nil) {
78
79 BGMeasureMode models= BGMeasureMode_Blood;
80
81 if ([testType intValue]==1) {
82
83 models=BGMeasureMode_NoBlood;
84
85 }else{
86
87 models=BGMeasureMode_Blood;
88 }
89
90 [[self getDeviceWithMac:mac] commandCreateBG1STestModel:models DisposeBGStripInBlock:^(BOOL inORout) {
91
92 if (inORout) {
93 [self sendEventWithName:BG1S_EVENT_NOTIFY body:@{
94 BG1S_ACTION:ACTION_STRIP_INSERTION_STATUS,
95 BG1S_KEY_MAC:mac,
96 BG1S_TYPE:@"BG1S",
97 OPERATION_DESCRIBE:@"strip in",
98 STRIP_INSERTION_STATUS:@1,
99 }];
100 }else{
101
102 [self sendEventWithName:BG1S_EVENT_NOTIFY body:@{
103 BG1S_ACTION:ACTION_STRIP_INSERTION_STATUS,
104 BG1S_KEY_MAC:mac,
105 BG1S_TYPE:@"BG1S",
106 OPERATION_DESCRIBE:@"strip put",
107 STRIP_INSERTION_STATUS:@2,
108 }];
109 }
110
111 } DisposeBGBloodBlock:^{
112
113 [self sendEventWithName:BG1S_EVENT_NOTIFY body:@{
114 BG1S_ACTION:ACTION_GET_BLOOD,
115 BG1S_KEY_MAC:mac,
116 BG1S_TYPE:@"BG1S",
117 OPERATION_DESCRIBE:@"get blood"
118 }];
119
120 } DisposeBGResultBlock:^(NSDictionary *result) {
121
122
123 [self sendEventWithName:BG1S_EVENT_NOTIFY body:@{
124 BG1S_ACTION:ACTION_MEASURE_RESULT,
125 BG1S_KEY_MAC:mac,
126 BG1S_TYPE:@"BG1S",
127 MEASURE_RESULT:[result valueForKey:@"Result"],
128 MEASURE_MODE:[result valueForKey:@"TestState"]
129 }];
130
131 } DisposeBGErrorBlock:^(BG1SDeviceError error) {
132
133 [self sendBG1SErrorCode:error mac:mac];
134
135 }];
136
137
138 }
139
140}
141
142//getFunction
143RCT_EXPORT_METHOD(getFunction:(nonnull NSString *)mac){
144 if ([self getDeviceWithMac:mac]!=nil) {
145
146
147 [[self getDeviceWithMac:mac] commandFunction:^(NSDictionary *functionDict) {
148
149
150 [self sendEventWithName:BG1S_EVENT_NOTIFY body:@{
151 BG1S_ACTION:ACTION_CODE_ANALYSIS,
152 BG1S_KEY_MAC:mac,
153 BG1S_TYPE:@"BG1S",
154 INFO_BATTERY_BG1S:[functionDict valueForKey:@"Battary"],
155 INFO_VERSION_CODE_BLOOD_BG1S:[functionDict valueForKey:@"CodeVersion"],
156 INFO_VERSION_CODE_CTL_BG1S:[functionDict valueForKey:@"DcodeVersion"],
157
158 }];
159
160 } DisposeBGErrorBlock:^(BG1SDeviceError error) {
161
162
163 [self sendBG1SErrorCode:error mac:mac];
164
165 }];
166
167
168 }
169}
170
171//断开连接
172RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
173
174 if ([self getDeviceWithMac:mac]!=nil) {
175
176 [[self getDeviceWithMac:mac] commandDisconnectDevice];
177 }
178
179}
180
181-(void)sendBG1SErrorCode:(BG1SDeviceError)errorID mac:(NSString*)mac{
182
183 NSString *errorMassage = [NSString string];
184 switch (errorID) {
185 case 0:
186 errorMassage = @"BG1SDeviceError0";
187 break;
188 case 1:
189 errorMassage = @"BG1SError_LowBattery";
190 break;
191 case 2:
192 errorMassage = @"BG1SError_ReferenceUnstable";
193 break;
194 case 3:
195 errorMassage = @"BG1SError_BadStrip";
196 break;
197 case 4:
198 errorMassage = @"BG1SError_BadEEPROM";
199 break;
200 case 5:
201 errorMassage = @"BG1SError_LowAmbientTemperature";
202 break;
203 case 6:
204 errorMassage = @"BG1SError_HighAmbientTemperature";
205 break;
206 case 7:
207 errorMassage = @"BG1SError_BleedEarly";
208 break;
209 case 8:
210 errorMassage = @"BG1SError_Other";
211 break;
212
213
214 default:
215 break;
216 }
217
218 NSDictionary *deviceInfo = @{BG1S_KEY_MAC:mac,BG1S_ACTION:ACTION_ERROR_BG1S,ERROR_NUM_BG1S:[NSNumber numberWithInt:errorID],ERROR_DESCRIPTION_BG1S:errorMassage};
219 [self sendEventWithName:BG1S_EVENT_NOTIFY body:deviceInfo];
220
221
222}
223
224@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SProfileModule.h
new file mode 100644
index 0000000..ab9abc4
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SProfileModule.h
@@ -0,0 +1,61 @@
1//
2// BG1SProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by user on 2019/11/14.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15
16
17@interface BG1SProfileModule : NSObject<RCTBridgeModule>
18
19#define BG1S_EVENT_NOTIFY @"event_notify_bg1s"
20
21#define BG1S_ACTION @"action"
22
23#define BG1S_TYPE @"type"
24
25#define BG1S_DEVICE @"devices"
26
27#define BG1S_KEY_MAC @"mac"
28
29#define OPERATION_DESCRIBE @"describe"
30
31#define STRIP_INSERTION_STATUS @"insertion_status"
32
33#define kACTION_GET_ALL_CONNECTED_DEVICES @"ACTION_GET_ALL_CONNECTED_DEVICES"
34
35#define MEASURE_RESULT @"measure_result"
36
37#define MEASURE_MODE @"measure_mode"
38
39#define ACTION_CODE_ANALYSIS @"action_get_device_info"
40
41#define INFO_BATTERY_BG1S @"battery"
42
43#define INFO_VERSION_CODE_BLOOD_BG1S @"info_version_code_blood_bg1s"
44
45#define INFO_VERSION_CODE_CTL_BG1S @"info_version_code_ctl_bg1s"
46
47#define ACTION_ERROR_BG1S @"action_error"
48
49#define ERROR_NUM_BG1S @"error_num"
50
51#define ERROR_DESCRIPTION_BG1S @"error_description"
52
53#define ACTION_STRIP_INSERTION_STATUS @"action_strip_insertion_status"
54
55#define ACTION_GET_BLOOD @"action_get_blood"
56
57#define ACTION_MEASURE_RESULT @"action_measure_result"
58
59
60@end
61
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SProfileModule.m
new file mode 100644
index 0000000..a3f153b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG1SProfileModule.m
@@ -0,0 +1,50 @@
1//
2// BG1SProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by user on 2019/11/14.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import "BG1SProfileModule.h"
10
11@implementation BG1SProfileModule
12
13RCT_EXPORT_MODULE()
14
15#pragma mark
16#pragma mark - constantsToExport
17
18
19- (NSDictionary *)constantsToExport
20{
21 return @{
22 BG1S_ACTION:BG1S_ACTION,
23 BG1S_DEVICE:BG1S_DEVICE,
24 BG1S_KEY_MAC:BG1S_KEY_MAC,
25 BG1S_TYPE:BG1S_TYPE,
26 OPERATION_DESCRIBE:OPERATION_DESCRIBE,
27 STRIP_INSERTION_STATUS:STRIP_INSERTION_STATUS,
28 kACTION_GET_ALL_CONNECTED_DEVICES:kACTION_GET_ALL_CONNECTED_DEVICES,
29 @"ACTION_STRIP_INSERTION_STATUS" :ACTION_STRIP_INSERTION_STATUS,
30 @"ACTION_GET_BLOOD" :ACTION_GET_BLOOD,
31 @"ACTION_MEASURE_RESULT" :ACTION_MEASURE_RESULT,
32 @"ACTION_CODE_ANALYSIS" :ACTION_CODE_ANALYSIS,
33 @"INFO_BATTERY_BG1S" :INFO_BATTERY_BG1S,
34 @"INFO_VERSION_CODE_BLOOD_BG1S" :INFO_VERSION_CODE_BLOOD_BG1S,
35 @"INFO_VERSION_CODE_CTL_BG1S" :INFO_VERSION_CODE_CTL_BG1S,
36 @"ACTION_ERROR_BG1S" :ACTION_ERROR_BG1S,
37 @"ERROR_NUM_BG1S" :ERROR_NUM_BG1S,
38 @"ERROR_DESCRIPTION_BG1S" :ERROR_DESCRIPTION_BG1S,
39 @"MEASURE_RESULT" :MEASURE_RESULT,
40 @"MEASURE_MODE" :MEASURE_MODE
41 };
42};
43
44
45+ (BOOL)requiresMainQueueSetup
46{
47 return YES;
48}
49
50@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5Module.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5Module.h
new file mode 100755
index 0000000..2b51c47
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5Module.h
@@ -0,0 +1,23 @@
1//
2// BG5Module.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16
17@interface BG5Module : RCTEventEmitter<RCTBridgeModule>
18
19
20
21
22
23@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5Module.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5Module.m
new file mode 100644
index 0000000..c0a7fcf
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5Module.m
@@ -0,0 +1,643 @@
1//
2// BG5Module.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "BG5Module.h"
10#import "BGProfileModule.h"
11#import "BGMacroFile.h"
12#import "BG5Controller.h"
13#import "BG5.h"
14
15#define EVENT_NOTIFY @"event_notify_bg5"
16#define kMAC_KEY @"mac"
17#define kACTION_KEY @"action"
18
19@interface BG5Module()
20
21/**
22 保存设备回复的开机模式
23 */
24@property (assign, nonatomic) NSInteger deviceSelectedOpenMode;
25
26/**
27 保存用户传入的测量模式
28 */
29@property (assign, nonatomic) NSInteger userSelectedMeasureMode;
30
31@end
32
33@implementation BG5Module
34
35
36RCT_EXPORT_MODULE()
37- (NSArray<NSString *> *)supportedEvents {
38 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
39 @"event_device_connected", @"event_device_connect_failed",
40 @"event_device_disconnect", @"event_authenticate_result",
41 @"event_notify_ts28b", @"event_notify_bg1",
42 @"action_connect_result_for_bg1"];
43}
44
45
46- (NSDictionary *)constantsToExport{
47 return @{
48 @"Event_Notify":EVENT_NOTIFY,
49 };
50}
51+ (BOOL)requiresMainQueueSetup
52{
53 return YES;
54}
55#pragma mark - Objc Method
56-(id)init{
57 self = [super init];
58 if (self) {
59 [BG5Controller shareIHBg5Controller];
60 self.deviceSelectedOpenMode = 0;// 初始化时,将开机模式设置为0;目的是,在用户调用开始测量方法时,判断用户是否已经调用过发码方法。调用过发码方法后,openMode的值是1或2
61 self.userSelectedMeasureMode = 0;// 初始化时,将开机模式设置为0;目的是,在用户调用开始测量方法时,判断用户发码时传入的测量模式 是否等于 开始测量传入的测量模式
62 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clear) name:BG5DisConnectNoti object:nil];
63 }
64 return self;
65}
66
67-(void)dealloc{
68 [[NSNotificationCenter defaultCenter]removeObserver:self];
69}
70
71- (void)clear{
72 self.deviceSelectedOpenMode = 0;
73 self.userSelectedMeasureMode = 0;
74}
75
76/**
77 返回传入的Mac地址对应的BG5对象
78
79 @param mac mac地址,需要完整的mac地址
80 @return BG5对象;如果没有匹配mac地址的BG5对象,那么返回nil
81 */
82-(BG5*)getDeviceWithMac:(NSString*)mac{
83
84 BG5Controller *controller = [BG5Controller shareIHBg5Controller];
85 NSArray *BGDeviceArray = [controller getAllCurrentBG5Instace];
86 NSLog(@"%@",BGDeviceArray);
87 for(BG5 *tempBG5 in BGDeviceArray){
88 if([mac isEqualToString:tempBG5.serialNumber]){
89 return tempBG5;
90 }
91 }
92 return nil;
93}
94
95- (void)sendMeasureErrorEventWithMac:(NSString *)mac errorId:(NSNumber *)errorId{
96
97
98 NSString *errorDescription = @"";
99
100 switch (errorId.integerValue) {
101 case 0:
102 errorDescription = @"Battery is low.";
103 break;
104 case 1:
105 errorDescription = @"Glucose test result is out of the measurement range.";
106 break;
107 case 2:
108 errorDescription = @"Unknown interference detected, please repeat the test.";
109 break;
110 case 3:
111 errorDescription = @"Strip is used or unknown moisture detected, discard the test strip and repeat the test with a new strip.";
112 break;
113 case 4:
114 errorDescription = @"Reading transmission error. Repeat the test with a new test strip. If the problem persists, contact iHealth customer service for assistance.";
115 break;
116 case 5:
117 errorDescription = @"The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.";
118 break;
119 case 6:
120 errorDescription = @"The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.";
121 break;
122 case 7:
123 errorDescription = @"Test strip coding error.";
124 break;
125 case 8:
126 errorDescription = @"Communication error, press \"START\" or rescan the code to repeat the test.";
127 break;
128 case 9:
129 errorDescription = @"Strip removed in the middle of reading, repeat the test with a new strip.";
130 break;
131 case 10:
132 errorDescription = @"Insert a new test strip and repeat the test.";
133 break;
134 case 11:
135 errorDescription = @"Cannot write to SN or KEY.";
136 break;
137 case 12:
138 errorDescription = @"Please set time.";
139 break;
140 case 13:
141 errorDescription = @"0 test strips remaining.";
142 break;
143 case 14:
144 errorDescription = @"Test strip expired.";
145 break;
146 case 15:
147 errorDescription = @"Unplug the charging cable before testing.";
148 break;
149 case 18:
150 errorDescription = @"Unplug the charging cable before read the history data";
151 break;
152 case 19:
153 errorDescription = @"Charging line is inserted";
154 break;
155 case 20:
156 errorDescription = @"Charging line pull out";
157 break;
158 case 21:
159 errorDescription = @"The bluetooth module failure";
160 break;
161 case 22:
162 errorDescription = @"Need to set time at first.";
163 break;
164 case 30:
165 errorDescription = @"BG Over Time Error.";
166 break;
167 case 112:
168 errorDescription = @"Device don't support to query energy.";
169 break;
170 case RNBGError_InputParameterError:
171 errorDescription = @"Parameters out of range.";
172 break;
173 case RNBGError_FunctionCallOrderError:
174 errorDescription = @"The order of call is wrong.";
175 break;
176 case RNBGError_MeasureModeNotMatched:
177 errorDescription = @"Measure Mode is not matched in fucntion call (setBottleMessageWithInfo and startMeasure)";
178 break;
179 case RNBGError_DisconnectFunctionNotSupportIniOSPlatform:
180 errorDescription = @"Function(disConnect) is not supported in iOS platform.";
181 break;
182 case RNBGError_getBottleInfoFromQRFunctionInpurParameterError:
183 errorDescription = @"Function(getBottleInfoFromQR) Input Parameter Error";
184 break;
185 default:
186 break;
187 }
188
189 [self sendEventWithName:EVENT_NOTIFY body:@{
190 kMAC_KEY:mac,
191 kACTION_KEY:kACTION_ERROR_BG,
192 kERROR_NUM_BG:errorId,
193 kERROR_DESCRIPTION_BG:errorDescription
194 }];
195}
196
197- (void)sendNoMatchedDeviceEventWithMac:(NSString *)mac{
198 if (mac && mac.length > 0) {
199 [self sendEventWithName:EVENT_NOTIFY body:@{
200 kMAC_KEY:mac,
201 kACTION_KEY:kACTION_ERROR_BG,
202 kERROR_NUM_BG:@100
203 }];
204 } else {
205 [self sendEventWithName:EVENT_NOTIFY body:@{
206 kACTION_KEY:kACTION_ERROR_BG,
207 kERROR_NUM_BG:@100
208 }];
209 }
210
211}
212
213- (void)sendInputParameterErrorEventWithMac:(NSString *)mac{
214 if (mac && mac.length > 0) {
215 [self sendEventWithName:EVENT_NOTIFY body:@{
216 kMAC_KEY:mac,
217 kACTION_KEY:kACTION_ERROR_BG,
218 kERROR_NUM_BG:@400,
219 kERROR_DESCRIPTION_BG:@"Parameters out of range."
220 }];
221 } else {
222 [self sendEventWithName:EVENT_NOTIFY body:@{
223 kACTION_KEY:kACTION_ERROR_BG,
224 kERROR_NUM_BG:@400,
225 kERROR_DESCRIPTION_BG:@"Parameters out of range."
226 }];
227 }
228
229}
230
231#pragma mark - Objc method for BG5Module.js function
232
233#pragma mark-获取连接设备
234RCT_EXPORT_METHOD(getAllConnectedDevices){
235
236
237 NSArray*bg5array= [[BG5Controller shareIHBg5Controller] getAllCurrentBG5Instace];
238
239 NSMutableArray*deviceMacArray=[NSMutableArray array];
240
241 for (int i=0; i<[bg5array count]; i++) {
242
243 BG5*bg5=[bg5array objectAtIndex:i];
244
245 [deviceMacArray addObject:bg5.serialNumber];
246
247 }
248
249 NSDictionary* deviceInfo = @{kACTION_KEY:@"ACTION_GET_ALL_CONNECTED_DEVICES",@"devices":deviceMacArray};
250
251 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
252
253
254}
255
256#pragma mark 保持连接
257RCT_EXPORT_METHOD(holdLink:(nonnull NSString *)mac){
258
259 if ([self getDeviceWithMac:mac]) {
260 __weak typeof(self) weakSelf = self;
261 [[self getDeviceWithMac:mac] commandKeepConnect:^(BOOL sendOk) {
262 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
263 kMAC_KEY:mac,
264 kACTION_KEY:kACTION_KEEP_LINK,
265 }];
266 } DisposeErrorBlock:^(NSNumber *errorID) {
267 [weakSelf sendMeasureErrorEventWithMac:mac errorId:errorID];
268 }];
269 }else{
270 [self sendNoMatchedDeviceEventWithMac:mac];
271 }
272}
273
274#pragma mark 获得电池电量
275RCT_EXPORT_METHOD(getBattery:(nonnull NSString *)mac){
276
277 if ([self getDeviceWithMac:mac]) {
278 __weak typeof(self) weakSelf = self;
279 [[self getDeviceWithMac:mac] commandQueryBattery:^(NSNumber *energy) {
280 NSLog(@"电量");
281 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
282 kMAC_KEY:mac,
283 kACTION_KEY:kACTION_GET_BATTERY,
284 kGET_BATTERY:energy
285 }];
286
287 } DisposeErrorBlock:^(NSNumber *errorID) {
288 [weakSelf sendMeasureErrorEventWithMac:mac errorId:errorID];
289 }];
290
291 }else{
292 [self sendNoMatchedDeviceEventWithMac:mac];
293 }
294}
295#pragma mark 设置时间
296RCT_EXPORT_METHOD(setTime:(nonnull NSString *)mac){
297
298
299 if ([self getDeviceWithMac:mac]) {
300 __weak typeof(self) weakSelf = self;
301 [[self getDeviceWithMac:mac] commandBGSetTime:^(BOOL setResult) {
302 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
303 kMAC_KEY:mac,
304 kACTION_KEY:kACTION_SET_TIME,
305 }];
306 } DisposeBGErrorBlock:^(NSNumber *errorID) {
307 [weakSelf sendMeasureErrorEventWithMac:mac errorId:errorID];
308 }];
309 }else{
310 [self sendNoMatchedDeviceEventWithMac:mac];
311
312 }
313}
314
315#pragma mark 设置单位
316RCT_EXPORT_METHOD(setUnit:(nonnull NSString *)mac unitType:(nonnull NSNumber *)type){
317#warning 下位机回复是否表示设置成功
318 if ([self getDeviceWithMac:mac]) {
319
320 BGUnit tempUnit = BGUnit_mmolPL;
321 if ([type isEqual:@(BGUnit_mmolPL)]) {
322 tempUnit = BGUnit_mmolPL;
323 } else if([type isEqual:@(BGUnit_mgPmL)]) {
324 tempUnit = BGUnit_mgPmL;
325 } else {
326 [self sendInputParameterErrorEventWithMac:mac];
327 return;
328 }
329 __weak typeof(self) weakSelf = self;
330 [[self getDeviceWithMac:mac] commandBGSetUnit:tempUnit DisposeSetUnitResult:^(BOOL setResult) {
331 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
332 kMAC_KEY:mac,
333 kACTION_KEY:kACTION_SET_UNIT,
334 }];
335
336 } DisposeBGErrorBlock:^(NSNumber *errorID) {
337
338 [weakSelf sendMeasureErrorEventWithMac:mac errorId:errorID];
339 }];
340
341 }else{
342 [self sendNoMatchedDeviceEventWithMac:mac];
343 }
344}
345
346#pragma mark 获得Bottle ID
347RCT_EXPORT_METHOD(getBottleId:(nonnull NSString *)mac){
348
349 if ([self getDeviceWithMac:mac]) {
350 __weak typeof(self) weakSelf = self;
351 [[self getDeviceWithMac:mac]commandBGGetBottleID:^(NSNumber *bottleID) {
352 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
353 kMAC_KEY:mac,
354 kACTION_KEY:kACTION_GET_BOTTLEID,
355 kGET_BOTTLEID:bottleID,
356 }];
357
358 } DisposeBGErrorBlock:^(NSNumber *errorID) {
359 [weakSelf sendMeasureErrorEventWithMac:mac errorId:errorID];
360 }];
361
362 }else{
363 [self sendNoMatchedDeviceEventWithMac:mac];
364 }
365}
366
367#pragma mark 开始测量
368RCT_EXPORT_METHOD(startMeasure:(nonnull NSString *)mac measureType:(nonnull NSNumber *)measureType){
369
370
371 if ([self getDeviceWithMac:mac]) {
372
373 /* 优先判断输入参数的内容正确性 */
374 if (![measureType isEqual: @(BGMeasureMode_Blood)] && ![measureType isEqual: @(BGMeasureMode_NoBlood)]) {
375 //输入参数错误
376 [self sendInputParameterErrorEventWithMac:mac];
377 return;
378 }
379
380 /* 再检查setBottleMessageWithInfo方法中传入的测量模式和本次传入的一致一致性 */
381 if (self.userSelectedMeasureMode != measureType.integerValue) {
382 [self sendMeasureErrorEventWithMac:mac errorId:@(RNBGError_MeasureModeNotMatched)];
383 return;
384 }
385
386 if (self.deviceSelectedOpenMode == 0) {
387 [self sendMeasureErrorEventWithMac:mac errorId:@(RNBGError_FunctionCallOrderError)];
388 return;
389 }
390
391 [self sendEventWithName:EVENT_NOTIFY body:@{
392 kMAC_KEY:mac,
393 kACTION_KEY:kACTION_START_MEASURE,
394 }];
395 }else{
396
397 [self sendNoMatchedDeviceEventWithMac:mac];
398 }
399
400}
401
402#pragma mark 获得离线数据
403RCT_EXPORT_METHOD(getOfflineData:(nonnull NSString *)mac){
404
405 if ([self getDeviceWithMac:mac]) {
406 __weak typeof(self) weakSelf = self;
407 [[self getDeviceWithMac:mac]commandTransferMemorryData:^(NSNumber *dataCount) {
408
409 NSDictionary *deviceInfo = @{@"mac":mac,@"action":kACTION_GET_OFFLINEDATA_COUNT,kGET_OFFLINEDATA_COUNT:dataCount,@"type":@"BG5"};
410
411 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
412 } DisposeBGHistoryData:^(NSDictionary *historyDataDic) {
413
414 NSArray *historyArr = [NSArray arrayWithArray:[historyDataDic objectForKey:@"ResultList"]];
415 NSMutableArray * tempArr = [[NSMutableArray alloc]init];
416
417 for(NSDictionary *history in historyArr) {
418 NSDate *tempDate = [history objectForKey:@"Date"];
419
420 //将时间格式转化成字符串,适配plugin和react native
421 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
422 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
423 NSString *dateStr = [mydateFormatter stringFromDate:tempDate];
424
425 NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:dateStr,@"date",[history objectForKey:@"Result"],@"value",[history objectForKey:@"dataID"],@"dataID", nil];
426
427 [tempArr addObject:dic];
428 }
429
430 NSDictionary*hisDic=[NSDictionary dictionaryWithObjectsAndKeys:tempArr,@"history", nil];
431
432
433 NSDictionary *deviceInfo = @{@"mac":mac,@"action":kACTION_GET_OFFLINEDATA,kGET_OFFLINEDATA:hisDic,@"type":@"BG5"};
434
435 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
436 } DisposeBGErrorBlock:^(NSNumber *errorID) {
437 [weakSelf sendMeasureErrorEventWithMac:mac errorId:errorID];
438 }];
439 }else{
440 [self sendNoMatchedDeviceEventWithMac:mac];
441 }
442}
443
444#pragma mark 删除离线数据
445RCT_EXPORT_METHOD(deleteOfflineData:(nonnull NSString *)mac){
446
447 if ([self getDeviceWithMac:mac]) {
448
449 [[self getDeviceWithMac:mac] commandDeleteMemorryData:^(BOOL deleteOk) {
450
451 [self sendEventWithName:EVENT_NOTIFY body:@{
452 kMAC_KEY:mac,
453 kACTION_KEY:kACTION_DELETE_OFFLINEDATA,
454 }];
455
456 } DisposeBGErrorBlock:^(NSNumber *errorID) {
457
458 }];
459
460
461 }else{
462 [self sendNoMatchedDeviceEventWithMac:mac];
463 }
464}
465
466#pragma mark 发Code信息方法
467RCT_EXPORT_METHOD(setBottleMessageWithInfo:(nonnull NSString *)mac codeMode:(nonnull NSNumber *)codeType measureMode:(nonnull NSNumber *)testType qrCode:(nonnull NSString *)qrCode stripNum:(nonnull NSNumber *)stripNum overDate:(nonnull NSString *)overDate){
468
469
470 if ([self getDeviceWithMac:mac]) {
471 // 检查输入参数是否合法,交给SDK的方法去做,不在原生模块中校验,但是SDK中发码方法没有校验,所以先在RN模块中校验
472 if ((codeType.integerValue == BGCodeMode_GOD) || (codeType.integerValue == BGCodeMode_GDH)) {
473
474 } else {
475 [self sendInputParameterErrorEventWithMac:mac];
476 return;
477 }
478 self.userSelectedMeasureMode = testType.integerValue;
479 //code的截止时期是东八区的时间,String 转 Date
480 NSDateFormatter *dongBaFormatter = [[NSDateFormatter alloc] init];
481 NSTimeZone *dongBaTimeZone = [NSTimeZone timeZoneForSecondsFromGMT:8*60*60];
482 [dongBaFormatter setTimeZone:dongBaTimeZone];
483 [dongBaFormatter setDateFormat:@"yyyy-MM-dd"];
484 NSCalendar *canlendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
485 [dongBaFormatter setCalendar:canlendar];
486 NSDate *dueDate = [dongBaFormatter dateFromString:overDate];//过期时间
487
488 NSDictionary *codeDic = [[self getDeviceWithMac:mac]codeStripStrAnalysis:qrCode];
489 NSNumber *bottleID = [codeDic objectForKey:@"BottleID"];
490
491 __weak typeof(self) weakSelf = self;
492 [[self getDeviceWithMac:mac]commandSendBGCodeWithMeasureType:(BGMeasureMode)testType.integerValue
493 CodeType:(BGCodeMode)codeType.integerValue
494 CodeString:qrCode
495 validDate:dueDate
496 remainNum:stripNum
497 DisposeBGSendCodeBlock:^(BOOL sendOk) {
498 // 发码成功,发送事件
499 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
500 kMAC_KEY:mac,
501 kACTION_KEY:kACTION_SET_BOTTLEMESSAGE,
502 }];
503 } DisposeBGStartModel:^(BGOpenMode mode) {
504 weakSelf.deviceSelectedOpenMode = mode;
505 if (mode == BGOpenMode_Strip) {
506 [[weakSelf getDeviceWithMac:mac]commandCreateBGtestStripInBlock:^{
507 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
508 kMAC_KEY:mac,
509 kACTION_KEY:kACTION_STRIP_IN,
510 }];
511 } DisposeBGBloodBlock:^{
512 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
513 kMAC_KEY:mac,
514 kACTION_KEY:kACTION_GET_BLOOD,
515 }];
516 } DisposeBGResultBlock:^(NSDictionary *result) {
517 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
518 kMAC_KEY:mac,
519 kACTION_KEY:kACTION_ONLINE_RESULT_BG,
520 kONLINE_RESULT_BG:[result objectForKey:@"Result"],
521 kDATA_ID:[result objectForKey:@"dataID"],
522 }];
523
524 } DisposeBGErrorBlock:^(NSNumber *errorID) {
525 [weakSelf sendMeasureErrorEventWithMac:mac errorId:errorID];
526 }];
527 } else {
528 [[weakSelf getDeviceWithMac:mac]commandCreateBGtestModel:(BGMeasureMode)testType.integerValue DisposeBGStripInBlock:^{
529 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
530 kMAC_KEY:mac,
531 kACTION_KEY:kACTION_STRIP_IN,
532 }];
533 } DisposeBGBloodBlock:^{
534 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
535 kMAC_KEY:mac,
536 kACTION_KEY:kACTION_GET_BLOOD,
537 }];
538 } DisposeBGResultBlock:^(NSDictionary *result) {
539 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
540 kMAC_KEY:mac,
541 kACTION_KEY:kACTION_ONLINE_RESULT_BG,
542 kONLINE_RESULT_BG:[result objectForKey:@"Result"],
543 kDATA_ID:[result objectForKey:@"dataID"],
544 }];
545
546 } DisposeBGErrorBlock:^(NSNumber *errorID) {
547 [weakSelf sendMeasureErrorEventWithMac:mac errorId:errorID];
548 }];
549 }
550
551 } DisposeBGErrorBlock:^(NSNumber *errorID) {
552 [weakSelf sendMeasureErrorEventWithMac:mac errorId:errorID];
553 }];
554
555
556
557 }else{
558 [self sendNoMatchedDeviceEventWithMac:mac];
559 }
560}
561
562#pragma mark 读取试条信息
563RCT_EXPORT_METHOD(getBottleMessage:(nonnull NSString *)mac){
564
565 if ([self getDeviceWithMac:mac]) {
566 __weak typeof(self) weakSelf = self;
567 [[self getDeviceWithMac:mac]commandReadBGCodeDic:^(NSDictionary *codeDic) {
568
569 NSDate *tempDate = [codeDic objectForKey:@"Date"];
570 //将时间格式转化成字符串,适配plugin和react native
571 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
572 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
573 NSTimeZone *dongBaTimeZone = [NSTimeZone timeZoneForSecondsFromGMT:8*60*60];
574 [mydateFormatter setTimeZone:dongBaTimeZone];
575 NSString *dateStr = [mydateFormatter stringFromDate:tempDate];
576
577 [self sendEventWithName:EVENT_NOTIFY body:@{
578 kMAC_KEY:mac,
579 kACTION_KEY:kACTION_GET_BOTTLEMESSAGE,
580 kGET_EXPIRECTIME:dateStr,
581 kGET_USENUM:[codeDic objectForKey:@"Strips"],
582 }];
583 } DisposeBGErrorBlock:^(NSNumber *errorID) {
584 [weakSelf sendMeasureErrorEventWithMac:mac errorId:errorID];
585 }];
586
587 }else{
588
589 [self sendNoMatchedDeviceEventWithMac:mac];
590
591 }
592
593}
594
595#pragma mark 设置试条信息
596RCT_EXPORT_METHOD(setBottleId:(nonnull NSString *)mac bottleId:(nonnull NSString *)bottleId){
597 if ([self getDeviceWithMac:mac]) {
598 __weak typeof(self) weakSelf = self;
599
600 [[self getDeviceWithMac:mac] commandSendBottleID:bottleId.longLongValue DisposeBGSendBottleIDBlock:^(BOOL sendOk) {
601 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
602 kMAC_KEY:mac,
603 kACTION_KEY:kACTION_SET_BOTTLEID,
604 }];
605 } DisposeBGErrorBlock:^(NSNumber *errorID) {
606 [weakSelf sendMeasureErrorEventWithMac:mac errorId:errorID];
607 }];
608 } else {
609 [self sendNoMatchedDeviceEventWithMac:mac];
610 }
611}
612
613#pragma mark 断开连接
614RCT_EXPORT_METHOD(disConnect:(nonnull NSString *)mac){
615 [self sendMeasureErrorEventWithMac:mac errorId:@(RNBGError_DisconnectFunctionNotSupportIniOSPlatform)];
616}
617
618#pragma mark 二维码解析
619RCT_EXPORT_METHOD(getBottleInfoFromQR:(NSString *)qrCode){
620 BG5 *bg = [BG5 new];
621 NSDictionary *codeDic = [bg codeStripStrAnalysis:qrCode];
622 if (codeDic) {
623
624 NSDate *tempDate = [codeDic objectForKey:@"DueDate"];
625
626
627 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
628 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
629 NSString *dateStr = [mydateFormatter stringFromDate:tempDate];
630
631 [self sendEventWithName:EVENT_NOTIFY body:@{
632 kACTION_KEY:kACTION_CODE_ANALYSIS,
633 kSTRIP_NUM_BG:codeDic[@"StripNum"],
634 kSTRIP_EXPIRETIME_BG:dateStr,
635 kBOTTLEID_BG:[NSString stringWithFormat:@"%@",codeDic[@"BottleID"]],// String
636 }];
637 } else {
638 [self sendMeasureErrorEventWithMac:nil errorId:@(RNBGError_getBottleInfoFromQRFunctionInpurParameterError)];
639 }
640
641}
642
643@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SModule.h
new file mode 100755
index 0000000..0d7b0fd
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SModule.h
@@ -0,0 +1,19 @@
1//
2// BG5SModule.h
3// ReactNativeIOSLibrary
4//
5// Created by soso on 2019/4/24.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTEventEmitter.h>
12#else
13#import "RCTEventEmitter.h"
14#endif
15
16@interface BG5SModule : RCTEventEmitter<RCTBridgeModule>
17
18@end
19
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SModule.m
new file mode 100644
index 0000000..0857956
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SModule.m
@@ -0,0 +1,529 @@
1//
2// BG5SModule.m
3// ReactNativeIOSLibrary
4//
5// Created by soso on 2019/4/24.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import "BG5SModule.h"
10
11#import "BG5SProfileModule.h"
12#import "BGMacroFile.h"
13#import "BG5SController.h"
14#import "BG5S.h"
15#import "ManageDeviceController.h"
16
17
18#define EVENT_NOTIFY @"event_notify_bg5s"
19#define kMAC_KEY @"mac"
20#define kACTION_KEY @"action"
21
22#define kFUNCTION_BatteryValue @"batteryValue"
23#define kFUNCTION_DeviceDate @"deviceDate"
24#define kFUNCTION_DeviceTimeZone @"deviceTimeZone"
25#define kFUNCTION_StripUsedValue @"stripUsedValue"
26#define kFUNCTION_OfflineDataQuantity @"offlineDataQuantity"
27#define kFUNCTION_BloodCodeVersion @"bloodCodeVersion"
28#define kFUNCTION_CtlCodeVersion @"ctlCodeVersion"
29#define kFUNCTION_Unit @"unit"
30
31
32@interface BG5SModule ()<BG5SDelegate>
33@property (nonatomic, assign) BOOL isMeasuring;
34
35@end
36@implementation BG5SModule
37RCT_EXPORT_MODULE()
38- (NSArray<NSString *> *)supportedEvents {
39 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
40 @"event_device_connected", @"event_device_connect_failed",
41 @"event_device_disconnect", @"event_authenticate_result",
42 @"event_notify_ts28b", @"event_notify_bg1",
43 @"action_connect_result_for_bg1"];
44}
45
46
47- (NSDictionary *)constantsToExport
48{
49 return @{ @"Event_Notify": EVENT_NOTIFY };
50}
51
52+ (BOOL)requiresMainQueueSetup
53{
54 return YES;
55}
56
57
58-(BG5S*)getDeviceWithMac:(NSString*)mac{
59
60 BG5SController *controller = [BG5SController sharedController];
61 NSArray *bgDeviceArray = [controller getAllCurrentInstace];
62
63 for(BG5S *tempDevice in bgDeviceArray){
64 if([mac isEqualToString:tempDevice.serialNumber]){
65 tempDevice.delegate = self;
66 return tempDevice;
67 }
68 }
69 return nil;
70}
71
72RCT_EXPORT_METHOD(getAllConnectedDevices){
73
74
75 NSArray*bgDeviceArray= [[BG5SController sharedController] getAllCurrentInstace];
76
77 NSMutableArray*deviceMacArray=[NSMutableArray array];
78
79 for (int i=0; i<[bgDeviceArray count]; i++) {
80
81 BG5S *bg5s = [bgDeviceArray objectAtIndex:i];
82
83 [deviceMacArray addObject:bg5s.serialNumber];
84
85 }
86
87 NSDictionary* deviceInfo = @{kACTION_KEY:@"ACTION_GET_ALL_CONNECTED_DEVICES",@"devices":deviceMacArray};
88
89 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
90}
91
92
93//综合查询
94RCT_EXPORT_METHOD(getStatusInfo:(nonnull NSString *)mac){
95
96 if ([self getDeviceWithMac:mac]!=nil) {
97 __weak typeof(self) weakSelf = self;
98 [[self getDeviceWithMac:mac] queryStateInfoWithSuccess:^(BG5SStateInfo *stateInfo) {
99
100
101 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
102 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
103 NSString *dateStr = [mydateFormatter stringFromDate:stateInfo.deviceDate];
104
105 NSDictionary* response = @{
106 kMAC_KEY:mac,
107 kACTION_KEY:kACTION_GET_STATUS_INFO,
108 INFO_BATTERY_LEVEL:@(stateInfo.batteryValue),
109 INFO_TIME:dateStr,
110 INFO_TIMEZONE:@(stateInfo.deviceTimeZone),
111 INFO_USED_STRIP:@(stateInfo.stripUsedValue),
112 INFO_OFFLINE_DATA_NUM:@(stateInfo.offlineDataQuantity),
113 INFO_CODE_VERSION_BLOOD:@(stateInfo.bloodCodeVersion),
114 INFO_CODE_VERSION_CTL:@(stateInfo.ctlCodeVersion),
115 INFO_UNIT:(stateInfo.unit == BGUnit_mmolPL)?@"mmol":((stateInfo.unit == BGUnit_mgPmL)?@"mg":@"unknown"),
116 };
117
118 [weakSelf sendEventWithName:EVENT_NOTIFY body:response];
119
120
121 } errorBlock:^(BG5SError error, NSString *detailInfo) {
122 [weakSelf sendMeasureErrorEventWithMac:mac errorId:error];
123 }];
124 }else{
125 [self sendNoMatchedDeviceEventWithMac:mac];
126 }
127}
128
129//同步时间
130RCT_EXPORT_METHOD(setTime:(nonnull NSString *)mac date:(nonnull NSString *)date timezone:(nonnull NSNumber *)timezone){
131 if ([self getDeviceWithMac:mac]) {
132
133
134 NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
135
136 [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
137
138 NSDate*mydate=[dateFormatter dateFromString:date];
139
140
141 __weak typeof(self) weakSelf = self;
142 [[self getDeviceWithMac:mac] setTimeWithDate:mydate timezone:[timezone floatValue] successBlock:^{
143 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
144 kMAC_KEY:mac,
145 kACTION_KEY:kACTION_SET_TIME,
146 }];
147 } errorBlock:^(BG5SError error, NSString *detailInfo) {
148 [weakSelf sendMeasureErrorEventWithMac:mac errorId:error];
149 }];
150 }else{
151 [self sendNoMatchedDeviceEventWithMac:mac];
152 }
153}
154
155////同步时间
156//RCT_EXPORT_METHOD(setTime:(nonnull NSString *)mac){
157// if ([self getDeviceWithMac:mac]) {
158//
159// __weak typeof(self) weakSelf = self;
160//
161// NSString *zone = [[NSTimeZone systemTimeZone] description];
162// NSString *time = [[zone componentsSeparatedByString:@"offset "] objectAtIndex:1];
163// float floatTimeZone = time.floatValue/3600;
164//
165// [[self getDeviceWithMac:mac] setTimeWithDate:[NSDate date] timezone:floatTimeZone successBlock:^{
166// [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
167// kMAC_KEY:mac,
168// kACTION_KEY:kACTION_SET_TIME,
169// }];
170// } errorBlock:^(BG5SError error, NSString *detailInfo) {
171// [weakSelf sendMeasureErrorEventWithMac:mac errorId:error];
172// }];
173// }else{
174// [self sendNoMatchedDeviceEventWithMac:mac];
175// }
176//}
177
178//设置单位
179RCT_EXPORT_METHOD(setUnit:(nonnull NSString *)mac type:(nonnull NSNumber *)type){
180 if ([self getDeviceWithMac:mac]) {
181
182 BGUnit tempUnit = BGUnit_mmolPL;
183 if ([type isEqual:@(BGUnit_mmolPL)]) {
184 tempUnit = BGUnit_mmolPL;
185 } else if([type isEqual:@(BGUnit_mgPmL)]) {
186 tempUnit = BGUnit_mgPmL;
187 } else {
188 [self sendNoMatchedDeviceEventWithMac:mac];
189 return;
190 }
191 __weak typeof(self) weakSelf = self;
192
193 [[self getDeviceWithMac:mac] setUnit:tempUnit successBlock:^{
194 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
195 kMAC_KEY:mac,
196 kACTION_KEY:kACTION_SET_UNIT,
197 }];
198 } errorBlock:^(BG5SError error, NSString *detailInfo) {
199 [weakSelf sendMeasureErrorEventWithMac:mac errorId:error];
200
201 }];
202
203 }else{
204 [self sendNoMatchedDeviceEventWithMac:mac];
205 }
206}
207
208//设置离线模式 Is offline measurement allowed 0:allowed 1:Offline measurement is not allowed
209RCT_EXPORT_METHOD(setOfflineModel:(nonnull NSString *)mac type:(nonnull NSNumber *)type){
210 if ([self getDeviceWithMac:mac]) {
211
212 BOOL modelType=YES;
213
214 if ([type intValue]==0) {
215 modelType=NO;
216 }else{
217
218 modelType=YES;
219 }
220
221
222 __weak typeof(self) weakSelf = self;
223
224
225 [[self getDeviceWithMac:mac] setIsOfflineMeasurementAllowed:modelType successBlock:^{
226 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
227 kMAC_KEY:mac,
228 kACTION_KEY:kACTION_SET_OFFINEMODEL,
229 }];
230 } errorBlock:^(BG5SError error, NSString *detailInfo) {
231
232 [weakSelf sendMeasureErrorEventWithMac:mac errorId:error];
233 }];
234
235 }else{
236 [self sendNoMatchedDeviceEventWithMac:mac];
237 }
238}
239
240
241//删除试条使用条数
242RCT_EXPORT_METHOD(deleteUsedStrip:(nonnull NSString *)mac){
243 if ([self getDeviceWithMac:mac]) {
244 __weak typeof(self) weakSelf = self;
245 [[self getDeviceWithMac:mac] deleteStripUsedInfoWithSuccessBlock:^{
246 [self sendEventWithName:EVENT_NOTIFY body:@{
247 kMAC_KEY:mac,
248 kACTION_KEY:kACTION_DELETE_USED_STRIP,
249 }];
250 } errorBlock:^(BG5SError error, NSString *detailInfo) {
251 [weakSelf sendMeasureErrorEventWithMac:mac errorId:error];
252 }];
253 }else{
254 [self sendNoMatchedDeviceEventWithMac:mac];
255 }
256}
257
258//删除离线数据
259RCT_EXPORT_METHOD(deleteOfflineData:(nonnull NSString *)mac){
260 if ([self getDeviceWithMac:mac]) {
261 __weak typeof(self) weakSelf = self;
262 [[self getDeviceWithMac:mac] deleteRecordWithSuccessBlock:^{
263 [self sendEventWithName:EVENT_NOTIFY body:@{
264 kMAC_KEY:mac,
265 kACTION_KEY:kACTION_DELETE_OFFLINE_DATA,
266 }];
267 } errorBlock:^(BG5SError error, NSString *detailInfo) {
268 [weakSelf sendMeasureErrorEventWithMac:mac errorId:error];
269
270 }];
271 }else{
272 [self sendNoMatchedDeviceEventWithMac:mac];
273 }
274}
275
276
277//同步离线数据
278RCT_EXPORT_METHOD(getOfflineData:(nonnull NSString *)mac){
279
280 if ([self getDeviceWithMac:mac]) {
281 __weak typeof(self) weakSelf = self;
282 [[self getDeviceWithMac:mac] queryRecordWithSuccessBlock:^(NSArray *array) {
283
284 NSMutableArray * tempArr = [[NSMutableArray alloc]init];
285
286 for(BG5SRecordModel *model in array) {
287 NSDate *tempDate = model.measureDate;
288 BOOL flag = model.canCorrect;
289
290 //将时间格式转化成字符串,适配plugin和react native
291 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
292 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
293 NSString *dateStr = [mydateFormatter stringFromDate:tempDate];
294
295 NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:dateStr,@"data_measure_time",@(model.value),@"data_value",model.dataID,@"dataID",@(model.timeZone),@"data_measure_timezone",flag,@"data_time_proof", nil];
296
297 [tempArr addObject:dic];
298 }
299
300 NSDictionary*hisDic=[NSDictionary dictionaryWithObjectsAndKeys:tempArr,@"history", nil];
301
302
303 NSDictionary *deviceInfo = @{@"mac":mac,@"action":kACTION_GET_OFFLINE_DATA,kGET_OFFLINEDATA:hisDic,@"type":@"BG5S"};
304
305 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
306
307 } errorBlock:^(BG5SError error, NSString *detailInfo) {
308 [weakSelf sendMeasureErrorEventWithMac:mac errorId:error];
309 }];
310 }else{
311 [self sendNoMatchedDeviceEventWithMac:mac];
312
313 }
314}
315
316
317//开始测量
318RCT_EXPORT_METHOD(startMeasure:(nonnull NSString *)mac type:(nonnull NSNumber *)type){
319 if ([self getDeviceWithMac:mac]) {
320 __weak typeof(self) weakSelf = self;
321
322 BGMeasureMode measureMode = BGMeasureMode_Blood;
323 if ([type isEqual:@(BGMeasureMode_Blood)]) {
324 measureMode = BGMeasureMode_Blood;
325 } else if([type isEqual:@(BGMeasureMode_NoBlood)]) {
326 measureMode = BGMeasureMode_NoBlood;
327 } else {
328 [self sendNoMatchedDeviceEventWithMac:mac];
329 return;
330 }
331
332 [[self getDeviceWithMac:mac] startMeasure:measureMode withSuccessBlock:^{
333 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
334 kMAC_KEY:mac,
335 kACTION_KEY:kACTION_START_MEASURE,
336 }];
337 } errorBlock:^(BG5SError error, NSString *detailInfo) {
338 [weakSelf sendMeasureErrorEventWithMac:mac errorId:error];
339
340 }];
341 }else{
342 [self sendNoMatchedDeviceEventWithMac:mac];
343 }
344}
345
346- (void)device:(BG5S *)device occurError:(BG5SError)error errorDescription:(NSString *)errorDescription{
347 NSLog(@"下位机主发的错误信息:%d",(int)error);
348 [self sendMeasureErrorEventWithMac:device.serialNumber errorId:error];
349
350}
351- (void)device:(BG5S *)device stripStateDidUpdate:(BG5SStripState)state{
352 NSLog(@"试条状态:%@",(state == BG5SStripState_Insert)?@"插入":@"拔出");
353
354 if (state == BG5SStripState_Insert) {
355 [self sendEventWithName:EVENT_NOTIFY body:@{
356 kMAC_KEY:device.serialNumber,
357 kACTION_KEY:kACTION_STRIP_IN,
358 }];
359 }else{
360 [self sendEventWithName:EVENT_NOTIFY body:@{
361 kMAC_KEY:device.serialNumber,
362 kACTION_KEY:kACTION_STRIP_OUT,
363 }];
364 }
365
366
367}
368- (void)deviceDropBlood:(BG5S *)device{
369 NSLog(@"滴血");
370 [self sendEventWithName:EVENT_NOTIFY body:@{
371 kMAC_KEY:device.serialNumber,
372 kACTION_KEY:kACTION_GET_BLOOD,
373 }];
374}
375- (void)device:(BG5S *)device dataID:(NSString *)dataID measureReult:(NSInteger)result{
376 NSLog(@"结果:%d",(int)result);
377// NSDictionary *resultDic = [NSDictionary dictionaryWithObjectsAndKeys:@(result),@"value",dataID,@"dataID", nil];
378
379 [self sendEventWithName:EVENT_NOTIFY body:@{
380 kMAC_KEY:device.serialNumber,
381 RESULT_VALUE:@(result),
382 kDATA_ID:dataID,
383
384 kACTION_KEY:kACTION_RESULT,
385 }];
386}
387- (void)device:(BG5S *)device chargeStateDidUpdate:(BG5SChargeState)state{
388 NSLog(@"充电线状态:%@",(state == BG5SChargeState_Charging)?@"插入":@"拔出");
389
390 if (state == BG5SChargeState_Charging) {
391 [self sendEventWithName:EVENT_NOTIFY body:@{
392 kMAC_KEY:device.serialNumber,
393 kACTION_KEY:kACTION_ENTER_CHARGED_STATE,
394 }];
395 }else{
396 [self sendEventWithName:EVENT_NOTIFY body:@{
397 kMAC_KEY:device.serialNumber,
398 kACTION_KEY:kACTION_LEAVE_CHARGED_STATE,
399 }];
400
401 }
402
403}
404
405
406//断开连接
407RCT_EXPORT_METHOD(disConnect:(nonnull NSString *)mac){
408 if ([self getDeviceWithMac:mac]!=nil) {
409
410 [[self getDeviceWithMac:mac] disconnectDevice];
411 }else{
412
413 }
414}
415
416//开始离线数据修正
417RCT_EXPORT_METHOD(adjustOfflineData:(nonnull NSString *)mac timeString:(nonnull NSString *)timeString array:(nonnull NSArray *)array ){
418 if ([self getDeviceWithMac:mac]!=nil) {
419
420 if (array.count > 0 ) {
421 NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
422 [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
423 NSDate *date = [formatter dateFromString:timeString];
424
425 NSArray *correctArray = [[self getDeviceWithMac:mac] processData:array deviceDate:date];
426 }
427
428 [self sendEventWithName:EVENT_NOTIFY body:@{
429 kMAC_KEY:mac,
430 kACTION_KEY:kACTION_ADJUST_OFFLINE_DATA,
431 }];
432
433 }else{
434 [self sendNoMatchedDeviceEventWithMac:mac];
435
436 }
437}
438
439- (void)sendMeasureErrorEventWithMac:(NSString *)mac errorId:(BG5SError)errorId{
440
441
442 NSString *errorDescription = @"";
443
444 switch (errorId) {
445 case 0:
446 errorDescription = @"Only showed in BG5S's screen and need charging.";
447 break;
448 case 1:
449 errorDescription = @"Strip removed in the middle of reading, repeat the test with a new strip.";
450 break;
451 case 2:
452 errorDescription = @"Reference voltage error, not normal measurement, please repeat the test.";
453 break;
454 case 3:
455 errorDescription = @"Strip is used or unknown moisture detected, discard the test strip and repeat the test with a new strip.";
456 break;
457 case 4:
458 errorDescription = @"Reading transmission error. Repeat the test with a new test strip. If the problem persists, contact iHealth customer service for assistance.";
459 break;
460 case 5:
461 errorDescription = @"The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.";
462 break;
463 case 6:
464 errorDescription = @"The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.";
465 break;
466 case 7:
467 errorDescription = @"Only showed in BG5S's screen.";
468 break;
469 case 8:
470 errorDescription = @"Glucose test result is low.";
471 break;
472 case 9:
473 errorDescription = @"Glucose test result is high.";
474 break;
475 case 10:
476 errorDescription = @"Reset and if the problem persists, contact iHealth customer service for assistance.";
477 break;
478 case 400:
479 errorDescription = @"arameter input error.";
480 break;
481 case 401:
482 errorDescription = @"Quantity not match";
483 break;
484 case 402:
485 errorDescription = @"Single packet is not full.";
486 break;
487 case 403:
488 errorDescription = @"Packet index not match.";
489 break;
490 case 500:
491 errorDescription = @"Command timeout";
492 break;
493 case 501:
494 errorDescription = @"Command is not supported for current device.";
495 break;
496 default:
497 break;
498 }
499
500 [self sendEventWithName:EVENT_NOTIFY body:@{
501 kMAC_KEY:mac,
502 kACTION_KEY:kACTION_ERROR_BG,
503 kERROR_NUM_BG:@(errorId),
504 kERROR_DESCRIPTION_BG:errorDescription
505 }];
506}
507
508
509- (void)sendNoMatchedDeviceEventWithMac:(NSString *)mac{
510 if (mac && mac.length > 0) {
511 [self sendEventWithName:EVENT_NOTIFY body:@{
512 kMAC_KEY:mac,
513 kACTION_KEY:kACTION_ERROR_BG,
514 kERROR_NUM_BG:@100
515 }];
516 } else {
517 [self sendEventWithName:EVENT_NOTIFY body:@{
518 kACTION_KEY:kACTION_ERROR_BG,
519
520 kERROR_NUM_BG:@100,
521 kERROR_DESCRIPTION_BG:@"Device disconnect."
522
523 }];
524 }
525}
526
527
528
529@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SProfileModule.h
new file mode 100644
index 0000000..e26770a
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SProfileModule.h
@@ -0,0 +1,85 @@
1//
2// BG5SProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by soso on 2019/4/24.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15
16
17// Commom in BG5Module.js & BG5LModule.js
18#define kACTION_ERROR_BG @"ACTION_ERROR_BG"
19#define kACTION_GET_STATUS_INFO @"ACTION_GET_STATUS_INFO"
20#define kACTION_SET_TIME @"ACTION_SET_TIME"
21#define kACTION_SET_UNIT @"ACTION_SET_UNIT"
22#define kACTION_GET_BATTERY @"ACTION_GET_BATTERY"
23#define kACTION_START_MEASURE @"ACTION_START_MEASURE"
24#define kACTION_GET_OFFLINEDATA_COUNT @"ACTION_GET_OFFLINEDATA_COUNT"
25#define kACTION_GET_OFFLINE_DATA @"ACTION_GET_OFFLINE_DATA"
26#define kACTION_DELETE_OFFLINE_DATA @"ACTION_DELETE_OFFLINE_DATA"
27#define kACTION_SET_BOTTLEMESSAGE @"ACTION_SET_BOTTLEMESSAGE"
28#define kACTION_GET_BOTTLEMESSAGE @"ACTION_GET_BOTTLEMESSAGE"
29#define kACTION_SET_BOTTLEID @"ACTION_SET_BOTTLEID"
30#define kACTION_GET_BOTTLEID @"ACTION_GET_BOTTLEID"
31#define kACTION_STRIP_IN @"ACTION_STRIP_IN"
32#define kACTION_STRIP_OUT @"ACTION_STRIP_OUT"
33#define kACTION_GET_BLOOD @"ACTION_GET_BLOOD"
34#define kACTION_ONLINE_RESULT_BG @"ACTION_ONLINE_RESULT_BG"
35#define kACTION_ADJUST_OFFLINE_DATA @"ACTION_ADJUST_OFFLINE_DATA"
36#define kACTION_DELETE_USED_STRIP @"ACTION_DELETE_USED_STRIP"
37
38
39
40#define kERROR_NUM_BG @"ERROR_NUM_BG"
41#define kERROR_DESCRIPTION_BG @"ERROR_DESCRIPTION_BG"
42#define kGET_BATTERY @"GET_BATTERY"
43#define kGET_OFFLINEDATA_COUNT @"GET_OFFLINEDATA_COUNT"
44#define kGET_OFFLINEDATA @"GET_OFFLINEDATA"
45#define kSET_BOTTLEMESSAGE @"SET_BOTTLEMESSAGE"
46#define kSTART_MODE @"START_MODE"
47#define kGET_EXPIRECTIME @"GET_EXPIRECTIME"
48#define kGET_USENUM @"GET_USENUM"
49#define kGET_BOTTLEID @"GET_BOTTLEID"
50#define kONLINE_RESULT_BG @"ONLINE_RESULT_BG"
51#define kDATA_ID @"DATA_ID"
52#define kACTION_CODE_ANALYSIS @"ACTION_CODE_ANALYSIS"
53#define kSTRIP_NUM_BG @"STRIP_NUM_BG"
54#define kSTRIP_EXPIRETIME_BG @"STRIP_EXPIRETIME_BG"
55#define kBOTTLEID_BG @"BOTTLEID_BG"
56#define kACTION_GET_ALL_CONNECTED_DEVICES @"ACTION_GET_ALL_CONNECTED_DEVICES"
57#define kACTION_RESULT @"ACTION_RESULT"
58#define kACTION_ENTER_CHARGED_STATE @"ACTION_ENTER_CHARGED_STATE"
59#define kACTION_LEAVE_CHARGED_STATE @"ACTION_LEAVE_CHARGED_STATE"
60
61#define INFO_BATTERY_LEVEL @"INFO_BATTERY_LEVEL"
62#define INFO_TIME @"INFO_TIME"
63#define INFO_TIMEZONE @"INFO_TIMEZONE"
64#define INFO_USED_STRIP @"INFO_USED_STRIP"
65#define INFO_OFFLINE_DATA_NUM @"INFO_OFFLINE_DATA_NUM"
66#define INFO_CODE_VERSION_BLOOD @"INFO_CODE_VERSION_BLOOD"
67#define INFO_CODE_VERSION_CTL @"INFO_CODE_VERSION_CTL"
68#define INFO_UNIT @"INFO_UNIT"
69#define RESULT_VALUE @"RESULT_VALUE"
70#define kACTION_SET_OFFINEMODEL @"ACTION_SET_OFFINEMODEL"
71
72typedef NS_ENUM(NSInteger,RNBGError) {
73 RNBGError_Unknown = -1,
74 RNBGError_InputParameterError = 400,
75 RNBGError_FunctionCallOrderError = 402,
76 RNBGError_MeasureModeNotMatched = 403,
77 RNBGError_DisconnectFunctionNotSupportIniOSPlatform = 404, // only for BG5s
78 RNBGError_getBottleInfoFromQRFunctionInpurParameterError = 405,
79};
80
81@interface BG5SProfileModule : NSObject<RCTBridgeModule>
82
83@end
84
85
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SProfileModule.m
new file mode 100644
index 0000000..a80fcd2
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BG5SProfileModule.m
@@ -0,0 +1,84 @@
1//
2// BG5SProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by soso on 2019/4/24.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import "BG5SProfileModule.h"
10#import "RNBGMacro.h"
11
12@implementation BG5SProfileModule
13
14
15RCT_EXPORT_MODULE()
16
17#pragma mark
18#pragma mark - constantsToExport
19
20
21- (NSDictionary *)constantsToExport
22{
23
24
25
26 return @{
27 @"Event_Notify":@"event_notify_bg5s",
28 kRN_ACTION_ERROR_BG :kACTION_ERROR_BG,
29 kRN_ACTION_SET_TIME :kACTION_SET_TIME,
30 kRN_ACTION_SET_UNIT :kACTION_SET_UNIT,
31 kRN_ACTION_GET_BATTERY :kACTION_GET_BATTERY,
32 kRN_ACTION_START_MEASURE :kACTION_START_MEASURE,
33 kRN_ACTION_GET_OFFLINEDATA_COUNT :kACTION_GET_OFFLINEDATA_COUNT,
34 kRN_ACTION_GET_OFFLINE_DATA :kACTION_GET_OFFLINE_DATA,
35 kRN_ACTION_DELETE_OFFLINE_DATA :kACTION_DELETE_OFFLINE_DATA,
36 kRN_ACTION_SET_BOTTLEMESSAGE :kACTION_SET_BOTTLEMESSAGE,
37 kRN_ACTION_GET_BOTTLEMESSAGE :kACTION_GET_BOTTLEMESSAGE,
38 kRN_ACTION_SET_BOTTLEID :kACTION_SET_BOTTLEID,
39 kRN_ACTION_GET_BOTTLEID :kACTION_GET_BOTTLEID,
40 kRN_ACTION_STRIP_IN :kACTION_STRIP_IN,
41 kRN_ACTION_STRIP_OUT :kACTION_STRIP_OUT,
42 kRN_ACTION_GET_BLOOD :kACTION_GET_BLOOD,
43 kRN_ACTION_ONLINE_RESULT_BG :kACTION_ONLINE_RESULT_BG,
44 kRN_ACTION_CODE_ANALYSIS :kACTION_CODE_ANALYSIS,
45 kRN_ACTION_GET_ALL_CONNECTED_DEVICES :kACTION_GET_ALL_CONNECTED_DEVICES,
46 kRN_ERROR_NUM_BG :kERROR_NUM_BG,
47 kRN_ERROR_DESCRIPTION_BG :kERROR_DESCRIPTION_BG,
48 kRN_GET_BATTERY :kGET_BATTERY,
49 kRN_GET_OFFLINEDATA_COUNT :kGET_OFFLINEDATA_COUNT,
50 kRN_GET_OFFLINEDATA :kGET_OFFLINEDATA,
51 kRN_SET_BOTTLEMESSAGE :kSET_BOTTLEMESSAGE,
52 kRN_START_MODE :kSTART_MODE,
53 kRN_GET_EXPIRECTIME :kGET_EXPIRECTIME,
54 kRN_GET_USENUM :kGET_USENUM,
55 kRN_GET_BOTTLEID :kGET_BOTTLEID,
56 kRN_ONLINE_RESULT_BG :kONLINE_RESULT_BG,
57 kRN_DATA_ID :kDATA_ID,
58 kRN_STRIP_NUM_BG :kSTRIP_NUM_BG,
59 kRN_STRIP_EXPIRETIME_BG :kSTRIP_EXPIRETIME_BG,
60 kRN_BOTTLEID_BG :kBOTTLEID_BG,
61 kRN_ACTION_DELETE_USED_STRIP :kACTION_DELETE_USED_STRIP,
62 kRN_ACTION_ADJUST_OFFLINE_DATA :kACTION_ADJUST_OFFLINE_DATA,
63 INFO_BATTERY_LEVEL :INFO_BATTERY_LEVEL,
64 INFO_TIME :INFO_TIME,
65 INFO_TIMEZONE :INFO_TIMEZONE,
66 INFO_USED_STRIP :INFO_USED_STRIP,
67 INFO_OFFLINE_DATA_NUM :INFO_OFFLINE_DATA_NUM,
68 INFO_CODE_VERSION_BLOOD :INFO_CODE_VERSION_BLOOD,
69 INFO_CODE_VERSION_CTL :INFO_CODE_VERSION_CTL,
70 INFO_UNIT :INFO_UNIT,
71 kACTION_RESULT :kACTION_RESULT,
72 RESULT_VALUE :RESULT_VALUE,
73 kACTION_ENTER_CHARGED_STATE :kACTION_ENTER_CHARGED_STATE,
74 kACTION_LEAVE_CHARGED_STATE :kACTION_LEAVE_CHARGED_STATE,
75 kACTION_SET_OFFINEMODEL:kACTION_SET_OFFINEMODEL,
76 };
77};
78
79
80+ (BOOL)requiresMainQueueSetup
81{
82 return YES;
83}
84@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BGProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BGProfileModule.h
new file mode 100755
index 0000000..0c6f3b0
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BGProfileModule.h
@@ -0,0 +1,65 @@
1//
2// BGProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15
16
17// Commom in BG5Module.js & BG5LModule.js
18#define kACTION_ERROR_BG @"ACTION_ERROR_BG"
19#define kACTION_KEEP_LINK @"ACTION_KEEP_LINK"
20#define kACTION_SET_TIME @"ACTION_SET_TIME"
21#define kACTION_SET_UNIT @"ACTION_SET_UNIT"
22#define kACTION_GET_BATTERY @"ACTION_GET_BATTERY"
23#define kACTION_START_MEASURE @"ACTION_START_MEASURE"
24#define kACTION_GET_OFFLINEDATA_COUNT @"ACTION_GET_OFFLINEDATA_COUNT"
25#define kACTION_GET_OFFLINEDATA @"ACTION_GET_OFFLINEDATA"
26#define kACTION_DELETE_OFFLINEDATA @"ACTION_DELETE_OFFLINEDATA"
27#define kACTION_SET_BOTTLEMESSAGE @"ACTION_SET_BOTTLEMESSAGE"
28#define kACTION_GET_BOTTLEMESSAGE @"ACTION_GET_BOTTLEMESSAGE"
29#define kACTION_SET_BOTTLEID @"ACTION_SET_BOTTLEID"
30#define kACTION_GET_BOTTLEID @"ACTION_GET_BOTTLEID"
31#define kACTION_STRIP_IN @"ACTION_STRIP_IN"
32#define kACTION_STRIP_OUT @"ACTION_STRIP_OUT"
33#define kACTION_GET_BLOOD @"ACTION_GET_BLOOD"
34#define kACTION_ONLINE_RESULT_BG @"ACTION_ONLINE_RESULT_BG"
35#define kACTION_CODE_ANALYSIS @"ACTION_CODE_ANALYSIS"
36#define kACTION_GET_ALL_CONNECTED_DEVICES @"ACTION_GET_ALL_CONNECTED_DEVICES"
37
38#define kERROR_NUM_BG @"ERROR_NUM_BG"
39#define kERROR_DESCRIPTION_BG @"ERROR_DESCRIPTION_BG"
40#define kGET_BATTERY @"GET_BATTERY"
41#define kGET_OFFLINEDATA_COUNT @"GET_OFFLINEDATA_COUNT"
42#define kGET_OFFLINEDATA @"GET_OFFLINEDATA"
43#define kSET_BOTTLEMESSAGE @"SET_BOTTLEMESSAGE"
44#define kSTART_MODE @"START_MODE"
45#define kGET_EXPIRECTIME @"GET_EXPIRECTIME"
46#define kGET_USENUM @"GET_USENUM"
47#define kGET_BOTTLEID @"GET_BOTTLEID"
48#define kONLINE_RESULT_BG @"ONLINE_RESULT_BG"
49#define kDATA_ID @"DATA_ID"
50#define kSTRIP_NUM_BG @"STRIP_NUM_BG"
51#define kSTRIP_EXPIRETIME_BG @"STRIP_EXPIRETIME_BG"
52#define kBOTTLEID_BG @"BOTTLEID_BG"
53
54typedef NS_ENUM(NSInteger,RNBGError) {
55 RNBGError_Unknown = -1,
56 RNBGError_InputParameterError = 400,
57 RNBGError_FunctionCallOrderError = 402,
58 RNBGError_MeasureModeNotMatched = 403,
59 RNBGError_DisconnectFunctionNotSupportIniOSPlatform = 404, // only for BG5
60 RNBGError_getBottleInfoFromQRFunctionInpurParameterError = 405,
61};
62
63@interface BGProfileModule : NSObject<RCTBridgeModule>
64
65@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BGProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BGProfileModule.m
new file mode 100755
index 0000000..fd7a27c
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BGProfileModule.m
@@ -0,0 +1,69 @@
1//
2// BGProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "BGProfileModule.h"
10#import "RNBGMacro.h"
11
12@implementation BGProfileModule
13
14
15RCT_EXPORT_MODULE()
16
17#pragma mark
18#pragma mark - constantsToExport
19
20
21- (NSDictionary *)constantsToExport
22{
23 return @{
24 @"Event_Notify":@"event_notify_bg5",
25 kRN_ACTION_ERROR_BG :kACTION_ERROR_BG,
26 kRN_ACTION_KEEP_LINK :kACTION_KEEP_LINK,
27 kRN_ACTION_SET_TIME :kACTION_SET_TIME,
28 kRN_ACTION_SET_UNIT :kACTION_SET_UNIT,
29 kRN_ACTION_GET_BATTERY :kACTION_GET_BATTERY,
30 kRN_ACTION_START_MEASURE :kACTION_START_MEASURE,
31 kRN_ACTION_GET_OFFLINEDATA_COUNT :kACTION_GET_OFFLINEDATA_COUNT,
32 kRN_ACTION_GET_OFFLINEDATA :kACTION_GET_OFFLINEDATA,
33 kRN_ACTION_DELETE_OFFLINEDATA :kACTION_DELETE_OFFLINEDATA,
34 kRN_ACTION_SET_BOTTLEMESSAGE :kACTION_SET_BOTTLEMESSAGE,
35 kRN_ACTION_GET_BOTTLEMESSAGE :kACTION_GET_BOTTLEMESSAGE,
36 kRN_ACTION_SET_BOTTLEID :kACTION_SET_BOTTLEID,
37 kRN_ACTION_GET_BOTTLEID :kACTION_GET_BOTTLEID,
38 kRN_ACTION_STRIP_IN :kACTION_STRIP_IN,
39 kRN_ACTION_STRIP_OUT :kACTION_STRIP_OUT,
40 kRN_ACTION_GET_BLOOD :kACTION_GET_BLOOD,
41 kRN_ACTION_ONLINE_RESULT_BG :kACTION_ONLINE_RESULT_BG,
42 kRN_ACTION_CODE_ANALYSIS :kACTION_CODE_ANALYSIS,
43 kRN_ACTION_GET_ALL_CONNECTED_DEVICES:kACTION_GET_ALL_CONNECTED_DEVICES,
44
45 kRN_ERROR_NUM_BG :kERROR_NUM_BG,
46 kRN_ERROR_DESCRIPTION_BG :kERROR_DESCRIPTION_BG,
47 kRN_GET_BATTERY :kGET_BATTERY,
48 kRN_GET_OFFLINEDATA_COUNT :kGET_OFFLINEDATA_COUNT,
49 kRN_GET_OFFLINEDATA :kGET_OFFLINEDATA,
50 kRN_SET_BOTTLEMESSAGE :kSET_BOTTLEMESSAGE,
51 kRN_START_MODE :kSTART_MODE,
52 kRN_GET_EXPIRECTIME :kGET_EXPIRECTIME,
53 kRN_GET_USENUM :kGET_USENUM,
54 kRN_GET_BOTTLEID :kGET_BOTTLEID,
55 kRN_ONLINE_RESULT_BG :kONLINE_RESULT_BG,
56 kRN_DATA_ID :kDATA_ID,
57 kRN_STRIP_NUM_BG :kSTRIP_NUM_BG,
58 kRN_STRIP_EXPIRETIME_BG :kSTRIP_EXPIRETIME_BG,
59 kRN_BOTTLEID_BG :kBOTTLEID_BG,
60 };
61};
62
63
64+ (BOOL)requiresMainQueueSetup
65{
66 return YES;
67}
68
69@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP3LModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP3LModule.h
new file mode 100755
index 0000000..afb5df9
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP3LModule.h
@@ -0,0 +1,19 @@
1//
2// BP3LModule.h
3// ReactNativeIOSLibrary
4//
5// Created by Liu Yanbo on 2016/12/05.
6// Copyright © 2016年 Liu Yanbo. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16
17@interface BP3LModule : RCTEventEmitter<RCTBridgeModule>
18
19@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP3LModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP3LModule.m
new file mode 100755
index 0000000..05adb0c
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP3LModule.m
@@ -0,0 +1,226 @@
1//
2// BP3LModule.m
3// ReactNativeIOSLibrary
4//
5// Created by Liu Yanbo on 2016/12/05.
6// Copyright © 2016年 Liu Yanbo. All rights reserved.
7//
8
9#import "BP3LModule.h"
10#import "BPProfileModule.h"
11#import "BPMacroFile.h"
12#import "BP3LController.h"
13#import "BP3L.h"
14#import "iHealthDeviceManagerModule.h"
15
16#import "ScanDeviceController.h"
17#import "ConnectDeviceController.h"
18#define EVENT_NOTIFY @"BP3L.MODULE.NOTIFY"
19
20@interface BP3LModule ()
21@property (nonatomic, assign) BOOL isMeasuring;
22
23@end
24
25@implementation BP3LModule
26RCT_EXPORT_MODULE()
27- (NSArray<NSString *> *)supportedEvents {
28 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
29 @"event_device_connected", @"event_device_connect_failed",
30 @"event_device_disconnect", @"event_authenticate_result",
31 @"event_notify_ts28b", @"event_notify_bg1",
32 @"action_connect_result_for_bg1"];
33}
34
35
36- (NSDictionary *)constantsToExport
37{
38 return @{
39 @"Event_Notify":EVENT_NOTIFY,
40
41 };
42}
43+ (BOOL)requiresMainQueueSetup
44{
45 return YES;
46}
47
48-(BP3L*)getDeviceWithMac:(NSString*)mac{
49
50 BP3LController *controller = [BP3LController shareBP3LController];
51 NSArray *bpDeviceArray = [controller getAllCurrentBP3LInstace];
52
53 for(BP3L *tempDevice in bpDeviceArray){
54 if([mac isEqualToString:tempDevice.serialNumber]){
55
56 return tempDevice;
57 }
58 }
59
60 return nil;
61}
62
63
64#pragma mark - Method
65
66
67#pragma mark-获取连接设备
68RCT_EXPORT_METHOD(getAllConnectedDevices){
69
70
71 NSArray*bp3larray= [[BP3LController shareBP3LController] getAllCurrentBP3LInstace];
72
73 NSMutableArray*deviceMacArray=[NSMutableArray array];
74
75 for (int i=0; i<[bp3larray count]; i++) {
76
77 BP3L*bp3l=[bp3larray objectAtIndex:i];
78
79 [deviceMacArray addObject:bp3l.serialNumber];
80
81 }
82
83 NSDictionary* deviceInfo = @{@"action":@"ACTION_GET_ALL_CONNECTED_DEVICES",@"devices":deviceMacArray};
84
85 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
86
87
88}
89
90
91
92
93RCT_EXPORT_METHOD(startMeasure:(nonnull NSString *)mac){
94
95 if ([self getDeviceWithMac:mac]!=nil) {
96 __weak typeof(self) weakSelf = self;
97
98 [[self getDeviceWithMac:mac] commandStartMeasureWithZeroingState:^(BOOL isComplete) {
99 weakSelf.isMeasuring = YES;
100 NSDictionary* response = @{
101 kACTION:isComplete ? kACTION_ZOREING_BP : kACTION_ZOREOVER_BP,
102 };
103 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
104 } pressure:^(NSArray *pressureArr) {
105 weakSelf.isMeasuring = YES;
106 NSLog(@"pressure %@",pressureArr);
107 NSDictionary* response = @{
108 kACTION:kACTION_ONLINE_PRESSURE_BP,
109 kBLOOD_PRESSURE_BP:pressureArr.firstObject,
110 };
111 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
112 } waveletWithHeartbeat:^(NSArray *waveletArr) {
113 weakSelf.isMeasuring = YES;
114 NSLog(@"xiaoboWithHeart %@",waveletArr);
115 NSDictionary* response = @{
116 kACTION:kACTION_ONLINE_PULSEWAVE_BP,
117 kFLAG_HEARTBEAT_BP:@(1),
118 kPULSEWAVE_BP:waveletArr
119 };
120 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
121 } waveletWithoutHeartbeat:^(NSArray *waveletArr) {
122 weakSelf.isMeasuring = YES;
123 NSLog(@"xiaoboNoHeart %@",waveletArr);
124 NSDictionary* response = @{
125 kACTION:kACTION_ONLINE_PULSEWAVE_BP,
126 kFLAG_HEARTBEAT_BP:@(0),
127 kPULSEWAVE_BP:waveletArr
128 };
129 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
130 } result:^(NSDictionary *resultDict) {
131 weakSelf.isMeasuring = NO;
132 NSLog(@"result %@",resultDict);
133 NSDictionary* response = @{
134 kACTION:kACTION_ONLINE_RESULT_BP,
135 kHIGH_BLOOD_PRESSURE_BP:resultDict[@"sys"],
136 kLOW_BLOOD_PRESSURE_BP:resultDict[@"dia"],
137 kPULSE_BP:resultDict[@"heartRate"],
138 kMEASUREMENT_AHR_BP:resultDict[@"irregular"],
139 kDATAID:resultDict[@"dataID"],
140 };
141 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
142 } errorBlock:^(BPDeviceError error) {
143 weakSelf.isMeasuring = NO;
144 NSLog(@"error %d",error);
145 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
146 }];
147
148 }else{
149 self.isMeasuring = NO;
150 NSLog(@"error %d",BPDidDisconnect);
151 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
152 }
153
154
155}
156
157
158RCT_EXPORT_METHOD(stopMeasure:(nonnull NSString *)mac){
159 if (!self.isMeasuring) {
160 NSLog(@"error %d",401);
161 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:401];
162 return;
163 }
164 __weak typeof(self) weakSelf = self;
165 if ([self getDeviceWithMac:mac]!=nil) {
166 [[self getDeviceWithMac:mac] stopBPMeassureSuccessBlock:^{
167
168 weakSelf.isMeasuring = NO;
169 NSDictionary* response = @{
170 kACTION:kACTION_INTERRUPTED_BP,
171 };
172 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
173
174 } errorBlock:^(BPDeviceError error) {
175
176 NSLog(@"error %d",error);
177 weakSelf.isMeasuring = NO;
178 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
179 }];
180
181
182 }else{
183 weakSelf.isMeasuring = NO;
184 NSLog(@"error %d",BPDidDisconnect);
185 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
186 }
187
188
189}
190
191RCT_EXPORT_METHOD(getBattery:(nonnull NSString *)mac){
192
193 if ([self getDeviceWithMac:mac]!=nil) {
194 __weak typeof(self) weakSelf = self;
195 [[self getDeviceWithMac:mac] commandEnergy:^(NSNumber *energyValue) {
196 NSDictionary* response = @{
197 kACTION:kACTION_BATTERY_BP,
198 kBATTERY_BP:energyValue
199 };
200 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
201 } errorBlock:^(BPDeviceError error) {
202 NSLog(@"error %d",error);
203 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
204 }];
205 }else{
206 NSLog(@"error %d",BPDidDisconnect);
207 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
208 }
209
210
211}
212
213RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
214
215 if ([self getDeviceWithMac:mac]!=nil) {
216 [[self getDeviceWithMac:mac] commandDisconnectDevice];
217 }else{
218 NSLog(@"error %d",BPDidDisconnect);
219 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
220 }
221
222
223}
224
225
226@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP550BTModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP550BTModule.h
new file mode 100755
index 0000000..ab2b804
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP550BTModule.h
@@ -0,0 +1,23 @@
1//
2// BP550BTModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16
17
18@interface BP550BTModule : RCTEventEmitter<RCTBridgeModule>
19{
20
21}
22
23@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP550BTModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP550BTModule.m
new file mode 100755
index 0000000..e8976be
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP550BTModule.m
@@ -0,0 +1,318 @@
1//
2// BP550BTModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "BP550BTModule.h"
10#import "KN550BT.h"
11#import "KN550BTController.h"
12#import "BPProfileModule.h"
13#import "iHealthDeviceManagerModule.h"
14#import "ScanDeviceController.h"
15#import "ConnectDeviceController.h"
16#define EVENT_NOTIFY @"event_notify_bp550bt"
17
18@implementation BP550BTModule
19
20RCT_EXPORT_MODULE()
21- (NSArray<NSString *> *)supportedEvents {
22 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
23 @"event_device_connected", @"event_device_connect_failed",
24 @"event_device_disconnect", @"event_authenticate_result",
25 @"event_notify_ts28b", @"event_notify_bg1",
26 @"action_connect_result_for_bg1"];
27}
28
29
30- (NSDictionary *)constantsToExport
31{
32 return @{
33 @"Event_Notify":EVENT_NOTIFY,
34
35 };
36}
37+ (BOOL)requiresMainQueueSetup
38{
39 return YES;
40}
41#pragma mark
42#pragma mark - Init
43-(id)init
44{
45 if (self=[super init])
46 {
47
48// [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(DeviceConnectForKN550BT:) name:KN550BTConnectNoti object:nil];
49// [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(DeviceDisConnectForKN550BT:) name:KN550BTDisConnectNoti object:nil];
50
51 [KN550BTController shareKN550BTController];
52
53 }
54 return self;
55}
56
57
58-(KN550BT*)getDeviceWithMac:(NSString*)mac{
59
60 KN550BTController *controller = [KN550BTController shareKN550BTController];
61 NSArray *bpDeviceArray = [controller getAllCurrentKN550BTInstace];
62
63 for(KN550BT *tempDevice in bpDeviceArray){
64 if([mac isEqualToString:tempDevice.serialNumber]){
65
66// tempDevice.reactNativeFlg = @YES;
67 return tempDevice;
68 }
69 }
70
71 return nil;
72}
73
74
75//-(void)DeviceConnectForKN550BT:(NSNotification *)tempNoti{
76// KN550BTController *controller = [KN550BTController shareKN550BTController];
77// NSArray *BPDeviceArray = [controller getAllCurrentKN550BTInstace];
78//
79// KN550BT *bpInstance = [BPDeviceArray objectAtIndex:0];
80// NSString *mac = bpInstance.currentUUID;
81// NSDictionary *IDPSDic = [tempNoti userInfo];
82//
83// NSDictionary* deviceInfo = @{
84// kACTION:@"kn550bt_connected_bg",@"idps":IDPSDic };
85// [BPProfileModule sendEventToEmitter:self eventNotify:EVENT_NOTIFY WithDict:response];
86//
87//}
88//
89//-(void)DeviceDisConnectForKN550BT:(NSNotification *)tempNoti{
90//
91// NSDictionary *IDPSDic = [tempNoti userInfo];
92// NSString *mac = [IDPSDic objectForKey:@"SerialNumber"];
93//
94// NSDictionary* deviceInfo = @{@"mac":mac,@"action":@"kn550bt_disconnected_bg",@"idps":IDPSDic};
95// [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
96//
97//}
98
99
100#pragma mark-获取连接设备
101RCT_EXPORT_METHOD(getAllConnectedDevices){
102
103
104 NSArray*bp550array= [[KN550BTController shareKN550BTController] getAllCurrentKN550BTInstace];
105
106 NSMutableArray*deviceMacArray=[NSMutableArray array];
107
108 for (int i=0; i<[bp550array count]; i++) {
109
110 KN550BT*kn550bt=[bp550array objectAtIndex:i];
111
112 [deviceMacArray addObject:kn550bt.serialNumber];
113
114 }
115
116 NSDictionary* deviceInfo = @{@"action":@"ACTION_GET_ALL_CONNECTED_DEVICES",@"devices":deviceMacArray};
117
118 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
119
120
121}
122
123
124
125
126#pragma mark - Method
127
128RCT_EXPORT_METHOD(getFunctionInfo:(nonnull NSString *)mac){
129
130 if ([self getDeviceWithMac:mac]!=nil) {
131 __weak typeof(self) weakSelf = self;
132 [[self getDeviceWithMac:mac] commandFunction:^(NSDictionary *dic) {
133
134 NSDictionary* response = @{
135 kACTION:kACTION_FUNCTION_INFORMATION_BP,
136 kFUNCTION_IS_UPAIR_MEASURE: [dic objectForKey:@"upAirMeasureFlg"],
137 kFUNCTION_IS_ARM_MEASURE: [dic objectForKey:@"armMeasureFlg"],
138 kFUNCTION_HAVE_ANGLE_SENSOR: [dic objectForKey:@"haveAngleSensor"],
139 kFUNCTION_HAVE_OFFLINE: [dic objectForKey:@"haveOffline"],
140 kFUNCTION_HAVE_HSD: [dic objectForKey:@"haveHSD"],
141 kFUNCTION_HAVE_ANGLE_SETTING: [dic objectForKey:@"haveAngleSet"],
142 kFUNCTION_IS_MULTI_UPLOAD: [dic objectForKey:@"mutableUpload"],
143 kFUNCTION_HAVE_SELF_UPDATE: [dic objectForKey: @"selfUpdate"],
144 kType:@"KN550",
145 kMAC:mac
146 };
147 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
148
149 } errorBlock:^(BPDeviceError error) {
150
151 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
152
153 }];
154 }else{
155
156 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
157
158 }
159
160
161}
162
163RCT_EXPORT_METHOD(getBattery:(nonnull NSString *)mac){
164
165 if ([self getDeviceWithMac:mac]!=nil) {
166 __weak typeof(self) weakSelf = self;
167 [[self getDeviceWithMac:mac] commandEnergy:^(NSNumber *energyValue) {
168
169 NSDictionary* response = @{
170 kACTION:kACTION_BATTERY_BP,
171 kBATTERY_BP:energyValue,
172 kType:@"KN550",
173 kMAC:mac
174 };
175 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
176 NSLog(@"%@",response);
177
178 } errorBlock:^(BPDeviceError error) {
179
180 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
181
182 }];
183
184 }else{
185
186 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
187 }
188
189
190}
191
192RCT_EXPORT_METHOD(getOffLineNum:(nonnull NSString *)mac){
193
194 if ([self getDeviceWithMac:mac]!=nil) {
195 __weak typeof(self) weakSelf = self;
196 [[self getDeviceWithMac:mac]commandTransferMemoryTotalCount:^(NSNumber *num) {
197
198 NSDictionary* response = @{
199 kACTION:kACTION_HISTORICAL_NUM_BP,
200 kHISTORICAL_NUM_BP:num,
201 kType:@"KN550",
202 kMAC:mac
203 };
204 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
205
206 } errorBlock:^(BPDeviceError error) {
207
208 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
209
210 }];
211
212 }else{
213 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
214
215 }
216
217
218}
219
220RCT_EXPORT_METHOD(getOffLineData:(nonnull NSString *)mac){
221
222 if ([self getDeviceWithMac:mac]!=nil) {
223 __weak typeof(self) weakSelf = self;
224
225 [[self getDeviceWithMac:mac] commandTransferMemoryDataWithTotalCount:^(NSNumber *count) {
226 if ([count integerValue] == 0) {
227 NSDictionary* response = @{kACTION:kACTION_HISTORICAL_DATA_BP };
228 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
229 }
230 } progress:^(NSNumber *progress) {
231
232 } dataArray:^(NSArray *array) {
233 NSMutableArray * tempArr = [[NSMutableArray alloc]init];
234
235 for(NSDictionary *history in array)
236 {
237 NSDate *tempDate = [history objectForKey:@"time"];
238
239 //将时间格式转化成字符串,适配plugin和react native【
240 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
241 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
242 NSString *dateStr = [mydateFormatter stringFromDate:tempDate];
243
244 NSNumber*bpHSD=[history valueForKey:@"hsdValue"];
245 NSDictionary *dic=[NSDictionary dictionary];
246 if (bpHSD!=nil) {
247 dic = @{
248 kMEASUREMENT_DATE_BP: dateStr,
249 kLOW_BLOOD_PRESSURE_BP: [history objectForKey:@"dia"],
250 kHIGH_BLOOD_PRESSURE_BP: [history objectForKey:@"sys"],
251 kMEASUREMENT_AHR_BP: [history objectForKey:@"irregular"],
252 kPULSE_BP: [history objectForKey:@"heartRate"],
253 kDATAID: [history objectForKey:@"dataID"],
254 kMEASUREMENT_HSD_BP: history[@"hsdValue"],
255 kType:@"KN550",
256 kMAC:mac
257 };
258 }else{
259
260
261 dic = @{
262 kMEASUREMENT_DATE_BP: dateStr,
263 kLOW_BLOOD_PRESSURE_BP: [history objectForKey:@"dia"],
264 kHIGH_BLOOD_PRESSURE_BP: [history objectForKey:@"sys"],
265 kMEASUREMENT_AHR_BP: [history objectForKey:@"irregular"],
266 kPULSE_BP: [history objectForKey:@"heartRate"],
267 kDATAID: [history objectForKey:@"dataID"],
268 kType:@"KN550",
269 kMAC:mac
270
271 };
272 }
273
274
275
276 [tempArr addObject:dic];
277
278 }
279
280 if (tempArr.count > 0) {
281 NSDictionary* response = @{
282 kACTION:kACTION_HISTORICAL_DATA_BP,
283 kHISTORICAL_DATA_BP:[tempArr copy],
284 kType:@"KN550",
285 kMAC:mac
286 };
287 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
288 }
289
290 } errorBlock:^(BPDeviceError error) {
291 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
292 }];
293
294 }else{
295
296 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
297 }
298
299
300}
301
302RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
303
304 if ([self getDeviceWithMac:mac]!=nil) {
305
306 [[self getDeviceWithMac:mac] commandDisconnectDevice];
307
308 }else{
309
310 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
311
312 }
313
314
315}
316
317
318@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5Module.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5Module.h
new file mode 100755
index 0000000..0f49db2
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5Module.h
@@ -0,0 +1,23 @@
1//
2// BP5Module.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16
17@interface BP5Module : RCTEventEmitter<RCTBridgeModule>
18
19
20
21
22
23@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5Module.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5Module.m
new file mode 100644
index 0000000..4804e9c
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5Module.m
@@ -0,0 +1,501 @@
1//
2// BP5Module.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "BP5Module.h"
10#import "BPProfileModule.h"
11#import "BPMacroFile.h"
12#import "BP5Controller.h"
13#import "BP5.h"
14#import "iHealthDeviceManagerModule.h"
15
16@interface BP5Module()
17@property (nonatomic, strong) NSNumber* previousPressure;
18@property (nonatomic, assign) BOOL startSendWavelet;
19@property (nonatomic, assign) BOOL isMeasuring;
20
21@end
22@implementation BP5Module
23#define EVENT_NOTIFY @"BP5.MODULE.NOTIFY"
24RCT_EXPORT_MODULE()
25- (NSArray<NSString *> *)supportedEvents {
26 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
27 @"event_device_connected", @"event_device_connect_failed",
28 @"event_device_disconnect", @"event_authenticate_result",
29 @"event_notify_ts28b", @"event_notify_bg1",
30 @"action_connect_result_for_bg1"];
31}
32
33
34
35- (NSDictionary *)constantsToExport
36{
37 return @{
38 @"Event_Notify":EVENT_NOTIFY,
39
40 };
41}
42+ (BOOL)requiresMainQueueSetup
43{
44 return YES;
45}
46
47#pragma mark
48#pragma mark - Init
49
50-(BP5*)getBP5WithMac:(NSString*)mac{
51
52 BP5Controller *controller = [BP5Controller shareBP5Controller];
53 NSArray *bpDeviceArray = [controller getAllCurrentBP5Instace];
54
55 for(BP5 *tempDevice in bpDeviceArray){
56 if([mac isEqualToString:tempDevice.serialNumber]){
57
58 return tempDevice;
59 }
60 }
61
62 return nil;
63
64// static BP5* bp5Device = nil;
65// if (!bp5Device) {
66// BP5Controller *controller = [BP5Controller shareBP5Controller];
67// NSArray *bpDeviceArray = [controller getAllCurrentBP5Instace];
68//
69// for(BP5 *tempBP5 in bpDeviceArray){
70// if([mac isEqualToString:tempBP5.serialNumber]){
71//
72// bp5Device = tempBP5;
73// break;
74// }
75// }
76// }
77//
78//
79// return bp5Device;
80}
81
82#pragma mark
83#pragma mark - Notification
84#pragma mark - BP5
85//-(void)DeviceConnectForBP5:(NSNotification *)tempNoti{
86// BP5Controller *controller = [BP5Controller shareBP5Controller];
87// NSArray *bpDeviceArray = [controller getAllCurrentBP5Instace];
88//
89// BP5 *bpInstance = [bpDeviceArray objectAtIndex:0];
90//
91//}
92//
93//- (void)DeviceDisConnectForBP5:(NSNotification*)tempNoti{
94//
95//}
96
97
98
99
100#pragma mark
101#pragma mark - Method
102
103
104#pragma mark-获取连接设备
105RCT_EXPORT_METHOD(getAllConnectedDevices){
106
107
108 NSArray*bp5array= [[BP5Controller shareBP5Controller] getAllCurrentBP5Instace];
109
110 NSMutableArray*deviceMacArray=[NSMutableArray array];
111
112 for (int i=0; i<[bp5array count]; i++) {
113
114 BP5*bp5=[bp5array objectAtIndex:i];
115
116 [deviceMacArray addObject:bp5.serialNumber];
117
118 }
119
120 NSDictionary* deviceInfo = @{@"action":@"ACTION_GET_ALL_CONNECTED_DEVICES",@"devices":deviceMacArray};
121
122 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
123
124
125}
126
127
128
129
130
131RCT_EXPORT_METHOD(startMeasure:(nonnull NSString *)mac){
132
133 _previousPressure = @(0);
134 self.startSendWavelet = NO;
135 if ([self getBP5WithMac:mac]!=nil) {
136 __weak typeof(self) weakSelf = self;
137 [[self getBP5WithMac:mac] commandStartMeasureWithZeroingState:^(BOOL isComplete) {
138 weakSelf.isMeasuring = YES;
139 NSDictionary* response = @{
140 kACTION:isComplete ? kACTION_ZOREING_BP : kACTION_ZOREOVER_BP,
141 };
142 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
143 } pressure:^(NSArray *pressureArr) {
144 NSLog(@"pressure %@",pressureArr);
145 weakSelf.isMeasuring = YES;
146 [weakSelf sendPresssre:pressureArr.firstObject wavelet:nil isHeartPulse:NO];
147 } waveletWithHeartbeat:^(NSArray *waveletArr) {
148 NSLog(@"xiaoboWithHeart %@",waveletArr);
149 weakSelf.isMeasuring = YES;
150 [weakSelf sendPresssre:nil wavelet:waveletArr isHeartPulse:YES];
151 } waveletWithoutHeartbeat:^(NSArray *waveletArr) {
152 weakSelf.isMeasuring = YES;
153 NSLog(@"xiaoboNoHeart %@",waveletArr);
154 [weakSelf sendPresssre:nil wavelet:waveletArr isHeartPulse:NO];
155 } result:^(NSDictionary *resultDict) {
156 NSLog(@"result %@",resultDict);
157 weakSelf.startSendWavelet = NO;
158 weakSelf.isMeasuring = NO;
159 NSDictionary* response = @{
160 kACTION:kACTION_ONLINE_RESULT_BP,
161 kHIGH_BLOOD_PRESSURE_BP:resultDict[@"sys"],
162 kLOW_BLOOD_PRESSURE_BP:resultDict[@"dia"],
163 kPULSE_BP:resultDict[@"heartRate"],
164 kMEASUREMENT_AHR_BP:resultDict[@"irregular"],
165 kDATAID:resultDict[@"dataID"],
166 };
167 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
168 } errorBlock:^(BPDeviceError error) {
169 NSLog(@"error %lu",(unsigned long)error);
170 weakSelf.startSendWavelet = NO;
171 weakSelf.isMeasuring = NO;
172 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
173
174 }];
175
176
177 }else{
178
179 NSLog(@"error %d",BPDidDisconnect);
180 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
181 self.isMeasuring = NO;
182 }
183
184
185}
186
187- (void)sendPresssre:(NSNumber*)pressure wavelet:(NSArray*)waveletArray isHeartPulse:(BOOL)heartPulse{
188
189 if (pressure) {
190 self.previousPressure = pressure;
191 }
192 if (waveletArray.count > 0) {
193 self.startSendWavelet = YES;
194 }
195 if (pressure && !self.startSendWavelet) {
196 NSDictionary* response = @{
197 kACTION:kACTION_ONLINE_PRESSURE_BP,
198 kBLOOD_PRESSURE_BP:pressure,
199 };
200 [BPProfileModule sendEventToEmitter:self eventNotify:EVENT_NOTIFY WithDict:response];
201 }else if (waveletArray.count > 0 && self.startSendWavelet){
202 NSDictionary* response = @{
203 kACTION:kACTION_ONLINE_PULSEWAVE_BP,
204 kBLOOD_PRESSURE_BP:self.previousPressure,
205 kFLAG_HEARTBEAT_BP:@(heartPulse),
206 kPULSEWAVE_BP:waveletArray
207 };
208 [BPProfileModule sendEventToEmitter:self eventNotify:EVENT_NOTIFY WithDict:response];
209 }
210}
211
212
213RCT_EXPORT_METHOD(stopMeasure:(nonnull NSString *)mac){
214
215 if (!self.isMeasuring) {
216 NSLog(@"error %d",401);
217 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:401];
218 return;
219 }
220 if ([self getBP5WithMac:mac]!=nil) {
221 __weak typeof(self) weakSelf = self;
222
223 [[self getBP5WithMac:mac] stopBPMeassureSuccessBlock:^{
224
225 } errorBlock:^(BPDeviceError error) {
226
227 NSLog(@"error %lu",(unsigned long)error);
228 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
229
230 }];
231
232 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
233 NSDictionary* response = @{
234 kACTION:kACTION_INTERRUPTED_BP,
235 };
236 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
237 weakSelf.isMeasuring = NO;
238 });
239 }else{
240
241 NSLog(@"error %lu",(unsigned long)BPDidDisconnect);
242 self.isMeasuring = NO;
243 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
244
245 }
246
247}
248
249RCT_EXPORT_METHOD(getBattery:(nonnull NSString *)mac){
250
251
252 if ([self getBP5WithMac:mac]!=nil) {
253 __weak typeof(self) weakSelf = self;
254 [[self getBP5WithMac:mac] commandEnergy:^(NSNumber *energyValue) {
255 NSDictionary* response = @{
256 kACTION:kACTION_BATTERY_BP,
257 kBATTERY_BP:energyValue
258 };
259 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
260 } errorBlock:^(BPDeviceError error) {
261 NSLog(@"error %lu",(unsigned long)error);
262 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
263 }];
264
265 }else{
266
267 NSLog(@"error %lu",(unsigned long)BPDidDisconnect);
268 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
269
270 }
271
272
273
274
275}
276
277
278RCT_EXPORT_METHOD(enbleOffline:(nonnull NSString *)mac){
279
280
281 if ([self getBP5WithMac:mac]!=nil) {
282 __block BOOL success = YES;
283 __weak typeof(self) weakSelf = self;
284 [[self getBP5WithMac:mac] commandSetOffline:YES errorBlock:^(BPDeviceError error) {
285 success = NO;
286 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
287 }];
288
289 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
290 if (success) {
291 NSDictionary* response = @{
292 kACTION:kACTION_ENABLE_OFFLINE_BP,
293 };
294 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
295 }
296 });
297
298 }else{
299 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
300 }
301
302}
303
304
305RCT_EXPORT_METHOD(disableOffline:(nonnull NSString *)mac){
306
307
308 if ([self getBP5WithMac:mac]!=nil) {
309 __block BOOL success = YES;
310 __weak typeof(self) weakSelf = self;
311 [[self getBP5WithMac:mac] commandSetOffline:NO errorBlock:^(BPDeviceError error) {
312 success = NO;
313 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
314 }];
315
316 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
317 if (success) {
318 NSDictionary* response = @{
319 kACTION:kACTION_DISENABLE_OFFLINE_BP,
320 };
321 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
322 }
323 });
324
325 }else{
326 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
327 }
328
329
330}
331
332
333RCT_EXPORT_METHOD(isEnableOffline:(nonnull NSString *)mac){
334
335
336 if ([self getBP5WithMac:mac]!=nil) {
337 __weak typeof(self) weakSelf = self;
338 [[self getBP5WithMac:mac] commandFunction:^(NSDictionary *dic) {
339 NSDictionary* response = @{
340 kACTION:kACTION_IS_ENABLE_OFFLINE,
341 kIS_ENABLE_OFFLINE:dic[@"offlineOpen"]
342 };
343 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
344 } errorBlock:^(BPDeviceError error) {
345 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
346 }];
347 }else{
348 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
349 }
350
351}
352
353
354
355RCT_EXPORT_METHOD(getOfflineNum:(nonnull NSString *)mac){
356
357
358
359 if ([self getBP5WithMac:mac]!=nil) {
360
361 __weak typeof(self) weakSelf = self;
362
363 [[self getBP5WithMac:mac] commandTransferMemoryTotalCount:^(NSNumber *count) {
364
365 NSDictionary* response = @{
366 kACTION:kACTION_HISTORICAL_NUM_BP,
367 kHISTORICAL_NUM_BP:count
368 };
369 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
370
371 } errorBlock:^(BPDeviceError error) {
372
373 }];
374 }else{
375 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
376 }
377
378
379
380// if ([self getBP5WithMac:mac]!=nil) {
381// __weak typeof(self) weakSelf = self;
382//
383// [[self getBP5WithMac:mac] commandBatchUpload:^(NSNumber *count) {
384// NSDictionary* response = @{
385// kACTION:kACTION_HISTORICAL_NUM_BP,
386// kHISTORICAL_NUM_BP:count
387// };
388// [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
389//
390// } progress:^(NSNumber *progressValue) {
391//
392// } dataArray:^(NSArray *bachArray) {
393// NSMutableArray * historyDataArray = [NSMutableArray array];
394//
395// for(NSDictionary *dataDict in bachArray)
396// {
397//
398// NSDate *date = [dataDict objectForKey:@"time"];
399//
400// //将时间格式转化成字符串,适配plugin和react native
401// NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
402// [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
403// NSString *dateStr = [mydateFormatter stringFromDate:date];
404// NSDictionary* historyDataDict = @{
405// kMEASUREMENT_DATE_BP:dateStr,
406// kHIGH_BLOOD_PRESSURE_BP:dataDict[@"sys"],
407// kLOW_BLOOD_PRESSURE_BP:dataDict[@"dia"],
408// kPULSE_BP:dataDict[@"heartRate"],
409// kMEASUREMENT_AHR_BP:dataDict[@"irregular"],
410// // kMEASUREMENT_HSD_BP:dataDict[@"hsdValue"],
411// kDATAID:dataDict[@"dataID"]
412// };
413// [historyDataArray addObject:historyDataDict];
414//
415//
416// }
417//
418// if (historyDataArray.count > 0) {
419// NSDictionary* deviceInfo = @{kACTION:kACTION_HISTORICAL_DATA_BP,kHISTORICAL_DATA_BP:[historyDataArray copy] };
420// [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:deviceInfo];
421// }
422//
423// } errorBlock:^(BPDeviceError error) {
424// [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
425//
426// }];
427//
428// }else{
429// [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
430// }
431}
432
433
434
435RCT_EXPORT_METHOD(getOfflineData:(nonnull NSString *)mac){
436
437
438 if ([self getBP5WithMac:mac]!=nil) {
439 __weak typeof(self) weakSelf = self;
440 [[self getBP5WithMac:mac] commandBatchUpload:^(NSNumber *count) {
441 NSDictionary* response = @{
442 kACTION:kACTION_HISTORICAL_NUM_BP,
443 kHISTORICAL_NUM_BP:count
444 };
445 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
446
447 } progress:^(NSNumber *progressValue) {
448
449 } dataArray:^(NSArray *bachArray) {
450 NSMutableArray * historyDataArray = [NSMutableArray array];
451
452 for(NSDictionary *dataDict in bachArray)
453 {
454
455 NSDate *date = [dataDict objectForKey:@"time"];
456
457 //将时间格式转化成字符串,适配plugin和react native
458 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
459 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
460 NSString *dateStr = [mydateFormatter stringFromDate:date];
461 NSDictionary* historyDataDict = @{
462 kMEASUREMENT_DATE_BP:dateStr,
463 kHIGH_BLOOD_PRESSURE_BP:dataDict[@"sys"],
464 kLOW_BLOOD_PRESSURE_BP:dataDict[@"dia"],
465 kPULSE_BP:dataDict[@"heartRate"],
466 kMEASUREMENT_AHR_BP:dataDict[@"irregular"],
467 // kMEASUREMENT_HSD_BP:dataDict[@"hsdValue"],
468 kDATAID:dataDict[@"dataID"]
469 };
470 [historyDataArray addObject:historyDataDict];
471
472
473 }
474
475 if (historyDataArray.count > 0) {
476 NSDictionary* deviceInfo = @{kACTION:kACTION_HISTORICAL_DATA_BP,kHISTORICAL_DATA_BP:[historyDataArray copy] };
477 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:deviceInfo];
478 }
479
480 } errorBlock:^(BPDeviceError error) {
481 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
482
483 }];
484
485 }else{
486 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
487 }
488
489}
490
491
492
493RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
494 NSLog(@"iOS doesn't support disconnect normal BT devices");
495 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:900];
496
497}
498
499
500
501@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5SModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5SModule.h
new file mode 100644
index 0000000..f2ff6ba
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5SModule.h
@@ -0,0 +1,19 @@
1//
2// BP5SModule.h
3// ReactNativeIOSLibrary
4//
5// Created by soso on 2019/4/17.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16@interface BP5SModule : RCTEventEmitter<RCTBridgeModule>
17
18
19@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5SModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5SModule.m
new file mode 100644
index 0000000..332fe67
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP5SModule.m
@@ -0,0 +1,426 @@
1//
2// BP5SModule.m
3// ReactNativeIOSLibrary
4//
5// Created by soso on 2019/4/17.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import "BP5SModule.h"
10
11#import "BPProfileModule.h"
12#import "BPMacroFile.h"
13#import "BP5SController.h"
14#import "BP5S.h"
15#import "iHealthDeviceManagerModule.h"
16
17#import "ScanDeviceController.h"
18#import "ConnectDeviceController.h"
19#define EVENT_NOTIFY @"BP5S.MODULE.NOTIFY"
20
21@interface BP5SModule ()
22@property (nonatomic, assign) BOOL isMeasuring;
23
24@end
25
26
27@implementation BP5SModule
28RCT_EXPORT_MODULE()
29- (NSArray<NSString *> *)supportedEvents {
30 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
31 @"event_device_connected", @"event_device_connect_failed",
32 @"event_device_disconnect", @"event_authenticate_result",
33 @"event_notify_ts28b", @"event_notify_bg1",
34 @"action_connect_result_for_bg1"];
35}
36
37
38- (NSDictionary *)constantsToExport
39{
40 return @{
41 @"Event_Notify":EVENT_NOTIFY,
42
43 };
44}
45+ (BOOL)requiresMainQueueSetup
46{
47 return YES;
48}
49
50-(BP5S*)getDeviceWithMac:(NSString*)mac{
51
52 BP5SController *controller = [BP5SController sharedController];
53 NSArray *bpDeviceArray = [controller getAllCurrentInstance];
54
55 for(BP5S *tempDevice in bpDeviceArray){
56 if([mac isEqualToString:tempDevice.serialNumber]){
57
58 return tempDevice;
59 }
60 }
61
62 return nil;
63}
64
65
66#pragma mark - Method
67
68
69#pragma mark-获取连接设备
70RCT_EXPORT_METHOD(getAllConnectedDevices){
71
72
73 NSArray *bp5sArray= [[BP5SController sharedController] getAllCurrentInstance];
74
75 NSMutableArray *deviceMacArray = [NSMutableArray array];
76
77 for (int i=0; i<[bp5sArray count]; i++) {
78
79 BP5S *bp5s=[bp5sArray objectAtIndex:i];
80
81 [deviceMacArray addObject:bp5s.serialNumber];
82
83 }
84
85 NSDictionary* deviceInfo = @{@"action":@"ACTION_GET_ALL_CONNECTED_DEVICES",@"devices":deviceMacArray};
86
87 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
88
89}
90
91
92//开始测量
93RCT_EXPORT_METHOD(startMeasure:(nonnull NSString *)mac){
94
95 if ([self getDeviceWithMac:mac]!=nil) {
96 __weak typeof(self) weakSelf = self;
97
98 [[self getDeviceWithMac:mac] commandStartMeasureWithZeroingState:^(BOOL isComplete) {
99 weakSelf.isMeasuring = YES;
100 NSDictionary* response = @{
101 @"mac":mac,
102 kACTION:isComplete ? kACTION_ZOREING_BP : kACTION_ZOREOVER_BP,
103 };
104 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
105 } pressure:^(NSArray *pressureArr) {
106 weakSelf.isMeasuring = YES;
107 NSLog(@"pressure %@",pressureArr);
108 NSDictionary* response = @{
109 @"mac":mac,
110 kACTION:kACTION_ONLINE_PRESSURE_BP,
111 kBLOOD_PRESSURE_BP:pressureArr.firstObject,
112 };
113 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
114 } waveletWithHeartbeat:^(NSArray *waveletArr) {
115 weakSelf.isMeasuring = YES;
116 NSLog(@"xiaoboWithHeart %@",waveletArr);
117 NSDictionary* response = @{
118 @"mac":mac,
119 kACTION:kACTION_ONLINE_PULSEWAVE_BP,
120 kFLAG_HEARTBEAT_BP:@(1),
121 kPULSEWAVE_BP:waveletArr
122 };
123 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
124 } waveletWithoutHeartbeat:^(NSArray *waveletArr) {
125 weakSelf.isMeasuring = YES;
126 NSLog(@"xiaoboNoHeart %@",waveletArr);
127 NSDictionary* response = @{
128 @"mac":mac,
129 kACTION:kACTION_ONLINE_PULSEWAVE_BP,
130 kFLAG_HEARTBEAT_BP:@(0),
131 kPULSEWAVE_BP:waveletArr
132 };
133 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
134 } result:^(NSDictionary *resultDict) {
135 weakSelf.isMeasuring = NO;
136 NSLog(@"result %@",resultDict);
137 NSDictionary* response = @{
138 @"mac":mac,
139 kACTION:kACTION_ONLINE_RESULT_BP,
140 kHIGH_BLOOD_PRESSURE_BP:resultDict[@"sys"],
141 kLOW_BLOOD_PRESSURE_BP:resultDict[@"dia"],
142 kPULSE_BP:resultDict[@"heartRate"],
143 kMEASUREMENT_AHR_BP:resultDict[@"irregular"],
144 kDATAID:resultDict[@"dataID"],
145 };
146 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
147 } errorBlock:^(BPDeviceError error) {
148 weakSelf.isMeasuring = NO;
149 NSLog(@"error %lu",(unsigned long)error);
150 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
151 }];
152
153 }else{
154 self.isMeasuring = NO;
155 NSLog(@"error %lu",(unsigned long)BPDidDisconnect);
156 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
157 }
158}
159
160//停止测量
161RCT_EXPORT_METHOD(stopMeasure:(nonnull NSString *)mac){
162 if (!self.isMeasuring) {
163 NSLog(@"error %d",401);
164 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:401];
165 return;
166 }
167 __weak typeof(self) weakSelf = self;
168 if ([self getDeviceWithMac:mac]!=nil) {
169 [[self getDeviceWithMac:mac] stopBPMeassureSuccessBlock:^{
170
171 weakSelf.isMeasuring = NO;
172 NSDictionary* response = @{
173 @"mac":mac,
174 kACTION:kACTION_INTERRUPTED_BP,
175 };
176 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
177
178 } errorBlock:^(BPDeviceError error) {
179
180 NSLog(@"error %lu",(unsigned long)error);
181 weakSelf.isMeasuring = NO;
182 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
183 }];
184
185
186 }else{
187 weakSelf.isMeasuring = NO;
188 NSLog(@"error %lu",(unsigned long)BPDidDisconnect);
189 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
190 }
191
192
193}
194
195//删除功能
196RCT_EXPORT_METHOD(deleteData:(nonnull NSString *)mac){
197
198 if ([self getDeviceWithMac:mac]!=nil) {
199 __weak typeof(self) weakSelf = self;
200 [[self getDeviceWithMac:mac] commandDeleteDataSuccessBlock:^{
201 NSDictionary* response = @{
202 @"mac":mac,
203 kACTION:kACTION_Delete_BP,
204 };
205 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
206 } errorBlock:^(BPDeviceError error) {
207 NSLog(@"error %lu",(unsigned long)error);
208 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
209 }];
210 }else{
211 NSLog(@"error %lu",(unsigned long)BPDidDisconnect);
212 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
213 }
214}
215
216//设置离线功能
217RCT_EXPORT_METHOD(enbleOffline:(nonnull NSString *)mac mode:(nonnull NSNumber *)mode){
218
219 if ([self getDeviceWithMac:mac]!=nil) {
220 __block BOOL success = YES;
221 __weak typeof(self) weakSelf = self;
222
223 BOOL flag;
224
225 if ([mode boolValue] == YES) {
226 flag = YES;
227 }else{
228 flag = NO;
229 }
230
231 [[self getDeviceWithMac:mac] commandSetOffline:flag success:^{
232
233 if (flag == YES) {
234 NSDictionary* response = @{
235 @"mac":mac,
236 kACTION:kACTION_ENABLE_OFFLINE_BP,
237 };
238 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
239 }else{
240 NSDictionary* response = @{
241 @"mac":mac,
242 kACTION:kACTION_DISENABLE_OFFLINE_BP,
243 };
244 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
245 }
246
247 } error:^(BPDeviceError error) {
248 success = NO;
249 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
250 }];
251 }else{
252 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
253 }
254}
255
256
257//查电量
258RCT_EXPORT_METHOD(getBattery:(nonnull NSString *)mac){
259
260 if ([self getDeviceWithMac:mac]!=nil) {
261 __weak typeof(self) weakSelf = self;
262 [[self getDeviceWithMac:mac] commandEnergy:^(NSNumber *energyValue) {
263 NSDictionary* response = @{
264 @"mac":mac,
265 kACTION:kACTION_BATTERY_BP,
266 kBATTERY_BP:energyValue
267 };
268 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
269 } errorBlock:^(BPDeviceError error) {
270 NSLog(@"error %lu",(unsigned long)error);
271 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
272 }];
273 }else{
274 NSLog(@"error %lu",(unsigned long)BPDidDisconnect);
275 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
276 }
277}
278
279//查数据数量
280RCT_EXPORT_METHOD(getOffLineNum:(nonnull NSString *)mac){
281
282 if ([self getDeviceWithMac:mac]!=nil) {
283 __weak typeof(self) weakSelf = self;
284 [[self getDeviceWithMac:mac]commandTransferMemoryTotalCount:^(NSNumber *num) {
285
286 NSDictionary* response = @{
287 @"mac":mac,
288 kACTION:kACTION_HISTORICAL_NUM_BP,
289 kHISTORICAL_NUM_BP:num
290 };
291 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
292
293 } errorBlock:^(BPDeviceError error) {
294
295 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
296
297 }];
298
299 }else{
300 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
301 }
302}
303
304
305//查离线数据
306RCT_EXPORT_METHOD(getOffLineData:(nonnull NSString *)mac){
307
308 if ([self getDeviceWithMac:mac]!=nil) {
309 __weak typeof(self) weakSelf = self;
310
311 [[self getDeviceWithMac:mac] commandTransferMemoryDataWithTotalCount:^(NSNumber *count) {
312 if ([count integerValue] == 0) {
313 NSDictionary* response = @{@"mac":mac,kACTION:kACTION_HISTORICAL_DATA_BP };
314 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
315 }
316 } progress:^(NSNumber *progress) {
317
318 } dataArray:^(NSArray *array) {
319 NSMutableArray * tempArr = [[NSMutableArray alloc]init];
320
321 for(NSDictionary *history in array)
322 {
323
324 NSNumber *dateNum = [history objectForKey:@"time"];
325
326 NSDate *tempDate = [NSDate dateWithTimeIntervalSince1970:[dateNum integerValue]];
327 //将时间格式转化成字符串,适配plugin和react native
328 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
329 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
330 NSString *dateStr = [mydateFormatter stringFromDate:tempDate];
331
332 NSNumber*bpHSD=[history valueForKey:@"hsdValue"];
333 NSDictionary *dic=[NSDictionary dictionary];
334 if (bpHSD!=nil) {
335 dic = @{
336 @"mac":mac,
337 kMEASUREMENT_DATE_BP: dateStr,
338 kLOW_BLOOD_PRESSURE_BP: [history objectForKey:@"dia"],
339 kHIGH_BLOOD_PRESSURE_BP: [history objectForKey:@"sys"],
340 kMEASUREMENT_AHR_BP: [history objectForKey:@"irregular"],
341 kPULSE_BP: [history objectForKey:@"heartRate"],
342 kDATAID: [history objectForKey:@"dataID"],
343 kMEASUREMENT_HSD_BP: history[@"hsdValue"]
344 };
345 }else{
346
347
348 dic = @{
349 @"mac":mac,
350 kMEASUREMENT_DATE_BP: dateStr,
351 kLOW_BLOOD_PRESSURE_BP: [history objectForKey:@"dia"],
352 kHIGH_BLOOD_PRESSURE_BP: [history objectForKey:@"sys"],
353 kMEASUREMENT_AHR_BP: [history objectForKey:@"irregular"],
354 kPULSE_BP: [history objectForKey:@"heartRate"],
355 kDATAID: [history objectForKey:@"dataID"]
356
357 };
358 }
359 [tempArr addObject:dic];
360 }
361
362 if (tempArr.count > 0) {
363 NSDictionary* response = @{
364 @"mac":mac,
365 kACTION:kACTION_HISTORICAL_DATA_BP,
366 kHISTORICAL_DATA_BP:[tempArr copy]
367 };
368 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
369 }
370
371 } errorBlock:^(BPDeviceError error) {
372 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
373 }];
374
375 }else{
376
377 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
378 }
379
380
381}
382
383//查询功能
384RCT_EXPORT_METHOD(getFunctionInfo:(nonnull NSString *)mac){
385
386 if ([self getDeviceWithMac:mac]!=nil) {
387 __weak typeof(self) weakSelf = self;
388 [[self getDeviceWithMac:mac] commandFunction:^(NSDictionary *dic) {
389
390 NSDictionary* response = @{
391 @"mac":mac,
392 kACTION:kACTION_FUNCTION_INFORMATION_BP,
393 kFUNCTION_IS_UPAIR_MEASURE: [dic objectForKey:@"upAirMeasureFlg"],
394 kFUNCTION_IS_ARM_MEASURE: [dic objectForKey:@"armMeasureFlg"],
395 kFUNCTION_HAVE_ANGLE_SENSOR: [dic objectForKey:@"haveAngleSensor"],
396 kFUNCTION_HAVE_OFFLINE: [dic objectForKey:@"haveOffline"],
397 kFUNCTION_HAVE_HSD: [dic objectForKey:@"haveHSD"],
398 kFUNCTION_IS_MULTI_UPLOAD: [dic objectForKey:@"mutableUpload"],
399 kFUNCTION_HAVE_SELF_UPDATE: [dic objectForKey: @"selfUpdate"]};
400 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
401
402 } errorBlock:^(BPDeviceError error) {
403
404 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
405
406 }];
407 }else{
408
409 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
410 }
411}
412
413//离线数据
414RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
415
416 if ([self getDeviceWithMac:mac]!=nil) {
417 [[self getDeviceWithMac:mac] commandDisconnectDevice];
418 }else{
419 NSLog(@"error %lu",(unsigned long)BPDidDisconnect);
420 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
421 }
422}
423
424
425
426@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7Module.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7Module.h
new file mode 100755
index 0000000..cc6aedc
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7Module.h
@@ -0,0 +1,23 @@
1//
2// BP5Module.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16
17@interface BP7Module : RCTEventEmitter<RCTBridgeModule>
18
19
20
21
22
23@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7Module.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7Module.m
new file mode 100644
index 0000000..7745c0c
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7Module.m
@@ -0,0 +1,521 @@
1//
2// BP7Module.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "BP7Module.h"
10#import "BPProfileModule.h"
11#import "BPMacroFile.h"
12#import "BP7Controller.h"
13#import "BP7.h"
14#import "iHealthDeviceManagerModule.h"
15
16@interface BP7Module()
17@property (nonatomic, strong) NSNumber* previousPressure;
18@property (nonatomic, assign) BOOL startSendWavelet;
19@property (nonatomic, assign) BOOL isMeasuring;
20
21@end
22@implementation BP7Module
23#define EVENT_NOTIFY @"BP7.MODULE.NOTIFY"
24RCT_EXPORT_MODULE()
25- (NSArray<NSString *> *)supportedEvents {
26 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
27 @"event_device_connected", @"event_device_connect_failed",
28 @"event_device_disconnect", @"event_authenticate_result",
29 @"event_notify_ts28b", @"event_notify_bg1",
30 @"action_connect_result_for_bg1"];
31}
32
33
34
35- (NSDictionary *)constantsToExport
36{
37 return @{
38 @"Event_Notify":EVENT_NOTIFY,
39
40 };
41}
42+ (BOOL)requiresMainQueueSetup
43{
44 return YES;
45}
46
47#pragma mark
48#pragma mark - Init
49
50-(BP7*)getBP7WithMac:(NSString*)mac{
51
52 BP7Controller *controller = [BP7Controller shareBP7Controller];
53 NSArray *bpDeviceArray = [controller getAllCurrentBP7Instace];
54
55 for(BP7 *tempDevice in bpDeviceArray){
56 if([mac isEqualToString:tempDevice.serialNumber]){
57
58 return tempDevice;
59 }
60 }
61
62 return nil;
63
64
65}
66
67#pragma mark
68#pragma mark - Notification
69#pragma mark - BP7
70
71
72
73
74
75#pragma mark
76#pragma mark - Method
77
78
79#pragma mark-获取连接设备
80RCT_EXPORT_METHOD(getAllConnectedDevices){
81
82
83 NSArray*bp7array= [[BP7Controller shareBP7Controller] getAllCurrentBP7Instace];
84
85 NSMutableArray*deviceMacArray=[NSMutableArray array];
86
87 for (int i=0; i<[bp7array count]; i++) {
88
89 BP7*bp7=[bp7array objectAtIndex:i];
90
91 [deviceMacArray addObject:bp7.serialNumber];
92
93 }
94
95 NSDictionary* deviceInfo = @{@"action":@"ACTION_GET_ALL_CONNECTED_DEVICES",@"devices":deviceMacArray};
96
97 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
98
99
100}
101
102
103RCT_EXPORT_METHOD(conformAngle:(nonnull NSString *)mac){
104
105
106 if ([self getBP7WithMac:mac]!=nil) {
107 __weak typeof(self) weakSelf = self;
108
109
110 [[self getBP7WithMac:mac] commandStartGetAngle:^(NSDictionary *angleDict) {
111
112
113 NSDictionary* response = @{
114 kACTION:kACTION_ANGLE_BP,
115
116 kANGLE_BP:angleDict[@"angle"],
117
118 kWHICH_ARM:angleDict[@"isLeftHand"]
119 };
120 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
121
122 } errorBlock:^(BPDeviceError error) {
123
124
125 NSLog(@"error %lu",(unsigned long)error);
126
127 weakSelf.isMeasuring = NO;
128
129 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
130
131 }];
132
133
134
135 }else{
136
137 NSLog(@"error %lu",(unsigned long)BPDidDisconnect);
138 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
139 self.isMeasuring = NO;
140 }
141
142
143
144
145}
146
147
148
149
150
151RCT_EXPORT_METHOD(startMeasure:(nonnull NSString *)mac){
152
153 _previousPressure = @(0);
154 self.startSendWavelet = NO;
155 if ([self getBP7WithMac:mac]!=nil) {
156 __weak typeof(self) weakSelf = self;
157 [[self getBP7WithMac:mac] commandStartMeasureWithZeroingState:^(BOOL isComplete) {
158 weakSelf.isMeasuring = YES;
159 NSDictionary* response = @{
160 kACTION:isComplete ? kACTION_ZOREING_BP : kACTION_ZOREOVER_BP,
161 };
162 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
163 } pressure:^(NSArray *pressureArr) {
164 NSLog(@"pressure %@",pressureArr);
165 weakSelf.isMeasuring = YES;
166 [weakSelf sendPresssre:pressureArr.firstObject wavelet:nil isHeartPulse:NO];
167 } waveletWithHeartbeat:^(NSArray *waveletArr) {
168 NSLog(@"xiaoboWithHeart %@",waveletArr);
169 weakSelf.isMeasuring = YES;
170 [weakSelf sendPresssre:nil wavelet:waveletArr isHeartPulse:YES];
171 } waveletWithoutHeartbeat:^(NSArray *waveletArr) {
172 weakSelf.isMeasuring = YES;
173 NSLog(@"xiaoboNoHeart %@",waveletArr);
174 [weakSelf sendPresssre:nil wavelet:waveletArr isHeartPulse:NO];
175 } result:^(NSDictionary *resultDict) {
176 NSLog(@"result %@",resultDict);
177 weakSelf.startSendWavelet = NO;
178 weakSelf.isMeasuring = NO;
179 NSDictionary* response = @{
180 kACTION:kACTION_ONLINE_RESULT_BP,
181 kHIGH_BLOOD_PRESSURE_BP:resultDict[@"sys"],
182 kLOW_BLOOD_PRESSURE_BP:resultDict[@"dia"],
183 kPULSE_BP:resultDict[@"heartRate"],
184 kMEASUREMENT_AHR_BP:resultDict[@"irregular"],
185 kDATAID:resultDict[@"dataID"],
186 };
187 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
188 } errorBlock:^(BPDeviceError error) {
189 NSLog(@"error %lu",(unsigned long)error);
190 weakSelf.startSendWavelet = NO;
191 weakSelf.isMeasuring = NO;
192 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
193
194 }];
195
196
197 }else{
198
199 NSLog(@"error %d",BPDidDisconnect);
200 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
201 self.isMeasuring = NO;
202 }
203
204
205}
206
207- (void)sendPresssre:(NSNumber*)pressure wavelet:(NSArray*)waveletArray isHeartPulse:(BOOL)heartPulse{
208
209 if (pressure) {
210 self.previousPressure = pressure;
211 }
212 if (waveletArray.count > 0) {
213 self.startSendWavelet = YES;
214 }
215 if (pressure && !self.startSendWavelet) {
216 NSDictionary* response = @{
217 kACTION:kACTION_ONLINE_PRESSURE_BP,
218 kBLOOD_PRESSURE_BP:pressure,
219 };
220 [BPProfileModule sendEventToEmitter:self eventNotify:EVENT_NOTIFY WithDict:response];
221 }else if (waveletArray.count > 0 && self.startSendWavelet){
222 NSDictionary* response = @{
223 kACTION:kACTION_ONLINE_PULSEWAVE_BP,
224 kBLOOD_PRESSURE_BP:self.previousPressure,
225 kFLAG_HEARTBEAT_BP:@(heartPulse),
226 kPULSEWAVE_BP:waveletArray
227 };
228 [BPProfileModule sendEventToEmitter:self eventNotify:EVENT_NOTIFY WithDict:response];
229 }
230}
231
232
233RCT_EXPORT_METHOD(stopMeasure:(nonnull NSString *)mac){
234
235 if (!self.isMeasuring) {
236 NSLog(@"error %d",401);
237 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:401];
238 return;
239 }
240 if ([self getBP7WithMac:mac]!=nil) {
241 __weak typeof(self) weakSelf = self;
242
243 [[self getBP7WithMac:mac] stopBPMeassureSuccessBlock:^{
244
245 } errorBlock:^(BPDeviceError error) {
246
247 NSLog(@"error %lu",(unsigned long)error);
248 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
249
250 }];
251
252 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
253 NSDictionary* response = @{
254 kACTION:kACTION_INTERRUPTED_BP,
255 };
256 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
257 weakSelf.isMeasuring = NO;
258 });
259 }else{
260
261 NSLog(@"error %lu",(unsigned long)BPDidDisconnect);
262 self.isMeasuring = NO;
263 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
264
265 }
266
267}
268
269RCT_EXPORT_METHOD(getBattery:(nonnull NSString *)mac){
270
271
272 if ([self getBP7WithMac:mac]!=nil) {
273 __weak typeof(self) weakSelf = self;
274 [[self getBP7WithMac:mac] commandEnergy:^(NSNumber *energyValue) {
275 NSDictionary* response = @{
276 kACTION:kACTION_BATTERY_BP,
277 kBATTERY_BP:energyValue
278 };
279 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
280 } errorBlock:^(BPDeviceError error) {
281 NSLog(@"error %lu",(unsigned long)error);
282 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
283 }];
284
285 }else{
286
287 NSLog(@"error %lu",(unsigned long)BPDidDisconnect);
288 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
289
290 }
291
292
293
294
295}
296
297
298RCT_EXPORT_METHOD(enbleOffline:(nonnull NSString *)mac){
299
300
301 if ([self getBP7WithMac:mac]!=nil) {
302 __block BOOL success = YES;
303 __weak typeof(self) weakSelf = self;
304 [[self getBP7WithMac:mac] commandSetOffline:YES errorBlock:^(BPDeviceError error) {
305 success = NO;
306 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
307 }];
308
309 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
310 if (success) {
311 NSDictionary* response = @{
312 kACTION:kACTION_ENABLE_OFFLINE_BP,
313 };
314 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
315 }
316 });
317
318 }else{
319 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
320 }
321
322}
323
324
325RCT_EXPORT_METHOD(disableOffline:(nonnull NSString *)mac){
326
327
328 if ([self getBP7WithMac:mac]!=nil) {
329 __block BOOL success = YES;
330 __weak typeof(self) weakSelf = self;
331 [[self getBP7WithMac:mac] commandSetOffline:NO errorBlock:^(BPDeviceError error) {
332 success = NO;
333 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
334 }];
335
336 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
337 if (success) {
338 NSDictionary* response = @{
339 kACTION:kACTION_DISENABLE_OFFLINE_BP,
340 };
341 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
342 }
343 });
344
345 }else{
346 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
347 }
348
349
350}
351
352
353RCT_EXPORT_METHOD(isEnableOffline:(nonnull NSString *)mac){
354
355
356 if ([self getBP7WithMac:mac]!=nil) {
357 __weak typeof(self) weakSelf = self;
358 [[self getBP7WithMac:mac] commandFunction:^(NSDictionary *dic) {
359 NSDictionary* response = @{
360 kACTION:kACTION_IS_ENABLE_OFFLINE,
361 kIS_ENABLE_OFFLINE:dic[@"offlineOpen"]
362 };
363 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
364 } errorBlock:^(BPDeviceError error) {
365 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
366 }];
367 }else{
368 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
369 }
370
371}
372
373
374
375RCT_EXPORT_METHOD(getOfflineNum:(nonnull NSString *)mac){
376
377
378
379 if ([self getBP7WithMac:mac]!=nil) {
380
381 __weak typeof(self) weakSelf = self;
382
383 [[self getBP7WithMac:mac] commandTransferMemoryTotalCount:^(NSNumber *count) {
384
385 NSDictionary* response = @{
386 kACTION:kACTION_HISTORICAL_NUM_BP,
387 kHISTORICAL_NUM_BP:count
388 };
389 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
390
391 } errorBlock:^(BPDeviceError error) {
392
393 }];
394 }else{
395 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
396 }
397
398
399
400// if ([self getBP7WithMac:mac]!=nil) {
401// __weak typeof(self) weakSelf = self;
402//
403// [[self getBP7WithMac:mac] commandBatchUpload:^(NSNumber *count) {
404// NSDictionary* response = @{
405// kACTION:kACTION_HISTORICAL_NUM_BP,
406// kHISTORICAL_NUM_BP:count
407// };
408// [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
409//
410// } progress:^(NSNumber *progressValue) {
411//
412// } dataArray:^(NSArray *bachArray) {
413// NSMutableArray * historyDataArray = [NSMutableArray array];
414//
415// for(NSDictionary *dataDict in bachArray)
416// {
417//
418// NSDate *date = [dataDict objectForKey:@"time"];
419//
420// //将时间格式转化成字符串,适配plugin和react native
421// NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
422// [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
423// NSString *dateStr = [mydateFormatter stringFromDate:date];
424// NSDictionary* historyDataDict = @{
425// kMEASUREMENT_DATE_BP:dateStr,
426// kHIGH_BLOOD_PRESSURE_BP:dataDict[@"sys"],
427// kLOW_BLOOD_PRESSURE_BP:dataDict[@"dia"],
428// kPULSE_BP:dataDict[@"heartRate"],
429// kMEASUREMENT_AHR_BP:dataDict[@"irregular"],
430// // kMEASUREMENT_HSD_BP:dataDict[@"hsdValue"],
431// kDATAID:dataDict[@"dataID"]
432// };
433// [historyDataArray addObject:historyDataDict];
434//
435//
436// }
437//
438// if (historyDataArray.count > 0) {
439// NSDictionary* deviceInfo = @{kACTION:kACTION_HISTORICAL_DATA_BP,kHISTORICAL_DATA_BP:[historyDataArray copy] };
440// [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:deviceInfo];
441// }
442//
443// } errorBlock:^(BPDeviceError error) {
444// [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
445//
446// }];
447//
448// }else{
449// [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
450// }
451}
452
453
454
455RCT_EXPORT_METHOD(getOfflineData:(nonnull NSString *)mac){
456
457
458 if ([self getBP7WithMac:mac]!=nil) {
459 __weak typeof(self) weakSelf = self;
460 [[self getBP7WithMac:mac] commandBatchUpload:^(NSNumber *count) {
461 NSDictionary* response = @{
462 kACTION:kACTION_HISTORICAL_NUM_BP,
463 kHISTORICAL_NUM_BP:count
464 };
465 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:response];
466
467 } progress:^(NSNumber *progressValue) {
468
469 } dataArray:^(NSArray *bachArray) {
470 NSMutableArray * historyDataArray = [NSMutableArray array];
471
472 for(NSDictionary *dataDict in bachArray)
473 {
474
475 NSDate *date = [dataDict objectForKey:@"time"];
476
477 //将时间格式转化成字符串,适配plugin和react native
478 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
479 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
480 NSString *dateStr = [mydateFormatter stringFromDate:date];
481 NSDictionary* historyDataDict = @{
482 kMEASUREMENT_DATE_BP:dateStr,
483 kHIGH_BLOOD_PRESSURE_BP:dataDict[@"sys"],
484 kLOW_BLOOD_PRESSURE_BP:dataDict[@"dia"],
485 kPULSE_BP:dataDict[@"heartRate"],
486 kMEASUREMENT_AHR_BP:dataDict[@"irregular"],
487 // kMEASUREMENT_HSD_BP:dataDict[@"hsdValue"],
488 kDATAID:dataDict[@"dataID"]
489 };
490 [historyDataArray addObject:historyDataDict];
491
492
493 }
494
495 if (historyDataArray.count > 0) {
496 NSDictionary* deviceInfo = @{kACTION:kACTION_HISTORICAL_DATA_BP,kHISTORICAL_DATA_BP:[historyDataArray copy] };
497 [BPProfileModule sendEventToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithDict:deviceInfo];
498 }
499
500 } errorBlock:^(BPDeviceError error) {
501 [BPProfileModule sendErrorToEmitter:weakSelf eventNotify:EVENT_NOTIFY WithCode:error];
502
503 }];
504
505 }else{
506 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
507 }
508
509}
510
511
512
513RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
514 NSLog(@"iOS doesn't support disconnect normal BT devices");
515 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:900];
516
517}
518
519
520
521@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7SModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7SModule.h
new file mode 100755
index 0000000..7a3d63f
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7SModule.h
@@ -0,0 +1,19 @@
1//
2// BP7SModule.h
3// ReactNativeIOSLibrary
4//
5// Created by Liu Yanbo on 2016/12/05.
6// Copyright © 2016年 Liu Yanbo. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16
17@interface BP7SModule : RCTEventEmitter<RCTBridgeModule>
18
19@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7SModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7SModule.m
new file mode 100755
index 0000000..95986bc
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BP7SModule.m
@@ -0,0 +1,284 @@
1//
2// BP7SModule.m
3// ReactNativeIOSLibrary
4//
5// Created by Liu Yanbo on 2016/12/05.
6// Copyright © 2016年 Liu Yanbo. All rights reserved.
7//
8
9#import "BP7SModule.h"
10#import "BPProfileModule.h"
11#import "BPMacroFile.h"
12#import "BP7SController.h"
13#import "BP7S.h"
14#import "iHealthDeviceManagerModule.h"
15#import "ScanDeviceController.h"
16#import "ConnectDeviceController.h"
17#define EVENT_NOTIFY @"BP7S.MODULE.NOTIFY"
18
19@implementation BP7SModule
20RCT_EXPORT_MODULE()
21- (NSArray<NSString *> *)supportedEvents {
22 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
23 @"event_device_connected", @"event_device_connect_failed",
24 @"event_device_disconnect", @"event_authenticate_result",
25 @"event_notify_ts28b", @"event_notify_bg1",
26 @"action_connect_result_for_bg1"];
27}
28
29
30- (NSDictionary *)constantsToExport
31{
32 return @{
33 @"Event_Notify":EVENT_NOTIFY,
34
35 };
36}
37
38+ (BOOL)requiresMainQueueSetup
39{
40 return YES;
41}
42-(BP7S*)getDeviceWithMac:(NSString*)mac{
43
44 BP7SController *controller = [BP7SController shareBP7SController];
45 NSArray *bpDeviceArray = [controller getAllCurrentBP7SInstace];
46
47 for(BP7S *tempDevice in bpDeviceArray){
48 if([mac isEqualToString:tempDevice.serialNumber]){
49
50 return tempDevice;
51 }
52 }
53
54 return nil;
55}
56
57#pragma mark-获取连接设备
58RCT_EXPORT_METHOD(getAllConnectedDevices){
59
60
61 NSArray*bp7Sarray= [[BP7SController shareBP7SController] getAllCurrentBP7SInstace];
62
63 NSMutableArray*deviceMacArray=[NSMutableArray array];
64
65 for (int i=0; i<[bp7Sarray count]; i++) {
66
67 BP7S*bp7s=[bp7Sarray objectAtIndex:i];
68
69 [deviceMacArray addObject:bp7s.serialNumber];
70
71 }
72
73 NSDictionary* deviceInfo = @{@"action":@"ACTION_GET_ALL_CONNECTED_DEVICES",@"devices":deviceMacArray};
74
75 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
76
77
78}
79
80
81
82#pragma mark - Method
83
84RCT_EXPORT_METHOD(getFunctionInfo:(nonnull NSString *)mac){
85
86 if ([self getDeviceWithMac:mac]!=nil) {
87
88
89 [[self getDeviceWithMac:mac] commandFunction:^(NSDictionary *dic) {
90
91 NSDictionary* response = @{
92 kACTION:kACTION_FUNCTION_INFORMATION_BP,
93 kFUNCTION_IS_UPAIR_MEASURE:dic[@"upAirMeasureFlg"],
94 kFUNCTION_IS_ARM_MEASURE:dic[@"armMeasureFlg"],
95 kFUNCTION_HAVE_ANGLE_SENSOR:dic[@"haveAngleSensor"],
96 kFUNCTION_HAVE_OFFLINE:dic[@"haveOffline"],
97 kFUNCTION_HAVE_ANGLE_SETTING:dic[@"haveAngleSet"],
98 kFUNCTION_IS_MULTI_UPLOAD:dic[@"mutableUpload"],
99 kFUNCTION_HAVE_SELF_UPDATE:dic[@"selfUpdate"],
100 kFUNCTION_HAVE_HSD:dic[@"haveHSD"]
101 };
102 [BPProfileModule sendEventToEmitter:self eventNotify:EVENT_NOTIFY WithDict:response];
103 } errorBlock:^(BPDeviceError error) {
104 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:error];
105 }];
106 }else{
107 NSLog(@"error %d",BPDidDisconnect);
108 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
109 }
110
111
112}
113
114//getOffLineNum
115RCT_EXPORT_METHOD(getOffLineNum:(nonnull NSString *)mac){
116
117 if ([self getDeviceWithMac:mac]!=nil) {
118
119 [[self getDeviceWithMac:mac] commandTransferMemoryTotalCount:^(NSNumber *count) {
120 NSDictionary* response = @{
121 kACTION:kACTION_HISTORICAL_NUM_BP,
122 kHISTORICAL_NUM_BP:count,
123 };
124 [BPProfileModule sendEventToEmitter:self eventNotify:EVENT_NOTIFY WithDict:response];
125 } errorBlock:^(BPDeviceError error) {
126 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:error];
127 }];
128 }else{
129 NSLog(@"error %d",BPDidDisconnect);
130 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
131 }
132
133
134}
135
136//getOffLineData
137RCT_EXPORT_METHOD(getOffLineData:(nonnull NSString *)mac){
138
139 if ([self getDeviceWithMac:mac]!=nil) {
140 [[self getDeviceWithMac:mac] commandTransferMemoryDataWithTotalCount:^(NSNumber *count) {
141 if (count.integerValue == 0) {
142 NSDictionary* response = @{
143 kACTION:kACTION_HISTORICAL_DATA_BP,
144 };
145 [BPProfileModule sendEventToEmitter:self eventNotify:EVENT_NOTIFY WithDict:response];
146 }
147 } progress:^(NSNumber *progress) {
148 NSLog(@"pregress %@",progress);
149 } dataArray:^(NSArray *array) {
150 NSLog(@"dataArray %@",array);
151 NSMutableArray* historyDataArray = [NSMutableArray array];
152 for (NSDictionary* dataDict in array) {
153 if ([dataDict isKindOfClass:[NSDictionary class]]) {
154 NSDate *tempDate = [dataDict objectForKey:@"time"];
155
156 //将时间格式转化成字符串,适配plugin和react native
157 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
158 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
159 NSString *dateStr = [mydateFormatter stringFromDate:tempDate];
160 NSDictionary* historyDataDict = @{
161 kMEASUREMENT_DATE_BP:dateStr,
162 kHIGH_BLOOD_PRESSURE_BP:dataDict[@"sys"],
163 kLOW_BLOOD_PRESSURE_BP:dataDict[@"dia"],
164 kPULSE_BP:dataDict[@"heartRate"],
165 kMEASUREMENT_AHR_BP:dataDict[@"irregular"],
166 kMEASUREMENT_HSD_BP:dataDict[@"hsdValue"],
167 kMEASUREMENT_STRAT_ANGLE_BP: dataDict[@"startAngle"],
168 kMEASUREMENT_ANGLE_CHANGE_BP:dataDict[@"measureAngleChange"],
169 kMEASUREMENT_HAND_BP:dataDict[@"chooseHand"],
170 kDATAID:dataDict[@"dataID"]
171 };
172 [historyDataArray addObject:historyDataDict];
173 }
174 }
175 if (historyDataArray.count > 0) {
176 NSDictionary* response = @{
177 kACTION:kACTION_HISTORICAL_DATA_BP,
178 kHISTORICAL_DATA_BP:[historyDataArray copy]
179 };
180 [BPProfileModule sendEventToEmitter:self eventNotify:EVENT_NOTIFY WithDict:response];
181 }
182 } errorBlock:^(BPDeviceError error) {
183 NSLog(@"error %d",error);
184 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:error];
185 }];
186
187 }else{
188 NSLog(@"error %d",BPDidDisconnect);
189 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
190 }
191
192
193}
194//getBattery
195RCT_EXPORT_METHOD(getBattery:(nonnull NSString *)mac){
196
197 if ([self getDeviceWithMac:mac]!=nil) {
198 [[self getDeviceWithMac:mac] commandEnergy:^(NSNumber *energyValue) {
199 NSLog(@"energyValue %@",energyValue);
200 NSDictionary* response = @{
201 kACTION:kACTION_BATTERY_BP,
202 kBATTERY_BP:energyValue,
203 };
204 [BPProfileModule sendEventToEmitter:self eventNotify:EVENT_NOTIFY WithDict:response];
205 } errorBlock:^(BPDeviceError error) {
206 NSLog(@"error %d",error);
207 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:error];
208 }];
209 }else{
210 NSLog(@"error %d",BPDidDisconnect);
211 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
212 }
213
214
215}
216//setUnit
217RCT_EXPORT_METHOD(setUnit:(nonnull NSString *)mac unit:(nonnull NSNumber*)unit){
218
219 if ([unit integerValue] > 1 || [unit integerValue] < 0) {
220 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPInputParameterError];
221 return;
222 }
223
224 if ([self getDeviceWithMac:mac]!=nil) {
225 [[self getDeviceWithMac:mac] commandSetUnit:[unit integerValue] > 0 ? @"kPa" : @"mmHg" disposeSetReslut:^{
226 NSLog(@"set unit success");
227 NSDictionary* response = @{
228 kACTION:kACTION_SET_UNIT_SUCCESS_BP,
229 };
230 [BPProfileModule sendEventToEmitter:self eventNotify:EVENT_NOTIFY WithDict:response];
231 } errorBlock:^(BPDeviceError error) {
232 NSLog(@"error %d",error);
233 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:error];
234 }];
235 }else{
236 NSLog(@"error %d",BPDidDisconnect);
237 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
238 }
239
240
241}
242//angleSet
243RCT_EXPORT_METHOD(angleSet:(nonnull NSString *)mac hl:(nonnull NSNumber*)hl ll:(nonnull NSNumber*)ll hr:(nonnull NSNumber*)hr lr:(nonnull NSNumber*)lr){
244
245 if ([self getDeviceWithMac:mac]!=nil) {
246 NSDictionary* dict = @{
247 @"highAngleForLeft":hl,
248 @"lowAngleForLeft":ll,
249 @"highAngleForRight":hr,
250 @"lowAngleForRight":lr
251 };
252
253 [[self getDeviceWithMac:mac] commandSetAngle:dict disposeSetReslut:^{
254 NSDictionary* response = @{
255 kACTION:kACTION_SET_ANGLE_SUCCESS_BP,
256 };
257 [BPProfileModule sendEventToEmitter:self eventNotify:EVENT_NOTIFY WithDict:response];
258 } errorBlock:^(BPDeviceError error) {
259 NSLog(@"error %d",error);
260 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:error];
261 }];
262 }else{
263 NSLog(@"error %d",BPDidDisconnect);
264 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
265 }
266
267
268}
269
270RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
271
272 if ([self getDeviceWithMac:mac]!=nil) {
273 [[self getDeviceWithMac:mac] commandDisconnectDevice];
274 }else{
275 NSLog(@"error %d",BPDidDisconnect);
276 [BPProfileModule sendErrorToEmitter:self eventNotify:EVENT_NOTIFY WithCode:BPDidDisconnect];
277 }
278
279
280}
281
282
283
284@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BPProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BPProfileModule.h
new file mode 100755
index 0000000..5fa5fd4
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BPProfileModule.h
@@ -0,0 +1,83 @@
1//
2// BPProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTEventEmitter.h>)
11#import <React/RCTEventEmitter.h>
12#else
13#import "RCTEventEmitter.h"
14#endif
15@interface BPProfileModule : NSObject<RCTBridgeModule>
16
17#define kACTION_ERROR_BP @"error_bp"
18#define kERROR_DESCRIPTION_BP @"description"
19#define kACTION_BATTERY_BP @"battery_bp"
20#define kACTION_ZOREING_BP @"zoreing_bp"
21#define kACTION_ZOREOVER_BP @"zoreover_bp"
22#define kACTION_ONLINE_PRESSURE_BP @"online_pressure_bp"
23#define kACTION_ONLINE_PULSEWAVE_BP @"online_pulsewave_bp"
24#define kACTION_ONLINE_RESULT_BP @"online_result_bp"
25#define kACTION_HISTORICAL_NUM_BP @"offlinenum"
26#define kACTION_HISTORICAL_DATA_BP @"historicaldata_bp"
27#define kACTION_HISTORICAL_OVER_BP @"get_historical_over_bp"
28#define kACTION_FUNCTION_INFORMATION_BP @"function_info_bp"
29#define kACTION_SET_UNIT_SUCCESS_BP @"set_unit_success"
30#define kACTION_SET_ANGLE_SUCCESS_BP @"set_angle_success"
31#define kACTION_INTERRUPTED_BP @"interrupted_bp"
32#define kACTION_Delete_BP @"delete_bp"
33
34
35#define kACTION_ENABLE_OFFLINE_BP @"enable_offline_bp"
36#define kACTION_DISENABLE_OFFLINE_BP @"disenable_offline_bp"
37#define kACTION_IS_ENABLE_OFFLINE @"offlinestatus"
38
39#define kMessage @"Message"
40#define kIDPS @"idps"
41#define kACTION @"action"
42#define kERROR_NUM_BP @"error"
43#define kBATTERY_BP @"battery"
44#define kBLOOD_PRESSURE_BP @"pressure"
45#define kFLAG_HEARTBEAT_BP @"heartbeat"
46#define kPULSEWAVE_BP @"wave"
47#define kHIGH_BLOOD_PRESSURE_BP @"sys"
48#define kLOW_BLOOD_PRESSURE_BP @"dia"
49#define kPULSE_BP @"heartRate"
50#define kMEASUREMENT_DATE_BP @"date"
51#define kMEASUREMENT_AHR_BP @"arrhythmia"
52#define kMEASUREMENT_HSD_BP @"hsd"
53#define kMEASUREMENT_STRAT_ANGLE_BP @"startAngle"
54#define kMEASUREMENT_ANGLE_CHANGE_BP @"measureAngleChange"
55#define kMEASUREMENT_HAND_BP @"chooseHand"
56#define kDATAID @"dataID"
57#define kHISTORICAL_NUM_BP @"offlinenum"
58#define kHISTORICAL_DATA_BP @"data"
59#define kIS_ENABLE_OFFLINE @"offlinestatus"
60
61#define kFUNCTION_IS_UPAIR_MEASURE @"upAirMeasureFlg"
62#define kFUNCTION_IS_ARM_MEASURE @"armMeasureFlg"
63#define kFUNCTION_HAVE_ANGLE_SENSOR @"haveAngleSensor"
64#define kFUNCTION_HAVE_OFFLINE @"haveOffline"
65#define kFUNCTION_HAVE_ANGLE_SETTING @"haveAngleSet"
66#define kFUNCTION_IS_MULTI_UPLOAD @"mutableUpload"
67#define kFUNCTION_HAVE_SELF_UPDATE @"selfUpdate"
68#define kFUNCTION_HAVE_HSD @"haveHSD"
69
70#define kANGLE_BP @"angle"
71
72#define kWHICH_ARM @"which_arm"
73
74#define kACTION_ANGLE_BP @"angle_bp"
75
76#define kMAC @"mac"
77#define kType @"type"
78
79
80+ (void)sendErrorToEmitter:(RCTEventEmitter *)emitter eventNotify:(NSString*)eventNotify WithCode:(NSInteger)errorCode;
81+ (void)sendEventToEmitter:(RCTEventEmitter *)emitter eventNotify:(NSString*)eventNotify WithDict:(NSDictionary*)dict;
82
83@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BPProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BPProfileModule.m
new file mode 100755
index 0000000..6417dc5
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BPProfileModule.m
@@ -0,0 +1,182 @@
1//
2// BPProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "BPProfileModule.h"
10#import "BPMacroFile.h"
11@implementation BPProfileModule
12
13
14
15
16RCT_EXPORT_MODULE()
17
18#pragma mark
19#pragma mark - constantsToExport
20
21
22- (NSDictionary *)constantsToExport
23{
24 return @{
25 @"ACTION_ERROR_BP":kACTION_ERROR_BP,
26 @"ACTION_BATTERY_BP":kACTION_BATTERY_BP,
27 @"ACTION_ZOREING_BP":kACTION_ZOREING_BP,
28 @"ACTION_ZOREOVER_BP":kACTION_ZOREOVER_BP,
29 @"ACTION_ONLINE_PRESSURE_BP":kACTION_ONLINE_PRESSURE_BP,
30 @"ACTION_ONLINE_PULSEWAVE_BP":kACTION_ONLINE_PULSEWAVE_BP,
31 @"ACTION_ONLINE_RESULT_BP":kACTION_ONLINE_RESULT_BP,
32 @"ACTION_HISTORICAL_NUM_BP":kACTION_HISTORICAL_NUM_BP,
33 @"ACTION_HISTORICAL_DATA_BP":kACTION_HISTORICAL_DATA_BP,
34 @"ACTION_HISTORICAL_OVER_BP":kACTION_HISTORICAL_OVER_BP,
35 @"ACTION_FUNCTION_INFORMATION_BP":kACTION_FUNCTION_INFORMATION_BP,
36 @"ACTION_SET_UNIT_SUCCESS_BP":kACTION_SET_UNIT_SUCCESS_BP,
37 @"ACTION_SET_ANGLE_SUCCESS_BP":kACTION_SET_ANGLE_SUCCESS_BP,
38 @"ACTION_INTERRUPTED_BP":kACTION_INTERRUPTED_BP,
39
40 @"ACTION_ENABLE_OFFLINE_BP":kACTION_ENABLE_OFFLINE_BP,
41 @"ACTION_DISENABLE_OFFLINE_BP":kACTION_DISENABLE_OFFLINE_BP,
42 @"ACTION_IS_ENABLE_OFFLINE":kACTION_IS_ENABLE_OFFLINE,
43
44 @"ERROR_NUM_BP":kERROR_NUM_BP,
45 @"BATTERY_BP":kBATTERY_BP,
46 @"BLOOD_PRESSURE_BP":kBLOOD_PRESSURE_BP,
47 @"FLAG_HEARTBEAT_BP":kFLAG_HEARTBEAT_BP,
48 @"PULSEWAVE_BP":kPULSEWAVE_BP,
49 @"HIGH_BLOOD_PRESSURE_BP":kHIGH_BLOOD_PRESSURE_BP,
50 @"LOW_BLOOD_PRESSURE_BP":kLOW_BLOOD_PRESSURE_BP,
51 @"PULSE_BP":kPULSE_BP,
52 @"MEASUREMENT_DATE_BP":kMEASUREMENT_DATE_BP,
53 @"MEASUREMENT_AHR_BP":kMEASUREMENT_AHR_BP,
54 @"MEASUREMENT_HSD_BP":kMEASUREMENT_HSD_BP,
55 @"MEASUREMENT_STRAT_ANGLE_BP":kMEASUREMENT_STRAT_ANGLE_BP,
56 @"MEASUREMENT_ANGLE_CHANGE_BP":kMEASUREMENT_ANGLE_CHANGE_BP,
57 @"MEASUREMENT_HAND_BP":kMEASUREMENT_HAND_BP,
58 @"DATAID":kDATAID,
59 @"IS_ENABLE_OFFLINE":kIS_ENABLE_OFFLINE,
60
61 @"HISTORICAL_NUM_BP":kHISTORICAL_NUM_BP,
62 @"HISTORICAL_DATA_BP":kHISTORICAL_DATA_BP,
63
64 @"FUNCTION_IS_UPAIR_MEASURE":kFUNCTION_IS_UPAIR_MEASURE,
65 @"FUNCTION_IS_ARM_MEASURE":kFUNCTION_IS_ARM_MEASURE,
66 @"FUNCTION_HAVE_ANGLE_SENSOR":kFUNCTION_HAVE_ANGLE_SENSOR,
67 @"FUNCTION_HAVE_OFFLINE":kFUNCTION_HAVE_OFFLINE,
68 @"FUNCTION_HAVE_ANGLE_SETTING":kFUNCTION_HAVE_ANGLE_SETTING,
69 @"FUNCTION_IS_MULTI_UPLOAD":kFUNCTION_IS_MULTI_UPLOAD,
70 @"FUNCTION_HAVE_SELF_UPDATE":kFUNCTION_HAVE_SELF_UPDATE,
71 @"FUNCTION_HAVE_HSD":kFUNCTION_HAVE_HSD,
72 @"ERROR_DESCRIPTION_BP":kERROR_DESCRIPTION_BP,
73
74 @"ACTION_ANGLE_BP":kACTION_ANGLE_BP,
75
76 @"ANGLE_BP":kANGLE_BP,
77
78 @"WHICH_ARM":kWHICH_ARM,
79
80 @"ACTION_GET_ALL_CONNECTED_DEVICES":@"ACTION_GET_ALL_CONNECTED_DEVICES",
81 };
82}
83+ (BOOL)requiresMainQueueSetup
84{
85 return YES;
86}
87+ (NSString*)descriptionForErrorCode:(NSInteger)errorCode{
88 switch (errorCode) {
89 case BPError0:
90 return @"not find a suitable zero in 20s.";
91 case BPError1:
92 return @"not find high pressure.";
93 case BPError2:
94 return @"not find low pressure or the high pressure value is lower than the low pressure value.";
95 case BPError3:
96 return @"pressurization fast.";
97 case BPError4:
98 return @"pressurization slow.";
99 case BPError5:
100 return @"pressure exceeds 300mmHg.";
101 case BPError6:
102 return @"time of pressure greater than 15 mmHg exceeds 160s.";
103 case BPError7:
104 return @"EE read and write error.";
105 case BPError8:
106 return @"EE three backup data error.";
107 case BPError9:
108 return @"retention.";
109 case BPError10:
110 return @"SPAN value error.";
111 case BPError11:
112 return @"CRC errors.";
113 case BPError12:
114 return @"connect error.";
115 case BPError13:
116 return @"low power tips.";
117 case BPError14:
118 return @"device bluetooth set failed";
119 case BPError15:
120 return @"high or low pressure value of measurement exceeds the set upper limit.";
121 case BPError16:
122 return @"high or low pressure value of measurement exceeds the set lower limit.";
123 case BPError17:
124 return @"arm movement during the measurement over the machine set point.";
125 case BPNormalError:
126 return @"device error, error message displayed automatically";
127 case BPOverTimeError:
128 return @"abnormal communication";
129 case BPNoRespondError:
130 return @"abnormal communication";
131 case BPBeyondRangeError:
132 return @"device is out of communication range.";
133 case BPDidDisconnect:
134 return @"device is disconnected.";
135 case BPAskToStopMeasure:
136 return @"measurement has been stopped.";
137 case BPDeviceBusy:
138 return @"device is busy doing other things";
139 case BPInputParameterError:
140 return @"the argument of method is illegal.";
141 case 401:
142 return @"the operation is illegal";
143 case 900:
144 return @"iOS doesn't support disconnect normal BT devices";
145 }
146 return @"unknown error";
147}
148
149
150+ (void)sendErrorToEmitter:(RCTEventEmitter *)emitter eventNotify:(NSString*)eventNotify WithCode:(NSInteger)errorCode{
151 NSDictionary* errorDict;
152
153
154 if(errorCode==BPDidDisconnect){
155
156
157 errorDict = @{
158 kACTION:kACTION_ERROR_BP,
159 kERROR_DESCRIPTION_BP:[self descriptionForErrorCode:errorCode]
160 };
161
162 }else{
163
164
165 errorDict = @{
166 kACTION:kACTION_ERROR_BP,
167 kERROR_NUM_BP:@(errorCode),
168 kERROR_DESCRIPTION_BP:[self descriptionForErrorCode:errorCode]
169 };
170
171
172 }
173
174 [self sendEventToEmitter:emitter eventNotify:eventNotify WithDict:errorDict];
175}
176
177+ (void)sendEventToEmitter:(RCTEventEmitter *)emitter eventNotify:(NSString*)eventNotify WithDict:(NSDictionary*)dict{
178 [emitter sendEventWithName:eventNotify body:dict];
179}
180
181
182@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMModule.h
new file mode 100755
index 0000000..dc20029
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMModule.h
@@ -0,0 +1,19 @@
1//
2// BTMModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16@interface BTMModule : RCTEventEmitter<RCTBridgeModule>
17
18
19@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMModule.m
new file mode 100644
index 0000000..779b141
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMModule.m
@@ -0,0 +1,370 @@
1//
2// BTMModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "BTMModule.h"
10#import "THV3.h"
11#import "THV3Controller.h"
12#import "BTMProfileModule.h"
13
14@implementation BTMModule{
15
16
17 NSMutableDictionary*resultDic;
18
19}
20
21#define EVENT_NOTIFY @"event_notify_po3"
22
23
24RCT_EXPORT_MODULE()
25- (NSArray<NSString *> *)supportedEvents {
26 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
27 @"event_device_connected", @"event_device_connect_failed",
28 @"event_device_disconnect", @"event_authenticate_result",
29 @"event_notify_ts28b", @"event_notify_bg1",
30 @"action_connect_result_for_bg1"];
31}
32
33
34
35#pragma mark
36#pragma mark - constantsToExport
37- (NSDictionary *)constantsToExport
38{
39 return @{ @"Event_Notify": EVENT_NOTIFY };
40
41}
42+ (BOOL)requiresMainQueueSetup
43{
44 return YES;
45}
46
47#pragma mark
48#pragma mark - Init
49-(id)init
50{
51 if (self=[super init])
52 {
53
54 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(reciveDeviceData:) name:@"THV3NewDataCome" object:nil];
55
56 }
57 return self;
58}
59
60-(THV3*)getTHV3WithMac:(NSString*)mac{
61
62 THV3Controller *controller = [THV3Controller sharedController];
63 NSArray *thvDeviceArray = [controller allCurrentInstance];
64
65 for(THV3 *tempTHV3 in thvDeviceArray){
66 if([mac isEqualToString:tempTHV3.serialNumber]){
67
68 return tempTHV3;
69 break;
70 }
71 }
72
73 return nil;
74}
75
76-(void)reciveDeviceData:(NSNotification *)tempNoti{
77
78 NSDictionary *infoDic=[tempNoti object];
79
80 THV3*myTHV3=[self getTHV3WithMac:[infoDic valueForKey:@"SerialNumber"]];
81
82 THV3RcvDataType rtDataType=myTHV3.rtDataType;
83
84 NSNumber*target;
85
86 if (myTHV3.isTargetHuman) {
87
88 target=@1;
89
90 }else{
91
92 target=@2;
93 }
94
95 if (myTHV3!=nil) {
96
97 if (rtDataType==THV3RcvDataRT) {
98
99 THV3HistoryData* rtTemperature=myTHV3.rtTemperature;
100
101 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
102 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
103
104 if (rtTemperature.measureDate!=nil) {
105
106 NSDictionary* deviceInfo = @{BTM_ACTION:BTM_ACTION_MEASURE,BTM_TEMPERATURE:[NSNumber numberWithFloat:rtTemperature.temperature],BTM_MEASURE_TIME:[mydateFormatter stringFromDate:rtTemperature.measureDate],BTM_TEMPERATURE_TARGET:target};
107 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
108 }
109
110
111
112
113 }else{
114
115
116
117 }
118 }else{
119
120
121 NSDictionary* deviceInfo = @{BTM_ACTION:BTM_ACTION_ERROR,BTM_ERROR_DESCRIPTION:@"disconnect"};
122 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
123
124 }
125
126
127
128}
129
130#pragma mark
131#pragma mark - Method
132
133RCT_EXPORT_METHOD(getAllConnectedDevices){
134
135
136 NSArray*thv3array= [[THV3Controller sharedController] allCurrentInstance];
137
138 NSMutableArray*deviceMacArray=[NSMutableArray array];
139
140 for (int i=0; i<[thv3array count]; i++) {
141
142 THV3*thv3=[thv3array objectAtIndex:i];
143
144 [deviceMacArray addObject:thv3.serialNumber];
145
146 }
147
148 NSDictionary* deviceInfo = @{@"action":@"ACTION_GET_ALL_CONNECTED_DEVICES",BTM_DEVICE:deviceMacArray};
149
150 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
151
152
153}
154
155
156
157RCT_EXPORT_METHOD(getBattery:(nonnull NSString *)mac){
158
159 BOOL voltIsNormal = [self getTHV3WithMac:mac].voltIsNormal;
160
161 NSNumber*battNum;
162
163 if (voltIsNormal) {
164 battNum=@1;
165 }else{
166
167 battNum=@0;
168 }
169
170 NSDictionary* deviceInfo = @{BTM_ACTION:BTM_ACTION_BATTERY,BTM_BATTERY:battNum};
171 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
172
173}
174
175RCT_EXPORT_METHOD(getMemoryData:(nonnull NSString *)mac){
176
177
178 if ([self getTHV3WithMac:mac]!=nil) {
179
180 [[self getTHV3WithMac:mac] readHistoryDataWithResultBlock:^(NSArray<THV3HistoryData *> *dataArray) {
181
182 NSMutableArray * tempArr = [[NSMutableArray alloc]init];
183
184 for (int i=0; i<dataArray.count; i++) {
185 //将时间格式转化成字符串,适配plugin和react native
186 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
187 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
188 NSString *dateStr = [mydateFormatter stringFromDate:[dataArray objectAtIndex:i].measureDate];
189
190 NSNumber*target;
191
192 if ([dataArray objectAtIndex:i].isHumanBody) {
193
194 target=@1;
195 }else{
196
197 target=@2;
198 }
199
200 NSDictionary *dic = @{BTM_MEASURE_TIME:dateStr,BTM_TEMPERATURE:[NSNumber numberWithFloat:[dataArray objectAtIndex:i].temperature],BTM_TEMPERATURE_TARGET:target};
201
202 [tempArr addObject:dic];
203 }
204
205 if (tempArr.count>0) {
206
207 NSDictionary* deviceInfo = @{BTM_ACTION:BTM_ACTION_MEMORY,BTM_TEMPERATURE_ARRAY:tempArr,BTM_MEMORY_COUNT:[NSNumber numberWithInt:tempArr.count]};
208 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
209 }
210
211
212 }];
213
214
215 }else{
216
217 NSDictionary* deviceInfo = @{BTM_ACTION:BTM_ACTION_ERROR,BTM_ERROR_DESCRIPTION:@"disconnect"};
218 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
219
220 }
221
222}
223
224RCT_EXPORT_METHOD(setStandbyTime:(nonnull NSString *)mac :(nonnull NSNumber *)hour:(nonnull NSNumber *)min:(nonnull NSNumber *)sec){
225
226 if ([self getTHV3WithMac:mac]!=nil) {
227
228 [[self getTHV3WithMac:mac] configIdleTime:[[NSDate date]timeIntervalSince1970] withResultBlock:^(BOOL success) {
229
230 NSDictionary* deviceInfo = @{BTM_ACTION:BTM_ACTION_CALLBACK};
231 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
232
233 }];
234
235
236 }else{
237
238 NSDictionary* deviceInfo = @{BTM_ACTION:BTM_ACTION_ERROR,BTM_ERROR_DESCRIPTION:@"disconnect"};
239 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
240
241 }
242
243
244
245
246
247}
248RCT_EXPORT_METHOD(setTemperatureUnit:(nonnull NSString *)mac:(nonnull NSNumber *)unit){
249
250 if ([self getTHV3WithMac:mac]!=nil) {
251
252 BOOL isUnitC=YES;
253
254 if ([unit intValue]==1) {
255
256 isUnitC=YES;
257
258 }else{
259
260 isUnitC=NO;
261 }
262
263 [[self getTHV3WithMac:mac] configTemperUnit:isUnitC withResultBlock:^(BOOL success) {
264
265 NSDictionary* deviceInfo = @{BTM_ACTION:BTM_ACTION_CALLBACK};
266 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
267
268 }];
269
270
271 }else{
272
273 NSDictionary* deviceInfo = @{BTM_ACTION:BTM_ACTION_ERROR,BTM_ERROR_DESCRIPTION:@"disconnect"};
274 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
275
276 }
277
278
279
280}
281RCT_EXPORT_METHOD(setMeasuringTarget:(nonnull NSString *)mac :(nonnull NSNumber *)target){
282
283 if ([self getTHV3WithMac:mac]!=nil) {
284
285 BOOL istarget=YES;
286
287 if ([target intValue]==1) {
288
289 istarget=YES;
290
291 }else{
292
293 istarget=NO;
294 }
295
296 [[self getTHV3WithMac:mac] configMeasureTarget:istarget withResultBlock:^(BOOL success) {
297 NSDictionary* deviceInfo = @{BTM_ACTION:BTM_ACTION_CALLBACK};
298 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
299
300 }];
301
302
303 }else{
304
305 NSDictionary* deviceInfo = @{BTM_ACTION:BTM_ACTION_ERROR,BTM_ERROR_DESCRIPTION:@"disconnect"};
306 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
307
308 }
309
310
311}
312RCT_EXPORT_METHOD(setOfflineTarget:(nonnull NSString *)mac:(nonnull NSNumber *)target){
313
314 if ([self getTHV3WithMac:mac]!=nil) {
315
316 BOOL istarget=YES;
317
318 if ([target intValue]==1) {
319
320 istarget=NO;
321
322 }else{
323
324 istarget=YES;
325 }
326
327 [[self getTHV3WithMac:mac] configOfflineMode:istarget withResultBlock:^(BOOL success) {
328
329 NSDictionary* deviceInfo = @{BTM_ACTION:BTM_ACTION_CALLBACK};
330 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
331
332 }];
333
334
335 }else{
336
337 NSDictionary* deviceInfo = @{BTM_ACTION:BTM_ACTION_ERROR,BTM_ERROR_DESCRIPTION:@"disconnect"};
338 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
339
340 }
341
342}
343
344RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
345
346
347
348
349 if ([self getTHV3WithMac:mac]!=nil) {
350
351 [[self getTHV3WithMac:mac] commandDisconnectDevice];
352
353// NSDictionary* deviceInfo = @{BTM_ACTION:BTM_ACTION_CALLBACK};
354// [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
355
356 }else{
357
358
359
360 }
361
362
363
364}
365
366
367
368
369
370@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMProfileModule.h
new file mode 100755
index 0000000..e19f1a9
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMProfileModule.h
@@ -0,0 +1,50 @@
1//
2// BTMProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15@interface BTMProfileModule : NSObject<RCTBridgeModule>
16
17
18
19#define BTMACTION @"event_notify_btm"
20#define BTM_ACTION @"action"
21
22#define BTM_BATTERY @"battery"
23
24#define BTM_ACTION_BATTERY @"battery_btm"
25
26#define BTM_ACTION_MEMORY @"memory_btm"
27
28#define BTM_ACTION_MEASURE @"measure_btm"
29
30#define BTM_ACTION_CALLBACK @"btm_callback"
31
32#define BTM_ACTION_ERROR @"action_error_btm"
33
34#define BTM_MEMORY_COUNT @"memory_count"
35
36#define BTM_TEMPERATURE_ARRAY @"btm_temperature_array"
37
38#define BTM_TEMPERATURE_TARGET @"btm_temperature_target"
39
40#define BTM_TEMPERATURE @"btm_temperature"
41
42#define BTM_MEASURE_TIME @"measure_time"
43
44#define BTM_ERROR_DESCRIPTION @"description"
45
46#define BTM_ERROR_NUM @"error_num"
47
48#define BTM_DEVICE @"devices"
49
50@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMProfileModule.m
new file mode 100755
index 0000000..61ee3fe
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/BTMProfileModule.m
@@ -0,0 +1,47 @@
1//
2// BTMProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "BTMProfileModule.h"
10
11@implementation BTMProfileModule
12
13
14RCT_EXPORT_MODULE()
15
16#pragma mark
17#pragma mark - constantsToExport
18
19
20- (NSDictionary *)constantsToExport
21{
22 return @{
23 @"ACTION_BTM_BATTERY":BTM_ACTION_BATTERY,
24 @"BTM_BATTERY":BTM_BATTERY,
25 @"ACTION_BTM_MEMORY":BTM_ACTION_MEMORY,
26 @"ACTION_BTM_MEASURE":BTM_ACTION_MEASURE,
27 @"ACTION_BTM_CALLBACK":BTM_ACTION_CALLBACK,
28 @"ACTION_ERROR_BTM":BTM_ACTION_ERROR,
29 @"MEMORY_COUNT":BTM_MEMORY_COUNT,
30 @"BTM_TEMPERATURE_ARRAY":BTM_TEMPERATURE_ARRAY,
31 @"BTM_TEMPERATURE_TARGET":BTM_TEMPERATURE_TARGET,
32 @"BTM_TEMPERATURE":BTM_TEMPERATURE,
33 @"BTM_MEASURE_TIME":BTM_MEASURE_TIME,
34 @"ERROR_NUM_BTM":BTM_ERROR_NUM,
35 @"ERROR_DESCRIPTION_BTM":BTM_ERROR_DESCRIPTION,
36 @"devices":BTM_ERROR_DESCRIPTION,
37 @"ACTION_GET_ALL_CONNECTED_DEVICES":@"ACTION_GET_ALL_CONNECTED_DEVICES",
38 };
39};
40
41
42+ (BOOL)requiresMainQueueSetup
43{
44 return YES;
45}
46
47@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABI.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABI.h
new file mode 100644
index 0000000..a4416f9
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABI.h
@@ -0,0 +1,82 @@
1//
2// ABI.h
3// iHealthDemoCode
4//
5// Created by zhiwei jing on 14-11-18.
6// Copyright (c) 2014年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BPMacroFile.h"
11
12/**
13 ABI device class
14 */
15@interface ABI : NSObject
16
17@property (assign, nonatomic) BOOL hasLegMonitor;
18@property (strong, nonatomic) NSString *currentArmUUID;
19@property (strong, nonatomic) NSString *currentLegUUID;
20//‘serialNumber’ is for separating different device when multiple device have been connected.
21@property (strong, nonatomic) NSString *armSerialNumber;
22@property (strong, nonatomic) NSString *legSerialNumber;
23
24/**
25 * Query battery remaining energy
26 * @param armEnergy A block to return battery ratio of upper-arm BPM, 80 means 80%.
27 * @param legEnergy A block to return battery ratio of ankle BPM, 80 means 80%.
28 * @param error When error occur, this block will be callback.
29 */
30-(void)commandQueryEnergy:(BlockEnergyValue)armEnergy leg:(BlockEnergyValue)legEnergy errorBlock:(BlockError)error;
31
32
33/**
34 * Establish measurement connection and start BP measurement
35 * @Notice By the first time of new user register via SDK, ‘iHealth disclaimer’ will pop up automatically, and require the user agrees to continue. SDK application requires Internet connection; there is 10-day tryout if SDK cannot connect Internet, SDK is fully functional during tryout period, but will be terminated without verification through Internet after 10 days.
36 * @param blockZeroState Zeroing state
37 * @param armPressure Return Upper-arm blood pressure value during measurement, unit as mmHg
38 * @param legPressure Return Ankle blood pressure value during measurement, unit as mmHg.
39 * @param blockArmWaveletWithHeartbeat Return Wavelet value of upper-arm BPM, with heartbeats.
40 * @param blockLegWaveletWithHeartbeat Return Wavelet value of ankle BPM, with heartbeats.
41 * @param blockArmWaveletWithoutHeartbeat Return Wavelet value of upper-arm BPM, without heartbeats.
42 * @param blockLegWaveletWithoutHeartbeat Return Wavelet value of ankle BPM, without heartbeats.
43 * @param armResult Return BP value of upper-arm BPM, including time, sys, dia, heartRate, irregular heartbeat.
44 * @param legResult Return BP value of ankle BPM, including time, sys, dia, heartRate, irregular heartbeat.
45 * @param error When error occur, this block will be callback.
46 */
47-(void)commandStartMeasureWithZeroingState:(BlockZero)blockZeroState armPressure:(BlockPressure)armPressure legPressure:(BlockPressure)legPressure armWaveletWithHeartbeat:(BlockWavelet)blockArmWaveletWithHeartbeat legWaveletWithHeartbeat:(BlockWavelet)blockLegWaveletWithHeartbeat armWaveletWithoutHeartbeat:(BlockWavelet)blockArmWaveletWithoutHeartbeat legWaveletWithoutHeartbeat:(BlockWavelet)blockLegWaveletWithoutHeartbeat armResult:(BlockMeasureResult)armResult legResult:(BlockMeasureResult)legResult errorBlock:(BlockError)error;
48
49
50/**
51 * Measurement termination and stop ABI measurement
52 */
53-(void)stopABIMeassure;
54
55
56
57#pragma mark - Arm Measure Api
58/**
59 * Query battery remaining energy
60 * @param armEnergy A block to return battery ratio of upper-arm BPM, 80 means 80%.
61 * @param error When error occur, this block will be callback.
62 */
63-(void)commandQueryEnergy:(BlockEnergyValue)armEnergy errorBlock:(BlockError)error;
64
65
66/**
67 * Establish measurement connection and Start upper-arm BPM measurement.
68 * @param blockZeroState Zeroing state
69 * @param armPressure Return Upper-arm blood pressure value during measurement, unit as mmHg.
70 * @param blockArmWaveletWithHeartbeat The Wavelet value of upper-arm BPM, with heartbeats.
71 * @param blockArmWaveletWithoutHeartbeat The Wavelet value of upper-arm BPM, without heartbeats.
72 * @param armResult The BP value of upper-arm BPM, including time, sys, dia, heartRate, irregular heartbeat. irregular will be 0 or 1.
73 * @param error When error occur, this block will be callback.
74 */
75-(void)commandStartArmMeasureWithZeroingState:(BlockZero)blockZeroState armPressure:(BlockPressure)armPressure armWaveletWithHeartbeat:(BlockWavelet)blockArmWaveletWithHeartbeat armWaveletWithoutHeartbeat:(BlockWavelet)blockArmWaveletWithoutHeartbeat armResult:(BlockMeasureResult)armResult errorBlock:(BlockError)error;
76
77/**
78 * Measurement termination and stop upper-arm BPM measurement
79 */
80-(void)stopABIArmMeassure;
81
82@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABIController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABIController.h
new file mode 100644
index 0000000..5163aa0
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABIController.h
@@ -0,0 +1,28 @@
1//
2// ABIController.h
3// iHealthDemoCode
4//
5// Created by zhiwei jing on 14-11-18.
6// Copyright (c) 2014年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "ABI.h"
11
12/**
13 ABI controller class
14 */
15@interface ABIController : NSObject
16
17/**
18 * Initialize ABI controller class
19 */
20+(ABIController *)shareABIController;
21
22/**
23 * Get ABI instance,Access control class instance after receiving ABIConnectNoti/ArmConnectNoti, then use this instance to call ABI/ABI-Arm related communication methods.
24 * You can use hasLegMonitor property to distinguish whether connecting both arm&leg or only arm
25 */
26-(ABI *)currentInstance;
27
28@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABPM.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABPM.h
new file mode 100644
index 0000000..0a3e74a
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABPM.h
@@ -0,0 +1,144 @@
1//
2// ABPM.h
3// iHealthSDKStatic
4//
5// Created by Realank on 2017/9/26.
6// Copyright © 2017年 ihealthSDK. All rights reserved.
7//
8
9#import "BPBV10Device.h"
10
11/**
12 ABPM device class
13 */
14@interface ABPM : BPBV10Device<BPBasicBTLEProtocol,BPRealtimeMeasureProtocol,BPOfflineDataTransferProtocol>
15
16
17/**
18 * Synchronize time and return functions this device supports.
19 * @param function A block to return the functions and states that the device supports.
20 * @param error Operation failed, and returns the error codes.
21 */
22-(void)commandFunction:(BlockDeviceFunction)function errorBlock:(BlockError)error;
23
24/**
25 * Get battery remaining energy by percent
26 * @param energyValue A block to return the device battery remaining energy percentage, ‘80’ stands for 80%.
27 * @param error Operation failed, and returns the error codes.
28 */
29-(void)commandEnergy:(BlockEnergyValue)energyValue errorBlock:(BlockError)error;
30
31/**
32 * Get detailed battery remaining energy
33 * @param energyValueBlock A block to return the device's battery percentage, voltage and measure times left.
34 * @param errorBlock Operation failed, and returns the error codes.
35 */
36-(void)commandEnergyDetail:(BlockEnergyDetailValue)energyValueBlock errorBlock:(BlockError)errorBlock;
37
38/**
39 * Set units for the Device
40 * @param UnitName The unit name of the result, must be @"mmHg" or @"kPa".
41 * @param setResult This block return means set success.
42 * @param error Operation failed, and returns the error codes.
43 */
44-(void)commandSetUnit:(NSString *)UnitName disposeSetReslut:(BlockSuccess)setResult errorBlock:(BlockError)error;
45
46/**
47 * Disconnect current device
48 */
49-(void)commandDisconnectDevice;
50
51/**
52 * Start BP measurement.
53 * @param blockZeroState Zeroing state
54 * @param pressure Pressure value in the process of measurement, the unit is ‘mmHg’.
55 * @param blockWaveletWithHeartbeat Wavelet data set including pulse rate
56 * @param blockWaveletWithoutHeartbeat Wavelet data set without pulse rate
57 * @param result result of the measurement, including systolic pressure, diastolic pressure, pulse rate and irregular judgment. Relevant keys: time, sys, dia, heartRate, irregular. irregular will be 0 or 1.
58 * @param error Operation failed, and returns the error codes.
59 */
60-(void)commandStartMeasureWithZeroingState:(BlockZero)blockZeroState pressure:(BlockPressure)pressure waveletWithHeartbeat:(BlockWavelet)blockWaveletWithHeartbeat waveletWithoutHeartbeat:(BlockWavelet)blockWaveletWithoutHeartbeat result:(BlockMeasureResult)result errorBlock:(BlockError)error;
61
62/**
63 * Stop measurement
64 * @param success The block return means measurement has been terminated.
65 * @param error Operation failed, and returns the error codes.
66 */
67-(void)stopBPMeassureSuccessBlock:(BlockSuccess)success errorBlock:(BlockError)error;
68
69
70/**
71 * Upload history data.
72 * @param totalCount history data total Count.
73 * @param progress upload completion ratio , from 0.0 to 1.0.
74 * @param uploadDataArray offline data set, including measurement time, systolic pressure, diastolic pressure, pulse rate, irregular judgment,scheme ID,body movement flag. corresponding KEYs are time, sys, dia, heartRate, irregular,schemeID,bodyMovementFlg.
75 * @param error Operation failed, and returns the error codes.
76 */
77-(void)commandTransferMemoryDataWithTotalCount:(BlockBachCount)totalCount progress:(BlockBachProgress)progress dataArray:(BlockBachArray)uploadDataArray errorBlock:(BlockError)error;
78
79-(void)commandTransferMemoryDataAndRawPressureWithTotalCount:(BlockBachCount)totalCount progress:(BlockBachProgress)progress dataArray:(BlockBachArray)uploadDataArray errorBlock:(BlockError)error;
80
81/**
82 * Upload history data total Count.
83 * @param totalCount item quantity of total data.
84 * @param error Operation failed, and returns the error codes.
85 */
86-(void)commandTransferMemoryTotalCount:(BlockBachCount)totalCount errorBlock:(BlockError)error;
87
88
89/**
90 Delete all the history memory stored in device
91
92 @param successBlock A block refer to delete complete.
93 @param errorBlock Operation failed, and returns the error codes.
94 */
95- (void)commandDeleteAllMemoryWithSuccessBlock:(BlockSuccess)successBlock errorBlock:(BlockError)errorBlock;
96
97
98/**
99 Set ID String (eg.patientID, schemeID), length 100 max
100
101 @param idString the content of id
102 @param successBlock A block refer to success.
103 @param errorBlock Operation failed, and returns the error codes.
104 */
105- (void)commandSetIDString:(NSString*)idString successBlock:(BlockSuccess)successBlock errorBlock:(BlockError)errorBlock;
106
107
108/**
109 Ask ID String
110
111 @param idStringResultBlock return ID String
112 @param errorBlock Operation failed, and returns the error codes.
113 */
114- (void)commandAskIDStringWithResult:(BlockAskIDString)idStringResultBlock errorBlock:(BlockError)errorBlock;
115
116
117/**
118 Set auto loop measure scheme
119
120 @param scheme scheme content
121 @param successBlock A block refer to success.
122 @param errorBlock Operation failed, and returns the error codes.
123 */
124- (void)commandSetLoopMeasureScheme:(BPLoopMeasureSettingModel*)scheme successBlock:(BlockSuccess)successBlock errorBlock:(BlockError)errorBlock;
125
126
127/**
128 Get auto loop measure scheme
129
130 @param loopMeasureSchemeBlock return auto loop measure scheme content
131 @param errorBlock Operation failed, and returns the error codes.
132 */
133- (void)commandAskLoopMeasureScheme:(BlockAskLoopMeasureScheme)loopMeasureSchemeBlock errorBlock:(BlockError)errorBlock;
134
135
136/**
137 Change loop measure scheme status
138
139 @param start YES to start, NO to pause
140 @param successBlock A block refer to success.
141 @param errorBlock Operation failed, and returns the error codes.
142 */
143- (void)commandChangeLoopMeasureStatusToStart:(BOOL)start successBlock:(BlockSuccess)successBlock errorBlock:(BlockError)errorBlock;
144@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABPMController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABPMController.h
new file mode 100644
index 0000000..36e80fd
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ABPMController.h
@@ -0,0 +1,25 @@
1//
2// ABPMController.h
3// iHealthSDKStatic
4//
5// Created by Realank on 2017/9/26.
6// Copyright © 2017年 ihealthSDK. All rights reserved.
7//
8
9#import "BPController.h"
10
11/**
12 ABPM controller class
13 */
14@interface ABPMController : BPController
15/**
16 * Initialize ABPM controller class
17 */
18+ (ABPMController *)sharedController;
19
20/**
21 * Get all ABPM instance,Access control class instance after receiving BP3LConnectNoti then use instance to call ABPM related communication methods.
22 */
23- (NSArray *)allConnectedInstance;
24
25@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3.h
new file mode 100644
index 0000000..98b62cc
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3.h
@@ -0,0 +1,188 @@
1//
2// AM3.h
3// testShareCommunication
4//
5// Created by daiqingquan on 13-10-15.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "AMMacroFile.h"
11
12/**
13 AM3
14 */
15@interface AM3 : NSObject
16@property (strong, nonatomic) NSString *currentUUID;
17@property (strong, nonatomic) NSString *serialNumber;
18@property (strong, nonatomic) NSString *firmwareVersion;
19
20/**
21 * Get device userID
22 * @param getDeviceUserIDBlock get userID
23 * @param errorBlock Communication error codes, see AM3 error descriptions.
24 */
25-(void)commandAM3GetDeviceUserID:(DisposeAM3GetDeviceUserIDBlock)getDeviceUserIDBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
26
27
28/**
29 * Sync time
30 * @param syncTimeBlock True: Success, False: Failed.
31 * @param errorBlock Communication error codes, see AM3 error descriptions.
32 */
33-(void)commandAM3SyncTime:(DisposeAM3SyncTimeBlock)syncTimeBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
34
35
36/**
37 * Set time format and nation
38 * @param timeFormat AM3TimeFormat_hh,AM3TimeFormat_HH
39 * @param setTimeFormatBlock True: Success, False: Failed.
40 * @param errorBlock Communication error codes, see AM3 error descriptions.
41 * @Notice Notice: Firmware version 1.1.9 and above supports this function
42 */
43-(void)commandAM3SetTimeFormatAndNation:(AM3TimeFormat)timeFormat withFinishResult:(DisposeAM3TimeFormatSettingBlock)setTimeFormatBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
44
45/**
46 * Binding AM3 to user,Account binding requires an active internet connection.
47 * @param userID userID, ranging from 1 – 2147483647.
48 * @param finishResultBlock True: Success, False: Failed.
49 * @param errorBlock Communication error codes, see AM3 error descriptions.
50 */
51-(void)commandAM3SetUserID:(NSNumber*)userID withFinishResult:(DisposeAM3SetDeviceUserIDBlock)finishResultBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
52
53
54/**
55 * AM3 initialization,Must be called the first time to ensure that the AM3 has correct user information, goals, time, battery checks, etc.
56 * @param user User information, needs to include the following:age(int)、height(cm,1-255)、weight(kg,1-255)、bmr(user basal metabolic)、sex(UserSex_Female or UserSex_Male)、activityLevel (activityLevel=1, Sedentary,spend most of day sitting.activityLevel=2, Active,spend a good part of day doing some physical activity.activityLevel=3, Very Active,spend most of day doing heavy physical activity.)
57 * @param unit AM3StateUnit_mile or AM3StateUnit_km
58 * @param activeGoalNumber User goal number of steps,ranging from 4 – 65535. Default is 10,000
59 * @param setUserInfoFinishBlock True: Success, False: Failed.
60 * @param setBMRFinishResultBlock True: Success, False: Failed.
61 * @param errorBlock Communication error codes, see AM3 error descriptions.
62 */
63-(void)commandAM3SetUserInfo:(HealthUser *)user withUnit:(AM3StateUnit)unit withActiveGoal:(NSNumber *)activeGoalNumber withSetUserInfoFinishResult:(DisposeAM3SetUserInfoBlock)setUserInfoFinishBlock withSetBMR:(DisposeAM3SetBMRBlock)setBMRFinishResultBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
64
65
66/**
67 * Upload AM3 data,Data type: 5 minutes of active data, total number of steps for the day, and total calories.Also includes the number of steps for the 5 minutes of motion data, total calories for the current time, calories of the steps, and total calories.
68 * @param activeTransmissionBlock activeTransmission: Start uploading motion data, including parameters:Start date,yyyy-MM-dd(ActiveHistoryDateYear,ActiveHistoryDateMonth,ActiveHistoryDateDay),ActiveStepSize:Length of each step,ActiveHistoryTotoalNum:Number of records.
69 * @param activeHistoryDataBlock active data,including the following parameters:AMDate、AMCalorie、AMstepNum、AMstepSize、dataID、Start. AMDate:Workout time,AMCalorie: Current time total calories,AMStepNum:Total number of steps,dataID:data ID,Start:represents the beginning of a movement.
70 * @param activeFinishTransmissionBlock Upload complete.
71 * @param errorBlock Communication error codes, see AM3 error descriptions.
72 */
73-(void)commandAM3StartSyncActiveData:(DisposeAM3ActiveStartTransmission)activeTransmissionBlock withActiveHistoryData:(DisposeAM3ActiveHistoryData)activeHistoryDataBlock withActiveFinishTransmission:(DisposeAM3ActiveFinishTransmission)activeFinishTransmissionBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
74
75
76/**
77 * Upload AM3 data,Data type: 5 minutes of sleep data,
78 * @param sleepTransmissionBlock sleepTransmission:Start uploading sleep data,, including parameters:SleepHistoryDate、AM3SleepHistoryTotoalNum.SleepHistoryDate:Sleep start time,yyyy-MM-dd HH:mm:ss(SleepHistoryDateYear,SleepHistoryDateMonth,SleepHistoryDateDay,SleepHistoryDateHour,SleepHistoryDateMinute,SleepHistoryDateSeconds).SleepHistoryTotoalNum: Number of records
79 * @param sleepHistoryDataBlock Sleep data, including the following parameters::AMDate、SleepData、dataID.AMDate:Sleep time, SleepData: Sleep grade, 0: awake, 1: light sleep, 2: deep sleep ,dataID: data ID.
80 * @param sleepFinishTransmissionBlock Upload complete.
81 * @param errorBlock Communication error codes, see AM3 error descriptions.
82 */
83-(void)commandAM3StartSyncSleepData:(DisposeAM3SleepStartTransmission)sleepTransmissionBlock withSleepHistoryData:(DisposeAM3SleepHistoryData)sleepHistoryDataBlock withSleepFinishTransmission:(DisposeAM3SleepFinishTransmission)sleepFinishTransmissionBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
84
85/**
86 * Upload AM3 data,Data type: Sync current active data
87 * @param currentActiveInfoBlock Total calories and steps for today, including parameters:Step、Calories、TotalCalories.Step:Number of steps taken today.Calories:Number of calories burned today.TotalCalories:Sum calories burned and bmr today.
88 * @param errorBlock Communication error codes, see AM3 error descriptions.
89 */
90-(void)commandAM3StartSyncCurrentActiveData:(DisposeAM3GetCurrentActiveInfo)currentActiveInfoBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
91
92/**
93 * Get totoal alarm infomation
94 * @param totoalAlarmInfoBlock Alarm array contains up to 3 alarms, each one needs the following parameters:AlarmId、Time、Week.AlarmId:1, 2, 3.Time:HH:mm.Week(Sun、Mon、Tue、Wed、Thu、Fri、Sat)True: On, False: Off
95 * @param errorBlock Communication error codes, see AM3 error descriptions.
96 */
97-(void)commandAM3GetTotoalAlarmInfo:(DisposeAM3TotoalAlarmData)totoalAlarmInfoBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
98
99/**
100 * Set alarm.
101 * @param alarmDic Alarm information, include parameters:AlarmId、Time、IsRepeat、Switch、(Sun、Mon、Tue、Wed、Thu、Fri、Sat)
102 * @param finishResultBlock True: Alarm set successfully,False: Failed.
103 * @param errorBlock Communication error codes, see AM3 error descriptions.
104 */
105-(void)commandAM3SetAlarmDictionary:(NSDictionary *)alarmDic withFinishResult:(DisposeAM3SetAlarmBlock)finishResultBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
106
107/**
108 * Delete alarm.
109 * @param alarmID alarmID:1, 2, 3.
110 * @param finishResultBlock True: Delete successful,False: Failed
111 * @param errorBlock Communication error codes, see AM3 error descriptions.
112 */
113-(void)commandAM3DeleteAlarmID:(NSNumber *)alarmID withFinishResult:(DisposeAM3DeleteAlarmBlock)finishResultBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
114
115
116/**
117 * Get reminder.
118 * @param remindInfoBlock Array containing following parameters:ReminderID、Time、Switch.ReminderID:Reminder ID.Time:format HH:mm, time between reminders (HH*60+mm) minutes.Switch:Reminder on/off,True: On, False: Off.
119 * @param errorBlock Communication error codes, see AM3 error descriptions.
120 */
121-(void)commandAM3GetReminderInfo:(DisposeAM3RemindInfoBlock)remindInfoBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
122
123/**
124 * Set reminders.
125 * @param reminderDic Array containing collowing parameters:Time、Switch。
126 * @param finishResultBlock YES: Successfully set, NO: Failed.
127 * @param errorBlock Communication error codes, see AM3 error descriptions.
128 */
129-(void)commandAM3SetReminderDictionary:(NSDictionary *)reminderDic withFinishResult:(DisposeAM3SetReminderBlock)finishResultBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
130
131/**
132 * Get device state infomation
133 * @param deviceStateInfoBlock AM status,State_wrist (AM3 being worn on the wrist),State_waist (AM3 worn with belt clip).
134 * @param batteryBlock AM3 battery percentage, from 0~100.
135 * @param errorBlock Communication error codes, see AM3 error descriptions.
136 */
137-(void)commandAM3GetDeviceStateInfo:(DisposeAM3StateInfoBlock)deviceStateInfoBlock withBattery:(DisposeAM3BatteryBlock)batteryBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
138
139/**
140 * Restore factory settings.
141 * @param resetDeviceBlock True: Success, False: Failed.
142 * @param errorBlock Communication error codes, see AM3 error descriptions.
143 */
144-(void)commandAM3ResetDevice:(DisposeAM3ResetDeviceBlock)resetDeviceBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
145
146/**
147 * Disconnect AM3 connection.
148 * @param disconnectBlock True: Success,False: Failed.
149 * @param errorBlock Communication error codes, see AM3 error descriptions.
150 */
151-(void)commandAM3Disconnect:(DisposeAM3DisconnectBlock)disconnectBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
152
153
154/**
155 * Get time format
156 * @param timeFormat (AM3TimeFormat_hh,AM3TimeFormat_HH)
157 * @param errorBlock Communication error codes, see AM3 error descriptions.
158 * @Notice Notice: Firmware version 1.1.9 and above supports this function
159 */
160-(void)commandAM3GetTimeFormat:(DisposeAM3TimeFormatBlock)timeFormat withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
161
162
163/**
164 * Get user infomation
165 * @param userInfoBlock including parameters:Age,Step,Height,Gender,Weight,Unit,goal(TotalStep1、TotalStep2、TotalStep3)
166 * @param errorBlock Communication error codes, see AM3 error descriptions.
167 */
168-(void)commandAM3GetUserInfo:(DisposeAM3UserInfoBlock)userInfoBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
169
170/**
171 * Set state model
172 * @param state including AM3SetStateModel_sleep,AM3SetStateModel_active,AM3SetStateModel_fly,AM3SetStateModel_drive
173 * @param finishResultBlock True: Delete successful,False: Failed
174 * @param errorBlock Communication error codes, see AM3 error descriptions.
175 * @Notice Notice: Firmware version 1.1.1 and above supports AM3SetStateModel_drive
176 */
177-(void)commandAM3SetStateModel:(AM3StateModel)state withFinishResult:(DisposeAM3SetStateModelBlock)finishResultBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
178
179
180/**
181 * Set BMR
182 * @param bmr ranging from 0 – 5000.
183 * @param finishResultBlock True: Delete successful,False: Failed
184 * @param errorBlock Communication error codes, see AM3 error descriptions.
185 * @Notice Notice: Firmware version 1.0.2 and above supports this function
186 */
187-(void)commandAM3SetBMR:(NSNumber *)bmr withFinishResult:(DisposeAM3SetBMRBlock)finishResultBlock withErrorBlock:(DisposeAM3ErrorBlock)errorBlock;
188@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3Controller.h
new file mode 100644
index 0000000..701393a
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3Controller.h
@@ -0,0 +1,29 @@
1//
2// AM3Controller.h
3// testShareCommunication
4//
5// Created by daiqingquan on 13-10-15.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 AM3Controller
13 */
14@interface AM3Controller : NSObject
15
16/**
17 * Initialize AM3 controller class
18 */
19+(AM3Controller *)shareIHAM3Controller;
20
21
22/**
23 * Access control class instance after receiving AM3ConnectNoti, then use instance to call AM3 related communication methods
24 */
25-(NSArray *)getAllCurrentAM3Instace;
26
27
28
29@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3SController_V2.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3SController_V2.h
new file mode 100644
index 0000000..17acd64
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3SController_V2.h
@@ -0,0 +1,29 @@
1//
2// AM3SController_V2.h
3// iHealthDemoCode
4//
5// Created by user on 16/8/12.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 AM3SController_V2
13 */
14@interface AM3SController_V2 : NSObject
15
16/**
17 * Initialize AM3S controller class
18 */
19+(AM3SController_V2 *)shareIHAM3SController;
20
21
22/**
23 * Access control class instance after receiving AM3SConnectNoti, then use instance to call AM3S related communication methods
24 */
25-(NSArray *)getAllCurrentAM3SInstace;
26
27
28
29@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3S_V2.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3S_V2.h
new file mode 100644
index 0000000..f3b2e58
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM3S_V2.h
@@ -0,0 +1,227 @@
1//
2// AM3S_V2.h
3// iHealthDemoCode
4//
5// Created by user on 16/8/12.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "AMMacroFile.h"
11/**
12 AM3S_V2
13 */
14@interface AM3S_V2 : NSObject
15@property (strong, nonatomic) NSMutableString *am3SRandomString;
16@property (strong, nonatomic) NSString *currentUUID;
17@property (strong, nonatomic) NSString *serialNumber;
18@property (strong, nonatomic) NSString *firmwareVersion;
19
20
21
22/**
23 * Get device userID
24 * @param getDeviceUserIDBlock get userID
25 * @param errorBlock Communication error codes, see AM3S error descriptions.
26 */
27-(void)commandAM3SGetDeviceUserID:(DisposeAM3SGetDeviceUserIDBlock)getDeviceUserIDBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
28
29
30
31/**
32 * Set RandomNumber
33 * @param setRandomNumberBlock randomNumber
34 * @param errorBlock Communication error codes, see AM3S error descriptions.
35 */
36-(void)commandAM3SSetRandomNumber:(DisposeAM3SSetRandomNumberBlock)setRandomNumberBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
37
38
39/**
40 * Sync time
41 * @param syncTimeBlock True: Success, False: Failed.
42 * @param errorBlock Communication error codes, see AM3S error descriptions.
43 */
44-(void)commandAM3SSyncTime:(DisposeAM3SSyncTimeBlock)syncTimeBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
45
46/**
47 * Set time format and nation
48 * @param timeFormatAndNation AM3STimeFormat_hh,AM3STimeFormat_HH,AM3STimeFormat_NoEuropeAndhh,AM3STimeFormat_EuropeAndhh,AM3STimeFormat_NoEuropeAndHH,AM3STimeFormat_EuropeAndHH,
49 * @param setTimeFormatBlock True: Success, False: Failed.
50 * @param errorBlock Communication error codes, see AM3S error descriptions.
51 * @Notice Notice: Firmware version 1.0.0 and above supports AM3STimeFormat_NoEuropeAndhh,AM3STimeFormat_EuropeAndhh,AM3STimeFormat_NoEuropeAndHH,AM3STimeFormat_EuropeAndHH,
52 */
53-(void)commandAM3SSetTimeFormatAndNation:(AM3STimeFormatAndNation)timeFormatAndNation withFinishResult:(DisposeAM3STimeFormatAndNationSettingBlock)setTimeFormatBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
54
55/**
56 * Binding AM3S to user,Account binding requires an active internet connection.
57 * @param userID userID, ranging from 1 – 2147483647.
58 * @param finishResultBlock True: Success, False: Failed.
59 * @param errorBlock Communication error codes, see AM3S error descriptions.
60 */
61-(void)commandAM3SSetUserID:(NSNumber*)userID withFinishResult:(DisposeAM3SSetDeviceUserIDBlock)finishResultBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
62
63/**
64 * AM3S initialization,Must be called the first time to ensure that the AM3S has correct user information, goals, time, battery checks, etc.
65 * @param user User information, needs to include the following:age(int)、height(cm,1-255)、weight(kg,1-255)、bmr(user basal metabolic)、sex(UserSex_Female or UserSex_Male)、activityLevel (activityLevel=1, Sedentary,spend most of day sitting.activityLevel=2, Active,spend a good part of day doing some physical activity.activityLevel=3, Very Active,spend most of day doing heavy physical activity.)
66 * @param unit AM3SKmUnit_mile or AM3SKmUnit_km
67 * @param activeGoalNumber User goal number of steps,ranging from 4 – 2147483647. Default is 10,000
68 * @param setUserInfoFinishBlock True: Success, False: Failed.
69 * @param setBMRfinishResultBlock True: Success, False: Failed.
70 * @param errorBlock Communication error codes, see AM3S error descriptions.
71 */
72
73-(void)commandAM3SSetUserInfo:(HealthUser *)user withUnit:(AM3SKmUnit)unit withActiveGoal:(NSNumber *)activeGoalNumber withSetUserInfoFinishResult:(DisposeAM3SSetUserInfoBlock)setUserInfoFinishBlock withSetBMR:(DisposeAM3SSetBMRBlock)setBMRfinishResultBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
74
75
76
77
78
79/**
80 * Upload AM3S data,Data type: 5 minutes of active data, total number of steps for the day, and total calories.Also includes the number of steps for the 5 minutes of motion data, total calories for the current time, calories of the steps, and total calories.
81 * @param activeTransmissionBlock activeTransmission: Start uploading motion data, including parameters:Start date,yyyy-MM-dd(ActiveHistoryDateYear,ActiveHistoryDateMonth,ActiveHistoryDateDay),ActiveStepSize:Length of each step,ActiveHistoryTotoalNum:Number of records.
82 * @param activeHistoryDataBlock active data,including the following parameters:AMDate、AMCalorie、AMstepNum、AMstepSize、dataID、Start. AMDate:Workout time,AMCalorie: Current time total calories,AMStepNum:Total number of steps,dataID:data ID,Start:represents the beginning of a movement.
83 * @param activeFinishTransmissionBlock Upload complete.
84 * @param errorBlock Communication error codes, see AM3S error descriptions.
85 */
86-(void)commandAM3SStartSyncActiveData:(DisposeAM3SActiveStartTransmission)activeTransmissionBlock
87 withActiveHistoryData:(DisposeAM3SActiveHistoryData)activeHistoryDataBlock
88 withActiveFinishTransmission:(DisposeAM3SActiveFinishTransmission)activeFinishTransmissionBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
89/**
90 * Upload AM3S data,Data type: 5 minutes of sleep data
91 * @param sleepTransmissionBlock sleepTransmission:Start uploading sleep data,, including parameters:SleepHistoryDate、AM3SSleepHistoryTotoalNum.SleepHistoryDate:Sleep start time,yyyy-MM-dd HH:mm:ss(SleepHistoryDateYear,SleepHistoryDateMonth,SleepHistoryDateDay,SleepHistoryDateHour,SleepHistoryDateMinute,SleepHistoryDateSeconds).SleepHistoryTotoalNum: Number of records
92 * @param sleepHistoryDataBlock Sleep data, including the following parameters::AMDate、SleepData、dataID.AMDate:Sleep time, SleepData: Sleep grade, 0: awake, 1: light sleep, 2: deep sleep ,dataID: data ID.
93 * @param sleepFinishTransmissionBlock Upload complete.
94 * @param errorBlock Communication error codes, see AM3S error descriptions.
95 */
96-(void)commandAM3SStartSyncSleepData:(DisposeAM3SSleepStartTransmission)sleepTransmissionBlock withSleepHistoryData:(DisposeAM3SSleepHistoryData)sleepHistoryDataBlock
97 withSleepFinishTransmission:(DisposeAM3SSleepFinishTransmission)sleepFinishTransmissionBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
98
99/**
100 * Upload AM3S data,Data type: Sync current active data
101 * @param currentActiveInfoBlock Total calories and steps for today, including parameters:Step、Calories、TotalCalories.Step:Number of steps taken today.Calories:Number of calories burned today.TotalCalories:Sum calories burned and bmr today.
102 * @param errorBlock Communication error codes, see AM3S error descriptions.
103 */
104-(void)commandAM3SStartSyncCurrentActiveData:(DisposeAM3SGetCurrentActiveInfo)currentActiveInfoBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
105
106
107
108/**
109 * Upload AM3S report data.
110 * @param stageDataBlock Report data, including parameters:ReportStage_Work_out(1)、ReportStage_Sleep_summary(2).ReportStage_Work_out:Report Stage active,including parameters:Work_outCalories(Workout calories burned)、Work_outLengthNumber(Workout distance)、Work_outMeasureDate(Start time)、Work_outStepNumber(Workout number of steps)、Work_outTimeNumber(Length of workout)、dataID(data ID).ReportStage_Sleep_summary:Report Stage sleep,including parameters:Sleep_summaryMeasureDate(Sleep start time)、Sleep_summarySleepTime(Sleep duration)、Sleep_summarysleepAddMinute(Correct sleep duration length)、Sleep_summarysleepEfficiency(Sleep efficiency percentage, range is 0-100)
111 * @param stageDataFinishTransmissionBlock YES: Success,NO: Failed.
112 * @param errorBlock Communication error codes, see AM3S error descriptions.
113 */
114-(void)commandAM3SStartSyncStageData:(DisposeAM3SStageMeasureDataBlock)stageDataBlock withStageDataFinishTransmission:(DisposeAM3SStageMeasureFinishBlock)stageDataFinishTransmissionBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
115
116
117/**
118 * Get totoal alarm infomation
119 * @param totoalAlarmInfoBlock Alarm array contains up to 3 alarms, each one needs the following parameters:AlarmId、Time、Week.AlarmId:1, 2, 3.Time:HH:mm.Week(Sun、Mon、Tue、Wed、Thu、Fri、Sat)True: On, False: Off
120 * @param errorBlock Communication error codes, see AM3S error descriptions.
121 */
122-(void)commandAM3SGetTotoalAlarmInfo:(DisposeAM3STotoalAlarmData)totoalAlarmInfoBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
123
124/**
125 * Set alarm.
126 * @param alarmDic Alarm information, include parameters:AlarmId(1、2、3)、Time、IsRepeat、Switch、Week(Sun、Mon、Tue、Wed、Thu、Fri、Sat)
127 * @param finishResultBlock True: Alarm set successfully,False: Failed.
128 * @param errorBlock Communication error codes, see AM3S error descriptions.
129 */
130-(void)commandAM3SSetAlarmDictionary:(NSDictionary *)alarmDic withFinishResult:(DisposeAM3SSetAlarmBlock)finishResultBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
131
132
133/**
134 * Delete alarm.
135 * @param alarmID alarmID:1, 2, 3.
136 * @param finishResultBlock True: Delete successful,False: Failed
137 * @param errorBlock Communication error codes, see AM3S error descriptions.
138 */
139-(void)commandAM3SDeleteAlarmID:(NSNumber *)alarmID withFinishResult:(DisposeAM3SDeleteAlarmBlock)finishResultBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
140
141/**
142 * Get reminder.
143 * @param remindInfoBlock Array containing following parameters:ReminderID、Time、Switch.ReminderID:Reminder ID.Time:format HH:mm, time between reminders (HH*60+mm) minutes.Switch:Reminder on/off,True: On, False: Off.
144 * @param errorBlock Communication error codes, see AM3S error descriptions.
145 */
146-(void)commandAM3SGetReminderInfo:(DisposeAM3SRemindInfoBlock)remindInfoBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
147
148/**
149 * Set reminders.
150 * @param reminderDic Array containing collowing parameters:Time、Switch。
151 * @param finishResultBlock YES: Successfully set, NO: Failed.
152 * @param errorBlock Communication error codes, see AM3S error descriptions.
153 */
154-(void)commandAM3SSetReminderDictionary:(NSDictionary *)reminderDic withFinishResult:(DisposeAM3SSetReminderBlock)finishResultBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
155
156
157
158/**
159 * Get device state infomation
160 * @param deviceStateInfoBlock AM status,State_wrist (AM3S being worn on the wrist),State_waist (AM3S worn with belt clip).
161 * @param batteryBlock AM battery percentage, from 0~100.
162 * @param errorBlock Communication error codes, see AM3S error descriptions.
163 */
164-(void)commandAM3SGetDeviceStateInfo:(DisposeAM3SStateInfoBlock)deviceStateInfoBlock withBattery:(DisposeAM3SBatteryBlock)batteryBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
165
166/**
167 * Restore factory settings.
168 * @param resetDeviceBlock True: Success, False: Failed.
169 * @param errorBlock Communication error codes, see AM3S error descriptions.
170 */
171-(void)commandAM3SResetDevice:(DisposeAM3SResetDeviceBlock)resetDeviceBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
172
173/**
174 * Disconnect AM3S connection.
175 * @param disconnectBlock True: Success,False: Failed.
176 * @param errorBlock Communication error codes, see AM3S error descriptions.
177 */
178-(void)commandAM3SDisconnect:(DisposeAM3SDisconnectBlock)disconnectBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
179
180
181/**
182 * Get time format and nation
183 * @param timeAndNationBlock (AM3STimeFormat_hh,AM3STimeFormat_HH,AM3STimeFormat_NoEuropeAndhh,AM3STimeFormat_EuropeAndhh,AM3STimeFormat_NoEuropeAndHH,AM3STimeFormat_EuropeAndHH)
184 * @param errorBlock Communication error codes, see AM3S error descriptions.
185 */
186-(void)commandAM3SGetTimeFormatAndNation:(DisposeAM3STimeFormatAndNationBlock)timeAndNationBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
187
188
189
190
191/**
192 * Get user infomation
193 * @param userInfoBlock including parameters:Age,Step,Height,Gender,Weight,Unit,goal(TotalStep1、TotalStep2、TotalStep3)
194 * @param errorBlock Communication error codes, see AM3S error descriptions.
195 */
196-(void)commandAM3SGetUserInfo:(DisposeAM3SUserInfoBlock)userInfoBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
197
198
199
200/**
201 * Set BMR
202 * @param bmr ranging from 0 – 5000.
203 * @param finishResultBlock True: Delete successful,False: Failed
204 * @param errorBlock Communication error codes, see AM3S error descriptions.
205 */
206-(void)commandAM3SSetBMR:(NSNumber *)bmr withFinishResult:(DisposeAM3SSetBMRBlock)finishResultBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
207
208
209
210
211
212/**
213 * Get Picture.
214 * @param pictureBlock Picture_one,Picture_two
215 * @param errorBlock Communication error codes, see AM3S error descriptions.
216 */
217-(void)commandAM3SGetPicture:(DisposeAM3SGetPictureBlock)pictureBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
218
219/**
220 * Set Picture.
221 * @param pictures Picture_one,Picture_two
222 * @param finishResultBlock True: Success,False: Failed.
223 * @param errorBlock Communication error codes, see AM3S error descriptions.
224 */
225-(void)commandAM3SSetPicture:(AM3SPicture)pictures withFinishResult:(DisposeAM3SSetPictureBlock)finishResultBlock withErrorBlock:(DisposeAM3SErrorBlock)errorBlock;
226
227@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM4.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM4.h
new file mode 100755
index 0000000..f37474e
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM4.h
@@ -0,0 +1,223 @@
1//
2// AM4.h
3// iHealthApp2
4//
5// Created by 小翼 on 14-7-2.
6// Copyright (c) 2014年 andon. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "AMMacroFile.h"
11
12/**
13 AM4
14 */
15@interface AM4 : NSObject
16@property (strong, nonatomic) NSMutableString *am4RandomString;
17@property (strong, nonatomic) NSString *currentUUID;
18@property (strong, nonatomic) NSString *serialNumber;
19@property (strong, nonatomic) NSString *firmwareVersion;
20
21
22
23/**
24 * Get device userID
25 * @param getDeviceUserIDBlock get userID
26 * @param errorBlock Communication error codes, see AM4 error descriptions.
27 */
28-(void)commandAM4GetDeviceUserID:(DisposeAM4GetDeviceUserIDBlock)getDeviceUserIDBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
29
30
31
32/**
33 Set RandomNumber
34
35 @param setRandomNumberBlock randomNumber
36 @param errorBlock Communication error codes, see AM4 error descriptions.
37 */
38-(void)commandAM4SetRandomNumber:(DisposeAM4SetRandomNumberBlock)setRandomNumberBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
39
40
41/**
42 * Sync time
43 * @param syncTimeBlock True: Success, False: Failed.
44 * @param errorBlock Communication error codes, see AM4 error descriptions.
45 */
46-(void)commandAM4SyncTime:(DisposeAM4SyncTimeBlock)syncTimeBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
47
48/**
49 * Set time format and nation
50 * @param timeFormatAndNation AM4TimeFormat_hh,AM4TimeFormat_HH,AM4TimeFormat_NoEuropeAndhh,AM4TimeFormat_EuropeAndhh,AM4TimeFormat_NoEuropeAndHH,AM4TimeFormat_EuropeAndHH
51 * @param setTimeFormatBlock True: Success, False: Failed.
52 * @param errorBlock Communication error codes, see AM4 error descriptions.
53 */
54-(void)commandAM4SetTimeFormatAndNation:(AM4TimeFormatAndNation)timeFormatAndNation withFinishResult:(DisposeAM4TimeFormatAndNationSettingBlock)setTimeFormatBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
55/**
56 * Binding AM4 to user,Account binding requires an active internet connection.
57 * @param userID userID, ranging from 1 – 2147483647.
58 * @param finishResultBlock True: Success, False: Failed.
59 * @param errorBlock Communication error codes, see AM4 error descriptions.
60 */
61-(void)commandAM4SetUserID:(NSNumber*)userID withFinishResult:(DisposeAM4SetDeviceUserIDBlock)finishResultBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
62
63/**
64 * AM4 initialization,Must be called the first time to ensure that the AM4 has correct user information, goals, time, battery checks, etc.
65 * @param user User information, needs to include the following:age(int)、height(cm,1-255)、weight(kg,1-255)、bmr(user basal metabolic)、sex(UserSex_Female or UserSex_Male)、activityLevel (activityLevel=1, Sedentary,spend most of day sitting.activityLevel=2, Active,spend a good part of day doing some physical activity.activityLevel=3, Very Active,spend most of day doing heavy physical activity.)
66 * @param unit AM4KmUnit_mile or AM4KmUnit_km
67 * @param activeGoalNumber User goal number of steps,ranging from 4 – 2147483647. Default is 10,000
68 * @param swimmingGoal User goal number of swimming.ranging from 1–1439. Default is 30min
69 * @param setUserInfoFinishBlock True: Success, False: Failed.
70 * @param setBMRfinishResultBlock True: Success, False: Failed.
71 * @param errorBlock Communication error codes, see AM4 error descriptions.
72 */
73
74-(void)commandAM4SetUserInfo:(HealthUser *)user withUnit:(AM4KmUnit)unit withActiveGoal:(NSNumber *)activeGoalNumber withSwimmingGoal:(NSNumber *)swimmingGoal withSetUserInfoFinishResult:(DisposeAM4SetUserInfoBlock)setUserInfoFinishBlock withSetBMR:(DisposeAM4SetBMRBlock)setBMRfinishResultBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
75
76
77
78/**
79 * Set swimming
80 * @param swimmingIsOpen YES:open swimming function NO:close swimming function default:no
81 * @param swimmingPoolLength swimming Pool Length,ranging from 0 – 255.
82 * @param noSwimmingDate automatic drop out swim duration
83 * @param unit swim unit (AM4SwimmingUnit_m or AM4SwimmingUnit_km)
84 * @param finishResultBlock True: Success, False: Failed.
85 * @param errorBlock Communication error codes, see AM4 error descriptions.
86 */
87-(void)commandAM4SetSwimmingState:(BOOL)swimmingIsOpen withSwimmingPoolLength:(NSNumber *)swimmingPoolLength withNOSwimmingTime:(NSDate *)noSwimmingDate withUnit:(AM4SwimmingUnit)unit withFinishResult:(DisposeAM4SettingSwimmingBlock)finishResultBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
88
89/**
90 * Upload AM4 data,Data type: 5 minutes of active data, total number of steps for the day, and total calories.Also includes the number of steps for the 5 minutes of motion data, total calories for the current time, calories of the steps, and total calories.
91 * @param activeTransmissionBlock activeTransmission: Start uploading motion data, including parameters:Start date,yyyy-MM-dd(ActiveHistoryDateYear,ActiveHistoryDateMonth,ActiveHistoryDateDay),ActiveStepSize:Length of each step,ActiveHistoryTotoalNum:Number of records.
92 * @param activeHistoryDataBlock active data,including the following parameters:AMDate、AMCalorie、AMstepNum、AMstepSize、dataID、Start. AMDate:Workout time,AMCalorie: Current time total calories,AMStepNum:Total number of steps,dataID:data ID,Start:represents the beginning of a movement.
93 * @param activeFinishTransmissionBlock Upload complete.
94 * @param errorBlock Communication error codes, see AM4 error descriptions.
95 */
96-(void)commandAM4StartSyncActiveData:(DisposeAM4ActiveStartTransmission)activeTransmissionBlock
97 withActiveHistoryData:(DisposeAM4ActiveHistoryData)activeHistoryDataBlock
98 withActiveFinishTransmission:(DisposeAM4ActiveFinishTransmission)activeFinishTransmissionBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
99/**
100 * Upload AM4 data,Data type: 5 minutes of sleep data
101 * @param sleepTransmissionBlock sleepTransmission:Start uploading sleep data,, including parameters:SleepHistoryDate、AM4SleepHistoryTotoalNum.SleepHistoryDate:Sleep start time,yyyy-MM-dd HH:mm:ss(SleepHistoryDateYear,SleepHistoryDateMonth,SleepHistoryDateDay,SleepHistoryDateHour,SleepHistoryDateMinute,SleepHistoryDateSeconds).SleepHistoryTotoalNum: Number of records
102 * @param sleepHistoryDataBlock Sleep data, including the following parameters::AMDate、SleepData、dataID.AMDate:Sleep time, SleepData: Sleep grade, 0: awake, 1: light sleep, 2: deep sleep ,dataID: data ID.
103 * @param sleepFinishTransmissionBlock Upload complete.
104 * @param errorBlock Communication error codes, see AM4 error descriptions.
105 */
106-(void)commandAM4StartSyncSleepData:(DisposeAM4SleepStartTransmission)sleepTransmissionBlock withSleepHistoryData:(DisposeAM4SleepHistoryData)sleepHistoryDataBlock
107 withSleepFinishTransmission:(DisposeAM4SleepFinishTransmission)sleepFinishTransmissionBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
108
109/**
110 * Upload AM4 data,Data type: Sync current active data
111 * @param currentActiveInfoBlock Total calories and steps for today, including parameters:Step、Calories、TotalCalories.Step:Number of steps taken today.Calories:Number of calories burned today.TotalCalories:Sum calories burned and bmr today.
112 * @param errorBlock Communication error codes, see AM4 error descriptions.
113 */
114-(void)commandAM4StartSyncCurrentActiveData:(DisposeAM4GetCurrentActiveInfo)currentActiveInfoBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
115
116
117
118/**
119 * Upload AM4 report data.
120 * @param stageDataBlock Report data, including parameters:ReportStage_Swimming(0)、ReportStage_Work_out(1)、ReportStage_Sleep_summary(2).ReportStage_Swimming:Report Stage Swimming.including parameters:SwimmingMeasureDate(swimming Measure date)、SwimmingTimeNumber(swimming time number)、SwimmingTimes(swimming times)、Swimmingcalories(swimming calories)、SwimmingAct(swimming action)、SwimmingCircleCount(swimming circle count)、SwimmingPoollength(swimming pool length)、EnterSwimmingTime(enter swimming time)、OutSwimmingTime(out swimming time)、SwimmingProcessMark(swimming process mark)、SwimStartTimeStamp(swim start time stamp)、dataID(data ID).ReportStage_Work_out:Report Stage active,including parameters:Work_outCalories(Workout calories burned)、Work_outLengthNumber(Workout distance)、Work_outMeasureDate(Start time)、Work_outStepNumber(Workout number of steps)、Work_outTimeNumber(Length of workout)、dataID(data ID).ReportStage_Sleep_summary:Report Stage sleep,including parameters:Sleep_summaryMeasureDate(Sleep start time)、Sleep_summarySleepTime(Sleep duration)、Sleep_summarysleepAddMinute(Correct sleep duration length)、Sleep_summarysleepEfficiency(Sleep efficiency percentage, range is 0-100)
121 * @param stageDataFinishTransmissionBlock YES: Success,NO: Failed.
122 * @param errorBlock Communication error codes, see AM4 error descriptions.
123 */
124-(void)commandAM4StartSyncStageData:(DisposeAM4StageMeasureDataBlock)stageDataBlock withStageDataFinishTransmission:(DisposeAM4StageMeasureFinishBlock)stageDataFinishTransmissionBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
125
126
127/**
128 * Get totoal alarm infomation
129 * @param totoalAlarmInfoBlock Alarm array contains up to 3 alarms, each one needs the following parameters:AlarmId、Time、Week.AlarmId:1, 2, 3.Time:HH:mm.Week(Sun、Mon、Tue、Wed、Thu、Fri、Sat)True: On, False: Off
130 * @param errorBlock Communication error codes, see AM4 error descriptions.
131 */
132-(void)commandAM4GetTotoalAlarmInfo:(DisposeAM4TotoalAlarmData)totoalAlarmInfoBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
133
134/**
135 * Set alarm.
136 * @param alarmDic Alarm information, include parameters:AlarmId(1、2、3)、Time、IsRepeat、Switch、Week(Sun、Mon、Tue、Wed、Thu、Fri、Sat)
137 * @param finishResultBlock True: Alarm set successfully,False: Failed.
138 * @param errorBlock Communication error codes, see AM4 error descriptions.
139 */
140-(void)commandAM4SetAlarmDictionary:(NSDictionary *)alarmDic withFinishResult:(DisposeAM4SetAlarmBlock)finishResultBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
141
142
143/**
144 * Delete alarm.
145 * @param alarmID alarmID:1, 2, 3.
146 * @param finishResultBlock True: Delete successful,False: Failed
147 * @param errorBlock Communication error codes, see AM4 error descriptions.
148 */
149-(void)commandAM4DeleteAlarmID:(NSNumber *)alarmID withFinishResult:(DisposeAM4DeleteAlarmBlock)finishResultBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
150
151/**
152 * Get reminder.
153 * @param remindInfoBlock Array containing following parameters:ReminderID、Time、Switch.ReminderID:Reminder ID.Time:format HH:mm, time between reminders (HH*60+mm) minutes.Switch:Reminder on/off,True: On, False: Off.
154 * @param errorBlock Communication error codes, see AM4 error descriptions.
155 */
156-(void)commandAM4GetReminderInfo:(DisposeAM4RemindInfoBlock)remindInfoBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
157
158/**
159 * Set reminders.
160 * @param reminderDic Array containing collowing parameters:Time、Switch。
161 * @param finishResultBlock YES: Successfully set, NO: Failed.
162 * @param errorBlock Communication error codes, see AM4 error descriptions.
163 */
164-(void)commandAM4SetReminderDictionary:(NSDictionary *)reminderDic withFinishResult:(DisposeAM4SetReminderBlock)finishResultBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
165
166
167
168/**
169 * Get device state infomation
170 * @param deviceStateInfoBlock AM status,State_wrist (AM4 being worn on the wrist),State_waist (AM4 worn with belt clip).
171 * @param batteryBlock AM battery percentage, from 0~100.
172 * @param errorBlock Communication error codes, see AM4 error descriptions.
173 */
174-(void)commandAM4GetDeviceStateInfo:(DisposeAM4StateInfoBlock)deviceStateInfoBlock withBattery:(DisposeAM4BatteryBlock)batteryBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
175
176/**
177 * Restore factory settings.
178 * @param resetDeviceBlock True: Success, False: Failed.
179 * @param errorBlock Communication error codes, see AM4 error descriptions.
180 */
181-(void)commandAM4ResetDevice:(DisposeAM4ResetDeviceBlock)resetDeviceBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
182
183/**
184 * Disconnect AM4 connection.
185 * @param disconnectBlock True: Success,False: Failed.
186 * @param errorBlock Communication error codes, see AM4 error descriptions.
187 */
188-(void)commandAM4Disconnect:(DisposeAM4DisconnectBlock)disconnectBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
189
190
191/**
192 * Get time format and nation
193 * @param timeAndNationBlock (AM4TimeFormat_hh,AM4TimeFormat_HH,AM4TimeFormat_NoEuropeAndhh,AM4TimeFormat_EuropeAndhh,AM4TimeFormat_NoEuropeAndHH,AM4TimeFormat_EuropeAndHH)
194 * @param errorBlock Communication error codes, see AM4 error descriptions.
195 */
196-(void)commandAM4GetTimeFormatAndNation:(DisposeAM4TimeFormatAndNationBlock)timeAndNationBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
197
198
199
200
201/**
202 * Get user infomation
203 * @param userInfoBlock including parameters:Age,Step,Height,Gender,Weight,Unit,goal(TotalStep1、TotalStep2、TotalStep3)
204 * @param errorBlock Communication error codes, see AM4 error descriptions.
205 */
206-(void)commandAM4GetUserInfo:(DisposeAM4UserInfoBlock)userInfoBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
207
208/**
209 * Get swimming infomation
210 * @param swimmingInfoBlock including parameters:swimmingIsOpen,swimmingLaneLength,NOSwimmingTime,unit
211 * @param errorBlock Communication error codes, see AM4 error descriptions.
212 */
213-(void)commandAM4GetSwimmingInfo:(DisposeAM4SwimmingBlock)swimmingInfoBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
214
215/**
216 * Set BMR
217 * @param bmr ranging from 0 – 5000.
218 * @param finishResultBlock True: Delete successful,False: Failed
219 * @param errorBlock Communication error codes, see AM4 error descriptions.
220 */
221-(void)commandAM4SetBMR:(NSNumber *)bmr withFinishResult:(DisposeAM4SetBMRBlock)finishResultBlock withErrorBlock:(DisposeAM4ErrorBlock)errorBlock;
222
223@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM4Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM4Controller.h
new file mode 100755
index 0000000..b54a062
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM4Controller.h
@@ -0,0 +1,31 @@
1//
2// AM4Controller.h
3// iHealthApp3
4//
5// Created by 小翼 on 15/5/22.
6// Copyright (c) 2015年 iHealth. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 AM4Controller
13 */
14@interface AM4Controller : NSObject
15
16
17
18/**
19 * Initialize AM4 controller class
20 */
21+(AM4Controller *)shareIHAM4Controller;
22
23
24/**
25 * Access control class instance after receiving AM4ConnectNoti, then use instance to call AM4 related communication methods
26 */
27-(NSArray *)getAllCurrentAM4Instace;
28
29
30
31@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM5.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM5.h
new file mode 100755
index 0000000..a08f3ae
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM5.h
@@ -0,0 +1,335 @@
1//
2// AM5.h
3// iHealthSDKStatic
4//
5// Created by user on 2019/7/2.
6// Copyright © 2019 ihealthSDK. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "AM5Header.h"
11#import "AMMacroFile.h"
12
13@interface AM5 : NSObject
14
15@property (strong, nonatomic) NSString *currentUUID;
16@property (strong, nonatomic) NSString *serialNumber;
17
18
19/**
20 *BindingDevice
21
22 * @param bindingResult YES:success NO:failed
23 * @param disposeErrorBlock error code
24 */
25-(void)commandBindingDevice:(DisposeBindingAM5Result)bindingResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
26
27/**
28 *UnBindingDevice
29
30 * @param unbindingResult YES:success NO:failed
31 * @param disposeErrorBlock error code
32 */
33-(void)commandUnBindingDevice:(DisposeUnBindingAM5Result)unbindingResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
34/**
35 * GetDeviceInfo
36
37 * @param deviceInfo
38 This dictionary includes key:
39 Mode:Device mode BatteryStatus:Battery status BatteryLevel:Battery level RebootFlag:Whether to restart BindTimeStr:Binding timestamp BindState:Binding status
40 * @param disposeErrorBlock error code
41 */
42-(void)commandGetDeviceInfo:(DisposeGetAM5DeviceInfo)deviceInfo DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
43/**
44 * Get functional information
45
46 * @param deviceFunctionalInfo
47 This dictionary includes key:
48 Steps:Number of steps
49 SleepDetection:Sleep detection
50 SingleMovement:Single movement
51 LiveData:Real-time data
52 Update:Equipment Update
53 HeartRate:Heart rate function
54 Notification:Notification Center
55 Timeline:Timeline
56 * @param disposeErrorBlock error code
57 */
58-(void)commandGetFuncTable:(DisposeGetAM5FuncTable)deviceFunctionalInfo DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
59/**
60 * GetDeviceMac
61
62 * @param deviceMac This is the MAC for the device
63 * @param disposeErrorBlock error code
64 */
65-(void)commandGetDeviceMac:(DisposeGetAM5Mac)deviceMac DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
66
67/**
68 * GetLiveData
69
70 * @param liveData
71 This dictionary includes key:
72 Step:Step count Calorie:Calorie Distances:distance ActiveTime:Duration of activity HeartRate:Heart rate
73 * @param disposeErrorBlock error code
74 */
75-(void)commandGetLiveData:(DisposeGetAM5LiveData)liveData DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
76
77/**
78 * GetActivityCount
79
80 * @param activityCount
81
82 This dictionary includes key:
83
84 ActivityCount:Number of activities ActivityPacketCount:Number of active packages GpsCount:Number of GPS data GpsPacketCount:Number of GPS packets
85
86 * @param disposeErrorBlock error code
87 */
88-(void)commandGetActivityCount:(DisposeGetAM5ActivityCount)activityCount DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
89
90/**
91 * setCurrentTime
92 * @param setCurrentTime Synchronizes the current time to the device YES:success NO:failed
93 * @param disposeErrorBlock error code
94 */
95-(void)commandSetCurrentTime:(DisposeAM5SetCurrentTime)setCurrentTime DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
96
97/**
98 * setAlarm
99 * @param alarm
100 example code:
101 IDOSetAlarmInfoBluetoothModel * alarmModel= [IDOSetAlarmInfoBluetoothModel currentModel];
102 switch alarmModel.isOpen
103 Whether the synchronization alarmModel.isSync
104 Whether or not to delete alarmModel.isDelete
105 Type alarmModel.type
106 Hour alarmModel.hour
107 Minute alarmModel.minute
108 Repeat alarmModel.repeat
109 TsnoozeDuration alarmModel.tsnoozeDuration
110 AlarmId alarmModel.alarmId
111
112 * @param setAlarmResult YES:success NO:failed
113 * @param disposeErrorBlock error code
114 */
115-(void)commandSetAlarm:(IDOSetAlarmInfoBluetoothModel*)alarm setResult:(DisposeAM5SetAlarm)setAlarmResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
116
117/**
118 * SetUserTarget
119 * @param target
120 example code:
121 IDOSetUserInfoBuletoothModel * userModel= [IDOSetUserInfoBuletoothModel currentModel];
122 Target sleep time(hour) userModel.goalSleepDataHour
123 Target sleep time(minutes) userModel.goalSleepDataMinute
124 Target steps userModel.goalStepData
125 Target Calorie userModel.goalCalorieData
126 Target Distance userModel.goalDistanceData
127 Target Weight userModel.goalWeightData
128 Target type userModel.goalType (type: 0: steps 1: calories 2: distance) setting a type of target requires executing a command once
129
130 * @param setUserTargetResult YES:success NO:failed
131 * @param disposeErrorBlock error code
132 */
133-(void)commandSetUserTarget:(IDOSetUserInfoBuletoothModel*)target setResult:(DisposeAM5SetUserTarget)setUserTargetResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
134
135/**
136 * SetUserInfo
137 @param userInfo
138 example code:
139 IDOSetUserInfoBuletoothModel * userModel= [IDOSetUserInfoBuletoothModel currentModel];
140 height userModel.height
141 weight userModel.weight
142 gender userModel.gender Gender 1: male 2: female
143 year userModel.year
144 month userModel.month
145 day userModel.day
146
147 * @param setUserInfoResult YES:success NO:failed
148 * @param disposeErrorBlock error code
149 */
150-(void)commandSetUserInfo:(IDOSetUserInfoBuletoothModel*)userInfo setResult:(DisposeAM5SetUserInfo)setUserInfoResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
151
152/**
153 * SetUnit
154 @param unit
155 example code:
156 IDOSetUnitInfoBluetoothModel * unitInfo = [IDOSetUnitInfoBluetoothModel currentModel];
157 From the unit unitInfo.distanceUnit 0x00: invalid, 0x01:km, 0x02:mi
158 Unit of weight unitInfo.weightUnit 0x00: invalid, 0x01:kg, 0x02:lb, 0x03: st
159 Temperature of the unit unitInfo.tempUnit 0x00: invalid, 0 x01: ° C, 0 x02: ° F
160 The language unit unitInfo.languageUnit (Invalid :0, Chinese :1, English :2, French :3, German :4, Italian :5, Spanish :6, Japanese :7,Polish :8, Czech :9, Romania :10, Lithuanian :11, Dutch :12, Slovenia :13,Hungarian :14, Russian :15, Ukrainian :16, slovak :17, Danish :18, Croatian :19)
161 Walking pace unitInfo.strideWalk Convert to the default value of 90 for men (unit: cm)
162 Running pace unitInfo.strideRun According to the default value of male conversion 72 (unit: cm)
163 GPS calibration step size unitInfo.strideGps 0x00: invalid, 0x01: on, 0x02: off
164 Unit of time unitInfo.timeUnit 0x00: invalid, 0x01:24 hours, 0x02: 12 hours
165 The beginning of the week unitInfo.weekStart (Sunday: 0, Monday: 1, Tuesday: 2, Wednesday: 3, Thursday: 4, Friday: 5, Saturday: 6)
166
167 * @param setUnitResult YES:success NO:failed
168 * @param disposeErrorBlock error code
169 */
170-(void)commandSetUnit:(IDOSetUnitInfoBluetoothModel*)unit setResult:(DisposeAM5SetUnit)setUnitResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
171
172/**
173 * SetLongSit
174 @param longSit
175 example code:
176 IDOSetLongSitInfoBuletoothModel * SitInfo = [IDOSetLongSitInfoBuletoothModel currentModel];
177
178 interval SitInfo.interval
179 Start(Hour) SitInfo.startHour
180 Start(minutes) SitInfo.startMinute
181 End(Hour) SitInfo.endHour
182 End(minutes) SitInfo.endMinute
183 Switch SitInfo.isOpen
184
185 * @param setLongSitResult YES:success NO:failed
186 * @param disposeErrorBlock error code
187 */
188-(void)commandSetLongSit:(IDOSetLongSitInfoBuletoothModel*)longSit setResult:(DisposeAM5SetLongSit)setLongSitResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
189
190
191/**
192 * SetLeftRightHand
193 @param leftRightHand
194 example code:
195 IDOSetLeftOrRightInfoBuletoothModel * leftOrRightModel = [IDOSetLeftOrRightInfoBuletoothModel currentModel];
196
197 Whether to wear right hand leftOrRightModel.isRight 0:left 1:right
198
199 * @param setLeftRightHandResult YES:success NO:failed
200 * @param disposeErrorBlock error code
201 */
202-(void)commandSetLeftRightHand:(IDOSetLeftOrRightInfoBuletoothModel*)leftRightHand setResult:(DisposeAM5SetLeftRightHand)setLeftRightHandResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
203
204/**
205 * SetHrInterval
206 @param hrInterval
207 example code:
208 IDOSetHrIntervalInfoBluetoothModel * hrIntervalInfo = [IDOSetHrIntervalInfoBluetoothModel currentModel];
209
210 Fat burning threshold hrIntervalInfo.burnFat
211 Aerobic threshold hrIntervalInfo.aerobic
212 Threshold limit hrIntervalInfo.limitValue
213 Maximum heart rate hrIntervalInfo.userMaxHr
214
215 * @param setHrIntervalResult YES:success NO:failed
216 * @param disposeErrorBlock error code
217 */
218-(void)commandSetHrInterval:(IDOSetHrIntervalInfoBluetoothModel*)hrInterval setResult:(DisposeAM5SetHrInterval)setHrIntervalResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
219
220/**
221 * SetHrMode
222 @param hrMode
223 example code:
224 IDOSetHrModeInfoBluetoothModel * hrModeInfo = [IDOSetHrModeInfoBluetoothModel currentModel];
225 Heart rate pattern hrModeInfo.modeType 0: turn off heart rate monitoring function 1: manual mode 2: automatic mode (default: automatic mode)
226 Is there an interval hrModeInfo.isHasTimeRange
227 Start(Hour) hrModeInfo.startHour
228 Start(minutes) hrModeInfo.startMinute
229 End(Hour) hrModeInfo.endHour
230 End(minutes) hrModeInfo.endMinute
231
232 * @param setHrModeResult YES:success NO:failed
233 * @param disposeErrorBlock error code
234 */
235-(void)commandSetHrMode:(IDOSetHrModeInfoBluetoothModel*)hrMode setResult:(DisposeAM5SetHrMode)setHrModeResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
236
237/**
238 * SetNoDisturbMode
239 @param noDisturbMode
240 example code:
241 IDOSetNoDisturbModeInfoBluetoothModel * noDisturbModeInfo = [IDOSetNoDisturbModeInfoBluetoothModel currentModel];
242
243 Is there an interval noDisturbModeInfo.isOpen
244 Start(Hour) noDisturbModeInfo.startHour
245 Start(minutes) noDisturbModeInfo.startMinute
246 End(Hour) noDisturbModeInfo.endHour
247 End(minutes) noDisturbModeInfo.endMinute
248
249 * @param setNoDisturbModeResult YES:success NO:failed
250 * @param disposeErrorBlock error code
251 */
252-(void)commandSetNoDisturbMode:(IDOSetNoDisturbModeInfoBluetoothModel*)noDisturbMode setResult:(DisposeAM5SetNoDisturbMode)setNoDisturbModeResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
253/**
254 * SetSportModeSelect
255 @param sportModeSelect
256 example code:
257 IDOSetSportShortcutInfoBluetoothModel * sportShortcutInfo = [IDOSetSportShortcutInfoBluetoothModel currentModel];
258 sportShortcutInfo.isWalk
259 sportShortcutInfo.isRun
260 sportShortcutInfo.isByBike
261 sportShortcutInfo.isOnFoot
262 sportShortcutInfo.isMountainClimbing
263 sportShortcutInfo.isBadminton
264 sportShortcutInfo.isSpinning
265 sportShortcutInfo.isTreadmill
266 sportShortcutInfo.isFitness
267 sportShortcutInfo.isYoga
268 sportShortcutInfo.isBasketball
269 sportShortcutInfo.isTennis
270 sportShortcutInfo.isDance
271 sportShortcutInfo.isFootball
272
273 * @param setSportModeSelectResult YES:success NO:failed
274 * @param disposeErrorBlock error code
275 */
276-(void)commandSetSportModeSelect:(IDOSetSportShortcutInfoBluetoothModel*)sportModeSelect setResult:(DisposeAM5SetSportModeSelect)setSportModeSelectResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
277
278/**
279 * SetSwitchNotice
280 @param switchNotice
281 example code:
282 IDOSetNoticeInfoBuletoothModel* noticeInfo = [IDOSetNoticeInfoBuletoothModel currentModel];
283 noticeInfo.isPairing
284 noticeInfo.isOnChild
285 * @param setSwitchNoticeResult YES:success NO:failed
286 * @param disposeErrorBlock error code
287 */
288-(void)commandSetSwitchNotice:(IDOSetNoticeInfoBuletoothModel*)switchNotice setResult:(DisposeAM5SetSwitchNotice)setSwitchNoticeResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
289
290/**
291 * syncConfigComplete
292
293 * @param syncConfigCompleteResult YES:success NO:failed
294 * @param disposeErrorBlock error code
295 */
296-(void)commandSyncConfigComplete:(DisposeGetAM5SyncConfigComplete)syncConfigCompleteResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
297
298/**
299 * syncData
300
301 * @param heartRateData heartRateData
302 * @param sleepData sleepData
303 * @param activityData activityData
304 * @param syncprogress data progress
305 * @param syncDataSuccess sync finish
306 * @param disposeErrorBlock error code
307 */
308-(void)commandSyncData:(DisposeGetAM5SyncHeartRateData)heartRateData syncSleepData:(DisposeGetAM5SyncSleepData)sleepData syncActivityData:(DisposeGetAM5SyncActivityData)activityData syncDataProgress:(DisposeAM5SyncDataProgress)syncprogress syncDataSuccess:(DisposeAM5SyncDataSuccess)syncDataSuccess DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
309
310/**
311 * setAppReboot
312
313 * @param setAppRebootResult YES:success NO:failed
314 * @param disposeErrorBlock error code
315 */
316-(void)commandSetAppReboot:(DisposeAM5SetAppReboot)setAppRebootResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
317
318/**
319 * SetHandUp
320 @param setHandUp
321 example code:
322 IDOSetHandUpInfoBuletoothModel * handUpModel= [IDOSetHandUpInfoBuletoothModel currentModel];
323 handUpModel.isOpen YES:open NO:close
324 * @param setHandUpResult YES:success NO:failed
325 * @param disposeErrorBlock error code
326 */
327-(void)commandSetHandUp:(IDOSetHandUpInfoBuletoothModel*)setHandUp setResult:(DisposeAM5SetHandUp)setHandUpResult DiaposeErrorBlock:(DisposeAM5ErrorBlock)disposeErrorBlock;
328
329/**
330 * Disconnect AM5 connection.
331 */
332-(void)commandAM5Disconnect;
333
334@end
335
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM5Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM5Controller.h
new file mode 100644
index 0000000..4eb42d8
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM5Controller.h
@@ -0,0 +1,30 @@
1//
2// AM5Controller.h
3// iHealthSDKStatic
4//
5// Created by user on 2019/7/2.
6// Copyright © 2019 ihealthSDK. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11NS_ASSUME_NONNULL_BEGIN
12
13@interface AM5Controller : NSObject
14
15/**
16 * Initialize AM5 controller class
17 */
18+(AM5Controller *)shareAM5Controller;
19
20
21/**
22 * Access control class instance after receiving AM5ConnectNoti, then use instance to call AM5 related communication methods
23 */
24-(NSArray *)getAllCurrentAM5Instace;
25
26-(NSMutableDictionary *)getAllDiscoverAM5Instace;
27
28@end
29
30NS_ASSUME_NONNULL_END
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM5Header.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM5Header.h
new file mode 100644
index 0000000..bfe8887
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AM5Header.h
@@ -0,0 +1,20 @@
1//
2// AM5Header.h
3// iHealthSDKStatic
4//
5// Created by user on 2019/7/4.
6// Copyright © 2019 ihealthSDK. All rights reserved.
7//
8
9#ifndef AM5Header_h
10#define AM5Header_h
11
12#import "IDOBluetoothBaseModel.h"
13#import "IDOSetInfoBluetoothModel.h"
14#import "IDOBluetoothManager.h"
15#import "IDOBluetoothServices.h"
16#import "IDOSyncManager.h"
17#import "IDOFoundationCommand.h"
18#import "IDOErrorCodeToStr.h"
19
20#endif /* AM5Header_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AMHeader.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AMHeader.h
new file mode 100644
index 0000000..a78ef3a
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AMHeader.h
@@ -0,0 +1,27 @@
1//
2// AMHeader.h
3// AMDemoCode
4//
5// Created by zhiwei jing on 14-8-12.
6// Copyright (c) 2014年 zhiwei jing. All rights reserved.
7//
8
9#ifndef AMDemoCode_AMHeader_h
10#define AMDemoCode_AMHeader_h
11
12#import "AM3.h"
13#import "AM3S_V2.h"
14#import "AM4.h"
15#import "AM5.h"
16#import "AM5Controller.h"
17
18
19#import "AM3Controller.h"
20#import "AM3SController_V2.h"
21#import "AM4Controller.h"
22
23
24#import "AMMacroFile.h"
25#import "HealthUser.h"
26
27#endif
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AMMacroFile.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AMMacroFile.h
new file mode 100755
index 0000000..dbe0a96
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/AMMacroFile.h
@@ -0,0 +1,1171 @@
1//
2// AMMacroFile.h
3// AMDemoCode
4//
5// Created by zhiwei jing on 14-8-12.
6// Copyright (c) 2014年 zhiwei jing. All rights reserved.
7//
8
9#import "HealthUser.h"
10
11#ifndef AMDemoCode_AMMacroFile_h
12#define AMDemoCode_AMMacroFile_h
13
14
15#define AM3Discover @"AM3Discover"
16#define AM3ConnectFailed @"AM3ConnectFailed"
17#define AM3ConnectNoti @"AM3ConnectNoti"
18#define AM3DisConnectNoti @"AM3DisConnectNoti"
19
20#define AM3SDiscover @"AM3SDiscover"
21#define AM3SConnectFailed @"AM3SConnectFailed"
22#define AM3SConnectNoti @"AM3SConnectNoti"
23#define AM3SDisConnectNoti @"AM3SDisConnectNoti"
24
25#define AM4Discover @"AM4Discover"
26#define AM4ConnectFailed @"AM4ConnectFailed"
27#define AM4ConnectNoti @"AM4ConnectNoti"
28#define AM4DisConnectNoti @"AM4DisConnectNoti"
29
30#define AMDeviceID @"ID"
31#define AMSDKSportRightApi @"OpenApiActivity"
32#define AMSDKSleepRightApi @"OpenApiSleep"
33
34#define AM5Discover @"AM5Discover"
35#define AM5ConnectFailed @"AM5ConnectFailed"
36#define AM5ConnectNoti @"AM5ConnectNoti"
37#define AM5DisConnectNoti @"AM5DisConnectNoti"
38#define AM5Device @"AM5Device"
39#define AM5Distance @"AM5Distance"
40
41
42//cloud
43#define AMDate @"AMDate"
44#define AMCalorie @"AMcalorie"
45#define AMStepNum @"AMstepNum"
46#define AMStepSize @"AMstepSize"
47//cloud
48
49
50///////////////////////////////////////////////////////////////
51
52//AM3
53
54///////////////////////////////////////////////////////////////
55
56
57#define AM3TimeInterval @"TimeInterval"
58
59#define AM3ActiveHistoryDateYear @"ActiveHistoryDateYear"
60#define AM3ActiveHistoryDateMonth @"ActiveHistoryDateMonth"
61#define AM3ActiveHistoryDateDay @"ActiveHistoryDateDay"
62#define AM3ActiveHistoryTotoalNum @"ActiveHistoryTotoalNum"
63#define AM3ActiveStepSize @"ActiveStepSize"
64
65#define AM3SleepHistoryDateYear @"SleepHistoryDateYear"
66#define AM3SleepHistoryDateMonth @"SleepHistoryDateMonth"
67#define AM3SleepHistoryDateDay @"SleepHistoryDateDay"
68#define AM3SleepHistoryDateHour @"SleepHistoryDateHour"
69#define AM3SleepHistoryDateMinute @"SleepHistoryDateMinute"
70#define AM3SleepHistoryDateSeconds @"SleepHistoryDateSeconds"
71#define AM3SleepHistoryTotoalNum @"SleepHistoryTotoalNum"
72
73
74/**
75 AM3 error code
76 */
77typedef NS_ENUM(NSUInteger, AM3ErrorID) {
78 /// Communication error
79 AM3Error_OverTime = 0,
80 /// You did not receive a response within a certain period of time, usually clogged Bluetooth
81 AM3Error_NoRespond,
82 /// Reset failed
83 AM3Error_ResetDeviceFaild,
84 /// AM disconnect
85 AM3Error_Disconnect,
86 /// ParameterError
87 AM3Error_ParameterError = 400,
88 /// firmware version is not supported
89 AM3Error_FirmwareVersionIsNotSupported
90};
91
92
93/**
94 AM3 Time Format
95 */
96typedef NS_ENUM(NSUInteger, AM3TimeFormat) {
97 /// 12
98 AM3TimeFormat_hh,
99 /// 24
100 AM3TimeFormat_HH
101};
102
103/**
104 AM3 State Unit
105 */
106typedef NS_ENUM(NSUInteger, AM3StateUnit){
107 /// mile
108 AM3StateUnit_mile,
109 /// km
110 AM3StateUnit_km
111};
112
113
114/**
115 AM3 State Model
116 */
117typedef NS_ENUM(NSUInteger, AM3StateModel){
118 /// sleep
119 AM3StateModel_sleep,
120 /// active
121 AM3StateModel_active,
122 /// fly
123 AM3StateModel_fly,
124 /// drive
125 AM3StateModel_drive
126};
127
128/**
129 AM3 State Info
130 */
131typedef NS_ENUM(NSUInteger, AM3StateInfo){
132 /// waist
133 AM3StateInfo_waist,
134 /// wrist
135 AM3StateInfo_wrist,
136 /// sleep
137 AM3StateInfo_sleep
138};
139
140
141
142/**
143 Error Block
144
145 @param errorID AM3ErrorID descriptions
146 */
147typedef void (^DisposeAM3ErrorBlock)(AM3ErrorID errorID);
148
149
150/**
151 get user ID
152
153 @param userID userID
154 */
155typedef void (^DisposeAM3GetDeviceUserIDBlock)(unsigned int userID);
156
157
158/**
159 sync time
160
161 @param resetSuc yes:success no:fail
162 */
163typedef void (^DisposeAM3SyncTimeBlock)(BOOL resetSuc);
164
165
166/**
167 get dateFormatter
168
169 @param timeFormat AM3TimeFormat description
170 */
171typedef void (^DisposeAM3TimeFormatBlock)(AM3TimeFormat timeFormat);
172
173
174
175/**
176 set timeFormat
177
178 @param resetSuc yes:success no:fail
179 */
180typedef void (^DisposeAM3TimeFormatSettingBlock)(BOOL resetSuc);
181
182
183
184/**
185 set userID
186
187 @param resetSuc yes:success no:fail
188 */
189typedef void (^DisposeAM3SetDeviceUserIDBlock)(BOOL resetSuc);
190
191
192/**
193 set user info
194
195 @param resetSuc yes:success no:fail
196 */
197typedef void (^DisposeAM3SetUserInfoBlock)(BOOL resetSuc);
198
199
200/**
201 set BMR
202 @param resetSuc yes:success no:fail
203 */
204typedef void (^DisposeAM3SetBMRBlock)(BOOL resetSuc);
205
206
207/**
208 active start transmission
209
210 @param startDataDictionary including parameters:Start date,yyyy-MM-dd(ActiveHistoryDateYear,ActiveHistoryDateMonth,ActiveHistoryDateDay),ActiveStepSize:Length of each step,ActiveHistoryTotoalNum:Number of records.
211 */
212typedef void (^DisposeAM3ActiveStartTransmission)(NSDictionary *startDataDictionary);
213
214
215/**
216 active history data
217
218 @param historyDataArray including the following parameters:AMDate、AMCalorie、AMstepNum、AMstepSize、dataID、Start. AMDate:Workout time,AMCalorie: Current time total calories,AMStepNum:Total number of steps,dataID:data ID,Start:represents the beginning of a movement.
219 */
220typedef void (^DisposeAM3ActiveHistoryData)(NSArray *historyDataArray);
221
222
223
224/**
225 active finish transmission
226 */
227typedef void (^DisposeAM3ActiveFinishTransmission)(void);
228
229
230
231
232/**
233 sleep start transmission
234
235 @param startDataDictionary including parameters:SleepHistoryDate、AM3SleepHistoryTotoalNum.SleepHistoryDate:Sleep start time,yyyy-MM-dd HH:mm:ss(SleepHistoryDateYear,SleepHistoryDateMonth,SleepHistoryDateDay,SleepHistoryDateHour,SleepHistoryDateMinute,SleepHistoryDateSeconds).SleepHistoryTotoalNum: Number of records
236 */
237typedef void (^DisposeAM3SleepStartTransmission)(NSDictionary *startDataDictionary);
238
239
240/**
241 sleep history data
242
243 @param historyDataArray including the following parameters::AMDate、SleepData、dataID.AMDate:Sleep time, SleepData: Sleep grade, 0: awake, 1: light sleep, 2: deep sleep ,dataID: data ID
244 */
245typedef void (^DisposeAM3SleepHistoryData)(NSArray *historyDataArray);
246
247
248/**
249 sleep finish transmission
250 */
251typedef void (^DisposeAM3SleepFinishTransmission)(void);
252
253
254/**
255 get current active info
256
257 @param activeDictionary Total calories and steps for today, including parameters:Step、Calories、TotalCalories.Step:Number of steps taken today.Calories:Number of calories burned today.TotalCalories:Sum calories burned and bmr today.
258 */
259typedef void (^DisposeAM3GetCurrentActiveInfo)(NSDictionary *activeDictionary);
260
261
262/**
263 totoal alarm array
264
265 @param totoalAlarmArray totoalAlarmArray contains up to 3 alarms, each one needs the following parameters:AlarmId、Time、IsRepeat、Switch、(Sun、Mon、Tue、Wed、Thu、Fri、Sat)
266 */
267typedef void (^DisposeAM3TotoalAlarmData)(NSMutableArray *totoalAlarmArray);
268
269
270/**
271 set alarm
272
273 @param resetSuc yes:success no:fail
274 */
275typedef void (^DisposeAM3SetAlarmBlock)(BOOL resetSuc);
276
277
278/**
279 delete Alarm
280
281 @param resetSuc yes:success no:fail
282
283 */
284typedef void (^DisposeAM3DeleteAlarmBlock)(BOOL resetSuc);
285
286
287/**
288 get remind info
289
290 @param remindInfo array containing following parameters:ReminderID、Time、Switch.ReminderID:Reminder ID.Time:format HH:mm, time between reminders (HH*60+mm) minutes.Switch:Reminder on/off,True: On, False: Off.
291 */
292typedef void (^DisposeAM3RemindInfoBlock)(NSArray *remindInfo);
293
294
295
296/**
297 set reminder
298
299 @param resetSuc yes:success no:fail
300 */
301typedef void (^DisposeAM3SetReminderBlock)(BOOL resetSuc);
302
303
304/**
305 get state info
306
307 @param queryState AM3StateInfo description
308 */
309typedef void (^DisposeAM3StateInfoBlock)(AM3StateInfo queryState);
310
311
312/**
313 get battery
314
315 @param battery 1~100
316 */
317typedef void (^DisposeAM3BatteryBlock)(NSNumber *battery);
318
319
320/**
321 reset device
322
323 @param resetSuc yes:success no:fail
324 */
325typedef void (^DisposeAM3ResetDeviceBlock)(BOOL resetSuc);
326
327
328/**
329 disconnect
330
331 @param resetSuc yes:success no:fail
332 */
333typedef void (^DisposeAM3DisconnectBlock)(BOOL resetSuc);
334
335
336/**
337 get user info
338
339 @param userInfo including parameters:Age,Step,Height,Gender,Weight,Unit,goal(TotalStep1、TotalStep2、TotalStep3)
340 */
341typedef void (^DisposeAM3UserInfoBlock)(NSDictionary *userInfo);
342
343
344/**
345 set State
346
347 @param resetSuc yes:success no:fail
348 */
349typedef void (^DisposeAM3SetStateBlock)(BOOL resetSuc);
350
351
352/**
353 set state model
354
355 @param resetSuc yes:success no:fail
356 */
357typedef void (^DisposeAM3SetStateModelBlock)(BOOL resetSuc);
358///////////////////////////////////////////////////////////////
359
360//AM3S
361
362///////////////////////////////////////////////////////////////
363
364#define AM3STimeInterval @"TimeInterval"
365
366#define AM3SActiveHistoryDateYear @"ActiveHistoryDateYear"
367#define AM3SActiveHistoryDateMonth @"ActiveHistoryDateMonth"
368#define AM3SActiveHistoryDateDay @"ActiveHistoryDateDay"
369#define AM3SActiveHistoryTotoalNum @"ActiveHistoryTotoalNum"
370#define AM3SActiveStepSize @"ActiveStepSize"
371
372#define AM3SSleepHistoryDateYear @"SleepHistoryDateYear"
373#define AM3SSleepHistoryDateMonth @"SleepHistoryDateMonth"
374#define AM3SSleepHistoryDateDay @"SleepHistoryDateDay"
375#define AM3SSleepHistoryDateHour @"SleepHistoryDateHour"
376#define AM3SSleepHistoryDateMinute @"SleepHistoryDateMinute"
377#define AM3SSleepHistoryDateSeconds @"SleepHistoryDateSeconds"
378#define AM3SSleepHistoryTotoalNum @"SleepHistoryTotoalNum"
379
380
381#define ReportState @"ReportState"
382
383#define Work_outMeasureDate @"Work_outMeasureDate"
384#define Work_outTimeNumber @"Work_outTimeNumber"
385#define Work_outStepNumber @"Work_outStepNumber"
386#define Work_outLengthNumber @"Work_outLengthNumber"
387#define Work_outCalories @"Work_outCalories"
388#define Work_outTimeZone @"Work_outTimeZone"
389
390#define Sleep_summaryMeasureDate @"Sleep_summaryMeasureDate"
391#define Sleep_summarySleepTime @"Sleep_summarySleepTime"
392#define Sleep_summarysleepEfficiency @"Sleep_summarysleepEfficiency"
393#define Sleep_summarysleepAddMinute @"Sleep_summarysleepAddMinute"
394#define Sleep_summaryTimeZone @"Sleep_summaryTimeZone"
395
396
397/**
398 AM3S error code
399 */
400typedef NS_ENUM(NSUInteger, AM3SErrorID) {
401 /// Communication error
402 AM3SError_OverTime = 0,
403 /// You did not receive a response within a certain period of time, usually clogged Bluetooth
404 AM3SError_NoRespond,
405 /// Reset failed
406 AM3SError_ResetDeviceFaild,
407 /// AM disconnect
408 AM3SError_Disconnect,
409 /// ParameterError
410 AM3SError_ParameterError = 400,
411 /// firmware version is not supported
412 AM3SError_FirmwareVersionIsNotSupported
413};
414
415
416
417/**
418 AM3S Time Format
419 */
420typedef NS_ENUM(NSUInteger, AM3STimeFormatAndNation) {
421 /// 12
422 AM3STimeFormat_hh = 0,
423 /// 24
424 AM3STimeFormat_HH,
425 /// No europe and hh
426 AM3STimeFormat_NoEuropeAndhh,
427 /// europe and hh
428 AM3STimeFormat_EuropeAndhh,
429 /// no europe and HH
430 AM3STimeFormat_NoEuropeAndHH,
431 /// europe and HH
432 AM3STimeFormat_EuropeAndHH,
433};
434
435
436/**
437 AM3S State Unit
438 */
439typedef NS_ENUM(NSUInteger, AM3SKmUnit){
440 /// mile
441 AM3SKmUnit_mile,
442 /// km
443 AM3SKmUnit_km
444};
445
446
447/**
448 AM3S Query State
449 */
450typedef NS_ENUM(NSUInteger, AM3SQueryState){
451 /// waist
452 AM3SState_waist,
453 /// wrist
454 AM3SState_wrist,
455 /// sleep
456 AM3SState_sleep
457};
458
459
460/**
461 AM3S Picture
462 */
463typedef NS_ENUM(NSUInteger, AM3SPicture){
464 /// one
465 AM3SPicture_one,
466 /// two
467 AM3SPicture_two,
468};
469
470/**
471 AM3S ReportStage
472 */
473typedef NS_ENUM(NSUInteger, AM3SReportStage){
474 /// Work_out
475 AM3SReportStage_Work_out = 1,
476 /// Sleep_summary
477 AM3SReportStage_Sleep_summary,
478};
479
480/**
481 AM3S ActiveState
482 */
483typedef NS_ENUM(NSUInteger, AM3SActiveState){
484 /// Active
485 AM3SActive_State = 0,
486 /// sleep
487 AM3SSleep_State = 1,
488 /// flight
489 AM3SFly_State = 2,
490 /// workout
491 AM3SWorkout_State = 4,
492};
493
494
495/**
496 get user ID
497
498 @param userID userID
499 */
500typedef void (^DisposeAM3SGetDeviceUserIDBlock)(unsigned int userID);
501
502/**
503 Error Block
504
505 @param errorID AM3SErrorID descriptions
506 */
507typedef void (^DisposeAM3SErrorBlock)(AM3SErrorID errorID);
508
509
510/**
511 set random number
512
513 @param randomNumString randomNumString
514 */
515typedef void (^DisposeAM3SSetRandomNumberBlock)(NSString *randomNumString);
516/**
517 sync time
518
519 @param resetSuc yes:success no:fail
520 */
521typedef void (^DisposeAM3SSyncTimeBlock)(BOOL resetSuc);
522
523/**
524 set timeFormat and nation
525
526 @param timeFormatAndNation AM3STimeFormatAndNation description
527 */
528typedef void (^DisposeAM3STimeFormatAndNationBlock)(AM3STimeFormatAndNation timeFormatAndNation);
529
530/**
531 set date Formatter
532
533 @param resetSuc yes:success no:fail
534 */
535typedef void (^DisposeAM3STimeFormatAndNationSettingBlock)(BOOL resetSuc);
536
537/**
538 set userID
539
540 @param resetSuc yes:success no:fail
541 */
542typedef void (^DisposeAM3SSetDeviceUserIDBlock)(BOOL resetSuc);
543
544
545/**
546 set user info
547
548 @param resetSuc yes:success no:fail
549 */
550typedef void (^DisposeAM3SSetUserInfoBlock)(BOOL resetSuc);
551
552/**
553 set BMR
554 @param resetSuc yes:success no:fail
555 */
556typedef void (^DisposeAM3SSetBMRBlock)(BOOL resetSuc);
557
558/**
559 active start transmission
560
561 @param startDataDictionary including parameters:Start date,yyyy-MM-dd(ActiveHistoryDateYear,ActiveHistoryDateMonth,ActiveHistoryDateDay),ActiveStepSize:Length of each step,ActiveHistoryTotoalNum:Number of records.
562 */
563typedef void (^DisposeAM3SActiveStartTransmission)(NSDictionary *startDataDictionary);
564
565
566/**
567 active history data
568
569 @param historyDataArray including the following parameters:AMDate、AMCalorie、AMstepNum、AMstepSize、dataID、Start. AMDate:Workout time,AMCalorie: Current time total calories,AMStepNum:Total number of steps,dataID:data ID,Start:represents the beginning of a movement.
570 */
571typedef void (^DisposeAM3SActiveHistoryData)(NSArray *historyDataArray);
572
573/**
574 active finish transmission
575 */
576typedef void (^DisposeAM3SActiveFinishTransmission)(void);//
577
578
579/**
580 sleep start transmission
581
582 @param startDataDictionary including parameters:SleepHistoryDate、AM3SleepHistoryTotoalNum.SleepHistoryDate:Sleep start time,yyyy-MM-dd HH:mm:ss(SleepHistoryDateYear,SleepHistoryDateMonth,SleepHistoryDateDay,SleepHistoryDateHour,SleepHistoryDateMinute,SleepHistoryDateSeconds).SleepHistoryTotoalNum: Number of records
583 */
584typedef void (^DisposeAM3SSleepStartTransmission)(NSDictionary *startDataDictionary);
585/**
586 sleep history data
587
588 @param historyDataArray including the following parameters::AMDate、SleepData、dataID.AMDate:Sleep time, SleepData: Sleep grade, 0: awake, 1: light sleep, 2: deep sleep ,dataID: data ID
589 */
590typedef void (^DisposeAM3SSleepHistoryData)(NSArray *historyDataArray);
591
592/**
593 sleep finish transmission
594 */
595typedef void (^DisposeAM3SSleepFinishTransmission)(void);
596
597/**
598 get current active info
599
600 @param activeDictionary Total calories and steps for today, including parameters:Step、Calories、TotalCalories.Step:Number of steps taken today.Calories:Number of calories burned today.TotalCalories:Sum calories burned and bmr today.
601 */
602typedef void (^DisposeAM3SGetCurrentActiveInfo)(NSDictionary *activeDictionary);
603
604/**
605 reset device
606
607 @param resetSuc yes:success no:fail
608 */
609typedef void (^DisposeAM3SResetDeviceBlock)(BOOL resetSuc);
610
611/**
612 totoal alarm array
613
614 @param totoalAlarmArray totoalAlarmArray contains up to 3 alarms, each one needs the following parameters:AlarmId、Time、IsRepeat、Switch、(Sun、Mon、Tue、Wed、Thu、Fri、Sat)
615 */
616typedef void (^DisposeAM3STotoalAlarmData)(NSMutableArray *totoalAlarmArray);
617
618
619/**
620 set alarm
621
622 @param resetSuc yes:success no:fail
623 */
624typedef void (^DisposeAM3SSetAlarmBlock)(BOOL resetSuc);
625/**
626 delete Alarm
627
628 @param resetSuc yes:success no:fail
629
630 */
631typedef void (^DisposeAM3SDeleteAlarmBlock)(BOOL resetSuc);
632
633/**
634 get remind info
635
636 @param remindInfo array containing following parameters:ReminderID、Time、Switch.ReminderID:Reminder ID.Time:format HH:mm, time between reminders (HH*60+mm) minutes.Switch:Reminder on/off,True: On, False: Off.
637 */
638typedef void (^DisposeAM3SRemindInfoBlock)(NSArray *remindInfo);
639
640
641/**
642 set reminder
643
644 @param resetSuc yes:success no:fail
645 */
646typedef void (^DisposeAM3SSetReminderBlock)(BOOL resetSuc);
647
648/**
649 get state info
650
651 @param queryState AM3StateInfo description
652 */
653typedef void (^DisposeAM3SStateInfoBlock)(AM3SQueryState queryState);
654
655/**
656 get battery
657
658 @param battery 1~100
659 */
660typedef void (^DisposeAM3SBatteryBlock)(NSNumber *battery);
661
662/**
663 disconnect
664
665 @param resetSuc yes:success no:fail
666 */
667typedef void (^DisposeAM3SDisconnectBlock)(BOOL resetSuc);
668
669/**
670 stage measure data
671
672 @param measureDataArray including workout and sleepSummary
673 */
674typedef void (^DisposeAM3SStageMeasureDataBlock)(NSArray *measureDataArray);
675
676
677/**
678 stage measure dinish
679
680 @param resetSuc yes:success no:fail
681 */
682typedef void (^DisposeAM3SStageMeasureFinishBlock)(BOOL resetSuc);
683
684
685/**
686 get user info
687
688 @param userInfo including parameters:Age,Step,Height,Gender,Weight,Unit,goal(TotalStep1、TotalStep2、TotalStep3)
689 */
690typedef void (^DisposeAM3SUserInfoBlock)(NSDictionary *userInfo);
691
692/**
693 query picture
694 */
695typedef void (^DisposeAM3SGetPictureBlock)(AM3SPicture picture);
696
697/**
698 set picture
699 */
700typedef void (^DisposeAM3SSetPictureBlock)(BOOL resetSuc);
701
702
703
704///////////////////////////////////////////////////////////////
705
706
707//AM4
708
709///////////////////////////////////////////////////////////////
710
711
712#define AM4TimeInterval @"TimeInterval"
713
714#define AM4ActiveHistoryDateYear @"ActiveHistoryDateYear"
715#define AM4ActiveHistoryDateMonth @"ActiveHistoryDateMonth"
716#define AM4ActiveHistoryDateDay @"ActiveHistoryDateDay"
717#define AM4ActiveHistoryTotoalNum @"ActiveHistoryTotoalNum"
718#define AM4ActiveStepSize @"ActiveStepSize"
719#define AM4ActiveTimeZone @"ActiveTimeZone"
720
721#define AM4SleepHistoryDateYear @"SleepHistoryDateYear"
722#define AM4SleepHistoryDateMonth @"SleepHistoryDateMonth"
723#define AM4SleepHistoryDateDay @"SleepHistoryDateDay"
724#define AM4SleepHistoryDateHour @"SleepHistoryDateHour"
725#define AM4SleepHistoryDateMinute @"SleepHistoryDateMinute"
726#define AM4SleepHistoryDateSeconds @"SleepHistoryDateSeconds"
727#define AM4SleepHistoryTotoalNum @"SleepHistoryTotoalNum"
728#define AM4SleepHistoryTimeZone @"SleepHistoryTimeZone"
729
730
731
732#define AM4SwimmingMeasureDate @"SwimmingMeasureDate"
733#define AM4SwimmingTimeNumber @"SwimmingTimeNumber"
734#define AM4SwimmingTimes @"SwimmingTimes"
735#define AM4Swimmingcalories @"Swimmingcalories"
736#define AM4SwimmingAct @"SwimmingAct"
737#define AM4SwimmingPoollength @"SwimmingPoollength"
738#define AM4SwimmingCircleCount @"SwimmingCircleCount"
739#define AM4EnterSwimmingTime @"EnterSwimmingTime"
740#define AM4OutSwimmingTime @"OutSwimmingTime"
741#define AM4SwimmingProcessMark @"SwimmingProcessMark"
742#define AM4SwimStartTimeStamp @"SwimStartTimeStamp"
743#define AM4SwimmingTimeZone @"SwimmingTimeZone"
744
745
746/**
747 AM4 error code
748 */
749typedef NS_ENUM(NSUInteger, AM4ErrorID) {
750 /// Communication error
751 AM4Error_OverTime = 0,
752 /// You did not receive a response within a certain period of time, usually clogged Bluetooth
753 AM4Error_NoRespond,
754 /// Reset failed
755 AM4Error_ResetDeviceFaild,
756 /// AM disconnect
757 AM4Error_Disconnect,
758 /// ParameterError
759 AM4Error_ParameterError = 400,
760 /// firmware version is not supported
761 AM4Error_FirmwareVersionIsNotSupported
762};
763
764
765
766/**
767 AM4 Time Format
768 */
769typedef NS_ENUM(NSUInteger, AM4TimeFormatAndNation) {
770 /// 12
771 AM4TimeFormat_hh = 0,
772 /// 24
773 AM4TimeFormat_HH,
774 /// No europe and hh
775 AM4TimeFormat_NoEuropeAndhh,
776 /// europe and hh
777 AM4TimeFormat_EuropeAndhh,
778 /// no europe and HH
779 AM4TimeFormat_NoEuropeAndHH,
780 /// europe and HH
781 AM4TimeFormat_EuropeAndHH,
782};
783
784/**
785 AM4 State Unit
786 */
787typedef NS_ENUM(NSUInteger, AM4KmUnit){
788 /// mile
789 AM4KmUnit_mile,
790 /// km
791 AM4KmUnit_km
792};
793
794
795/**
796 AM4 Swimming Unit
797 */
798typedef NS_ENUM(NSUInteger, AM4SwimmingUnit){
799 /// m
800 AM4SwimmingUnit_m,
801 /// km
802 AM4SwimmingUnit_km,
803};
804
805/**
806 AM4 Query State
807 */
808typedef NS_ENUM(NSUInteger, AM4QueryState){
809 /// waist
810 AM4State_waist,
811 /// waist
812 AM4State_wrist,
813 /// waist
814 AM4State_sleep
815};
816
817/**
818 AM4 Swimming Action
819 */
820typedef NS_ENUM(NSUInteger, AM4SwimmingAction){
821 /// Crawl
822 AM4SwimmingAction_Crawl,
823 /// Breaststroke
824 AM4SwimmingAction_Breaststroke,
825 /// Backstroke
826 AM4SwimmingAction_Backstroke,
827 /// Butterfly
828 AM4SwimmingAction_Butterfly,
829 /// MixedSwimming
830 AM4SwimmingAction_MixedSwimming,
831 /// Unkonw
832 AM4SwimmingAction_Unkonw
833};
834
835/**
836 AM4 Report Stage
837 */
838typedef NS_ENUM(NSUInteger, AM4ReportStage){
839 /// Swimming
840 AM4ReportStage_Swimming,
841 /// Work_out
842 AM4ReportStage_Work_out,
843 /// summary
844 AM4ReportStage_Sleep_summary,
845};
846
847/**
848 AM4 Active State
849 */
850typedef NS_ENUM(NSUInteger, AM4ActiveState){
851 /// Active_State
852 AM4Active_State =0,
853 /// Sleep_State
854 AM4Sleep_State =1,
855 /// Fly_State
856 AM4Fly_State =2,
857 /// Workout_State
858 AM4Workout_State=4,
859 /// Swimming_State
860 AM4Swimming_State=5,
861};
862
863
864
865/**
866 get user ID
867
868 @param userID userID
869 */
870typedef void (^DisposeAM4GetDeviceUserIDBlock)(unsigned int userID);
871
872/**
873 Error Block
874
875 @param errorID AM4ErrorID descriptions
876 */
877typedef void (^DisposeAM4ErrorBlock)(AM4ErrorID errorID);
878
879/**
880 set random number
881
882 @param randomNumString randomNumString
883 */
884typedef void (^DisposeAM4SetRandomNumberBlock)(NSString *randomNumString);
885
886/**
887 sync time
888
889 @param resetSuc yes:success no:fail
890 */
891typedef void (^DisposeAM4SyncTimeBlock)(BOOL resetSuc);
892
893
894/**
895 set timeFormat and nation
896
897 @param timeFormatAndNation AM4TimeFormatAndNation description
898 */
899typedef void (^DisposeAM4TimeFormatAndNationBlock)(AM4TimeFormatAndNation timeFormatAndNation);
900
901
902/**
903 set date Formatter
904
905 @param resetSuc yes:success no:fail
906 */
907typedef void (^DisposeAM4TimeFormatAndNationSettingBlock)(BOOL resetSuc);
908
909/**
910 set userID
911
912 @param resetSuc yes:success no:fail
913 */
914typedef void (^DisposeAM4SetDeviceUserIDBlock)(BOOL resetSuc);
915
916/**
917 set user info
918
919 @param resetSuc yes:success no:fail
920 */
921typedef void (^DisposeAM4SetUserInfoBlock)(BOOL resetSuc);
922
923/**
924 set BMR
925 */
926typedef void (^DisposeAM4SetBMRBlock)(BOOL resetSuc);
927
928/**
929 active start transmission
930
931 @param startDataDictionary including parameters:Start date,yyyy-MM-dd(ActiveHistoryDateYear,ActiveHistoryDateMonth,ActiveHistoryDateDay),ActiveStepSize:Length of each step,ActiveHistoryTotoalNum:Number of records.
932 */
933typedef void (^DisposeAM4ActiveStartTransmission)(NSDictionary *startDataDictionary);
934
935/**
936 active history data
937
938 @param historyDataArray including the following parameters:AMDate、AMCalorie、AMstepNum、AMstepSize、dataID、Start. AMDate:Workout time,AMCalorie: Current time total calories,AMStepNum:Total number of steps,dataID:data ID,Start:represents the beginning of a movement.
939 */
940typedef void (^DisposeAM4ActiveHistoryData)(NSArray *historyDataArray);
941
942/**
943 active finish transmission
944 */
945typedef void (^DisposeAM4ActiveFinishTransmission)(void);
946
947/**
948 sleep start transmission
949
950 @param startDataDictionary including parameters:SleepHistoryDate、AM3SleepHistoryTotoalNum.SleepHistoryDate:Sleep start time,yyyy-MM-dd HH:mm:ss(SleepHistoryDateYear,SleepHistoryDateMonth,SleepHistoryDateDay,SleepHistoryDateHour,SleepHistoryDateMinute,SleepHistoryDateSeconds).SleepHistoryTotoalNum: Number of records
951 */
952typedef void (^DisposeAM4SleepStartTransmission)(NSDictionary *startDataDictionary);
953
954/**
955 sleep history data
956
957 @param historyDataArray including the following parameters::AMDate、SleepData、dataID.AMDate:Sleep time, SleepData: Sleep grade, 0: awake, 1: light sleep, 2: deep sleep ,dataID: data ID
958 */
959typedef void (^DisposeAM4SleepHistoryData)(NSArray *historyDataArray);
960
961/**
962 sleep finish transmission
963 */
964typedef void (^DisposeAM4SleepFinishTransmission)(void);
965
966/**
967 get current active info
968
969 @param activeDictionary Total calories and steps for today, including parameters:Step、Calories、TotalCalories.Step:Number of steps taken today.Calories:Number of calories burned today.TotalCalories:Sum calories burned and bmr today.
970 */
971typedef void (^DisposeAM4GetCurrentActiveInfo)(NSDictionary *activeDictionary);
972
973/**
974 reset device
975
976 @param resetSuc yes:success no:fail
977 */
978typedef void (^DisposeAM4ResetDeviceBlock)(BOOL resetSuc);
979
980/**
981 totoal alarm array
982
983 @param totoalAlarmArray totoalAlarmArray contains up to 3 alarms, each one needs the following parameters:AlarmId、Time、IsRepeat、Switch、(Sun、Mon、Tue、Wed、Thu、Fri、Sat)
984 */
985typedef void (^DisposeAM4TotoalAlarmData)(NSMutableArray *totoalAlarmArray);
986
987/**
988 set alarm
989
990 @param resetSuc yes:success no:fail
991 */
992typedef void (^DisposeAM4SetAlarmBlock)(BOOL resetSuc);
993
994/**
995 delete Alarm
996
997 @param resetSuc yes:success no:fail
998
999 */
1000typedef void (^DisposeAM4DeleteAlarmBlock)(BOOL resetSuc);
1001
1002/**
1003 get remind info
1004
1005 @param remindInfo array containing following parameters:ReminderID、Time、Switch.ReminderID:Reminder ID.Time:format HH:mm, time between reminders (HH*60+mm) minutes.Switch:Reminder on/off,True: On, False: Off.
1006 */
1007typedef void (^DisposeAM4RemindInfoBlock)(NSArray *remindInfo);
1008
1009/**
1010 set reminder
1011
1012 @param resetSuc yes:success no:fail
1013 */
1014typedef void (^DisposeAM4SetReminderBlock)(BOOL resetSuc);
1015
1016/**
1017 get state info
1018
1019 @param queryState AM3StateInfo description
1020 */
1021typedef void (^DisposeAM4StateInfoBlock)(AM4QueryState queryState);
1022
1023/**
1024 get battery
1025
1026 @param battery 1~100
1027 */
1028typedef void (^DisposeAM4BatteryBlock)(NSNumber *battery);
1029
1030/**
1031 disconnect
1032
1033 @param resetSuc yes:success no:fail
1034 */
1035typedef void (^DisposeAM4DisconnectBlock)(BOOL resetSuc);
1036
1037
1038/**
1039 get Swimming info
1040
1041 @param swimmingIsOpen yes open ,no close
1042 @param swimmingLaneLength lane length
1043 @param NOSwimmingTime no swimming time
1044 @param unit AM4SwimmingUnit description
1045 */
1046typedef void (^DisposeAM4SwimmingBlock)(BOOL swimmingIsOpen, NSNumber * swimmingLaneLength,NSNumber * NOSwimmingTime, AM4SwimmingUnit unit);
1047
1048
1049/**
1050 setting swimming
1051
1052 @param resetSuc yes:success no:fail
1053 */
1054typedef void (^DisposeAM4SettingSwimmingBlock)(BOOL resetSuc);
1055
1056/**
1057 stage measure data
1058
1059 @param measureDataArray including workout、swimming and sleepSummary
1060 */
1061typedef void (^DisposeAM4StageMeasureDataBlock)(NSArray *measureDataArray);
1062
1063/**
1064 stage measure dinish
1065
1066 @param resetSuc yes:success no:fail
1067 */
1068typedef void (^DisposeAM4StageMeasureFinishBlock)(BOOL resetSuc);
1069
1070
1071/**
1072 get user info
1073
1074 @param userInfo including parameters:Age,Step,Height,Gender,Weight,Unit,goal(TotalStep1、TotalStep2、TotalStep3)
1075 */
1076typedef void (^DisposeAM4UserInfoBlock)(NSDictionary *userInfo);
1077
1078
1079
1080/**
1081 send AM3 data
1082 */
1083typedef void (^DisposeSendAM3DataBlock)(void);
1084
1085/**
1086 send AM3S data
1087 */
1088typedef void (^DisposeSendAM3SDataBlock)(void);
1089
1090
1091/**
1092 send AM4 data
1093
1094 */
1095typedef void (^DisposeSendAM4DataBlock)(void);
1096
1097
1098
1099
1100/************AM5**************/
1101
1102typedef NS_ENUM(NSUInteger, AM5DeviceError) {
1103 AM5DeviceError_GetDataFailError = 0,
1104 AM5DeviceError_SetTimeFaild,
1105 AM5DeviceError_SetUnitFaild,
1106 AM5DeviceError_SetUserInfoFaild,
1107 AM5DeviceError_BindFaild,
1108 AM5DeviceError_SyncConfigComplete,
1109};
1110
1111
1112
1113
1114typedef void (^DisposeAM5ErrorBlock)(AM5DeviceError errorID);
1115
1116typedef void (^DisposeBindingAM5Result)(BOOL result);
1117
1118typedef void (^DisposeUnBindingAM5Result)(BOOL result);
1119
1120typedef void (^DisposeGetAM5DeviceInfo)(NSMutableDictionary * DeviceInfo);
1121
1122typedef void (^DisposeGetAM5FuncTable)(NSMutableDictionary * DeviceFuncTable);
1123
1124typedef void (^DisposeGetAM5Mac)(NSString* deviceMac);
1125
1126typedef void (^DisposeGetAM5LiveData)(NSMutableDictionary * liveDataDic);
1127
1128typedef void (^DisposeGetAM5ActivityCount)(NSMutableDictionary * activityCountDic);
1129
1130typedef void (^DisposeAM5SetCurrentTime)(BOOL result);
1131
1132typedef void (^DisposeAM5SetAlarm)(BOOL result);
1133
1134typedef void (^DisposeAM5SetUserTarget)(BOOL result);
1135
1136typedef void (^DisposeAM5SetUserInfo)(BOOL result);
1137
1138typedef void (^DisposeAM5SetUnit)(BOOL result);
1139
1140typedef void (^DisposeAM5SetLongSit)(BOOL result);
1141
1142typedef void (^DisposeAM5SetLeftRightHand)(BOOL result);
1143
1144typedef void (^DisposeAM5SetHrInterval)(BOOL result);
1145
1146typedef void (^DisposeAM5SetHrMode)(BOOL result);
1147
1148typedef void (^DisposeAM5SetNoDisturbMode)(BOOL result);
1149
1150typedef void (^DisposeAM5SetSportModeSelect)(BOOL result);
1151
1152typedef void (^DisposeAM5SetSwitchNotice)(BOOL result);
1153
1154typedef void (^DisposeGetAM5SyncConfigComplete)(BOOL result);
1155
1156typedef void (^DisposeGetAM5SyncHeartRateData)(NSDictionary * syncDataDic);
1157
1158typedef void (^DisposeGetAM5SyncSleepData)(NSDictionary * syncDataDic);
1159
1160typedef void (^DisposeGetAM5SyncActivityData)(NSDictionary * syncDataDic);
1161
1162typedef void (^DisposeAM5SyncDataProgress)(NSNumber * syncDataProgress);
1163
1164typedef void (^DisposeAM5SyncDataSuccess)(void);
1165
1166typedef void (^DisposeAM5SetAppReboot)(BOOL result);
1167
1168typedef void (^DisposeAM5SetHandUp)(BOOL result);
1169
1170#endif
1171
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1.h
new file mode 100644
index 0000000..5cd9537
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1.h
@@ -0,0 +1,53 @@
1//
2// BG1.h
3// iHealthSDKStatic
4//
5// Created by soso on 2017/8/25.
6// Copyright © 2017年 ihealth. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BGMacroFile.h"
11
12/**
13 BG1
14 */
15@interface BG1 : NSObject
16@property (strong, nonatomic) NSString *mac;
17@property (strong, nonatomic) NSString *firmwareVersion;
18
19
20/**
21 * Start connect BG1 and get the connection status.
22 * @param BG1Model the BG1 type.
23 * @param discover This block returns means blood glucose meter plugged in.
24 * @param IDPSInfo This block returns the IDPS of the meter, this will be operated for the first time when the app talks to the meter.
25 * @param connect This block returns the connection status, the connection of the BG meter is regular , the measurement could be processed.
26 * @param error block returns error codes,please refer to error codes list in BGMacroFile.
27 * @Notice Notice: Using this method should be placed kNotificationNameNeedAudioPermission callback
28 */
29- (void)commandBG1DeviceModel:(NSNumber *)BG1Model withDiscoverBlock:(DisposeBG1DiscoverBlock)discover withDiscoverBlock:(DisposeBG1IDPSBlock)IDPSInfo withConnectBlock:(DisposeBG1ConnectBlock)connect withErrorBlock:(DisposeBG1ErrorBlock)error;
30
31
32/**
33 * Establish connection and start BG measurement.(New)
34 * @param measureMode Set the measure test type,BGMeasureMode_Blood is Blood Test,BGMeasureMode_NoBlood is CTL Test.
35 * @param codeMode Set the code type,BGCodeMode_GOD is GOD,BGCodeMode_GDH is GDH.
36 * @param codeString The code String gets by scanning the QR code.
37 * @param sendCodeResult If the QR code is accepted, yes means accepted, no means deny.
38 * @param stripIn The strips slide into the BG meter.
39 * @param blood The blood drop has beed sensed from the strip.
40 * @param measureResult Returns the measurement by the unit of mg/dL, range from 20-600.
41 * @param stripOut The strip has been pulled out.
42 * @param error This block returns error codes,please refer to error codes list in BGMacroFile.
43 */
44- (void)commandBG1MeasureMode:(BGMeasureMode)measureMode withCodeMode:(BGCodeMode)codeMode withCodeString:(NSString *)codeString withSendCodeResultBlock:(DisposeBG1SendCodeResultBlock)sendCodeResult withStripInBlock:(DisposeBGStripInBlock)stripIn withBloodBlock:(DisposeBGBloodBlock)blood withResultBlock:(DisposeBGResultBlock)measureResult withStripOutBlock:(DisposeBGStripOutBlock)stripOut withErrorBlock:(DisposeBG1ErrorBlock)error;
45
46/**
47 Analyze code include bottleID,DueDate and the number of strips. Only Available for GOD Code
48
49 @param encodeString The code String gets by scanning the QR code.
50 @return return a dictionary contains keys such as @"BottleID",@"StripNum",@"DueDate"; return nil if input parameter is GDH code or code is invalid.
51 */
52-(NSDictionary *)codeStripStrAnalysis:(NSString *)encodeString;
53@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1Controller.h
new file mode 100644
index 0000000..fe0860b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1Controller.h
@@ -0,0 +1,46 @@
1//
2// BG1Controller.h
3// iHealthBG
4//
5// Created by xujianbo on 14-10-08.
6// Copyright (c) 2014年 andon. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10@class BG1;
11
12/**
13 BG1Controller
14 */
15@interface BG1Controller : NSObject
16
17
18/**
19 * Initialization for BG1Controller Instance.
20 */
21+(BG1Controller *)shareBG1Controller;
22
23/**
24 * Initialization for BG1 (connected BG via sound jack)
25 * When the application detects a headphone device, it sends a notification named kNotificationNameAudioDeviceInsert. When you receive kNotificationNameAudioDeviceInsert notification, you need to adjust the system volume to its maximum. After the device is disconnected, you receive a notification with the name kNotificationNameBG1DidDisConnect.
26 */
27-(void)initBGAudioModule;
28
29/**
30 * Get current BG1 Instance
31 * The methold needs to be called when the BG1 has been triggered.
32 */
33-(BG1 *)getCurrentBG1Instance;
34
35
36/**
37 * Stop audio module for BG1 (connected BG via sound jack)
38 * Call this method When the app need stop BG1 communication.
39 After call this method ,the app should set BG1 Disconnected status.
40 */
41-(void)stopBGAudioModule;
42
43
44
45
46@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1S.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1S.h
new file mode 100644
index 0000000..c6367c2
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1S.h
@@ -0,0 +1,64 @@
1//
2// BG1S.h
3// iHealthSDKStatic
4//
5// Created by jing on 2019/5/8.
6// Copyright © 2019 ihealthSDK. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BGMacroFile.h"
11NS_ASSUME_NONNULL_BEGIN
12
13@interface BG1S : NSObject
14@property (strong, nonatomic) NSString *serialNumber;
15@property (strong, nonatomic) NSString *currentUUID;
16
17/**
18 * Get device battary
19 * @param function A block to return the function and states that the device supports.
20 * @param disposeBGErrorBlock A block to refer ‘error’ in ‘Establish measurement connection’ in BG1S.
21 */
22-(void)commandFunction:(BlockBG1SDeviceFunction)function DisposeBGErrorBlock:(BlockBG1SError)disposeBGErrorBlock;
23
24/**
25 * Button-pressing booting mode
26 * @param testMode Set the measurement mode,must be the same as the testType in send code method, BGMeasureMode_Blood means blood measurement mode, BGMeasureMode_NoBlood means control solution measurement mode.
27 * @param disposeBGStripInBlock This block returns yes means strip slides in.
28 * @param disposeBGBloodBlock This block returns yes means the blood drop has beed sensed from the strip.
29 * @param disposeBGResultBlock This block returns the measurement by the unit of mg/dL, range from 20-600.
30 * @param disposeBGErrorBlock This block returns error codes,please refer to error codes list in BGMacroFile.
31 */
32-(void)commandCreateBG1STestModel:(BGMeasureMode)testMode
33 DisposeBGStripInBlock:(DisposeBG1SStripInBlock)disposeBGStripInBlock
34 DisposeBGBloodBlock:(DisposeBGBloodBlock)disposeBGBloodBlock
35 DisposeBGResultBlock:(DisposeBGResultBlock)disposeBGResultBlock
36 DisposeBGErrorBlock:(BlockBG1SError)disposeBGErrorBlock;
37
38/**
39* Read the information of the strip from the BG meter
40* @param disposeBGCodeDic This block returns the information of the strip, Strips means the number of strips which has been used, Date means expired date.
41* @param disposeBGErrorBlock This block returns error codes,please refer to error codes list in BGMacroFile.
42*/
43-(void)commandReadBGCodeDic:(DisposeBGCodeDic)disposeBGCodeDic
44 DisposeBGErrorBlock:(BlockBG1SError)disposeBGErrorBlock;
45
46/**
47 * Send code
48
49 * @param encodeString The code String gets by scanning the QR code. Only used when codetype is GOD
50
51 * @param disposeBGSendCodeBlock YES means success, NO means fail.
52
53 * @param disposeBGErrorBlock This block returns error codes,please refer to error codes list in BGMacroFile.
54 */
55-(void)commandSendBGCodeWithCodeString:(NSString*)encodeString DisposeBGSendCodeBlock:(DisposeBGSendCodeBlock)disposeBGSendCodeBlock DisposeBGErrorBlock:(BlockBG1SError)disposeBGErrorBlock;
56/**
57 * Disconnect current device
58 */
59-(void)commandDisconnectDevice;
60
61
62@end
63
64NS_ASSUME_NONNULL_END
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1SController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1SController.h
new file mode 100644
index 0000000..1d013b5
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG1SController.h
@@ -0,0 +1,25 @@
1//
2// BG1SController.h
3// iHealthSDKStatic
4//
5// Created by jing on 2019/5/8.
6// Copyright © 2019 ihealthSDK. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11NS_ASSUME_NONNULL_BEGIN
12
13@interface BG1SController : NSObject
14/**
15 * Initialize BG1S controller class
16 */
17+(BG1SController *)shareIHBG1SController;
18
19/**
20 * Get all BG1S instance,use hsInstance to call BG related communication methods.
21 */
22-(NSArray *)getAllCurrentBG1SInstace;
23@end
24
25NS_ASSUME_NONNULL_END
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG3.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG3.h
new file mode 100644
index 0000000..6c44904
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG3.h
@@ -0,0 +1,83 @@
1//
2// BG3.h
3// iHealthBG
4//
5// Created by daiqingquan on 14-2-20.
6// Copyright (c) 2014年 andon. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BGMacroFile.h"
11
12
13/**
14 DisposeAuthenticationBlock
15
16 @param result UserAuthenResult
17 */
18typedef void (^DisposeAuthenticationBlock)(UserAuthenResult result);//the result of userID verification
19
20
21/**
22 BG3
23 */
24@interface BG3 : NSObject{
25
26 uint8_t allCodeBuf[170];
27 uint8_t allCTLCodeBuf[170];
28
29 DisposeBGErrorBlock _disposeBGErrorBlock;
30 DisposeBGStripInBlock _disposeBGStripInBlock;
31 DisposeBGStripOutBlock _disposeBGStripOutBlock;
32 DisposeBGBloodBlock _disposeBGBloodBlock;
33 DisposeBGResultBlock _disposeBGResultBlock;
34 DisposeBGSendCodeBlock _disposeBGSendCodeBlock;
35 DisposeAuthenticationBlock _disposeAuthenticationBlock;
36
37 NSString *thirdUserID;
38
39 NSString *clientSDKUserName;
40 NSString *clientSDKID;
41 NSString *clientSDKSecret;
42
43 BGMeasureMode clientTestMode;
44}
45
46@property (strong, nonatomic) NSString *currentUUID;
47///‘serialNumber’ is for separating different device when multiple device have been connected.
48@property (strong, nonatomic) NSString *serialNumber;
49
50
51/**
52 * Start measure
53 * @param testMode The 'testMode' send measurement mode, BGMeasureMode_Blood means blood measurement mode, BGMeasureMode_NoBlood means control solution measurement mode.
54 * @param encodeString Get the code information by scanning the QR code.
55 * @param userID The only user label, is indicated by form of email address.
56 * @param clientID 'clientID' and 'clientSecret' are the only user label, will be achieved after the register of SDK application. Please contact louie@ihealthlabs.com for the registration.
57 * @param clientSecret 'clientID' and 'clientSecret' are the only user label, will be achieved after the register of SDK application. Please contact louie@ihealthlabs.com for the registration.
58 * @param disposeAuthenticationBlock This block returns results after the verification of userID,clientID,clientSecret.
59 * Results:
60 * a) UserAuthen_RegisterSuccess, new register successes.
61 * b) UserAuthen_LoginSuccess, user logs in successfully.
62 * c) UserAuthen_CombinedSuccess, user has been recognised as iHealth user, the measurement via SDK could be activated, the result data belongs to the user.
63 * d) UserAuthen_TrySuccess, network error, the measurement is only for testing, SDK is not fully functional.
64 * e) UserAuthen_InvalidateUserInfo, the verification of userID/clientID/clientSecret failed.
65 * f) UserAuthen_SDKInvalidateRight, the application has not been authorised.
66 * g) UserAuthen_UserInvalidateRight, the user has not been authorised.
67 * h) UserAuthen_InternetError, network error, verification failed.
68 * -- PS:
69 * 1. the measurement via SDK is functional in the case from a) to d).
70 * 2. the measurement via SDK will be determined in the case from e) to h), please contact iHealth support team, louie@ihealthlabs.com
71 * 3. “iHealth Disclaimer” will pop up and need to be proved by the user when SDK is activated for the first time.
72 * 4. if iHealth SDK has been using without internet, there is only 10-day try out because the SDK can not be certified.
73 * @param disposeBGSendCodeBlock disposeBGSendCodeBlock
74 * @param disposeBGStripInBlock The block returns yes means strip slides in.
75 * @param disposeBGBloodBlock The block returns yes means the blood drop has beed sensed from the strip
76 * @param disposeBGResultBlock block returns the measurement by the unit of mg/dL, range from 20-600.
77 * @param disposeBGErrorBlock A block to return error codes.
78 */
79-(void)commandCreateBG3TestModel:(BGMeasureMode)testMode CodeString:(NSString *)encodeString UserID:(NSString*)userID clientID:(NSString *)clientID clientSecret:(NSString *)clientSecret Authentication:(DisposeAuthenticationBlock)disposeAuthenticationBlock DisposeBGSendCodeBlock:(DisposeBGSendCodeBlock)disposeBGSendCodeBlock DisposeBGStripInBlock:(DisposeBGStripInBlock)disposeBGStripInBlock DisposeBGBloodBlock:(DisposeBGBloodBlock)disposeBGBloodBlock DisposeBGResultBlock:(DisposeBGResultBlock)disposeBGResultBlock DisposeBGErrorBlock:(DisposeBGErrorBlock)disposeBGErrorBlock;
80
81
82
83@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG3Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG3Controller.h
new file mode 100644
index 0000000..7d048e3
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG3Controller.h
@@ -0,0 +1,28 @@
1//
2// BG3Controller.h
3// iHealthBG
4//
5// Created by daiqingquan on 14-2-20.
6// Copyright (c) 2014年 andon. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BG3.h"
11
12/**
13 BG3Controller
14 */
15@interface BG3Controller : NSObject
16
17/**
18 *Initialization for BG3 (wireless BG via Bluetooth)
19 */
20+(BG3Controller *)shareIHBg3Controller;
21
22/**
23 * Get all BG3 Instance
24 * The methold needs to be called when the BG3 has been triggered. When the app detected the glucose meter, the notification with the name of DeviceAuthenSuccess will be sent. After the device disconnected, the notification with the name of DeviceAuthenSuccess will be received.
25 */
26-(BG3 *)getCurrentBG3Instace;
27
28@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5.h
new file mode 100644
index 0000000..79d6a58
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5.h
@@ -0,0 +1,158 @@
1//
2// BG5.h
3// testShareCommunication
4//
5// Created by daiqingquan on 14-1-16.
6// Copyright (c) 2014年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BGMacroFile.h"
11
12
13/**
14 BG5
15 */
16@interface BG5 : BGDevice
17
18/**
19 Set Time
20 @param disposeBGSetTime The block return YES means set success, NO means set fail.
21 @param disposeBGErrorBlock This block returns error codes,please refer to error codes list in BGMacroFile.
22 @note Time is local time
23 */
24-(void)commandBGSetTime:(DisposeBGSetTime)disposeBGSetTime
25 DisposeBGErrorBlock:(DisposeBGErrorBlock)disposeBGErrorBlock;
26
27/**
28 * Set Unit displayed in BG5's screen
29 * @param unitState The block return YES means set success, NO means set fail.
30 * @param disposeBGSetUnitResult YES:success NO:fail
31 * @param disposeBGErrorBlock This block returns error codes,please refer to error codes list in BGMacroFile.
32 */
33-(void)commandBGSetUnit:(BGUnit )unitState
34 DisposeSetUnitResult:(DisposeBGSetUnit)disposeBGSetUnitResult
35 DisposeBGErrorBlock:(DisposeBGErrorBlock)disposeBGErrorBlock;
36
37/**
38 * Query battery remaining energy
39 * @param disposeBatteryBlock A block to return the device battery remaining energy percentage, ‘80’ stands for 80%. 255 means device in charging.
40 * @param disposeErrorBlock This block returns error codes,please refer to error codes list in BGMacroFile.
41 */
42-(void)commandQueryBattery:(DisposeBGBatteryBlock)disposeBatteryBlock
43 DisposeErrorBlock:(DisposeBGErrorBlock)disposeErrorBlock;
44
45/**
46 Tranfer offline history records.
47 For BG5 V3.0, after calling this method, you should call commandDeleteMemorryData: method. Otherwise, the measure date may be wrong.
48
49 @param disposeBGDataCount The number of the records in the meter memory.
50 @param disposeBGHistoryData The offline history records detail, result means result, date means the measurement time.
51 @param disposeBGErrorBlock This block returns error codes,please refer to error codes list in BGMacroFile.
52 */
53-(void)commandTransferMemorryData:(DisposeBGDataCount)disposeBGDataCount
54 DisposeBGHistoryData:(DisposeBGHistoryData)disposeBGHistoryData
55 DisposeBGErrorBlock:(DisposeBGErrorBlock)disposeBGErrorBlock;
56
57/**
58 Delete offline history records
59
60 @param DisposeBGDeleteData deleteOk YES or NO
61 @param disposeBGErrorBlock This block returns error codes,please refer to error codes list in BGMacroFile.
62 */
63-(void)commandDeleteMemorryData:(DisposeBGDeleteData)DisposeBGDeleteData
64 DisposeBGErrorBlock:(DisposeBGErrorBlock)disposeBGErrorBlock;
65
66/**
67 * Send code with type (Note: After you got the CTL test results, you need to send the blood Code again.)
68 * @param testType Set the measure test type,@1 is Blood Test,@2 is CTL Test.
69 * @param codeType Set the code type,@1 is GOD,@2 is GDH.
70 * @param encodeString The code String gets by scanning the QR code. Only used when codetype is GOD
71 * @param date The strip expired date. support Jan 1,2000 to Dec 31, 2099. If other value, return BG5Error_InputParametersError.
72 * @param num the number of remaining strips,ranging from 1-255.
73 * @param disposeBGSendCodeBlock YES means success, NO means fail.
74 * @param disposeBGStartModel The boot mode of the BG meter, BGOpenMode_Strip means booting the meter by sliding the strip, BGOpenMode_Hand means booting the meter by pressing the on/off button. commandCreateBGtestStripInBlock should be called after recieving BGOpenMode_Strip, commandCreateBGtestModel should be called after recieving BGOpenMode_Hand.
75 * @param disposeBGErrorBlock This block returns error codes,please refer to error codes list in BGMacroFile.
76 */
77-(void)commandSendBGCodeWithMeasureType:(BGMeasureMode)testType
78 CodeType:(BGCodeMode)codeType
79 CodeString:(NSString*)encodeString
80 validDate:(NSDate*)date
81 remainNum:(NSNumber*)num
82 DisposeBGSendCodeBlock:(DisposeBGSendCodeBlock)disposeBGSendCodeBlock
83 DisposeBGStartModel:(DisposeBGStartModel)disposeBGStartModel
84 DisposeBGErrorBlock:(DisposeBGErrorBlock)disposeBGErrorBlock;
85
86/**
87 * Read the information of the strip from the BG meter
88 * @param disposeBGCodeDic This block returns the information of the strip, Strips means the number of strips which has been used, Date means expired date.
89 * @param disposeBGErrorBlock This block returns error codes,please refer to error codes list in BGMacroFile.
90 */
91-(void)commandReadBGCodeDic:(DisposeBGCodeDic)disposeBGCodeDic
92 DisposeBGErrorBlock:(DisposeBGErrorBlock)disposeBGErrorBlock;
93
94/**
95 *Send BottleID to the BG meter
96 *@param bottleID bottleID, 4 bytes,0x00000000-0xFFFFFFFF
97 *@param disposeBGSendBottleIDBlock The block return YES means set success, NO means set fail.
98 *@param disposeBGErrorBlock This block returns error codes,please refer to error codes list in BGMacroFile.
99 */
100-(void)commandSendBottleID:(long long)bottleID
101DisposeBGSendBottleIDBlock:(DisposeBGSendBottleIDBlock)disposeBGSendBottleIDBlock
102 DisposeBGErrorBlock:(DisposeBGErrorBlock)disposeBGErrorBlock;
103
104/**
105 * Get the bottleID stored in the BG meter
106 * @param disposeBGBottleID This block returns the ID which is stored in the BG meter, to verify if the strip that has been used is from the same bottle of the registered one. if not match, the app will notify the user need scan the new bottle; If match, the app can get the number of used strips and expire date.
107 * @param disposeBGErrorBlock This block returns error codes,please refer to error codes list in BGMacroFile.
108 */
109
110-(void)commandBGGetBottleID:(DisposeBGBottleID)disposeBGBottleID
111 DisposeBGErrorBlock:(DisposeBGErrorBlock)disposeBGErrorBlock;
112
113/**
114 Strip-Sliding booting mode
115
116 @param disposeBGStripInBlock This block returns yes means strip slides in.
117 @param disposeBGBloodBlock This block returns yes means the blood drop has beed sensed from the strip.
118 @param disposeBGResultBlock This block returns the measurement by the unit of mg/dL, range from 20-600.
119 @param disposeBGErrorBlock This block returns error codes,please refer to error codes list in BGMacroFile.
120
121 */
122-(void)commandCreateBGtestStripInBlock:(DisposeBGStripInBlock)disposeBGStripInBlock
123 DisposeBGBloodBlock:(DisposeBGBloodBlock)disposeBGBloodBlock
124 DisposeBGResultBlock:(DisposeBGResultBlock)disposeBGResultBlock
125 DisposeBGErrorBlock:(DisposeBGErrorBlock)disposeBGErrorBlock;
126
127
128/**
129 * Button-pressing booting mode
130 * @param testMode Set the measurement mode,must be the same as the testType in send code method, BGMeasureMode_Blood means blood measurement mode, BGMeasureMode_NoBlood means control solution measurement mode.
131 * @param disposeBGStripInBlock This block returns yes means strip slides in.
132 * @param disposeBGBloodBlock This block returns yes means the blood drop has beed sensed from the strip.
133 * @param disposeBGResultBlock This block returns the measurement by the unit of mg/dL, range from 20-600.
134 * @param disposeBGErrorBlock This block returns error codes,please refer to error codes list in BGMacroFile.
135 */
136-(void)commandCreateBGtestModel:(BGMeasureMode)testMode
137 DisposeBGStripInBlock:(DisposeBGStripInBlock)disposeBGStripInBlock
138 DisposeBGBloodBlock:(DisposeBGBloodBlock)disposeBGBloodBlock
139 DisposeBGResultBlock:(DisposeBGResultBlock)disposeBGResultBlock
140 DisposeBGErrorBlock:(DisposeBGErrorBlock)disposeBGErrorBlock;
141
142/**
143 * Keep the connection to enable enough time for operation such as scan code, insert strip and drop blood.
144 * @param disposeBG5KeepConnectBlock A block returns the result of the keeping connection order,'YES' means setting success,'NO' means fail.
145 * @param disposeErrorBlock This block returns error codes,please refer to error codes list in BGMacroFile.
146 */
147-(void)commandKeepConnect:(DisposeBG5KeepConnectBlock)disposeBG5KeepConnectBlock
148 DisposeErrorBlock:(DisposeBGErrorBlock)disposeErrorBlock;
149
150/**
151 Analyze code include bottleID,DueDate and the number of strips. Only Available for GOD Code
152
153 @param encodeString The code String gets by scanning the QR code.
154 @return return a dictionary contains keys such as @"BottleID",@"StripNum",@"DueDate"; return nil if input parameter is GDH code or code is invalid.
155 */
156-(NSDictionary *)codeStripStrAnalysis:(NSString *)encodeString;
157
158@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5Controller.h
new file mode 100644
index 0000000..32f8935
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5Controller.h
@@ -0,0 +1,28 @@
1//
2// BG5Controller.h
3// testShareCommunication
4//
5// Created by daiqingquan on 14-1-16.
6// Copyright (c) 2014年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BGMacroFile.h"
11
12/**
13 BG5Controller
14 */
15@interface BG5Controller : BGController
16
17/**
18 *Initialization for BG5 (wireless BG via Bluetooth)
19 */
20+(BG5Controller *)shareIHBg5Controller;
21
22/**
23 * Get all BG5 Instance
24 * The methold needs to be called when the BG5 has been triggered. When the app detected the glucose meter, the notification with the name of BG5ConnectNoti will be sent. After the device disconnected, the notification with the name of BG5DisConnectNoti will be received.
25 */
26-(NSArray *)getAllCurrentBG5Instace;
27
28@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5S.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5S.h
new file mode 100644
index 0000000..08cca13
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5S.h
@@ -0,0 +1,294 @@
1//
2// BG5S.h
3// iHealthSDKStatic
4//
5// Created by Lei Bao on 2017/6/30.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BGMacroFile.h"
11
12// --------------- DELEGATE ---------------
13@class BG5S;
14
15/**
16 BG5SDelegate
17 */
18@protocol BG5SDelegate <NSObject>
19@required
20
21/**
22 Device sends an error
23
24 @param device active device
25 @param error error number
26 @param errorDescription error message
27 */
28- (void)device:(BG5S *)device occurError:(BG5SError)error errorDescription:(NSString *)errorDescription;
29
30/**
31 Device sends strip state message
32 @note Only after startMeasure: method is called, does the device send strip state message.
33 If you insert strip before calling startMeasure: method, the device doesn't send strip state(Insert or Pull off) until startMeasure: method is called.
34 @param device active device
35 @param state BG5SStripState enum
36 */
37- (void)device:(BG5S *)device stripStateDidUpdate:(BG5SStripState)state;
38
39/**
40 Device sends drop blood or ctl message
41 @note After reciving this message, you should not call any method until you recive result. If called, the method may be timeout.
42 @param device active device
43 */
44- (void)deviceDropBlood:(BG5S *)device;
45
46/**
47 Device sends result
48
49 @param device active device
50 @param dataID data identifier (Only for SDK users)
51 @param result blood glucose value with mg/dL unit
52 */
53- (void)device:(BG5S *)device dataID:(NSString *)dataID measureReult:(NSInteger)result;
54
55/**
56 Device sends charging state
57 @note Only state changes, is the message sent.
58 @param device active device
59 @param state BG5SChargeState object
60 */
61- (void)device:(BG5S *)device chargeStateDidUpdate:(BG5SChargeState)state;
62@end
63
64/**
65 state information of BG5S when call "queryStateInfoWithSuccess:"
66 */
67@interface BG5SStateInfo : NSObject
68
69/**
70 0-100 means battery percent, 255 means charging
71 */
72@property (assign, nonatomic, readonly) NSInteger batteryValue;
73
74/**
75 device date (UTC)
76 */
77@property (copy, nonatomic, readonly) NSDate *deviceDate;
78
79/**
80 device timezon -12.00 to 14.00. Without setting, default timezone is 0.00
81 */
82@property (assign, nonatomic, readonly) float deviceTimeZone;
83
84/**
85 quantity of strip used in measurement.range:[0,65535]. If value is 65535, there may be something wrong with BG5S. Because 65535 is very large number for true user.
86 */
87@property (assign, nonatomic, readonly) NSInteger stripUsedValue;
88
89/**
90 quantity of record measuring without connecting to APP.range:[0,500]. If value is 65535, there may be something wrong with BG5S.
91 */
92@property (assign, nonatomic, readonly) NSInteger offlineDataQuantity;
93
94/**
95 blood code version (0-255)
96 */
97@property (assign, nonatomic, readonly) NSInteger bloodCodeVersion;
98
99/**
100 ctl code version (0-255)
101 */
102@property (assign, nonatomic, readonly) NSInteger ctlCodeVersion;
103
104/**
105 measure unit (BGUnit_Unknown means that BG5S has never been set unit from App,BGUnit_mmolPL stands for mmol/L,BGUnit_mgPmL stands for mg/dL)
106 */
107@property (assign, nonatomic, readonly) BGUnit unit;
108
109@end
110
111/**
112 Offline data model of BG5S
113 */
114@interface BG5SRecordModel : NSObject
115
116/**
117 Data ID (Only for SDK users)
118 */
119@property (copy, nonatomic, readonly) NSString *dataID;
120
121/**
122 Measure Date (UTC)
123 */
124@property (copy, nonatomic, readonly) NSDate *measureDate;
125
126/**
127 Time zone
128 */
129@property (assign, nonatomic, readonly) float timeZone;
130
131/**
132 BG Value with mg/dL unit
133 */
134@property (assign, nonatomic, readonly) NSInteger value;
135
136/**
137 Correct Flag, YES:can be corrected, NO:cannot be corrected
138 */
139@property (assign, nonatomic, readonly) BOOL canCorrect;
140
141@end
142
143/**
144 Modified offline data model of BG5S
145 */
146@interface BG5SRecordModifiedModel : NSObject
147
148/**
149 Data ID (Only for SDK users)
150 */
151@property (copy, nonatomic) NSString *dataID;
152
153/**
154 Measure Date (UTC)
155 */
156@property (copy, nonatomic) NSDate *measureDate;
157
158/**
159 Time zone
160 */
161@property (assign, nonatomic,) float timeZone;
162
163/**
164 BG Value with mg/dL unit
165 */
166@property (assign, nonatomic) NSInteger value;
167
168@end
169
170/**
171 BG5S
172 */
173@interface BG5S : BGDevice
174
175@property (weak, nonatomic) id<BG5SDelegate> delegate;
176
177/**
178 Query BG5S state information including battery value,device date, device timezone, strip used, quantity of offline data, blood code version, CTL code version, unit.
179
180 @param stateInfoBlock BG5SStateInfo object
181 @param errorBlock the block means fail. You can get error from this block
182 @note If analysis occurs error, BG5SStateInfo object maybe nil or some of its property are nil.
183 */
184- (void)queryStateInfoWithSuccess:(BG5SStateInfoBlock)stateInfoBlock
185 errorBlock:(BG5SSDKErrorBlock)errorBlock;
186
187/**
188 Set time
189
190 @param date the date you want to set should be an UTC time. valid range:Jan. 1,2000 - Dec. 31,2099. If date is nil, use [NSdate date] and system time zone
191 @param timezone the timezone you want to set should be from -12.00 to 14.00; step length = 0.25
192 @param successBlock the block means success
193 @param errorBlock the block means fail. You can get error from this block
194 @note If date is out of reange, BG5SError_InputParametersError will be returned by block.
195 If date and timezone are invalid , use input parameters; otherwise use [NSdate date] and system time zone;
196 */
197- (void)setTimeWithDate:(NSDate *)date
198 timezone:(float)timezone
199 successBlock:(BG5SSuccessBlock)successBlock
200 errorBlock:(BG5SSDKErrorBlock)errorBlock;
201
202/**
203 Set unit
204
205 @param unit the unit you want to set (BGUnit_mmolPL stands for mmol/L,BGUnit_mgPmL stands for mg/dL)
206 @param successBlock the block means success
207 @param errorBlock the block means fail. You can get error from this block
208 */
209- (void)setUnit:(BGUnit)unit
210 successBlock:(BG5SSuccessBlock)successBlock
211 errorBlock:(BG5SSDKErrorBlock)errorBlock;
212
213/**
214 Delete strip used info (the quantity of strip used is set to 0)
215
216 @param successBlock the block means success
217 @param errorBlock the block means fail. You can get error from this block
218 */
219- (void)deleteStripUsedInfoWithSuccessBlock:(BG5SSuccessBlock)successBlock
220 errorBlock:(BG5SSDKErrorBlock)errorBlock;
221
222/**
223 Query record data stored in BG5S
224
225 @param successBlock the block means success; if has record, return non-empty array (BG5SRecordModel object); if no record, return empty array
226 @param errorBlock the block means fail. You can get error from this block
227 */
228- (void)queryRecordWithSuccessBlock:(BG5SRecordBlock)successBlock
229 errorBlock:(BG5SSDKErrorBlock)errorBlock;
230
231
232/**
233 Delete record data stored in BG5S
234
235 @param successBlock the block means success
236 @param errorBlock the block means fail. You can get error from this block
237 */
238- (void)deleteRecordWithSuccessBlock:(BG5SSuccessBlock)successBlock
239 errorBlock:(BG5SSDKErrorBlock)errorBlock;
240
241/**
242 Start online measurement with specific measure mode.
243
244 @note If you don't call this method, BG5S use blood mode by default.
245
246 If CTL mode is sent, BG5S use CTL mode and BG5S can't be set to use blood mode until next connection.
247 @param measureMode Blood or CTL
248 @param successBlock the block means success
249 @param errorBlock the block means fail. You can get error from this block
250 */
251- (void)startMeasure:(BGMeasureMode)measureMode
252 withSuccessBlock:(BG5SSuccessBlock)successBlock
253 errorBlock:(BG5SSDKErrorBlock)errorBlock;
254
255/**
256 Disconnect device
257 */
258- (void)disconnectDevice;
259
260/**
261 Correct Measure Date if canCorrect is YES in BG5SRecordModel
262
263 @param array BG5SRecordModel objects
264 @param deviceDate This date should be read before set time method called.
265 @return BG5SRecordModifiedModel objects; return empty array means input parameters is wrong.
266 */
267- (NSArray *)processData:(NSArray<BG5SRecordModel*> *)array deviceDate:(NSDate *)deviceDate;
268
269
270/**
271
272 Is offline measurement allowed
273
274 @param isOffline Is offline measurement allowed 0:allowed 1:Offline measurement is not allowed
275 @param successBlock the block means success
276 @param errorBlock the block means fail. You can get error from this block
277 */
278- (void)setIsOfflineMeasurementAllowed:(BOOL)isOffline
279successBlock:(BG5SSuccessBlock)successBlock
280 errorBlock:(BG5SSDKErrorBlock)errorBlock;
281
282
283- (void)setCodeWithMeasureMode:(BGMeasureMode)mode
284 resultBlock:(BG5SSetCodeResultBlock)resultBlock
285 errorBlock:(BG5SSDKErrorBlock)errorBlock;
286
287- (void)readDeviceInfoWithSuccessBlock:(BG5SDeviceInfoBlock)deviceInfoBlock
288 errorBlock:(BG5SSDKErrorBlock)errorBlock;
289
290- (void)commandCloseDeviceBLEWithSuccessBlock:(BG5SSuccessBlock)successBlock errorBlock:(BG5SSDKErrorBlock)errorBlock;
291
292- (void)commandSetDeviceDisplay:(BOOL)isDisplay successBlock:(BG5SSuccessBlock)successBlock errorBlock:(BG5SSDKErrorBlock)errorBlock;
293
294@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5SController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5SController.h
new file mode 100644
index 0000000..7e83e95
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BG5SController.h
@@ -0,0 +1,29 @@
1//
2// BG5SController.h
3// iHealthSDKStatic
4//
5// Created by Lei Bao on 2017/6/30.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BGMacroFile.h"
11
12/**
13 BG5SController
14 */
15@interface BG5SController : BGController
16/**
17 Initialization method
18
19 @return BG5SController singleton
20 */
21+(BG5SController *)sharedController;
22/**
23 Get all BG5S Instance
24 @note The method should be called when the BG5S has been connected.
25 @return BG5S object array
26 */
27-(NSArray *)getAllCurrentInstace;
28
29@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGController.h
new file mode 100644
index 0000000..9675047
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGController.h
@@ -0,0 +1,32 @@
1//
2// BGController.h
3// iHealthDemoCode
4//
5// Created by Realank on 2017/1/4.
6// Copyright © 2017年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 Base class of BG controller
13 */
14@interface BGController : NSObject{
15 //区分设备
16 NSString* deviceName;
17 NSNumber* bluetoothType;
18 //发送通知
19 NSString* deviceConnectNotiName;
20 NSString* deviceDisconnectNotiName;
21 //创建实例
22 Class DeviceClass;
23}
24
25-(instancetype) initUniqueInstance;
26
27/**
28 * Get all BG3 instance,Access control class instance after receiving kNotificationNameBG3ConnectSuccess, then use instance to call BG3 related communication methods.
29 */
30-(NSArray *)allConnectedInstance;
31
32@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGDevice.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGDevice.h
new file mode 100644
index 0000000..125f762
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGDevice.h
@@ -0,0 +1,42 @@
1//
2// BGDevice.h
3// iHealthDemoCode
4//
5// Created by Realank on 2017/1/4.
6// Copyright © 2017年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 Base class of BG
13 */
14@interface BGDevice : NSObject
15
16/**
17 UUID
18 */
19@property (copy, nonatomic) NSString *currentUUID;
20/**
21 serial number or mac
22 */
23@property (copy, nonatomic) NSString *serialNumber;
24/**
25 firmware version
26 */
27@property (copy, nonatomic) NSString *firmwareVersion;
28/**
29 hardware version
30 */
31@property (copy, nonatomic) NSString *hardwareVersion;
32/**
33 model number
34 */
35@property (copy, nonatomic) NSString *modelNumber;
36
37/**
38 device type0:old device 1:new device
39 */
40@property (copy, nonatomic) NSNumber *deviceType;
41
42@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGHeader.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGHeader.h
new file mode 100644
index 0000000..20eac92
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGHeader.h
@@ -0,0 +1,23 @@
1//
2// BGHeader.h
3// BGDemoCode
4//
5// Created by zhiwei jing on 14-6-30.
6// Copyright (c) 2014年 zhiwei jing. All rights reserved.
7//
8
9#ifndef BGDemoCode_BGHeader_h
10#define BGDemoCode_BGHeader_h
11
12#import "BG1.h"
13#import "BG1Controller.h"
14#import "BGMacroFile.h"
15#import "BG3.h"
16#import "BG3Controller.h"
17#import "BG5.h"
18#import "BG5Controller.h"
19#import "BG5S.h"
20#import "BG5SController.h"
21#import "BG1S.h"
22#import "BG1SController.h"
23#endif
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGMacroFile.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGMacroFile.h
new file mode 100644
index 0000000..7e03f2c
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BGMacroFile.h
@@ -0,0 +1,507 @@
1//
2// BGMacroFile.h
3// BGDemoCode
4//
5// Created by zhiwei jing on 14-6-29.
6// Copyright (c) 2014年 zhiwei jing. All rights reserved.
7//
8
9#import "HealthUser.h"
10#import "BGDevice.h"
11#import "BGController.h"
12@class BG5SStateInfo;
13@class BG5SRecordModel;
14
15#ifndef BGDemoCode_BGMacroFile_h
16#define BGDemoCode_BGMacroFile_h
17
18/**
19 BG5 open mode
20 */
21typedef NS_ENUM(NSUInteger, BGOpenMode) {
22 /// BGOpenMode_Strip means booting the meter by insert the strip
23 BGOpenMode_Strip = 1,
24 /// BGOpenMode_Hand means booting the meter by pressing the on/off button.
25 BGOpenMode_Hand = 2,
26};
27
28/**
29 BG5\BG5S measure mode
30 */
31typedef NS_ENUM(NSUInteger, BGMeasureMode) {
32 /// BGMeasureMode_Blood means blood measurement mode
33 BGMeasureMode_Blood = 1,
34 /// BGMeasureMode_NoBlood means control solution measurement mode.
35 BGMeasureMode_NoBlood = 2,
36
37};
38
39/**
40 BG code mode
41 */
42typedef NS_ENUM(NSUInteger, BGCodeMode) {
43 /// BGCodeMode_GOD means GOD blood test strip.
44 BGCodeMode_GOD = 1,
45 /// BGCodeMode_GDH means GDH Blood test strip.
46 BGCodeMode_GDH = 2,
47};
48
49/**
50 BG unit
51 */
52typedef NS_ENUM(NSUInteger, BGUnit) {
53 /// Unknown
54 BGUnit_Unknown = 0,
55 /// mmol/L
56 BGUnit_mmolPL = 1,
57 /// mg/dL
58 BGUnit_mgPmL = 2,
59};
60
61/**
62 BG1 error code
63 */
64typedef NS_ENUM(NSInteger,BG1Error){
65 /// Battery is low.
66 BG1Error_LowBattery = 0,
67 /// Glucose test result is out of the measurement range.
68 BG1Error_ResultOutOfMeasurementRage = 1,
69 /// 2.5V reference voltage error, not normal measurement, please repeat the test.
70 BG1Error_UnvalidReferenceVoltage = 2,
71 /// Strip is used or unknown moisture detected, discard the test strip and repeat the test with a new strip.
72 BG1Error_StripUsed = 3,
73 /// CODE value check error. This error need let user scan code and call the send code function again,no alert need to show.
74 BG1Error_CodeError = 4,
75 /// The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.
76 BG1Error_RoomTemperatureOutOfRange1 = 5,
77 /// The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.
78 BG1Error_RoomTemperatureOutOfRange2 = 6,
79 /// Authentication failed more than 10 times.
80 BG1Error_AuthenticationFailed = 7,
81 /// Packet loss in the process of sending CODE.
82 BG1Error_CodeSendLost = 8,
83 /// Tooling inspection process is not completed.
84 BG1Error_ToolingTestFailed = 9,
85 /// Encryption burn write bit is empty.
86 BG1Error_EncryptionFailed = 10,
87 /// Compulsory Authentication is not passed.
88 BG1Error_CompulsoryAuthenticationFaild = 11,
89 /// Glucose test result is low.
90 BG1Error_ResultLow = 12,
91 /// Glucose test result is high.
92 BG1Error_ResultHigh = 13,
93 /// BG unknown.
94 BG1Error_Unknown = 300,
95 /// BG time out.
96 BG1Error_TimeOut = 301,
97 /// BG disConnented.
98 BG1Error_DisConnented = 303,
99 /// BG sleeping mode.
100 BG1Error_SleepingMode =330,
101 /// Hand shake failed.
102 BG1Error_HandShakeFailed = 331,
103 /// Parameter input error.
104 BG1Error_ParameterError = 400,
105};
106
107
108//UI
109#define kNotificationNameNeedAudioPermission @"LetkNotificationNameNeedAudioPermission"
110#define kNotificationNameAudioDeviceInsert @"kNotificationNameAudioDeviceInsert"
111#define kNotificationNameBG1DidDisConnect @"kNotificationNameBG1DidDisConnect"
112
113
114/**
115 Discover BG1
116 */
117typedef void (^DisposeBG1DiscoverBlock)(void);
118
119/**
120 BG1 IDPS
121
122 @param idpsDic IDPS dictionary
123 */
124typedef void (^DisposeBG1IDPSBlock)(NSDictionary* idpsDic);
125
126/**
127 Connect BG1 successfully
128 */
129typedef void (^DisposeBG1ConnectBlock)(void);
130
131/**
132 BG1 error block
133
134 @param errorID BG1Error enum
135 */
136typedef void (^DisposeBG1ErrorBlock)(BG1Error errorID);
137
138/**
139 BG1 send code result
140 */
141typedef void (^DisposeBG1SendCodeResultBlock)(void);
142
143/**
144 Strip is insered
145 */
146typedef void (^DisposeBGStripInBlock)(void);
147//
148/**
149 Strip is pulled off
150 */
151typedef void (^DisposeBGStripOutBlock)(void);
152
153/**
154 Blood is droped
155 */
156typedef void (^DisposeBGBloodBlock)(void);
157
158/**
159 Measurement result block
160
161 @param result dictionary
162 */
163typedef void (^DisposeBGResultBlock)(NSDictionary* result);
164
165/**
166 BG send code result block
167
168 @param sendOk YES: success NO:fail
169 */
170typedef void (^DisposeBGSendCodeBlock)(BOOL sendOk);
171
172/**
173 BG error block
174
175 @param errorID BG error code
176 */
177typedef void (^DisposeBGErrorBlock)(NSNumber* errorID);
178
179/**
180 BG5 keep connection result
181
182 @param sendOk YES:success NO:fail
183 */
184typedef void (^DisposeBG5KeepConnectBlock)(BOOL sendOk);
185
186/**
187 BG5 set time result
188
189 @param setResult YES:success NO:fail
190 */
191typedef void (^DisposeBGSetTime)(BOOL setResult);
192
193/**
194 BG5 set unit result
195
196 @param setResult YES:success NO:fail
197 */
198typedef void (^DisposeBGSetUnit)(BOOL setResult);
199
200/**
201 BG5 get bottleID result
202
203 @param bottleID bottleID
204 */
205typedef void (^DisposeBGBottleID)(NSNumber *bottleID);
206
207/**
208 BG5 offline measurement data quantity block
209
210 @param dataCount quantity
211 */
212typedef void (^DisposeBGDataCount)(NSNumber* dataCount);
213
214/**
215 BG5 offline measurement data block
216
217 @param historyDataDic data
218 */
219typedef void (^DisposeBGHistoryData)(NSDictionary *historyDataDic);
220
221/**
222 BG5 delete offline measurement data result block
223
224 @param deleteOk YES:success NO:fail
225 */
226typedef void (^DisposeBGDeleteData)(BOOL deleteOk);
227
228/**
229 BG5 send bottle ID result block
230
231 @param sendOk YES:success NO:fail
232 */
233typedef void(^DisposeBGSendBottleIDBlock)(BOOL sendOk);
234
235/**
236 BG5 get code information
237
238 @param codeDic dictionary
239 */
240typedef void (^DisposeBGCodeDic)(NSDictionary *codeDic);
241
242/**
243 BG5 send code result block
244
245 @param sendOk YES:success NO:fail
246 */
247typedef void (^DisposeBGSendCodeBlock)(BOOL sendOk);
248
249/**
250 BG5 open mode block
251
252 @param mode BGOpenMode enum
253 */
254typedef void (^DisposeBGStartModel)(BGOpenMode mode);
255
256/**
257 BG device battery block
258
259 @param energy normal range:0-100;255 means in charging
260 */
261typedef void (^DisposeBGBatteryBlock)(NSNumber* energy);
262
263
264#define kNotificationNameBG3ConnectSuccess @"kNotificationNameBG3ConnectSuccess"
265#define kNotificationNameBG3DidDisConnect @"kNotificationNameBG3DidDisConnect"
266
267
268// ------ BG5 Baolei ------
269#define BG5ConnectNoti @"BG5ConnectNoti"
270#define BG5DisConnectNoti @"BG5DisConnectNoti"
271
272/**
273 BG5 error code
274 */
275typedef NS_ENUM(NSInteger, BG5Error) {
276 /// BG5Error_Unknown: Unknown error
277 BG5Error_Unknown = -1,
278 /// BG5Error_LowBattery: Battery is low.
279 BG5Error_LowBattery = 0,
280 /// BG5Error_ResultOutOfMeasurementRage: Glucose test result is out of the measurement range.
281 BG5Error_ResultOutOfMeasurementRage = 1,
282 /// BG5Error_UnvalidReferenceVoltage: Reference voltage error, not normal measurement, please repeat the
283 BG5Error_UnvalidReferenceVoltage = 2,
284 /// BG5Error_StripUsed: Strip is used or unknown moisture detected, discard the test strip and repeat the
285 BG5Error_StripUsed = 3,
286 /// BG5Error_ErrorOccurInEEPROM: Reading transmission error. Repeat the test with a new test strip. If the
287 BG5Error_ErrorOccurInEEPROM = 4,
288 /// BG5Error_RoomTemperatureOutOfRange1: The environmental temperature is beyond normal range, place the
289 BG5Error_RoomTemperatureOutOfRange1 = 5,
290 /// BG5Error_RoomTemperatureOutOfRange2: The environmental temperature is beyond normal range, place the
291 BG5Error_RoomTemperatureOutOfRange2 = 6,
292 /// BG5Error_TestStripCodingError1: Test strip coding error.
293 BG5Error_TestStripCodingError1 = 7,
294 /// BG5Error_TestStripCodingError2: Test strip coding error.
295 BG5Error_TestStripCodingError2 = 8,
296 /// BG5Error_PullOffStripWhenMeasuring: Strip removed in the middle of reading, repeat the test with a new
297 BG5Error_PullOffStripWhenMeasuring = 9,
298 /// BG5Error_ShouldPullOffStripAfterReadingResult: Pull off strips after measuring
299 BG5Error_ShouldPullOffStripAfterReadingResult = 10,
300 /// BG5Error_CannotWriteSNOrKey: SN or KEY write error
301 BG5Error_CannotWriteSNOrKey = 11,
302 /// BG5Error_NeedSetTime: Please set time.
303 BG5Error_NeedSetTime = 12,
304 /// BG5Error_StripNumberIsZero: 0 test strips remaining.
305 BG5Error_StripNumberIsZero = 13,
306 /// BG5Error_StripExpired: Test strip expired.
307 BG5Error_StripExpired = 14,
308 /// BG5Error_CannotMeasureWhenCharging: Unplug the charging cable before testing.
309 BG5Error_CannotMeasureWhenCharging = 15,
310 /// BG5Error_InputParametersError: Parameter input error.
311 BG5Error_InputParametersError = 400,
312 /// BG5Error_FunctionCallOrderError: Fucntion call order error
313 BG5Error_FunctionCallOrderError = 402,
314 /// BG5Error_MeasureModeNotMatch: Measure mode is not match.
315 BG5Error_MeasureModeNotMatch = 403,
316 /// BG5Error_CommandTimeout: Command timeout
317 BG5Error_CommandTimeout = 500,
318 /// BG5Error_CommandNotSupport: Command is not supported for current device.
319 BG5Error_CommandNotSupport = 501,
320};
321
322#define kNotificationNameBG5SDidDiscover @"BG5SDiscover"
323#define kNotificationNameBG5SConnectFail @"BG5SConnectFailed"
324#define kNotificationNameBG5SConnectSuccess @"BG5SConnectNoti"
325#define kNotificationNameBG5SDidDisConnect @"BG5SDisConnectNoti"
326
327/**
328 BG5SCommandAction Enum
329 */
330typedef NS_ENUM(NSInteger, BG5SCommandAction) {
331 /// placeholder
332 BG5SCommandAction_Unknown = -1,
333 /// Query device state information
334 BG5SCommandAction_QueryBG5SStateInfo,
335 /// Set device time
336 BG5SCommandAction_SetBG5STime,
337 /// Set device unit
338 BG5SCommandAction_SetBG5SUnit,
339 /// Send code
340 BG5SCommandAction_SendBG5SCode,
341 /// Delete Strip used information
342 BG5SCommandAction_DeleteBG5SStripUsedInfo,
343 /// Query device offline measurement data
344 BG5SCommandAction_QueryBG5SRecord,
345 /// Delete device offline measurement data
346 BG5SCommandAction_DeleteBG5SRecord,
347 /// Set measure mode
348 BG5SCommandAction_StartBG5SMeasure,
349 /// Device send error code
350 BG5SCommandAction_ErrorCode,
351 /// Strip is inserted
352 BG5SCommandAction_StripInsert,
353 /// Strip is pulled off
354 BG5SCommandAction_StripPullOff,
355 /// Blood is dropped
356 BG5SCommandAction_DropBlood,
357 /// Device send result
358 BG5SCommandAction_Result,
359 /// Device enters charging state
360 BG5SCommandAction_EnterChagre,
361 /// Device exits charging state
362 BG5SCommandAction_ExitCharge,
363
364};
365
366/**
367 BG5S error code
368 */
369typedef NS_ENUM(NSInteger, BG5SError) {
370 /// Unknown error
371 BG5SError_Unknown = -1,
372 /// Only showed in BG5S's screen and need charging
373 BG5SError_LowBattery = 0,
374 /// Strip removed in the middle of reading, repeat the test with a new strip.
375 BG5SError_PullOffStripWhenMeasuring = 1,
376 /// Reference voltage error, not normal measurement, please repeat the test.
377 BG5SError_UnvalidReferenceVoltage = 2,
378 /// Strip is used or unknown moisture detected, discard the test strip and repeat the test with a new strip.
379 BG5SError_StripUsed = 3,
380 /// Reading transmission error. Repeat the test with a new test strip. If the problem persists, contact iHealth customer service for assistance.
381 BG5SError_ErrorOccurInEEPROM = 4,
382 /// The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.
383 BG5SError_LowTemperature = 5,
384 /// The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.
385 BG5SError_HighTemperature = 6,
386 /// Only showed in BG5S's screen.
387 BG5SError_BluetoothError = 7,
388 /// Glucose test result is low.
389 BG5SError_ResultLow = 8,
390 /// Glucose test result is high.
391 BG5SError_ResultHigh = 9,
392 /// Reset and if the problem persists, contact iHealth customer service for assistance.
393 BG5SError_FactoryError = 10,
394 /// Parameter input error.
395 BG5SError_InputParametersError = 400,
396 /// Quantity not match
397 BG5SError_RecordTotalNumberNotMatchTransferTotalNumber = 401,
398 /// Single packet is not full.
399 BG5SError_RecordPacketNotMatch = 402,
400 /// Packet index not match.
401 BG5SError_RecordPackerIndexNotMatch = 403,
402 /// Command timeout
403 BG5SError_CommandTimeout = 500,
404 /// Command is not supported for current device.
405 BG5SError_CommandNotSupport = 501,
406 BG5SError_Disconnect = 502,
407};
408
409
410/**
411 BG5S strip state
412 */
413typedef NS_ENUM(NSInteger, BG5SStripState) {
414 /// Unknown state
415 BG5SStripState_Unknown = -1,
416 /// Insert
417 BG5SStripState_Insert,
418 /// Pull off
419 BG5SStripState_PullOff,
420};
421/**
422 BG5S charging state
423 */
424typedef NS_ENUM(NSInteger, BG5SChargeState) {
425 /// Unknown state
426 BG5SChargeState_Unknown = -1,
427 /// In charging
428 BG5SChargeState_Charging,
429 /// Not in charging
430 BG5SChargeState_ExitCharge,
431};
432
433/**
434 BG5SStateInfoBlock
435
436 @param stateInfo BG5SStateInfo object
437 */
438typedef void(^BG5SStateInfoBlock)(BG5SStateInfo *stateInfo);
439
440/**
441 BG5SRecordBlock
442
443 @param array offline measurement data array
444 */
445typedef void(^BG5SRecordBlock)(NSArray *array);
446/**
447 Block without return parameters
448 */
449typedef void(^BG5SSuccessBlock)(void);
450
451/**
452 Block show the result of setting code
453
454 @param success YES:success NO:fail
455 */
456typedef void(^BG5SSetCodeResultBlock)(BOOL success);
457
458
459typedef void(^BG5SDeviceInfoBlock)(NSDictionary* deviceInfoDic);
460
461
462//typedef void(^BG5SRecordBlock)(NSArray *array);
463
464/**
465 Error block with error type
466
467 @param error error type
468 */
469typedef void(^BG5SSDKErrorBlock)(BG5SError error,NSString *detailInfo);
470
471
472/*
473 BG1S code
474 */
475
476#define BG1SDiscover @"BG1SDiscover"
477#define BG1SConnectFailed @"BG1SConnectFailed"
478#define BG1SConnectNoti @"BG1SConnectNoti"
479#define BG1SDisConnectNoti @"BG1SDisConnectNoti"
480
481typedef NS_ENUM(NSUInteger, BG1SDeviceError) {
482
483 BG1SDeviceError0=0,
484 BG1SError_LowBattery,
485 BG1SError_ReferenceUnstable,//2.5V reference is unstable
486 BG1SError_BadStrip,
487 BG1SError_BadEEPROM,
488 BG1SError_LowAmbientTemperature,//Low ambient temperature
489 BG1SError_HighAmbientTemperature,//High ambient temperature
490 BG1SError_BleedEarly,
491 BG1SError_Other,
492 BG1SError_ResultHigh,
493 BG1SError_ResultLow,
494 BG1SError_Disconnect,
495
496};
497
498typedef void(^BlockBG1SDeviceFunction)(NSDictionary *functionDict);
499
500typedef void(^BlockBG1SError)(BG1SDeviceError error);
501
502/**
503 Strip is insered
504 */
505typedef void (^DisposeBG1SStripInBlock)(BOOL inORout);
506
507#endif
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3.h
new file mode 100644
index 0000000..d7c7342
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3.h
@@ -0,0 +1,77 @@
1//
2// BP3.h
3// testShareCommunication
4//
5// Created by zhiwei jing on 13-10-22.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BPDevice.h"
11#import <UIKit/UIKit.h>
12
13
14/**
15 BP3 device class
16 */
17@interface BP3 : BPDevice
18
19/**
20 * Query battery remaining energy
21 * @param energyValue A block to return the device battery remaining energy percentage, ‘80’ stands for 80%.
22 * @param error A block to return the error in ‘Establish measurement connection’.
23 */
24-(void)commandEnergy:(BlockEnergyValue)energyValue errorBlock:(BlockError)error;
25
26/**
27 * Establish measurement connection and start BP measurement
28 * @Notice By the first time of new user register via SDK, ‘iHealth disclaimer’ will pop up automatically, and require the user agrees to continue. SDK application requires Internet connection; there is 10-day tryout if SDK cannot connect Internet, SDK is fully functional during tryout period, but will be terminated without verification through Internet after 10 days.
29 * @param blockZeroState Zeroing state
30 * @param pressure Pressure value in the process of measurement, the unit is ‘mmHg’.
31 * @param blockWaveletWithHeartbeat Wavelet data set with heart beat.
32 * @param blockWaveletWithoutHeartbeat Wavelet data set without heart beat.
33 * @param result result of the measurement, including systolic pressure, diastolic pressure, pulse rate and irregular judgment. Relevant key: time, sys, dia, heartRate, irregular
34 * @param error error codes.
35 * Specification:
36 * 1. BPError0 = 0: Unable to take measurements due to arm/wrist movements.
37 * 2. BPError1: Failed to detect systolic pressure.
38 * 3. BPError2: Failed to detect diastolic pressure.
39 * 4. BPError3: Pneumatic system blocked or cuff is too tight during inflation.
40 * 5. BPError4: Pneumatic system leakage or cuff is too loose during inflation.
41 * 6. BPError5: Cuff pressure reached over 300mmHg.
42 * 7. BPError6: Cuff pressure reached over 15 mmHg for more than 160 seconds.
43 * 8. BPError7: Data retrieving error.
44 * 9. BPError8: Data retrieving error.
45 * 10. BPError9: Data retrieving error.
46 * 11. BPError10: Data retrieving error.
47 * 12. BPError11: Communication Error.
48 * 13. BPError12: Communication Error.
49 * 14. BPError13: Low battery.
50 * 15. BPError14: Device bluetooth set failed.
51 * 16. BPError15: Systolic exceeds 260mmHg or diastolic exceeds 199mmHg.
52 * 17. BPError16: Systolic below 60mmHg or diastolic below 40mmHg.
53 * 18. BPError17: Arm/wrist movement beyond range.
54 * 19. BPNormalError=30: device error, error message displayed automatically.
55 * 20. BPOverTimeError: Abnormal communication.
56 * 21. BPNoRespondError: Abnormal communication.
57 * 22. BPBeyondRangeError: device is out of communication range.
58 * 23. BPDidDisconnect: device is disconnected.
59 * 24. BPAskToStopMeasure: measurement has been stopped.
60 * 25. BPInputParameterError=400: Parameter input error.
61 */
62-(void)commandStartMeasureWithZeroingState:(BlockZero)blockZeroState pressure:(BlockPressure)pressure waveletWithHeartbeat:(BlockWavelet)blockWaveletWithHeartbeat waveletWithoutHeartbeat:(BlockWavelet)blockWaveletWithoutHeartbeat result:(BlockMeasureResult)result errorBlock:(BlockError)error;
63
64/**
65 * Measurement termination and stop upper-arm BPM measurement
66 * @param result The block return ‘YES’ means measurement has been terminated, return ‘NO’ means termination failed.
67 * @param error A block to return the error in ‘Establish measurement connection' in BP3.
68 */
69-(void)stopBPMeassure:(BlockResult)result ErrorBlock:(BlockError)error;
70/**
71 * Disconnect BP3 and delete the measurement port
72 */
73-(void)deleteMeasurePort;
74
75
76
77@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3Controller.h
new file mode 100644
index 0000000..67b0f0b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3Controller.h
@@ -0,0 +1,27 @@
1//
2// BP3Controller.h
3// testShareCommunication
4//
5// Created by zhiwei jing on 13-10-22.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BPMacroFile.h"
11
12
13/**
14 BP3 controller class
15 */
16@interface BP3Controller : NSObject
17/**
18 * Initialize BP3 controller class
19 */
20+(BP3Controller *)shareBP3Controller;
21
22/**
23 * Get all BP3 instance,Access control class instance after receiving BP3ConnectNoti, then use instance to call BP3 related communication methods.
24 */
25-(NSArray *)getAllCurrentBP3Instace;
26
27@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3L.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3L.h
new file mode 100644
index 0000000..0478149
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3L.h
@@ -0,0 +1,58 @@
1//
2// BP3L.h
3// testShareCommunication
4//
5// Created by my on 14/10/13.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import <UIKit/UIKit.h>
11#import "BPV24Device.h"
12
13
14/**
15 BP3L device class
16 */
17@interface BP3L : BPV24Device <BPBasicBTLEProtocol,BPRealtimeMeasureProtocol>
18
19
20
21/**
22 * Establish measurement connection and start BP measurement.
23 * @param blockZeroState Zeroing state
24 * @param pressure Pressure value in the process of measurement, the unit is ‘mmHg’.
25 * @param blockWaveletWithHeartbeat Wavelet data set with heart beat.
26 * @param blockWaveletWithoutHeartbeat Wavelet data set without heart beat.
27 * @param result result of the measurement, including systolic pressure, diastolic pressure, pulse rate and irregular judgment. Relevant key: time, sys, dia, heartRate, irregular. irregular will be 0 or 1.
28 * @param error Return error codes.
29 */
30-(void)commandStartMeasureWithZeroingState:(BlockZero)blockZeroState pressure:(BlockPressure)pressure waveletWithHeartbeat:(BlockWavelet)blockWaveletWithHeartbeat waveletWithoutHeartbeat:(BlockWavelet)blockWaveletWithoutHeartbeat result:(BlockMeasureResult)result errorBlock:(BlockError)error;
31
32/**
33 * Measurement termination and stop BP3L measurement
34 * @param success The block return means measurement has been terminated.
35 * @param error A block to return the error in ‘Establish measurement connection’ in BP3L.
36 */
37-(void)stopBPMeassureSuccessBlock:(BlockSuccess)success errorBlock:(BlockError)error;
38
39/**
40 * Synchronize time and judge if the device supports BT auto-connection, offline detection, and if the function on or off, corresponding KEYs are haveBlue, haveOffline, blueOpen, offlineOpen. ‘True’ means yes or on, ‘False’ means no or off
41 * @param function A block to return the function and states that the device supports.
42 * @param error A block to refer ‘error’ in ‘Establish measurement connection’ in BP3L.
43 */
44-(void)commandFunction:(BlockDeviceFunction)function errorBlock:(BlockError)error;
45
46/**
47 * Query battery remaining energy
48 * @param energyValue A block to return the device battery remaining energy percentage, ‘80’ stands for 80%.
49 * @param error A block to return the error in ‘Establish measurement connection’.
50 */
51-(void)commandEnergy:(BlockEnergyValue)energyValue errorBlock:(BlockError)error;
52
53/**
54 * Disconnect current device
55 */
56-(void)commandDisconnectDevice;
57
58@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3LController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3LController.h
new file mode 100644
index 0000000..f4c0e75
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP3LController.h
@@ -0,0 +1,30 @@
1//
2// BP3LViewController.h
3// testShareCommunication
4//
5// Created by my on 14/10/13.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BPMacroFile.h"
11
12
13
14/**
15 BP3L controller class
16 */
17@interface BP3LController : BPController
18
19/**
20 * Initialize BP3L controller class
21 */
22+(BP3LController *)shareBP3LController;
23
24/**
25 * Get all BP3L instance,Access control class instance after receiving BP3LConnectNoti then use instance to call BP3L related communication methods.
26 */
27-(NSArray *)getAllCurrentBP3LInstace;
28
29
30@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5.h
new file mode 100644
index 0000000..43fbe42
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5.h
@@ -0,0 +1,32 @@
1//
2// BP5.h
3// testShareCommunication
4//
5// Created by my on 14/10/13.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import "BP7.h"
10
11
12/**
13 BP5 device class
14 */
15@interface BP5 : BP7
16
17/**
18 * Establish measurement connection and start BP measurement(Only for BP5).
19 * @param blockZeroState Zeroing state
20 * @param pressure Pressure value in the process of measurement, the unit is ‘mmHg’.
21 * @param blockWaveletWithHeartbeat Wavelet data set with heart beat.
22 * @param blockWaveletWithoutHeartbeat Wavelet data set without heart beat.
23 * @param result result of the measurement, including systolic pressure, diastolic pressure, pulse rate and irregular judgment. Relevant key: time, sys, dia, heartRate, irregular. irregular will be 0 or 1.
24 * @param error Return error codes.
25 */
26
27-(void)commandStartMeasureWithZeroingState:(BlockZero)blockZeroState pressure:(BlockPressure)pressure waveletWithHeartbeat:(BlockWavelet)blockWaveletWithHeartbeat waveletWithoutHeartbeat:(BlockWavelet)blockWaveletWithoutHeartbeat result:(BlockMeasureResult)result errorBlock:(BlockError)error;
28
29
30
31
32@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5C.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5C.h
new file mode 100644
index 0000000..f2c7a14
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5C.h
@@ -0,0 +1,131 @@
1//
2// BP5C.h
3// iHealthSDKStatic
4//
5// Created by Realank on 2017/9/26.
6// Copyright © 2017年 ihealthSDK. All rights reserved.
7//
8
9#import "BPBV10Device.h"
10@interface BP5C : BPBV10Device<BPBasicBTLEProtocol,BPRealtimeMeasureProtocol,BPOfflineDataTransferProtocol>
11
12
13/**
14 * Synchronize time and return functions this device supports.
15 * @param function A block to return the functions and states that the device supports.
16 * @param error Operation failed, and returns the error codes.
17 */
18-(void)commandFunction:(BlockDeviceFunction)function errorBlock:(BlockError)error;
19
20/**
21 * Get battery remaining energy by percent
22 * @param energyValue A block to return the device battery remaining energy percentage, ‘80’ stands for 80%.
23 * @param error Operation failed, and returns the error codes.
24 */
25-(void)commandEnergy:(BlockEnergyValue)energyValue errorBlock:(BlockError)error;
26
27/**
28 * Set units for the Device
29 * @param UnitName The unit name of the result, must be @"mmHg" or @"kPa".
30 * @param setResult This block return means set success.
31 * @param error Operation failed, and returns the error codes.
32 */
33-(void)commandSetUnit:(NSString *)UnitName disposeSetReslut:(BlockSuccess)setResult errorBlock:(BlockError)error;
34
35
36/**
37 Set auto loop measure scheme
38
39 @param scheme scheme content
40 @param successBlock A block refer to success.
41 @param errorBlock Operation failed, and returns the error codes.
42 */
43- (void)commandSetLoopMeasureScheme:(BPLoopMeasureSettingModel*)scheme successBlock:(BlockSuccess)successBlock errorBlock:(BlockError)errorBlock;
44
45/**
46 Get auto loop measure scheme
47
48 @param loopMeasureSchemeBlock return auto loop measure scheme content
49 @param errorBlock Operation failed, and returns the error codes.
50 */
51- (void)commandAskLoopMeasureScheme:(BlockAskLoopMeasureScheme)loopMeasureSchemeBlock errorBlock:(BlockError)errorBlock;
52
53/**
54 * Start BP measurement.
55 * @param blockZeroState Zeroing state
56 * @param pressure Pressure value in the process of measurement, the unit is ‘mmHg’.
57 * @param blockWaveletWithHeartbeat Wavelet data set including pulse rate
58 * @param blockWaveletWithoutHeartbeat Wavelet data set without pulse rate
59 * @param result result of the measurement, including systolic pressure, diastolic pressure, pulse rate and irregular judgment. Relevant keys: time, sys, dia, heartRate, irregular. irregular will be 0 or 1.
60 * @param error Operation failed, and returns the error codes.
61 */
62-(void)commandStartMeasureWithZeroingState:(BlockZero)blockZeroState pressure:(BlockPressure)pressure waveletWithHeartbeat:(BlockWavelet)blockWaveletWithHeartbeat waveletWithoutHeartbeat:(BlockWavelet)blockWaveletWithoutHeartbeat result:(BlockMeasureResult)result errorBlock:(BlockError)error;
63
64/**
65 * Stop measurement
66 * @param success The block return means measurement has been terminated.
67 * @param error Operation failed, and returns the error codes.
68 */
69-(void)stopBPMeassureSuccessBlock:(BlockSuccess)success errorBlock:(BlockError)error;
70
71
72/**
73 * Upload history data.
74 * @param totalCount history data total Count.
75 * @param progress upload completion ratio , from 0.0 to 1.0.
76 * @param uploadDataArray offline data set, including measurement time, systolic pressure, diastolic pressure, pulse rate, irregular judgment,scheme ID,body movement flag. corresponding KEYs are time, sys, dia, heartRate, irregular,schemeID,bodyMovementFlg.
77 * @param error Operation failed, and returns the error codes.
78 */
79-(void)commandTransferMemoryDataWithTotalCount:(BlockBachCount)totalCount progress:(BlockBachProgress)progress dataArray:(BlockBachArray)uploadDataArray errorBlock:(BlockError)error;
80
81-(void)commandTransferMemoryDataAndRawPressureWithTotalCount:(BlockBachCount)totalCount progress:(BlockBachProgress)progress dataArray:(BlockBachArray)uploadDataArray errorBlock:(BlockError)error;
82
83/**
84 * Upload history data total Count.
85 * @param totalCount item quantity of total data.
86 * @param error Operation failed, and returns the error codes.
87 */
88-(void)commandTransferMemoryTotalCount:(BlockBachCount)totalCount errorBlock:(BlockError)error;
89
90
91/**
92 Delete all the history memory stored in device
93
94 @param successBlock A block refer to delete complete.
95 @param errorBlock Operation failed, and returns the error codes.
96 */
97- (void)commandDeleteAllMemoryWithSuccessBlock:(BlockSuccess)successBlock errorBlock:(BlockError)errorBlock;
98
99
100/**
101 Set ID String (eg.patientID, schemeID), length 100 max
102
103 @param idString the content of id
104 @param successBlock A block refer to success.
105 @param errorBlock Operation failed, and returns the error codes.
106 */
107- (void)commandSetIDString:(NSString*)idString successBlock:(BlockSuccess)successBlock errorBlock:(BlockError)errorBlock;
108
109
110/**
111 Ask ID String
112
113 @param idStringResultBlock return ID String
114 @param errorBlock Operation failed, and returns the error codes.
115 */
116- (void)commandAskIDStringWithResult:(BlockAskIDString)idStringResultBlock errorBlock:(BlockError)errorBlock;
117
118/**
119 Change loop measure scheme status
120
121 @param start YES to start, NO to pause
122 @param successBlock A block refer to success.
123 @param errorBlock Operation failed, and returns the error codes.
124 */
125- (void)commandChangeLoopMeasureStatusToStart:(BOOL)start successBlock:(BlockSuccess)successBlock errorBlock:(BlockError)errorBlock;
126
127/**
128 * Disconnect current device
129 */
130-(void)commandDisconnectDevice;
131@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5CController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5CController.h
new file mode 100644
index 0000000..30c8069
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5CController.h
@@ -0,0 +1,25 @@
1//
2// ABPMController.h
3// iHealthSDKStatic
4//
5// Created by Realank on 2017/9/26.
6// Copyright © 2017年 ihealthSDK. All rights reserved.
7//
8
9#import "BPController.h"
10
11/**
12 BP5C controller class
13 */
14@interface BP5CController : BPController
15/**
16 * Initialize BP5C controller class
17 */
18+ (BP5CController *)sharedController;
19
20/**
21 * Get all BP5C instance,Access control class instance after receiving BP3LConnectNoti then use instance to call BP5C related communication methods.
22 */
23- (NSArray *)allConnectedInstance;
24
25@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5Controller.h
new file mode 100644
index 0000000..e9609ae
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5Controller.h
@@ -0,0 +1,25 @@
1//
2// BP5ViewController.h
3// testShareCommunication
4//
5// Created by my on 14/10/13.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BPMacroFile.h"
11
12/**
13 BP5 controller class
14 */
15@interface BP5Controller : BPController
16/**
17 * Initialize BP5 controller class
18 */
19+(BP5Controller *)shareBP5Controller;
20
21/**
22 * Get all BP5 instance,Access control class instance after receiving BP5ConnectNoti, then use instance to call BP5 related communication methods.
23 */
24-(NSArray *)getAllCurrentBP5Instace;
25@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5S.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5S.h
new file mode 100644
index 0000000..bb1db70
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5S.h
@@ -0,0 +1,97 @@
1//
2// BP5S.h
3// iHealthSDKStatic
4//
5// Created by Realank on 2017/7/14.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#import "BPV25Device.h"
10
11
12/**
13 BP5S device class
14 */
15@interface BP5S : BPV25Device <BPBasicBTLEProtocol,BPRealtimeMeasureProtocol, BPOfflineDataTransferProtocol, BPEnableOfflineProtocol>
16
17
18/**
19 * Upload offline data.
20 * @Notice By the first time of new user register via SDK, ‘iHealth disclaimer’ will pop up automatically, and require the user agrees to continue. SDK application requires Internet connection; there is 10-day tryout if SDK cannot connect Internet, SDK is fully functional during tryout period, but will be terminated without verification through Internet after 10 days.
21 * @param totalCount item quantity of total data
22 * @param progress upload completion ratio , from 0.0 to 1.0 or 0%~100%, 100% means upload completed.
23 * @param uploadDataArray offline data set, including measurement time, systolic pressure, diastolic pressure, pulse rate, irregular judgment,scheme ID,body movement flag. corresponding KEY as time, sys, dia, heartRate, irregular,schemeID,bodyMovementFlg.
24 * @param error error codes.
25 */
26-(void)commandTransferMemoryDataWithTotalCount:(BlockBachCount)totalCount progress:(BlockBachProgress)progress dataArray:(BlockBachArray)uploadDataArray errorBlock:(BlockError)error;
27
28
29/**
30 * Upload offline data total Count.
31 * @param totalCount item quantity of total data.
32 * @param error A block to return the error.
33 */
34-(void)commandTransferMemoryTotalCount:(BlockBachCount)totalCount errorBlock:(BlockError)error;
35
36
37/**
38 * * Synchronize time and return the function and states that the device supports
39 * @param function A block to return the function and states that the device supports,judge if the device supports the function of up Air Measurement, arm Measurement,the last operation status,the max memory capacity, HSD, Offline Memory, mutable Groups Upload, Self Upgrade. ‘True’ means yes or on, ‘False’ means no or off.
40 * @param error A block to refer ‘error’ in ‘Establish measurement connection’ in BP5S.
41 */
42-(void)commandFunction:(BlockDeviceFunction)function errorBlock:(BlockError)error;
43
44/**
45 * Query battery remaining energy
46 * @param energyValue A block to return the device battery remaining energy percentage, ‘80’ stands for 80%.
47 * @param energyState 1:Not charging 2:charging 3:charging finish
48 * @param error A block to return the error in ‘Establish measurement connection’.
49 */
50-(void)commandEnergy:(BlockEnergyValue)energyValue energyState:(BlockEnergyState)energyState errorBlock:(BlockError)error;
51
52/**
53 * Establish measurement connection and start BP measurement.
54 * @param blockZeroState Zeroing state
55 * @param pressure Pressure value in the process of measurement, the unit is ‘mmHg’.
56 * @param blockWaveletWithHeartbeat Wavelet data set with heart beat.
57 * @param blockWaveletWithoutHeartbeat Wavelet data set without heart beat.
58 * @param result result of the measurement, including systolic pressure, diastolic pressure, pulse rate and irregular judgment. Relevant key: time, sys, dia, heartRate, irregular. irregular will be 0 or 1.
59 * @param error Return error codes.
60 */
61-(void)commandStartMeasureWithZeroingState:(BlockZero)blockZeroState pressure:(BlockPressure)pressure waveletWithHeartbeat:(BlockWavelet)blockWaveletWithHeartbeat waveletWithoutHeartbeat:(BlockWavelet)blockWaveletWithoutHeartbeat result:(BlockMeasureResult)result errorBlock:(BlockError)error;
62
63/**
64 * Measurement termination and stop BP measurement
65 * @param success The block return means measurement has been terminated.
66 * @param error A block to return the error in ‘Establish measurement connection’ in BP.
67 */
68-(void)stopBPMeassureSuccessBlock:(BlockSuccess)success errorBlock:(BlockError)error;
69
70/**
71 * Delete all offline data
72 * @param success The block return means delete has been terminated.
73 * @param error A block to return the error in ‘Establish measurement connection’ in BP.
74 */
75-(void)commandDeleteDataSuccessBlock:(BlockSuccess)success errorBlock:(BlockError)error;
76
77/**
78 * set up offline detection
79 * @param open True means on; False means off.
80 * @param successBlock A block to refer ‘set success’.
81 * @param errorBlock A block to refer ‘set failed’.
82 */
83-(void)commandSetOffline:(BOOL)open success:(BlockSuccess)successBlock error:(BlockError)errorBlock;
84
85/**
86 * set unit display
87 * @param UnitName mmHg, kPa
88 * @param setResult A block to refer ‘set success’.
89 * @param error A block to refer ‘set failed’.
90 */
91-(void)commandSetUnit:(NSString *)UnitName disposeSetReslut:(BlockSuccess)setResult errorBlock:(BlockError)error;
92/**
93 * Disconnect current device
94 */
95-(void)commandDisconnectDevice;
96
97@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5SController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5SController.h
new file mode 100644
index 0000000..7018b8f
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5SController.h
@@ -0,0 +1,27 @@
1//
2// BP5SController.h
3// iHealthSDKStatic
4//
5// Created by Realank on 2017/7/7.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#import <UIKit/UIKit.h>
10#import "BPMacroFile.h"
11
12/**
13 BP5S controller class
14 */
15@interface BP5SController : BPController
16
17/**
18 * Initialize controller class
19 */
20+(instancetype)sharedController;
21
22/**
23 * Get all BP5S instance,Access control class instance after receiving BP3LConnectNoti then use instance to call BP5S related communication methods.
24 */
25-(NSArray *)getAllCurrentInstance;
26
27@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5SRW.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5SRW.h
new file mode 100644
index 0000000..e2e8d77
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5SRW.h
@@ -0,0 +1,101 @@
1//
2// BP5SRW.h
3// testShareCommunication
4//
5// Created by my on 14/10/13.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BPDevice.h"
11#import <UIKit/UIKit.h>
12
13
14/**
15 BP5SRW device class
16 */
17@interface BP5SRW : BPDevice
18
19
20
21/**
22 * Establish measurement connection and start BP measurement.
23 * @Notice By the first time of new user register via SDK, ‘iHealth disclaimer’ will pop up automatically, and require the user agrees to continue. SDK application requires Internet connection; there is 10-day tryout if SDK cannot connect Internet, SDK is fully functional during tryout period, but will be terminated without verification through Internet after 10 days.
24 * @param blockZeroState Zeroing state
25 * @param pressure Pressure value in the process of measurement, the unit is ‘mmHg’.
26 * @param blockWaveletWithHeartbeat Wavelet data set with heart beat.
27 * @param blockWaveletWithoutHeartbeat Wavelet data set without heart beat.
28 * @param result result of the measurement, including systolic pressure, diastolic pressure, pulse rate and irregular judgment. Relevant key: time, sys, dia, heartRate, irregular.
29 * @param redWave A block to return wave information,include the packets order number(0~255),the current measure status(@1 means measuring,@2 means constant Pressure measuring,@3 means completed),the pressure data type(@1 means pressure data ,@2 means wave data) ,the pressure or wave count ,the pressure or wave data array.The corresponding keys are @"packetOrderID",@"measureStatusID",@"pressureDataType",@"pressureCount",@"pressureArray".
30 * @param error Return error codes.
31 * Specification:
32 * 1. BPError0 = 0: Unable to take measurements due to arm/wrist movements.
33 * 2. BPError1: Failed to detect systolic pressure.
34 * 3. BPError2: Failed to detect diastolic pressure.
35 * 4. BPError3: Pneumatic system blocked or cuff is too tight during inflation.
36 * 5. BPError4: Pneumatic system leakage or cuff is too loose during inflation.
37 * 6. BPError5: Cuff pressure reached over 300mmHg.
38 * 7. BPError6: Cuff pressure reached over 15 mmHg for more than 160 seconds.
39 * 8. BPError7: Data retrieving error.
40 * 9. BPError8: Data retrieving error.
41 * 10. BPError9: Data retrieving error.
42 * 11. BPError10: Data retrieving error.
43 * 12. BPError11: Communication Error.
44 * 13. BPError12: Communication Error.
45 * 14. BPError13: Low battery.
46 * 15. BPError14: Device bluetooth set failed.
47 * 16. BPError15: Systolic exceeds 260mmHg or diastolic exceeds 199mmHg.
48 * 17. BPError16: Systolic below 60mmHg or diastolic below 40mmHg.
49 * 18. BPError17: Arm/wrist movement beyond range.
50 * 19. BPError18: Bleed to specified pressure over time
51 * 20. BPError19: Constant pressure acquisition process changes over the specified range of pressure.
52 * 21. BPNormalError=30: device error, error message displayed automatically.
53 * 22. BPOverTimeError: Abnormal communication.
54 * 23. BPNoRespondError: Abnormal communication.
55 * 24. BPBeyondRangeError: device is out of communication range.
56 * 25. BPDidDisconnect: device is disconnected.
57 * 26. BPAskToStopMeasure: measurement has been stopped.
58 * 27. BPInputParameterError=400: Parameter input error.
59 */
60
61-(void)commandStartMeasureWithZeroingState:(BlockZero)blockZeroState pressure:(BlockPressure)pressure waveletWithHeartbeat:(BlockWavelet)blockWaveletWithHeartbeat waveletWithoutHeartbeat:(BlockWavelet)blockWaveletWithoutHeartbeat result:(BlockMeasureResult)result redWave:(BlockRedWaveDic)redWave errorBlock:(BlockError)error;
62
63/**
64 * Measurement termination and stop BP5SRW measurement
65 * @param success The block return means measurement has been terminated.
66 * @param error A block to return the error in ‘Establish measurement connection’ in BP5SRW.
67 */
68-(void)stopBPMeassureSuccessBlock:(BlockSuccess)success errorBlock:(BlockError)error;
69
70/**
71 * Synchronize time and judge if the device supports BT auto-connection, offline detection, and if the function on or off, corresponding KEY as haveBlue, haveOffline, blueOpen, offlineOpen. ‘True’ means yes or on, ‘False’ means no or off
72 * @param function A block to return the function and states that the device supports.
73 * @param error A block to refer ‘error’ in ‘Establish measurement connection’ in BP5SRW.
74 */
75-(void)commandFunction:(BlockDeviceFunction)function errorBlock:(BlockError)error;
76
77/**
78 * Query battery remaining energy
79 * @param energyValue A block to return the device battery remaining energy percentage, ‘80’ stands for 80%.
80 * @param error A block to return the error in ‘Establish measurement connection’.
81 */
82-(void)commandEnergy:(BlockEnergyValue)energyValue errorBlock:(BlockError)error;
83
84
85/**
86 Set the target measure configure
87
88 @param targetPressure Set the target constant pressure in measuring.
89 @param fluctuationPressure Set the allowed range of pressure fluctuations.
90 @param sampleTime Set the pressure sample time.
91 @param setResult Success callback
92 @param error A block to return the error in ‘Establish measurement connection’.
93 */
94-(void)CommandSetPressureSamplewithTargetPressure:(NSNumber *)targetPressure fluctuationRange:(NSNumber *)fluctuationPressure sampleTime:(NSNumber *)sampleTime disposeSetPresureTargetSuccess:(BlockSuccess)setResult errorBlock:(BlockError)error;
95
96/**
97 * Disconnect current device
98 */
99-(void)commandDisconnectDevice;
100
101@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5SRWController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5SRWController.h
new file mode 100644
index 0000000..5026a2c
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP5SRWController.h
@@ -0,0 +1,26 @@
1//
2// BP5SRWController.h
3// testShareCommunication
4//
5// Created by my on 14/10/13.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BPMacroFile.h"
11
12/**
13 BP5SRW contoller class
14 */
15@interface BP5SRWController : BPController
16/**
17 * Initialize BP5SRW controller class
18 */
19+(BP5SRWController *)shareBP5SRWController;
20
21/**
22 * Get all BP5SRW instance,Access control class instance after receiving BP5SRWConnectNoti then use instance to call BP5SRW related communication methods.
23 */
24-(NSArray *)getAllCurrentBP5SRWInstace;
25
26@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7.h
new file mode 100644
index 0000000..fa9b478
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7.h
@@ -0,0 +1,141 @@
1//
2// BP7.h
3// testShareCommunication
4//
5// Created by my on 8/10/13.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BPDevice.h"
11#import <UIKit/UIKit.h>
12
13
14/**
15 BP7 device class
16 */
17@interface BP7 : BPDevice<BPBasicProtocol,BPRealtimeMeasureProtocol,BPOfflineDataTransferProtocol,BPEnableOfflineProtocol>
18/**
19 * Synchronize time and judge if the device supports BT auto-connection, offline detection, and if the function on or off, corresponding KEYs are haveBlue, haveOffline, blueOpen, offlineOpen. ‘True’ means yes or on, ‘False’ means no or off
20 * @param function A block to return the function and states that the device supports.
21 * @param error A block to refer ‘error’ in ‘Establish measurement connection’ in BP.
22 */
23-(void)commandFunction:(BlockDeviceFunction)function errorBlock:(BlockError)error;
24
25/**
26 *set up BT auto-connection
27 * @param open True means on; False means off.
28 * @param blockBuleSet The device current statues, True means on, False means off.
29 * @param error A block to refer ‘error’ in ‘Establish measurement connection’ in BP.
30 */
31-(void)commandSetBlueConnect:(BOOL)open respond:(BlockBlueSet)blockBuleSet errorBlock:(BlockError)error;
32
33/**
34 * set up offline detection
35 * @param open True means on; False means off.
36 * @param successBlock A block to refer ‘set success’.
37 * @param errorBlock A block to refer ‘set failed’.
38 */
39-(void)commandSetOffline:(BOOL)open success:(BlockSuccess)successBlock error:(BlockError)errorBlock;
40/**
41 * set up offline detection (Deprecated)
42 * @param open True means on; False means off.
43 * @param error A block to refer ‘error’ in ‘Establish measurement connection’ in BP.
44 */
45-(void)commandSetOffline:(BOOL)open errorBlock:(BlockError)error;
46
47
48/**
49 * Query battery remaining energy
50 * @param energyValue A block to return the device battery remaining energy percentage, ‘80’ stands for 80%.
51 * @param error A block to return the error in ‘Establish measurement connection’
52 */
53-(void)commandEnergy:(BlockEnergyValue)energyValue errorBlock:(BlockError)error;
54
55
56/**
57 * Get current angle(only for BP7,This function needs to be called before the call of the start measure function)
58 * @param angleInfo Angle information, including angle、isLeftHand. ‘angle’ stands for the inclination angle of the device, from 0 to 90; ‘isLeftHand’ stands for the judgment if the device is on the left hand, ‘true’ means left hand, otherwise is right hand.
59 * @param error error codes.
60 * Specification:
61 * 1. BPError0 = 0: Unable to take measurements due to arm/wrist movements.
62 * 2. BPError1: Failed to detect systolic pressure.
63 * 3. BPError2: Failed to detect diastolic pressure.
64 * 4. BPError3: Pneumatic system blocked or cuff is too tight during inflation.
65 * 5. BPError4: Pneumatic system leakage or cuff is too loose during inflation.
66 * 6. BPError5: Cuff pressure reached over 300mmHg.
67 * 7. BPError6: Cuff pressure reached over 15 mmHg for more than 160 seconds.
68 * 8. BPError7: Data retrieving error.
69 * 9. BPError8: Data retrieving error.
70 * 10. BPError9: Data retrieving error.
71 * 11. BPError10: Data retrieving error.
72 * 12. BPError11: Communication Error.
73 * 13. BPError12: Communication Error.
74 * 14. BPError13: Low battery.
75 * 15. BPError14: Device bluetooth set failed.
76 * 16. BPError15: Systolic exceeds 260mmHg or diastolic exceeds 199mmHg.
77 * 17. BPError16: Systolic below 60mmHg or diastolic below 40mmHg.
78 * 18. BPError17: Arm/wrist movement beyond range.
79 * 19. BPNormalError=30: device error, error message displayed automatically.
80 * 20. BPOverTimeError: Abnormal communication.
81 * 21. BPNoRespondError: Abnormal communication.
82 * 22. BPBeyondRangeError: device is out of communication range.
83 * 23. BPDidDisconnect: device is disconnected.
84 * 24. BPAskToStopMeasure: measurement has been stopped.
85 * 25. BPInputParameterError=400: Parameter input error.
86 */
87-(void)commandStartGetAngle:(BlockAngle)angleInfo errorBlock:(BlockError)error;
88
89/*
90 * Measurement start(only for BP7). When ‘angle’ is between 10-30, measurement starts
91 * @param blockZeroState Zeroing state
92 * @param Pressure Pressure value in the process of measurement, the unit is ‘mmHg’.
93 * @param blockWaveletWithHeartbeat Wavelet data set with heart beat.
94 * @param blockWaveletWithoutHeartbeat Wavelet data set without heart beat.
95 * @param Result result including systolic pressure, diastolic pressure, pulse rate and irregular judgment. Relevant key: time, sys, dia, heartRate, irregular. irregular will be 0 or 1.
96 * @param error error codes.
97 * Specification:
98 * 1. BPNormalError: device error, error message displayed automatically.
99 * 2. BPOverTimeError: communication over time error.
100 * 3. BPNoRespondError: abnormal communication.
101 * 4. BPBeyondRangeError: device is out of communication range.
102 * 5. BPDidDisconnect: device is disconnected.
103 * 6. BPAskToStopMeasure: measurement has been stopped.
104 */
105
106-(void)commandStartMeasureWithZeroingState:(BlockZero)blockZeroState pressure:(BlockPressure)pressure waveletWithHeartbeat:(BlockWavelet)blockWaveletWithHeartbeat waveletWithoutHeartbeat:(BlockWavelet)blockWaveletWithoutHeartbeat result:(BlockMeasureResult)result errorBlock:(BlockError)error;
107
108/**
109 * upload offline data (Deprecated)
110 * @param totalCount item quantity of total data.
111 * @param progress upload completion ratio , from 0.0 to 1.0 or 0%~100%, 100% means upload completed.
112 * @param uploadDataArray offline data set, including measurement time, systolic pressure, diastolic pressure, pulse rate, irregular judgment. corresponding KEYs are time, sys, dia, heartRate, irregular.
113 * @param error refer ‘error’ in ‘Establish measurement connection’ in BP.
114 */
115-(void)commandBatchUpload:(BlockBachCount)totalCount progress:(BlockBachProgress)progress dataArray:(BlockBachArray)uploadDataArray errorBlock:(BlockError)error;
116
117/**
118 * Upload offline data total Count.
119 * @param totalCount item quantity of total data.
120 * @param error A block to return the error.
121 */
122-(void)commandTransferMemoryTotalCount:(BlockBachCount)totalCount errorBlock:(BlockError)error;
123
124/**
125 * Upload offline data.
126 * @Notice By the first time of new user register via SDK, ‘iHealth disclaimer’ will pop up automatically, and require the user agrees to continue. SDK application requires Internet connection; there is 10-day tryout if SDK cannot connect Internet, SDK is fully functional during tryout period, but will be terminated without verification through Internet after 10 days.
127 * @param totalCount item quantity of total data
128 * @param progress upload completion ratio , from 0.0 to 1.0 or 0%~100%, 100% means upload completed.
129 * @param uploadDataArray offline data set, including measurement time, systolic pressure, diastolic pressure, pulse rate, irregular judgment,scheme ID,body movement flag. corresponding KEYs are time, sys, dia, heartRate, irregular,schemeID,bodyMovementFlg.
130 * @param error A block to return the error.
131 */
132-(void)commandTransferMemoryDataWithTotalCount:(BlockBachCount)totalCount progress:(BlockBachProgress)progress dataArray:(BlockBachArray)uploadDataArray errorBlock:(BlockError)error;
133
134/**
135 * Measurement termination and stop BP measurement
136 * @param success The block return means measurement has been terminated.
137 * @param error A block to return the error in ‘Establish measurement connection’ in BP.
138 */
139-(void)stopBPMeassureSuccessBlock:(BlockSuccess)success errorBlock:(BlockError)error;
140
141@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7Controller.h
new file mode 100644
index 0000000..2c0151e
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7Controller.h
@@ -0,0 +1,25 @@
1//
2// BP7Controller.h
3// testShareCommunication
4//
5// Created by my on 8/10/13.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BPMacroFile.h"
11
12/**
13 BP7 controller class
14 */
15@interface BP7Controller : BPController
16/**
17 * Initialize BP7 controller class
18 */
19+(BP7Controller *)shareBP7Controller;
20
21/**
22 * Get all BP7 instance,Access control class instance after receiving BP7ConnectNoti, then use instance to call BP7 related communication methods.
23 */
24-(NSArray *)getAllCurrentBP7Instace;
25@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7S.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7S.h
new file mode 100644
index 0000000..bc06c5a
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7S.h
@@ -0,0 +1,106 @@
1//
2// BP7S.h
3// testShareCommunication
4//
5// Created by my on 8/10/13.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BPDevice.h"
11#import <UIKit/UIKit.h>
12
13
14/**
15 BP7S device class
16 */
17@interface BP7S : BPDevice <BPBasicBTLEProtocol,BPOfflineDataTransferProtocol>
18
19#pragma mark - Hypogenous query
20
21/**
22 * Synchronize time and return the function and states that the device supports
23 * @param function A block to return the function and states that the device supports,judge if the device supports the function of up Air Measurement, arm Measurement, Angle Sensor, Angle Setting, HSD, Offline Memory, mutable Groups Upload, Self Upgrade. ‘True’ means yes or on, ‘False’ means no or off.
24 * @param error A block to refer ‘error’ in ‘Establish measurement connection’ in BP7S.
25 */
26-(void)commandFunction:(BlockDeviceFunction)function errorBlock:(BlockError)error;
27
28/**
29 * Query battery remaining energy.
30 * @param energyValue A block to return the device battery remaining energy percentage, ‘80’ stands for 80%.
31 * @param error A block to return the error in ‘Establish measurement connection’
32 */
33-(void)commandEnergy:(BlockEnergyValue)energyValue errorBlock:(BlockError)error;
34
35
36/**
37 * Upload offline data total Count.
38 * @param totalCount item quantity of total data.
39 * @param error A block to return the error.
40 */
41-(void)commandTransferMemoryTotalCount:(BlockBachCount)totalCount errorBlock:(BlockError)error;
42
43/**
44 * Upload offline data.
45 * @param totalCount item quantity of total data
46 * @param progress upload completion ratio , from 0.0 to 1.0 or 0%~100%, 100% means upload completed.
47 * @param uploadDataArray offline data set, including measurement time, systolic pressure, diastolic pressure, pulse rate, irregular judgment. corresponding KEYs are time, sys, dia, heartRate, irregular.
48 * @param error error codes.
49 * Specification:
50 * 1. BPError0 = 0: Unable to take measurements due to arm/wrist movements.
51 * 2. BPError1: Failed to detect systolic pressure.
52 * 3. BPError2: Failed to detect diastolic pressure.
53 * 4. BPError3: Pneumatic system blocked or cuff is too tight during inflation.
54 * 5. BPError4: Pneumatic system leakage or cuff is too loose during inflation.
55 * 6. BPError5: Cuff pressure reached over 300mmHg.
56 * 7. BPError6: Cuff pressure reached over 15 mmHg for more than 160 seconds.
57 * 8. BPError7: Data retrieving error.
58 * 9. BPError8: Data retrieving error.
59 * 10. BPError9: Data retrieving error.
60 * 11. BPError10: Data retrieving error.
61 * 12. BPError11: Communication Error.
62 * 13. BPError12: Communication Error.
63 * 14. BPError13: Low battery.
64 * 15. BPError14: Device bluetooth set failed.
65 * 16. BPError15: Systolic exceeds 260mmHg or diastolic exceeds 199mmHg.
66 * 17. BPError16: Systolic below 60mmHg or diastolic below 40mmHg.
67 * 18. BPError17: Arm/wrist movement beyond range.
68 * 19. BPNormalError=30: device error, error message displayed automatically.
69 * 20. BPOverTimeError: Abnormal communication.
70 * 21. BPNoRespondError: Abnormal communication.
71 * 22. BPBeyondRangeError: device is out of communication range.
72 * 23. BPDidDisconnect: device is disconnected.
73 * 24. BPAskToStopMeasure: measurement has been stopped.
74 * 25. BPInputParameterError=400: Parameter input error.
75 */
76-(void)commandTransferMemoryDataWithTotalCount:(BlockBachCount)totalCount progress:(BlockBachProgress)progress dataArray:(BlockBachArray)uploadDataArray errorBlock:(BlockError)error;
77
78/**
79 * Set units for the Device
80 * @param UnitName The unit name string that BP7S show result should use, must be @"mmHg" or @"kPa".
81 * @param setResult This block return means set success.
82 * @param error A block to return the error in set Unit communication.
83 */
84-(void)commandSetUnit:(NSString *)UnitName disposeSetReslut:(BlockSuccess)setResult errorBlock:(BlockError)error;
85
86
87/**
88 Set the effective angle range for left hand measurement and right hand measurement to the Device
89
90 @param angleInfo A dictionary set the max and mini effective angles for left hand measurement and right hand measurement,the angle values type is NSNumber, ranging from 0~90
91 with the four keys are:
92 @"highAngleForLeft", @"lowAngleForLeft", @"highAngleForRight", @"lowAngleForRight".
93 @param setResult This block return means set success.
94 @param error A block to return the error in set angles communication.
95 */
96-(void)commandSetAngle:(NSDictionary *)angleInfo disposeSetReslut:(BlockSuccess)setResult errorBlock:(BlockError)error;
97
98/**
99 * Disconnect current device
100 */
101-(void)commandDisconnectDevice;
102
103
104
105
106@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7SController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7SController.h
new file mode 100644
index 0000000..4ef86a1
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BP7SController.h
@@ -0,0 +1,32 @@
1//
2// BP7SController.h
3// testShareCommunication
4//
5// Created by my on 8/10/13.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BPController.h"
11
12/**
13 BP7S device controller class
14 */
15@interface BP7SController : BPController{
16 NSMutableArray *BP7SDeviceArray;
17}
18
19/**
20 * Initialize BP7S controller class
21 */
22+(BP7SController *)shareBP7SController;
23
24/**
25 * Get all BP7S instance,Access control class instance after receiving BP7SConnectNoti, then use instance to call BP7S related communication methods.
26 */
27-(NSArray *)getAllCurrentBP7SInstace;
28
29
30
31
32@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPAV10Device.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPAV10Device.h
new file mode 100644
index 0000000..7974ba0
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPAV10Device.h
@@ -0,0 +1,15 @@
1//
2// BPAV10Device.h
3// iHealthSDKStatic
4//
5// Created by Realank on 2017/7/24.
6// Copyright © 2017年 ihealthSDK. All rights reserved.
7//
8
9#import "BPBTLEDevice.h"
10/**
11 a subclass of BPBTLEDevice, which represent BP BTLE devices using BPAV10 protocol
12 */
13@interface BPAV10Device : BPBTLEDevice
14
15@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPBTLEDevice.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPBTLEDevice.h
new file mode 100644
index 0000000..01546d8
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPBTLEDevice.h
@@ -0,0 +1,17 @@
1//
2// BPBTLEDevice.h
3// iHealthSDKStatic
4//
5// Created by Realank on 2017/9/22.
6// Copyright © 2017年 ihealthSDK. All rights reserved.
7//
8
9#import "BPDevice.h"
10
11
12/**
13 a subclass of BP device, which represent BP BTLE devices
14 */
15@interface BPBTLEDevice : BPDevice
16
17@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPBV10Device.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPBV10Device.h
new file mode 100644
index 0000000..77b512f
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPBV10Device.h
@@ -0,0 +1,20 @@
1//
2// BPBV10Device.h
3// iHealthSDKStatic
4//
5// Created by Realank on 2017/9/26.
6// Copyright © 2017年 ihealthSDK. All rights reserved.
7//
8
9#import "BPV24Device.h"
10#import "BPLoopMeasureSettingModel.h"
11
12typedef void(^BlockAskIDString)(NSString* IDString);
13typedef void(^BlockAskLoopMeasureScheme)(BPLoopMeasureSettingResultModel* scheme);
14
15/**
16 a subclass of BPBTLEDevice, which represent BP BTLE devices using BPBV10 protocol
17 */
18@interface BPBV10Device : BPV24Device
19
20@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPContinua.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPContinua.h
new file mode 100644
index 0000000..3949cae
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPContinua.h
@@ -0,0 +1,56 @@
1//
2// BPContinua.h
3// testShareCommunication
4//
5// Created by zhiwei jing on 13-10-22.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "UIKit/UIKit.h"
11#import "BPDevice.h"
12
13 /**
14
15 BPContinua device class
16
17 */
18@interface BPContinua : BPDevice
19
20
21/**
22 * Upload offline data.
23 * @param uploadDataArray offline data set, including MAP, dataID, dia, heartRate, irregular, measureState, sys, time, unit, userId.
24 * @param completeBlock transfer memory complete
25 * @param error error codes.
26 * Specification:
27 */
28-(void)commandTransferMemoryDataWithDataArray:(BlockBachArray)uploadDataArray complete:(BlockSuccess)completeBlock errorBlock:(BlockError)error;
29
30
31/**
32 * Set the userID of memery data that need to upload
33 * @param userID The userID of memery data that want to upload.The userID is @1 or @2.
34 * @param setResult The result of setting userID,'YES'means success.
35 * @param error Error codes.
36 */
37-(void)commandSetUploadUserID:(NSNumber *)userID setUserIDBlock:(BlockSetUserID)setResult errorBlock:(BlockError)error;
38
39/**
40 * Synchronize time
41 */
42-(void)commandSynchronizeTime;
43
44/**
45 * Get Battery
46 * @param energyValue 0-100
47 * @param error Error codes.
48 */
49-(void)commandGetBattery:(BlockEnergyValue)energyValue errorBlock:(BlockError)error;
50
51/**
52 * Disconnect current device
53 */
54-(void)commandDisconnectDevice;
55
56@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPContinuaController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPContinuaController.h
new file mode 100644
index 0000000..2511f32
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPContinuaController.h
@@ -0,0 +1,30 @@
1//
2// BPContinuaController.h
3// testShareCommunication
4//
5// Created by zhiwei jing on 13-10-22.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BPContinua.h"
11#import "BPController.h"
12
13/**
14 BPContinua controller class
15 */
16@interface BPContinuaController : BPController{
17
18}
19
20/**
21 * Initialize contina BP controller class
22 */
23+(BPContinuaController *)sharedController;
24
25/**
26 * Get all ContinuaBP instance,Access control class instance after receiving ContinuaBPConnectNoti, then use instance to call ContinuaBP related communication methods.
27 */
28- (NSArray *)allConnectedInstance;
29
30@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPController.h
new file mode 100644
index 0000000..d706d39
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPController.h
@@ -0,0 +1,40 @@
1//
2// BPController.h
3// iHealthDemoCode
4//
5// Created by Realank on 2017/1/4.
6// Copyright © 2017年 ihealthSDK. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 BP Base Controller
13 */
14@interface BPController : NSObject{
15 //区分设备
16 NSString* deviceName;
17 NSString* deviceProtocol;
18 //发送通知
19 NSString* deviceConnectNotiName;
20 NSString* deviceDisconnectNotiName;
21 //创建实例
22 Class DeviceClass;
23}
24
25
26/**
27 Get BPController singleton instance
28
29 @return unique BPController instance
30 */
31-(instancetype) initUniqueInstance;
32
33/**
34 Get all BP instances,you can choose one instance to call BP related communication methods.
35
36 @return all connected BP instance
37 */
38-(NSArray *)allConnectedInstance;
39
40@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPDevice.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPDevice.h
new file mode 100644
index 0000000..8f7a96b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPDevice.h
@@ -0,0 +1,131 @@
1//
2// BPDevice.h
3// iHealthDemoCode
4//
5// Created by Realank on 2017/1/4.
6// Copyright © 2017年 ihealthSDK. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BPMacroFile.h"
11
12
13/**
14 a BP protocol related to realtime measure
15 */
16@protocol BPRealtimeMeasureProtocol <NSObject>
17
18/**
19 * Establish measurement connection and start BP measurement.
20 * @param blockZeroState Zeroing state
21 * @param pressure Pressure value in the process of measurement, the unit is ‘mmHg’.
22 * @param blockWaveletWithHeartbeat Wavelet data set including pulse rate
23 * @param blockWaveletWithoutHeartbeat Wavelet data set without pulse rate
24 * @param result result of the measurement, including systolic pressure, diastolic pressure, pulse rate and irregular judgment. Relevant key: time, sys, dia, heartRate, irregular. irregular will be 0 or 1.
25 * @param error Return error codes.
26 */
27-(void)commandStartMeasureWithZeroingState:(BlockZero)blockZeroState pressure:(BlockPressure)pressure waveletWithHeartbeat:(BlockWavelet)blockWaveletWithHeartbeat waveletWithoutHeartbeat:(BlockWavelet)blockWaveletWithoutHeartbeat result:(BlockMeasureResult)result errorBlock:(BlockError)error;
28
29/**
30 * stop measuring state of BP
31 * @param success The block return means measurement has been successfully stoped.
32 * @param error Return error codes.
33 */
34-(void)stopBPMeassureSuccessBlock:(BlockSuccess)success errorBlock:(BlockError)error;
35
36@end
37
38
39/**
40 a BP protocol related to offline data transfer
41 */
42@protocol BPOfflineDataTransferProtocol <NSObject>
43
44/**
45 * Upload offline data.
46 * @param totalCount quantity of total history data
47 * @param progress upload completion ratio , from 0.0 to 1.0, 1.0 means upload completed.
48 * @param uploadDataArray offline data set, may including measurement time, systolic pressure, diastolic pressure, pulse rate, irregular judgment,scheme ID, body movement flag. corresponding KEYs are time, sys, dia, heartRate, irregular,schemeID,bodyMovementFlg.
49 * @param error Return error codes.
50 */
51-(void)commandTransferMemoryDataWithTotalCount:(BlockBachCount)totalCount progress:(BlockBachProgress)progress dataArray:(BlockBachArray)uploadDataArray errorBlock:(BlockError)error;
52
53
54/**
55 * Upload offline data total Count.
56 * @param totalCount quantity of total history data.
57 * @param error Return error codes.
58 */
59-(void)commandTransferMemoryTotalCount:(BlockBachCount)totalCount errorBlock:(BlockError)error;
60
61-(void)commandDeleteDataSuccessBlock:(BlockSuccess)success errorBlock:(BlockError)error;
62
63@end
64
65
66/**
67 a BP protocol related to basic function, such as get function, get energy
68 */
69@protocol BPBasicProtocol <NSObject>
70
71/**
72 * Synchronize time and judge if the device supports BT auto-connection, offline detection, and if the function on or off, corresponding KEY are haveBlue, haveOffline, blueOpen, offlineOpen. ‘True’ means yes or on, ‘False’ means no or off
73 * @param function A block to return the function and states that the device supports.
74 * @param error Return error codes.
75 */
76-(void)commandFunction:(BlockDeviceFunction)function errorBlock:(BlockError)error;
77
78/**
79 * Get battery remaining energy by percent
80 * @param energyValue A block to return the device battery remaining energy percentage, ‘80’ stands for 80%.
81 * @param error Return error codes.
82 */
83-(void)commandEnergy:(BlockEnergyValue)energyValue errorBlock:(BlockError)error;
84
85@end
86
87
88/**
89 a BP protocol related to basic function and disconnect
90 */
91@protocol BPBasicBTLEProtocol <BPBasicProtocol>
92
93/**
94 * Disconnect current device
95 */
96-(void)commandDisconnectDevice;
97
98@end
99
100
101/**
102 a BP protocol related to enable offline
103 */
104@protocol BPEnableOfflineProtocol <BPBasicProtocol>
105
106/**
107 * set up offline detection
108 * @param open True means on; False means off.
109 * @param successBlock A block to refer ‘set success’.
110 * @param errorBlock A block to refer ‘set failed’.
111 */
112-(void)commandSetOffline:(BOOL)open success:(BlockSuccess)successBlock error:(BlockError)errorBlock;
113
114@end
115
116
117/**
118 BP device basic class
119 */
120@interface BPDevice : NSObject
121
122@property (copy, nonatomic) NSString *currentUUID;
123///‘serialNumber’ is for separating different device when multiple device have been connected.
124@property (copy, nonatomic) NSString *serialNumber;
125@property (copy, nonatomic) NSString *firmwareVersion;
126@property (copy, nonatomic) NSString *hardwareVersion;
127@property (copy, nonatomic) NSString *deviceName;
128@property (copy, nonatomic) NSString *protocolString;
129@property (copy, nonatomic) NSString *modelNumber;
130@property (copy, nonatomic) NSNumber *isNew550BT;
131@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPHeader.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPHeader.h
new file mode 100644
index 0000000..df61d1f
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPHeader.h
@@ -0,0 +1,54 @@
1//
2// BPHeader.h
3// BP_SDKDemo
4//
5// Created by zhiwei jing on 14-2-28.
6// Copyright (c) 2014年 zhiwei jing. All rights reserved.
7//
8
9#ifndef BP_SDKDemo_BPHeader_h
10#define BP_SDKDemo_BPHeader_h
11
12#import "BPController.h"
13#import "BPDevice.h"
14
15#import "BP5Controller.h"
16#import "BP5.h"
17
18#import "BP3.h"
19#import "BP3Controller.h"
20
21#import "BP3L.h"
22#import "BP3LController.h"
23
24#import "BP7Controller.h"
25#import "BP7.h"
26
27#import "BP7SController.h"
28#import "BP7S.h"
29
30#import "KN550BT.h"
31#import "KN550BTController.h"
32
33#import "BPMacroFile.h"
34#import "HealthUser.h"
35
36#import "ABI.h"
37#import "ABIController.h"
38
39#import "ABPM.h"
40#import "ABPMController.h"
41
42#import "BPContinua.h"
43#import "BPContinuaController.h"
44
45#import "BP5S.h"
46#import "BP5SController.h"
47
48#import "BP5SRW.h"
49#import "BP5SRWController.h"
50
51#import "BP5C.h"
52#import "BP5CController.h"
53
54#endif
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPLoopMeasureSettingModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPLoopMeasureSettingModel.h
new file mode 100644
index 0000000..ea0e177
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPLoopMeasureSettingModel.h
@@ -0,0 +1,120 @@
1//
2// BPLoopMeasureSettingModel.h
3// iHealthSDKStatic
4//
5// Created by Realank on 2017/9/27.
6// Copyright © 2017年 ihealthSDK. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11
12/**
13 ABPM loop remeasure method
14
15 - BPLoopRemeasureNO: don't remeasure
16 - BPLoopRemeasure90Sec: 90 seconds remeasure
17 - BPLoopRemeasure90Sec10Min: 90 seconds and 10 minutes remeasure
18 */
19typedef NS_ENUM(NSUInteger, BPLoopRemeasureMethod) {
20 BPLoopRemeasureNO = 0x00,
21 BPLoopRemeasure90Sec = 0x01,
22 BPLoopRemeasure90Sec10Min = 0x03,
23};
24
25
26/**
27 ABPM loop measure time setting model
28 */
29@interface BPLoopMeasureTimeSetting : NSObject
30@property (nonatomic, assign) NSUInteger hour;
31@property (nonatomic, assign) NSUInteger min;
32@property (nonatomic, assign) NSUInteger measureIntervalInMin;
33@property (nonatomic, assign) BOOL before5MinViberateAlert;
34@property (nonatomic, assign) BOOL before5MinSoundAlert;
35@property (nonatomic, assign) BOOL before30SecViberateAlert;
36@property (nonatomic, assign) BOOL before30SecSoundAlert;
37@property (nonatomic, assign) BPLoopRemeasureMethod remeasureMethods;
38
39+ (instancetype) modelWithHour:(NSUInteger)hour
40 min:(NSUInteger)min
41 measureIntervalInMin:(NSUInteger)measureIntervalInMin
42 before5MinViberateAlert:(BOOL)before5MinViberateAlert
43 before5MinSoundAlert:(BOOL)before5MinSoundAlert
44 before30SecViberateAlert:(BOOL)before30SecViberateAlert
45 before30SecSoundAlert:(BOOL)before30SecSoundAlert
46 remeasureMethod:(BPLoopRemeasureMethod)remeasureMethod;
47
48+(instancetype) alloc __attribute__((unavailable("alloc not available, call sharedInstance instead")));
49-(instancetype) init __attribute__((unavailable("init not available, call sharedInstance instead")));
50+(instancetype) new __attribute__((unavailable("new not available, call sharedInstance instead")));
51
52@end
53
54
55/**
56 ABPM loop measure setting model
57 */
58@interface BPLoopMeasureSettingModel : NSObject
59
60@property (nonatomic, assign) BOOL isTakeMedicine;
61@property (nonatomic, assign) uint8_t measureHours;
62@property (nonatomic, strong) BPLoopMeasureTimeSetting* morningTimeSetting;
63@property (nonatomic, strong) BPLoopMeasureTimeSetting* nightTimeSetting;
64@property (nonatomic, strong) BPLoopMeasureTimeSetting* noonSleepTimeSetting;
65@property (nonatomic, strong) BPLoopMeasureTimeSetting* noonWakeupTimeSetting;
66
67+ (instancetype)modelWithTakeMedicine:(BOOL)isTakeMedicine
68 measureHours:(uint8_t)measureHours
69 morningTimeSetting:(BPLoopMeasureTimeSetting*)morningTimeSetting
70 nightTimeSetting:(BPLoopMeasureTimeSetting*)nightTimeSetting
71 noonSleepTimeSetting:(BPLoopMeasureTimeSetting*)noonSleepTimeSetting
72 noonWakeupTimeSetting:(BPLoopMeasureTimeSetting*)noonWakeupTimeSetting;
73
74+(instancetype) alloc __attribute__((unavailable("alloc not available, call sharedInstance instead")));
75-(instancetype) init __attribute__((unavailable("init not available, call sharedInstance instead")));
76+(instancetype) new __attribute__((unavailable("new not available, call sharedInstance instead")));
77
78
79@end
80
81
82/**
83 ABPM loop measure status
84
85 - BPLoopMeasureStateNoScheme: don't have scheme
86 - BPLoopMeasureStateSchemeUncompleted: scheme not completed
87 - BPLoopMeasureStateSchemeCompleted: scheme has been completed
88 */
89typedef NS_ENUM(NSUInteger, BPLoopMeasureStatus) {
90 BPLoopMeasureStateNoScheme,
91 BPLoopMeasureStateSchemeUncompleted,
92 BPLoopMeasureStateSchemeCompleted,
93};
94
95
96
97/**
98 ABPM loop measure setting result model
99 */
100@interface BPLoopMeasureSettingResultModel : BPLoopMeasureSettingModel
101
102@property (nonatomic, assign) BPLoopMeasureStatus loopMeasureStatus;
103@property (nonatomic, strong) NSDate* realStartDate;
104@property (nonatomic, assign) NSInteger realStartDateTimeZoneInMin;
105
106+ (instancetype)modelWithLoopMeasureStatus:(BPLoopMeasureStatus)loopMeasureStatus
107 TakeMedicine:(BOOL)isTakeMedicine
108 measureHours:(uint8_t)measureHours
109 realStartDate:(NSDate*)realStartDate
110 realStartDateTimeZoneInMin:(NSInteger)realStartDateTimeZoneInMin
111 morningTimeSetting:(BPLoopMeasureTimeSetting*)morningTimeSetting
112 nightTimeSetting:(BPLoopMeasureTimeSetting*)nightTimeSetting
113 noonSleepTimeSetting:(BPLoopMeasureTimeSetting*)noonSleepTimeSetting
114 noonWakeupTimeSetting:(BPLoopMeasureTimeSetting*)noonWakeupTimeSetting;
115
116+(instancetype) alloc __attribute__((unavailable("alloc not available, call sharedInstance instead")));
117-(instancetype) init __attribute__((unavailable("init not available, call sharedInstance instead")));
118+(instancetype) new __attribute__((unavailable("new not available, call sharedInstance instead")));
119
120@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPM1AE.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPM1AE.h
new file mode 100644
index 0000000..4027742
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPM1AE.h
@@ -0,0 +1,80 @@
1//
2// BPM1AE.h
3// iHealthDemoCode
4//
5// Created by XuJianbo on 16/8/18.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11typedef NS_ENUM(NSUInteger, WifiSetWifiError) {
12 WifiDidDisconnect=0,//下位机断开
13 WifiOverTimeError,//超时
14 WifiParameterInputWrong=400,//输入参数错误
15};
16
17
18typedef void(^BlockWifiError)(WifiSetWifiError error);
19typedef void(^BlockWifiSetSuccess)(NSNumber *waitFlg);
20typedef void(^BlockWifiConnectState)(void);
21typedef void(^BlockWifiInfoDictionary) (NSDictionary *dict);
22
23
24#define Wifi_SSID @"Wifi_SSID"
25#define Wifi_Channel @"Wifi_Channel"
26#define Wifi_Security @"Wifi_Security"
27#define Wifi_RSSI @"Wifi_RSSI"
28
29
30
31/**
32 BPM1AE device class
33 */
34@interface BPM1AE : NSObject
35
36
37/**
38 *Start search the UDP access point device.
39 * @param wifiIDPSDic A block return the IDPS of the connected wifi Device.
40 * @param error This block will be invoked when error occurs.
41 * Specification:
42 * 1. WifiDidDisconnect: Socket connection disconnected.
43 * 2. WifiOverTimeError: Command time out.
44 * 3. WifiParameterInputWrong: Input wrong parameter(s).
45 */
46-(void)commandStartSearchDeviceGetIDPS:(BlockWifiInfoDictionary)wifiIDPSDic blockError:(BlockWifiError)error;
47/**
48 *Start search the UDP access point device.
49 * @param blockWifiArrayDic The block return a dictionary which contains the wifi list and the wifi count that the device scan.
50 * @param error This block will be invoked when error occurs.
51 * Specification:
52 * 1. WifiDidDisconnect: Socket connection disconnected.
53 * 2. WifiOverTimeError: Command time out.
54 * 3. WifiParameterInputWrong: Input wrong parameter(s).
55 */
56-(void)commandGetWifiArrayDictionary:(BlockWifiInfoDictionary)blockWifiArrayDic blockError:(BlockWifiError)error;
57
58/**
59 *Send wifi name and password to the device and return the connect status of the device.
60 * @param wifiName wifiname
61 * @param password wifiName,password are the information of the wifi that selected to connect.
62 * @param phoneIDStr The unique device ID of the current iPhone,iTouch or iPad.
63 * @param urlStr a service URL, to where the AP device send the wifi connect status.
64 * @param setResult The block return means set success, containing a flg to show whether need to wait the 'stepAndStateDic', @1 means need,@0 means not.
65 * @param stepAndStateDic The block return a dictionary which contains the connection step and the connection status.
66 * @param error This block will be invoked when error occurs.
67 * Specification:
68 * 1. WifiDidDisconnect: Socket connection disconnected.
69 * 2. WifiOverTimeError: Command time out.
70 * 3. WifiParameterInputWrong: Input wrong parameter(s).
71 */
72-(void)commandSendWifiName:(NSString*)wifiName password:(NSString *) password phoneID:(NSString *)phoneIDStr withURL:(NSString *)urlStr setResult:(BlockWifiSetSuccess)setResult blockConnectState:(BlockWifiInfoDictionary)stepAndStateDic blockError:(BlockWifiError)error;
73
74
75/**
76 Disconnect current socket
77 */
78- (void)disconnect;
79
80@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPMacroFile.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPMacroFile.h
new file mode 100644
index 0000000..aea3dcd
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPMacroFile.h
@@ -0,0 +1,247 @@
1//
2// BPMacroFile.h
3// BP_SDKDemo
4//
5// Created by zhiwei jing on 14-2-25.
6// Copyright (c) 2014年 zhiwei jing. All rights reserved.
7//
8
9
10
11#ifndef BP_SDKDemo_BPMacroFile_h
12#define BP_SDKDemo_BPMacroFile_h
13
14#import "HealthUser.h"
15#import "BPController.h"
16
17/**
18 BP error code
19 */
20typedef NS_ENUM(NSUInteger, BPDeviceError) {
21 /// Unable to take measurements due to arm/wrist movements.
22 BPError0 = 0,
23 /// Failed to detect systolic pressure
24 BPError1,
25 /// Failed to detect diastolic pressure
26 BPError2,
27 /// Pneumatic system blocked or cuff is too tight during inflation
28 BPError3,
29 /// Pneumatic system leakage or cuff is too loose during inflation
30 BPError4,
31 /// Cuff pressure reached over 300mmHg
32 BPError5,
33 /// Cuff pressure reached over 15 mmHg for more than 160 seconds
34 BPError6,
35 /// Data retrieving error
36 BPError7,
37 /// Data retrieving error
38 BPError8,
39 /// Data retrieving error
40 BPError9,
41 /// Data retrieving error
42 BPError10,
43 /// Communication Error
44 BPError11,
45 /// Communication Error
46 BPError12,
47 /// Low battery
48 BPError13,
49 /// Device bluetooth set failed
50 BPError14,
51 /// Systolic exceeds 260mmHg or diastolic exceeds 199mmHg
52 BPError15,
53 /// Systolic below 60mmHg or diastolic below 40mmHg
54 BPError16,
55 /// Arm/wrist movement beyond range
56 BPError17,
57 /// Heart rate in measure result exceeds max limit
58 BPError18,
59 /// Heart rate in measure result exceeds min limit
60 BPError19,
61 /// PP(Average BP) exceeds limit
62 BPError20,
63 /// User stop measure(for ABPM history measurement only)
64 BPErrorUserStopMeasure,
65 /// device error, error message displayed automatically
66 BPNormalError = 30,
67 /// Abnormal communication
68 BPOverTimeError,
69 /// Abnormal communication
70 BPNoRespondError,
71 /// device is out of communication range.
72 BPBeyondRangeError,
73 /// device is disconnected.
74 BPDidDisconnect,
75 /// measurement has been stopped.
76 BPAskToStopMeasure,
77 /// 36 device is busy doing other things
78 BPDeviceBusy,
79 /// Parameter input error.
80 BPInputParameterError = 400,
81 /// Parameter input error.
82 BPInvalidOperation = 402,
83};
84
85
86typedef void(^BlockEnergyDetailValue)(NSNumber *energyValue,NSNumber *mVolt, NSNumber* measureTimesLeft);
87typedef void(^BlockEnergyValue)(NSNumber *energyValue);
88typedef void(^BlockEnergyState)(NSNumber *energyState);
89typedef void(^BlockError)(BPDeviceError error);
90typedef void(^BlockDeviceFunction)(NSDictionary *functionDict);
91typedef void(^BlockBlueSet)(BOOL isOpen);
92typedef void(^BlockAngle)(NSDictionary *angleDict);
93typedef void(^BlockPressure)(NSArray *pressureArr);
94typedef void(^BlockWavelet)(NSArray *waveletArr);
95typedef void(^BlockZero)(BOOL isComplete);
96typedef void(^BlockMeasureResult)(NSDictionary *resultDict);
97
98typedef void(^BlockBachCount)(NSNumber *count);
99typedef void(^BlockBachProgress)(NSNumber *progressValue);
100typedef void(^BlockBachArray)(NSArray *bachArray);
101typedef void(^BlockBachFinished)(BOOL finishFlag);
102
103typedef void(^BlockAskMeasureTime)(NSDictionary *measureTimeDict);//Deprecated
104typedef void(^BlockSetMeasureTime)(NSDictionary *setResult);//Deprecated
105
106typedef void(^BlockSuccess)(void);
107
108typedef void(^BlockUserAuthentication)(UserAuthenResult result);//the result of userID verification
109typedef void(^BlockSetUserID)(BOOL finishFlag);
110
111typedef void(^BlockResult)(BOOL result);
112
113typedef void(^BlockRedWaveDic)(NSDictionary *redWaveDict);
114
115typedef void(^BlockMeasureStatus)(NSDictionary *statusDict);
116
117typedef void(^BlockDisplayStatus)(NSDictionary *statusDict);
118
119
120#define BP3ConnectNoti @"BP3ConnectNoti"
121#define BP3DisConnectNoti @"BP3DisConnectNoti"
122#define BP5ConnectNoti @"BP5ConnectNoti"
123#define BP5DisConnectNoti @"BP5DisConnectNoti"
124#define BP7ConnectNoti @"BP7ConnectNoti"
125#define BP7DisConnectNoti @"BP7DisConnectNoti"
126
127#define BP3LDiscover @"BP3LDiscover"
128#define BP3LConnectFailed @"BP3LConnectFailed"
129#define BP3LConnectNoti @"BP3LConnectNoti"
130#define BP3LDisConnectNoti @"BP3LDisConnectNoti"
131
132#define BP5SDiscover @"BP5SDiscover"
133#define BP5SConnectFailed @"BP5SConnectFailed"
134#define BP5SConnectNoti @"BP5SConnectNoti"
135#define BP5SDisConnectNoti @"BP5SDisConnectNoti"
136
137#define BP5SRWDiscover @"BP5SRWDiscover"
138#define BP5SRWConnectFailed @"BP5SRWConnectFailed"
139#define BP5SRWConnectNoti @"BP5SRWConnectNoti"
140#define BP5SRWDisConnectNoti @"BP5SRWDisConnectNoti"
141
142#define BP7SDiscover @"BP7SDiscover"
143#define BP7SConnectFailed @"BP7SConnectFailed"
144#define BP7SConnectNoti @"BP7SConnectNoti"
145#define BP7SDisConnectNoti @"BP7SDisConnectNoti"
146
147#define KN550BTDiscover @"KN550BTDiscover"
148#define KN550BTConnectFailed @"KN550BTConnectFailed"
149#define KN550BTConnectNoti @"KN550BTConnectNoti"
150#define KN550BTDisConnectNoti @"KN550BTDisConnectNoti"
151
152#define KD926Discover @"KD926Discover"
153#define KD926ConnectFailed @"KD926ConnectFailed"
154#define KD926ConnectNoti @"KD926ConnectNoti"
155#define KD926DisConnectNoti @"KD926DisConnectNoti"
156
157#define KD723Discover @"KD723Discover"
158#define KD723ConnectFailed @"KD723ConnectFailed"
159#define KD723ConnectNoti @"KD723ConnectNoti"
160#define KD723DisConnectNoti @"KD723DisConnectNoti"
161
162#define ABPMDiscover @"ABPMDiscover"
163#define ABPMConnectFailed @"ABPMConnectFailed"
164#define ABPMConnectNoti @"ABPMConnectNoti"
165#define ABPMDisConnectNoti @"ABPMDisConnectNoti"
166
167#define BP5CDiscover @"BP5CDiscover"
168#define BP5CConnectFailed @"BP5CConnectFailed"
169#define BP5CConnectNoti @"BP5CConnectNoti"
170#define BP5CDisConnectNoti @"BP5CDisConnectNoti"
171
172#define ContinuaBPDiscover @"ContinuaBPDiscover"
173#define ContinuaBPConnectFailed @"ContinuaBPConnectFailed"
174#define ContinuaBPConnectNoti @"ContinuaBPConnectNoti"
175#define ContinuaBPDisConnectNoti @"ContinuaBPDisConnectNoti"
176
177#define ABIConnectNoti @"ABIConnectNoti"
178#define ABIDisConnectNoti @"ABIDisConnectNoti"
179#define ArmKey @"ABI-ARM"
180#define LegKey @"ABI-Leg"
181#define ArmConnectNoti @"ArmConnectNoti"
182#define ArmDisConnectNoti @"ArmDisConnectNoti"
183
184//#define BPDeviceID @"ID"
185//#define BPSDKRightApi @"OpenApiBP"
186
187//result
188#define kResultBPSYS @"sys"
189#define kResultBPDIA @"dia"
190#define kResultBPPulse @"heartRate"
191#define kResultBPIHB @"irregular"
192#define kResultBPHSD @"hsdValue"
193#define kResultBPChooseHand @"chooseHand"
194#define kResultBPBodyMove @"bodyMovement"
195#define kResultBPStartAngle @"startAngle"
196#define kResultBPAngleChange @"measureAngleChange"
197#define kResultBPDataID @"dataID"
198#define kResultBPMeasureDate @"time"
199#define kResultBPMeasureDateTimeZoneInMin @"timeZoneInMin"
200#define kResultBPSchemeID @"schemeID"
201#define kResultBPHistoryIndex @"historyIndex"
202#define kResultBPUnit @"unit"
203
204#define kResultBPIsAutoMeasure @"isAutoMeasure"
205#define kResultBPRemeasureMode @"remeasureMode"
206#define kResultBPHasRawPressure @"hasRawPressure"
207#define kResultBPStartMeasureAngle @"startMeasureAngle"
208#define kResultBPMeasureAngleDelta @"measureAngleDelta"
209#define kResultBPIsMeasureResultFailed @"isMeasureResultFailed"
210#define kResultBPMeasureResultErrorCode @"measureResultErrorCode"
211#define kResultBPMeasureResultRawPressure @"measureResultRawPressure"
212#define kResultBPActivityStrengthList @"activityStrengthList"
213#define kResultBPActivityStrengthLevel @"level"
214#define kResultBPActivityStrengthAngle @"angle"
215#define kResultBPActivityStrengthIsSleeping @"isSleeping"
216
217//function
218#define kFunctionBPUpAirMeasure @"upAirMeasureFlg"
219#define kFunctionBPArmMeasure @"armMeasureFlg"
220#define kFunctionBPHaveAngleSensor @"haveAngleSensor"
221#define kFunctionBPSupportPowerOff @"havePowerOff"
222#define kFunctionBPSupportOffline @"haveOffline"
223#define kFunctionBPSupportClearMemory @"haveClearMemory"
224#define kFunctionBPSupportBTConnectBack @"haveBlue"
225#define kFunctionBPBTConnectBackOpen @"blueOpen"
226#define kFunctionBPOfflineOpen @"offlineOpen"
227#define kFunctionBPHaveHSD @"haveHSD"
228#define kFunctionBPHaveAngleSet @"haveAngleSet"
229#define kFunctionBPAutoLoopMeasureModel @"autoLoopMeasureModel"
230#define kFunctionBPAutoConnect @"autoConnect"
231#define kFunctionBPReConnectSwitch @"reConnectSwitch"
232#define kFunctionBPhasOfflineSetingFlg @"offlineSetingFlg"
233#define kFunctionBPofflineMeasureFlg @"offlineMeasureFlg"
234#define kFunctionBPbtfunctionFlg @"btfunctionFlg"
235
236#define kFunctionBPSupportUnitSetting @"hasUnitSetting"
237#define kFunctionBPCurrentUnitIsKPa @"unitKPa"
238#define kFunctionBPMutableUpload @"mutableUpload"
239#define kFunctionBPDFU @"selfUpdate"
240#define kFunctionBPSupportMoveDetect @"hasMoveDetect"
241#define kFunctionBPSupportAlertSetting @"hasAlertSetting"
242#define kFunctionBPSupportRawPressure @"hasRawPressure"
243#define kFunctionBPRawPressureFormat @"rowPressureFormat"
244#define kFunctionBPBackLightControl @"haveBackLightSetting"
245#define kFunctionBPClockDisplayControl @"haveClockShowSetting"
246#define kFunctionBPMaxHistoryCount @"maxHistoryCount"
247#endif
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPV24Device.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPV24Device.h
new file mode 100644
index 0000000..1b79f16
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPV24Device.h
@@ -0,0 +1,16 @@
1//
2// BPV2xDevice.h
3// iHealthSDKStatic
4//
5// Created by Realank on 2017/7/14.
6// Copyright © 2017年 ihealthSDK. All rights reserved.
7//
8
9#import "BPBTLEDevice.h"
10
11/**
12 a subclass of BPBTLEDevice, which represent BP BTLE devices using BPV24 protocol
13 */
14@interface BPV24Device : BPBTLEDevice
15
16@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPV25Device.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPV25Device.h
new file mode 100644
index 0000000..df34ce7
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/BPV25Device.h
@@ -0,0 +1,17 @@
1//
2// BPV25Device.h
3// iHealthSDKStatic
4//
5// Created by jing on 2018/7/18.
6// Copyright © 2018年 ihealthSDK. All rights reserved.
7//
8
9#import "BPBTLEDevice.h"
10
11/**
12 a subclass of BPBTLEDevice, which represent BP BTLE devices using BPV25 protocol
13 */
14
15@interface BPV25Device : BPBTLEDevice
16
17@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ConnectDeviceController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ConnectDeviceController.h
new file mode 100644
index 0000000..d29e9cc
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ConnectDeviceController.h
@@ -0,0 +1,27 @@
1//
2// ConnectDeviceController.h
3// iHealthDemoCode
4//
5// Created by zhiwei jing on 1/24/16.
6// Copyright © 2016 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "HealthHeader.h"
11
12/**
13 ConnectDeviceController
14 */
15@interface ConnectDeviceController : NSObject
16
17+(ConnectDeviceController *)commandGetInstance;
18
19
20/**
21 * Connect iHealth device with bluretooth low energy
22 * @param tempDeviceType iHealth DeviceType
23 * @param tempSerialNub iHealth device serialNub or deviceID, you can get it from [ScanDeviceController commandScanDeviceType].
24 */
25-(int)commandContectDeviceWithDeviceType:(HealthDeviceType)tempDeviceType andSerialNub:(NSString *)tempSerialNub;
26
27@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUController.h
new file mode 100644
index 0000000..57dace4
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUController.h
@@ -0,0 +1,160 @@
1//
2// DFUController.h
3// iHealthSDKStatic
4//
5// Created by Lei Bao on 2017/7/17.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "DFUMacro.h"
11/**
12 DFU Controller
13 */
14@interface DFUController : NSObject
15
16/**
17 Get instance
18
19 @return DFUController object
20 */
21+ (instancetype)shareInstance;
22
23/**
24 Query device firmware information in Flash
25
26 @param deviceType DFUDeviceType enum
27 @param uuid device UUID
28 @param successBlock success block
29 @param errorBlock DFUError enum(DFUError_InUpgradeCannotExecuteCommand,DFUError_UnsupportedDeviceType,DFUError_InvalidUUID,DFUError_NoConnectedDevice,DFUError_CommandTimeOut,DFUError_DeviceDisconnect)
30 @note The method should be called when device is connected.
31 */
32- (void)queryDeviceFirmwareInfoWithDeviceType:(DFUDeviceType)deviceType
33 uuid:(NSString *)uuid
34 successBlock:(QueryDeviceFirmwareInfoSuccessBlock)successBlock
35 errorBlock:(DFUErrorBlock)errorBlock;
36
37/**
38 Query the latest firmware information from server
39
40 @param deviceType DFUDeviceType enum
41 @param productModel Model Number(you can get from IDPS or device object's property)
42 @param currentFirmwareVersion current firmware version (you can get from IDPS or device object's property)
43 @param hardwareVersion hardware version (you can get from IDPS or device object's property)
44 @param successBlock success block
45 @param errorBlock DFUError enum(DFUError_UnsupportedDeviceType,DFUError_InvalidFirmwareVersion,DFUError_InvalidHardwareVersion,DFUError_NetworkError,DFUError_ServerError)
46 @note No need to connect but IDPS should be known.
47 */
48- (void)queryServerFirmwareInfoWithDeviceType:(DFUDeviceType)deviceType
49 productModel:(NSString *)productModel
50 currentFirmwareVersion:(NSString *)currentFirmwareVersion
51 hardwareVersion:(NSString *)hardwareVersion
52 successBlock:(QueryServerFirmwareInfoSuccessBlock)successBlock
53 errorBlock:(DFUErrorBlock)errorBlock;
54
55
56/**
57 Download firmware file
58
59 @param deviceType DFUDeviceType enum
60 @param productModel Model Number(you can get from IDPS or device object's property)
61 @param firmwareVersion firmware version you want to download (the latest version you can get from "queryServerFirmwareInfoWithDeviceType:")
62 @param hardwareVersion hardware version (you can get from IDPS or device object's property)
63 @param startBlock download start block
64 @param downloadFirmwareProgressBlock download progress block [0-100]
65 @param successBlock success block (firmwareIdentifier is used to in "startUpgradeWithDeviceType:")
66 @param errorBlock DFUError enum(DFUError_UnsupportedDeviceType,DFUError_InvalidFirmwareVersion,DFUError_InvalidHardwareVersion,DFUError_FileSaveError,DFUError_NetworkError,DFUError_ServerError,DFUError_RequestedFileNotExist,DFUError_InfoFileCheckNotPass,DFUError_firmwareFileCheckNotPass)
67 */
68- (void)downloadFirmwareWithDeviceType:(DFUDeviceType)deviceType
69 productModel:(NSString *)productModel
70 firmwareVersion:(NSString *)firmwareVersion
71 hardwareVersion:(NSString *)hardwareVersion
72 downloadStartBlock:(DownloadFirmwareStartBlock)startBlock
73 downloadFirmwareProgressBlock:(DownloadFirmwareProgressBlock)downloadFirmwareProgressBlock
74 successblock:(DownloadFirmwareSuccessBlock)successBlock
75 errorBlock:(DFUErrorBlock)errorBlock;
76
77
78/**
79 Cancel downloading firmware file
80
81 @param deviceType DFUDeviceType enum
82 @param successBlock success block
83
84 */
85- (void)cancelDownloadFirmwareWithDeviceType:(DFUDeviceType)deviceType
86 successBlock:(CancelDownloadFirmwareSuccessBlock)successBlock;
87
88/**
89 Start update
90
91 @param deviceType DFUDeviceType enum
92 @param productModel Model Number(you can get from IDPS or device object's property)
93 @param uuid device UUID
94 @param firmwareIdentifier firmware identifier
95 @param firmwareVersion destination firmware version
96 @param hardwareVersion hardware version (you can get from IDPS or device object's property)
97 @param deviceReplyCannotUpgradeBlock cannot upgrade and return reason
98 @param transferBeginBlock transfer begin
99 @param transferProgressBlock transfer progress block [0-100]
100 @param transferSuccessBlock transfer success block (return write MCU speed, unit:Byte/s, only support AM3S,AM4,PO3,HS2,HS4,ECG)
101 @param transferResultBlock transfer result block (return result type, pasue reason, pause length,only support BG5S,BP5S,ABPM)
102 @param upgradeSuccessBlock upgrade success block(only support AM3)
103 @param upgradeFailBlock upgrade fail block
104 @param upgradeErrorBlock upgrade error blcok (DFUError enum(DFUError_InUpgradeCannotExecuteCommand,DFUError_UnsupportedDeviceType,DFUError_InvalidUUID,DFUError_NoConnectedDevice,DFUError_NoFirmwareFile,DFUError_InvalidFirmwareInfoFile,DFUError_CommandTimeOut,DFUError_DeviceDisconnect))
105 */
106- (void)startUpgradeWithDeviceType:(DFUDeviceType)deviceType
107 productModel:(NSString *)productModel
108 uuid:(NSString *)uuid
109 firmwareVersion:(NSString *)firmwareVersion
110 hardwareVersion:(NSString *)hardwareVersion
111 firmwareIdentifier:(NSString *)firmwareIdentifier
112 deviceReplyCannotUpgradeBlock:(DeviceReplyCannotUpgradeBlock)deviceReplyCannotUpgradeBlock
113 transferBeginBlock:(TransferBeginBlock)transferBeginBlock
114 transferProgressBlock:(TransferProgressBlock)transferProgressBlock
115 transferSuccessBlock:(TransferSuccessBlock)transferSuccessBlock
116 transferResultBlock:(TransferResultBlock)transferResultBlock
117 upgradeSuccessBlock:(UpgradeSuccessBlock)upgradeSuccessBlock
118 upgradeFailBlock:(UpgradeFailBlock)upgradeFailBlock
119 upgradeErrorBlock:(DFUErrorBlock)upgradeErrorBlock;
120
121/**
122 Stop update
123
124 @param deviceType DFUDeviceType enum
125 @param uuid device UUID
126 @param successBlock success block
127 @param failBlock fail block, DFUError enum:(DFUError_UnsupportedDeviceType,DFUError_InvalidUUID,DFUError_CommandTimeOut)
128 */
129- (void)stopUpgradeWithDeviceType:(DFUDeviceType)deviceType
130 uuid:(NSString *)uuid
131 successBlock:(StopUpgradeSuccessBlock)successBlock
132 failBlock:(DFUErrorBlock)failBlock;
133
134/**
135 Delete firmware file
136
137 @param firmwareIdentifier firmware identifier
138 @param successBlock success block
139 @param errorBlock error block DFUError enum:DFUError_DeleteError
140 */
141- (void)deleteFirmwareWithIdentifier:(NSString *)firmwareIdentifier
142 successBlock:(DeleteFirmwareSuccessBlock)successBlock
143 errorBlock:(DFUErrorBlock)errorBlock;
144
145/**
146 Query DFU state
147
148 @return Busy or Free
149 */
150- (DFUState)queryDFUState;
151
152/**
153 Query Device UUID in updating
154
155 @return Device UUID
156 */
157- (NSString *)UUIDInDFU;
158
159- (void)openSesame:(NSInteger)number;
160@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUDeviceFirmwareInfo.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUDeviceFirmwareInfo.h
new file mode 100644
index 0000000..a33e67e
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUDeviceFirmwareInfo.h
@@ -0,0 +1,56 @@
1//
2// DFUDeviceFirmwareInfo.h
3// iHealthSDKStatic
4//
5// Created by Lei Bao on 2017/7/17.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "DFUMacro.h"
11/**
12 Firmware information from device flash
13 */
14@interface DFUDeviceFirmwareInfo : NSObject
15/**
16 Device UUID
17 */
18@property (copy, nonatomic, readonly) NSString *UUID;
19/**
20 DFUDeviceType
21 */
22@property (assign, nonatomic, readonly) DFUDeviceType deviceType;
23
24/**
25 Model Number
26 */
27@property (copy, nonatomic, readonly) NSString *deviceModel;
28
29/**
30 Hardware version
31 */
32@property (copy, nonatomic, readonly) NSString *hardwareVersion;
33
34/**
35 Firmware version in Flash
36 */
37@property (copy, nonatomic, readonly) NSString *firmwareVersion;
38
39/**
40 YES:allow;NO:not allow
41 */
42@property (assign, nonatomic, readonly) BOOL canUpgrade;
43
44/**
45 Continue to transfer or not
46 */
47@property (assign, nonatomic, readonly) BOOL isContinue;
48
49/**
50 1:update no need to disconnect 2:update need to disconnect
51 */
52@property (assign, nonatomic, readonly) NSInteger upgradeMethod;
53
54+ (instancetype)infoWithData:(uint8_t [])buf deviceType:(DFUDeviceType)deviceType deviceUUID:(NSString *)uuid;
55
56@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUHeader.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUHeader.h
new file mode 100644
index 0000000..7ac9450
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUHeader.h
@@ -0,0 +1,19 @@
1//
2// DFUHeader.h
3// iHealthSDKStatic
4//
5// Created by Lei Bao on 2017/7/17.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#ifndef DFUHeader_h
10#define DFUHeader_h
11
12#import "DFUController.h"
13#import "DFUDeviceFirmwareInfo.h"
14#import "DFUServerFirmwareInfo.h"
15
16
17
18
19#endif /* DFUHeader_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUMacro.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUMacro.h
new file mode 100644
index 0000000..4848ad9
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUMacro.h
@@ -0,0 +1,264 @@
1//
2// DFUMacro.h
3// iHealthSDKStatic
4//
5// Created by Lei Bao on 2017/7/18.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#ifndef DFUMacro_h
10#define DFUMacro_h
11
12@class DFUDeviceFirmwareInfo;
13@class DFUServerFirmwareInfo;
14
15/**
16 DFU error code
17 */
18typedef NS_ENUM(NSInteger, DFUError) {
19 /// Device type does not support.
20 DFUError_UnsupportedDeviceType = 100,
21 /// UUID is invalid.
22 DFUError_InvalidUUID = 101,
23 /// Command timeout.
24 DFUError_CommandTimeOut = 102,
25 /// Device is not connected.
26 DFUError_NoConnectedDevice = 104,
27 /// During DFU, other commands cannot be executed.
28 DFUError_InUpgradeCannotExecuteCommand = 105,
29 /// Firmware version is invalid.
30 DFUError_InvalidFirmwareVersion = 106,
31 /// Hardware version is invalid.
32 DFUError_InvalidHardwareVersion = 107,
33 /// The firmware info file is wrong.
34 DFUError_InvalidFirmwareInfoFile = 108,
35 /// The firmware file is wrong.
36 DFUError_InvalidFirmwareFile = 109,
37 /// It indicates network error.
38 DFUError_NetworkError = 200,
39 /// Server error
40 DFUError_ServerError = 202,
41 /// Requested file does not exist.
42 DFUError_RequestedFileNotExist = 203,
43 /// File save error
44 DFUError_FileSaveError = 204,
45 /// Info file does not pass check.
46 DFUError_InfoFileCheckNotPass = 205,
47 /// Firmware file does not pass check.
48 DFUError_firmwareFileCheckNotPass = 206,
49 /// Device disconnects before command finish.
50 DFUError_DeviceDisconnect = 300,
51 /// Device stops update.
52 DFUError_DeviceStopUpdate = 301,
53 /// The firmware file does not exist.
54 DFUError_NoFirmwareFile = 402,
55 /// Delete error
56 DFUError_DeleteError = 407,
57 /// Delete file , but file does not exist
58 DFUError_DeleteWhileFileNotExist = 408,
59 /// Device flash error (only support in ECG3 DFU)
60 DFUError_DeviceFlashError = 408,
61
62};
63
64/**
65 DFU device type
66 */
67typedef NS_ENUM(NSInteger, DFUDeviceType) {
68 /// Unknown
69 DFUDeviceType_Unknown = -1,
70 /// AM3
71 DFUDeviceType_AM3,
72 /// AM3S
73 DFUDeviceType_AM3S,
74 /// AM4
75 DFUDeviceType_AM4,
76 /// PO3
77 DFUDeviceType_PO3,
78 /// HS2
79 DFUDeviceType_HS2,
80 /// HS4
81 DFUDeviceType_HS4,
82 /// ECG
83 DFUDeviceType_ECG,
84 /// BP5S
85 DFUDeviceType_BP5S,
86 /// ABPM
87 DFUDeviceType_ABPM,
88 /// BG5S
89 DFUDeviceType_BG5S,
90 /// HS2S
91 DFUDeviceType_HS2S,
92 /// placeholder
93 DFUDeviceType_MAX,
94};
95
96/**
97 Cannot upgrade reason
98 */
99typedef NS_ENUM(NSInteger, DFUDeviceReplyCannotUpgradeReason){
100 /// Unknown
101 DFUDeviceReplyCannotUpgradeReason_Unknown = 1,
102 /// battery is low
103 DFUDeviceReplyCannotUpgradeReason_Battery,
104 /// cannot upgrade when measuring
105 DFUDeviceReplyCannotUpgradeReason_InMeasuring,
106};
107
108/**
109 Upgrade fail reason
110 */
111typedef NS_ENUM(NSInteger, DFUUpgradeFailReason) {
112 /// Unknown
113 DFUUpgradeFailReason_Unknown = -1,
114 /// Device recieve wrong data or no data
115 DFUUpgradeFailReason_DeviceRecieveWrongDataOrNotRecieve,
116 /// Write MCU error
117 DFUUpgradeFailReason_WriteMCUError,
118 /// Device stop upgrade
119 DFUUpgradeFailReason_DeviceStopUpgrade,
120 /// Delete firmware error (only support in ECG3 DFU)
121 DFUUpgradeFailReason_DeleteFirmwareError,
122 /// Device flash error (only support in ECG3 DFU)
123 DFUUpgradeFailReason_DeviceFlashError,
124};
125
126/**
127 Transmission result type
128 */
129typedef NS_ENUM(NSInteger, DFUTransmissionResultType) {
130 /// Unknown
131 DFUTransmissionResultType_Unknown = -1,
132 /// All firmware transfer finish
133 DFUTransmissionResultType_Finish,
134 /// Pasuse because device needs write MCU
135 DFUTransmissionResultType_Pause,
136};
137
138/**
139 Pause reason
140 */
141typedef NS_ENUM(NSInteger, DFUPauseReason) {
142 /// Unkonw reason
143 DFUPauseReason_Unknown = 0,
144 /// Need write MCU, if finished, device can be connected.
145 DFUPauseReason_RebootAndNeedReconnect,
146};
147
148
149/**
150 DFU state
151 */
152typedef NS_ENUM(NSInteger, DFUState) {
153 /// Unknown
154 DFUState_Unknown = -1,
155 /// Busy
156 DFUState_Busy,
157 /// Free
158 DFUState_Free,
159};
160
161
162/**
163 DFU error block
164
165 @param error DFUError enum
166 */
167typedef void (^DFUErrorBlock)(DFUError error);
168
169/**
170 Device firmware information block
171
172 @param deviceFirmwareInfo DFUDeviceFirmwareInfo object
173 */
174typedef void (^QueryDeviceFirmwareInfoSuccessBlock)(DFUDeviceFirmwareInfo *deviceFirmwareInfo);
175
176/**
177 Server firmware information block
178
179 @param serverFirmwareInfo DFUServerFirmwareInfo object
180 */
181typedef void (^QueryServerFirmwareInfoSuccessBlock)(DFUServerFirmwareInfo *serverFirmwareInfo);
182
183/**
184 Download firmware file success block
185
186 @param firmwareIdentifier firmware ID
187 */
188typedef void (^DownloadFirmwareSuccessBlock)(NSString *firmwareIdentifier);
189
190/**
191 Download firmware file start block
192 */
193typedef void (^DownloadFirmwareStartBlock)(void);
194
195/**
196 Download firmware file progress block
197
198 @param progress 0-100
199 */
200typedef void (^DownloadFirmwareProgressBlock)(NSInteger progress);
201
202/**
203 CancelDownloadFirmwareSuccessBlock
204 */
205typedef void (^CancelDownloadFirmwareSuccessBlock)(void);
206
207/**
208 DeviceReplyCannotUpgradeBlock
209
210 @param reason DFUDeviceReplyCannotUpgradeReason enum
211 */
212typedef void(^DeviceReplyCannotUpgradeBlock)(DFUDeviceReplyCannotUpgradeReason reason);
213
214/**
215 TransferBeginBlock
216 */
217typedef void(^TransferBeginBlock)(void);
218
219/**
220 TransferProgressBlock
221
222 @param progress 0-100
223 */
224typedef void(^TransferProgressBlock)(NSInteger progress);
225
226/**
227 TransferSuccessBlock
228
229 @param writeMCUSpeed unit:bytes/second
230 */
231typedef void(^TransferSuccessBlock)(NSUInteger writeMCUSpeed);
232
233/**
234 TransferResultBlock
235
236 @param type DFUTransmissionResultType enum
237 @param reason DFUPauseReason enum, -1 if type is DFUTransmissionResultType_Finish;
238 @param pauseLength 0-255s,-1 if type is DFUTransmissionResultType_Finish;
239 */
240typedef void(^TransferResultBlock)(DFUTransmissionResultType type,DFUPauseReason reason,NSInteger pauseLength);
241
242/**
243 UpgradeSuccessBlock
244 */
245typedef void(^UpgradeSuccessBlock)(void);
246
247/**
248 UpgradeFailBlock
249
250 @param reason DFUUpgradeFailReason enum
251 */
252typedef void(^UpgradeFailBlock)(DFUUpgradeFailReason reason);
253
254/**
255 StopUpgradeSuccessBlock
256 */
257typedef void(^StopUpgradeSuccessBlock)(void);
258
259/**
260 DeleteFirmwareSuccessBlock
261 */
262typedef void(^DeleteFirmwareSuccessBlock)(void);
263
264#endif /* DFUMacro_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUServerFirmwareInfo.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUServerFirmwareInfo.h
new file mode 100644
index 0000000..c3fa2af
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/DFUServerFirmwareInfo.h
@@ -0,0 +1,48 @@
1//
2// DFUServerFirmwareInfo.h
3// iHealthSDKStatic
4//
5// Created by Lei Bao on 2017/7/17.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "DFUMacro.h"
11
12/**
13 Firmware information from server
14 */
15@interface DFUServerFirmwareInfo : NSObject
16
17/**
18 DFUDeviceType
19 */
20@property (assign, nonatomic, readonly) DFUDeviceType deviceType;
21
22/**
23 The latest firmware version (0.0.0 or 0.0.0.0 means no firmware in server, you should check your query input parameters)
24 */
25@property (copy, nonatomic, readonly) NSString *latestFirmwareVersion;
26
27/**
28 YES means mandtory
29 */
30@property (assign, nonatomic, readonly) BOOL isMandtoryUpgrade;
31
32/**
33 Description
34 */
35@property (copy, nonatomic, readonly) NSString *updateDescription;
36
37/**
38 Images before updating
39 */
40@property (copy, nonatomic, readonly) NSArray *beforeImages;
41
42/**
43 Image after updating
44 */
45@property (copy, nonatomic, readonly) NSArray *afterImages;
46
47+ (instancetype)infoWithDeviceType:(DFUDeviceType)deviceType dic:(NSDictionary *)dic;
48@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3.h
new file mode 100644
index 0000000..d8d8736
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3.h
@@ -0,0 +1,94 @@
1//
2// ECG3.h
3// iHealthDemoCode
4//
5// Created by zhiwei jing on 16/7/12.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "ECGMacroFile.h"
11
12/**
13 Sync Time Successfully
14 */
15typedef void (^DisposeECG3SyncTimeSuccessBlock)(void);
16
17/**
18 Error block
19
20 @param errorId see ECG3ErrorID enum
21 */
22typedef void(^DisposeECG3ErrorBlock)(ECG3ErrorID errorId);
23/**
24 Start Measure
25 */
26typedef void (^DisposeECG3StartMeasureBlock)(void);
27/**
28 Finish Measure
29 */
30typedef void (^DisposeECG3FinishMeasureSuccessBlock)(void);
31
32 /**
33 ECG3 Wave Data
34 */
35typedef void (^DisposeECG3WaveDataBlock)(NSArray* waveDataArray);
36
37/**
38 ECG3 HR Data
39 */
40typedef void (^DisposeECG3PluseResultBlock)(BOOL hasHR,NSUInteger HR);
41/**
42 get Battery
43 */
44typedef void (^DisposeECG3GetBatteryBlock)(NSNumber *battery);
45/**
46 ECG3
47 */
48@interface ECG3 : NSObject
49
50@property (strong, nonatomic) NSString *currentUUID;
51@property (strong, nonatomic) NSString *serialNumber;
52@property (strong, nonatomic) NSString *firmwareVersion;
53
54/**
55 * Sync time
56 * @param syncTimeBlock Sync time successfully
57 * @param errorBlock Communication error codes, see ECG3 error descriptions.
58 */
59-(void)commandECG3SyncTime:(DisposeECG3SyncTimeSuccessBlock)syncTimeBlock withErrorBlock:(DisposeECG3ErrorBlock)errorBlock;
60
61
62/**
63 * Start Measure
64 * @param startMeasureBlock True: Success, False: Failed.
65 * @param waveDataBlock waveData:ECGWaveData use for draw wave
66 * @param pluseResultBlock hasHR: whether have heart; HR: heart rate (unit: bpm) only valid when isHaveHeart is true
67 * @param errorBlock Communication error codes, see ECG3 error descriptions.
68 */
69-(void)commandECG3StartMeasure:(DisposeECG3StartMeasureBlock)startMeasureBlock withWaveData:(DisposeECG3WaveDataBlock)waveDataBlock withPulseResult:(DisposeECG3PluseResultBlock)pluseResultBlock withErrorBlock:(DisposeECG3ErrorBlock)errorBlock;
70
71
72
73/**
74 * Finish Measure
75 * @param finishMeasureBlock finish successfully
76 * @param errorBlock Communication error codes, see ECG3 error descriptions.
77 */
78-(void)commandECG3FinishMeasure:(DisposeECG3FinishMeasureSuccessBlock)finishMeasureBlock withErrorBlock:(DisposeECG3ErrorBlock)errorBlock;
79
80
81
82
83/**
84 * Get Battery
85 * @param batteryBlock from 0~100.
86 * @param errorBlock Communication error codes, see ECG3 error descriptions.
87 */
88-(void)commandECG3GetBatteryInfo:(DisposeECG3GetBatteryBlock)batteryBlock withErrorBlock:(DisposeECG3ErrorBlock)errorBlock;
89
90/**
91 Disconnect device
92 */
93- (void)disconnectDevice;
94@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3Controller.h
new file mode 100644
index 0000000..548ea75
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3Controller.h
@@ -0,0 +1,30 @@
1//
2// ECG3Controller.h
3// CES2014ECG
4//
5// Created by 小翼 on 15/8/27.
6// Copyright (c) 2015年 leed. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 ECG3Controller
13 */
14@interface ECG3Controller : NSObject
15
16
17
18/**
19 * Initialize ECG3 controller class
20 */
21+(ECG3Controller *)shareECG3Controller;
22
23/**
24 * Access control class instance after receiving ECG3ConnectNoti, then use instance to call ECG3 related communication methods
25 */
26-(NSArray *)getAllCurrentECG3Instace;
27
28
29
30@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3USB.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3USB.h
new file mode 100755
index 0000000..5882028
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3USB.h
@@ -0,0 +1,145 @@
1//
2// ECG3.h
3// iHealthDemoCode
4//
5// Created by daiqingquan on 15/9/15.
6// Copyright (c) 2015年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "ECGMacroFile.h"
11
12/**
13 Sync Start
14 */
15typedef void (^ECG3USBSyncStartBlock)(void);
16
17/**
18 Sync Progress
19
20 @param progress 0-100
21 */
22typedef void (^ECG3USBSyncProgressBlock)(NSUInteger progress);
23
24/**
25 @brief Sync Result
26
27 @param resultArray An array contains Dictionary
28 @code Dictionary format: {
29 @"SampleRate":@(sampleRate),
30 @"StartTime":startTimeString,
31 @"EndTime":endTimeString,
32 @"FileName":fileName,
33 @"FilePath":path
34 });
35 @endcode
36 @param finish YES means all data has been uploaded, NO means not all data has been uploaded because of some reasons sucn as device disconnect\communication error\iOS device's memory issue\raw data error. The reason you can get from ECG3USBErrorBlock.
37 */
38typedef void (^ECG3USBSyncResultBlock)(NSArray *resultArray,BOOL finish);
39
40/**
41 Sync Error
42
43 @param errorID error ID
44 */
45typedef void (^ECG3USBErrorBlock)(ECG3USBError errorID);
46
47
48/**
49 Format SD Card Success
50 */
51typedef void (^ECG3FormatSDCardSuccessBlock)(void);
52
53/**
54 Format SD Card Fail
55 */
56typedef void (^ECG3FormatSDCardFailBlock)(ECG3USBError error);
57/**
58 Format Progress
59
60 @param progress 0-100
61 */
62typedef void (^ECG3USBFormatProgressBlock)(NSUInteger progress);
63/**
64 ECG3USB
65 */
66@interface ECG3USB : NSObject
67@property (strong, nonatomic) NSString *currentUUID;
68@property (strong, nonatomic) NSString *serialNumber;
69@property (strong, nonatomic) NSString *firmwareVersion;
70
71/**
72 Sync Data
73
74 @param startBlock means start
75 @param progressBlock 0-100
76 @param resultBlock You can get filtered data from the NSDocumentDirectory path.
77
78 Abnormal Point Marked by User: OBData_FileName.xml
79 Filtered ECG Data: ECGAnalyseResult_FileName.dat
80 Lead Off Begin Point: ECGLeadOffBegin_FileName.xml
81 Lead Off End Point: ECGLeadOffEnd_FileName.xml
82 ECG HR Information EveryHour: ECGHREveryHour_FileName.xml
83 Abnormal Point Filtered by Algorithm: ECGOBbyFilter_FileName.xml
84 ECG HR Information for Day: ECGDetail_FileName.xml
85 @param errorBlock error
86
87 */
88- (void)syncDataWithStartBlock:(ECG3USBSyncStartBlock)startBlock
89 progressBlock:(ECG3USBSyncProgressBlock)progressBlock
90 resultBlock:(ECG3USBSyncResultBlock)resultBlock
91 errorBlock:(ECG3USBErrorBlock)errorBlock;
92
93/**
94 Format SD Card
95
96 @param successBlock Success
97 @param progressBlock 0-100
98 @param failBlock Fail
99 */
100-(void)formatSDCard:(ECG3FormatSDCardSuccessBlock)successBlock
101 progressBlock:(ECG3USBFormatProgressBlock)progressBlock
102 errorBlock:(ECG3FormatSDCardFailBlock)failBlock;
103
104/**
105 Splice data
106
107 @param fileNames An Array with FileName value from ECG3USBSyncResultBlock
108 @param successBlock a block contains a dictionary with keys: success(@{@"DataFileName":dataFileName,@"MarkFileName":markFileName,@"StartTime":yyyyMMddHHmmss,@"EndTime":yyyyMMddHHmmss,@"FilePath":directory});
109 @param errorBlock a block contains error message
110 */
111+ (void)spliceWithFileNames:(NSArray<NSString *>*)fileNames
112 successBlock:(void(^)(NSDictionary *dic))successBlock
113 errorBlock:(void(^)(ECG3USBError error,NSString *message))errorBlock;
114
115
116/**
117 Get data cache
118
119 @param block An array contains Dictionary object
120 {
121 @"SampleRate":@(sampleRate),
122 @"StartTime":startTimeString,
123 @"EndTime":endTimeString,
124 @"FileName":fileName,
125 @"FilePath":path
126 });
127 */
128- (void)getCacheDataWithBlock:(void(^)(NSArray *array))block;
129
130/**
131
132
133 @param dic the dictionary from the success block of method ’synthesisWithFileNames:success:error:‘
134 */
135
136/**
137 Filter
138
139 @param dic the dictionary from the success block of method ’synthesisWithFileNames:success:error:‘
140 @param success see ECG3USBSyncResultBlock comments
141 @param error a block contains error message (If the files don't exist, no error block retrun but print error message in the console)
142 */
143- (void)getFilterDataWithDic:(NSDictionary *)dic success:(ECG3USBSyncResultBlock)success error:(void(^)(NSString *message))error;
144
145@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3USBController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3USBController.h
new file mode 100755
index 0000000..df2c6d2
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECG3USBController.h
@@ -0,0 +1,31 @@
1//
2// ECG3Controller.h
3// iHealthDemoCode
4//
5// Created by daiqingquan on 15/9/15.
6// Copyright (c) 2015年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11@class ECG3USB;
12
13/**
14 ECG3USBController
15 */
16@interface ECG3USBController : NSObject
17
18/**
19 share ECG3 Controller
20
21 @return ECG3USBController
22 */
23+(ECG3USBController *)shareECG3USBController;
24
25/**
26 get ECG3
27
28 @return ECG3USB
29 */
30-(ECG3USB *)getCurrentECG3USBInstace;
31@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECGHeader.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECGHeader.h
new file mode 100644
index 0000000..006c5f2
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECGHeader.h
@@ -0,0 +1,20 @@
1//
2// ECGHeader.h
3// iHealthDemoCode
4//
5// Created by zhiwei jing on 16/7/12.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#ifndef ECGHeader_h
10#define ECGHeader_h
11
12
13#import "ECG3.h"
14#import "ECG3Controller.h"
15#import "ECGMacroFile.h"
16#import "HealthUser.h"
17#import "ECG3USB.h"
18#import "ECG3USBController.h"
19
20#endif /* ECGHeader_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECGMacroFile.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECGMacroFile.h
new file mode 100644
index 0000000..45a749c
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ECGMacroFile.h
@@ -0,0 +1,84 @@
1//
2// ECGMacroFile.h
3// iHealthDemoCode
4//
5// Created by zhiwei jing on 16/7/12.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#import "HealthUser.h"
10
11#ifndef ECGMacroFile_h
12#define ECGMacroFile_h
13
14
15#define ECGUSBConnectNoti @"ECGUSBConnect"
16#define ECGUSBDisConnectNoti @"ECGUSBDisConnectNoti"
17
18#define ECG3Discover @"ECG3Discover"
19#define ECG3ConnectFailed @"ECG3ConnectFailed"
20#define ECG3ConnectNoti @"ECG3ConnectNoti"
21#define ECG3DisConnectNoti @"ECG3DisConnectNoti"
22#define ECG3DeviceID @"ID"
23
24/**
25 ECG3ErrorID
26 */
27typedef NS_ENUM(NSUInteger, ECG3ErrorID) {
28 /// Electrode Loss
29 ECG3Error_ElectrodeLoss = 1,
30 /// Electrode Loss Recovery
31 ECG3Error_ElectrodeLossRecovery,
32 /// Electrode Loss Timeout
33 ECG3Error_ElectrodeLossTimeout,
34 /// SDCard Communication Error
35 ECG3Error_SDCardCommunicationError,
36 /// Sample Module Error
37 ECG3Error_SampleModuleError,
38 /// Low Power
39 ECG3Error_LowPower,
40 /// Device Memory Full
41 ECG3Error_DeviceMemoryFull,
42 /// Disconnect
43 ECG3Error_Disconnect,
44 /// Parameter Error
45 ECG3Error_ParameterError = 400,
46 /// Command timeout
47 ECG3Error_CommandTimeout = 500,
48};
49
50typedef NS_ENUM(NSUInteger, ECG3USBError) {
51 /// Query command timeout
52 ECG3USBError_QuerySDCardInfoTimeout,
53 /// Received SD card info is wrong.
54 ECG3USBError_SDCardInfoError,
55 /// Receive devce's error log: SD card error.
56 ECG3USBError_SDCardError,
57 /// There is not enough space for ECG's offline data.
58 ECG3USBError_iOSDeviceFlashNotEnough,
59 /// Receive wrong data
60 ECG3USBError_AFilePackageIndexNotMatch,
61 /// Receive wrong data
62 ECG3USBError_BFilePackageIndexNotMatch,
63 /// Receive data timeout
64 ECG3USBError_ReceiveDataTimeout,
65 /// Save file error
66 ECG3USBError_SaveFileError,
67 /// Device is disconnected.
68 ECG3USBError_DeviceDisconnect,
69 /// Format fail.
70 ECG3USBError_DeviceReplyFormatFail,
71 /// Splice fail.
72 ECG3USBError_SpliceFail,
73 /// Get data cache fail.
74 ECG3USBError_GetDataCacheFail,
75 /// Filter fail.
76 ECG3USBError_FilterFail,
77 /// Format command timeout.
78 ECG3USBError_DeviceFormatTimeout,
79 /// Command timeout
80 ECG3USBError_CommandTimeout = 500,
81
82};
83
84#endif /* ECGMacroFile_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HFSmartLink.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HFSmartLink.h
new file mode 100644
index 0000000..236e6d4
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HFSmartLink.h
@@ -0,0 +1,88 @@
1//
2// HFSmartLink.h
3// SmartlinkLib
4//
5// Created by wangmeng on 15/3/16.
6// Copyright (c) 2015年 HF. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "HFSmartLinkDeviceInfo.h"
11
12typedef void(^SmartLinkProcessBlock)(NSInteger process);
13/**
14 * 设置成功以后的Block
15 *
16 *
17 */
18typedef void(^SmartLinkSuccessBlock)(HFSmartLinkDeviceInfo *dev);
19/**
20 * 设置失败的信息
21 *
22 * @param failmsg 失败信息
23 */
24typedef void(^SmartLinkFailBlock)(NSString * failmsg);
25/**
26 * 用户手动停掉的block
27 *
28 * @param stopMsg 停止的信息
29 * @param isOk 是否停止成功
30 */
31typedef void(^SmartLinkStopBlock)(NSString *stopMsg,BOOL isOk);
32/**
33 * 关闭服务的Block
34 *
35 * @param closeMsg 关闭的信息
36 * @param isOK 是否关闭成功
37 */
38typedef void(^SmartLinkCloseBlock)(NSString * closeMsg,BOOL isOK);
39/**
40 * 发现设备的block
41 *
42 * @param deviceDic 发现的设备
43 */
44typedef void(^SmartLinkEndblock)(NSDictionary * deviceDic);
45
46@interface HFSmartLink : NSObject
47/**
48 * 是否配置单个设备,或者多个设备 默认false
49 */
50@property (nonatomic) BOOL isConfigOneDevice;
51/**
52 * 配置信息发送完成以后,等待搜索设备的时间 second 默认15
53 */
54@property (nonatomic) NSInteger waitTimers;
55
56/**
57 * 获取smartlink 的单例
58 *
59 * @return 返回smartlink的单例
60 */
61+(instancetype)shareInstence;
62/**
63 * 开始配置 block不能为nil
64 *
65 * @param key 路由器密码
66 * @param pblock 进度block
67 * @param sblock 成功block
68 * @param fblock 失败block
69 * @param eblock 结束block
70 */
71//-(void)startWithKey:(NSString*)key processblock:(SmartLinkProcessBlock)pblock successBlock:(SmartLinkSuccessBlock)sblock failBlock:(SmartLinkFailBlock)fblock endBlock:(SmartLinkEndblock)eblock;
72
73-(void)startWithSSID:(NSString*)ssid Key:(NSString*)key withV3x:(BOOL)v3x processblock:(SmartLinkProcessBlock)pblock successBlock:(SmartLinkSuccessBlock)sblock failBlock:(SmartLinkFailBlock)fblock endBlock:(SmartLinkEndblock)eblock;
74// for smartlink V7.0
75//-(void)startWithContent:(char *)content lenght:(int)len key:(NSString *)key withV3x:(BOOL)v3x processblock:(SmartLinkProcessBlock)pblock successBlock:(SmartLinkSuccessBlock)sblock failBlock:(SmartLinkFailBlock)fblock endBlock:(SmartLinkEndblock)eblock;
76/**
77 * 停止配置
78 *
79 * @param block 停止配置的block
80 */
81-(void)stopWithBlock:(SmartLinkStopBlock)block;
82/**
83 * 关闭整个Smartlink服务,再次调用的时候必须 从头开始 初始化。
84 *
85 * @param block 关闭服务block
86 */
87-(void)closeWithBlock:(SmartLinkCloseBlock)block;
88@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HFSmartLinkDeviceInfo.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HFSmartLinkDeviceInfo.h
new file mode 100644
index 0000000..2abf066
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HFSmartLinkDeviceInfo.h
@@ -0,0 +1,14 @@
1//
2// HFSmartLinkDeviceInfo.h
3// SmartlinkLib
4//
5// Created by wangmeng on 15/3/17.
6// Copyright (c) 2015年 HF. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11@interface HFSmartLinkDeviceInfo : NSObject
12@property (nonatomic,strong) NSString * ip;
13@property (nonatomic,strong) NSString * mac;
14@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2.h
new file mode 100644
index 0000000..347b7a9
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2.h
@@ -0,0 +1,64 @@
1//
2// HS2.h
3// iHealthSDKStatic
4//
5// Created by ihealth on 2017/6/6.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "HSMacroFile.h"
11
12@interface HS2 : NSObject
13@property (strong, nonatomic) NSString *currentUUID;
14@property (strong, nonatomic) NSString *deviceID;
15@property (strong, nonatomic) NSNumber *daiModel;
16@property (retain, nonatomic) NSString *firmwareVersion;
17
18/**
19
20 * Establish memory and measurement connection
21
22 * Import parameter:
23 * @param tempUnit -Unit displayed on HS2: HSUnit_Kg、HSUnit_LB、HSUnit_ST。
24
25 * Return parameters:
26 The measurement via SDK will be operated in the case of 1-4, and will be terminated if any of 5-8 occurs. The interface needs to be re-called after analyzing the return parameters.
27
28 * @param unStableWeight - Current weight, (Kg) [Value Range:0~180]
29 * @param stableWeight - Stable weight, (Kg) [Value Range:0~180]
30 * @param disposeErrorBlock - error code
31 * Error code definition:
32 * refer to “error” : HS2 error instruction.
33 */
34
35-(void)commandHS2MeasureWithUint:(HSUnit)tempUnit Weight:(UnStableWeight)unStableWeight StableWeight:(StableWeight)stableWeight DisposeErrorBlock:(DisposeHS2ErrorBlock)disposeErrorBlock;
36
37/**
38 * Upload memory data
39
40 * Return parameters:
41 * @param startTransmission -Start Memory transmission.
42 * @param progress -Memory transmission progress,[Range:0.0~1.0].
43 * @param memorryData -Record data including weight (kg), measurement time,coordinated key:weight,date.[Range of weight 0~180(kg)] (If it exceeds 180kg, it will display er1 error, but the SDK interface will also return data. More than 180kg of data is not recommended.)
44 * @param finishTransmission -Finish memory transmission.
45 * @param disposeErrorBlock -Record the error code in uploading process.
46 * Error code definition: refer to ”error” : HS2 error instruction.
47 */
48
49-(void)commandHS2TransferMemorryData:(StartHS2Transmission)startTransmission DisposeProgress:(DisposeProgress)progress MemorryData:(MemorryData)memorryData FinishTransmission:(FinishHS2Transmission)finishTransmission DisposeErrorBlock:(DisposeHS2ErrorBlock)disposeErrorBlock;
50
51/**
52 *Get HS2 Battery
53
54 * @param HS2battery HS2battery [Range:0~100]%
55 * @param disposeErrorBlock error code
56 */
57-(void)commandGetHS2Battery:(DisposeHS2BatteryBlock)HS2battery DiaposeErrorBlock:(DisposeHS2ErrorBlock)disposeErrorBlock;
58/**
59 Disconnect current device
60 */
61
62-(void)commandDisconnectDevice;
63
64@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2Controller.h
new file mode 100644
index 0000000..781e830
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2Controller.h
@@ -0,0 +1,25 @@
1//
2// HS2Controller.h
3// iHealthSDKStatic
4//
5// Created by ihealth on 2017/6/6.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 HS2Controller
13 */
14@interface HS2Controller : NSObject
15/**
16 * Initialize HS2 controller class
17 */
18+(HS2Controller *)shareIHHs2Controller;
19
20/**
21 * Get all scale instance,use hsInstance to call HS related communication methods.
22 */
23-(NSArray *)getAllCurrentHS2Instace;
24
25@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2S.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2S.h
new file mode 100644
index 0000000..96b4829
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2S.h
@@ -0,0 +1,399 @@
1//
2// HS2S.h
3// iHealthSDKStatic
4//
5// Created by jing on 2019/5/8.
6// Copyright © 2019 ihealthSDK. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "HSMacroFile.h"
11NS_ASSUME_NONNULL_BEGIN
12
13@interface HS2S : NSObject
14
15@property (strong, nonatomic) NSString *serialNumber;
16@property (strong, nonatomic) NSString *currentUUID;
17@property (nonatomic,strong) NSNumber *hs2sDeviceFlag;
18/**
19 *Get HS2S DeviceInfo (After the HS2S device is successfully connected, the interface must be called to synchronize the device time. Otherwise, the offline data measurement time error will be caused)
20
21 * @param deviceInfo Contains device IDPS info(FirmwareVersion,HardwareVersion,Manufacture,ModelNumber,ProtocolString,SerialNumber),user count ,HS2S current unit(1:Kg,2:LB,3:ST),battery
22 * Example:
23 * {
24 Battary = 70;
25 DeviceName = HS2S;
26 FirmwareVersion = "0.5.4";
27 HardwareVersion = "1.0.0";
28 Manufacture = iHealth;
29 ModelNumber = "HS2S 11070";
30 ProtocolString = "com.jiuan.BFSV22";
31 SerialNumber = 004D320CA04D;
32 Unit = 1;
33 UserCount = 1;
34 * }
35 * @param disposeErrorBlock - error code
36 * Error code definition:
37 * refer to “error” : HS2S error instruction.
38 */
39-(void)commandGetHS2SDeviceInfo:(DisposeHS2SDeviceInfo)deviceInfo DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
40
41
42/**
43 *Get HS2S battery
44
45 * @param battary HS2Sbattery [Range:0~100]%
46 * @param disposeErrorBlock - error code
47 * Error code definition:
48 * refer to “error” : HS2S error instruction.
49 */
50-(void)commandGetHS2SBattery:(DisposeHS2SBatteryBlock)battary DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
51
52
53/**
54
55 * SetUnit
56
57 * Import parameter:
58 * @param tempUnit -Unit displayed on HS2S: HSUnit_Kg、HSUnit_LB、HSUnit_ST。
59 * Return parameters:
60 * @param result YES:Success NO:Failed
61 * @param disposeErrorBlock - error code
62 * Error code definition:
63 * refer to “error” : HS2S error instruction.
64 */
65
66-(void)commandSetHS2SUnit:(HSUnit)tempUnit result:(DisposeHS2SResult)result DisposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
67
68/**
69 * Get HS2S UserInfo
70 * Return parameters:
71 * @param userInfo NSDictionary type,contains: UserCount and UserInfo
72 * Example:
73 * {
74 UserCount = 1;
75 UserInfo =(
76 {
77 "UserInfo_Age" = 20;
78 "UserInfo_Height" = 100;
79 "UserInfo_CreatTS" = 1558406503; //User creat time
80 "UserInfo_ID" = <69486561 6c746831 32333435 36373839>;
81 "UserInfo_ImpedanceMark" = 1; //0 Don't measure 1 Measure
82 "UserInfo_SEX" = 1; //0 female 1 male,
83 "UserInfo_Weight" = "79.5";
84 "UserInfo_Fitness" = 1; //0:Don't fitness 1:fitness
85 }
86 );
87 * }
88 * @param disposeErrorBlock - error code
89 * Error code definition:
90 * refer to “error” : HS2S error instruction.
91 */
92-(void)commandGetHS2SUserInfo:(DisposeHS2SUserInfo)userInfo DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
93
94/**
95 * Create or Update HS2S UserInfo (The HS2S device only supports the creation of a maximum of 8 users)
96 * Import parameter:
97 * @param user (user information must be entered in accordance with the reference range, otherwise it may be impossible to measure the accurate body fat information)
98
99 * contains:
100 * hs2SUserID:NSData type,The user ID must be 16 bytes or the user creation fails,
101 * createTS:NSInteger type,The unit of time is seconds ,
102 * weight:NSNumber type,range:20-150kg,
103 * age:NSNumber type,range:18-99 years,
104 * height:NSNumber type,range:90-220cm
105 * sex:0 female 1 male,
106 * impedanceMark: 0 Don't measure 1 Measure
107 * fitnessMark:0 Don't fitness 1:fitness
108 * Return parameters:
109 * @param result YES:Success NO:Failed
110 * @param disposeErrorBlock - error code
111 * Error code definition:
112 * refer to “error” : HS2S error instruction.
113 */
114-(void)commandUpdateHS2SUserInfoWithUser:(HealthUser*)user result:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
115
116/**
117 * Delete HS2S User
118 * Import parameter:
119 * @param userID :NSData type,The user ID must be 16 bytes or the user creation fails,
120 * Return parameters:
121 * @param result YES:Success NO:Failed
122 * @param disposeErrorBlock - error code
123 * Error code definition:
124 * refer to “error” : HS2S error instruction.
125 */
126-(void)commandDeleteHS2SUserWithUserID:(NSData*)userID result:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
127
128/**
129 * Get HS2S Memory data count
130 * Import parameter:
131 * @param userID :NSData type,The user ID must be 16 bytes or the user creation fails,
132 * Return parameters:
133 * @param count NSNumber Type,memory count
134 * @param disposeErrorBlock - error code
135 * Error code definition:
136 * refer to “error” : HS2S error instruction.
137 */
138-(void)commandGetHS2SMemoryDataCountWithUserID:(NSData*)userID memoryCount:(DisposeHS2SMemoryCountBlock)count DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
139
140/**
141 * Get HS2S Memory data
142
143 Lean mass calculation formula: result = weight * (1 - body fat percentage)
144 BMI calculation formula: result = weight / (height * height)
145 BMR calculation formula:
146 If no fat is measured
147 {
148 For men:
149 P = 13.397* weight + 4.799* height – 5.677* age + 88.362
150 For women:
151 P = 9.247* weight + 3.098* height – 4.330* age + 447.593
152 If the user enters the sport level in the app, correct the P:
153 Sport level=1, P = P*1.0
154 Sport level = 2, P = P*1.05
155 Sport level = 3, P = P*1.10
156 }
157 When fat is measured:
158 {
159 P=370 + 21.6*Lean mass(kg )
160 }
161 * Import parameter:
162 * @param userID :NSData type,The user ID must be 16 bytes or the user creation fails,
163 * Return parameters:
164 * @param memoryData NSArray Type,memory data
165 * Example:
166 * (
167
168 {
169 DeviceMac = 004D320CA04D; //device mac
170 HS2SBodyAge = 10; //body age
171 HS2SBodyWaterPercentAge = "39.3"; //body moisture rate
172 HS2SBoneMineral = "1.9"; //Bone salt
173 HS2SFatControl = 0; //Fat Control
174 HS2SFatWeight = 0; //Fat weight
175 HS2SFitness = 1; //0:Don't fitness 1:fitness
176 HS2SImpedance = (); //NSArray type ,Impedance
177 HS2SIsRightTS = 1; //0:Incorrect, unsynchronized time on measured data 1:Correct, synchronize the measured data after the time
178 HS2SMeasureTS = "2019-05-18 08:56:38 +0000";
179 HS2SMuscle = "13.1"; //Muscle mass
180 HS2SMuscleControl = 0; //Muscle Control
181 HS2SProteinPercentAge = "9.8"; //Protein rate
182 HS2SResultBodyFatPercentAge = "44.2"; //Body fat rate
183 HS2SBodyWeightFlag = 0; //0:Body fat was not measured 1:Measure body fat
184 HS2SSkeletalMuscle = 0; //Skeletal Muscle
185 HS2SStandardWeight = 0; //Standard Weight
186 HS2SVFR = 29; //Visceral fat grade
187 HS2SWeightControl = 0; //Weight Control
188 HS2SWeigthResult = "79.5";
189 "UserInfo_Age" = 18;
190 "UserInfo_Height" = 100;
191 "UserInfo_SEX" = 1;
192 }
193 * )
194 * @param disposeErrorBlock - error code
195 * Error code definition:
196 * refer to “error” : HS2S error instruction.
197 */
198-(void)commandGetHS2SMemoryDataWithUserID:(NSData*)userID memoryData:(DisposeHS2SMemoryDataBlock)memoryData DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
199
200/**
201 * Delete HS2S Memory data
202 * Import parameter:
203 * @param userID :NSData type,The user ID must be 16 bytes or the user creation fails,
204 * Return parameters:
205 * @param result YES:Success NO:Failed
206 * @param disposeErrorBlock - error code
207 * Error code definition:
208 * refer to “error” : HS2S error instruction.
209 */
210-(void)commandDeleteHS2SMemoryDataWithUserID:(NSData*)userID result:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
211
212/**
213 * Get HS2S Anonymous Memory data count
214 * Return parameters:
215 * @param count memory count
216 * @param disposeErrorBlock - error code
217 * Error code definition:
218 * refer to “error” : HS2S error instruction.
219 */
220-(void)commandGetHS2SAnonymousMemoryDataCount:(DisposeHS2SAnonymousMemoryCountBlock)count DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
221
222/**
223 * Get HS2S Anonymous Memory data
224 * Return parameters:
225 * @param memoryData NSArray type,Each result dictionary contains: HS2SIsRightTS(Time correctness identification,0:Incorrect, unsynchronized time on measured data 1:Correct, synchronize the measured data after the time),HS2SMeasureTS(Measure Time,NSdate type),HS2SWeigthResult(Weigth Result)
226 * Example:
227 * (
228 {
229 HS2SIsRightTS = 0; //Time correctness identification
230 HS2SMeasureTS = "2019-05-18 07:18:36 +0000";
231 HS2SWeigthResult = "43.7";
232 }
233 * )
234 * @param disposeErrorBlock - error code
235 * Error code definition:
236 * refer to “error” : HS2S error instruction.
237 */
238-(void)commandGetHS2SAnonymousMemoryData:(DisposeHS2SAnonymousMemoryDataBlock)memoryData DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
239
240/**
241 * Delete HS2S Anonymous Memory data
242 * Return parameters:
243 * @param result YES:Success NO:Failed
244 * @param disposeErrorBlock - error code
245 * Error code definition:
246 * refer to “error” : HS2S error instruction.
247 */
248-(void)commandDeleteHS2SAnonymousMemoryData:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
249
250
251/**
252 * Measure HS2S Data
253 * Import parameter:
254 * @param user (user information must be entered in accordance with the reference range, otherwise it may be impossible to measure the accurate body fat information)
255
256 Lean mass calculation formula: result = weight * (1 - body fat percentage)
257 BMI calculation formula: result = weight / (height * height)
258 BMR calculation formula:
259 If no fat is measured
260 {
261 For men:
262 P = 13.397* weight + 4.799* height – 5.677* age + 88.362
263 For women:
264 P = 9.247* weight + 3.098* height – 4.330* age + 447.593
265 If the user enters the sport level in the app, correct the P:
266 Sport level=1, P = P*1.0
267 Sport level = 2, P = P*1.05
268 Sport level = 3, P = P*1.10
269 }
270 When fat is measured:
271 {
272 P=370 + 21.6*Lean mass(kg )
273 }
274 * contains:
275 * userType : 0 guest 1 normal
276 * hs2SUserID:NSData type,The user ID must be 16 bytes or the user creation fails,
277 * createTS:NSInteger type,The unit of time is seconds ,
278 * weight:NSNumber type,range:20-150kg,
279 * age:NSNumber type,range:18-99 years,
280 * height:NSNumber type,range:90-220cm
281 * sex:0 female 1 male,
282 * impedanceMark: 0 Don't measure 1 Measure
283 * fitnessMark:0 Don't fitness 1:fitness
284 * Return parameters:
285 * @param unStableWeight - Current weight, (Kg) [Value Range:0~180]
286 * @param stableWeight - Stable weight, (Kg) [Value Range:0~180]
287 * @param weightAndBodyInfo Weight and body fat information guest user not return weightAndBodyInfo
288 * Example:
289 * {
290 DeviceMac = 004D320CA04D; //device mac
291 HS2SBodyAge = 10; //body age
292 HS2SBodyWaterPercentAge = "39.3"; //body moisture rate
293 HS2SBoneMineral = "1.9"; //Bone salt
294 HS2SFatControl = 0; //Fat Control
295 HS2SFatWeight = 0; //Fat weight
296 HS2SFitness = 1; //0:Don't fitness 1:fitness
297 HS2SImpedance = (); //NSArray type ,Impedance
298 HS2SMeasureTS = "2019-05-18 08:56:38 +0000";
299 HS2SMuscle = "13.1"; //Muscle mass
300 HS2SMuscleControl = 0; //Muscle Control
301 HS2SProteinPercentAge = "9.8"; //Protein rate
302 HS2SResultBodyFatPercentAge = "44.2"; //Body fat rate
303 HS2SBodyWeightFlag = 0; //0:Body fat was not measured 1:Measure body fat
304 HS2SSkeletalMuscle = 0; //Skeletal Muscle
305 HS2SStandardWeight = 0; //Standard Weight
306 HS2SVFR = 29; //Visceral fat grade
307 HS2SWeightControl = 0; //Weight Control
308 HS2SWeigthResult = "79.5";
309 "UserInfo_Age" = 18;
310 "UserInfo_Height" = 100;
311 "UserInfo_SEX" = 1;
312 * }
313 * @param measureFinish If HS2S is measuring weight, the call to the online measurement interface will fail at the beginning, and the call to the interface will succeed when the return measurement is completed.
314 * @param disposeErrorBlock - error code
315 * Error code definition:
316 * refer to “error” : HS2S error instruction.
317 */
318-(void)commandStartHS2SMeasureWithUser:(HealthUser*)user weight:(DisposeHS2SUnStableWeight)unStableWeight stableWeight:(DisposeHS2SStableWeight)stableWeight weightAndBodyInfo:(DisposeHS2SWeightAndBodyInfo)weightAndBodyInfo disposeHS2SMeasureFinish:(DisposeHS2SMeasureFinish)measureFinish DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
319
320
321/**
322 * Reset HS2S device
323 * Return parameters:
324 * @param result YES:Success NO:Failed
325 * @param disposeErrorBlock - error code
326 * Error code definition:
327 * refer to “error” : HS2S error instruction.
328 */
329-(void)commandResetHS2SDevice:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
330
331/**
332 * HS2S BroadCastType device
333 * Return parameters:
334 * @param result YES:Success NO:Failed
335 * @param disposeErrorBlock - error code
336 * Error code definition:
337 * refer to “error” : HS2S error instruction.
338 */
339-(void)commandBroadCastTypeHS2SDevice:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
340
341
342/**
343 Disconnect current device
344 */
345
346-(void)commandDisconnectDevice;
347
348/**
349 * HS2S Light up bluetooth
350 * Return parameters:
351 * @param result YES:Success NO:Failed
352 * @param disposeErrorBlock - error code
353 * Error code definition:
354 * refer to “error” : HS2S error instruction.
355 */
356-(void)commandSetHS2SDeviceLightUp:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
357
358
359
360
361/**
362 * HS2S Enter heart rate measurement mode
363 * Return parameters:
364 * @param result
365 * heartResultDic:{
366 HeartValue = 0;
367 ResultStatus = 1;(0: success,
368 1: failed 1, no real-time data received in 6s
369 2: Failure 2, the algorithm judges that the user is weighing down
370 3: Failure 3, calculation failed
371 4: Failure 4: 30s timeout)
372 }
373
374 * @param status ( 1: User on the scale
375 2: User referred below
376 3: The user's heartbeat signal is detected)
377 * @param disposeErrorBlock - error code
378 * Error code definition:
379 * refer to “error” : HS2S error instruction.
380 */
381-(void)commandEnterHS2SHeartRateMeasurementMode:(DisposeHS2SHeartResult)result measurementStatus:(DisposeHS2SMeasurementStatus)status DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
382
383/**
384 * HS2S Exit heart rate measurement mode
385 * Return parameters:
386 * @param result YES:Success NO:Failed
387 * @param disposeErrorBlock - error code
388 * Error code definition:
389 * refer to “error” : HS2S error instruction.
390 */
391-(void)commandExitHS2SHeartRateMeasurementMode:(DisposeHS2SResult)result DiaposeErrorBlock:(DisposeHS2SErrorBlock)disposeErrorBlock;
392
393
394@end
395
396
397
398
399NS_ASSUME_NONNULL_END
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2SController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2SController.h
new file mode 100644
index 0000000..8758699
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS2SController.h
@@ -0,0 +1,27 @@
1//
2// HS2SController.h
3// iHealthSDKStatic
4//
5// Created by jing on 2019/4/30.
6// Copyright © 2019 ihealthSDK. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11NS_ASSUME_NONNULL_BEGIN
12/**
13 HS2SController
14 */
15@interface HS2SController : NSObject
16/**
17 * Initialize HS2S controller class
18 */
19+(HS2SController *)shareIHHS2SController;
20
21/**
22 * Get all scale instance,use hsInstance to call HS related communication methods.
23 */
24-(NSArray *)getAllCurrentHS2SInstace;
25@end
26
27NS_ASSUME_NONNULL_END
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS3.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS3.h
new file mode 100644
index 0000000..2d8fb09
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS3.h
@@ -0,0 +1,63 @@
1//
2// HS3.h
3// testShareCommunication
4//
5// Created by daiqingquan on 13-10-10.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "HSMacroFile.h"
11
12
13/**
14 HS3
15 */
16@interface HS3 : NSObject
17@property (retain, nonatomic) NSString *currentUUID;
18@property (retain, nonatomic) NSString *deviceID;
19@property (retain, nonatomic) NSString *modelNumber;
20@property (retain, nonatomic) NSDictionary *commInfoDic;
21@property (retain, nonatomic) NSString *firmwareVersion;
22
23
24
25-(void)commandInitMeasureWeightID:(WeightID)weightID FinishInit:(FinishHS3Init)finishInit DisposeErrorBlock:(DisposeHS3ErrorBlock)disposeHS3ErrorBlock;
26
27
28/**
29 Establish memory and measurement connection
30 The measurement via SDK will be operated in the case of 1-4, and will be terminated if any of 5-8 occurs. The interface needs to be re-called after analyzing the return parameters.
31
32 @param startTransmission Start Memory transmission,Success: Yes,Fail: No.
33 @param hs3UploadDataNum MemoryNumber,Range:0~200.
34 @param progress Memory transmission progress,Range:0.0~1.0.
35 @param memorryData Record data including weight(kg)[Range:0.0~150.0], measure time,coordinated key:weight、date.
36 @param finishTransmission Finish memory transmission.
37 @param stableWeight weight (Kg) [value range:0.0~150.0]
38 @param disposeHS3ErrorBlock Error code in measurement process
39 */
40-(void)commandInitWithUser:(StartHS3Transmission)startTransmission UploadDataNum:(DisposeHS3UploadDataNum)hs3UploadDataNum DisposeProgress:(DisposeHS3Progress)progress MemorryData:(HS3MemorryData)memorryData FinishTransmission:(FinishHS3Transmission)finishTransmission StableWeight:(StableHS3Weight)stableWeight DisposeErrorBlock:(DisposeHS3ErrorBlock)disposeHS3ErrorBlock;
41
42/**
43 Turn off Bluetooth Connection
44 This method can be called only for hsInstance.HS3 with FirmwareVersion>=1.0.2
45 Return parameters:
46 @param disposeResult — ‘YES’ means measurement has been terminated, ‘NO’ means termination failed.
47 @param disposeHS3ErrorBlock - refer to “error” : HS3 error instruction.
48*/
49-(void)commandTurnOffBTConnectAutoResult:(DisposeResult)disposeResult DisposeErrorBlock:(DisposeHS3ErrorBlock)disposeHS3ErrorBlock;
50
51
52
53/**
54 Turn on Bluetooth Connection
55 This method can be called only for hsInstance.HS3 with FirmwareVersion>=1.0.2
56 Return parameters:
57 @param disposeResult ‘YES’ means measurement has been terminated, ‘NO’ means termination failed.
58 @param disposeHS3ErrorBlock refer to “error” : HS3 error instruction.
59
60 */
61-(void)commandTurnOnBTConnectAutoResult:(DisposeResult)disposeResult DisposeErrorBlock:(DisposeHS3ErrorBlock)disposeHS3ErrorBlock;
62
63@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS3Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS3Controller.h
new file mode 100644
index 0000000..9a811ae
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS3Controller.h
@@ -0,0 +1,32 @@
1//
2// HS3Controller.h
3// testShareCommunication
4//
5// Created by daiqingquan on 13-10-10.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11
12/**
13 HS3Controller
14 */
15@interface HS3Controller : NSObject{
16
17 NSMutableArray *hs3Array;
18}
19
20/**
21 * Initialize HS3 controller class
22 */
23
24+(HS3Controller *)shareIHHs3Controller;
25
26/**
27 * Get all scale instance,use hsInstance to call HS related communication methods.
28 */
29-(NSArray *)getAllCurrentHS3Instace;
30
31
32@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS4.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS4.h
new file mode 100644
index 0000000..066b3ed
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS4.h
@@ -0,0 +1,64 @@
1//
2// HS4.h
3// testShareCommunication
4//
5// Created by daiqingquan on 13-12-2.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "HSMacroFile.h"
11
12
13/**
14 HS4
15 */
16@interface HS4 : NSObject
17@property (strong, nonatomic) NSString *currentUUID;
18@property (strong, nonatomic) NSString *deviceID;
19@property (strong, nonatomic) NSNumber *daiModel;
20@property (retain, nonatomic) NSString *firmwareVersion;
21
22
23/**
24 Establish memory and measurement connection
25Import parameter:
26 @param tempUnit Unit displayed on HS4: HSUnit_Kg、HSUnit_LB、HSUnit_ST。
27 Return parameters:
28 The measurement via SDK will be operated in the case of 1-4, and will be terminated if any of 5-8 occurs. The interface needs to be re-called after analyzing the return parameters.
29 @param unStableWeight Current weight, (Kg) [Value Range:0~180]
30 @param stableWeight Stable weight, (Kg) [Value Range:0~180]
31 @param disposeErrorBlock error code
32 */
33-(void)commandMeasureWithUint:(HSUnit)tempUnit Weight:(UnStableWeight)unStableWeight StableWeight:(StableWeight)stableWeight DisposeErrorBlock:(DisposeHS4ErrorBlock)disposeErrorBlock;
34
35
36
37/**
38 Upload memory data
39
40 Return parameters:
41 @param startTransmission Start Memory transmission.
42 @param progress Memory transmission progress,[Range:0.0~1.0].
43 @param memorryData Record data including weight (kg), measurement time,coordinated key:weight,date.[Range of weight 0.0~180.0(kg)]
44 @param finishTransmission Finish memory transmission.
45 @param disposeErrorBlock Record the error code in uploading process.
46 */
47-(void)commandTransferMemorryData:(StartHS4Transmission)startTransmission DisposeProgress:(DisposeProgress)progress MemorryData:(MemorryData)memorryData FinishTransmission:(FinishHS4Transmission)finishTransmission DisposeErrorBlock:(DisposeHS4ErrorBlock)disposeErrorBlock;
48
49/**
50 * End Current Measure Connection
51 * @param result - the result of end current action
52 * @param disposeErrorBlock - error code
53 * Error code definition ---refer to “error” : HS4 error instruction.
54*/
55
56-(void)commandEndCurrentConnection:(DisposeResult)result DisposeErrorBlock:(DisposeHS4ErrorBlock)disposeErrorBlock;
57
58/**
59 Disconnect current device
60 */
61
62-(void)commandDisconnectDevice;
63
64@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS4Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS4Controller.h
new file mode 100644
index 0000000..57e436c
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS4Controller.h
@@ -0,0 +1,26 @@
1//
2// HS4Controller.h
3// testShareCommunication
4//
5// Created by daiqingquan on 13-12-2.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 HS4Controller
13 */
14@interface HS4Controller : NSObject
15
16/**
17 * Initialize HS4 controller class
18 */
19+(HS4Controller *)shareIHHs4Controller;
20
21/**
22 * Get all scale instance,use hsInstance to call HS related communication methods.
23 */
24-(NSArray *)getAllCurrentHS4Instace;
25
26@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS5.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS5.h
new file mode 100644
index 0000000..632ca4f
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS5.h
@@ -0,0 +1,141 @@
1//
2// HS5.h
3// testShareCommunication
4//
5// Created by zhiwei jing on 13-10-22.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "HealthUser.h"
11#import "HSMacroFile.h"
12
13
14
15/**
16 HS5
17 */
18@interface HS5 : NSObject
19
20@property (retain, nonatomic) NSString *currentUUID;
21@property (retain, nonatomic) NSString *deviceID;
22@property (retain, nonatomic) NSString *firmwareVersion;
23@property (retain, nonatomic) NSString *modelNumber;
24
25
26
27/**
28 Establish memory and measurement connection
29
30Import Parameters:
31 @param tempUser included properties: userAccount、clientID、clientSecret。
32 userAccount: either email or mobile phone number (mobile phone number is not currently supported yet)
33 height: the height of a user (cm);
34 clientID & clientSecret: the only identification for users of the SDK, requires registration from iHealth administrator, please email: heguangming@ihealthlabs.com.cn for more information.
35
36 Return Parameters:
37 The measurement via SDK will be operated in the case of 1-3, and will be terminated if any of 4-8 occurs. The interface needs to be re-called after analyzing the return parameters.
38 Notice: when a new user registers via SDK, an ‘iHealth disclaimer’ will pop up automatically, and will require the user to agree in order to continue. SDK applications require an Internet connection; UserAuthen_TrySuccess is invalidate for HS5.
39 @param serialNub The only identification of a user,should be reserved in third party apps,provide to other Apps [Range:0~0xFFFFFFF]
40 @param MemorryUserListHS5Data Existing user info in HS5,including serialNub、Position of users. Related key: serialNumber、position
41 @param disposeErrorBlock error codes in transmission process: Errors in HS5
42 */
43-(void)commandCreateUserManageConnectWithUser:(HealthUser *)tempUser currentUserSerialNub:(CurrentSerialNub)serialNub deviceUserList:(MemorryUserListHS5Data) MemorryUserListHS5Data Disposehs5ErrorBlock:(DisposeHS5ErrorBlock)disposeErrorBlock;
44
45/**
46 * Create new user
47 * Use the function if the SerialNub of current user is not included in user list of HS5 and the user number is less than 20
48 * Import parameters:
49 * @param tempUser - included properties: serialNub、age、birthday、height、isAthlete、sex。
50 * serialNub: The only identification for user [Range:0~0x7FFFFFFF]
51 * age:user's age Range:7~99
52 * birthday: User’s birthday, NSDate
53 * height: User’s height, (cm) Range:81~219
54 * isAthlete: If user is an athelete, UserIsAthelete_No: no, UserIsAthelete_Yes: Yes
55 * sex: User’s sex, UserSex_Female: female, UserSex_Male: male
56 * @param tempPosition - Position of user, range: 0~19, pick from empty position that has never been occupied
57 * Return Parameters:
58 * @param disposeHS5Result - Success:Yes,Fail:No.
59 * @param disposeErrorBlock - error codes in transmission process: Errors in HS5
60*/
61-(void)commandCreateUser:(HealthUser *)tempUser position:(uint8_t )tempPosition DisposeHS5Result:(DisposeHS5Result)disposeHS5Result Disposehs5ErrorBlock:(DisposeHS5ErrorBlock)disposeErrorBlock;
62
63
64/**
65 * Edit User Info
66 * If the SerialNub of current user already exists in the user list of HS5, this will be used when user info is changed.
67 *Import Parameters:
68 * @param tempUser - included properties: serialNub、birthday、height、isAthlete、sex,instructions refer to “new user Api”.
69 *Return Parameters:
70 * @param disposeHS5Result - Success:Yes,Fail:No.
71 * @param disposeErrorBlock - error codes in transmission process: Errors in HS5
72 */
73-(void)commandModifyUser:(HealthUser *)tempUser DisposeHS5Result:(DisposeHS5Result)disposeHS5Result Disposehs5ErrorBlock:(DisposeHS5ErrorBlock)disposeErrorBlock;
74
75/**
76 * Delete Specified User
77 * This will be used deleting account in HS5.
78 *Import Parameters:
79 * @param tempUser - included properties: serialNub,instructions refer to “new user Api”.
80 *Return Parameters:
81 * @param disposeHS5Result - Success:Yes,Fail:No.
82 * @param disposeErrorBlock - error codes in transmission proces: Errors in HS5
83 */
84-(void)commandDelteUser:(HealthUser *)tempUser DisposeHS5Result:(DisposeHS5Result)disposeHS5Result Disposehs5ErrorBlock:(DisposeHS5ErrorBlock)disposeErrorBlock;
85
86
87
88
89/**
90 Create memory upload connection
91 Import Parameters:
92 @param tempUser included properties: serialNub [Range:0~0x7FFFFFFF],instructions refer to “new user Api”.
93 Return Parameters:
94 @param disposeHS5Result Success:Yes,Fail:No.
95 @param startTransmission Finish memory transmission.
96 @param progress Memory transmission progress,0.0~1.0.
97 @param memorryData Record data,More details and key refer Measure API. Additionally add time-measure property, related key: date.dataID
98 @param finishTransmission Finish Memory Transmission
99 @param disposeErrorBlock error codes in transmission process: Errors in HS5
100 */
101-(void)commandCreateMemoryWithUser:(HealthUser *)tempUser uploadConnect: (DisposeHS5Result)disposeHS5Result TransferMemorryData:(StartHS5Transmission)startTransmission DisposeProgress:(DisposeHS5Progress)progress MemorryData:(MemorryHS5Data)memorryData FinishTransmission:(FinishHS5Transmission)finishTransmission Disposehs5ErrorBlock:(DisposeHS5ErrorBlock)disposeErrorBlock;
102
103
104/**
105 * Establish Measurement Connection
106 * Import Parameters:
107 * @param tempUser - included properties: serialNub [Range:0~0x7FFFFFFF]、height,instructions refer to “new user Api”.
108 * Return Parameters:
109 * @param unStableHS5Weight - Current weight, (kg) [Value Range:0.0~150.0]
110 * @param stableHS5Weight - Stable weight, (kg) [Value Range:0.0~150.0]
111 * @param impedanceWeight - Weight by impedence, (kg)[Value Range:0.0~150.0]
112 * @param bodyCompositionMeasurements - body info, includes weight(kg) Range:0.0~150.0, fat content(%) Rnage:0.0~100.0, water content(%) Range:0.0~100.0, muscle content(%) Rnage:0.0~100.0, bone mass Range:0.0~25.5, visceral fat level Range:0~255, DCI(Kcal) Range:0~65535. keys: weight, weightFatValue, waterValue, muscleValue, skeletonValue, VFatLevelValue, DCIValue, dataID
113 * @param disposeErrorBlock - error codes in transmission process: Errors in HS5
114 */
115
116-(void)commandCreateMeasureWithUser:(HealthUser *)tempUser unStableWeight:(UnStableHS5Weight)unStableHS5Weight MeasureWeight:(StableHS5Weight)stableHS5Weight ImpedanceType:(ImpedanceWeight)impedanceWeight BodyCompositionMeasurements:(BodyCompositionMeasurements)bodyCompositionMeasurements Disposehs5ErrorBlock:(DisposeHS5ErrorBlock)disposeErrorBlock;
117
118
119
120
121/**
122 Stop Current Action and disconnect
123 Return Parameters:
124 @param disposeHS5Result Success:Yes,Fail:No.
125 @param disposeErrorBlock error codes in endCurrentConnect: Errors in HS5
126 */
127-(void)commandEndCurrentConnect:(DisposeHS5Result)disposeHS5Result Disposehs5ErrorBlock:(DisposeHS5ErrorBlock)disposeErrorBlock;
128/**
129 * Clean HS5
130 * Explanation:Delete current Auten Device and then rebuild connection.
131 * Return Parameters:
132 * @param disposeHS5Result - Success:Yes,Fail:No.
133 * @param disposeErrorBlock - error codes in transmission process: Errors in HS5
134 */
135-(void)commandcleanDeviceDisposeHS5Result:(DisposeHS5Result)disposeHS5Result Disposehs5ErrorBlock:(DisposeHS5ErrorBlock)disposeErrorBlock;
136
137/**
138 * Rebuild UDP connection
139 */
140-(void)commandRebuildUdpLinker;
141@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS5Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS5Controller.h
new file mode 100644
index 0000000..7ad4965
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HS5Controller.h
@@ -0,0 +1,38 @@
1//
2// HS5Controller.h
3// testShareCommunication
4//
5// Created by zhiwei jing on 13-10-22.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "HSMacroFile.h"
11
12
13/**
14 HS5Controller
15 */
16@interface HS5Controller : NSObject
17
18/**
19 * Initialize HS5 controller class
20 */
21+(HS5Controller *)shareIHHs5Controller;
22
23/**
24 * Get all scale instance,use hsInstance to call HS related communication methods.
25 */
26-(NSArray *)getAllCurrentHS5Instace;
27
28//Acquire HS5 data from cloud
29//When connected to the internet, HS5 could upload measurement to cloud to be recorded. Get data in cloud using the below API.
30-(void)getDownloadDataFromCloud:(BlockDataFromCloud )dataBlock;
31
32/*Start search HS5*/
33-(void)commandStartSearchScale;
34
35/*Stop search HS5*/
36-(void)commandStopSearchScale;
37
38@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HSHeader.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HSHeader.h
new file mode 100644
index 0000000..f6f7543
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HSHeader.h
@@ -0,0 +1,25 @@
1//
2// HSHeader.h
3// HSDemoCode
4//
5// Created by zhiwei jing on 14-7-28.
6// Copyright (c) 2014年 zhiwei jing. All rights reserved.
7//
8
9#ifndef HSDemoCode_HSHeader_h
10#define HSDemoCode_HSHeader_h
11
12#import "HealthUser.h"
13#import "HS3.h"
14#import "HS2.h"
15#import "HS4.h"
16#import "HS5.h"
17#import "HS3Controller.h"
18#import "HS2Controller.h"
19#import "HS4Controller.h"
20#import "HS5Controller.h"
21#import "HSMacroFile.h"
22#import "iHealthHS6.h"
23#import "HS2S.h"
24#import "HS2SController.h"
25#endif
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HSMacroFile.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HSMacroFile.h
new file mode 100644
index 0000000..fc3e117
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HSMacroFile.h
@@ -0,0 +1,709 @@
1//
2// HSMacroFile.h
3// HSDemoCode
4//
5// Created by zhiwei jing on 14-7-23.
6// Copyright (c) 2014年 zhiwei jing. All rights reserved.
7//
8
9#import "HealthUser.h"
10
11#ifndef HSDemoCode_HSMacroFile_h
12#define HSDemoCode_HSMacroFile_h
13
14#define RecordLength 16
15
16
17
18/**
19 HS2 Device Error Code
20 */
21typedef NS_ENUM(NSInteger,HS2DeviceError){
22 /// Battery level is low
23 HS2DeviceLowPower = 1,
24 /// The Scale failed to initialize
25 HS2DeviceEr0 = 2,
26 /// Maximum weight has been exceeded
27 HS2DeviceEr1 = 3,
28 /// The Scale can't capture a steady reading
29 HS2DeviceEr2 = 4,
30 /// Bluetooth connection error
31 HS2DeviceEr4 = 5,
32 /// Movement while measuring
33 HS2DeviceEr7 = 6,
34 ///Invalidate
35 HS2DeviceEr8 = 7,
36 /// Scale memory access error
37 HS2DeviceEr9 = 8,
38 /// No memory 9
39 HS2DataZeor = 9,
40 ///Device disconnect
41 HS2DeviceDisconnect = 10,
42 /// Communication error
43 HS2DeviceSendTimeout = 11,
44 /// DeviceRecWeightError
45 HS2DeviceRecWeightError = 12,
46};
47/**
48 HS2S Device Error Code
49 */
50typedef NS_ENUM(int, HS2SDeviceError) {
51 HS2SDeviceError_Unknown = -1,// device send wrong error code
52 HS2SDeviceError_CommunicationTimeout = 0,
53 HS2SDeviceError_ReceivedCommandError,
54 HS2SDeviceError_InputParameterError,
55 HS2SDeviceError_MoreThanMaxNumbersOfUser,
56 HS2SDeviceError_WriteFlashError,
57 HS2SDeviceError_UserNotExist,
58 HS2SDeviceError_StartMeasureError,
59 HS2SDeviceError_MeasureTimeout,
60 HS2SDeviceError_MeasureOverweight,
61 HS2SDeviceError_Disconnect,
62 HS2SDeviceError_Unsupported,
63};
64
65
66/**
67 HS3 Device Error Code
68 */
69typedef NS_ENUM(NSInteger,HS3DeviceError){
70 /// Low battery
71 HS3DeviceLowPower = 1,
72 /// Weight capacity is exceeded
73 HS3DeviceEr2 = 2,
74 /// The Scale calibration error
75 HS3DeviceEr4 = 3,
76 /// Movement while measuring
77 HS3DeviceEr7 = 4,
78 /// No memory
79 HS3DataZeor = 5, //No memory
80 /// Device disconnect
81 HS3DeviceDisconnect = 6,
82 /// Communication error
83 HS3DeviceSendTimeout = 7,
84};
85
86
87/**
88 HS4 Device Error Code
89 */
90typedef NS_ENUM(NSInteger,HS4DeviceError){
91 /// Battery level is low
92 HS4DeviceLowPower = 1, // Battery level is low
93 /// The Scale failed to initialize
94 HS4DeviceEr0 = 2,
95 /// Maximum weight has been exceeded
96 HS4DeviceEr1 = 3,
97 /// The Scale can't capture a steady reading
98 HS4DeviceEr2 = 4,
99 /// Bluetooth connection error
100 HS4DeviceEr4 = 5,
101 /// Movement while measuring
102 HS4DeviceEr7 = 6,
103 /// Invalidate
104 HS4DeviceEr8 = 7,
105 /// Scale memory access error
106 HS4DeviceEr9 = 8,
107 /// No memory
108 HS4DataZeor = 9 ,
109 /// Device disconnect
110 HS4DeviceDisconnect = 10,
111 /// Communication error
112 HS4DeviceSendTimeout = 11, // Communication error
113 /// Device Recive Weight Error
114 HS4DeviceRecWeightError = 12,
115};
116
117/**
118 HS5 error
119 */
120typedef NS_ENUM(NSInteger,HS5DeviceError){
121 /// Communication error
122 IHSCOverTimeError = 0,
123 /// Communication Error
124 IHSCUserInScale=5,
125 /// Make sure batteries are installed correctly, if the problem persists, replace with a new set of batteries.
126 IHSCLowPower=6,
127 /// Remove the batteries, wait 1 minute and then replace with a new set of batteries.
128 IHSCScaleEr0=7,
129 /// The current weight may be beyond the measurement range of 330 lbs/150 kg.
130 IHSCScaleEr1=8,
131 /// Stand still on all four electrodes with bare feet.
132 IHSCScaleEr2=9,
133 /// Communication Error
134 IHSCScaleEr7=10,
135 /// Communication Error
136 IHSCScaleEr8=11,
137 /// Communication Error
138 IHSCScaleEr9=12,
139 /// Scale is busy
140 IHScaleBusy=13,
141 /// No memory
142 HS5DataZeor=14,// No memory
143 /// Scale Create User Test Error
144 IHSCScaleCreateUserTestError = 15,
145 /// Device disconnect
146 HS5Disconnect = 16,
147 /// User verify error
148 HS5UserInvalidate = 400
149};
150
151//HS6 Unit
152
153/**
154 HS6 Unit
155
156 */
157typedef NS_ENUM(NSInteger,IHHS6SDKUnitWeight){
158 /// kg
159 IHHS6SDKUnitWeight_kg = 0,
160 /// lb
161 IHHS6SDKUnitWeight_lbs,
162 /// st
163 IHHS6SDKUnitWeight_oz,
164};
165
166#pragma mark HS2 Block
167
168/**
169 Result
170
171 @param resetSuc reset Success
172 */
173typedef void (^DisposeHS2Result)(BOOL resetSuc);
174
175/**
176 HS4 error
177
178 @param errorID error number
179 */
180typedef void (^DisposeHS2ErrorBlock)(HS2DeviceError errorID);
181
182
183/**
184Start transfer Memory Dictionary(5)
185
186 @param startDataDictionary Memory Data Dictionary
187 */
188typedef void (^StartHS2Transmission)(NSDictionary *startDataDictionary);
189
190/**
191 Memory transmission progress
192
193 @param progress progress 0.0~1.0.
194 */
195typedef void (^DisposeHS2Progress)(NSNumber *progress);
196//data including weight (kg), measurement time,coordinated key:weight,date.
197
198/**
199 historyDataArray including weight (kg), measurement time,coordinated key:weight,date.
200
201 @param historyDataArray historyDataArray
202 */
203typedef void (^HS2MemorryData)(NSArray *historyDataArray);
204
205/**
206 Finish memory transmission.
207 */
208typedef void (^FinishHS2Transmission)(void);
209//Current weight, (Kg)
210
211/**
212 Current unstable weight, (Kg)
213
214 @param unStableWeight unStableWeight
215 */
216typedef void (^HS2UnStableWeight)(NSNumber *unStableWeight);
217//Stable weight, (Kg)
218
219/**
220 StableWeightDictionary including stableweight(kg),time,dataID
221
222 @param StableWeightDic StableWeightDictionary
223 */
224typedef void (^HS2StableWeight)(NSDictionary *StableWeightDic);
225
226/**
227 DisposeSendHS2DataBlock
228 */
229typedef void (^DisposeSendHS2DataBlock)(void);
230
231/**
232 HS2 battery
233
234 @param battary battery
235 */
236typedef void (^DisposeHS2BatteryBlock)(NSNumber *battary);
237
238
239#pragma mark HS3 Block
240/**
241 deviceID
242
243 @param weightID deviceID
244 */
245typedef void(^WeightID)(NSString *weightID);
246//HS3Error
247
248/**
249 HS3 Device Error
250
251 @param errorID errorID
252 */
253typedef void (^DisposeHS3ErrorBlock)(HS3DeviceError errorID);
254
255/**
256 Memory Number,0~200.
257
258 @param uploadDataNum Memory Number
259 */
260typedef void (^DisposeHS3UploadDataNum)(NSNumber *uploadDataNum);
261
262/**
263 Memory transmission progress,0.0~1.0.
264
265 @param progress Transmission progress
266 */
267typedef void (^DisposeHS3Progress)(float progress);
268
269/**
270 historyData including weight(kg), measure time,coordinated key:weight、date.
271
272 @param historyDataDic historyDataDictionary
273 */
274typedef void (^HS3MemorryData)(NSDictionary *historyDataDic);
275//Start transmission
276
277/**
278 Start transmission
279
280 @param startTransmission YES or NO
281 */
282typedef void (^StartHS3Transmission)(BOOL startTransmission);
283
284/**
285 Finish memory transmission.
286 */
287typedef void (^FinishHS3Transmission)(void);
288
289/**
290 Stable weight (Kg)
291
292 @param StableWeightDic StableWeightNSDictionary
293 */
294typedef void (^StableHS3Weight)(NSDictionary *StableWeightDic);
295
296/**
297 FinishHS3Init
298 */
299typedef void (^FinishHS3Init)(void);
300
301/**
302 DisposeResult
303
304 @param resetSuc YES or NO
305 */
306typedef void (^DisposeResult)(BOOL resetSuc);
307
308
309#pragma mark HS4 Block
310/**
311 DisposeResult
312
313 @param resetSuc YES or NO
314 */
315typedef void (^DisposeResult)(BOOL resetSuc);
316
317/**
318 HS4 error
319
320 @param errorID errorID
321 */
322typedef void (^DisposeHS4ErrorBlock)(HS4DeviceError errorID);
323
324/**
325 Start Memory transmission
326
327 @param startDataDictionary startDataDictionary
328 */
329typedef void (^StartHS4Transmission)(NSDictionary *startDataDictionary);
330
331/**
332 Memory transmission progress,0.0~1.0.
333
334 @param progress progress
335 */
336typedef void (^DisposeProgress)(NSNumber *progress);
337
338/**
339 historyDataArray data including weight (kg), measurement time,coordinated key:weight,date.
340
341 @param historyDataArray historyDataArray
342 */
343typedef void (^MemorryData)(NSArray *historyDataArray);
344
345/**
346 Finish memory transmission.
347 */
348typedef void (^FinishHS4Transmission)(void);
349
350/**
351 Current unstableweight, (Kg)
352
353 @param unStableWeight unStableWeight
354 */
355typedef void (^UnStableWeight)(NSNumber *unStableWeight);
356
357/**
358 Stable weight,(Kg)
359
360 @param StableWeightDic StableWeightDictionary
361 */
362typedef void (^StableWeight)(NSDictionary *StableWeightDic);
363
364/**
365 SendHS4DataBlock
366 */
367typedef void (^DisposeSendHS4DataBlock)(void);
368
369
370#pragma mark HS5 Block
371
372/**
373 Existing user info in HS5,including serialNub、Position of users. Related key: serialNumber、position
374
375 @param userListDataArray userListDataArray
376 */
377typedef void (^MemorryUserListHS5Data)(NSArray *userListDataArray);
378
379/**
380 HS5 result
381
382 @param resetSuc reset success
383 */
384typedef void (^DisposeHS5Result)(BOOL resetSuc);
385
386/**
387 HS5 error
388
389 @param errorID errorID
390 */
391typedef void (^DisposeHS5ErrorBlock)(HS5DeviceError errorID);
392
393/**
394 Start memory transmission.
395
396 @param startHS5Transmission startHS5Transmission
397 */
398typedef void (^StartHS5Transmission)(BOOL startHS5Transmission);
399
400/**
401 progress: Memory transmission progress,0.0~1.0.
402
403 @param progress progress
404 */
405typedef void (^DisposeHS5Progress)(NSNumber *progress);
406
407/**
408 Record data,More details and key refer Measure API. Additionally add time-measure property, related key: date.
409
410 @param historyDataDic historyDataDictionary
411 */
412typedef void (^MemorryHS5Data)(NSDictionary *historyDataDic);
413
414/**
415 Finish Memory Transmission
416
417 @param finishHS5Transmission YES or NO
418 */
419typedef void (^FinishHS5Transmission)(BOOL finishHS5Transmission);
420
421/**
422 Current unstableweight, (kg)
423
424 @param unStableWeight unStableWeight
425 */
426typedef void (^UnStableHS5Weight)(NSNumber *unStableWeight);
427
428/**
429 Stable weight, (kg)
430
431 @param StableWeight StableWeight
432 */
433typedef void (^StableHS5Weight)(NSNumber *StableWeight);
434
435/**
436 Weight by impedence, (kg)
437
438 @param ImpedanceWeight ImpedanceWeight
439 */
440typedef void (^ImpedanceWeight)(NSNumber*ImpedanceWeight);
441
442/**
443 body info, includes weight(kg), fat content(%), water content(%), muscle content(%), bone mass, visceral fat level, DCI(Kcal). keys: weight, weightFatValue, waterValue, muscleValue, skeletonValue, VFatLevelValue, DCIValue
444
445
446 @param BodyCompositionInforDic BodyCompositionInforDictionary
447 */
448typedef void (^BodyCompositionMeasurements)(NSDictionary*BodyCompositionInforDic);
449
450/**
451 superPassword
452
453 @param superPassword superPassword
454 */
455typedef void (^GetScaleSuperPassword)(NSString*superPassword);
456
457/**
458 CurrentSerialNub
459
460 @param serialNub serialNub
461 */
462typedef void (^CurrentSerialNub)(NSInteger serialNub);
463
464/**
465 SendHS5DataBlock
466 */
467typedef void (^DisposeSendHS5DataBlock)(void);
468
469
470#pragma mark HS6 Block
471
472/**
473 Set HS6 wifi success with device infomation
474
475 @param deviceInfo deviceInfo
476 */
477typedef void (^DisposeHS6SuccessBlock)(NSDictionary* deviceInfo);
478
479/**
480 Set HS6 wifi fail
481
482 @param failmsg fail message
483 */
484typedef void (^DisposeHS6FailBlock)(NSString* failmsg);
485
486/**
487 Set HS6 end
488
489 @param deviceDic deviceDictionary
490 */
491typedef void (^DisposeHS6EndBlock)(NSDictionary* deviceDic);
492
493/**
494 HS6 error
495
496 @param error error number
497 */
498typedef void (^DisposeHS6ErrorBlock)(NSNumber* error);
499
500/**
501 Binding QR Device
502
503 @param resultArray resultArray
504 */
505typedef void(^BinedQRDeviceBlock)(NSArray *resultArray);
506/**
507 Binding QR Device error
508
509 @param errorCode errorCode
510 */
511typedef void(^BinedQRDeviceErrorBlock)(NSString *errorCode);
512
513/**
514 unbind QRDevice
515
516 @param resultArray resultArray
517 */
518typedef void(^DisBinedQRDeviceBlock)(NSArray *resultArray);
519
520/**
521 unbind QRDevice error
522
523 @param errorCode errorCode
524 */
525typedef void(^DisBinedQRDeviceErrorBlock)(NSString *errorCode);
526
527/**
528 getOpenApi
529
530 @param openAPIInfoDic openAPIInfoDictionary
531 */
532typedef void (^DisposeHS6GetOpenAPISuccessBlock)(NSDictionary* openAPIInfoDic);
533
534/**
535 GetOpenAPIError
536
537 @param errorCode errorCode
538 */
539typedef void (^DisposeHS6GetOpenAPIErrorBlock)(NSDictionary *errorCode);
540
541/**
542 sync Weight Unit
543
544 @param syncWeightUnit syncWeightUnit
545 */
546typedef void (^DisposeHS6SyncWeightUnitSuccessBlock)(BOOL syncWeightUnit);
547
548/**
549 Sync Weight Unit Error
550
551 @param errorCode errorCode
552 */
553typedef void (^DisposeHS6SyncWeightUnitErrorBlock)(NSString *errorCode);
554
555
556//typedef void (^BlockUserAuthentication)(UserAuthenResult result);
557
558/**
559 the result of userID
560
561 @param dataArray dataArray
562 */
563
564typedef void (^BlockDataFromCloud)(NSArray *dataArray);
565
566typedef void (^BlockHS6DataFromCloud)(NSDictionary *dataDic);
567
568typedef void (^BlockHS6LastTSFromCloud)(NSNumber *lastTS);
569
570#pragma mark HS2S Block
571
572
573/**
574 Result
575
576 @param deviceInfo deviceInfo
577 */
578typedef void (^DisposeHS2SDeviceInfo)(NSDictionary*deviceInfo);
579
580/**
581 HS2S error
582
583 @param errorID error number
584 */
585typedef void (^DisposeHS2SErrorBlock)(HS2SDeviceError errorID);
586
587/**
588 HS2S battery
589
590 @param battary battery
591 */
592typedef void (^DisposeHS2SBatteryBlock)(NSNumber *battary);
593
594/**
595 HS2S UserInfo
596
597
598 @param userInfo userInfo
599 */
600typedef void (^DisposeHS2SUserInfo)(NSDictionary*userInfo);
601
602/**
603 Result
604
605 @param result reset Success
606 */
607typedef void (^DisposeHS2SResult)(BOOL result);
608
609/**
610 HS2S memory count
611
612 @param count count
613 */
614typedef void (^DisposeHS2SMemoryCountBlock)(NSNumber *count);
615
616/**
617 HS2S memory data
618
619 @param data data
620 */
621typedef void (^DisposeHS2SMemoryDataBlock)(NSArray *data);
622
623/**
624 HS2S memory count
625
626 @param count count
627 */
628typedef void (^DisposeHS2SAnonymousMemoryCountBlock)(NSNumber *count);
629
630/**
631 HS2S memory data
632
633 @param data data
634 */
635typedef void (^DisposeHS2SAnonymousMemoryDataBlock)(NSArray *data);
636/**
637 Current unstableweight, (Kg)
638
639 @param unStableWeight unStableWeight
640 */
641typedef void (^DisposeHS2SUnStableWeight)(NSNumber *unStableWeight);
642
643/**
644 Stable weight,(Kg)
645
646 @param stableWeight StableWeight
647 */
648typedef void (^DisposeHS2SStableWeight)(NSNumber *stableWeight);
649
650/**
651 weightAndBodyInfoDic
652
653 @param weightAndBodyInfoDic weightAndBodyInfoDic
654 */
655typedef void (^DisposeHS2SWeightAndBodyInfo)(NSDictionary *weightAndBodyInfoDic);
656
657
658/**
659 Heart Result
660
661 @param heartResultDic
662 */
663typedef void (^DisposeHS2SHeartResult)(NSDictionary *heartResultDic);
664
665
666/**
667 MeasurementStatus
668
669 @param measurementStatus
670 */
671typedef void (^DisposeHS2SMeasurementStatus)(NSNumber *measurementStatus);
672
673
674
675typedef void (^DisposeHS2SMeasureFinish)(void);
676
677#define HS3ConnectNoti @"HS3ConnectNoti"
678#define HS3DisConnectNoti @"HS3DisConnectNoti"
679
680#define HS2Discover @"HS2Discover"
681#define HS2ConnectFailed @"HS2ConnectFailed"
682#define HS2ConnectNoti @"HS2ConnectNoti"
683#define HS2DisConnectNoti @"HS2DisConnectNoti"
684
685#define HS2SDiscover @"HS2SDiscover"
686#define HS2SConnectFailed @"HS2SConnectFailed"
687#define HS2SConnectNoti @"HS2SConnectNoti"
688#define HS2SDisConnectNoti @"HS2SDisConnectNoti"
689
690#define HS4Discover @"HS4Discover"
691#define HS4ConnectFailed @"HS4ConnectFailed"
692#define HS4ConnectNoti @"HS4ConnectNoti"
693#define HS4DisConnectNoti @"HS4DisConnectNoti"
694
695
696#define HS5ConnectNoti @"HS5ConnectNoti"
697#define HS5DisConnectNoti @"HS5DisConnectNoti"
698
699#define HSDeviceID @"ID"
700#define HSSDKRightApi @"OpenApiWeight"
701
702
703#define ContinuaHSDiscover @"ContinuaHSDiscover"
704#define ContinuaHSConnectFailed @"ContinuaHSConnectFailed"
705#define ContinuaHSConnectNoti @"ContinuaHSConnectNoti"
706#define ContinuaHSDisConnectNoti @"ContinuaHSDisConnectNoti"
707
708
709#endif
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HealthHeader.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HealthHeader.h
new file mode 100644
index 0000000..83ca80f
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HealthHeader.h
@@ -0,0 +1,67 @@
1//
2// HealthHeader.h
3// iHealthDemoCode
4//
5// Created by zhiwei jing on 1/25/16.
6// Copyright © 2016 zhiwei jing. All rights reserved.
7//
8
9#ifndef HealthHeader_h
10#define HealthHeader_h
11
12typedef NS_ENUM(NSUInteger, HealthDeviceType) {
13 //AM
14 HealthDeviceType_AM3,
15 HealthDeviceType_AM3S,
16 HealthDeviceType_AM4,
17 //BP
18 HealthDeviceType_BP3L,
19 HealthDeviceType_BP5SRW,
20 HealthDeviceType_BP5S,
21 HealthDeviceType_BP7S,
22 HealthDeviceType_KN550BT,
23 HealthDeviceType_KD926,
24 HealthDeviceType_KD723,
25 HealthDeviceType_ABPM,
26 //PO
27 HealthDeviceType_PO3,
28 //HS
29 HealthDeviceType_HS4,
30 HealthDeviceType_HS2,
31 //ECG
32 HealthDeviceType_ECG3,
33 //BG
34 HealthDeviceType_BG5S,
35 //HTS
36 HealthDeviceType_TS28B,
37 HealthDeviceType_CONTINUA_BP,
38 HealthDeviceType_CONTINUA_BG,
39 HealthDeviceType_CONTINUA_PO,
40 HealthDeviceType_CONTINUA_HS,
41 HealthDeviceType_THV3,
42 //BLE Device
43 HealthDeviceType_HS3,
44 HealthDeviceType_HS5,
45 HealthDeviceType_BP3,
46 HealthDeviceType_BP5,
47 HealthDeviceType_BP7,
48 HealthDeviceType_ABI,
49 HealthDeviceType_BG1,
50 HealthDeviceType_BG3,
51 HealthDeviceType_BG5,
52 HealthDeviceType_USBECG,
53 HealthDeviceType_HS6,
54 HealthDeviceType_AM5,
55 HealthDeviceType_BP5C,
56 HealthDeviceType_HS2S,
57 HealthDeviceType_BG1S,
58 HealthDeviceType_NT13B,
59 HealthDeviceType_PT3SBT,
60 HealthDeviceType_PO1,
61};
62
63#import "ScanDeviceController.h"
64#import "ConnectDeviceController.h"
65
66
67#endif /* HealthHeader_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HealthUser.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HealthUser.h
new file mode 100644
index 0000000..03fc9f9
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/HealthUser.h
@@ -0,0 +1,126 @@
1//
2// HealthUser.h
3// iHealthDemoCode
4//
5// Created by jing on 16/5/13.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11
12typedef enum{
13 UserAuthen_RegisterSuccess = 1,//New-user registration succeeded
14 UserAuthen_LoginSuccess,// User login succeeded
15 UserAuthen_CombinedSuccess,// The user is iHealth user as well, measurement via SDK has been activated, and the data from the measurement belongs to the user
16 UserAuthen_TrySuccess,//Testing without Internet connection succeeded
17 UserAuthen_InvalidateUserInfo,//Userid/clientID/clientSecret verification failed
18 UserAuthen_SDKInvalidateRight,//SDK has not been authorized
19 UserAuthen_UserInvalidateRight,//User has not been authorized
20 UserAuthen_InternetError,//Internet error, verification failed
21 UserAuthen_AppSecretVerifySuccess, // appsecrect is right
22 UserAuthen_AppSecretVerifyFailed, //appsecrect error
23 UserAuthen_InputError, //Input error
24 UserAuthen_CertificateExpired, //Certificate expired
25 UserAuthen_InvalidCertificate, //Invalid certificate
26}UserAuthenResult;
27
28//User
29typedef enum{
30 LengthUnit_Mile = 0,
31 LengthUnit_Kilometer,
32}LengthUnit;
33
34typedef enum{
35 UserSex_Female = 0,
36 UserSex_Male,
37}UserSex;
38
39typedef enum{
40 UserType_Guest = 0,
41 UserType_Normal,
42}HS2SUserType;
43typedef enum{
44 HS2SImpedanceMark_NO = 0,
45 HS2SImpedanceMark_YES,
46}HS2SImpedanceMark;
47typedef enum{
48 HS2SFitnessMark_NO = 0,
49 HS2SFitnessMark_YES,
50}HS2SFitnessMark;
51
52typedef enum{
53 HSUnit_Kg = 1, //kg
54 HSUnit_LB, //lb
55 HSUnit_ST //st
56}HSUnit;
57
58typedef enum{
59 UserIsAthelete_No = 0, //No athelete
60 UserIsAthelete_Yes //athelete
61}UserIsAthelete;
62
63
64typedef enum{
65 AppSecretVerifySucess = 1,
66 AppSecretVerifyFailed
67}AppSecretVerifyStatus;
68
69typedef enum{
70 iHealthSDK_BP= 0,
71 iHealthSDK_BG,
72 iHealthSDK_HS,
73 iHealthSDK_PO,
74 iHealthSDK_AM,
75 iHealthSDK_ECG,
76 iHealthSDK_TH,
77 iHealthSDK_All
78}SDKDeviceAccessType;
79
80typedef void(^DisposeSDKUserDeviceAccess)(NSArray*DeviceAccessArray);
81
82typedef void(^DisposeSDKUserValidationSuccess)(UserAuthenResult result);
83
84typedef void(^DisposeSDKUserValidationReturn)(NSString *userID);
85
86typedef void (^DisposeSDKUserValidationErrorBlock)(UserAuthenResult errorID);
87
88
89
90@interface HealthUser : NSObject
91
92
93@property (nonatomic, strong) NSString * clientID;
94@property (nonatomic, strong) NSString * clientSecret;
95@property (nonatomic, strong) NSString * userID;
96@property (nonatomic, strong) NSString * userAccount;
97@property (nonatomic, strong) NSString * certificatePath;
98@property (nonatomic, strong) NSString * certificateSecret;
99
100@property (nonatomic, strong) NSNumber * serialNub;
101@property (nonatomic, strong) NSDate *birthday;
102@property (nonatomic, strong) NSNumber *age;
103
104//unit:cm
105@property (nonatomic, strong) NSNumber * height;
106//kg
107@property (strong, nonatomic)NSNumber *weight;
108//invalidate
109@property (strong, nonatomic)NSNumber *bmr;
110//activityLevel=1, Sedentary,spend most of day sitting.
111//activityLevel=2, Active,spend a good part of day doing some physical activity.
112//activityLevel=3, Very Active,spend most of day doing heavy physical activity.
113@property (strong, nonatomic)NSNumber *activityLevel;
114
115@property UserIsAthelete isAthlete;
116@property UserSex sex;
117@property LengthUnit lengthUnit;
118
119@property HS2SUserType userType;
120@property HS2SImpedanceMark impedanceMark;
121@property HS2SFitnessMark fitnessMark;
122@property NSInteger newDevice;
123@property NSInteger createTS;
124@property (nonatomic, strong) NSData * hs2SUserID;
125
126@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBindEnum.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBindEnum.h
new file mode 100755
index 0000000..f73c91a
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBindEnum.h
@@ -0,0 +1,49 @@
1//
2// IDOBindEnum.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/3.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#ifndef IDOBindEnum_h
10#define IDOBindEnum_h
11
12/**
13 * 绑定状态枚举
14 * Binding status enumeration
15 */
16typedef NS_ENUM(NSInteger, IDO_BIND_STATUS) {
17 /**
18 * 绑定失败
19 * Binding failed
20 */
21 IDO_BLUETOOTH_BIND_FAILED = 0,
22
23 /**
24 * 绑定成功
25 * Binding succeeded
26 */
27 IDO_BLUETOOTH_BIND_SUCCESS,
28
29 /**
30 * 已经绑定
31 * Already bound
32 */
33 IDO_BLUETOOTH_BINDED,
34
35 /**
36 * 需要授权绑定
37 * Need authorization binding
38 */
39 IDO_BLUETOOTH_NEED_AUTH,
40
41 /**
42 * 拒绝绑定
43 * Rejected binding
44 */
45 IDO_BLUETOOTH_REFUSED_BINDED,
46
47};
48
49#endif /* IDOBindEnum_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBlueDataResponse.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBlueDataResponse.h
new file mode 100755
index 0000000..d316b52
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBlueDataResponse.h
@@ -0,0 +1,66 @@
1//
2// IDOBlueDataResponse.h
3// IDOBlueProtocol
4//
5// Created by 何东阳 on 2019/5/8.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import <CoreBluetooth/CoreBluetooth.h>
11
12NS_ASSUME_NONNULL_BEGIN
13
14@interface IDOBlueDataResponse : NSObject
15
16/**
17 * 获取扫描的服务
18 * [manager scanForPeripheralsWithServices:services options:@{CBCentralManagerScanOptionAllowDuplicatesKey:@YES}];
19 * get the scan service
20 */
21+ (NSArray <CBUUID *>*)getScanServices;
22
23/**
24 * 判断当前外围设备是否为OTA模式
25 * whether the current peripheral is in OTA mode
26 */
27+ (BOOL)isOtaModeWithPeripheral:(CBPeripheral *)peripheral;
28
29/**
30 * manager :当前蓝牙管理中心
31 * peripheral : 当前外接设备
32 * serviceIndex : 当前发现服务的索引 默认传0不作服务索引判断
33 * current bluetooth management center
34 * current bluetooth peripheral
35 * serviceIndex : the index of the current discovered service is set to 0 by default without service index judgment
36 */
37+ (void)blueManager:(CBCentralManager *)manager
38 peripheral:(CBPeripheral *)peripheral
39 serviceIndex:(NSInteger)serviceIndex
40 didConnected:(void(^)(BOOL isOta))callback;
41
42/**
43 * 连接外围设备成功后发现外围设备特征
44 * - (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error
45 * after successfully connecting the peripheral device, peripheral device characteristics are found.
46 */
47+ (void)findCharac:(CBPeripheral *)peripheral
48 service:(CBService *)service;
49
50/**
51 * 蓝牙接收到手环返回的数据
52 * - (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
53 * bluetooth receives data from the ring
54 */
55+ (void)didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic;
56
57/**
58 * 蓝牙写完数据的回调
59 * - (void)peripheral:(CBPeripheral *)peripheral didWriteValueForCharacteristic:(CBCharacteristic *)characteristic error:(nullable NSError *)error
60 * bluetooth writes a callback to the data
61 */
62+ (void)didWriteValueForCharacteristic:(CBCharacteristic *)characteristic
63 error:(NSError *)error;
64@end
65
66NS_ASSUME_NONNULL_END
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBlueEnum.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBlueEnum.h
new file mode 100755
index 0000000..2303091
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBlueEnum.h
@@ -0,0 +1,213 @@
1//
2// IDOBlueEnum.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/3.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#ifndef IDOBlueEnum_h
10#define IDOBlueEnum_h
11
12/**
13 * 蓝牙扫描设备模式枚举
14 * Bluetooth scanning device mode enumeration
15 */
16typedef NS_ENUM(NSInteger, IDO_SCAN_DEVICE_MODE) {
17 /**
18 * 手机蓝牙关闭或不支持蓝牙功能将不能扫描设备
19 * Mobile phone Bluetooth off or not supporting Bluetooth will not scan the device
20 */
21 IDO_DO_NOT_SCAN_MODE = 0,
22
23 /**
24 * 手动扫描连接模式
25 * Manual scan connection mode
26 */
27 IDO_MANUAL_SCAN_CONNECT_MODE,
28
29 /**
30 * 系统蓝牙列表扫描连接模式
31 * System bluetooth list scan connection mode
32 */
33 IDO_SYSTEM_LIST_SCAN_CONNECT_MODE,
34
35 /**
36 * 自动扫描连接模式
37 * MAutomatic scan connection mode
38 */
39 IDO_AUTO_SCAN_CONNECT_MODE,
40
41};
42
43/**
44 * 蓝牙管理状态枚举
45 * Bluetooth management status enumeration
46 */
47typedef NS_ENUM(NSInteger, IDO_BLUETOOTH_MANAGER_STATE) {
48 /**
49 * 蓝牙关闭
50 * Bluetooth off
51 */
52 IDO_MANAGER_STATE_POWEREDOFF = 1,
53
54 /**
55 * 蓝牙打开
56 * Bluetooth open
57 */
58 IDO_MANAGER_STATE_POWEREDON,
59
60 /**
61 * 蓝牙自动扫描中
62 * Bluetooth automatic scanning
63 */
64 IDO_MANAGER_STATE_AUTO_SCANING,
65
66 /**
67 * 在ota模式自动连接
68 * Automatically connect in ota mode
69 */
70 IDO_MANAGER_STATE_AUTO_OTA_CONNECT,
71
72 /**
73 * 普通模式自动连接
74 * Normal mode automatic connection
75 */
76 IDO_MANAGER_STATE_AUTO_CONNECT,
77
78 /**
79 * 蓝牙扫描停止
80 * Bluetooth scan stop
81 */
82 IDO_MANAGER_STATE_SCAN_STOP,
83
84 /**
85 * 蓝牙手动扫描中
86 * Bluetooth manual scanning
87 */
88 IDO_MANAGER_STATE_MANUAL_SCANING,
89
90 /**
91 * 在ota模式手动连接
92 * Manually connect in ota mode
93 */
94 IDO_MANAGER_STATE_MANUAL_OTA_CONNECT,
95
96 /**
97 * 普通模式手动连接
98 * Normal mode manual connection
99 */
100 IDO_MANAGER_STATE_MANUAL_CONNECT,
101
102 /**
103 * 手环连接成功
104 * The bracelet is connected successfully
105 */
106 IDO_MANAGER_STATE_DID_CONNECT,
107
108 /**
109 * 手环连接失败
110 * Bracelet connection failed
111 */
112 IDO_MANAGER_STATE_CONNECT_FAILED,
113
114 /**
115 * 手环断开连接
116 * Bracelet dis connect
117 */
118 IDO_MANAGER_STATE_DIS_CONNECT
119};
120
121
122/**
123 * 蓝牙连接错误类型枚举
124 * Bluetooth connection error type enumeration
125 */
126typedef NS_ENUM(NSInteger, IDO_BLUETOOTH_CONNECT_ERROR_TYPE) {
127 /**
128 * UUID 为空蓝牙不能自动连接
129 * UUID is Empty, Bluetooth cannot be automatically connected
130 */
131 IDO_BLUETOOTH_UUID_EMPTY_TYPE = 1,
132
133 /**
134 * MAC地址为空ota模式蓝牙不能自动连接
135 * The MAC address is empty. ota mode Bluetooth cannot be automatically connected.
136 */
137 IDO_BLUETOOTH_MAC_ADDR_EMPTY_TYPE,
138
139 /**
140 * 未绑定设备蓝牙不能自动连接
141 * Unbound device Bluetooth cannot be automatically connected.
142 */
143 IDO_BLUETOOTH_UNBOUND_TYPE,
144
145 /**
146 * 蓝牙关闭不能自动连接
147 * Bluetooth off does not automatically connect.
148 */
149 IDO_BLUETOOTH_POWERED_OFF_TYPE,
150
151 /**
152 * 外围设备不存在
153 * Peripheral device does not exist
154 */
155 IDO_BLUETOOTH_PERIPHERAL_DON_EXIST,
156
157 /**
158 * 蓝牙自动模式断开连接
159 * Bluetooth auto mode disconnect
160 */
161 IDO_BLUETOOTH_AUTO_DIS_CONNECT_TYPE,
162
163 /**
164 * 蓝牙手动模式断开连接
165 * Bluetooth manual mode disconnect
166 */
167 IDO_BLUETOOTH_MANUAL_DIS_CONNECT_TYPE,
168
169 /**
170 * 蓝牙连接失败
171 * Bluetooth connection failed
172 */
173 IDO_BLUETOOTH_CONNECT_FAIL_TYPE,
174
175 /**
176 * 蓝牙连接超时
177 * Bluetooth connection timeout
178 */
179 IDO_BLUETOOTH_CONNECT_TIME_OUT_TYPE,
180
181 /**
182 * 蓝牙扫描连接超时
183 * Bluetooth scan connection timed out
184 */
185 IDO_BLUETOOTH_SCAN_CONNECT_TIME_OUT_TYPE,
186
187 /**
188 * 蓝牙发现外围设备服务失败
189 * Bluetooth discovery peripheral service failed
190 */
191 IDO_BLUETOOTH_DISCOVER_SERVICE_FAIL_TYPE,
192
193 /**
194 * 蓝牙发现外围设备服务不存在
195 * Bluetooth discovery peripheral service does not exist
196 */
197 IDO_BLUETOOTH_DISCOVER_SERVICE_NO_EXIST_TYPE,
198
199 /**
200 * 蓝牙发现外围设备特征失败
201 * Bluetooth discovery peripheral feature failed
202 */
203 IDO_BLUETOOTH_DISCOVER_CHARACTERISTICS_TYPE,
204
205 /**
206 * 蓝牙数据交换错误
207 * Bluetooth data exchange error
208 */
209 IDO_BLUETOOTH_DATA_EXCHANGE_ERROR_TYPE
210
211};
212
213#endif /* IDOBlueEnum_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothBaseModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothBaseModel.h
new file mode 100755
index 0000000..4d9ffbe
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothBaseModel.h
@@ -0,0 +1,112 @@
1//
2// IDOBluetoothInfo.h
3// VeryfitSDK
4//
5// Created by hedongyang on 2018/6/13.
6// Copyright © 2018年 hedongyang. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11@interface IDOBluetoothBaseModel : NSObject
12
13@property (copy,readonly,nonatomic,nullable) NSArray<NSString *> * originColumnNames;
14@property (copy,readonly,nonatomic,nullable) NSArray<NSString *> * columnNames;
15@property (copy,readonly,nonatomic,nullable) NSArray<NSString *> * columnTypes;
16
17@property (nonatomic,assign) NSInteger pk;
18
19@property (nonatomic,copy,nullable) NSString * macAddr;
20@property (nonatomic,copy,nullable) NSString * uuidStr;
21@property (nonatomic,copy,nullable) NSString * deviceId;
22@property (nonatomic,copy,nullable) NSString * version;
23@property (nonatomic,copy,nullable) NSString * deviceName;
24@property (nonatomic,copy,nullable) NSString * userId;
25@property (nonatomic,assign) NSInteger migrationState;
26
27/**
28 * @brief 数据引擎为model赋值 | Assigned to the model
29 */
30- (void)assignment;
31
32/**
33 * @brief model创建表 | Create a table
34 * @return 是 或 否 | yes or no
35 */
36- (BOOL)createTable;
37
38/**
39 * @brief model 单个数据存储 | Single data storage
40 * @return 是 或 否 | yes or no
41 */
42- (BOOL)save;
43
44/**
45 * @brief model 单个数据更新 | Single data update
46 * @return 是 或 否 | yes or no
47 */
48- (BOOL)update;
49
50/**
51 * @brief model 单个数据存储或更新 | Single data storage or update
52 * @return 是 或 否 | yes or no
53 */
54- (BOOL)saveOrUpdate;
55
56/**
57 * @brief model 单个数据删除 (*不建议使用) | Model single data deletion (*Not recommended)
58 * @return 是 或 否 | yes or no
59 */
60- (BOOL)del;
61
62/**
63 * @brief model 通过Mac地址查询单个数据 多用于蓝牙设置查询
64 * The model queries individual data by Mac address, which is mostly used for bluetooth setting query
65 * @return 根据设备ID 查询获取最后一个model 不存在会初始化一个新的对象
66 * Getting the last model based on the device ID query does not initialize a new object
67 */
68+ (IDOBluetoothBaseModel *_Nullable)queryCurrentModel;
69
70/**
71 * @brief 自定义查询语句 | Custom query statements
72 * @param sqlStr 查询语句 | Database query for example @"WHERE mac_addr = '%@'"
73 * @return model 集合 | Array
74 */
75+ (NSArray <IDOBluetoothBaseModel *>*_Nullable)queryModelsWithSqlStr:(NSString *_Nullable)sqlStr;
76
77/**
78 * @brief 自定义删除语句 | Custom delete statement
79 * @param sqlStr 删除语句 | Delete sqlStr for example @"WHERE mac_addr = '%@'"
80 * @return yes or no
81 */
82+ (BOOL)deleteModelsWithSqlStr:(NSString *_Nullable)sqlStr;
83
84/**
85 * @brief 批量存储或更新model | Bulk store or update models
86 * @param models model 集合 | Array
87 * @return 是 或 否 | yes or no
88 */
89
90+ (BOOL)saveOrUpdateModels:(NSArray <IDOBluetoothBaseModel *>*_Nullable)models;
91
92/**
93 * @brief 批量存储model | Bulk store models
94 * @param models model 集合 | Array
95 * @return 是 或 否 | yes or no
96 */
97+ (BOOL)saveModels:(NSArray <IDOBluetoothBaseModel *>*_Nullable)models;
98
99/**
100 * @brief 批量删除model (*不建议使用) | Delete models in bulk (*Not recommended)
101 * @param models model 集合 | Array
102 * @return 是 或 否 | yes or no
103 */
104+ (BOOL)deleteModels:(NSArray <IDOBluetoothBaseModel *>*_Nullable)models;
105
106/**
107 * @brief 删除对应的数据库表数据 (*不建议使用) | Delete the corresponding database table data (*Not recommended)
108 * @return 是 或 否 | yes or no
109 */
110+ (BOOL)deleteCurrentTable;
111
112@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothEngine.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothEngine.h
new file mode 100755
index 0000000..fe0fd1c
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothEngine.h
@@ -0,0 +1,283 @@
1//
2// IDOBluetoothEngine.h
3// VeryfitSDK
4//
5// Created by hedongyang on 2018/5/31.
6// Copyright © 2018年 hedongyang. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import <CoreBluetooth/CoreBluetooth.h>
11
12#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
13#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
14#else
15#import "IDOGetInfoBluetoothModel.h"
16#endif
17
18@interface IDOBluetoothManagerInfoEngine : NSObject
19
20/**
21 * 蓝牙管理中心 | Bluetooth Management Center
22 */
23@property (nonatomic,strong) CBCentralManager * centralManager;
24
25/**
26 * 外围设备 | Peripherals
27 */
28@property (nonatomic,strong) CBPeripheral * peripheral;
29
30/**
31 * 蓝牙是否开启 | Is Bluetooth enabled?
32 */
33@property (nonatomic,assign,readonly,getter=isPoweredOn) BOOL poweredOn;
34
35/**
36 * 蓝牙是否连接 | Bluetooth is connected
37 */
38@property (nonatomic,assign,readonly,getter=isConnected) BOOL connected;
39
40/**
41 * 蓝牙是否正在连接中 | Bluetooth is connecting
42 */
43@property (nonatomic,assign,readonly,getter=isConnecting) BOOL connecting;
44
45/**
46 * 命令服务特征 | Command Service Features
47 */
48@property (nonatomic,strong) CBCharacteristic * commandCharacteristic;
49
50/**
51 * 健康服务特征 | Health Service Features
52 */
53@property (nonatomic,strong) CBCharacteristic * healthCharacteristic;
54
55/**
56 * 锐捷定制发送服务特征 | Ruijie write service Features
57 */
58@property (nonatomic,strong) CBCharacteristic * customWriteCharacteristic;
59
60/**
61 * 功能列表 | Function List
62 */
63@property (nonatomic,strong) IDOGetDeviceFuncBluetoothModel * funcTableModel;
64
65@end
66
67@interface IDOBluetoothPeripheralInfoEngine : NSObject
68
69/**
70 * 当前连接外围设备的uuid | uuid currently connected to peripherals
71 */
72@property (nonatomic,copy) NSString * uuidStr;
73
74/**
75 * 当前连接设备ID | Current connection device ID
76 */
77@property (nonatomic,copy) NSString * deviceId;
78
79/**
80 * 当前连接设备名字 | Current connected device name
81 */
82@property (nonatomic,copy) NSString * deviceName;
83
84/**
85 * 当前连接设备固件版本号 | Current connected device firmware version number
86 */
87@property (nonatomic,copy) NSString * version;
88
89/**
90 * 当前连接设备Mac地址 | Currently connected device Mac address
91 */
92@property (nonatomic,copy) NSString * macAddr;
93
94/**
95 * 当前连接设备授权码 | Currently connected device authorization code
96 */
97@property (nonatomic,copy) NSString * authCode;
98
99/**
100 * 当前设备连接成功的时间 | The time the current device was successfully connected
101 */
102@property (nonatomic,strong) NSDate * connectedDate;
103
104/**
105 * 当前连接设备模式 | Current connected device mode
106 */
107@property (nonatomic,assign) NSInteger deviceMode;
108
109/**
110 * 当前连接设备状态 | Current connected device status
111 */
112@property (nonatomic,assign) NSInteger battStatus;
113
114/**
115 * 当前连接设备电量 | Current connected device power
116 */
117@property (nonatomic,assign) NSInteger battLevel;
118
119/**
120 * 当前连接设备是否重启 | Is the current connected device restarted?
121 */
122@property (nonatomic,assign) NSInteger rebootFlag;
123
124/**
125 * 当前连接设备授权码长度 | Current connection device authorization code length
126 */
127@property (nonatomic,assign) NSInteger authLength;
128
129/**
130 * 当前设备绑定的时间戳 | Current connection device binding timestamp
131 */
132@property (nonatomic,assign) NSInteger bindTime;
133
134/**
135 * 手环的平台 | platform for bracelet
136 * 0:nordic, 10:realtek 8762x ,20:cypress psoc6,30:Apollo3
137 */
138@property (nonatomic,assign) NSInteger platform;
139
140/**
141 * 当前连接设备是否绑定 | Is the current connected device bound?
142 */
143@property (nonatomic,assign) BOOL isBind;
144
145/**
146 * 当前连接设备是否配对中 | Is the current connected device pairing?
147 */
148@property (nonatomic,assign) BOOL isPairing;
149
150/**
151 * 当前连接设备是否ota | Is the current connected device ota?
152 */
153@property (nonatomic,assign) BOOL isOta;
154
155@end
156
157@interface IDOBluetoothUserInfoEngine : NSObject
158
159/**
160 * 用户ID | User ID
161 */
162@property (nonatomic,copy) NSString * userId;
163
164/**
165 * 用户生日 (例如:2018-10-01) | | User birthday (example: 2018-10-01)
166 */
167@property (nonatomic,copy) NSString * birthday;
168
169/**
170 * 用户目标步数 | User target steps
171 */
172@property (nonatomic,assign) NSInteger goalStepCount;
173
174/**
175 * 目标睡眠 (分钟) | Target sleep (minutes)
176 */
177@property (nonatomic,assign) NSInteger goalSleepMinute;
178
179/**
180 * 目标卡路里 | Goal Calories
181 */
182@property (nonatomic,assign) NSInteger goalCalorieData;
183
184/**
185 * 目标距离 | Target distance
186 */
187@property (nonatomic,assign) NSInteger goalDistanceData;
188
189/**
190 * 目标体重 (千克) | Target weight (kg)
191 */
192@property (nonatomic,assign) NSInteger goalWeight;
193
194/**
195 * 用户性别 | User gender
196 */
197@property (nonatomic,assign) NSInteger sex;
198
199/**
200 * 用户体重 | User weight
201 */
202@property (nonatomic,assign) NSInteger weight;
203
204/**
205 * 用户升高 | User rises
206 */
207@property (nonatomic,assign) NSInteger height;
208
209/**
210 * 是否登陆 | Login
211 */
212@property (nonatomic,assign) BOOL isLogin;
213
214@end
215
216@interface IDOBluetoothAppInfoEngine : NSObject
217
218/**
219 * 设备名字 | Device Name
220 */
221@property (nonatomic,copy) NSString * iphoneName;
222
223/**
224 * 手机系统版本 | Mobile phone system version
225 */
226@property (nonatomic,copy) NSString * sysVersion;
227
228/**
229 * sdk版本 | sdk version
230 */
231@property (nonatomic,copy) NSString * sdkVersion;
232
233@end
234
235@interface IDOBluetoothUnitInfoEngine : NSObject
236
237/**
238 * 时间格式是否12小时制 | Is the time format 12-hour format?
239 */
240@property (nonatomic,assign) BOOL is12Hour;
241
242/**
243 * 语言单位 | Language unit
244 */
245@property (nonatomic,assign) NSInteger language;
246
247/**
248 * 距离单位 | Distance unit
249 */
250@property (nonatomic,assign) NSInteger distUnit;
251
252/**
253 * 体重单位 | Weight unit
254 */
255@property (nonatomic,assign) NSInteger weightUnit;
256
257/**
258 * 温度单位 | Temperature unit
259 */
260@property (nonatomic,assign) NSInteger tempUnit;
261
262/**
263 * 走路步伐单位 | Walking pace unit
264 */
265@property (nonatomic,assign) NSInteger strideWalkUnit;
266
267/**
268 * 跑步步伐单位 | Running pace unit
269 */
270@property (nonatomic,assign) NSInteger strideRunUnit;
271
272@end
273
274@interface IDOBluetoothEngine : NSObject
275+ (IDOBluetoothEngine *)shareInstance;
276- (void)deserialization;
277@property (nonatomic,strong) IDOBluetoothManagerInfoEngine * managerEngine;
278@property (nonatomic,strong) IDOBluetoothPeripheralInfoEngine * peripheralEngine;
279@property (nonatomic,strong) IDOBluetoothUserInfoEngine * userEngine;
280@property (nonatomic,strong) IDOBluetoothAppInfoEngine * appEngine;
281@property (nonatomic,strong) IDOBluetoothUnitInfoEngine * unitEngine;
282@end
283
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothManager.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothManager.h
new file mode 100755
index 0000000..72c1a0b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothManager.h
@@ -0,0 +1,166 @@
1//
2// IDOBluetoothManager.h
3// VeryfitSDK
4//
5// Created by hedongyang on 2018/6/4.
6// Copyright © 2018年 hedongyang. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import <CoreBluetooth/CoreBluetooth.h>
11#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
12#elif __has_include(<IDOBluetooth/IDOBluetooth.h>)
13#else
14#import "IDOBlueEnum.h"
15#import "IDOPeripheralModel.h"
16#endif
17
18@class IDOBluetoothManager;
19
20@protocol IDOBluetoothManagerDelegate<NSObject>
21
22/**
23 * @brief 扫描所有外围设备 | Scan all peripherals
24 * @param manager IDO蓝牙管理中心 | IDO Bluetooth Management Center
25 * @param allDevices 扫描所有外围设备(包括OTA设备集合) | Scan all peripherals (including OTA device collections)
26 * @param otaDevices OTA 设备集合 | OTA Device Collection
27 */
28- (void)bluetoothManager:(IDOBluetoothManager *)manager
29 allDevices:(NSArray <IDOPeripheralModel *>*)allDevices
30 otaDevices:(NSArray <IDOPeripheralModel *>*)otaDevices;
31
32
33/**
34 * @brief 连接设备成功回调 | Connected device successfully callback
35 * @param manager IDO蓝牙管理中心 | IDO Bluetooth Management Center
36 * @param centerManager 蓝牙管理中心 | Bluetooth Management Center
37 * @param peripheral 外围设备 | Peripherals
38 * @param isOtaMode 连接是否在OTA模式 | Is the connection in OTA mode?
39 * @return 是或否 | yes or no
40 */
41- (BOOL)bluetoothManager:(IDOBluetoothManager *)manager
42 centerManager:(CBCentralManager *)centerManager
43 didConnectPeripheral:(CBPeripheral *)peripheral
44 isOatMode:(BOOL)isOtaMode;
45
46/**
47 * @brief 蓝牙管理状态 | Bluetooth management status
48 * @param manager IDO蓝牙管理中心 | IDO Bluetooth Management Center
49 * @param state 状态 | Status
50 */
51- (void)bluetoothManager:(IDOBluetoothManager *)manager
52 didUpdateState:(IDO_BLUETOOTH_MANAGER_STATE)state;
53
54/**
55 * @brief 连接设备错误回调,当解绑设备断开连接时不会回调此方法
56 * Connection Device Error Callback,This method is not called back when the unbound device is disconnected.
57 * @param manager IDO蓝牙管理中心 | IDO Bluetooth Management Center
58 * @param error 错误信息 | Error message
59 */
60- (void)bluetoothManager:(IDOBluetoothManager *)manager
61 connectPeripheralError:(NSError *)error;
62
63@end
64
65@interface IDOBluetoothManager : NSObject
66
67/**
68 设置代理 | Setting up the agent
69 */
70@property (nonatomic,weak) id<IDOBluetoothManagerDelegate> delegate;
71
72/**
73 * 自动扫描连接超时时长 默认 20
74 * Auto Scan Connection Timeout Duration Default 20
75 */
76@property (nonatomic,assign) NSInteger timeout;
77
78/**
79 * 设置扫描过滤信号弱的设备 默认值 80 大于80会被过滤
80 * Set the device with weak scan filtering signal. Default value 80 is greater than 80 will be filtered.
81 */
82@property (nonatomic,assign) NSInteger rssiNum;
83
84/**
85 * 是否启动超时,间隔扫描 默认 yes 默认10秒间隔扫描一次
86 * Whether to start timeout, interval scan Default yes Default scan at 10-second intervals
87 */
88@property (nonatomic,assign) BOOL isIntervalScan;
89
90/**
91 * 是否需要重连机制 默认 YES 如果设置 NO 断线后不会重连
92 * Whether a reconnect mechanism is required,if NO set,connection will not be reconnected
93 */
94@property (nonatomic,assign) BOOL isReconnect;
95
96/**
97 * 设置扫描间隔时长 默认 10秒 如果不启动超时间隔扫描,则无效
98 * Set the scan interval to 10 seconds by default.if timeout interval scanning is not started, it is not valid.
99 */
100@property (nonatomic,assign) NSInteger autoScanInterval;
101
102/**
103 蓝牙扫描设备模式 | Bluetooth Scanning Device Mode
104 */
105@property (nonatomic,assign,readonly) IDO_SCAN_DEVICE_MODE scanMode;
106
107/**
108 蓝牙管理连接状态 | Bluetooth management connection status
109 */
110@property (nonatomic,assign,readonly) IDO_BLUETOOTH_MANAGER_STATE state;
111
112/**
113 蓝牙连接错误码 | Bluetooth connection error code
114 */
115@property (nonatomic,assign,readonly) IDO_BLUETOOTH_CONNECT_ERROR_TYPE errorCode;
116
117/**
118 * 手动点击连接设备的总时长
119 * Total time to manually click on the connected device
120 */
121@property (nonatomic,assign,readonly) NSInteger manualConnectTotalTime;
122
123/**
124 * 自动扫描到成功连接设备的总时长
125 * Total time from automatic scanning to successful connection to the device
126 */
127@property (nonatomic,assign,readonly) NSInteger autoConnectTotalTime;
128
129/**
130 * @brief 初始化IDO蓝牙管理中心对象
131 * Initialize IDO the Bluetooth Management Center object
132 * @return IDOBluetoothManager
133 */
134+ (__kindof IDOBluetoothManager *)shareInstance;
135
136/**
137 * @brief 初始化系统蓝牙管理中心对象并刷新蓝牙代理
138 * Initializes the system bluetooth management center object and refreshes the bluetooth delegate
139 */
140+ (void)refreshDelegate;
141
142/**
143 开始扫描 | Start scanning
144 */
145+ (void)startScan;
146
147/**
148 停止扫描 | Stop scanning
149 */
150+ (void)stopScan;
151
152/**
153 * @brief 1、普通模式下选择外围设备连接 2、ota模式下选择外围设备连接
154 * 1. Select peripheral device connection in normal mode
155 * 2. Select peripheral device connection in ota mode
156 * @param model IDOPeripheralModel 对象 | IDOPeripheralModel object
157 */
158+ (void)connectDeviceWithModel:(IDOPeripheralModel *)model;
159
160/**
161 断开当前外围设备的连接 | Disconnect the current peripheral device
162 */
163+ (void)cancelCurrentPeripheralConnection;
164
165@end
166
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothServices.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothServices.h
new file mode 100755
index 0000000..e26ee59
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOBluetoothServices.h
@@ -0,0 +1,75 @@
1//
2// IDOBluetoothServices.h
3// VeryfitSDK
4//
5// Created by apple on 2018/8/22.
6// Copyright © 2018年 hedongyang. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
11#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
12#else
13#import "IDOGetInfoBluetoothModel.h"
14#endif
15
16// 蓝牙扫描、连接状态通知监听名字 | Bluetooth scan, connection status notification listener name
17extern NSString * _Nonnull IDOBluetoothConnectStateNotifyName;
18
19// 蓝牙扫描、连接过程错误通知监听名字 | Bluetooth scan, connection process error notification listener name
20extern NSString * _Nonnull IDOBluetoothConnectErrorNotifyName;
21
22// 蓝牙主动断开通知监听名字,多在配对和固件升级使用 | Bluetooth disconnect notification listener name
23extern NSString * _Nonnull IDOBluetoothDisconnectNotifyName;
24
25// 蓝牙主动开始扫描通知监听名字,多在配对和固件升级使用 | Bluetooth start scan notification listener name
26extern NSString * _Nonnull IDOBluetoothStartScanNotifyName;
27
28// 蓝牙主动停止扫描通知监听名字,多在配对和固件升级使用 | Bluetooth stop scan notification listener name
29extern NSString * _Nonnull IDOBluetoothStopScanNotifyName;
30
31// 当前连接的手环设备为OTA模式通知监听名字 | The currently connected bracelet device is OTA mode notification listener name
32extern NSString * _Nonnull IDOBluetoothOtaModeNotifyName;
33
34// 蓝牙日志打开记录通知名字 | Bluetooth log opens record notification name
35extern NSString * _Nonnull IDOBluetoothOpenLogRecordNotifyName;
36
37// 数据迁移状态通知名字 | Data migration status notification name
38extern NSString * _Nonnull IDOBluetoothDataMigrationNotifyName;
39
40@interface IDOBluetoothServices : NSObject
41
42/*
43 是否输出蓝牙sdk运行日志 | Whether to output the Bluetooth sdk running log
44 */
45@property (nonatomic,copy,nullable) IDOBluetoothServices *_Nonnull(^outputSdkLog)(BOOL isOutput);
46
47/*
48 是否输出蓝牙协议运行日志 | Whether to output the Bluetooth protocol running log
49 */
50@property (nonatomic,copy,nullable) IDOBluetoothServices *_Nonnull(^outputProtocolLog)(BOOL isOutput);
51
52/*
53 是否记录原始数据日志 | Whether to log raw data
54 */
55@property (nonatomic,copy,nullable) IDOBluetoothServices *_Nonnull(^rawDataLog)(BOOL isRecord);
56
57/*
58 是否添加阿里云日志 默认 No | Add Alibaba Cloud Log Default No
59 */
60@property (nonatomic,copy,nullable) IDOBluetoothServices *_Nonnull(^addAliYunLog)(BOOL isAdd);
61
62/**
63 * 注册SDK服务后,初始化设备信息并返回,需开始启动蓝牙,根据各自业务需求,可以选择自己的APP创建蓝牙管理,也可以使用我们提供的库创建蓝牙管理.
64 * After the SDK service is registered, the device information is initialized and returned, and bluetooth needs to be started.
65 * According to their business needs, they can choose their own APP to create bluetooth management, or they can use the library we provide to create bluetooth management.
66 */
67@property (nonatomic,copy,nullable) void(^startScanBule)(void(^ _Nullable getDeviceInfoBlock)(IDOGetDeviceInfoBluetoothModel * _Nullable model));
68
69/**
70 * @brief 注册SDK服务,初始化设备信息 | Register for SDK service,initializes device info
71 * @return IDOBluetoothServices
72 */
73IDOBluetoothServices * _Nonnull registrationServices(void);
74
75@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOCalculateBluetoothModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOCalculateBluetoothModel.h
new file mode 100755
index 0000000..df10198
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOCalculateBluetoothModel.h
@@ -0,0 +1,263 @@
1//
2// IDOCalculateBluetoothModel.h
3// IDOBluetooth
4//
5// Created by 何东阳 on 2018/10/16.
6// Copyright © 2018年 apple. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
11#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
12#else
13#import "IDOSyncSpo2DataModel.h"
14#import "IDOSyncBpDataModel.h"
15#import "IDOSyncHeartRateDataModel.h"
16#import "IDOSyncSleepDataModel.h"
17#import "IDOSyncSportDataModel.h"
18#endif
19
20struct ido_blood_pressure_data
21{
22 uint32_t sysBlood;
23 uint32_t diasBlood;
24};
25
26@interface IDOCalculateBluetoothModel : NSObject
27
28@end
29
30@interface IDOCalculateBloodOxygenBluetoothModel : NSObject
31/**
32 平均血氧 | Average blood oxygen
33 */
34@property (nonatomic,assign) NSInteger avgBloodOxygen;
35
36/**
37 最大血氧 | Maximum blood oxygen
38 */
39@property (nonatomic,assign) NSInteger maxBloodOxygen;
40
41/**
42 最小血氧 | Most blood oxygen
43 */
44@property (nonatomic,assign) NSInteger minBloodOxygen;
45
46/**
47 计算一天血氧平均值 | Calculate the average blood oxygen per day
48 */
49+ (__kindof IDOCalculateBloodOxygenBluetoothModel *)calculateOneDayBoDataWithHrModel:(__kindof IDOSyncBloodOxygenDataInfoBluetoothModel *)model;
50/**
51 计算一周、一月血氧平均值 | Calculate the blood oxygen average for one week and one month
52 */
53+ (__kindof IDOCalculateBloodOxygenBluetoothModel *)calculateOneMonthOrWeekBoDataWithHrModels:(NSArray <__kindof IDOSyncBloodOxygenDataInfoBluetoothModel *>*)models;
54/**
55 计算一年血氧平均值 | Calculate the annual blood oxygen average
56 */
57+ (__kindof IDOCalculateBloodOxygenBluetoothModel *)calculateOneYearBoDataWithHrModels:(NSArray <NSArray<__kindof IDOSyncBloodOxygenDataInfoBluetoothModel *>*> *)models;
58
59@end
60
61@interface IDOCalculateBpBluetoothModel : NSObject
62
63/**
64 记录血压日期时间戳 | Record blood pressure date time stamp
65 */
66@property (nonatomic,copy) NSString * dateStr;
67
68/**
69 最大血压值 struct | Maximum blood pressure value
70 */
71@property (nonatomic,assign) struct ido_blood_pressure_data maxBp;
72
73/**
74 最小血压值 struct | Minimum blood pressure value
75 */
76@property (nonatomic,assign) struct ido_blood_pressure_data minBp;
77
78/**
79 平均血压值 struct | Average blood pressure value
80 */
81@property (nonatomic,assign) struct ido_blood_pressure_data avgBp;
82
83/**
84 最新血压值 struct | Latest blood pressure value
85 */
86@property (nonatomic,assign) struct ido_blood_pressure_data lastBp;
87
88/**
89 计算一天血压平均值 | Calculate the average blood pressure per day
90 */
91+ (__kindof IDOCalculateBpBluetoothModel *)calculateOneDayBpDataWithBpModel:(__kindof IDOSyncBpDataInfoBluetoothModel *)model;
92
93/**
94 计算一周、一月血压平均值 | Calculate the average blood pressure for one week and one month
95 */
96+ (__kindof IDOCalculateBpBluetoothModel *)calculateOneMonthOrWeekBpDataWithBpModels:(NSArray <__kindof IDOSyncBpDataInfoBluetoothModel *>*)models
97 allDayCalculateBpModels:(NSArray <__kindof IDOCalculateBpBluetoothModel *> **)calculateBpModels;
98
99@end
100
101
102@interface IDOCalculateHrBluetoothModel : NSObject
103
104/**
105 平均心率 | Average heart rate
106 */
107@property (nonatomic,assign) NSInteger avgHr;
108
109/**
110 最大心率 | Maximum heart rate
111 */
112@property (nonatomic,assign) NSInteger maxHr;
113
114/**
115 最小心率 | Most careful rate
116 */
117@property (nonatomic,assign) NSInteger minHr;
118
119/**
120 脂肪燃烧时长 (单位 :分钟) | Fat burning Duration (unit: minute)
121 */
122@property (nonatomic,assign) NSUInteger burnFatMins;
123
124/**
125 肌肉锻炼时长 [有氧运动] (单位 :分钟) | Muscle training Duration (unit: minute)
126 */
127@property (nonatomic,assign) NSUInteger aerobicMins;
128
129/**
130 极限运动时长 (单位 :分钟) | Extreme Sports Duration (unit: minutes)
131 */
132@property (nonatomic,assign) NSUInteger limitMins;
133
134/**
135 热身运动时长 (单位 :分钟) | Warm up Duration (unit: minutes)
136 */
137@property (nonatomic,assign) NSUInteger warmUpMins;
138
139/**
140 无氧运动时长 (单位 :分钟) | Anaerobic Duration (unit: minutes)
141 */
142@property (nonatomic,assign) NSUInteger anaerobicMins;
143
144/**
145 * 计算一天心率平均值 | Calculate the average heart rate per day
146 * 只能传入 IDOSyncHrDataInfoBluetoothModel 和 IDOSyncSecHrDataInfoBluetoothModel 对象
147 * Only IDOSyncHrDataInfoBluetoothModel and IDOSyncSecHrDataInfoBluetoothModel object
148 */
149+ (__kindof IDOCalculateHrBluetoothModel *)calculateOneDayHrDataWithHrModel:(__kindof IDOBluetoothBaseModel *)model;
150/**
151 * 计算一周、一月心率平均值 | Calculate the heart rate average for one week and one month
152 * 只能传入 IDOSyncHrDataInfoBluetoothModel 和 IDOSyncSecHrDataInfoBluetoothModel 对象
153 * Only IDOSyncHrDataInfoBluetoothModel and IDOSyncSecHrDataInfoBluetoothModel object
154 */
155+ (__kindof IDOCalculateHrBluetoothModel *)calculateOneMonthOrWeekHrDataWithHrModels:(NSArray <__kindof IDOBluetoothBaseModel *>*)models;
156/**
157 * 计算一年心率平均值 | Calculate the annual heart rate average
158 * 只能传入 IDOSyncHrDataInfoBluetoothModel 和 IDOSyncSecHrDataInfoBluetoothModel 对象
159 * Only IDOSyncHrDataInfoBluetoothModel and IDOSyncSecHrDataInfoBluetoothModel object
160 */
161+ (__kindof IDOCalculateHrBluetoothModel *)calculateOneYearHrDataWithHrModels:(NSArray <NSArray<__kindof IDOBluetoothBaseModel *>*> *)models;
162
163@end
164
165@interface IDOCalculateSleepBluetoothModel : NSObject
166
167/**
168 平均一天睡眠时长 (单位 :分钟) | Average one-day sleep duration (in minutes)
169 */
170@property (nonatomic,assign) NSInteger avgSleep;
171
172/**
173 平均一天深睡眠时长 (单位 :分钟) | Average one-day deep sleep duration (unit: minute)
174 */
175@property (nonatomic,assign) NSInteger avgDeepSleep;
176
177/**
178 平均一天浅睡眠时长 (单位 :分钟) | Average day light sleep duration (unit: minute)
179 */
180@property (nonatomic,assign) NSInteger avgLightSleep;
181
182/**
183 平均一天醒来时长 (单位 :分钟) | Average wake-up time of one day (unit: minute)
184 */
185@property (nonatomic,assign) NSInteger avgWakeSleep;
186
187/**
188 平均入睡时间点 (格式 :00:00) | Average sleep time (format: 00:00)
189 */
190@property (nonatomic,copy) NSString * sleepTime;
191
192/**
193 平均醒来时间点(格式 :00:00) | Average wake-up time (format: 00:00)
194 */
195@property (nonatomic,copy) NSString * wakeTime;
196
197/**
198 计算一天睡眠平均值 | Calculate the average daily sleep
199 */
200+ (__kindof IDOCalculateSleepBluetoothModel *)calculateOneDaySleepDataWithSleepModel:(__kindof IDOSyncSleepDataInfoBluetoothModel *)model;
201
202/**
203 计算-周、一月睡眠平均值 | Calculation - Week, January sleep average
204 */
205+ (__kindof IDOCalculateSleepBluetoothModel *)calculateOneMonthOrWeekSleepDataWithSleepModels:(NSArray <__kindof IDOSyncSleepDataInfoBluetoothModel *>*)models;
206
207/**
208 计算一年睡眠平均值 | Calculate the average sleep value for one year
209 */
210+ (__kindof IDOCalculateSleepBluetoothModel *)calculateOneYearSleepDataWithSleepModels:(NSArray <NSArray<__kindof IDOSyncSleepDataInfoBluetoothModel *>*> *)models;
211
212@end
213
214@interface IDOCalculateSportBluetoothModel : NSObject
215
216/**
217 总运动里程(单位 :米) | Total mileage (in meters)
218 */
219@property (nonatomic,assign) NSInteger totalMileage;
220
221/**
222 总步数 (单位 :步数) | Total steps (unit: steps)
223 */
224@property (nonatomic,assign) NSInteger totalStep;
225
226/**
227 总卡路里 (单位 :大卡) | Total calories (unit: big card)
228 */
229@property (nonatomic,assign) NSInteger totalCalories;
230
231/**
232 平均里程(单位 :米) | Average mileage (in meters)
233 */
234@property (nonatomic,assign) NSInteger avgMileage;
235
236/**
237 平均步数(单位 :步数) | Average steps (unit: steps)
238 */
239@property (nonatomic,assign) NSInteger avgStep;
240
241/**
242 平均卡路里(单位 :大卡) | Average calories (unit: big card)
243 */
244@property (nonatomic,assign) NSInteger avgCalories;
245
246/**
247 计算一天步数平均值 | Calculate the average number of steps per day
248 */
249+ (__kindof IDOCalculateSportBluetoothModel *)calculateOneDaySportDataWithSportModel:(__kindof IDOSyncSportDataInfoBluetoothModel *)model;
250
251/**
252 计算-周、一月步数平均值 | Calculation - Week, January Step Average
253 */
254+ (__kindof IDOCalculateSportBluetoothModel *)calculateOneMonthOrWeekSportDataWithSportModels:(NSArray <__kindof IDOSyncSportDataInfoBluetoothModel *>*)models;
255
256/**
257 计算一年步数平均值 | Calculate the average number of steps in a year
258 */
259+ (__kindof IDOCalculateSportBluetoothModel *)calculateOneYearSportDataWithSportModels:(NSArray <NSArray<__kindof IDOSyncSportDataInfoBluetoothModel *>*> *)models;
260
261@end
262
263
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOCommonMacro.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOCommonMacro.h
new file mode 100755
index 0000000..f7ca286
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOCommonMacro.h
@@ -0,0 +1,89 @@
1//
2// IDOCommonMacro.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/7/8.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#ifndef IDOCommonMacro_h
10#define IDOCommonMacro_h
11
12#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
13#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
14#else
15#import "IDOBluetoothEngine.h"
16#endif
17
18/**
19 IDO 当前手环蓝牙引擎 | IDO current bracelet Bluetooth engine
20 */
21#define IDO_BLUE_ENGINE [IDOBluetoothEngine shareInstance]
22
23/**
24 IDO 当前手环蓝牙功能列表 | IDO Current Bracelet Bluetooth Feature List
25 */
26#define __IDO_FUNCTABLE__ IDO_BLUE_ENGINE.managerEngine.funcTableModel
27
28/**
29 IDO 当前蓝牙系统管理对象 | IDO Current Bluetooth System Management Object
30 */
31#define __IDO_MANAGER__ IDO_BLUE_ENGINE.managerEngine.centralManager
32
33/**
34 IDO 当前外围设备对象 | IDO Current Peripheral Object
35 */
36#define __IDO_PERIPHERAL__ IDO_BLUE_ENGINE.managerEngine.peripheral
37
38/**
39 IDO 当前外围设备是否连接 | IDO Current Peripheral is connected
40 */
41#define __IDO_CONNECTED__ IDO_BLUE_ENGINE.managerEngine.connected
42
43/**
44 IDO 当前外围设备是否连接中 | IDO Current Peripheral is connecting
45 */
46#define __IDO_CONNECTING__ IDO_BLUE_ENGINE.managerEngine.connecting
47
48/**
49 IDO 当前蓝牙管理中心是否开启 | IDO Current blue manager is powered on
50 */
51#define __IDO_POWERED_ON__ IDO_BLUE_ENGINE.managerEngine.poweredOn
52
53/**
54 IDO 当前手环UUID | IDO Current Bracelet UUID
55 */
56#define __IDO_UUID__ IDO_BLUE_ENGINE.peripheralEngine.uuidStr
57
58/**
59 IDO 当前手环MAC | IDO Current Bracelet MAC
60 */
61#define __IDO_MAC_ADDR__ IDO_BLUE_ENGINE.peripheralEngine.macAddr
62
63/**
64 IDO 当前手环绑定状态 | IDO Current Bracelet Binding Status
65 */
66#define __IDO_BIND__ IDO_BLUE_ENGINE.peripheralEngine.isBind
67
68/**
69 IDO 当前手环配对中状态 | IDO Current Bracelet pairing Status
70 */
71#define __IDO_PAIRING__ IDO_BLUE_ENGINE.peripheralEngine.isPairing
72
73/**
74 IDO 用户ID | IDO User ID
75 */
76#define __IDO_USER_ID__ IDO_BLUE_ENGINE.userEngine.userId
77
78/**
79 IDO 当前手环ota状态 | IDO current bracelet ota status
80 */
81#define __IDO_OTA__ IDO_BLUE_ENGINE.peripheralEngine.isOta
82
83/**
84 IDO 当前手环名字 | IDO Current Bracelet Name
85 */
86#define __IDO_NAME__ IDO_BLUE_ENGINE.peripheralEngine.deviceName
87
88
89#endif /* IDOCommonMacro_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDODataExchangeModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDODataExchangeModel.h
new file mode 100755
index 0000000..3709425
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDODataExchangeModel.h
@@ -0,0 +1,128 @@
1//
2// IDODataExchangeModel.h
3// IDOBluetooth
4//
5// Created by apple on 2018/10/5.
6// Copyright © 2018年 apple. All rights reserved.
7//
8
9#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
10#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
11#else
12#import "IDOBluetoothBaseModel.h"
13#endif
14
15@interface IDODataExchangeModel : IDOBluetoothBaseModel
16/**
17 日 | day
18 */
19@property (nonatomic,assign) NSInteger day;
20/**
21 时 | hour
22 */
23@property (nonatomic,assign) NSInteger hour;
24/**
25 分 | minute
26 */
27@property (nonatomic,assign) NSInteger minute;
28/**
29 秒 | second
30 */
31@property (nonatomic,assign) NSInteger second;
32/**
33 运动类型 | sport type
34 * 0:无,1:走路,2:跑步,3:骑行,4:徒步,5:游泳,6:爬山,7:羽毛球,8:其他,
35 * 9:健身,10:动感单车,11:椭圆机,12:跑步机,13:仰卧起坐,14:俯卧撑,15:哑铃,16:举重,
36 * 17:健身操,18:瑜伽,19:跳绳,20:乒乓球,21:篮球,22:足球 ,23:排球,24:网球,
37 * 25:高尔夫球,26:棒球,27:滑雪,28:轮滑,29:跳舞,48:户外跑步,49:室内跑步,50:户外骑行,51:室内骑行,
38 * 52:户外走路,53:室内走路,54:泳池游泳,55:开放水域游泳,56:椭圆机,57:划船机,58:高强度间歇训练法
39 * 0: none, 1: walk, 2: run, 3: ride, 4: hike, 5: swim, 6: climb, 7: badminton, 8: others,
40 * 9: fitness, 10: spinning, 11: elliptical, 12: treadmill, 13: sit-ups, 14: push-ups, 15: dumbbells, 16: weightlifting,
41 * 17: aerobics, 18: yoga, 19: jump rope, 20: table tennis, 21: basketball, 22: football, 23: volleyball, 24: tennis,
42 * 25: golf, 26: baseball, 27: skiing, 28: roller skating, 29: dancing,48: outdoor running, 49: indoor running, 50: outdoor cycling, 51: indoor cycling,
43 * 52: outdoor walking, 53: indoor walking, 54: pool swimming, 55: open water swimming, 56: elliptical machine, 57: rowing machine, 58: high-intensity interval training
44 */
45@property (nonatomic,assign) NSInteger sportType;
46/**
47 目标类型 | target type
48 */
49@property (nonatomic,assign) NSInteger targetType;
50/**
51 目标数值 | target value
52 */
53@property (nonatomic,assign) NSInteger targetValue;
54/**
55 是否强制开始 | is mandatory start
56 */
57@property (nonatomic,assign) NSInteger forceStart;
58/**
59 * 0:成功; 1:设备已经进入运动模式失败;2: 设备电量低失败;3:手环正在充电
60 * 0:success 1:into sport mode failed 2:Low power of equipment 3: the bracelet is charging
61 */
62@property (nonatomic,assign) NSInteger retCode;
63/**
64 status:0:全部有效, 1:距离无效, 2: gps 信号弱 | status 0:all effective 1:distance invalid 2:gps signal weak
65 */
66@property (nonatomic,assign) NSInteger status;
67/**
68 0:成功; 1:设备已经进入运动模式失败 | 0:success 1:into sport mode failed
69 */
70@property (nonatomic,assign) NSInteger errorCode;
71/**
72 步数 (单位:步) | step
73 */
74@property (nonatomic,assign) NSInteger step;
75/**
76 卡路里 (单位:J) | calories
77 */
78@property (nonatomic,assign) NSInteger calories;
79/**
80 距离 (单位:米) | distance
81 */
82@property (nonatomic,assign) NSInteger distance;
83/**
84 持续时间 (单位:分钟) | durations
85 */
86@property (nonatomic,assign) NSInteger durations;
87/**
88 是否存储 | is save
89 */
90@property (nonatomic,assign) BOOL isSave;
91/**
92 平均心率 | avg heart rate
93 */
94@property (nonatomic,assign) NSInteger avgHrValue;
95/**
96 最大心率 | max heart rate
97 */
98@property (nonatomic,assign) NSInteger maxHrValue;
99/**
100 脂肪燃烧时长 (分钟) | burn fat mins (mins)
101 */
102@property (nonatomic,assign) NSInteger burnFatMins;
103/**
104 心肺锻炼时长(分钟) | cardiopulmonary exercise mins
105 */
106@property (nonatomic,assign) NSInteger aerobicMins;
107/**
108 极限锻炼时长(分钟) | limit exercise mins
109 */
110@property (nonatomic,assign) NSInteger limitMins;
111/**
112 当前心率 | current heart rate
113 */
114@property (nonatomic,assign) NSInteger curHrValue;
115/**
116 心率间隔 | heart rate interval
117 */
118@property (nonatomic,assign) NSInteger intervalSecond;
119/**
120 序列号 | heart rate value serial
121 */
122@property (nonatomic,assign) NSInteger hrValueSerial;
123/**
124 心率数据 | heart rate data
125 */
126@property (nonatomic,copy) NSArray<NSNumber *> * hrValues;
127
128@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDODataMigrationManager.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDODataMigrationManager.h
new file mode 100755
index 0000000..67c4ae0
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDODataMigrationManager.h
@@ -0,0 +1,79 @@
1//
2// IDODataMigrationManager.h
3// IDOBluetooth
4//
5// Created by 何东阳 on 2018/12/7.
6// Copyright © 2018年 apple. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11@interface IDODataMigrationManager : NSObject
12
13/**
14 * 删除本地数据迁移状态(用于本地数据库表删除数据使用) | Delete local data migration state (used for local database table deletion data)
15 */
16+ (BOOL)deleteDataMigrationState;
17
18/**
19 * 是否需要数据迁移,只有需要迁移才会有下面迁移的启动和回调,新的项目不需要执行数据迁移,注意的问题数据迁移是在异步操作,⚠️在数据量大时比较耗时,尽量在执行完数据迁移再去执行其他工作.
20 * Whether data migration is required, only the migration and the callback of the following migration are required.
21  * New projects do not need to perform data migration, pay attention to the problem data migration is in asynchronous operation,
22  * ⚠️ It is time consuming when the amount of data is large, try to perform other tasks after performing data migration.
23 */
24+ (BOOL)isNeedMigration;
25
26/**
27 * 判断当前是否在迁移数据
28 * Determine if data is currently being migrated.
29 */
30+ (BOOL)isMigrationRun;
31
32/**
33 * 启动数据迁移
34 * Start data migration
35 */
36+ (void)dataMigrationStart;
37
38/**
39 * 数据迁移进度 (0-1)
40 * progress (0-1)
41 */
42+ (void)dataMigrationProgressBlock:(void(^_Nullable)(float progress))callback;
43
44/**
45 * 数据迁移完成 direNames 传入不能删除的目录名字集合,在Documents中其他的目录会在迁移完数据全部删除,
46 * ⚠️如果不传入目录集合,除了sdk新创建的目录不删除之外其他都会删除,所以根据开发需求自行传入目录名字集合
47 * Data migration is completed direNames is passed to the collection of directory names that cannot be deleted. In the other directories in Documents,
48 * all the data will be deleted after the migration.⚠️if you do not pass the directory collection, except for the newly created directory of sdk,
49 * it will be deleted,so you will pass the directory name collection according to the development requirements.
50 */
51+ (void)dataMigrationWithFileNames:(NSArray *_Nullable)names
52 completeBlock:(void(^_Nullable)(BOOL isSuccess))callback;
53
54
55/**
56 * 启动数据库转换json文件 ⚠️ 在数据量大时比较耗时,尽量在执行完数据迁移再去执行其他工作.
57 * 1、若传入json文件路径存在,先把json文件数据同步到数据库中,然后合并的数据库再转成json文件;
58 * 2、若传入json文件路径为空,只把本地数据库转成json文件,并返回json文件压缩路径;
59 * 3、jsonDirePath 是从云端下载的健康json文件目录路径;
60 * start the database to convert the json file ⚠️ it is time consuming when the amount of data is large,try to perform other tasks after performing the data migration.
61 * 1. If the path to the json file exists, synchronize the json file data to the database, and then merge the database into a json file.
62 * 2. If the path to the json file is empty, only convert the local database to a json file and return the path to the json file zip.
63 * 3. jsonDirePath is the path to the healthy json file directory downloaded from the cloud.
64 */
65+ (void)dataToJsonFileStart:(NSString *_Nullable)jsonZipPath;
66
67/**
68 数据转换json文件进度 (0-1) | Data conversion json file progress (0-1)
69 */
70+ (void)dataToJsonFileProgressBlock:(void(^_Nullable)(float progress))callback;
71
72/**
73 数据转换json文件完成
74 zipPath 本地数据库转换json文件压缩路径
75 Data conversion json file completed newDirePath local database conversion json file zip path
76 */
77+ (void)dataToJsonFileCompleteBlock:(void(^_Nullable)(BOOL isSuccess,NSString * _Nullable zipPath))callback;
78
79@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOErrorCodeToStr.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOErrorCodeToStr.h
new file mode 100755
index 0000000..8dbb529
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOErrorCodeToStr.h
@@ -0,0 +1,19 @@
1//
2// IDOErrorCodeToStr.h
3// VeryfitSDK
4//
5// Created by hedongyang on 2018/8/30.
6// Copyright © 2018年 hedongyang. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11@interface IDOErrorCodeToStr : NSObject
12
13/**
14 * @brief 错误码转字符串 | Error code to string
15 * @param errorCode 错误码 | Error code
16 * @return 字符串 | string
17 */
18+ (NSString *)errorCodeToStr:(NSInteger)errorCode;
19@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOFoundationCommand.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOFoundationCommand.h
new file mode 100755
index 0000000..cd9b67e
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOFoundationCommand.h
@@ -0,0 +1,1178 @@
1//
2// IDOAllOrder.h
3// VeryfitSDK
4//
5// Created by hedongyang on 2018/6/12.
6// Copyright © 2018年 hedongyang. All rights reserved.
7//
8
9
10
11#import <Foundation/Foundation.h>
12#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
13#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
14#else
15#import "IDOBindEnum.h"
16#import "IDOBluetoothBaseModel.h"
17#import "IDOGetInfoBluetoothModel.h"
18#import "IDOSetInfoBluetoothModel.h"
19#import "IDODataExchangeModel.h"
20#endif
21
22@interface IDOFoundationCommand : NSObject
23
24#pragma mark ======= control Command =======
25
26/**
27 设备进入ota模式通知 | Notification of device enter ota mode
28 */
29+ (void)didOta;
30
31/**
32 设备退出ota模式通知 | Notification of device exit ota mode
33 */
34+ (void)disOta;
35
36/**
37 断开发送通知 | Disconnect notification
38 */
39+ (void)disConnect;
40
41/**
42 * 连接失败通知 | connection failed
43 */
44+ (void)connectionFailed;
45
46/**
47 * 发送提示消息 (只用于DH项目中) | Send prompt message (used only for DH)
48 */
49+ (void)sendPromptInformation:(NSString*_Nullable)info;
50
51/**
52 * @brief 音乐开始 | Music begins
53 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
54 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
55 */
56+ (void)musicStartCommand:(void(^_Nullable)(int errorCode))callback;
57
58/**
59 * @brief 音乐结束 | End of music
60 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
61 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
62 */
63+ (void)musicStopCommand:(void(^_Nullable)(int errorCode))callback;
64
65/**
66 * @brief 相机开始 | Camera starts
67 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
68 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
69 */
70+ (void)cameraStartCommand:(void(^_Nullable)(int errorCode))callback;
71
72/**
73 * @brief 相机结束 | Camera ends
74 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
75 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
76 */
77+ (void)cameraStopCommand:(void(^_Nullable)(int errorCode))callback;
78
79/**
80 * @brief 开始寻找设备 | Start looking for equipment
81 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
82 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
83 */
84+ (void)findDeviceStartCommand:(void(^_Nullable)(int errorCode))callback;
85
86/**
87 * @brief 结束寻找设备 | End finding equipment
88 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
89 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
90 */
91+ (void)findDeviceStopCommand:(void(^_Nullable)(int errorCode))callback;
92
93/**
94 * @brief 打开ANCS(苹果通知中心) | Open ANCS (Apple Notification Center)
95 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
96 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
97 */
98+ (void)belOpenAncsCommand:(void(^_Nullable)(int errorCode))callback;
99
100/**
101 * @brief 关闭ANCS(苹果通知中心) | Close ANCS (Apple Notification Center)
102 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
103 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
104 */
105+ (void)belCloseAncsCommand:(void(^_Nullable)(int errorCode))callback;
106
107/**
108 * @brief 设备绑定 | Device Binding
109 * @param bindModel 绑定 model (IDOSetBindingInfoBluetoothModel) (只有在授权绑定才会存储数据)
110 * Binding model (IDOSetBindingInfoBluetoothModel) (Data will only be stored if the binding is authorized)
111 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
112 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
113 */
114+ (void)bindingCommand:(IDOSetBindingInfoBluetoothModel * _Nullable)bindModel
115 callback:(void (^_Nullable)(IDO_BIND_STATUS status, int errorCode))callback;
116
117/**
118 * @brief 连线设备解绑 | Unbundling equipment
119 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
120 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
121 */
122+ (void)unbindingCommand:(void(^_Nullable)(int errorCode))callback;
123
124/**
125 * @brief 解绑切换设备,但不删除手环和app数据 | switch device not delete the bracelet and app data
126 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
127 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
128 */
129+ (void)switchDeviceCommand:(void(^_Nullable)(int errorCode))callback;
130
131/**
132 * @brief 设备强制解绑,设备连接时,双方解绑,设备断开时,app单方解绑 | Device forced unbundling
133 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
134 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
135 */
136+ (void)mandatoryUnbindingCommand:(void(^_Nullable)(int errorCode))callback;
137
138/**
139 * @brief 手环主动解绑 | Active unbinding of the bracelet
140 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str,state:0x00:无效,0x01:手环已经解绑)
141 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr,state:0x00:invalid,0x01:bracelet has been untied)
142 */
143+ (void)braceletUnbundlingCommand:(void(^_Nullable)(int errorCode,int state))callback;
144
145/**
146 * @brief 设备配置复位 | Device Configuration Reset
147 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
148 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
149 */
150+ (void)setDefaultConfigCommand:(void(^_Nullable)(int errorCode))callback;
151
152/**
153 * @brief 控制设备重启(重启设备后手环会马上断线) | Control device restart (The bracelet disconnects immediately after restarting the device)
154 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
155 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
156 */
157+ (void)setAppRebootCommand:(void(^_Nullable)(int errorCode))callback;
158
159/**
160 * @brief 获取扩展功能列表 | Get the list of extended features
161 * @param callback 执行回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
162 * Execute callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
163 */
164+ (void)getFuncTableExCommand:(void(^_Nullable)(int errorCode))callback;
165
166/**
167 * @brief 设备进入ota升级模式 | The device enters the ota upgrade mode.
168 * @param callback 执行回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
169 * Execute callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
170 * state 0x00 : 成功;0x01 :电量过低;0x02 :设备不支持;0x03 :参数不正确 | 0x00: success; 0x01: low power; 0x02: device not supported; 0x03: parameter error
171 */
172+ (void)setOtaCommand:(void(^_Nullable)(int state , int errorCode))callback;
173
174/**
175 * @brief 手环检查版本号 | The bracelet checks the version number.
176 * @param model | check update version numbder model
177 * @param callback 执行回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
178 * Execute callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
179 * state 0x00 : 请求成功;0x01 :发生失败;
180 * state 0x00: success; 0x01: failed;
181 */
182+ (void)checkUpdateReplyCommand:(IDOCheckUpdateBluetoothModel *_Nullable)model
183 callback:(void(^_Nullable)(int state , int errorCode))callback;
184
185#pragma mark ======= set Command =======
186
187/**
188 * @brief 设置授权码绑定 | Set Authorization Code Binding
189 * @param bindModel 绑定 model (IDOSetBindingInfoBluetoothModel) | binding model
190 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
191 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
192 */
193+ (void)setAuthCodeCommand:(IDOSetBindingInfoBluetoothModel * _Nullable)bindModel callback:(void(^_Nullable)(int errorCode))callback;
194
195/**
196 * @brief 设置当前时间 | Set current time
197 * @param timeModel 时间 model (IDOSetTimeInfoBluetoothModel) | time model (IDOSetTimeInfoBluetoothModel)
198 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
199 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
200 */
201+ (void)setCurrentTimeCommand:(IDOSetTimeInfoBluetoothModel * _Nullable)timeModel callback:(void(^_Nullable)(int errorCode))callback;
202
203/**
204 * @brief 设置闹钟 | Set an alarm
205 * @param alarmModel 闹钟 model (IDOSetAlarmInfoBluetoothModel) | Alarm clock model (IDOSetAlarmInfoBluetoothModel)
206 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
207 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
208 */
209+ (void)setAlarmCommand:(IDOSetAlarmInfoBluetoothModel * _Nullable)alarmModel callback:(void(^_Nullable)(int errorCode))callback;
210
211/**
212 * @brief 批量设置闹钟 | Set alarms in batches
213 * @param alarmModels 闹钟集合 model (IDOSetAlarmInfoBluetoothModel) | Alarm clock collection model (IDOSetAlarmInfoBluetoothModel)
214 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
215 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
216 */
217+ (void)setAllAlarmsCommand:(NSArray <IDOSetAlarmInfoBluetoothModel *> * _Nullable)alarmModels callback:(void(^_Nullable)(int errorCode))callback;
218
219/**
220 * @brief 设置用户信息 | Setting user information
221 * @param userModel 用户信息 model (IDOSetUserInfoBuletoothModel) | User Information model (IDOSetUserInfoBuletoothModel)
222 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
223 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
224 */
225+ (void)setUserInfoCommand:(IDOSetUserInfoBuletoothModel * _Nullable)userModel callback:(void(^_Nullable)(int errorCode))callback;
226
227/**
228 * @brief 设置卡路里和距离目标 | Set calories and distance targets
229 * @param userModel 用户信息 model (IDOSetUserInfoBuletoothModel) | User Information model (IDOSetUserInfoBuletoothModel)
230 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
231 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
232 */
233+ (void)setCalorieAndDistanceGoalCommand:(IDOSetUserInfoBuletoothModel * _Nullable)userModel callback:(void (^ _Nullable)(int errorCode))callback;
234
235/**
236 * @brief 设置目标 | Setting goals
237
238 * @param targetModel 目标信息 model (IDOSetUserInfoBuletoothModel) | targetModel target information model (IDOSetUserInfoBuletoothModel)
239 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
240 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
241 */
242+ (void)setTargetInfoCommand:(IDOSetUserInfoBuletoothModel * _Nullable)targetModel callback:(void(^_Nullable)(int errorCode))callback;
243
244/**
245 * @brief 设置通知中心、来电提醒开关 ⚠️在配对过程中不要执行其他命令。如果设备没有配对,会发起配对,等配对成功后再执行设置子开关状态,需要配对耗时比较长请监听回调。
246 * Set up notification center, call alert switch.⚠️Do not execute other commands during pairing.
247 * If there is no pairing on the device, a pairing will be initiated, and the sub-switch state will be set after the pairing is successful.
248 * If pairing takes a long time, please listen for the callback.
249 * @param noticModel 通知开关信息 model (IDOSetNoticeInfoBuletoothModel)
250 * Notification switch information model (IDOSetNoticeInfoBuletoothModel)
251 * @param callback 设置后配对过程状态回调 stateCode:0x00为不明异常超时,0x01为系统配对成功,0x02为取消配对,isNeedDisconnect:是否需要断开重连,is need to disconnect and reconnect
252 * stateCode :0x00 indicates an unknown abnormal timeout,0x01 indicates successful system pairing, and 0x02 indicates unpairing
253 * @param complete 设置后完成配对回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
254 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
255 */
256+ (void)setSwitchNoticeCommand:(IDOSetNoticeInfoBuletoothModel * _Nullable)noticModel
257 callback:(void (^_Nullable)(BOOL isNeedDisconnect,int stateCode))callback
258 complete:(void (^_Nullable)(int errorCode))complete;
259
260/**
261 * @brief 设置通知中心、来电提醒开关,此方法只设置子开关状态。
262 * Set up notification center, call alert switch.method sets only the subswitch state
263 * @param noticModel 通知开关信息 model (IDOSetNoticeInfoBuletoothModel)
264 * Notification switch information model (IDOSetNoticeInfoBuletoothModel)
265 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
266 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
267 */
268+ (void)setChildSwitchNoticeStateCommand:(IDOSetNoticeInfoBuletoothModel * _Nullable)noticModel callback:(void (^_Nullable)(int errorCode))callback;
269
270/**
271 * @brief 设置蓝牙配对 (不可重复设置,会引起无法再连接设备.只要配对成功,就不需要再设置,只有获取到系统配对设备被忽略,才可设置配对。⚠️在配对过程中不要执行其他命令。)
272 * Set up Bluetooth pairing (cannot be set repeatedly, it will cause the device to be connected again. As long as the pairing is successful,
273 * you don't need to set it again. Only when the system pairing device is ignored, the pairing can be set.⚠️Do not execute other commands during pairing.)
274 * @param callback 设置后配对过程状态回调 stateCode:0x00为不明异常超时,0x01为系统配对成功,0x02为取消配对,isNeedDisconnect:是否需要断开重连,is need to disconnect and reconnect
275 * stateCode :0x00 indicates an unknown abnormal timeout,0x01 indicates successful system pairing, and 0x02 indicates unpairing
276 * @param complete 设置后完成配对回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
277 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
278 */
279+ (void)setBluetoothPairingCommandWithCallback:(void (^_Nullable)(BOOL isNeedDisconnect,int stateCode))callback
280 pairingComplete:(void (^_Nullable)(int errorCode))complete;
281
282/**
283 * @brief 设置寻找手机 | Set looking for a mobile phone
284 * @param findModel 寻找手机信息 model (IDOSetFindPhoneInfoBuletoothModel)
285 * Find mobile information model (IDOSetFindPhoneInfoBuletoothModel)
286 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
287 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
288 */
289+ (void)setFindPhoneCommand:(IDOSetFindPhoneInfoBuletoothModel * _Nullable)findModel callback:(void (^ _Nullable)(int errorCode))callback;
290
291/**
292 * @brief 设置抬腕 | Set the wrist
293 * @param handUpmodel 抬腕信息 model (IDOSetHandUpInfoBuletoothModel)
294 * Wrist information model (IDOSetHandUpInfoBuletoothModel)
295 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
296 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
297 */
298+ (void)setHandUpCommand:(IDOSetHandUpInfoBuletoothModel * _Nullable)handUpmodel callback:(void (^ _Nullable)(int errorCode))callback;
299
300/**
301 * @brief 设置左右手佩戴 | Set the left and right hand to wear
302 * @param handModel 左右手佩戴 model (IDOSetLeftOrRightInfoBuletoothModel)
303 * Left and right hand wearing model (IDOSetLeftOrRightInfoBuletoothModel)
304 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
305 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
306 */
307+ (void)setLeftRightHandCommand:(IDOSetLeftOrRightInfoBuletoothModel *_Nullable)handModel callback:(void (^ _Nullable)(int errorCode))callback;
308
309/**
310 * @brief 设置音乐开关 | Set music switch
311 * @param openMusicModel 音乐开关 model (IDOSetMusicOpenInfoBuletoothModel)
312 * Music Switch model (IDOSetMusicOpenInfoBuletoothModel)
313 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
314 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
315 */
316+ (void)setOpenMusicCommand:(IDOSetMusicOpenInfoBuletoothModel * _Nullable)openMusicModel callback:(void (^ _Nullable)(int errorCode))callback;
317
318/**
319 * @brief 设置预防丢失 | Set to prevent loss
320
321 * @param lostModel 预防丢失 model (IDOSetPreventLostInfoBuletoothModel)
322 * Prevent loss model (IDOSetPreventLostInfoBuletoothModel)
323 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
324 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
325 */
326+ (void)setPreventLostCommand:(IDOSetPreventLostInfoBuletoothModel * _Nullable)lostModel callback:(void (^ _Nullable)(int errorCode))callback;
327
328/**
329 * @brief 设置显示模式 | Setting the display mode
330 * @param displaModel 显示模式 model (IDOSetDisplayModeInfoBluetoothModel)
331 * Display mode model (IDOSetDisplayModeInfoBluetoothModel)
332 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
333 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
334 */
335+ (void)setDisplayModeCommand:(IDOSetDisplayModeInfoBluetoothModel * _Nullable)displaModel callback:(void (^ _Nullable)(int errorCode))callback;
336
337/**
338 * @brief 设置久坐 | Set sedentary
339 * @param longSitModel 久坐 model (IDOSetLongSitInfoBuletoothModel)
340 * Sedentary model (IDOSetLongSitInfoBuletoothModel)
341 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
342 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
343 */
344+ (void)setLongSitCommand:(IDOSetLongSitInfoBuletoothModel * _Nullable)longSitModel callback:(void (^ _Nullable)(int errorCode))callback;
345
346/**
347 * @brief 设置天气预报开关 | Set the weather forecast switch
348 * @param weatherModel 天气预报开关 model (IDOSetWeatherSwitchInfoBluetoothModel)
349 * Weather Forecast Switch model (IDOSetWeatherSwitchInfoBluetoothModel)
350 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
351 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
352 */
353+ (void)setWeatherCommand:(IDOSetWeatherSwitchInfoBluetoothModel * _Nullable)weatherModel callback:(void (^ _Nullable)(int errorCode))callback;
354
355/**
356 * @brief 设置心率模式 | Set heart rate mode
357 * @param hrModeModel 心率模式 model (IDOSetHRModeInfoBluetoothModel)
358 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
359 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
360 */
361+ (void)setHrModeCommand:(IDOSetHrModeInfoBluetoothModel * _Nullable)hrModeModel callback:(void(^_Nullable)(int errorCode))callback;
362
363/**
364 * @brief 设置防打扰模式 | Set the anti-disturb mode
365 * @param noDisturbModeModel 防打扰模式 model (IDOSetNoDisturbModeInfoBluetoothModel)
366 * Anti-disturbance mode model (IDOSetNoDisturbModeInfoBluetoothModel)
367 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
368 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
369 */
370+ (void)setNoDisturbModeCommand:(IDOSetNoDisturbModeInfoBluetoothModel * _Nullable)noDisturbModeModel callback:(void(^_Nullable)(int errorCode))callback;
371
372/**
373 * @brief 设置心率间隔 | Set heart rate interval
374 * @param hrIntervalModel 心率间隔 model (IDOSetHrIntervalInfoBluetoothModel)
375 * Heart Rate Interval model (IDOSetHrIntervalInfoBluetoothModel)
376 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
377 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
378 */
379+ (void)setHrIntervalCommand:(IDOSetHrIntervalInfoBluetoothModel * _Nullable)hrIntervalModel callback:(void(^_Nullable)(int errorCode))callback;
380
381/**
382 * @brief 设置单位 | Setting unit
383 * @param unitModel 单位 model (IDOSetUnitInfoBluetoothModel) | unit model (IDOSetUnitInfoBluetoothModel)
384 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
385 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
386 */
387+ (void)setUnitCommand:(IDOSetUnitInfoBluetoothModel * _Nullable)unitModel callback:(void(^_Nullable)(int errorCode))callback;
388
389/**
390 * @brief 设置一键呼叫 | Set up a one-click call
391 * @param oneKeySOSModel 一键呼叫 model (IDOSetOneKeySosInfoBuletoothModel)
392 * One-click calling model (IDOSetOneKeySosInfoBuletoothModel)
393 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
394 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
395 */
396+ (void)setOneKeySosCommand:(IDOSetOneKeySosInfoBuletoothModel * _Nullable)oneKeySOSModel callback:(void(^_Nullable)(int errorCode))callback;
397
398/**
399 * @brief 设置快捷方式 | Setting shortcuts
400 * @param shortcutModel 快捷方式 model (IDOSetShortcutInfoBluetoothModel) | Shortcut model (IDOSetShortcutInfoBluetoothModel)
401 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
402 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
403 */
404+ (void)setShortcutCommand:(IDOSetShortcutInfoBluetoothModel * _Nullable)shortcutModel callback:(void(^_Nullable)(int errorCode))callback;
405
406
407/**
408 * @brief 设置血压舒张、收缩 | Set blood pressure to relax and contract
409 * @param calModel 血压舒张、收缩 model (IDOSetBloodPressureInfoBluetoothModel)
410 * Blood pressure diastolic, contraction model (IDOSetBloodPressureInfoBluetoothModel)
411 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str ; model包含校准状态值)
412 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
413 */
414+ (void)setBpCalCommand:(IDOSetBloodPressureInfoBluetoothModel * _Nullable)calModel
415 callback:(void(^_Nullable)(int errorCode,IDOSetBloodPressureInfoBluetoothModel * _Nullable model))callback;
416
417/**
418 * @brief 设置运动快捷方式 | Set motion shortcuts
419 * @param sportSelectModel 运动快捷方式 model (IDOSetSportShortcutInfoBluetoothModel)
420 * Sports shortcut model (IDOSetSportShortcutInfoBluetoothModel)
421 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
422 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
423 */
424+ (void)setSportModeSelectCommand:(IDOSetSportShortcutInfoBluetoothModel * _Nullable)sportSelectModel callback:(void(^_Nullable)(int errorCode))callback;
425
426/**
427 * @brief 设置运动模式排序 | Set motion shortcuts
428 * @param sportSortModel 运动模式排序 model (IDOSetSportSortingInfoBluetoothModel)
429 * sport mode sort Model (IDOSetSportSortingInfoBluetoothModel)
430 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
431 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
432 */
433+ (void)setSportModeSortCommand:(IDOSetSportSortingInfoBluetoothModel * _Nullable)sportSortModel callback:(void(^_Nullable)(int errorCode))callback;
434
435/**
436 * @brief 设置天气预报数据 | Set weather forecast data
437 * @param weatherDataModel 天气预报数据 model (IDOSetWeatherDataInfoBluetoothModel)
438 * Weather Forecast Data model (IDOSetWeatherDataInfoBluetoothModel)
439 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
440 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
441 */
442+ (void)setWeatherDataCommand:(IDOSetWeatherDataInfoBluetoothModel *_Nullable)weatherDataModel
443 callback:(void (^ _Nullable)(int errorCode))callback;
444
445/**
446 * @brief 设置天气预报数据 (定制扩展功能数据不存储) | Set city name (Extend functionality)
447 * @param weatherData 天气预报数据 @{@"today":weatherModel,@"city":@"",@"oneHourWeather":@[@{@"type":@(0),@"temp":@(0)}...]}
448 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
449 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
450*/
451+ (void)setWeatherDataExtensionCommand:(NSDictionary *_Nullable)weatherData
452 callback:(void (^ _Nullable)(int errorCode))callback;
453
454/**
455 * @brief 设置iot按钮集合 (定制扩展功能数据不存储) | Set of iot buttons (Extend functionality)
456 * @param buttonNames iot按钮集合最多可以设置20个按钮 @[@{@"index":@(0),@"button":@""}...]
457 * callback 设置按钮集合回调进度 (0~1) | Set the button progress callback (0~1)
458 * @param complete 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
459 * Set post complete (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
460*/
461+ (void)setIotButtonNamesCommand:(NSArray <NSDictionary * >* _Nullable)buttonNames
462 callback:(void (^ _Nullable)(float progress))callback
463 complete:(void (^ _Nullable)(int errorCode))complete;
464
465/**
466 * @brief 设置屏幕亮度 | Set screen brightness
467 * @param screenBrightnessModel 屏幕亮度 model (IDOSetScreenBrightnessInfoBluetoothModel)
468 * Screen Brightness model (IDOSetScreenBrightnessInfoBluetoothModel)
469 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
470 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
471 */
472+ (void)setScreenBrightnessCommand:(IDOSetScreenBrightnessInfoBluetoothModel * _Nullable)screenBrightnessModel callback:(void (^ _Nullable)(int errorCode))callback;
473
474/**
475 * @brief 设置GPS信息 | Set GPS information
476 * @param gpsInfoModel GPS信息 model (IDOSetGpsConfigInfoBluetoothModel)
477 * GPS information model (IDOSetGpsConfigInfoBluetoothModel)
478 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
479 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
480 */
481+ (void)setGpsInfoCommand:(IDOSetGpsConfigInfoBluetoothModel * _Nullable)gpsInfoModel callback:(void (^ _Nullable)(int errorCode))callback;
482
483/**
484 * @brief 设置GPS控制信息 | Set GPS Control Information
485 * @param gpsControlModel GPS控制信息 model (IDOSetGpsControlInfoBluetoothModel)
486 * GPS Control Information model (IDOSetGpsControlInfoBluetoothModel)
487 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str) (status 0 : 写入失败 , 1 : 正在写入 , 2 : 写入完成)
488 */
489+ (void)setGpsControlCommand:(IDOSetGpsControlInfoBluetoothModel * _Nullable)gpsControlModel
490 callback:(void (^ _Nullable)(int status,int errorCode))callback;
491
492/**
493 * @brief 设置控制连接参数 | Setting Control Connection Parameters
494 * @param connParamModel 控制连接参数 model (IDOSetConnParamInfoBluetoothModel)
495 * Control connection parameters model (IDOSetConnParamInfoBluetoothModel)
496 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
497 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
498 */
499+ (void)setConnParamCommand:(IDOSetConnParamInfoBluetoothModel * _Nullable)connParamModel callback:(void (^ _Nullable)(int errorCode))callback;
500
501/**
502 * @brief 设置热启动参数 | Setting hot start parameters
503 * @param hotStartParamModel 热启动参数 model (IDOGetHotStartParamBluetoothModel)
504 * Hot Start Parameters model (IDOGetHotStartParamBluetoothModel)
505 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
506 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
507 */
508+ (void)setHotStartParamCommand:(IDOGetHotStartParamBluetoothModel * _Nullable)hotStartParamModel callback:(void (^ _Nullable)(int errorCode))callback;
509
510/**
511 * @brief 设置传感器实时数据 | Set sensor real-time data
512 * @param realTimeModel 传感器实时数据 model (IDOSetRealTimeSensorDataInfoBluetoothModel)
513 * Sensor real-time data model (IDOSetRealTimeSensorDataInfoBluetoothModel)
514 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
515 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
516 */
517+ (void)setRealTimeSensorDataCommand:(IDOSetRealTimeSensorDataInfoBluetoothModel * _Nullable)realTimeModel callback:(void (^ _Nullable)(int errorCode))callback;
518
519/**
520 * @brief 设置马达参数 | Setting the motor parameters
521 * @param startMotorModel 马达参数 model (IDOSetStartMotorInfoBluetoothModel)
522 * Motor Parameter model (IDOSetStartMotorInfoBluetoothModel)
523 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
524 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
525 */
526+ (void)setStartMotorCommand:(IDOSetStartMotorInfoBluetoothModel * _Nullable)startMotorModel callback:(void (^ _Nullable)(int errorCode))callback;
527
528
529/**
530 * @brief 设置表盘参数 | Setting the dial parameters
531 * @param watchDiaModel 表盘参数 model (IDOSetWatchDiaInfoBluetoothModel)
532 * Dial Parameters model (IDOSetWatchDiaInfoBluetoothModel)
533 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
534 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
535 */
536+ (void)setWatchDiaCommand:(IDOSetWatchDiaInfoBluetoothModel * _Nullable)watchDiaModel callback:(void (^ _Nullable)(int errorCode))callback;
537
538
539/**
540 * @brief 设置血压测量参数 | Setting blood pressure measurement parameters
541 * @param bpMeasureModel 血压测量参数 model (IDOSetBpMeasureInfoBluetoothModel)
542 * Blood pressure measurement parameters model (IDOSetBpMeasureInfoBluetoothModel)
543 * @param callback 设置回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str ; model实时血压数据和状态)
544 * Set callback (errorCode: 0 transmission succeeded, other values are wrong, error code str can be obtained according to IDOErrorCodeToStr;
545 * model real-time blood pressure data and status)
546 */
547+ (void)setBpMeasureCommand:(IDOSetBpMeasureInfoBluetoothModel * _Nullable)bpMeasureModel
548 callback:(void (^ _Nullable)(int errorCode,IDOSetBpMeasureInfoBluetoothModel * _Nullable model))callback;;
549
550
551/**
552 * @brief 设置睡眠时间段 | Setting the sleep period
553 * @param sleepPeriodModel 睡眠时间段 model (IDOSetSleepPeriodInfoBluetoothModel)
554 * Sleep time period model (IDOSetSleepPeriodInfoBluetoothModel)
555 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
556 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
557 */
558+ (void)setSleepPeriodCommand:(IDOSetSleepPeriodInfoBluetoothModel * _Nullable)sleepPeriodModel callback:(void (^ _Nullable)(int errorCode))callback;
559
560/**
561 * @brief 设置女性生理周期 (id205) | Setting the female physiological cycle (id205)
562 * @param menstrualModel 女性生理周期 model (IDOSetMenstruationInfoBluetoothModel)
563 * Female Physiological Cycle model (IDOSetMenstruationInfoBluetoothModel)
564 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
565 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
566 */
567+ (void)setMenstrualCommand:(IDOSetMenstruationInfoBluetoothModel * _Nullable)menstrualModel callback:(void (^ _Nullable)(int errorCode))callback;
568
569
570/**
571 * @brief 设置女性生理周期提醒 (id205) | Set Women's Physiological Cycle Reminder (id205)
572 * @param remindModel 女性生理周期提醒 model (IDOSetMenstruationRemindBluetoothModel)
573 * Female Physiological Cycle Reminder model (IDOSetMenstruationRemindBluetoothModel)
574 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
575 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
576 */
577+ (void)setMenstrualRemindCommand:(IDOSetMenstruationRemindBluetoothModel * _Nullable)remindModel callback:(void (^ _Nullable)(int errorCode))callback;
578
579/**
580 * @brief 设置每分钟呼吸次数 (139) | Breaths per minute
581 * @param breatheModel 每分钟呼吸次数 model (IDOSetBreatheTrainBluetoothModel)
582 * Breaths per minute model (IDOSetBreatheTrainBluetoothModel)
583 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
584 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
585 */
586+ (void)setBreatheTrainCommand:(IDOSetBreatheTrainBluetoothModel * _Nullable)breatheModel callback:(void (^ _Nullable)(int errorCode))callback;
587
588/**
589 * @brief 设置走动提醒开关 (139) | Walking reminder switch
590 * @param walkModel 走动提醒开关 model (IDOSetWalkReminderBluetoothModel)
591 * Walking reminder switch model (IDOSetWalkReminderBluetoothModel)
592 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
593 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
594 */
595+ (void)setWalkReminderCommand:(IDOSetWalkReminderBluetoothModel * _Nullable)walkModel callback:(void (^ _Nullable)(int errorCode))callback;
596
597/**
598 * @brief 设置血氧开关 (139) | blood oxygen switch
599 * @param spo2Model 血氧开关 model (IDOSetSpo2SwitchBluetoothModel)
600 * blood oxygen switch model (IDOSetSpo2SwitchBluetoothModel)
601 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
602 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
603 */
604+ (void)setSpo2SwitchCommand:(IDOSetSpo2SwitchBluetoothModel * _Nullable)spo2Model callback:(void (^ _Nullable)(int errorCode))callback;
605
606/**
607 * @brief 设置运动开关 (139) | activity switch
608 * @param switchModel 运动开关 model (IDOSetActivitySwitchBluetoothModel)
609 * activity switch model (IDOSetActivitySwitchBluetoothModel)
610 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
611 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
612 */
613+ (void)setActivitySwitchCommand:(IDOSetActivitySwitchBluetoothModel * _Nullable)switchModel callback:(void (^ _Nullable)(int errorCode))callback;
614
615/**
616* @brief 设置心率开关同步 (139) | v3 heart rate
617* @param v3HrModel 心率开关 model (IDOSetV3HeartRateModeBluetoothModel)
618* v3 heart rate switch model (IDOSetV3HeartRateModeBluetoothModel)
619* @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
620* Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
621*/
622+ (void)setV3HrModelCommand:(IDOSetV3HeartRateModeBluetoothModel * _Nullable)v3HrModel callback:(void (^ _Nullable)(int errorCode))callback;
623
624/**
625* @brief 设置喝水提醒 | drink water reminder
626* @param drinkModel 喝水提醒开关 model (IDOSetDrinkReminderModeBluetoothModel)
627* drink water reminder switch model (IDOSetDrinkReminderModeBluetoothModel)
628* @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
629* Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
630*/
631+ (void)setDrinkReminderCommand:(IDOSetDrinkReminderModeBluetoothModel * _Nullable)drinkModel callback:(void (^ _Nullable)(int errorCode))callback;
632
633/**
634 * @brief 设置星星数量 数据不作存储 (锐捷) | Set the number of stars (ruijie)
635 * @param startCount 星星数量 (1~5)| number of stars (1~5)
636 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
637 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
638 */
639+ (void)setStartCountCommand:(NSInteger)startCount callback:(void (^ _Nullable)(int errorCode))callback;
640
641/**
642 * @brief 设置蓝牙短信推送 数据不作存储 (锐捷) | Set bluetooth SMS push (ruijie)
643 * @param content 蓝牙短信推送内容 (最长64个字节) | push content (Up to 64 bytes)
644 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
645 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
646 */
647+ (void)setContentCommand:(NSString * _Nullable)content callback:(void (^ _Nullable)(int errorCode))callback;
648
649/**
650 * @brief 设置用户名字 数据不作存储 (锐捷) | Set user name (ruijie)
651 * @param userName 用户名字 (最长10个字节) | user name (Up to 10 bytes)
652 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
653 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
654 */
655+ (void)setUserNameCommand:(NSString * _Nullable)userName callback:(void (^ _Nullable)(int errorCode))callback;
656
657/**
658 * @brief 设置用户号码 数据不作存储 (锐捷) | Set user number (ruijie)
659 * @param userNumber 用户号码 (最长10个字节) | user number (Up to 10 bytes)
660 * @param callback 设置后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
661 * Set post callback (errorCode : 0 transfer succeeds, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
662 */
663+ (void)setUserNumberCommand:(NSString * _Nullable)userNumber callback:(void (^ _Nullable)(int errorCode))callback;
664
665#pragma mark ======= get Command =======
666
667/**
668 * @brief 获取mac地址 | Get mac address
669 * @param callback 执行后回调 data (IDOGetMacAddrInfoBluetoothModel) (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
670 * Post-execution callback data (IDOGetMacAddrInfoBluetoothModel) (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
671 */
672+ (void)getMacAddrCommand:(void(^_Nullable)(int errorCode,IDOGetMacAddrInfoBluetoothModel * _Nullable data))callback;
673
674/**
675 * @brief 获取设备信息 | Get device information
676 * @param callback 执行后回调 data (IDOGetDeviceInfoBluetoothModel) (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
677 * Post-execution callback data (IDOGetDeviceInfoBluetoothModel) (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
678 */
679+ (void)getDeviceInfoCommand:(void(^_Nullable)(int errorCode,IDOGetDeviceInfoBluetoothModel * _Nullable data))callback;
680
681/**
682 * @brief 获取功能列表 | Get the list of features
683 * @param callback 执行后回调 data (IDOGetDeviceFuncBluetoothModel) (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
684 * Post-execution callback data (IDOGetDeviceFuncBluetoothModel) (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
685 */
686+ (void)getFuncTableCommand:(void(^_Nullable)(int errorCode,IDOGetDeviceFuncBluetoothModel * _Nullable data))callback;
687
688/**
689 * 在非OTA模式下连接成功后,需要准备在同步配置时设置的默认数据,回调后根据类型保存需要设置的数据,在同步配置时分别设置,无需单独执行命令(只有支持相应功能类型才会返回)
690 * After successful connection in non-ota mode, you need to prepare the default data set during synchronization configuration,
691 * save the data set according to the type after callback, and set them separately during synchronization configuration without executing separate commands
692 */
693+ (void)syncConfigSetDefaultValuesCallback:(void(^_Nullable)(IDO_SYNC_CONFIG_DATA_TYPE type,BOOL isComplete))callback;
694
695/**
696 * @brief 获得实时数据 | Get real-time data
697 * @param callback 执行后回调 data (IDOGetLiveDataBluetoothModel) (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
698 * Post-execution callback data (IDOGetLiveDataBluetoothModel) (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
699 */
700+ (void)getLiveDataCommand:(void(^_Nullable)(int errorCode,IDOGetLiveDataBluetoothModel * _Nullable data))callback;
701
702/**
703 * @brief 获取设备当前时间 | Get the current time of the device
704 * @param callback 执行后回调 data (IDOGetDeviceTimeBluetoothModel) (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
705 * Post-execution callback data (IDOGetDeviceTimeBluetoothModel) (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
706 */
707+ (void)getDeviceTimeCommand:(void(^_Nullable)(int errorCode,IDOGetDeviceTimeBluetoothModel * _Nullable data))callback;
708
709/**
710 * @brief 获取通知中心的状态 | Get the status of the notification center
711 * @param callback 执行后回调 data (IDOSetNoticeInfoBuletoothModel) (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
712 * Post-execution callback data (IDOSetNoticeInfoBuletoothModel) (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
713 */
714+ (void)getNoticeStatusCommand:(void(^_Nullable)(int errorCode,IDOSetNoticeInfoBuletoothModel * _Nullable data))callback;
715
716/**
717 * @brief 获取心率传感器参数 | Get Heart Rate Sensor Parameters
718 * @param callback 执行后回调 data (IDOGetHrSensorParamBluetoothModel) (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
719 * Post-execution callback data (IDOGetHrSensorParamBluetoothModel) (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
720 */
721+ (void)getHrSensorParamCommand:(void(^_Nullable)(int errorCode,IDOGetHrSensorParamBluetoothModel * _Nullable data))callback;
722
723/**
724 * @brief 获取加速度传感器参数 | Acquire acceleration sensor parameters
725 * @param callback 执行后回调 data (IDOGetGsensorParamBluetoothModel) (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
726 * Post-execution callback data (IDOGetGsensorParamBluetoothModel) (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
727 */
728+ (void)getGsensorParamCommand:(void(^_Nullable)(int errorCode,IDOGetGsensorParamBluetoothModel * _Nullable data))callback;
729
730/**
731 * @brief 获取活动数量 | Get the number of events
732 * @param callback 执行后回调 data (IDOGetActivityCountBluetoothModel) (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
733 * Post-execution callback data (IDOGetActivityCountBluetoothModel) (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
734 */
735+ (void)getActivityCountCommand:(void(^_Nullable)(int errorCode,IDOGetActivityCountBluetoothModel * _Nullable data))callback;
736
737/**
738 * @brief 获取hid信息 | Get hid information
739 * @param callback 执行后回调 data (IDOGetHidInfoBluetoothModel) (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
740 * Post-execution callback data (IDOGetHidInfoBluetoothModel) (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
741 */
742+ (void)getHidInfoCommand:(void(^_Nullable)(int errorCode,IDOGetHidInfoBluetoothModel * _Nullable data))callback;
743
744/**
745 * @brief 获取gps信息 | Get gps information
746 * @param callback 执行后回调 data (IDOGetGpsInfoBluetoothModel) (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
747 * Post-execution callback data (IDOGetGpsInfoBluetoothModel) (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
748 */
749+ (void)getGpsInfoCommand:(void(^_Nullable)(int errorCode,IDOGetGpsInfoBluetoothModel * _Nullable data))callback;
750
751/**
752 * @brief 获取热启动参数 | Get hot start parameters
753 * @param callback 执行后回调 data (IDOGetHotStartParamBluetoothModel) (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
754 * Post-execution callback data (IDOGetHotStartParamBluetoothModel) (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
755 */
756+ (void)getHotStartParamCommand:(void(^_Nullable)(int errorCode,IDOGetHotStartParamBluetoothModel * _Nullable data))callback;
757
758/**
759 * @brief 获取GPS状态 | Get GPS status
760 * @param callback 执行后回调 data (IDOGetGpsStatusBluetoothModel) (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
761 * Post-execution callback data (IDOGetGpsStatusBluetoothModel) (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
762 */
763+ (void)getGpsStatusCommand:(void(^_Nullable)(int errorCode,IDOGetGpsStatusBluetoothModel * _Nullable data))callback;
764
765/**
766 * @brief 获取版本信息 | Get version information
767 * @param callback 执行后回调 data (IDOGetVersionInfoBluetoothModel) (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
768 * Post-execution callback data (IDOGetVersionInfoBluetoothModel) (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
769 */
770+ (void)getVersionInfoCommand:(void(^_Nullable)(int errorCode,IDOGetVersionInfoBluetoothModel * _Nullable data))callback;
771
772/**
773 * @brief 获取realtek平台 ota授权 | Obtain ota authorization of realtek platform
774 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
775 * Post-execution callback (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
776 * stateCode 0x00:校验成功,0x01:ID号校验失败,0x02:版本号校验失败,0x03:电量不足,0x04:其他错误
777 * stateCode 0x00: verification success,0x01:ID number verification failure,0x02: version number verification failure,0x03: insufficient power,0x04: other errors
778 */
779+ (void)getOtaAuthInfoCommand:(void(^_Nullable)(int errorCode,int stateCode))callback;
780
781/**
782 * @brief 获取5个心率区间交换数据 | Exchange data of 5 heart rate intervals were obtained
783 * @param exchangeModel 运动过程中交互数据模型 | Interactive data model during motion
784 * @param callback 执行后回调 data (IDOGetFiveHrReplyInfoBluetoothModel)
785 * (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
786 * Post-execution callback data (IDOGetFiveHrReplyInfoBluetoothModel)
787 * (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
788 */
789+ (void)getSwithHrInterval:(IDODataExchangeModel * _Nullable)exchangeModel
790 callback:(void(^_Nullable)(int errorCode,IDOGetFiveHrReplyInfoBluetoothModel * _Nullable data))callback;
791
792
793/**
794* @brief 默认的运动类型 | get default sport type
795* @param callback 执行后回调 data (IDOGetDefaultSportTypeBluetoothModel) (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
796* Post-execution callback data (IDOGetDefaultSportTypeBluetoothModel) (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
797*/
798+ (void)getDefaultSportTypeCommand:(void(^_Nullable)(int errorCode,IDOGetDefaultSportTypeBluetoothModel * _Nullable data))callback;
799
800/**
801 * @brief 获取星星的数量,数据不作存储(锐捷) | Get number of stars (ruijie)
802 * @param callback 执行后回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
803 * (errorCode : 0 The transfer was successful, the other values are errors, and the error code str can be obtained according to IDOErrorCodeToStr)
804 */
805+ (void)getStartCountCommand:(void (^ _Nullable)(int errorCode,NSInteger startCount))callback;
806
807#pragma mark ======= listen Command =======
808
809/**
810 * @brief 音乐开始 | Music begins
811 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
812 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
813 */
814+ (void)listenMusicStartCommand:(void(^_Nullable)(int errorCode))callback;
815
816/**
817 * @brief 音乐暂停 | Music pause
818 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
819 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
820 */
821+ (void)listenMusicPauseCommand:(void(^_Nullable)(int errorCode))callback;
822
823/**
824 * @brief 音乐结束 | End of music
825 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
826 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
827 */
828+ (void)listenMusicStopCommand:(void(^_Nullable)(int errorCode))callback;
829
830/**
831 * @brief 音乐上一首 | Music on the first
832 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
833 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
834 */
835+ (void)listenMusicLastCommand:(void(^_Nullable)(int errorCode))callback;
836
837/**
838 * @brief 音乐下一首 | Music next
839 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
840 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
841 */
842+ (void)listenMusicNextCommand:(void(^_Nullable)(int errorCode))callback;
843
844/**
845 * @brief 单次拍照 | Single photo
846 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
847 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
848 */
849+ (void)listenPhotoSingleShotCommand:(void(^_Nullable)(int errorCode))callback;
850
851/**
852 * @brief 连续拍照 | Taking photos continuously
853 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
854 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
855 */
856+ (void)listenPhotoBurstCommand:(void(^_Nullable)(int errorCode))callback;
857
858/**
859 * @brief 拍照开始 | Take a photo
860 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
861 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
862 */
863+ (void)listenPhotoStartCommand:(void(^_Nullable)(int errorCode))callback;
864
865/**
866 * @brief 拍照结束 | End of photo
867 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
868 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
869 */
870+ (void)listenPhotoEndCommand:(void(^_Nullable)(int errorCode))callback;
871
872/**
873 * @brief 音量+ | Volume +
874 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
875 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
876 */
877+ (void)listenVolumeUpCommand:(void(^_Nullable)(int errorCode))callback;
878
879/**
880 * @brief 音量- | Volume -
881 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
882 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
883 */
884+ (void)listenVolumeDownCommand:(void(^_Nullable)(int errorCode))callback;
885
886/**
887 * @brief 寻找手机开始 | Looking for a mobile phone to start
888 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
889 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
890 */
891+ (void)listenFindPhoneStartCommand:(void(^_Nullable)(int errorCode))callback;
892
893/**
894 * @brief 寻找手机结束 | Looking for the end of the phone
895 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
896 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
897 */
898+ (void)listenFindPhoneStopCommand:(void(^_Nullable)(int errorCode))callback;
899
900/**
901 * @brief 防丢启动 | Anti-lost start
902 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
903 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
904 */
905+ (void)listenLostStartCommand:(void(^_Nullable)(int errorCode))callback;
906
907/**
908 * @brief 防丢结束 | Anti-lost end
909 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
910 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
911 */
912+ (void)listenLostStopCommand:(void(^_Nullable)(int errorCode))callback;
913
914/**
915 * @brief 一键求救 | One button for help
916 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
917 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
918 */
919+ (void)listenSosStartCommand:(void(^_Nullable)(int errorCode))callback;
920
921/**
922 * @brief 闹钟同步完成 | Alarm clock synchronization completed
923 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
924 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
925 */
926+ (void)listenAlarmSyncCompleteCommand:(void(^_Nullable)(int errorCode))callback;
927
928/**
929 * @brief 配置同步完成 | Configure synchronization completion
930 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
931 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
932 */
933+ (void)listenConfigSyncCompleteCommand:(void(^_Nullable)(int errorCode))callback;
934
935/**
936 * @brief 健康同步完成 | Health sync completed
937 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
938 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
939 */
940+ (void)listenHealthSyncCompleteCommand:(void(^_Nullable)(int errorCode))callback;
941
942/**
943 * @brief 数据传输完成 | Data transfer completed
944 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
945 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
946 */
947+ (void)listenDataTranCompleteCommand:(void(^_Nullable)(int errorCode))callback;
948
949/**
950 * @brief 配置快速同步完成 | Configuring Fast Sync Complete
951 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
952 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
953 */
954+ (void)listenConfigFastSyncCompleteCommand:(void(^_Nullable)(int errorCode))callback;
955
956/**
957 * @brief GPS数据同步完成 | GPS data synchronization completed
958 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
959 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
960 */
961+ (void)listenGpsSyncCompleteCommand:(void(^_Nullable)(int errorCode))callback;
962
963/**
964 * @brief 活动数据同步完成 | Activity data synchronization completed
965 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
966 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
967 */
968+ (void)listenActivitySyncCompleteCommand:(void(^_Nullable)(int errorCode))callback;
969
970/**
971 * @brief 手环检查版本号 | Bracelet checks the version number
972 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
973 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
974 */
975+ (void)listenCheckUpdateReplyCommand:(void(^_Nullable)(int errorCode))callback;
976
977/**
978 * @brief 手环发送iot按钮 | Bracelet send iot buttons
979 * @param callback 监听回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str,index 对应按钮索引)
980 * Listening callback (errorCode : 0 is successful, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
981*/
982+ (void)listenIotButtonCommand:(void(^_Nullable)(int errorCode,int index))callback;
983
984#pragma mark ======= progress Command =======
985
986/**
987 * @brief 健康数据同步进度 | Health data synchronization progress
988 * @param callback 健康数据同步进度回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
989 * Health data synchronization progress callback (errorCode : 0 transmission success, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
990 */
991+ (void)healthSyncProgressCommand:(void(^_Nullable)(int progress,int errorCode))callback;
992
993/**
994 * @brief 闹钟数据同步进度 | Alarm data synchronization progress
995 * @param callback 闹钟数据同步进度回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
996 * Alarm data synchronization progress callback (errorCode : 0 transmission success, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
997 */
998+ (void)alarmSyncProgressCommand:(void(^_Nullable)(int progress,int errorCode))callback;
999
1000/**
1001 * @brief 活动数据同步进度 | Activity data synchronization progress
1002 * @param callback 活动数据同步进度回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1003 * Activity data synchronization progress callback (errorCode : 0 transmission success, other values are errors, you can get error code str according to IDOErrorCodeToStr)
1004 */
1005+ (void)activitySyncProgressCommand:(void(^_Nullable)(int progress,int errorCode))callback;
1006
1007/**
1008 * @brief 数据交换进度 手环->app | Data Exchange Progress Bracelet -> app
1009 * @param callback 数据交换进度回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1010 * Data exchange progress callback (errorCode: 0 transmission succeeded, other values are errors, error code str can be obtained according to IDOErrorCodeToStr)
1011 */
1012+ (void)dataTranProgressCommand:(void(^_Nullable)(int progress,int errorCode))callback;
1013
1014/**
1015 * @brief gps数据同步进度 | gps data synchronization progress
1016 * @param callback gps数据同步进度回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1017 * gps data synchronization progress callback (errorCode: 0 transmission success, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
1018 */
1019+ (void)gpsProgressCommand:(void(^_Nullable)(int progress,int errorCode))callback;
1020
1021/**
1022 * @brief 数据交换进度 app->手环 | Data Exchange Progress app->Bracelet
1023 * @param callback 数据交换进度回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1024 * Data exchange progress callback (errorCode: 0 transmission succeeded, other values are errors, error code str can be obtained according to IDOErrorCodeToStr)
1025 */
1026+ (void)appDataTranProgressCommand:(void(^_Nullable)(int progress,int errorCode))callback;
1027
1028/**
1029 * @brief 配置同步进度 | Configure synchronization progress
1030 * @param callback 配置同步进度回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1031 * Configure synchronization progress callback (errorCode : 0 transmission succeeded, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
1032 */
1033+ (void)configSyncProgressCommand:(void(^_Nullable)(int progress,int errorCode))callback;
1034
1035#pragma mark ======= data exchange Command =======
1036
1037/**
1038 * @brief app 发起运动开始 | app starts the campaign
1039 * @param model IDODataExchangeModel (数据交换model, day|hour|minute|second|sportType|targetType|targetValue|forceStart 这些属性需要赋值)
1040 * IDODataExchangeModel (data exchange model, day|hour|minute|second|sportType|targetType|targetValue|forceStart These attributes need to be assigned)
1041 * @param startCallback 运动发起回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1042 * Motion initiated callback (errorCode : 0 transmission succeeded, other values are errors, error code str can be obtained according to IDOErrorCodeToStr)
1043 */
1044+ (void)appStartSportCommand:(IDODataExchangeModel * _Nullable)model
1045 startCallback:(void (^_Nullable)(IDODataExchangeModel * _Nullable model,int errorCode))startCallback;
1046
1047/**
1048 * @brief app 发起运动结束 | app initiates the end of the campaign
1049 * @param model IDODataExchangeModel 活动时间需要保持一致,才能停止活动不然无效,当前model对象为全局时,只要开始活动记录开始时间,
1050 * 结束时不需要再次给时间赋值,只需要给 durations|calories|distance|sportType|isSave 这些属性需要赋值
1051 * IDODataExchangeModel activity time needs to be consistent in order to stop the activity or it will be invalid. When the current model object is global,
1052 * just start the activity record start time. You don't need to assign values to the time at the end, just give durations|calories|distance|sportType|isSave
1053 * these properties need to be assigned.
1054 * @param appEndCallback 运动停止回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1055 * Motion stop callback (errorCode : 0 transfer succeeded, other values are wrong, you can get error code str according to IDOErrorCodeToStr)
1056 */
1057+ (void)appEndSportCommand:(IDODataExchangeModel *_Nullable)model
1058 appEndcallback:(void (^_Nullable)(IDODataExchangeModel * _Nullable model,int errorCode))appEndCallback;
1059
1060/**
1061 * @brief app发起的运动 手环主动结束 | App-initiated sports bracelet ends actively
1062 * @param model IDODataExchangeModel 手环主动发起结束 APP需要给手环发送运动数据, durations|calories|distance|errorCode 这些属性需要赋值
1063 * IDODataExchangeModel The bracelet is actively launched. The APP needs to send motion data to the bracelet. durations|calories|distance|errorCode
1064 * These attributes need to be assigned.
1065 * @param appBleEndCallback 手环发起停止回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1066 * The bracelet initiates a stop callback (errorCode: 0 is successfully transmitted, other values are incorrect, and error code str can be obtained according to IDOErrorCodeToStr)
1067 */
1068+ (void)appBleEndReplyCommand:(IDODataExchangeModel *_Nullable)model
1069 appBleEndCallback:(void (^_Nullable)(IDODataExchangeModel * _Nullable model,int errorCode))appBleEndCallback;
1070
1071
1072/**
1073 * @brief app发起运动暂停 | app initiates a motion pause
1074 * @param model IDODataExchangeModel 活动时间需要保持一致,才能暂停活动不然无效,当前model对象为全局时,只要开始活动记录开始时间,暂停时不需要再次给时间赋值,直接传入当前model
1075 * IDODataExchangeModel activity time needs to be consistent in order to pause activity or not, when the current model object is global,  As soon as you start the activity
1076 * record start time, you don't need to assign time to the timeout when you pause, you can directly pass in the current model.
1077 * @param pauseCallback 运动暂停回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1078 * Motion pause callback (errorCode : 0 transmission success, other values are errors, you can get error code str according to IDOErrorCodeToStr)
1079 */
1080+ (void)appPauseSportCommand:(IDODataExchangeModel *_Nullable)model
1081 pauseCallback:(void (^_Nullable)(IDODataExchangeModel * _Nullable model,int errorCode))pauseCallback;
1082
1083
1084
1085/**
1086 * @brief app发起的运动 手环主动暂停 | App-initiated sports bracelet active suspension
1087 * @param model IDODataExchangeModel 手环主动发起暂停 APP需要给手环发送运动数据, errorCode 这个属性需要赋值
1088 * IDODataExchangeModel The bracelet initiates a pause. The APP needs to send motion data to the bracelet. The errorCode attribute needs to be assigned.
1089 * @param appBlePauseCallback 手环发起暂停回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1090 * The bracelet initiates a pause callback (errorCode: 0 is successfully transmitted, other values are errors, and error code str can be obtained according to IDOErrorCodeToStr)
1091 */
1092+ (void)appBlePauseReplyCommand:(IDODataExchangeModel *_Nullable)model
1093 appBlePauseCallback:(void (^_Nullable)(IDODataExchangeModel * _Nullable model,int errorCode))appBlePauseCallback;
1094
1095
1096/**
1097 * @brief app 发起运动恢复 | app initiates motion recovery
1098 * @param model IDODataExchangeModel 活动时间需要保持一致,才能恢复活动不然无效,当前model对象为全局时,只要开始活动记录开始时间,恢复时不需要再次给时间赋值,直接传入当前model
1099 * IDODataExchangeModel activity time needs to be consistent in order to restore activity or not, when the current model object is global,As soon as you start the activity
1100 * record start time, you don't need to assign time to the time when restoring, you can directly pass in the current model.
1101 * @param appRestoreCallback 运动恢复回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1102 * Motion recovery callback (errorCode : 0 transmission succeeded, other values are wrong, error code str can be obtained according to IDOErrorCodeToStr)
1103 */
1104+ (void)appRestoreSportCommand:(IDODataExchangeModel * _Nullable)model
1105 appRestoreCallback:(void (^_Nullable)(IDODataExchangeModel * _Nullable model,int errorCode))appRestoreCallback;
1106
1107/**
1108 * @brief app发起的运动 手环主动恢复 | app-initiated sports bracelet active recovery
1109 * @param model IDODataExchangeModel 手环主动发起恢复 APP需要给手环发送运动数据, errorCode 这个属性需要赋值
1110 * IDODataExchangeModel The bracelet initiates recovery. The APP needs to send motion data to the bracelet. The errorCode attribute needs to be assigned.
1111 * @param appBleRestoreCallback 手环发起恢复回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1112 * The bracelet initiates a recovery callback (errorCode : 0 is successfully transmitted, other values are incorrect, and error code str can be obtained according to IDOErrorCodeToStr)
1113 */
1114+ (void)appBleRestoreReplyCommand:(IDODataExchangeModel *_Nullable)model
1115 appBleRestoreCallback:(void (^_Nullable)(IDODataExchangeModel * _Nullable model,int errorCode))appBleRestoreCallback;
1116
1117/**
1118 * @brief app发起数据交换过程 | app initiates the data exchange process
1119 * @param model IDODataExchangeModel 活动时间需要保持一致,才能发送活动数据不然无效,当前model对象为全局时,只要开始活动记录开始时间,发送活动数据时不需要再次给时间赋值,
1120 * 只需要给 status|duration|calories|distance 这些属性需要赋值
1121 * IDODataExchangeModel Activity time needs to be consistent in order to send active data or it is invalid. When the current model object is global, as long as the activity
1122 * record start time is started, it is not necessary to assign time to the event when sending the activity data, just to status|duration|calories|distance
1123 * These attributes need to be assigned.
1124 * @param appIngCallback 运动发送数据回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1125 * Motion sends data callback (errorCode : 0 transmission succeeded, other values are errors, error code str can be obtained according to IDOErrorCodeToStr)
1126 */
1127+ (void)appIngSportCommand:(IDODataExchangeModel *_Nullable)model
1128 appIngCallback:(void (^_Nullable)(IDODataExchangeModel * _Nullable model,int errorCode))appIngCallback;
1129
1130/**
1131 * @brief 手环发起运动开始 | The bracelet starts the campaign
1132 * @param model IDODataExchangeModel 只需要给 retCode 这个属性需要赋值
1133 * IDODataExchangeModel only needs to assign value to retCode property
1134 * @param bleStartCallback 手环发起运动开始回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1135 * The bracelet initiates a motion start callback (errorCode : 0 is successfully transmitted, other values are wrong, and error code str can be obtained according to IDOErrorCodeToStr)
1136 */
1137+ (void)bleStartSportCommand:(IDODataExchangeModel *_Nullable)model
1138 bleStartCallback:(void (^_Nullable)(IDODataExchangeModel * _Nullable model,int errorCode))bleStartCallback;
1139
1140/**
1141 * @brief 手环发起运动暂停 | The bracelet initiates a motion pause
1142 * @param model IDODataExchangeModel 只需要给 retCode 这个属性需要赋值
1143 * IDODataExchangeModel only needs to assign value to retCode property
1144 * @param blePauseCallback 手环发起运动暂停回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1145 * The bracelet initiates a motion pause callback (errorCode : 0 is successfully transmitted, other values are incorrect, and error code str can be obtained according to IDOErrorCodeToStr)
1146 */
1147+ (void)blePauseSportCommand:(IDODataExchangeModel *_Nullable)model
1148 blePauseCallback:(void (^_Nullable)(IDODataExchangeModel * _Nullable model,int errorCode))blePauseCallback;
1149
1150/**
1151 * @brief 手环发起运动恢复 | Bracelet initiates sports recovery
1152 * @param model IDODataExchangeModel 只需要给 retCode 这个属性需要赋值
1153 * IDODataExchangeModel only needs to assign value to retCode property
1154 * @param bleRestoreCallback 手环发起运动恢复回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1155 * The bracelet initiates a motion recovery callback (errorCode : 0 is successfully transmitted, other values are wrong, and error code str can be obtained according to IDOErrorCodeToStr)
1156 */
1157+ (void)bleRestoreSportCommand:(IDODataExchangeModel *_Nullable)model
1158 bleRestoreCallback:(void (^_Nullable)(IDODataExchangeModel * _Nullable model,int errorCode))bleRestoreCallback;
1159
1160/**
1161 * @brief 手环发起运动结束 | The bracelet starts the campaign
1162 * @param model IDODataExchangeModel 只需要给 retCode 这个属性需要赋值
1163 * IDODataExchangeModel only needs to assign value to retCode property
1164 * @param bleEndCallback 手环发起运动结束回调 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1165 * The bracelet initiates a motion end callback (errorCode : 0 is successfully transmitted, other values are errors, and error code str can be obtained according to IDOErrorCodeToStr)
1166 */
1167+ (void)bleEndSportCommand:(IDODataExchangeModel *_Nullable)model
1168 bleEndCallback:(void (^_Nullable)(IDODataExchangeModel * _Nullable model,int errorCode))bleEndCallback;
1169
1170/**
1171 * @brief 手环发起运动发送数据 | The bracelet initiates a motion to send data
1172 * @param model IDODataExchangeModel 只需要给 distance 这个属性需要赋值
1173 * @param bleIngCallback 手环发起运动发送数据 (errorCode : 0 传输成功,其他值为错误,可以根据 IDOErrorCodeToStr 获取错误码str)
1174 */
1175+ (void)bleIngSportCommand:(IDODataExchangeModel *_Nullable)model
1176 bleIngCallback:(void (^_Nullable)(IDODataExchangeModel * _Nullable model,int errorCode))bleIngCallback;
1177
1178@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOGetInfoBluetoothModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOGetInfoBluetoothModel.h
new file mode 100755
index 0000000..3e84546
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOGetInfoBluetoothModel.h
@@ -0,0 +1,1924 @@
1//
2// IDOGetInfoBluetoothModel.h
3// VeryfitSDK
4//
5// Created by apple on 2018/7/20.
6// Copyright © 2018年 hedongyang. All rights reserved.
7//
8
9#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
10#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
11#else
12#import "IDOBluetoothBaseModel.h"
13#endif
14
15#pragma mark ==== 获取下载语言 model ====
16
17@interface IDOGetDownLanguageBluetoothModel:IDOBluetoothBaseModel
18/**
19 * 当前使用的语言 | use lang
20 */
21@property (nonatomic,assign) NSInteger useLang;
22/**
23 * 默认语言 | default lang
24 */
25@property (nonatomic,assign) NSInteger defaultLang;
26/**
27 * 固定存储语言个数 | fixed lang count
28 */
29@property (nonatomic,assign) NSInteger fixedLangCount;
30/**
31 * 最大存储语言个数 | max storage lang
32 */
33@property (nonatomic,assign) NSInteger maxStorageLang;
34/**
35 * 已经存储语言值 | language values
36 */
37@property (nonatomic,assign) NSArray * languageValues;
38/**
39 * @brief 查询数据库,如果查询不到初始化新的model对象
40 * Query the database, if the query does not initialize a new model object
41 * @return IDOGetDownLanguageBluetoothModel
42 */
43+ (__kindof IDOGetDownLanguageBluetoothModel *)currentModel;
44
45@end
46
47#pragma mark ==== 默认运动类型值 model ====
48@interface IDOGetDefaultSportTypeBluetoothModel:IDOBluetoothBaseModel
49/**
50 * 默认运动类型的个数 | sport type count
51 */
52@property (nonatomic,assign) NSInteger sportTypeCount;
53
54/**
55 运动类型值集合,集合排序就是运动类型排序 | set of motion type values, and set sort is motion type sort
56 */
57@property (nonatomic,strong) NSArray * sportTypes;
58
59/**
60 * @brief 查询数据库,如果查询不到初始化新的model对象
61 * Query the database, if the query does not initialize a new model object
62 * @return IDOGetDefaultSportTypeBluetoothModel
63 */
64+ (__kindof IDOGetDefaultSportTypeBluetoothModel *)currentModel;
65
66@end
67
68#pragma mark ==== 手环检查版本号 model ====
69@interface IDOCheckUpdateBluetoothModel:IDOBluetoothBaseModel
70/**
71 * app 响应状态 | flag code
72 * 0x00 : 已经是最新版本;0x01 :有新版本;0x02 :网络错误;0x03 :其他错误
73 * 0x00 : it is the latest version; 0x01: there are new versions; 0x02: network error; 0x03: other errors
74 */
75@property (nonatomic,assign) NSInteger flagCode;
76
77/**
78 固件最新版本号 | new version
79 */
80@property (nonatomic,assign) NSInteger newVersion;
81
82@end
83
84#pragma mark ==== 获取5个心率区间交换数据 ====
85@interface IDOGetFiveHrReplyInfoBluetoothModel:IDOBluetoothBaseModel
86/**
87 燃烧脂肪 | Threshold for burning fat
88 */
89@property (nonatomic,assign) NSInteger burnFat;
90
91/**
92 有氧运动 | Aerobic threshold
93 */
94@property (nonatomic,assign) NSInteger aerobic;
95
96/**
97 极限运动 | Limit threshold
98 */
99@property (nonatomic,assign) NSInteger limitValue;
100
101/**
102 热身运动 | Warm-up
103 */
104@property (nonatomic,assign) NSInteger warmUp;
105
106/**
107 无氧运动 | Anaerobic exercise
108 */
109@property (nonatomic,assign) NSInteger anaerobic;
110
111@end
112
113#pragma mark ==== 获取版本信息model ====
114@interface IDOGetVersionInfoBluetoothModel:IDOBluetoothBaseModel
115
116/**
117 * SDK版本 数值为x10,11表示1.1的版本
118 * SDK version number is x10, and 11 represents the 1.1 version
119 */
120@property (nonatomic,assign) NSInteger sdkVersion;
121
122/**
123 * 心率算法版本 数值为x10,11表示1.1的版本
124 * Version value of the heart rate algorithm is x10, and 11 represents version 1.1
125 */
126@property (nonatomic,assign) NSInteger hrAlgorithmVersion;
127
128/**
129 * 睡眠算法版本 数值为x10,11表示1.1的版本
130 * Sleep algorithm version number is x10, and 11 represents version 1.1
131 */
132@property (nonatomic,assign) NSInteger sleepAlgorithmVersion;
133
134/**
135 * 计步算法版本 数值为x10,11表示1.1的版本
136 * Step counting algorithm version value is x10,11 represents 1.1 version
137 */
138@property (nonatomic,assign) NSInteger stepAlgorithmVersion;
139
140/**
141 * 手势识别算法 数值为x10,11表示1.1的版本
142 * Value of gesture recognition algorithm is x10, and 11 represents version 1.1
143 */
144@property (nonatomic,assign) NSInteger gestureRecognitionVersion;
145
146/**
147 * PCB 版本 数值为x10,11表示1.1的版本
148 * PCB version number is x10, and 11 represents version 1.1
149 */
150@property (nonatomic,assign) NSInteger pcbVersion;
151
152/**
153 * @brief 查询数据库,如果查询不到初始化新的model对象
154 * Query the database, if the query does not initialize a new model object
155 * @return IDOGetVersionInfoBluetoothModel
156 */
157+ (__kindof IDOGetVersionInfoBluetoothModel *)currentModel;
158
159@end
160
161#pragma mark ==== 获取GPS状态model ====
162@interface IDOGetGpsStatusBluetoothModel:IDOBluetoothBaseModel
163/**
164 * GPS 运行状态 0 没有运行,1 正在搜星,2 为正在跟踪
165 * GPS running status 0 No running, 1 is searching for stars, 2 is tracking
166 */
167@property (nonatomic,assign) NSInteger gpsRunStatus;
168
169/**
170 * AGPS 是否有效,有效期剩余小时,非0为有效,
171 * AGPS is valid, the remaining period is valid, non-zero is valid,
172 */
173@property (nonatomic,assign) NSInteger isAgpsVaild;
174
175@end
176
177
178#pragma mark ==== 获取热启动参数model ====
179@interface IDOGetHotStartParamBluetoothModel:IDOBluetoothBaseModel
180/**
181 晶振偏移 默认 200 | crystals offset default 200
182 */
183@property (nonatomic,assign) NSInteger tcxoOffset;
184
185/**
186 * 当前位置的经度 当前经度 x 10^6 , 去掉小数,注意西经为负数 默认 0
187 * The current position of the longitude of the current longitude x 10 ^ 6,
188 * remove the decimal, pay attention to the scriptures is negative. default 0
189 */
190@property (nonatomic,assign) NSInteger longitude;
191
192/**
193 * 当前位置的纬度, x10^6 ,去掉小数,注意南纬为负数 默认 0
194 * The current position of latitude, x10 ^ 6, remove the decimal,
195 * pay attention to the south of the equator is negative. default 0
196 */
197@property (nonatomic,assign) NSInteger latitude;
198
199/**
200 当前位置的海拔高度 x10, 去掉小数 默认 0
201 The altitude of the current position x10, get rid of the decimal. default 0
202 */
203@property (nonatomic,assign) NSInteger altitude;
204
205/**
206 * @brief 查询数据库,如果查询不到初始化新的model对象
207 * Query the database, if the query does not initialize a new model object
208 * @return IDOGetHotStartParamBluetoothModel
209 */
210+ (__kindof IDOGetHotStartParamBluetoothModel *)currentModel;
211
212@end
213
214#pragma mark ==== 获取GPS信息model ====
215@interface IDOGetGpsInfoBluetoothModel:IDOBluetoothBaseModel
216
217/**
218 错误码 | error code
219 */
220@property (nonatomic,assign) NSInteger errorCode;
221
222/**
223 固件版本 | Firmware version
224 */
225@property (nonatomic,assign) NSInteger fwVersion;
226
227/**
228 GPS信息 | GPS information
229 */
230@property (nonatomic,assign) NSInteger agpsInfo;
231
232/**
233 GPS错误码 | GPS error code
234 */
235@property (nonatomic,assign) NSInteger agpsErrCode;
236
237/**
238 * @brief 查询数据库,如果查询不到初始化新的model对象
239 * Query the database, if the query does not initialize a new model object
240 * @return IDOGetGpsInfoBluetoothModel
241 */
242+ (__kindof IDOGetGpsInfoBluetoothModel *)currentModel;
243
244@end
245
246#pragma mark ==== 获取hid信息model ====
247@interface IDOGetHidInfoBluetoothModel:IDOBluetoothBaseModel
248
249/**
250 是否开启 | Whether to open
251 */
252@property (nonatomic,assign) BOOL isStart;
253
254/**
255 * @brief 查询数据库,如果查询不到初始化新的model对象 (暂停使用,无效)
256 * Query the database, if the query does not initialize a new model object (suspended, invalid)
257 * @return IDOGetHidInfoBluetoothModel
258 */
259+ (__kindof IDOGetHidInfoBluetoothModel *)currentModel;
260
261@end
262
263#pragma mark ==== 获取活动和GPS个数信息model ====
264@interface IDOGetActivityCountBluetoothModel:IDOBluetoothBaseModel
265
266/**
267 活动个数 | Number of activities
268 */
269@property (nonatomic,assign) NSInteger activityCount;
270
271/**
272 活动包数 | Number of active packages
273 */
274@property (nonatomic,assign) NSInteger activityPacketCount;
275
276/**
277 GPS个数 | Number of GPS data
278 */
279@property (nonatomic,assign) NSInteger gpsCount;
280
281/**
282 GPS包数 | Number of GPS packets
283 */
284@property (nonatomic,assign) NSInteger gpsPacketCount;
285
286/**
287 * @brief 查询数据库,如果查询不到初始化新的model对象 (未作存储处理,只会初始化新对象)
288 * Query the database, if the query does not initialize a new model object (not stored for processing, only the new object will be initialized)
289 * @return IDOGetActivityCountBluetoothModel
290 */
291+ (__kindof IDOGetActivityCountBluetoothModel *)currentModel;
292
293@end
294
295#pragma mark ==== 获取加速度传感器参数信息model ====
296@interface IDOGetGsensorParamBluetoothModel:IDOBluetoothBaseModel
297
298/**
299 率 | rate
300 */
301@property (nonatomic,assign) NSInteger rate;
302
303/**
304 间隔 | range
305 */
306@property (nonatomic,assign) NSInteger range;
307
308/**
309 阀值 | Threshold
310 */
311@property (nonatomic,assign) NSInteger threshold;
312
313/**
314 * @brief 查询数据库,如果查询不到初始化新的model对象 (暂停使用,无效)
315 * Query the database, if the query does not initialize a new model object (suspended, invalid)
316 * @return IDOGetHrSensorParamBluetoothModel
317 */
318+ (__kindof IDOGetGsensorParamBluetoothModel *)currentModel;
319@end
320
321#pragma mark ==== 获取心率传感器参数信息model ====
322@interface IDOGetHrSensorParamBluetoothModel:IDOBluetoothBaseModel
323
324/**
325 心率值 | Heart rate value
326 */
327@property (nonatomic,assign) NSInteger rate;
328
329/**
330 (未知参数) | (unknown parameter)
331 */
332@property (nonatomic,assign) NSInteger ledSelect;
333
334/**
335 * @brief 查询数据库,如果查询不到初始化新的model对象 *(暂停使用,无效)
336 * Query the database, if the query does not initialize a new model object (suspended, invalid)
337 * @return IDOGetHrSensorParamBluetoothModel
338 */
339+ (__kindof IDOGetHrSensorParamBluetoothModel *)currentModel;
340
341@end
342
343#pragma mark ==== 获取设备时间信息model ====
344@interface IDOGetDeviceTimeBluetoothModel:IDOBluetoothBaseModel
345
346/**
347 * 年 | year
348 *
349 */
350@property (nonatomic,assign) NSInteger year;
351
352/**
353 月 | month
354 */
355@property (nonatomic,assign) NSInteger month;
356
357/**
358 日 | day
359 */
360@property (nonatomic,assign) NSInteger day;
361
362/**
363 时 | hour
364 */
365@property (nonatomic,assign) NSInteger hour;
366
367/**
368 分 | Minute
369 */
370@property (nonatomic,assign) NSInteger minute;
371
372/**
373 秒 | second
374 */
375@property (nonatomic,assign) NSInteger second;
376
377/**
378 周 | week
379 */
380@property (nonatomic,assign) NSInteger week;
381
382/**
383 * @brief 查询数据库,如果查询不到初始化新的model对象 *(暂停使用,无效)
384 * Query the database, if the query does not initialize a new model object (suspended, invalid)
385 * @return IDOGetDeviceTimeBluetoothModel
386 */
387+ (__kindof IDOGetDeviceTimeBluetoothModel *)currentModel;
388@end
389
390#pragma mark ==== 获取实时数据信息model ====
391@interface IDOGetLiveDataBluetoothModel:IDOBluetoothBaseModel
392
393/**
394 步数 | Step count
395 */
396@property (nonatomic,assign) NSInteger step;
397
398/**
399 卡路里 | Calorie
400 */
401@property (nonatomic,assign) NSInteger calories;
402
403/**
404 距离 | distance
405 */
406@property (nonatomic,assign) NSInteger distances;
407
408/**
409 活动时长 | Duration of activity
410 */
411@property (nonatomic,assign) NSInteger activeTime;
412
413/**
414 心率 | Heart rate
415 */
416@property (nonatomic,assign) NSInteger heartRate;
417
418/**
419 * @brief 查询数据库,如果查询不到初始化新的model对象
420 * Query the database, if the query does not initialize a new model object
421 * @return IDOGetLiveDataBluetoothModel
422 */
423+ (__kindof IDOGetLiveDataBluetoothModel *)currentModel;
424
425@end
426
427#pragma mark ==== 获取第27个功能表model ====
428
429@interface IDOGetFuncTable27BluetoothModel : IDOBluetoothBaseModel
430/**
431 * 泰国语
432 * thai
433 */
434@property (nonatomic,assign) BOOL thai;
435/**
436 * 越南语
437 * vietnamese
438 */
439@property (nonatomic,assign) BOOL vietnamese;
440/**
441 * 缅甸语
442 * burmese
443 */
444@property (nonatomic,assign) BOOL burmese;
445/**
446 * 菲律宾语
447 * filipino
448 */
449@property (nonatomic,assign) BOOL filipino;
450
451/**
452 * @brief 查询数据库,如果查询不到初始化新的model对象
453 * Query the database, if the query does not initialize a new model object
454 * @return IDOGetFuncTable27BluetoothModel
455 */
456+ (__kindof IDOGetFuncTable27BluetoothModel *)currentModel;
457@end
458
459#pragma mark ==== 获取第26个功能表model ====
460
461@interface IDOGetFuncTable26BluetoothModel : IDOBluetoothBaseModel
462/**
463 * 支持恢复出厂设置,用于自动解绑
464 * Support to restore factory Settings for automatic untying
465 */
466@property (nonatomic,assign) BOOL factoryReset;
467/**
468 * 抬腕亮背光 命令和抬手亮屏一样,就是app显示的名字不一样,不能和other.upHandGesture共存
469 * The backlight command of raising wrist light is the same as raising hand light screen,
470 * except that the name displayed by app is different and cannot coexist with other.upHandGesture
471 */
472@property (nonatomic,assign) BOOL liftingWrisBacklight;
473/**
474 * 多运动不能使用app
475 * No app for more exercise
476 */
477@property (nonatomic,assign) BOOL multiActivityNoUseApp;
478/**
479 * 多表盘
480 * multi dial
481 */
482@property (nonatomic,assign) BOOL multiDial;
483/**
484 * 中高强度活动
485 * medium to high active duration
486 */
487@property (nonatomic,assign) BOOL mediumToHighActiveDuration;
488/**
489 * 获取手环运动模式
490 * default sport type
491 */
492@property (nonatomic,assign) BOOL defaultSportType;
493/**
494 * 可下载语言
495 * download language
496 */
497@property (nonatomic,assign) BOOL downloadLanguage;
498/**
499 * @brief 查询数据库,如果查询不到初始化新的model对象
500 * Query the database, if the query does not initialize a new model object
501 * @return IDOGetFuncTable26BluetoothModel
502 */
503+ (__kindof IDOGetFuncTable26BluetoothModel *)currentModel;
504@end
505
506#pragma mark ==== 获取第25个功能表model ====
507
508@interface IDOGetFuncTable25BluetoothModel:IDOBluetoothBaseModel
509/**
510 椭圆机 | elliptical
511 */
512@property (nonatomic,assign) BOOL elliptical;
513/**
514 划船机 | rower
515 */
516@property (nonatomic,assign) BOOL rower;
517/**
518 高强度间歇训练法 | High-intensity interval training
519 */
520@property (nonatomic,assign) BOOL hiit;
521/**
522 板球运动 | cricket
523 */
524@property (nonatomic,assign) BOOL cricket;
525/**
526 * @brief 查询数据库,如果查询不到初始化新的model对象
527 * Query the database, if the query does not initialize a new model object
528 * @return IDOGetFuncTable25BluetoothModel
529 */
530+ (__kindof IDOGetFuncTable25BluetoothModel *)currentModel;
531
532@end
533
534#pragma mark ==== 获取第24个功能表model ====
535
536@interface IDOGetFuncTable24BluetoothModel:IDOBluetoothBaseModel
537/**
538 户外跑步 | outdoor run
539 */
540@property (nonatomic,assign) BOOL outdoorRun;
541/**
542 室内跑步 | indoor run
543 */
544@property (nonatomic,assign) BOOL indoorRun;
545/**
546 户外骑行 | outdoor cycle
547 */
548@property (nonatomic,assign) BOOL outdoorCycle;
549/**
550 室内骑行 | indoor cycle
551 */
552@property (nonatomic,assign) BOOL indoorCycle;
553/**
554 户外走路 | outdoor walk
555 */
556@property (nonatomic,assign) BOOL outdoorWalk;
557/**
558室内走路 | indoor walk
559 */
560@property (nonatomic,assign) BOOL indoorWalk;
561/**
562 泳池游泳 | pool swim
563 */
564@property (nonatomic,assign) BOOL poolSwim;
565/**
566 开放水域游泳 | open water swim
567 */
568@property (nonatomic,assign) BOOL openWaterSwim;
569
570/**
571 * @brief 查询数据库,如果查询不到初始化新的model对象
572 * Query the database, if the query does not initialize a new model object
573 * @return IDOGetFuncTable24BluetoothModel
574 */
575+ (__kindof IDOGetFuncTable24BluetoothModel *)currentModel;
576
577@end
578
579#pragma mark ==== 获取第23个功能表model ====
580@interface IDOGetFuncTable23BluetoothModel:IDOBluetoothBaseModel
581/**
582 5级心率区间 | level 5 hr interval
583 */
584@property (nonatomic,assign) BOOL level5HrInterval;
585/**
586 走动提醒 | walk reminder
587 */
588@property (nonatomic,assign) BOOL walkReminder;
589/**
590 呼吸训练 | breathe train
591 */
592@property (nonatomic,assign) BOOL breatheTrain;
593
594/**
595 5级亮度调节 | screen brightness 5 level
596 */
597@property (nonatomic,assign) BOOL screenBrightness5Level;
598/**
599 运动模式开关 自动识别 | activity switch
600 */
601@property (nonatomic,assign) BOOL activitySwitch;
602/**
603 勿扰 支持可选时间范围和星期 | disturb have rang repeat
604 */
605@property (nonatomic,assign) BOOL disturbHaveRangRepeat;
606/**
607 夜间自动亮度 | night auto brightness
608 */
609@property (nonatomic,assign) BOOL nightAutoBrightness;
610/**
611 传输长包 | long mtu
612 */
613@property (nonatomic,assign) BOOL longMtu;
614/**
615 * @brief 查询数据库,如果查询不到初始化新的model对象
616 * Query the database, if the query does not initialize a new model object
617 * @return IDOGetFuncTable23BluetoothModel
618 */
619+ (__kindof IDOGetFuncTable23BluetoothModel *)currentModel;
620
621@end
622
623#pragma mark ==== 获取22功能列表信息model ====
624@interface IDOGetFuncTable22BluetoothModel:IDOBluetoothBaseModel
625/**
626 连接后自动配对 | auto pair
627 */
628@property (nonatomic,assign) BOOL autoPair;
629
630/**
631 不断线配对 | no disconnect pair
632 */
633@property (nonatomic,assign) BOOL noDisconnectPair;
634
635/**
636 v3 心率数据 | v3 hr data
637 */
638@property (nonatomic,assign) BOOL v3HrData;
639
640/**
641 v3 游泳数据 | v3 swim data
642 */
643@property (nonatomic,assign) BOOL v3SwimData;
644
645/**
646 v3 活动数据 | v3 activity data
647 */
648@property (nonatomic,assign) BOOL v3ActivityData;
649
650/**
651 v3 gps 数据 | v3 gps data
652 */
653@property (nonatomic,assign) BOOL v3GpsData;
654
655/**
656 喝水提醒 | drink water reminder
657 */
658@property (nonatomic,assign) BOOL drinkWaterReminder;
659
660/**
661 * @brief 查询数据库,如果查询不到初始化新的model对象
662 * Query the database, if the query does not initialize a new model object
663 * @return IDOGetFuncTable22BluetoothModel
664 */
665+ (__kindof IDOGetFuncTable22BluetoothModel *)currentModel;
666@end
667
668#pragma mark ==== 获取21功能列表信息model ====
669@interface IDOGetFuncTable21BluetoothModel:IDOBluetoothBaseModel
670/**
671 chatwork
672 */
673@property (nonatomic,assign) BOOL chatwork;
674/**
675 slack
676 */
677@property (nonatomic,assign) BOOL slack;
678/**
679 tumblr
680 */
681@property (nonatomic,assign) BOOL tumblr;
682/**
683 youtube
684 */
685@property (nonatomic,assign) BOOL youtube;
686/**
687 yahoo pinterest
688 */
689@property (nonatomic,assign) BOOL yahooPinterest;
690/**
691 yahoo mail
692 */
693@property (nonatomic,assign) BOOL yahooMail;
694
695/**
696 * @brief 查询数据库,如果查询不到初始化新的model对象
697 * Query the database, if the query does not initialize a new model object
698 * @return IDOGetFuncTable21BluetoothModel
699 */
700+ (__kindof IDOGetFuncTable21BluetoothModel *)currentModel;
701@end
702
703#pragma mark ==== 获取20功能列表信息model ====
704@interface IDOGetFuncTable20BluetoothModel:IDOBluetoothBaseModel
705
706/**
707 女性生理周期 | Female physiological cycle
708 */
709@property (nonatomic,assign) BOOL menstruation;
710
711/**
712 卡路里目标 | Calorie goal
713 */
714@property (nonatomic,assign) BOOL calorieGoal;
715
716/**
717 距离目标 | Distance target
718 */
719@property (nonatomic,assign) BOOL distanceGoal;
720
721/**
722 血氧数据 | Blood oxygen
723 */
724@property (nonatomic,assign) BOOL spo2Data;
725
726/**
727 压力数据 | pressure data
728 */
729@property (nonatomic,assign) BOOL pressureData;
730
731/**
732 获取勿扰模式 | get do not disturb
733 */
734@property (nonatomic,assign) BOOL getNoDisturb;
735
736/**
737 运动模式排序 | sport mode sort
738 */
739@property (nonatomic,assign) BOOL sportModeSort;
740
741/**
742 通知消息字节250 | notice message 250 byte
743 */
744@property (nonatomic,assign) BOOL noticeByte;
745
746/**
747 * @brief 查询数据库,如果查询不到初始化新的model对象
748 * Query the database, if the query does not initialize a new model object
749 * @return IDOGetFuncTable20BluetoothModel
750 */
751+ (__kindof IDOGetFuncTable20BluetoothModel *)currentModel;
752
753@end
754
755#pragma mark ==== 获取19功能列表信息model ====
756@interface IDOGetFuncTable19BluetoothModel:IDOBluetoothBaseModel
757
758/**
759 gps
760 */
761@property (nonatomic,assign) BOOL gps;
762
763/**
764 睡眠时间段 | Sleep period
765 */
766@property (nonatomic,assign) BOOL sleepPeriod;
767
768/**
769 屏幕亮度调节 | Screen brightness adjustment
770 */
771@property (nonatomic,assign) BOOL screenBrightness;
772
773/**
774 id107l 表盘 | Id107l dial
775 */
776@property (nonatomic,assign) BOOL id107Dial;
777
778/**
779 未知 属性 | Unknown attribute
780 */
781@property (nonatomic,assign) BOOL dhNewAppNotice;
782
783/**
784 128字节通知 | 128 byte notification
785 */
786@property (nonatomic,assign) BOOL noitice128Byte;
787
788/**
789 获取时间同步 | Get time synchronization
790 */
791@property (nonatomic,assign) BOOL activityTimeSync;
792
793/**
794 v3 收集 | Collection log
795 */
796@property (nonatomic,assign) BOOL v3Log;
797
798/**
799 * @brief 查询数据库,如果查询不到初始化新的model对象
800 * Query the database, if the query does not initialize a new model object
801 * @return IDOGetFuncTable19BluetoothModel
802 */
803+ (__kindof IDOGetFuncTable19BluetoothModel *)currentModel;
804
805@end
806
807#pragma mark ==== 获取18列表信息model ====
808@interface IDOGetFuncTable18BluetoothModel:IDOBluetoothBaseModel
809
810/**
811 登陆 | login
812 */
813@property (nonatomic,assign) BOOL logIn;
814
815/**
816 手环自带相机拍照 | Bracelet comes with a camera to take pictures
817 */
818@property (nonatomic,assign) BOOL hidPhoto;
819
820/**
821 表盘 | dial
822 */
823@property (nonatomic,assign) BOOL watchDial;
824
825/**
826 快捷方式 | Shortcut
827 */
828@property (nonatomic,assign) BOOL shortcut;
829
830/**
831 单位分开设置 | Units are set separately
832 */
833@property (nonatomic,assign) BOOL unitSet;
834
835/**
836 血压 | blood pressure
837 */
838@property (nonatomic,assign) BOOL bloodPressure;
839
840/**
841 微信运动 | WeChat Sport
842 */
843@property (nonatomic,assign) BOOL wechatSport;
844
845/**
846 精细的时间段控制 | Fine time period control
847 */
848@property (nonatomic,assign) BOOL fineTimeControl;
849
850/**
851 * @brief 查询数据库,如果查询不到初始化新的model对象
852 * Query the database, if the query does not initialize a new model object
853 * @return IDOGetFuncTable18BluetoothModel
854 */
855+ (__kindof IDOGetFuncTable18BluetoothModel *)currentModel;
856
857@end
858
859#pragma mark ==== 获取17功能列表信息model ====
860@interface IDOGetFuncTable17BluetoothModel:IDOBluetoothBaseModel
861
862/**
863 高尔夫 | Golf
864 */
865@property (nonatomic,assign) BOOL golf;
866
867/**
868 棒球 | baseball
869 */
870@property (nonatomic,assign) BOOL baseball;
871
872/**
873 滑雪 | ski
874 */
875@property (nonatomic,assign) BOOL skiing;
876
877/**
878 轮滑 | Roller
879 */
880@property (nonatomic,assign) BOOL rollerSkating;
881
882/**
883 跳舞 | dancing
884 */
885@property (nonatomic,assign) BOOL dance;
886
887/**
888 * @brief 查询数据库,如果查询不到初始化新的model对象
889 * Query the database, if the query does not initialize a new model object
890 * @return IDOGetFuncTable17BluetoothModel
891 */
892+ (__kindof IDOGetFuncTable17BluetoothModel *)currentModel;
893
894@end
895
896#pragma mark ==== 获取16功能列表信息model ====
897@interface IDOGetFuncTable16BluetoothModel:IDOBluetoothBaseModel
898
899/**
900 健身操 | Aerobics
901 */
902@property (nonatomic,assign) BOOL bodybuildingExercise;
903
904/**
905 瑜伽 | Yoga
906 */
907@property (nonatomic,assign) BOOL yoga;
908
909/**
910 跳绳 | rope skipping
911 */
912@property (nonatomic,assign) BOOL ropeSkipping;
913/**
914 乒乓球 | pingpong
915 */
916@property (nonatomic,assign) BOOL tableTennis;
917
918/**
919 篮球 | basketball
920 */
921@property (nonatomic,assign) BOOL basketball;
922
923/**
924 足球 | football
925 */
926@property (nonatomic,assign) BOOL football;
927
928/**
929 排球 | volleyball
930 */
931@property (nonatomic,assign) BOOL volleyball;
932
933/**
934 网球 | tennis
935 */
936@property (nonatomic,assign) BOOL tennis;
937
938/**
939 * @brief 查询数据库,如果查询不到初始化新的model对象
940 * Query the database, if the query does not initialize a new model object
941 * @return IDOGetFuncTable16BluetoothModel
942 */
943+ (__kindof IDOGetFuncTable16BluetoothModel *)currentModel;
944
945@end
946
947#pragma mark ==== 获取15功能列表信息model ====
948@interface IDOGetFuncTable15BluetoothModel:IDOBluetoothBaseModel
949
950/**
951 健身 | Fitness
952 */
953@property (nonatomic,assign) BOOL fitness;
954
955/**
956 动感单车 | Spinning bike
957 */
958@property (nonatomic,assign) BOOL spinning;
959
960/**
961 椭圆球 | Oval ball
962 */
963@property (nonatomic,assign) BOOL ellipsoid;
964
965/**
966 跑步机 | Treadmill
967 */
968@property (nonatomic,assign) BOOL treadmill;
969
970/**
971 仰卧起坐 | Sit-ups
972 */
973@property (nonatomic,assign) BOOL sitUp;
974
975/**
976 俯卧撑 | push ups
977 */
978@property (nonatomic,assign) BOOL pushUp;
979
980/**
981 哑铃 | Dumbbell
982 */
983@property (nonatomic,assign) BOOL dumbbell;
984
985/**
986 举重 | weightlifting
987 */
988@property (nonatomic,assign) BOOL weightlifting;
989
990/**
991 * @brief 查询数据库,如果查询不到初始化新的model对象
992 * Query the database, if the query does not initialize a new model object
993 * @return IDOGetFuncTable15BluetoothModel
994 */
995
996+ (__kindof IDOGetFuncTable15BluetoothModel *)currentModel;
997@end
998
999#pragma mark ==== 获取14功能列表信息model ====
1000@interface IDOGetFuncTable14BluetoothModel:IDOBluetoothBaseModel
1001
1002/**
1003 走路 | walk
1004 */
1005@property (nonatomic,assign) BOOL walk;
1006
1007/**
1008 跑步 | Run
1009 */
1010@property (nonatomic,assign) BOOL run;
1011
1012/**
1013 骑行 | Riding
1014 */
1015@property (nonatomic,assign) BOOL byBike;
1016
1017/**
1018 徒步 | on foot
1019 */
1020@property (nonatomic,assign) BOOL onFoot;
1021
1022/**
1023 游泳 | Swim
1024 */
1025@property (nonatomic,assign) BOOL swim;
1026
1027/**
1028 爬山 | Mountain climbing
1029 */
1030@property (nonatomic,assign) BOOL mountainClimbing;
1031
1032/**
1033 羽毛球 | badminton
1034 */
1035@property (nonatomic,assign) BOOL badminton;
1036
1037/**
1038 其他 | other
1039 */
1040@property (nonatomic,assign) BOOL other;
1041
1042/**
1043 * @brief 查询数据库,如果查询不到初始化新的model对象
1044 * Query the database, if the query does not initialize a new model object
1045 * @return IDOGetFuncTable14BluetoothModel
1046 */
1047+ (__kindof IDOGetFuncTable14BluetoothModel *)currentModel;
1048
1049@end
1050
1051#pragma mark ==== 获取13功能列表信息model ====
1052@interface IDOGetFuncTable13BluetoothModel:IDOBluetoothBaseModel
1053
1054/**
1055 静态心率 | Static heart rate
1056 */
1057@property (nonatomic,assign) BOOL staticHr;
1058
1059/**
1060 防打扰 | Anti-disturbance
1061 */
1062@property (nonatomic,assign) BOOL doNotDisturb;
1063
1064/**
1065 显示模式 | Display mode
1066 */
1067@property (nonatomic,assign) BOOL displayMode;
1068
1069/**
1070 心率监测 | Heart rate monitoring
1071 */
1072@property (nonatomic,assign) BOOL heartRateMonitor;
1073
1074/**
1075 双向防丢 | Two-way anti-lost
1076 */
1077@property (nonatomic,assign) BOOL bilateralAntiLost;
1078
1079/**
1080 所有通知提醒 | All notification reminders
1081 */
1082@property (nonatomic,assign) BOOL allAppNotice;
1083
1084/**
1085 不显示心率区间 | Does not show heart rate interval
1086 */
1087@property (nonatomic,assign) BOOL noShowHrInterval;
1088
1089/**
1090 翻转屏幕 | Flip the screen
1091 */
1092@property (nonatomic,assign) BOOL flipScreen;
1093
1094/**
1095 *@brief 查询数据库,如果查询不到初始化新的model对象
1096 * Query the database, if the query does not initialize a new model object
1097 *@return IDOGetFuncTable13BluetoothModel
1098 */
1099+ (__kindof IDOGetFuncTable13BluetoothModel *)currentModel;
1100
1101@end
1102
1103#pragma mark ==== 获取12功能列表信息model ====
1104@interface IDOGetFuncTable12BluetoothModel:IDOBluetoothBaseModel
1105
1106/**
1107 提示信息联系人 | Tips Contact
1108 */
1109@property (nonatomic,assign) BOOL tipInfoContact;
1110
1111/**
1112 提示信息号码 | Message number
1113 */
1114@property (nonatomic,assign) BOOL tipInfoNum;
1115
1116/**
1117 提醒信息内容 | Reminder content
1118 */
1119@property (nonatomic,assign) BOOL tipInfoContent;
1120
1121/**
1122 * @brief 查询数据库,如果查询不到初始化新的model对象
1123 * Query the database, if the query does not initialize a new model object
1124 * @return IDOGetFuncTable12BluetoothModel
1125 */
1126+ (__kindof IDOGetFuncTable12BluetoothModel *)currentModel;
1127
1128@end
1129
1130#pragma mark ==== 获取11功能列表信息model ====
1131@interface IDOGetFuncTable11BluetoothModel:IDOBluetoothBaseModel
1132
1133/**
1134 久坐提醒 | Sedentary reminder
1135 */
1136@property (nonatomic,assign) BOOL sedentariness;
1137
1138/**
1139 防丢提醒 | Anti-lost reminder
1140 */
1141@property (nonatomic,assign) BOOL antilost;
1142
1143/**
1144 一键呼叫 | One-click calling
1145 */
1146@property (nonatomic,assign) BOOL onetouchCalling;
1147
1148/**
1149 寻找手机 | Looking for a mobile phone
1150 */
1151@property (nonatomic,assign) BOOL findPhone;
1152
1153/**
1154 寻找手环 | Looking for a bracelet
1155 */
1156@property (nonatomic,assign) BOOL findDevice;
1157
1158/**
1159 默认模式 | Default mode
1160 */
1161@property (nonatomic,assign) BOOL configDefault;
1162
1163/**
1164 手势 | Gestures
1165 */
1166@property (nonatomic,assign) BOOL upHandGesture;
1167
1168/**
1169 天气预报 | Weather forecast
1170 */
1171@property (nonatomic,assign) BOOL weather;
1172
1173/**
1174 * @brief 查询数据库,如果查询不到初始化新的model对象
1175 * Query the database, if the query does not initialize a new model object
1176 * @return IDOGetFuncTable11BluetoothModel
1177 */
1178+ (__kindof IDOGetFuncTable11BluetoothModel *)currentModel;
1179
1180@end
1181
1182#pragma mark ==== 获取10功能列表信息model ====
1183@interface IDOGetFuncTable10BluetoothModel:IDOBluetoothBaseModel
1184
1185/**
1186 vkontakte
1187 */
1188@property (nonatomic,assign) BOOL vkontakte;
1189
1190/**
1191 line
1192 */
1193@property (nonatomic,assign) BOOL line;
1194
1195/**
1196 viber
1197 */
1198@property (nonatomic,assign) BOOL viber;
1199
1200/**
1201 kakaoTalk
1202 */
1203@property (nonatomic,assign) BOOL kakaoTalk;
1204
1205/**
1206 gmail
1207 */
1208@property (nonatomic,assign) BOOL gmail;
1209
1210/**
1211 outlook
1212 */
1213@property (nonatomic,assign) BOOL outlook;
1214
1215/**
1216 snapchat
1217 */
1218@property (nonatomic,assign) BOOL snapchat;
1219
1220/**
1221 telegram
1222 */
1223@property (nonatomic,assign) BOOL telegram;
1224
1225/**
1226 * @brief 查询数据库,如果查询不到初始化新的model对象
1227 * Query the database, if the query does not initialize a new model object
1228 * @return IDOGetFuncTable10BluetoothModel
1229 */
1230+ (__kindof IDOGetFuncTable10BluetoothModel *)currentModel;
1231
1232@end
1233
1234#pragma mark ==== 获取9功能列表信息model ====
1235@interface IDOGetFuncTable9BluetoothModel:IDOBluetoothBaseModel
1236
1237/**
1238 whatsapp
1239 */
1240@property (nonatomic,assign) BOOL whatsapp;
1241
1242/**
1243 messengre
1244 */
1245@property (nonatomic,assign) BOOL messengre;
1246
1247/**
1248 instagram
1249 */
1250@property (nonatomic,assign) BOOL instagram;
1251
1252/**
1253 linkedIn
1254 */
1255@property (nonatomic,assign) BOOL linkedIn;
1256
1257/**
1258 calendar
1259 */
1260@property (nonatomic,assign) BOOL calendar;
1261
1262/**
1263 skype
1264 */
1265@property (nonatomic,assign) BOOL skype;
1266
1267/**
1268 alarmClock
1269 */
1270@property (nonatomic,assign) BOOL alarmClock;
1271
1272
1273/**
1274 * @brief 查询数据库,如果查询不到初始化新的model对象
1275 * Query the database, if the query does not initialize a new model object
1276 * @return IDOGetFuncTable9BluetoothModel
1277 */
1278+ (__kindof IDOGetFuncTable9BluetoothModel *)currentModel;
1279
1280@end
1281
1282#pragma mark ==== 获取8功能列表信息model ====
1283@interface IDOGetFuncTable8BluetoothModel:IDOBluetoothBaseModel
1284
1285/**
1286 短信 | SMS
1287 */
1288@property (nonatomic,assign) BOOL message;
1289
1290/**
1291 邮件 | Mail
1292 */
1293@property (nonatomic,assign) BOOL email;
1294
1295/**
1296 qq
1297 */
1298@property (nonatomic,assign) BOOL qq;
1299
1300/**
1301 微信 | WeChat
1302 */
1303@property (nonatomic,assign) BOOL weixin;
1304
1305/**
1306 新浪 | Sina
1307 */
1308@property (nonatomic,assign) BOOL sinaWeibo;
1309
1310/**
1311 facebook
1312 */
1313@property (nonatomic,assign) BOOL facebook;
1314
1315/**
1316 twitter
1317 */
1318@property (nonatomic,assign) BOOL twitter;
1319
1320/**
1321 * @brief 查询数据库,如果查询不到初始化新的model对象
1322 * Query the database, if the query does not initialize a new model object
1323 * @return IDOGetFuncTable8BluetoothModel
1324 */
1325+ (__kindof IDOGetFuncTable8BluetoothModel *)currentModel;
1326@end
1327
1328#pragma mark ==== 获取7功能列表信息model ====
1329@interface IDOGetFuncTable7BluetoothModel:IDOBluetoothBaseModel
1330
1331/**
1332 来电提醒 | Call reminder
1333 */
1334@property (nonatomic,assign) BOOL calling;
1335
1336/**
1337 来电联系人 | Caller contact
1338 */
1339@property (nonatomic,assign) BOOL callingContact;
1340
1341/**
1342 来电号码 | Caller ID
1343 */
1344@property (nonatomic,assign) BOOL callingNum;
1345
1346/**
1347 * @brief 查询数据库,如果查询不到初始化新的model对象
1348 * Query the database, if the query does not initialize a new model object
1349 * @return IDOGetFuncTable7BluetoothModel
1350 */
1351+ (__kindof IDOGetFuncTable7BluetoothModel *)currentModel;
1352@end
1353
1354#pragma mark ==== 获取6功能列表信息model ====
1355@interface IDOGetFuncTable6BluetoothModel:IDOBluetoothBaseModel
1356
1357/**
1358 起床 | Get up
1359 */
1360@property (nonatomic,assign) BOOL wakeUp;
1361
1362/**
1363 睡觉 | Sleeping
1364 */
1365@property (nonatomic,assign) BOOL sleep;
1366
1367/**
1368 锻炼 | Exercise
1369 */
1370@property (nonatomic,assign) BOOL sport;
1371
1372/**
1373 吃药 | Taking medicine
1374 */
1375@property (nonatomic,assign) BOOL medicine;
1376
1377/**
1378 约会 | Dating
1379 */
1380@property (nonatomic,assign) BOOL dating;
1381
1382/**
1383 聚会 | Party
1384 */
1385@property (nonatomic,assign) BOOL party;
1386
1387/**
1388 会议 | Meeting
1389 */
1390@property (nonatomic,assign) BOOL metting;
1391
1392/**
1393 自定义 | Customization
1394 */
1395@property (nonatomic,assign) BOOL custom;
1396
1397/**
1398 * @brief 查询数据库,如果查询不到初始化新的model对象
1399 * Query the database, if the query does not initialize a new model object
1400 * @return IDOGetFuncTable6BluetoothModel
1401 */
1402+ (__kindof IDOGetFuncTable6BluetoothModel *)currentModel;
1403@end
1404
1405#pragma mark ==== 获取5功能列表信息model ====
1406@interface IDOGetFuncTable5BluetoothModel:IDOBluetoothBaseModel
1407
1408/**
1409 拍照 | taking pictures
1410 */
1411@property (nonatomic,assign) BOOL takePhoto;
1412
1413/**
1414 音乐 | Music
1415 */
1416@property (nonatomic,assign) BOOL music;
1417
1418/**
1419 控制拍照 | Control photo
1420 */
1421@property (nonatomic,assign) BOOL hidPhoto;
1422
1423/**
1424 5个心率区间 | 5 heart rate intervals
1425 */
1426@property (nonatomic,assign) BOOL fiveHrInterval;
1427
1428/**
1429 绑定授权 | Binding Authorization
1430 */
1431@property (nonatomic,assign) BOOL bindAuth;
1432
1433/**
1434 快速同步 | Quick sync
1435 */
1436@property (nonatomic,assign) BOOL fastSync;
1437
1438/**
1439 扩展功能 | Extended Features
1440 */
1441@property (nonatomic,assign) BOOL exFuncTable;
1442
1443/**
1444 绑定码授权 | Binding Code Authorization
1445 */
1446@property (nonatomic,assign) BOOL bindCodeAuth;
1447
1448/**
1449 * @brief 查询数据库,如果查询不到初始化新的model对象
1450 * Query the database, if the query does not initialize a new model object
1451 * @return IDOGetFuncTable5BluetoothModel
1452 */
1453+ (__kindof IDOGetFuncTable5BluetoothModel *)currentModel;
1454@end
1455
1456#pragma mark ==== 获取4功能列表信息model ====
1457@interface IDOGetFuncTable4BluetoothModel:IDOBluetoothBaseModel
1458
1459/**
1460 步数 | Number of steps
1461 */
1462@property (nonatomic,assign) BOOL stepCalculation;
1463
1464/**
1465 睡眠检测 | Sleep detection
1466 */
1467@property (nonatomic,assign) BOOL sleepMonitor;
1468
1469/**
1470 单次运动 | Single movement
1471 */
1472@property (nonatomic,assign) BOOL singleSport;
1473
1474/**
1475 实时数据 | Real-time data
1476 */
1477@property (nonatomic,assign) BOOL realtimeData;
1478
1479/**
1480 设备更新 | Equipment Update
1481 */
1482@property (nonatomic,assign) BOOL deviceUpdate;
1483
1484/**
1485 心率功能 | Heart rate function
1486 */
1487@property (nonatomic,assign) BOOL heartRate;
1488
1489/**
1490 通知中心 | Notification Center
1491 */
1492@property (nonatomic,assign) BOOL ancs;
1493
1494/**
1495 时间线 | Timeline
1496 */
1497@property (nonatomic,assign) BOOL timeLine;
1498
1499/**
1500 * @brief 查询数据库,如果查询不到初始化新的model对象
1501 * Query the database, if the query does not initialize a new model object
1502 * @return IDOGetFuncTable4BluetoothModel
1503 */
1504+ (__kindof IDOGetFuncTable4BluetoothModel *)currentModel;
1505
1506@end
1507
1508#pragma mark ==== 获取3功能列表信息model ====
1509@interface IDOGetFuncTable3BluetoothModel:IDOBluetoothBaseModel
1510
1511/**
1512 斯洛伐克语 | Slovak
1513 */
1514@property (nonatomic,assign) BOOL slovak;
1515
1516/**
1517 丹麦语 | Danish
1518 */
1519@property (nonatomic,assign) BOOL danish;
1520
1521/**
1522 克罗地亚语 | Croatian
1523 */
1524@property (nonatomic,assign) BOOL croatian;
1525
1526/**
1527 印尼语 | Indonesian
1528 */
1529@property (nonatomic,assign) BOOL indonesian;
1530
1531/**
1532 韩语 | korean
1533 */
1534@property (nonatomic,assign) BOOL korean;
1535
1536/**
1537 印地语 | hindi
1538 */
1539@property (nonatomic,assign) BOOL hindi;
1540
1541/**
1542 葡萄牙语 | portuguese
1543 */
1544@property (nonatomic,assign) BOOL portuguese;
1545
1546/**
1547 土耳其 | turkish
1548 */
1549@property (nonatomic,assign) BOOL turkish;
1550
1551/**
1552 * @brief 查询数据库,如果查询不到初始化新的model对象
1553 * Query the database, if the query does not initialize a new model object
1554 * @return IDOGetFuncTable3BluetoothModel
1555 */
1556+ (__kindof IDOGetFuncTable3BluetoothModel *)currentModel;
1557
1558@end
1559
1560
1561#pragma mark ==== 获取2功能列表信息model ====
1562@interface IDOGetFuncTable2BluetoothModel:IDOBluetoothBaseModel
1563
1564/**
1565 罗马尼亚文 | Romanian
1566 */
1567@property (nonatomic,assign) BOOL romanian;
1568
1569/**
1570 立陶宛文 | Lithuanian
1571 */
1572@property (nonatomic,assign) BOOL lithuanian;
1573
1574/**
1575 荷兰文 | Dutch
1576 */
1577@property (nonatomic,assign) BOOL dutch;
1578
1579/**
1580 斯洛文尼亚文 | Slovenian
1581 */
1582@property (nonatomic,assign) BOOL slovenian;
1583
1584/**
1585 匈牙利文 | Hungarian
1586 */
1587@property (nonatomic,assign) BOOL hungarian;
1588
1589/**
1590 波兰文 | Polish
1591 */
1592@property (nonatomic,assign) BOOL polish;
1593
1594/**
1595 俄罗斯文 | Russian
1596 */
1597@property (nonatomic,assign) BOOL russian;
1598
1599/**
1600 乌克兰文 | Ukrainian
1601 */
1602@property (nonatomic,assign) BOOL ukrainian;
1603
1604/**
1605 * @brief 查询数据库,如果查询不到初始化新的model对象
1606 * Query the database, if the query does not initialize a new model object
1607 * @return IDOGetFuncTable2BluetoothModel
1608 */
1609+ (__kindof IDOGetFuncTable2BluetoothModel *)currentModel;
1610@end
1611
1612#pragma mark ==== 获取1功能列表信息model ====
1613@interface IDOGetFuncTable1BluetoothModel:IDOBluetoothBaseModel
1614
1615/**
1616 中文 | Chinese
1617 */
1618@property (nonatomic,assign) BOOL ch;
1619
1620/**
1621 英文 | English
1622 */
1623@property (nonatomic,assign) BOOL eng;
1624
1625/**
1626 法文 | French
1627 */
1628@property (nonatomic,assign) BOOL french;
1629
1630/**
1631 德文 | German
1632 */
1633@property (nonatomic,assign) BOOL german;
1634
1635/**
1636 意大利文 | Italian
1637 */
1638@property (nonatomic,assign) BOOL italian;
1639
1640/**
1641 西班牙文 | Spanish
1642 */
1643@property (nonatomic,assign) BOOL spanish;
1644
1645/**
1646 日文 | Japanese
1647 */
1648@property (nonatomic,assign) BOOL japanese;
1649
1650/**
1651 捷克文 | Czech
1652 */
1653@property (nonatomic,assign) BOOL czech;
1654
1655/**
1656 * @brief 查询数据库,如果查询不到初始化新的model对象
1657 * Query the database, if the query does not initialize a new model object
1658 * @return IDOGetFuncTable1BluetoothModel
1659 */
1660+ (__kindof IDOGetFuncTable1BluetoothModel *)currentModel;
1661@end
1662
1663#pragma mark ==== 获取功能列表信息model ====
1664@interface IDOGetDeviceFuncBluetoothModel:IDOBluetoothBaseModel
1665
1666/**
1667 1功能列表 语言1 | 1 func table
1668 */
1669@property (nonatomic,strong) IDOGetFuncTable1BluetoothModel * funcTable1Model;
1670
1671/**
1672 2功能列表 语言2 | 2 func table
1673 */
1674@property (nonatomic,strong) IDOGetFuncTable2BluetoothModel * funcTable2Model;
1675
1676/**
1677 3功能列表 语言3 | 3 func table
1678 */
1679@property (nonatomic,strong) IDOGetFuncTable3BluetoothModel * funcTable3Model;
1680
1681/**
1682 4功能列表 | 4 func table
1683 */
1684@property (nonatomic,strong) IDOGetFuncTable4BluetoothModel * funcTable4Model;
1685
1686/**
1687 5功能列表 | 5 func table
1688 */
1689@property (nonatomic,strong) IDOGetFuncTable5BluetoothModel * funcTable5Model;
1690
1691/**
1692 6功能列表 闹钟功能 | 6 func table
1693 */
1694@property (nonatomic,strong) IDOGetFuncTable6BluetoothModel * funcTable6Model;
1695
1696/**
1697 7功能列表 来电提醒 | 7 func table
1698 */
1699@property (nonatomic,strong) IDOGetFuncTable7BluetoothModel * funcTable7Model;
1700
1701/**
1702 8功能列表 智能提醒1 | 8 func table
1703 */
1704@property (nonatomic,strong) IDOGetFuncTable8BluetoothModel * funcTable8Model;
1705
1706/**
1707 9功能列表 智能提醒2 | 9 func table
1708 */
1709@property (nonatomic,strong) IDOGetFuncTable9BluetoothModel * funcTable9Model;
1710
1711/**
1712 10功能列表 智能提醒3 | 10 func table
1713 */
1714@property (nonatomic,strong) IDOGetFuncTable10BluetoothModel * funcTable10Model;
1715
1716/**
1717 11功能列表 久坐、防丢 | 11 func table
1718 */
1719@property (nonatomic,strong) IDOGetFuncTable11BluetoothModel * funcTable11Model;
1720
1721/**
1722 12功能列表 短信号码 | 12 func table
1723 */
1724@property (nonatomic,strong) IDOGetFuncTable12BluetoothModel * funcTable12Model;
1725
1726/**
1727 13功能列表 静态心率、显示模式 | 13 func table
1728 */
1729@property (nonatomic,strong) IDOGetFuncTable13BluetoothModel * funcTable13Model;
1730
1731/**
1732 14功能列表 运动模式1 | 14 func table
1733 */
1734@property (nonatomic,strong) IDOGetFuncTable14BluetoothModel * funcTable14Model;
1735
1736/**
1737 15功能列表 运动模式2 | 15 func table
1738 */
1739@property (nonatomic,strong) IDOGetFuncTable15BluetoothModel * funcTable15Model;
1740
1741/**
1742 16功能列表 运动模式3 | 16 func table
1743 */
1744@property (nonatomic,strong) IDOGetFuncTable16BluetoothModel * funcTable16Model;
1745
1746/**
1747 17功能列表 运动模式4 | 17 func table
1748 */
1749@property (nonatomic,strong) IDOGetFuncTable17BluetoothModel * funcTable17Model;
1750
1751/**
1752 18功能列表 表盘、血压 | 18 func table
1753 */
1754@property (nonatomic,strong) IDOGetFuncTable18BluetoothModel * funcTable18Model;
1755
1756/**
1757 19功能列表 GPS、亮度 | 19 func table
1758 */
1759@property (nonatomic,strong) IDOGetFuncTable19BluetoothModel * funcTable19Model;
1760
1761/**
1762 20功能列表 女性健康、运动排序 | 20 func table
1763 */
1764@property (nonatomic,strong) IDOGetFuncTable20BluetoothModel * funcTable20Model;
1765
1766/**
1767 21功能列表 | 21 func table
1768 */
1769@property (nonatomic,strong) IDOGetFuncTable21BluetoothModel * funcTable21Model;
1770
1771/**
1772 22功能列表 连接后自动配对、v3数据 | 22 func table
1773 */
1774@property (nonatomic,strong) IDOGetFuncTable22BluetoothModel * funcTable22Model;
1775
1776/**
1777 23功能列表 走动提醒、呼吸训练 | 23 func table
1778 */
1779@property (nonatomic,strong) IDOGetFuncTable23BluetoothModel * funcTable23Model;
1780
1781/**
1782 24功能列表 运动模式5 | 24 func table
1783 */
1784@property (nonatomic,strong) IDOGetFuncTable24BluetoothModel * funcTable24Model;
1785
1786/**
1787 25功能列表 运动模式6 | 25 func table
1788 */
1789@property (nonatomic,strong) IDOGetFuncTable25BluetoothModel * funcTable25Model;
1790
1791/**
1792 26功能列表 运动模式6 | 26 func table
1793 */
1794@property (nonatomic,strong) IDOGetFuncTable26BluetoothModel * funcTable26Model;
1795
1796/**
1797 27功能列表 语言4 | 27 func table
1798 */
1799@property (nonatomic,strong) IDOGetFuncTable27BluetoothModel * funcTable27Model;
1800
1801/**
1802 是否支持版本信息 | version information is supported
1803 */
1804@property (nonatomic,assign) BOOL versionInfo;
1805
1806/**
1807 闹钟个数 | Number of alarms
1808 */
1809@property (nonatomic,assign) NSInteger alarmCount;
1810
1811/**
1812 运动显示个数 | Number of sports displays
1813 */
1814@property (nonatomic,assign) NSInteger sportShowCount;
1815
1816/**
1817 * @brief 查询数据库,如果查询不到初始化新的model对象
1818 * Query the database, if the query does not initialize a new model object
1819 * @return IDOGetDeviceFuncBluetoothModel
1820 */
1821+ (__kindof IDOGetDeviceFuncBluetoothModel *)currentModel;
1822
1823/**
1824 * @brief 判断是否有运动模式 | Determine if there are movement patterns
1825 */
1826+ (BOOL)isHaveMovment;
1827
1828@end
1829
1830#pragma mark ==== 获取设备信息model ====
1831@interface IDOGetDeviceInfoBluetoothModel:IDOBluetoothBaseModel
1832
1833/**
1834 设备模式 | Device mode
1835 */
1836@property (nonatomic,assign) NSUInteger mode;
1837
1838/**
1839 * 电量状态 (0x0:正常,0x01:正在充电,0x02:充满,0x03:电量低)
1840 * Battery status (0x0: normal,0x01: charging,0x02: full,0x03: low power)
1841 */
1842@property (nonatomic,assign) NSUInteger battStatus;
1843
1844/**
1845 电量级别 (0~100)| Battery level
1846 */
1847@property (nonatomic,assign) NSUInteger battLevel;
1848
1849/**
1850 是否重启 | Whether to restart
1851 */
1852@property (nonatomic,assign) NSUInteger rebootFlag;
1853
1854/**
1855 绑定时间戳 | Binding timestamp
1856 */
1857@property (nonatomic,copy) NSString * bindTimeStr;
1858
1859/**
1860 绑定状态 | Binding status
1861 */
1862@property (nonatomic,assign) NSInteger bindState;
1863
1864/**
1865 * 绑定类型 | Binding type
1866 * 0x00默认(注意以前ID号定制),超时时间无效,
1867 * 0x01(单击[按键在下面]),
1868 * 0x02(为长按[按键在下面]),
1869 * 0x03(屏幕点击 横向确认和取消,确认在左边),
1870 * 0x04(屏幕点击 横向确认和取消,确认在右边),
1871 * 0x05(屏幕点击 竖向确认和取消,确认在上边),
1872 * 0x06(屏幕点击 竖向确认和取消,确认在下边),
1873 * 0x07点击(右边一个按键))
1874 */
1875@property (nonatomic,assign) NSInteger bindType;
1876
1877/**
1878 * 绑定超时 | Binding timeout
1879 * 最长为15秒,0表示不超时
1880 */
1881@property (nonatomic,assign) NSInteger bindTimeout;
1882
1883/**
1884 * 手环的平台 | platform for bracelet
1885 * 0:nordic, 10:realtek 8762x ,20:cypress psoc6,30:Apollo3
1886 */
1887@property (nonatomic,assign) NSInteger platform;
1888
1889/**
1890 * 手环是否同步过配置 | is sync config
1891 *
1892 */
1893@property (nonatomic,assign) BOOL isSyncConfig;
1894
1895/**
1896 * @brief 查询数据库,如果查询不到初始化新的model对象
1897 * Query the database, if the query does not initialize a new model object
1898 * @return IDOGetDeviceInfoBluetoothModel
1899 */
1900+ (__kindof IDOGetDeviceInfoBluetoothModel *)currentModel;
1901
1902/**
1903 * @brief 查询本地所有设备信息(不包括Mac地址不存在的设备)
1904 * Query all local device information (excluding devices where Mac addresses do not exist)
1905 * @return IDOGetDeviceInfoBluetoothModel array
1906 */
1907+ (NSArray <__kindof IDOGetDeviceInfoBluetoothModel *>*)queryAllDeviceModels;
1908
1909@end
1910
1911#pragma mark ==== 获取mac地址model ====
1912@interface IDOGetMacAddrInfoBluetoothModel:IDOBluetoothBaseModel
1913
1914/**
1915 * @brief 查询数据库,如果查询不到初始化新的model对象
1916 * Query the database, if the query does not initialize a new model object
1917 * @return IDOGetMacAddrInfoBluetoothModel
1918 */
1919+ (__kindof IDOGetMacAddrInfoBluetoothModel *)currentModel;
1920@end
1921
1922@interface IDOGetInfoBluetoothModel : IDOBluetoothBaseModel
1923
1924@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOLogEnum.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOLogEnum.h
new file mode 100755
index 0000000..af811d3
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOLogEnum.h
@@ -0,0 +1,165 @@
1//
2// IDOLogEnum.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/3.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#ifndef IDOLogEnum_h
10#define IDOLogEnum_h
11
12/**
13 * 记录日志类型
14 * Log type
15 */
16typedef NS_ENUM(NSInteger, IDO_RECORD_LOG_TYPE) {
17 /**
18 * 手动连接手环
19 * Manually connect the bracelet
20 */
21 IDO_MANUAL_CONNECT_LOG = 1,
22 /**
23 * 自动连接手环
24 * Automatic connection bracelet
25 */
26 IDO_AUTO_CONNECT_LOG,
27 /**
28 * 手环绑定
29 * Bracelet binding
30 */
31 IDO_BIND_DEVICE_LOG,
32 /**
33 * 手环解绑
34 * Untie the bracelet
35 */
36 IDO_UNBIND_DEVICE_LOG,
37 /**
38 * 同步配置
39 * Synchronous configuration
40 */
41 IDO_SYNC_CONFIG_LOG,
42 /**
43 * 同步健康
44 * Synchronous Health
45 */
46 IDO_SYNC_HEALTH_LOG,
47 /**
48 * 同步健康 步数
49 * Synchronous Health Steps
50 */
51 IDO_SYNC_HEALTH_SPORT_LOG,
52 /**
53 * 同步健康 睡眠
54 * Synchronized Health Sleep
55 */
56 IDO_SYNC_HEALTH_SLEEP_LOG,
57 /**
58 * 同步健康 心率
59 * Synchronized Health Heart Rate
60 */
61 IDO_SYNC_HEALTH_HR_LOG,
62 /**
63 * 同步健康 血压
64 * Synchronized Health Blood Pressure
65 */
66 IDO_SYNC_HEALTH_BP_LOG,
67 /**
68 * 同步 血氧
69 * Synchronized blood oxygen
70 */
71 IDO_SYNC_BLOOD_OXYGEN_LOG,
72 /**
73 * 同步 压力
74 * Synchronized Pressure
75 */
76 IDO_SYNC_PRESSURE_LOG,
77 /**
78 * 同步 游泳
79 * Synchronized Swimming
80 */
81 IDO_SYNC_SWIMMING_LOG,
82 /**
83 * 同步活动
84 * Synchronous activity
85 */
86 IDO_SYNC_ACTIVITY_LOG,
87 /**
88 * 同步gps
89 * Synchronous gps
90 */
91 IDO_SYNC_GPS_LOG,
92 /**
93 * 同步结束
94 * End of synchronization
95 */
96 IDO_SYNC_COMPLETE_LOG,
97 /**
98 * 蓝牙写入数据
99 * Bluetooth write data
100 */
101 IDO_WRITE_DATA_LOG,
102 /**
103 * 蓝牙接收数据
104 * Bluetooth receiving data
105 */
106 IDO_RECEIVE_DATA_LOG,
107 /**
108 * 手环开始升级
109 * The bracelet starts to upgrade
110 */
111 IDO_START_UPDATE_LOG,
112 /**
113 * 手环升级失败
114 * Failed to upgrade the bracelet
115 */
116 IDO_UPDATE_FAILED_LOG,
117 /**
118 * 手环升级成功
119 * Bracelet upgraded successfully
120 */
121 IDO_UPDATE_SUCCESS_LOG,
122 /**
123 * 手环启动配对
124 * Bracelet starts pairing
125 */
126 IDO_PAIRING_START_LOG,
127 /**
128 * 手环配对失败
129 * Bracelet pairing failed
130 */
131 IDO_PAIRING_FAILED_LOG,
132 /**
133 * 手环配对后重连失败
134 * The bracelet failed to reconnect after pairing
135 */
136 IDO_PAIRING_RECONNECT_FAILED_LOG,
137 /**
138 * 手环配对后重连成功
139 * The bracelet successfully to reconnect after pairing
140 */
141 IDO_PAIRING_RECONNECT_SUCCESS_LOG,
142 /**
143 * 手环配对后启动设置子开关
144 * After the bracelet is paired, start the setting sub-switch
145 */
146 IDO_PAIRING_RECONNECT_SET_SUB_SWITCH_LOG,
147 /**
148 * 手环配对后设置子开关失败
149 * Failed to set sub-switch after bracelet pairing
150 */
151 IDO_PAIRING_RECONNECT_SET_SUB_SWITCH_FAILED_LOG,
152 /**
153 * 手环配对后设置子开关成功
154 * Set the sub-switch successfully after the bracelet is paired
155 */
156 IDO_PAIRING_RECONNECT_SET_SUB_SWITCH_SUCCESS_LOG,
157 /**
158 * 协议库日志记录
159 * protocol c log
160 */
161 IDO_PROTOCOL_C_LOG
162};
163
164
165#endif /* IDOLogEnum_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOPeripheralModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOPeripheralModel.h
new file mode 100755
index 0000000..717874a
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOPeripheralModel.h
@@ -0,0 +1,59 @@
1//
2// IDOPeripheralModel.h
3// VeryfitSDK
4//
5// Created by hedongyang on 2018/6/4.
6// Copyright © 2018年 hedongyang. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import <CoreBluetooth/CoreBluetooth.h>
11
12@interface IDOPeripheralModel : NSObject
13
14/**
15 外围设备 | peripheral
16 */
17@property (nullable,nonatomic,strong) CBPeripheral * peripheral;
18
19/**
20 手环名字 | Bracelet name
21 */
22@property (nullable,nonatomic,copy) NSString * name;
23
24/**
25 手环uuid | Bracelet uuid
26 */
27@property (nullable,nonatomic,copy) NSString * uuidStr;
28
29/**
30 手环rssi | bracelet rssi
31 */
32@property (nonatomic,assign) NSInteger rssi;
33
34/**
35 手环距离 单位 米 | Bracelet Distance Units
36 */
37@property (nonatomic,assign) float distance;
38
39/**
40 是否是OTA | Is it OTA?
41 */
42@property (nonatomic,assign) BOOL isOta;
43
44/**
45 mac 地址 | mac address
46 */
47@property (nullable,nonatomic,copy) NSString * macAddr;
48
49/**
50 设备ID | Device ID
51 */
52@property (nonatomic,assign) int deviceId;
53
54/**
55 固件版本 | Firmware version
56 */
57@property (nonatomic,assign) int bltVersion;
58
59@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDORecordDeviceLog.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDORecordDeviceLog.h
new file mode 100755
index 0000000..d846789
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDORecordDeviceLog.h
@@ -0,0 +1,56 @@
1//
2// IDORecordDeviceLog.h
3// IDOBluetooth
4//
5// Created by hedongyang on 2018/9/25.
6// Copyright © 2018年 apple. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
12#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
13#else
14#import "IDOLogEnum.h"
15#endif
16
17@interface IDORecordDeviceLog : NSObject
18
19/**
20 * @brief 获取设备日志信息 (在设备连接ota模式下不能使用获取设备重启日志)
21 * Obtain device log information (When the device is connected, it is not used in the ota mode to get the device restart log)
22 * @param callback 日志信息获取完成回调 | Log information acquisition completion callback
23 */
24+ (void)getDeviceLogWithCallback:(void(^_Nullable)(BOOL isComplete))callback;
25
26/**
27 * @brief 记录协议库外的蓝牙日志
28 * Record bluetooth logs outside the protocol library
29 * @param type 日志类型 | Log type
30 * @param logStr 日志记录 | Log str
31 */
32+ (void)recordBlueLogWithType:(IDO_RECORD_LOG_TYPE)type
33 logStr:(NSString *_Nullable)logStr;
34
35/**
36 * @brief 设备重启日志路径 | Device restart log path
37 * @return 日志存储目录 目录下可能有多个日志文件 日志文件是按日期生成的
38 * Log Storage Directory There may be multiple log files under the directory. The log files are generated by date.
39 */
40+ (NSString *_Nullable)rebootLogFloderPath;
41
42/**
43 * @brief 命令执行记录日志路径 | Command execution logging path
44 * @return 日志存储目录 目录下可能有多个日志文件 日志文件是按日期生成的
45 * log Storage Directory There may be multiple log files under the directory. The log files are generated by date.
46 */
47+ (NSString *_Nullable)recordLogFloaderPath;
48
49/**
50 * sdk 更新日志文件路径(html)
51 * sdk update log file path(html)
52 */
53+ (NSString *_Nullable)updateLogFilePath DEPRECATED_MSG_ATTRIBUTE("method is deprecated");
54
55@end
56
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSetInfoBluetoothModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSetInfoBluetoothModel.h
new file mode 100755
index 0000000..9f244b4
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSetInfoBluetoothModel.h
@@ -0,0 +1,1760 @@
1//
2// IDOSetBuletoothModel.h
3// VeryfitSDK
4//
5// Created by hedongyang on 2018/6/13.
6// Copyright © 2018年 hedongyang. All rights reserved.
7//
8
9#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
10#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
11#else
12#import "IDOBluetoothBaseModel.h"
13#endif
14
15#pragma mark ==== 设置喝水提醒 model ====
16@interface IDOSetDrinkReminderModeBluetoothModel:IDOBluetoothBaseModel
17/**
18 喝水提醒开关 | drink water reminder
19 */
20@property (nonatomic,assign) BOOL onOff;
21/**
22 提醒间隔,单位分钟 | interval (unit minutes)
23 */
24@property (nonatomic,assign) NSInteger interval;
25/**
26 开始时间(时) | start time (hours)
27 */
28@property (nonatomic,assign) NSInteger startHour;
29/**
30 开始时间(分) | start time (minutes)
31 */
32@property (nonatomic,assign) NSInteger startMinute;
33/**
34 结束时间 (时) | end time (hours)
35 */
36@property (nonatomic,assign) NSInteger endHour;
37/**
38 结束时间 (分) | end time (minutes)
39 */
40@property (nonatomic,assign) NSInteger endMinute;
41/**
42 * 重复集合 [星期一、星期二、星期三、星期四、星期五、星期六、星期日]
43 * Repeat collection [monday,tuesday,wednesday,thursday,friday,saturday,sunday]
44 */
45@property (nonatomic,strong)NSArray<NSNumber *> * repeat;
46/**
47 * @brief 查询数据库,如果查询不到初始化新的model对象
48 * Query the database, if the query does not initialize a new model object
49 * @return IDOSetDrinkReminderModeBluetoothModel
50 */
51+ (__kindof IDOSetDrinkReminderModeBluetoothModel *)currentModel;
52@end
53
54#pragma mark ==== 设置心率开关同步 model ====
55@interface IDOSetV3HeartRateModeBluetoothModel:IDOBluetoothBaseModel
56/**
57 * 心率模式 0:关闭心率监测功能 1:手动模式 2:自动模式 3:持续监测(默认:自动模式)
58 * Heart Rate Mode 0: Turn off heart rate monitoring function 1: Manual mode 2: Auto mode 3:Continuously monitor(Default: Auto mode)
59 */
60@property (nonatomic,assign) NSInteger modeType;
61/**
62 * 更新时间unix 时间戳,秒级 (eg 14442361933)
63 * Update time Unix timestamp, in seconds
64 */
65@property (nonatomic,copy) NSString * updateTime;
66/**
67 是否有相隔时间 | Is there a time interval?
68 */
69@property (nonatomic,assign) BOOL isHasTimeRange;
70/**
71 开始 (时) | Start (hours)
72 */
73@property (nonatomic,assign) NSInteger startHour;
74/**
75 开始 (分) | Start (minutes)
76 */
77@property (nonatomic,assign) NSInteger startMinute;
78/**
79 结束 (时) | End (hours)
80 */
81@property (nonatomic,assign) NSInteger endHour;
82/**
83 结束 (分) | End (minutes)
84 */
85@property (nonatomic,assign) NSInteger endMinute;
86/**
87 测量间隔,单位分钟 | measurement Interval,unit:minutes
88 */
89@property (nonatomic,assign) NSInteger measurementInterval;
90/**
91 * @brief 查询数据库,如果查询不到初始化新的model对象
92 * Query the database, if the query does not initialize a new model object
93 * @return IDOSetV3HeartRateModeBluetoothModel
94 */
95+ (__kindof IDOSetV3HeartRateModeBluetoothModel *)currentModel;
96@end
97
98#pragma mark ==== 设置运动开关 model ====
99@interface IDOSetActivitySwitchBluetoothModel:IDOBluetoothBaseModel
100/**
101 自动识别运动类型开关 | sport type on Off
102 */
103@property (nonatomic,assign) BOOL sportTypeOnOff DEPRECATED_MSG_ATTRIBUTE("this attribute is discarded");
104/**
105 自动识别走路开关 | auto identify sport walk
106 */
107@property (nonatomic,assign) BOOL sportWalkOnOff;
108/**
109 自动识别跑步开关 | auto identify sport run
110 */
111@property (nonatomic,assign) BOOL sportRunOnOff;
112/**
113 自动识别自行车开关 | auto identify sport bicycle
114 */
115@property (nonatomic,assign) BOOL sportBicycleOnOff;
116/**
117 运动自动暂停开关 | auto pause on off
118 */
119@property (nonatomic,assign) BOOL autoPauseOnOff;
120/**
121 结束提醒开关 | end remind on off
122 */
123@property (nonatomic,assign) BOOL endRemindOnOff;
124
125/**
126 * @brief 查询数据库,如果查询不到初始化新的model对象
127 * Query the database, if the query does not initialize a new model object
128 * @return IDOSetActivitySwitchBluetoothModel
129 */
130+ (__kindof IDOSetActivitySwitchBluetoothModel *)currentModel;
131
132@end
133
134
135#pragma mark ==== 设置血氧开关控制 model ====
136@interface IDOSetSpo2SwitchBluetoothModel:IDOBluetoothBaseModel
137/**
138 开关 | on off
139 */
140@property (nonatomic,assign) BOOL onOff;
141
142/**
143 开始时间 (时) | start hour
144 */
145@property (nonatomic,assign) NSInteger startHour;
146
147/**
148 开始时间 (分) | start minute
149 */
150@property (nonatomic,assign) NSInteger startMinute;
151
152/**
153 结束时间 (时) | end hour
154 */
155@property (nonatomic,assign) NSInteger endHour;
156
157/**
158 结束时间 (分) | end minute
159 */
160@property (nonatomic,assign) NSInteger endMinute;
161
162/**
163 * @brief 查询数据库,如果查询不到初始化新的model对象
164 * Query the database, if the query does not initialize a new model object
165 * @return IDOSetSpo2SwitchBluetoothModel
166 */
167+ (__kindof IDOSetSpo2SwitchBluetoothModel *)currentModel;
168
169@end
170
171#pragma mark ==== 设置呼吸训练 model ====
172@interface IDOSetBreatheTrainBluetoothModel:IDOBluetoothBaseModel
173/**
174 每分钟呼吸次数 | Breaths per minute
175 */
176@property (nonatomic,assign) NSInteger frequency;
177
178/**
179 * @brief 查询数据库,如果查询不到初始化新的model对象
180 * Query the database, if the query does not initialize a new model object
181 * @return IDOSetBreatheTrainBluetoothModel
182 */
183+ (__kindof IDOSetBreatheTrainBluetoothModel *)currentModel;
184@end
185
186#pragma mark ==== 设置走动提醒 model ====
187@interface IDOSetWalkReminderBluetoothModel:IDOBluetoothBaseModel
188/**
189 走动提醒开关 | Walking reminder switch
190 */
191@property (nonatomic,assign) BOOL onOff;
192/**
193 目标步数 | goal step
194 */
195@property (nonatomic,assign) NSInteger goalStep;
196/**
197 开始时间(时) | start time (hours)
198 */
199@property (nonatomic,assign) NSInteger startHour;
200/**
201 开始时间(分) | start time (minutes)
202 */
203@property (nonatomic,assign) NSInteger startMinute;
204/**
205 结束时间 (时) | end time (hours)
206 */
207@property (nonatomic,assign) NSInteger endHour;
208/**
209 结束时间 (分) | end time (minutes)
210 */
211@property (nonatomic,assign) NSInteger endMinute;
212/**
213 * 重复集合 [星期一、星期二、星期三、星期四、星期五、星期六、星期日]
214 * Repeat collection [monday,tuesday,wednesday,thursday,friday,saturday,sunday]
215 */
216@property (nonatomic,strong)NSArray<NSNumber *> * repeat;
217
218/**
219 * @brief 查询数据库,如果查询不到初始化新的model对象
220 * Query the database, if the query does not initialize a new model object
221 * @return IDOSetWalkReminderBluetoothModel
222 */
223+ (__kindof IDOSetWalkReminderBluetoothModel *)currentModel;
224
225@end
226#pragma mark ==== 设置经期提醒 model ====
227@interface IDOSetMenstruationRemindBluetoothModel:IDOBluetoothBaseModel
228/**
229 开始日提醒 提前天数 | Start Day Reminder
230 */
231@property (nonatomic,assign) NSInteger startDay;
232/**
233 排卵日提醒 提前天数 | Ovulation Day Reminder
234 */
235@property (nonatomic,assign) NSInteger ovulationDay;
236/**
237 提醒时间 (时) | Reminder time (hours)
238 */
239@property (nonatomic,assign) NSInteger hour;
240/**
241 提醒时间 (分) | Reminder time (minutes)
242 */
243@property (nonatomic,assign) NSInteger minute;
244
245/**
246 * @brief 查询数据库,如果查询不到初始化新的model对象
247 * Query the database, if the query does not initialize a new model object
248 * @return IDOSetMenstruationRemindBluetoothModel
249 */
250+ (__kindof IDOSetMenstruationRemindBluetoothModel *)currentModel;
251
252@end
253
254#pragma mark ==== 设置经期 model ====
255@interface IDOSetMenstruationInfoBluetoothModel:IDOBluetoothBaseModel
256/**
257 开关 | onoff
258 */
259@property (nonatomic,assign) BOOL onOff;
260/**
261 经期长度 | length of menstruation
262 */
263@property (nonatomic,assign) NSInteger menstrualLength;
264/**
265 经期周期 | Menstrual cycle
266 */
267@property (nonatomic,assign) NSInteger menstrualCycle;
268/**
269 最近经期年份 | Recent menstrual years
270 */
271@property (nonatomic,assign) NSInteger lastMenstrualYear;
272/**
273 最近经期月份 | Recent menstrual months
274 */
275@property (nonatomic,assign) NSInteger lastMenstrualMonth;
276/**
277 最近经期日期 | Recent menstrual date
278 */
279@property (nonatomic,assign) NSInteger lastMenstrualDay;
280/**
281 排卵日的间隔 | ovulation interval day
282 */
283@property (nonatomic,assign) NSInteger ovulationIntervalDay;
284/**
285 经期前一天 | | The day before the menstrual period
286 */
287@property (nonatomic,assign) NSInteger ovulationBeforeDay;
288/**
289 经期后一天 | | One day after menstruation
290 */
291@property (nonatomic,assign) NSInteger ovulationAfterDay;
292
293/**
294 * @brief 查询数据库,如果查询不到初始化新的model对象
295 * Query the database, if the query does not initialize a new model object
296 * @return IDOSetMenstruationInfoBluetoothModel
297 */
298+ (__kindof IDOSetMenstruationInfoBluetoothModel *)currentModel;
299
300@end
301
302#pragma mark ==== 绑定model ====
303@interface IDOSetBindingInfoBluetoothModel:IDOBluetoothBaseModel
304/**
305 授权码长度 | Authorization code length
306 */
307@property (nonatomic,assign) NSUInteger authLength;
308
309/**
310 授权码 | Authorization code
311 */
312@property (nonatomic,copy) NSString * authCode;
313
314/**
315 * @brief 查询数据库,如果查询不到初始化新的model对象 (只有在授权绑定才会存储数据)
316 * Query the database, if the query does not initialize the new model object (only the authorization binding will store the data)
317 * @return IDOSetBindingInfoBluetoothModel
318 */
319+ (__kindof IDOSetBindingInfoBluetoothModel *)currentModel;
320@end
321
322#pragma mark ==== 设置设置睡眠时间段model ====
323@interface IDOSetSleepPeriodInfoBluetoothModel:IDOBluetoothBaseModel
324
325/**
326 睡眠开关 | Sleep switch
327 */
328@property (nonatomic,assign) BOOL OnOff;
329
330/**
331 开始 (时) | Start (hours)
332 */
333@property (nonatomic,assign) NSInteger startHour;
334
335/**
336 开始 (分) | Start (minutes)
337 */
338@property (nonatomic,assign) NSInteger startMinute;
339
340/**
341 结束 (时) | End (hours)
342 */
343@property (nonatomic,assign) NSInteger endHour;
344
345/**
346 结束 (分) | End (minutes)
347 */
348@property (nonatomic,assign) NSInteger endMinute;
349
350/**
351 * @brief 查询数据库,如果查询不到初始化新的model对象 | Query the database, if the query does not initialize a new model object
352 * @return IDOSetSleepPeriodInfoBluetoothModel
353 */
354+ (__kindof IDOSetSleepPeriodInfoBluetoothModel *)currentModel;
355@end
356
357#pragma mark ==== 设置血压测量指令model ====
358@interface IDOSetBpMeasureInfoBluetoothModel:IDOBluetoothBaseModel
359
360/**
361 * 参数标志 0x01:开始测量,0x02:结束测量,0x03:获得血压数据
362 * Parameter flag 0x01: Start measurement, 0x02: End measurement, 0x03: Obtain blood pressure data
363 */
364@property (nonatomic,assign) NSInteger flag;
365
366/**
367 * 返回状态 0x00:不支持,0x01:正在测量,0x02:测量成功 0x03:测量失败 0x04:设备正在运动模式
368 * Return status 0x00: Not supported, 0x01: Positive measurement, 0x02: Measurement success 0x03: Measurement failure 0x04: Device is in motion mode
369 */
370@property (nonatomic,assign) NSInteger status;
371
372/**
373 高压(收缩压) | High pressure (systolic pressure)
374 */
375@property (nonatomic,assign) NSInteger systolicBp;
376
377/**
378 低压(舒张压) | Low pressure (diastolic pressure)
379 */
380@property (nonatomic,assign) NSInteger diastolicBp;
381
382/**
383 * @brief 查询数据库,如果查询不到初始化新的model对象
384 * Query the database, if the query does not initialize a new model object
385 * @return IDOSetBpMeasureInfoBluetoothModel
386 */
387+ (__kindof IDOSetBpMeasureInfoBluetoothModel *)currentModel;
388@end
389
390#pragma mark ==== 设置表盘参数model ====
391@interface IDOSetWatchDiaInfoBluetoothModel:IDOBluetoothBaseModel
392
393/**
394 表盘ID | Dial ID
395 */
396@property (nonatomic,assign) NSInteger dialId;
397
398/**
399 * @brief 查询数据库,如果查询不到初始化新的model对象
400 * Query the database, if the query does not initialize a new model object
401 * @return IDOSetWatchDiaInfoBluetoothModel
402 */
403+ (__kindof IDOSetWatchDiaInfoBluetoothModel *)currentModel;
404@end
405
406#pragma mark ==== 设置马达参数model ====
407@interface IDOSetStartMotorInfoBluetoothModel:IDOBluetoothBaseModel
408
409/**
410 马达状态 | Motor status
411 */
412@property (nonatomic,assign) NSInteger status;
413
414/**
415 马达超时时长 | Motor timeout duration
416 */
417@property (nonatomic,assign) NSInteger timeout;
418
419/**
420 * @brief 查询数据库,如果查询不到初始化新的model对象
421 * Query the database, if the query does not initialize a new model object
422 * @return IDOSetStartMotorInfoBluetoothModel
423 */
424+ (__kindof IDOSetStartMotorInfoBluetoothModel *)currentModel;
425@end
426
427#pragma mark ==== 设置传感器实时数据model ====
428@interface IDOSetRealTimeSensorDataInfoBluetoothModel:IDOBluetoothBaseModel
429
430/**
431 未知传感器状态 | Unknown sensor status
432 */
433@property (nonatomic,assign) NSInteger gsensorStatus;
434
435/**
436 心率传感器状态 | Heart Rate Sensor Status
437 */
438@property (nonatomic,assign) NSInteger heartRateSensorStatus;
439
440/**
441 * @brief 查询数据库,如果查询不到初始化新的model对象
442 * Query the database, if the query does not initialize a new model object
443 * @return IDOSetRealTimeSensorDataInfoBluetoothModel
444 */
445+ (__kindof IDOSetRealTimeSensorDataInfoBluetoothModel *)currentModel;
446@end
447
448#pragma mark ==== 设置连接参数信息model ====
449@interface IDOSetConnParamInfoBluetoothModel:IDOBluetoothBaseModel
450
451/**
452 连接模式 | Connection mode
453 */
454@property (nonatomic,assign) NSInteger mode;
455
456/**
457 修改快速模式连接间隔 | Modify Quick Mode Connection Interval
458 */
459@property (nonatomic,assign) NSInteger modifConnParam;
460
461/**
462 最大间隔 | Maximum interval
463 */
464@property (nonatomic,assign) NSInteger maxInterval;
465
466/**
467 最小间隔 | Minimum interval
468 */
469@property (nonatomic,assign) NSInteger minInterval;
470
471/**
472 延迟 | Delay
473 */
474@property (nonatomic,assign) NSInteger slaveLatency;
475
476/**
477 连接超时 | Connection timeout
478 */
479@property (nonatomic,assign) NSInteger connTimeout;
480
481/**
482 * @brief 查询数据库,如果查询不到初始化新的model对象
483 * Query the database, if the query does not initialize a new model object
484 * @return IDOSetConnParamInfoBluetoothModel
485 */
486+ (__kindof IDOSetConnParamInfoBluetoothModel *)currentModel;
487@end
488
489#pragma mark ==== 设置GPS控制信息model ====
490@interface IDOSetGpsControlInfoBluetoothModel:IDOBluetoothBaseModel
491
492/**
493 1: 控制 , 2: 查询 | 1: Control, 2: Query
494 */
495@property (nonatomic,assign) NSInteger operate;
496
497/**
498 * 0x01 开启log,0x02 关闭log,0x03 agps写入,0x04 agps 擦除,0x05 gps_fw 写入
499 * 0x01 turns on log, 0x02 turns off log, 0x03 agps writes, 0x04 agps erases, 0x05 gps_fw writes
500 */
501@property (nonatomic,assign) NSInteger type;
502
503/**
504 * @brief 查询数据库,如果查询不到初始化新的model对象
505 * Query the database, if the query does not initialize a new model object
506 * @return IDOSetGpsControlInfoBluetoothModel
507 */
508+ (__kindof IDOSetGpsControlInfoBluetoothModel *)currentModel;
509@end
510
511#pragma mark ==== 设置GPS信息model ====
512@interface IDOSetGpsConfigInfoBluetoothModel:IDOBluetoothBaseModel
513
514/**
515 0x01 冷启动,0x02 热启动 默认2 | 0x01 Cold Start, 0x02 Hot Start Default 2
516 */
517@property (nonatomic,assign) NSInteger startMode;
518
519/**
520 * 操作模式,1为正常;2为低功耗;4为Balance,5为1PPS 默认1
521 * Operation mode, 1 is normal; 2 is low power consumption; 4 is Balance, 5 is 1PPS default 1
522 */
523@property (nonatomic,assign) NSInteger gsopOperationMode;
524
525/**
526 定位周期,默认1000 1s | Positioning period, default 1000 1s
527 */
528@property (nonatomic,assign) NSInteger gsopCycleMs;
529
530/**
531 * 定位星mode,1为GPS,2为GLONASS,3为1为GPS + GLONASS 默认1
532 * Positioning star mode, 1 is GPS, 2 is GLONASS, 3 is 1 for GPS + GLONASS Default 1
533 */
534@property (nonatomic,assign) NSInteger gnsValue;
535
536/**
537 年 | year
538 */
539@property (nonatomic,assign) NSInteger year;
540
541/**
542 月 | Month
543 */
544@property (nonatomic,assign) NSInteger month;
545
546/**
547 日 | day
548 */
549@property (nonatomic,assign) NSInteger day;
550
551/**
552 时 | hour
553 */
554@property (nonatomic,assign) NSInteger hour;
555
556/**
557 分 | minute
558 */
559@property (nonatomic,assign) NSInteger minute;
560
561/**
562 秒 | seconds
563 */
564@property (nonatomic,assign) NSInteger second;
565
566/**
567 * @brief 查询数据库,如果查询不到初始化新的model对象
568 * Query the database, if the query does not initialize a new model object
569 * @return IDOSetGpsConfigInfoBluetoothModel
570 */
571+ (__kindof IDOSetGpsConfigInfoBluetoothModel *)currentModel;
572@end
573
574#pragma mark ==== 设置屏幕亮度model ====
575@interface IDOSetScreenBrightnessInfoBluetoothModel:IDOBluetoothBaseModel
576/**
577 屏幕亮度级别 (1-100) | Screen brightness level (1-100)
578 */
579@property (nonatomic,assign) NSInteger levelValue;
580/**
581 是否用户调节 | is manual
582 */
583@property (nonatomic,assign) BOOL isManual;
584/**
585 * 0x00关闭自动调整,0x01 使用环境光传感器,0x02,夜间自动调整亮度,0x03 夜间降亮度使用设置的时间
586 * 0x00 turns off automatic adjustment,0x01 USES ambient light sensor,
587 * 0x02, automatic adjustment of brightness at night,0x03 set time for reducing brightness at night
588 */
589@property (nonatomic,assign) NSInteger mode;
590/**
591 * 夜间自动亮度调整 0x00,无效,由固件定义,0x01关闭,0x02,夜间自动调整亮度,0x03 夜间降亮度使用设置的时间
592 * Automatic overnight brightness adjustment 0x00, invalid, as defined by firmware,0x01 is off,0x02,
593 * automatic night brightness adjustment,0x03 night brightness reduction USES the set time
594 */
595@property (nonatomic,assign) NSInteger autoAdjustNight;
596/**
597 开始 时钟 | start hour
598 */
599@property (nonatomic,assign) NSInteger startHour;
600/**
601 开始 分钟 | start minute
602 */
603@property (nonatomic,assign) NSInteger startMinute;
604/**
605 结束 时钟 | end hour
606 */
607@property (nonatomic,assign) NSInteger endHour;
608/**
609 结束 分钟 | end minute
610 */
611@property (nonatomic,assign) NSInteger endMinute;
612/**
613 夜间亮度 (realme项目) | night level
614 */
615@property (nonatomic,assign) NSInteger nightLevel;
616
617/**
618 * @brief 查询数据库,如果查询不到初始化新的model对象
619 * Query the database, if the query does not initialize a new model object
620 * @return IDOSetScreenBrightnessInfoBluetoothModel
621 */
622+ (__kindof IDOSetScreenBrightnessInfoBluetoothModel *)currentModel;
623@end
624
625#pragma mark ==== 设置天气数据model ====
626@interface IDOSetWeatherDataInfoBluetoothModel:IDOBluetoothBaseModel
627
628/**
629 * 天气预报更新的时间戳 time interval since 1970 (如:1444361933)
630 * Time stamp of weather forecast update time interval since 1970 (eg 14442361933)
631 */
632@property (nonatomic,copy) NSString * timeStr;
633
634/**
635 今天平均温度 | Average temperature today
636 */
637@property (nonatomic,assign) NSInteger todayTemp;
638
639/**
640 * 天气类型 | Weather type
641 * 天气情况(0:其他, 1:晴, 2:多云, 3:阴,4:雨,5:暴雨,
642 * 6:雷阵雨, 7:雪, 8:雨夹雪,9:台风, 10:沙尘暴, 11:夜 间晴,
643 * 12:夜间多云, 13:热, 14:冷, 15:清风, 16:大风, 17:雾霭,18:阵雨, 19:多云转晴)
644 * weather conditions (0: others, 1: sunny, 2: cloudy, 3: cloudy, 4: rain, 5: rainstorm,
645 * 6: thunderstorm, 7: snow, 8: sleet, 9: typhoon, 10: sandstorm, 11: night clear,
646 * 12: cloudy night, 13: hot, 14: cold, 15: breezy, 16: blustery, 17: mist, 18: showers, 19: cloudy to clear)
647 */
648@property (nonatomic,assign) NSInteger todayType;
649
650/**
651 今天最高温度 | Today's highest temperature
652 */
653@property (nonatomic,assign) NSInteger todayMaxTemp;
654
655/**
656 今天最小温度 | Today's minimum temperature
657 */
658@property (nonatomic,assign) NSInteger todayMinTemp;
659
660/**
661 湿度 | Humidity
662 */
663@property (nonatomic,assign) NSInteger humidity;
664
665/**
666 紫外线强度 | UV intensity
667 */
668@property (nonatomic,assign) NSInteger todayUvIntensity;
669
670/**
671 空气污染指数 | Air Pollution Index
672 */
673@property (nonatomic,assign) NSInteger todayAqi;
674
675/**
676 * 后三天天的天气集合 @{@"type":@(0),@"maxTemp":@(0),@"minTemp":@(0)}
677 * Weather collection for the last three days @{@"type":@(0),@"maxTemp":@(0),@"minTemp":@(0)}
678 */
679@property (nonatomic,strong) NSArray<NSDictionary*>* future;
680
681/**
682 * @brief 查询数据库,如果查询不到初始化新的model对象
683 * Query the database, if the query does not initialize a new model object
684 * @return IDOSetWeatherDataInfoBluetoothModel
685 */
686+ (__kindof IDOSetWeatherDataInfoBluetoothModel *)currentModel;
687@end
688
689#pragma mark ==== 设置运动快捷模式排序model ====
690
691@interface IDOSetSportSortingItemModel:NSObject
692
693/**
694 * 排序索引 index //排序,从1、2、3、4....,0:无效
695 * Sort index // sort from 1, 2, 3, 4... , 0: invalid
696 */
697@property (nonatomic,assign) NSInteger index;
698
699/**
700 * 运动模式 | Sport mode
701 * 0:无,1:走路,2:跑步,3:骑行,4:徒步,5:游泳,6:爬山,7:羽毛球,8:其他,
702 * 9:健身,10:动感单车,11:椭圆机,12:跑步机,13:仰卧起坐,14:俯卧撑,15:哑铃,16:举重,
703 * 17:健身操,18:瑜伽,19:跳绳,20:乒乓球,21:篮球,22:足球 ,23:排球,24:网球,
704 * 25:高尔夫球,26:棒球,27:滑雪,28:轮滑,29:跳舞,48:户外跑步,49:室内跑步,50:户外骑行,51:室内骑行,
705 * 52:户外走路,53:室内走路,54:泳池游泳,55:开放水域游泳,56:椭圆机,57:划船机,58:高强度间歇训练法,59:板球运动
706 * 0: none, 1: walk, 2: run, 3: ride, 4: hike, 5: swim, 6: climb, 7: badminton, 8: others,
707 * 9: fitness, 10: spinning, 11: elliptical, 12: treadmill, 13: sit-ups, 14: push-ups, 15: dumbbells, 16: weightlifting,
708 * 17: aerobics, 18: yoga, 19: jump rope, 20: table tennis, 21: basketball, 22: football, 23: volleyball, 24: tennis,
709 * 25: golf, 26: baseball, 27: skiing, 28: roller skating, 29: dancing,48: outdoor running, 49: indoor running, 50: outdoor cycling, 51: indoor cycling,
710 * 52: outdoor walking, 53: indoor walking, 54: pool swimming, 55: open water swimming, 56: elliptical machine, 57: rowing machine, 58: high-intensity interval training
711 * 59:cricket
712 */
713@property (nonatomic,assign) NSInteger type;
714
715@end
716
717@interface IDOSetSportSortingInfoBluetoothModel:IDOBluetoothBaseModel
718
719/**
720 运动模式排序集合最多8个 | Sports mode sort set up to 8
721 */
722@property (nonatomic,strong)NSArray <IDOSetSportSortingItemModel *>* sportSortingItems;
723
724/**
725 * @brief 查询数据库,如果查询不到初始化新的model对象
726 * Query the database, if the query does not initialize a new model object
727 * @return IDOSetSportSortingInfoBluetoothModel
728 */
729+ (__kindof IDOSetSportSortingInfoBluetoothModel *)currentModel;
730
731@end
732
733#pragma mark ==== 设置运动快捷模式model ====
734
735@interface IDOSetSportShortcutInfoBluetoothModel:IDOBluetoothBaseModel
736
737/**
738 走路 | Walking
739 */
740@property (nonatomic,assign) BOOL isWalk;
741
742/**
743 跑步 | Running
744 */
745@property (nonatomic,assign) BOOL isRun;
746
747/**
748 骑自行车 | Cycling
749 */
750@property (nonatomic,assign) BOOL isByBike;
751
752/**
753 步行 | Walking
754 */
755@property (nonatomic,assign) BOOL isOnFoot;
756
757/**
758 游泳 | Swimming
759 */
760@property (nonatomic,assign) BOOL isSwim;
761
762/**
763 爬山 | Mountain climbing
764 */
765@property (nonatomic,assign) BOOL isMountainClimbing;
766
767/**
768 羽毛球 | Badminton
769 */
770@property (nonatomic,assign) BOOL isBadminton;
771
772/**
773 其他 | Other
774 */
775@property (nonatomic,assign) BOOL isOther;
776
777/**
778 健身 | Fitness
779 */
780@property (nonatomic,assign) BOOL isFitness;
781
782/**
783 动感单车 | Spinning bike
784 */
785@property (nonatomic,assign) BOOL isSpinning;
786
787/**
788 橄榄球 | Rugby
789 */
790@property (nonatomic,assign) BOOL isEllipsoid;
791
792/**
793 跑步机 | Treadmill
794 */
795@property (nonatomic,assign) BOOL isTreadmill;
796
797/**
798 仰卧起坐 | Sit ups
799 */
800@property (nonatomic,assign) BOOL isSitUp;
801
802/**
803 俯卧撑 | Push-ups
804 */
805@property (nonatomic,assign) BOOL isPushUp;
806
807/**
808 哑铃 | Dumbbell
809 */
810@property (nonatomic,assign) BOOL isDumbbell;
811
812/**
813 举重 | Weightlifting
814 */
815@property (nonatomic,assign) BOOL isWeightlifting;
816
817/**
818 体操 | Gymnastics
819 */
820@property (nonatomic,assign) BOOL isBodybuildingExercise;
821
822/**
823 瑜伽 | Yoga
824 */
825@property (nonatomic,assign) BOOL isYoga;
826
827/**
828 跳绳 | Jumping rope
829 */
830@property (nonatomic,assign) BOOL isRopeSkipping;
831
832/**
833 乒乓球 | Table tennis
834 */
835@property (nonatomic,assign) BOOL isTableTennis;
836
837/**
838 篮球 | Basketball
839 */
840@property (nonatomic,assign) BOOL isBasketball;
841
842/**
843 足球 | Football
844 */
845@property (nonatomic,assign) BOOL isFootball;
846
847/**
848 排球 | Volleyball
849 */
850@property (nonatomic,assign) BOOL isVolleyball;
851
852/**
853 网球 | Tennis
854 */
855@property (nonatomic,assign) BOOL isTennis;
856
857/**
858 高尔夫 | Golf
859 */
860@property (nonatomic,assign) BOOL isGolf;
861
862/**
863 棒球 | Baseball
864 */
865@property (nonatomic,assign) BOOL isBaseball;
866
867/**
868 滑雪 | Skiing
869 */
870@property (nonatomic,assign) BOOL isSkiing;
871
872/**
873 滑旱冰 | Roller Skating
874 */
875@property (nonatomic,assign) BOOL isRollerSkating;
876
877/**
878 跳舞 | Dancing
879 */
880@property (nonatomic,assign) BOOL isDance;
881
882/**
883 * @brief 查询数据库,如果查询不到初始化新的model对象
884 * Query the database, if the query does not initialize a new model object
885 * @return IDOSetSportShortcutInfoBluetoothModel
886 */
887+ (__kindof IDOSetSportShortcutInfoBluetoothModel *)currentModel;
888@end
889
890#pragma mark ==== 设置血压校准model ====
891@interface IDOSetBloodPressureInfoBluetoothModel:IDOBluetoothBaseModel
892
893/**
894 舒张压 | Diastolic blood pressure
895 */
896@property (nonatomic,assign) NSInteger diastolic;
897
898/**
899 收缩压 | Systolic pressure
900 */
901@property (nonatomic,assign) NSInteger shrinkage;
902
903/**
904 * 返回校准状态 0x01.成功进入校准模式,正在校准 0x02.在运动模式, 0x03.设备忙碌 0x04.无效的状态 0x06.校准失败 0x00.校准成功
905 * Return to calibration status: 0x01. Successfully entered calibration mode, calibration;
906 * 0x02. In motion mode; 0x03. Device busy; 0x04. Invalid status; 0x06. Calibration failed; 0x00. Calibration successful
907 */
908@property (nonatomic,assign) NSInteger statusCode;
909
910/**
911 * 血压校准控制 0x01 血压校准开始 0x02 血压校准查询
912 * Blood Pressure Calibration Control 0x01 Blood Pressure Calibration Start 0x02 Blood Pressure Calibration Query
913 */
914@property (nonatomic,assign) NSInteger flag;
915
916/**
917 * @brief 查询数据库,如果查询不到初始化新的model对象
918 * Query the database, if the query does not initialize a new model object
919 * @return IDOSetBloodPressureInfoBluetoothModel
920 */
921+ (__kindof IDOSetBloodPressureInfoBluetoothModel *)currentModel;
922@end
923
924#pragma mark ==== 设置快捷方式model ====
925@interface IDOSetShortcutInfoBluetoothModel:IDOBluetoothBaseModel
926
927/**
928 快捷方式类型 | Shortcut Type
929 */
930@property (nonatomic,assign) NSInteger shortcutType;
931
932/**
933 * @brief 查询数据库,如果查询不到初始化新的model对象
934 * Query the database, if the query does not initialize a new model object
935 * @return IDOSetShortcutInfoBluetoothModel
936 */
937+ (__kindof IDOSetShortcutInfoBluetoothModel *)currentModel;
938@end
939
940#pragma mark ==== 设置闹钟model ====
941@interface IDOSetAlarmInfoBluetoothModel:IDOBluetoothBaseModel
942
943/**
944 开关 | Switch
945 */
946@property (nonatomic,assign) BOOL isOpen;
947
948/**
949 是否同步 | Synchronization
950 */
951@property (nonatomic,assign) BOOL isSync;
952
953/**
954 是否删除 | Delete
955 */
956@property (nonatomic,assign) BOOL isDelete;
957
958/**
959 类型 | Type
960 */
961@property (nonatomic,assign) NSInteger type;
962
963/**
964 时 | hour
965 */
966@property (nonatomic,assign) NSInteger hour;
967
968/**
969 分 | minute
970 */
971@property (nonatomic,assign) NSInteger minute;
972
973/**
974 * 重复集合 [星期一、星期二、星期三、星期四、星期五、星期六、星期日]
975 * Repeat collection [monday,tuesday,wednesday,thursday,friday,saturday,sunday]
976 */
977@property (nonatomic,strong)NSArray<NSNumber *> * repeat;
978
979/**
980 贪睡时长 | Sleepy time
981 */
982@property (nonatomic,assign) NSInteger tsnoozeDuration;
983
984/**
985 闹钟ID | Alarm ID
986 */
987@property (nonatomic,assign) NSInteger alarmId;
988
989/**
990 * @brief 初始化闹钟集合 | Initialize the alarm collection
991 * @return 闹钟集合 | Alarm clock collection
992 */
993+ (NSArray <IDOSetAlarmInfoBluetoothModel *>*)queryAllAlarms;
994
995/**
996 * @brief 查询没有被开启的闹钟集合 | Querying an alarm set that is not turned on
997 * @return 闹钟集合 | Alarm clock collection
998 */
999+ (NSArray <IDOSetAlarmInfoBluetoothModel *>*)queryAllNoOpenAlarms;
1000
1001@end
1002
1003#pragma mark ==== 设置时间model ====
1004@interface IDOSetTimeInfoBluetoothModel:IDOBluetoothBaseModel
1005
1006/**
1007 年 | year
1008 */
1009@property (nonatomic,assign) NSInteger year;
1010
1011/**
1012 月 | Month
1013 */
1014@property (nonatomic,assign) NSInteger month;
1015
1016/**
1017 日 | day
1018 */
1019@property (nonatomic,assign) NSInteger day;
1020
1021/**
1022 时 | hour
1023 */
1024@property (nonatomic,assign) NSInteger hour;
1025
1026/**
1027 分 | minute
1028 */
1029@property (nonatomic,assign) NSInteger minute;
1030
1031/**
1032 秒 | seconds
1033 */
1034@property (nonatomic,assign) NSInteger second;
1035
1036/**
1037 星期 | week
1038 */
1039@property (nonatomic,assign) NSInteger weekDay;
1040
1041/**
1042 * @brief 查询数据库,如果查询不到初始化新的model对象
1043 * Query the database, if the query does not initialize a new model object
1044 * @return IDOSetTimeInfoBluetoothModel
1045 */
1046+ (__kindof IDOSetTimeInfoBluetoothModel *)currentModel;
1047@end
1048
1049#pragma mark ==== 设置单位model ====
1050@interface IDOSetUnitInfoBluetoothModel:IDOBluetoothBaseModel
1051
1052/**
1053 距离单位 0x00:无效, 0x01:km,0x02:mi | Distance unit 0x00: Invalid, 0x01:km, 0x02:mi
1054 */
1055@property (nonatomic,assign) NSInteger distanceUnit;
1056
1057/**
1058 重量单位 0x00: 无效,0x01:kg, 0x02:lb, 0x03: 英石 | Weight Unit 0x00: Invalid, 0x01:kg, 0x02:lb, 0x03: Stone
1059 */
1060@property (nonatomic,assign) NSInteger weightUnit;
1061
1062/**
1063 温度单位 0x00:无效, 0x01:°C, 0x02:°F | Temperature unit 0x00: Invalid, 0x01: °C, 0x02: °F
1064 */
1065@property (nonatomic,assign) NSInteger tempUnit;
1066
1067/**
1068 * 语言单位 无效:0,中文:1,英文:2,法语:3,德语:4,意大利语:5,西班牙语:6,日语:7,
1069 * 波兰语:8,捷克语:9,罗马尼亚:10,立陶宛语:11,荷兰语:12,斯洛文尼亚:13,
1070 * 匈牙利语:14,俄罗斯语:15,乌克兰语:16,斯洛伐克语:17,丹麦语:18,克罗地亚:19,印尼语:20,
1071 * 韩语:21,印地语:22,葡萄牙语:23,土耳其:24,泰国语:25,越南语:26,缅甸语:27,菲律宾语:28
1072 * Language unit Invalid: 0, Chinese: 1, English: 2, French: 3, German: 4, Italian: 5, Spanish: 6, Japanese: 7,
1073 * Polish: 8, Czech: 9, Romania: 10, Lithuanian: 11, Dutch: 12, Slovenia: 13,
1074 * Hungarian: 14, Russian: 15, Ukrainian: 16, Slovak: 17, Danish: 18, Croatia: 19,Indonesian: 20,korean:21,hindi:22
1075 * portuguese:23,turkish:24,thai:25,vietnamese:26,burmese:27,filipino:28
1076 */
1077@property (nonatomic,assign) NSInteger languageUnit;
1078
1079/**
1080 * 走路步伐 根据男性换算 默认值 72 (单位 :cm)
1081 * Walking pace According to male conversion Default value 72 (unit: cm)
1082 */
1083@property (nonatomic,assign) NSInteger strideWalk;
1084
1085/**
1086 * 跑步步伐 根据男性换算 默认值 90 (单位 :cm)
1087 * Running pace Converted by male Default 90 (Unit: cm)
1088 */
1089@property (nonatomic,assign) NSInteger strideRun;
1090
1091/**
1092 * gps校准步长 0x00:无效, 0x01:开, 0x02: 关
1093 * gps calibration step size 0x00: invalid, 0x01: on, 0x02: off
1094 */
1095@property (nonatomic,assign) NSInteger strideGps;
1096
1097/**
1098 * 时间单位 0x00:无效, 0x01:24 小时制,0x02: 12 小时制
1099 * Time unit 0x00: Invalid, 0x01: 24-hour clock, 0x02: 12-hour clock
1100 */
1101@property (nonatomic,assign) NSInteger timeUnit;
1102
1103/**
1104 * 星期的开始日 星期日:0x01,星期一 :0x00,星期六 :0x03
1105 * Start of the week Sunday: 0x01, Monday: 0x00, Saturday: 0x03
1106 */
1107@property (nonatomic,assign) NSInteger weekStart;
1108
1109/**
1110 * @brief 查询数据库,如果查询不到初始化新的model对象
1111 * Query the database, if the query does not initialize a new model object
1112 * @return IDOSetUnitInfoBluetoothModel
1113 */
1114+ (__kindof IDOSetUnitInfoBluetoothModel *)currentModel;
1115@end
1116
1117#pragma mark ==== 设置心率区间model ====
1118@interface IDOSetHrIntervalInfoBluetoothModel:IDOBluetoothBaseModel
1119
1120/**
1121 燃烧脂肪 | Threshold for burning fat
1122 */
1123@property (nonatomic,assign) NSInteger burnFat;
1124
1125/**
1126 有氧运动 | Aerobic threshold
1127 */
1128@property (nonatomic,assign) NSInteger aerobic;
1129
1130/**
1131 极限运动 | Limit threshold
1132 */
1133@property (nonatomic,assign) NSInteger limitValue;
1134
1135/**
1136 最大心率 | Maximum heart rate
1137 */
1138@property (nonatomic,assign) NSInteger userMaxHr;
1139
1140/**
1141 热身运动 | Warm-up
1142 */
1143@property (nonatomic,assign) NSInteger warmUp;
1144
1145/**
1146 无氧运动 | Anaerobic exercise
1147 */
1148@property (nonatomic,assign) NSInteger anaerobic;
1149
1150/**
1151 * @brief 查询数据库,如果查询不到初始化新的model对象
1152 * Query the database, if the query does not initialize a new model object
1153 * @return IDOSetHrIntervalInfoBluetoothModel
1154 */
1155+ (__kindof IDOSetHrIntervalInfoBluetoothModel *)currentModel;
1156@end
1157
1158#pragma mark ==== 设置勿扰模式model ====
1159@interface IDOSetNoDisturbModeInfoBluetoothModel:IDOBluetoothBaseModel
1160
1161/**
1162 开关 | Switch
1163 */
1164@property (nonatomic,assign) BOOL isOpen;
1165
1166/**
1167 开始 (时) | Start (hours)
1168 */
1169@property (nonatomic,assign) NSInteger startHour;
1170
1171/**
1172 开始 (分) | Start (minutes)
1173 */
1174@property (nonatomic,assign) NSInteger startMinute;
1175
1176/**
1177 结束 (时) | End (hours)
1178 */
1179@property (nonatomic,assign) NSInteger endHour;
1180
1181/**
1182 结束 (分) | End (minutes)
1183 */
1184@property (nonatomic,assign) NSInteger endMinute;
1185
1186/**
1187 * 是否有间隔重复提醒
1188 * interval repeat reminder
1189 */
1190@property (nonatomic,assign) BOOL isHaveRangRepeat;
1191
1192/**
1193 * 重复集合 [星期一、星期二、星期三、星期四、星期五、星期六、星期日]
1194 * Repeat collection [monday,tuesday,wednesday,thursday,friday,saturday,sunday]
1195 */
1196@property (nonatomic,strong)NSArray<NSNumber *> * repeat;
1197
1198/**
1199 * @brief 查询数据库,如果查询不到初始化新的model对象
1200 * Query the database, if the query does not initialize a new model object
1201 * @return IDOSetNoDisturbModeInfoBluetoothModel
1202 */
1203+ (__kindof IDOSetNoDisturbModeInfoBluetoothModel *)currentModel;
1204@end
1205
1206#pragma mark ==== 设置心率模式model ====
1207@interface IDOSetHrModeInfoBluetoothModel:IDOBluetoothBaseModel
1208
1209/**
1210 * 心率模式 0:关闭心率监测功能 1:手动模式 2:自动模式 3:持续监测(默认:自动模式)
1211 * Heart Rate Mode 0: Turn off heart rate monitoring function 1: Manual mode 2: Auto mode 3:Continuously monitor(Default: Auto mode)
1212 */
1213@property (nonatomic,assign) NSInteger modeType;
1214
1215/**
1216 是否有相隔时间 | Is there a time interval?
1217 */
1218@property (nonatomic,assign) BOOL isHasTimeRange;
1219
1220/**
1221 开始 (时) | Start (hours)
1222 */
1223@property (nonatomic,assign) NSInteger startHour;
1224
1225/**
1226 开始 (分) | Start (minutes)
1227 */
1228@property (nonatomic,assign) NSInteger startMinute;
1229
1230/**
1231 结束 (时) | End (hours)
1232 */
1233@property (nonatomic,assign) NSInteger endHour;
1234
1235/**
1236 结束 (分) | End (minutes)
1237 */
1238@property (nonatomic,assign) NSInteger endMinute;
1239
1240/**
1241 测量间隔,单位分钟 | measurement Interval,unit:minutes
1242 */
1243@property (nonatomic,assign) NSInteger measurementInterval;
1244/**
1245 * @brief 查询数据库,如果查询不到初始化新的model对象
1246 * Query the database, if the query does not initialize a new model object
1247 * @return IDOSetHRModeInfoBluetoothModel
1248 */
1249+ (__kindof IDOSetHrModeInfoBluetoothModel *)currentModel;
1250@end
1251
1252#pragma mark ==== 设置手环横竖屏model ====
1253@interface IDOSetDisplayModeInfoBluetoothModel:IDOBluetoothBaseModel
1254
1255/**
1256 显示模式 | Display mode
1257 */
1258@property (nonatomic,assign) NSInteger modeType;
1259
1260/**
1261 * @brief 查询数据库,如果查询不到初始化新的model对象
1262 * Query the database, if the query does not initialize a new model object
1263 * @return IDOSetDisplayModeInfoBluetoothModel
1264 */
1265+ (__kindof IDOSetDisplayModeInfoBluetoothModel *)currentModel;
1266@end
1267
1268#pragma mark ==== 设置抬腕手势model ====
1269@interface IDOSetHandUpInfoBuletoothModel : IDOBluetoothBaseModel
1270
1271/**
1272 开关 | Switch
1273 */
1274@property (nonatomic,assign) BOOL isOpen;
1275
1276/**
1277 是否有相隔时间 | Is there a time interval?
1278 */
1279@property (nonatomic,assign) BOOL isHasTimeRange;
1280
1281/**
1282 显示时长 3~10 秒 | Display time 3~10 second
1283 */
1284@property (nonatomic,assign) NSInteger showSecond;
1285
1286/**
1287 开始 (时) | Start (hours)
1288 */
1289@property (nonatomic,assign) NSInteger startHour;
1290
1291/**
1292 开始 (分) | Start (minutes)
1293 */
1294@property (nonatomic,assign) NSInteger startMinute;
1295
1296/**
1297 结束 (时) | End (hours)
1298 */
1299@property (nonatomic,assign) NSInteger endHour;
1300
1301/**
1302 结束 (分) | End (minutes)
1303 */
1304@property (nonatomic,assign) NSInteger endMinute;
1305
1306/**
1307 * @brief 查询数据库,如果查询不到初始化新的model对象
1308 * Query the database, if the query does not initialize a new model object
1309 * @return IDOSetHandUpInfoBuletoothModel
1310 */
1311+ (__kindof IDOSetHandUpInfoBuletoothModel *)currentModel;
1312@end
1313
1314#pragma mark ==== 设置久坐提醒model ====
1315@interface IDOSetLongSitInfoBuletoothModel : IDOBluetoothBaseModel
1316
1317/**
1318 开始 (时) | Start (hours)
1319 */
1320@property (nonatomic,assign) NSInteger startHour;
1321
1322/**
1323 开始 (分) | Start (minutes)
1324 */
1325@property (nonatomic,assign) NSInteger startMinute;
1326
1327/**
1328 结束 (时) | End (hours)
1329 */
1330@property (nonatomic,assign) NSInteger endHour;
1331
1332/**
1333 结束 (分) | End (minutes)
1334 */
1335@property (nonatomic,assign) NSInteger endMinute;
1336
1337/**
1338 间隔 | Interval
1339 */
1340@property (nonatomic,assign) NSInteger interval;
1341
1342/**
1343 开关 | Switch
1344 */
1345@property (nonatomic,assign) BOOL isOpen;
1346
1347/**
1348 * 重复集合 [星期一、星期二、星期三、星期四、星期五、星期六、星期日]
1349 * Repeat collection [monday,tuesday,wednesday,thursday,friday,saturday,sunday]
1350 */
1351@property (nonatomic,strong) NSArray <NSNumber *>* selectWeeks;
1352
1353/**
1354 * @brief 查询数据库,如果查询不到初始化新的model对象
1355 * Query the database, if the query does not initialize a new model object
1356 * @return IDOSetLongSitInfoBuletoothModel
1357 */
1358+ (__kindof IDOSetLongSitInfoBuletoothModel *)currentModel;
1359@end
1360
1361#pragma mark ==== 设置天气预报开关model ====
1362@interface IDOSetWeatherSwitchInfoBluetoothModel:IDOBluetoothBaseModel
1363
1364/**
1365 天气预报开关 | Weather forecast switch
1366 */
1367@property (nonatomic,assign) BOOL isOpen;
1368
1369/**
1370 * @brief 查询数据库,如果查询不到初始化新的model对象
1371 * Query the database, if the query does not initialize a new model object
1372 * @return IDOSetWeatherSwitchInfoBluetoothModel
1373 */
1374+ (__kindof IDOSetWeatherSwitchInfoBluetoothModel *)currentModel;
1375@end
1376
1377#pragma mark ==== 设置相机开关model ====
1378@interface IDOSetCameraInfoBluetoothModel:IDOBluetoothBaseModel
1379
1380/**
1381 相机开关 | Camera switch
1382 */
1383@property (nonatomic,assign) BOOL isOpen;
1384
1385@end
1386
1387#pragma mark ==== 设置音乐开关model ====
1388@interface IDOSetMusicOpenInfoBuletoothModel : IDOBluetoothBaseModel
1389
1390/**
1391 音乐开关 | Music switch
1392 */
1393@property (nonatomic,assign) BOOL isOpen;
1394
1395/**
1396 * @brief 查询数据库,如果查询不到初始化新的model对象
1397 * Query the database, if the query does not initialize a new model object
1398 * @return IDOSetMusicOpenInfoBuletoothModel
1399 */
1400+ (__kindof IDOSetMusicOpenInfoBuletoothModel *)currentModel;
1401@end
1402
1403#pragma mark ==== 设置防止丢失model ====
1404@interface IDOSetPreventLostInfoBuletoothModel : IDOBluetoothBaseModel
1405
1406/**
1407 防丢失级别 | Loss prevention level
1408 */
1409@property (nonatomic,assign) NSInteger levelType;
1410
1411/**
1412 * @brief 查询数据库,如果查询不到初始化新的model对象
1413 * Query the database, if the query does not initialize a new model object
1414 * @return IDOSetPreventLostInfoBuletoothModel
1415 */
1416+ (__kindof IDOSetPreventLostInfoBuletoothModel *)currentModel;
1417@end
1418
1419#pragma mark ==== 设置左右手穿戴model ====
1420@interface IDOSetLeftOrRightInfoBuletoothModel : IDOBluetoothBaseModel
1421
1422/**
1423 是否右手佩戴 | Is it worn on the right hand?
1424 */
1425@property (nonatomic,assign) BOOL isRight;
1426
1427/**
1428 * @brief 查询数据库,如果查询不到初始化新的model对象
1429 * Query the database, if the query does not initialize a new model object
1430 * @return IDOSetLeftOrRightInfoBuletoothModel
1431 */
1432+ (__kindof IDOSetLeftOrRightInfoBuletoothModel *)currentModel;
1433@end
1434
1435#pragma mark ==== 设置寻找手机model ====
1436@interface IDOSetFindPhoneInfoBuletoothModel : IDOBluetoothBaseModel
1437
1438/**
1439 寻找手机开关 | Looking for a phone switch
1440 */
1441@property (nonatomic,assign) BOOL isOpen;
1442
1443/**
1444 * @brief 查询数据库,如果查询不到初始化新的model对象
1445 * Query the database, if the query does not initialize a new model object
1446 * @return IDOSetFindPhoneInfoBuletoothModel
1447 */
1448+ (__kindof IDOSetFindPhoneInfoBuletoothModel *)currentModel;
1449@end
1450
1451#pragma mark ==== 设置一键呼叫model ====
1452@interface IDOSetOneKeySosInfoBuletoothModel : IDOBluetoothBaseModel
1453
1454/**
1455 一键呼叫开关 | One-touch call switch
1456 */
1457@property (nonatomic,assign) BOOL isOpen;
1458
1459/**
1460 * @brief 查询数据库,如果查询不到初始化新的model对象
1461 * Query the database, if the query does not initialize a new model object
1462 * @return IDOSetOneKeySosInfoBuletoothModel
1463 */
1464+ (__kindof IDOSetOneKeySosInfoBuletoothModel *)currentModel;
1465@end
1466
1467#pragma mark ==== 设置开启蓝牙配对model ====
1468@interface IDOSetPairingInfoBuletoothModel : IDOBluetoothBaseModel
1469
1470/**
1471 配对时间戳 time interval since 1970 (如:1444361933)
1472 * Pairing timestamp time interval since 1970 (eg 14442361933)
1473 */
1474@property (nonatomic,copy) NSString * pairingTimeStr;
1475
1476/**
1477 是否配对 | Pairing
1478 */
1479@property (nonatomic,assign) BOOL isPairing;
1480
1481/**
1482 * @brief 查询数据库,如果查询不到初始化新的model对象
1483 * Query the database, if the query does not initialize a new model object
1484 * @return IDOSetPairingInfoBuletoothModel
1485 */
1486+ (__kindof IDOSetPairingInfoBuletoothModel *)currentModel;
1487
1488@end
1489
1490#pragma mark ==== 设置智能提醒model ====
1491@interface IDOSetNoticeInfoBuletoothModel : IDOBluetoothBaseModel
1492
1493/**
1494 是否配对 | Pairing
1495 */
1496@property (nonatomic,assign) BOOL isPairing;
1497
1498/**
1499 来电延迟 | Call delay
1500 */
1501@property (nonatomic,assign) NSInteger callDelay;
1502
1503/**
1504 * 是否开启子开关 (只对智能提醒有效,对来电提醒无效)
1505 * Whether to enable the sub-switch (only valid for smart reminders, invalid for incoming call reminders)
1506 */
1507@property (nonatomic,assign) BOOL isOnChild;
1508
1509/**
1510 来电提醒 | Call reminder
1511 */
1512@property (nonatomic,assign) BOOL isOnCall;
1513
1514/**
1515 短信提醒 | SMS reminder
1516 */
1517@property (nonatomic,assign) BOOL isOnSms;
1518
1519/**
1520 邮件提醒 | Email alert
1521 */
1522@property (nonatomic,assign) BOOL isOnEmail;
1523
1524/**
1525 微信提醒 | WeChat reminder
1526 */
1527@property (nonatomic,assign) BOOL isOnWeChat;
1528
1529/**
1530 qq提醒 | qq reminder
1531 */
1532@property (nonatomic,assign) BOOL isOnQq;
1533
1534/**
1535 微博提醒 | Weibo reminder
1536 */
1537@property (nonatomic,assign) BOOL isOnWeibo;
1538
1539/**
1540 FaceBook 提醒 | FaceBook Reminder
1541 */
1542@property (nonatomic,assign) BOOL isOnFaceBook;
1543
1544/**
1545 Twitter 提醒 | Twitter Reminder
1546 */
1547@property (nonatomic,assign) BOOL isOnTwitter;
1548
1549/**
1550 Whatsapp 提醒 | Whatsapp Reminder
1551 */
1552@property (nonatomic,assign) BOOL isOnWhatsapp;
1553
1554/**
1555 Messenger 提醒 | Messenger reminder
1556 */
1557@property (nonatomic,assign) BOOL isOnMessenger;
1558
1559/**
1560 Instagram 提醒 | Instagram reminder
1561 */
1562@property (nonatomic,assign) BOOL isOnInstagram;
1563
1564/**
1565 LinkedIn 提醒 | LinkedIn Reminder
1566 */
1567@property (nonatomic,assign) BOOL isOnLinkedIn;
1568
1569/**
1570 Calendar 提醒 | Calendar Reminder
1571 */
1572@property (nonatomic,assign) BOOL isOnCalendar;
1573
1574/**
1575 Skype 提醒 | Skype reminder
1576 */
1577@property (nonatomic,assign) BOOL isOnSkype;
1578
1579/**
1580 Alarm 提醒 | Alarm Reminder
1581 */
1582@property (nonatomic,assign) BOOL isOnAlarm;
1583
1584/**
1585 Pokeman 提醒 | Pokemon Reminder
1586 */
1587@property (nonatomic,assign) BOOL isOnPokeman;
1588
1589/**
1590 Vkontakte 提醒 | Vkontakte Reminder
1591 */
1592@property (nonatomic,assign) BOOL isOnVkontakte;
1593
1594/**
1595 Line 提醒 | Line reminder
1596 */
1597@property (nonatomic,assign) BOOL isOnLine;
1598
1599/**
1600 Viber 提醒 | Viber reminder
1601 */
1602@property (nonatomic,assign) BOOL isOnViber;
1603
1604/**
1605 KakaoTalk 提醒 | KakaoTalk Reminder
1606 */
1607@property (nonatomic,assign) BOOL isOnKakaoTalk;
1608
1609/**
1610 Gmail 提醒 | Gmail reminder
1611 */
1612@property (nonatomic,assign) BOOL isOnGmail;
1613
1614/**
1615 Outlook 提醒 | Outlook reminder
1616 */
1617@property (nonatomic,assign) BOOL isOnOutlook;
1618
1619/**
1620 Snapchat 提醒 | Snapchat Reminder
1621 */
1622@property (nonatomic,assign) BOOL isOnSnapchat;
1623
1624/**
1625 Telegram 提醒 | Telegram Reminder
1626 */
1627@property (nonatomic,assign) BOOL isOnTelegram;
1628
1629/**
1630 Chatwork 提醒 | Chatwork
1631 */
1632@property (nonatomic,assign) BOOL isOnChatwork;
1633
1634/**
1635 Slack 提醒 | Slack
1636 */
1637@property (nonatomic,assign) BOOL isOnSlack;
1638
1639/**
1640 Yahoo Mail 提醒 | Yahoo Mail
1641 */
1642@property (nonatomic,assign) BOOL isOnYahooMail;
1643
1644/**
1645 Tumblr 提醒 | Tumblr
1646 */
1647@property (nonatomic,assign) BOOL isOnTumblr;
1648
1649/**
1650 Youtube 提醒 | Youtube
1651 */
1652@property (nonatomic,assign) BOOL isOnYoutube;
1653
1654/**
1655 Yahoo Pinterest 提醒 | Yahoo Pinterest
1656 */
1657@property (nonatomic,assign) BOOL isOnYahooPinterest;
1658
1659/**
1660 * @brief 查询数据库,如果查询不到初始化新的model对象
1661 * Query the database, if the query does not initialize a new model object
1662 * @return IDOSetNoticeInfoBuletoothModel
1663 */
1664+ (__kindof IDOSetNoticeInfoBuletoothModel *)currentModel;
1665
1666@end
1667
1668#pragma mark ==== 设置用户信息model ====
1669@interface IDOSetUserInfoBuletoothModel : IDOBluetoothBaseModel
1670
1671/**
1672 身高(厘米) | Height(cm)
1673 */
1674@property (nonatomic,assign) NSInteger height;
1675
1676/**
1677 当前体重(千克) | Current weight(kg)
1678 */
1679@property (nonatomic,assign) NSInteger weight;
1680
1681/**
1682 性别 1: 男 2 :女 | Gender 1: Male 2: Female
1683 */
1684@property (nonatomic,assign) NSInteger gender;
1685
1686/**
1687 年 | year
1688 */
1689@property (nonatomic,assign) NSInteger year;
1690
1691/**
1692 月 | Month
1693 */
1694@property (nonatomic,assign) NSInteger month;
1695
1696/**
1697 日 | day
1698 */
1699@property (nonatomic,assign) NSInteger day;
1700
1701/**
1702 目标睡眠 (时) | Target sleep (hours)
1703 */
1704@property (nonatomic,assign) NSInteger goalSleepDataHour;
1705
1706/**
1707 目标睡眠 (分) | Target sleep (minutes)
1708 */
1709@property (nonatomic,assign) NSInteger goalSleepDataMinute;
1710
1711/**
1712 目标步数 | Target steps
1713 */
1714@property (nonatomic,assign) NSInteger goalStepData;
1715
1716/**
1717 目标卡路里 | Goal Calories
1718 */
1719@property (nonatomic,assign) NSInteger goalCalorieData;
1720
1721/**
1722 目标距离(米) | Target distance(m)
1723 */
1724@property (nonatomic,assign) NSInteger goalDistanceData;
1725
1726/**
1727 目标体重(千克) | Target weight(kg)
1728 */
1729@property (nonatomic,assign) NSInteger goalWeightData;
1730
1731/**
1732 * 目标类型 (类型 : 0 : 步数 1 : 卡路里 2 : 距离) 设置一种类型的目标需要执行一次命令
1733 * Target type (type : 0 : step 1 : calories 2 : distance) Setting a type of target requires a command to be executed
1734 */
1735@property (nonatomic,assign) NSInteger goalType;
1736
1737/**
1738 是否登陆 | Login
1739 */
1740@property (nonatomic,assign) BOOL isLogin;
1741
1742/**
1743 绑定状态 | Binding status
1744 */
1745@property (nonatomic,assign) NSInteger bindState;
1746
1747/**
1748 * @brief 查询数据库,如果查询不到初始化新的model对象
1749 * Query the database, if the query does not initialize a new model object
1750 * @return IDOSetUserInfoBuletoothModel
1751 */
1752+ (__kindof IDOSetUserInfoBuletoothModel *)currentModel;
1753
1754
1755@end
1756
1757
1758@interface IDOSetInfoBluetoothModel : IDOBluetoothBaseModel
1759
1760@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncActivityDataModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncActivityDataModel.h
new file mode 100755
index 0000000..8aaab8b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncActivityDataModel.h
@@ -0,0 +1,207 @@
1//
2// IDOSyncActivityDataModel.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/6.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
11#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
12#else
13#import "IDOBluetoothBaseModel.h"
14#endif
15
16@interface IDOSyncActivityDataInfoBluetoothModel : IDOBluetoothBaseModel
17
18/**
19 年份 | Year
20 */
21@property (nonatomic,assign) NSInteger year;
22
23/**
24 月份 | Month
25 */
26@property (nonatomic,assign) NSInteger month;
27
28/**
29 日期 | Date
30 */
31@property (nonatomic,assign) NSInteger day;
32
33/**
34 时 | hour
35 */
36@property (nonatomic,assign) NSInteger hour;
37
38/**
39 分 | minutes
40 */
41@property (nonatomic,assign) NSInteger minute;
42
43/**
44 秒 | seconds
45 */
46@property (nonatomic,assign) NSInteger second;
47
48/**
49 日期 精确到日期 date interval since 1970 (如:1444361933) | Date time interval since 1970 (eg 14442361933)
50 */
51@property (nonatomic,copy) NSString * dateStr;
52
53/**
54 开始时间 精确到秒 | start time interval since 1970 (eg 14442361933)
55 */
56@property (nonatomic,copy) NSString * timeStr;
57
58/**
59 数据长度 | Data length
60 */
61@property (nonatomic,assign) NSInteger dataLength;
62
63/**
64 心率数据产生间隔 (单位 : s) | Heart rate data generation interval (unit: s)
65 */
66@property (nonatomic,assign) NSInteger hrInterval;
67
68/**
69 心率项数据个数 | Heart rate item data
70 */
71@property (nonatomic,assign) NSInteger hrItemCount;
72
73/**
74 包的总数 | Total number of packages
75 */
76@property (nonatomic,assign) NSInteger packetCount;
77
78/*
79 * 类型:0x01:走路, 0x02:跑步, 0x03:骑行 0x04:徒步 这些类型才有轨迹运动
80 * Type: 0x01: Walk, 0x02: Running, 0x03: Cycling 0x04: Walking These types have track motion
81 */
82@property (nonatomic,assign) NSInteger type;
83
84/**
85 步数(骑行 时,步数为 0) | Number of steps (when riding, the number of steps is 0)
86 */
87@property (nonatomic,assign) NSInteger step;
88
89/**
90 持续时长 (单位:s) | Duration (unit: s)
91 */
92@property (nonatomic,assign) NSInteger durations;
93
94/**
95 卡路里(单 位:大卡) | Calories (Unit: Big Card)
96 */
97@property (nonatomic,assign) NSInteger calories;
98
99/**
100 距离(单位: 米) | Distance (in meters)
101 */
102@property (nonatomic,assign) NSInteger distance;
103
104/**
105 平均心率 | Average heart rate
106 */
107@property (nonatomic,assign) NSInteger avgHrValue;
108
109/**
110 最大心率 | Maximum heart rate
111 */
112@property (nonatomic,assign) NSInteger maxHrValue;
113
114/**
115 脂肪燃烧时长 | Fat burning time
116 */
117@property (nonatomic,assign) NSInteger burnFatMins;
118
119/**
120 心肺锻炼时长 [有氧运动时长] (分钟) | Cardio workout time (minutes)
121 */
122@property (nonatomic,assign) NSInteger aerobicMins;
123
124/**
125 极限锻炼时长 (分钟) | Extreme workout time (minutes)
126 */
127@property (nonatomic,assign) NSInteger limitMins;
128
129/**
130 无氧锻炼时长 (分钟) | Anaerobic workout time (minutes)
131 */
132@property (nonatomic,assign) NSInteger anaerobicMins;
133
134/**
135 热身锻炼时长 (分钟) | Warm up workout time (minutes)
136 */
137@property (nonatomic,assign) NSInteger warmUpMins;
138
139/**
140 有序列号的心率集合 json字符串 | Heart rate collection with serial number json string
141 */
142@property (nonatomic,copy) NSString * hrValuesStr;
143
144/**
145 是否需要保存数据 (用于数据交换) | Do you need to save data (for data exchange)
146 */
147@property (nonatomic,assign) BOOL isSave;
148
149/**
150 * 运动发起端 (1 : 手环发起 0 : app发起)
151 * Sports Initiator (1 : Bracelet Initiation 0 : app initiated)
152 */
153@property (nonatomic,assign) NSInteger startFrom;
154
155@end
156
157@interface IDOSyncActivityDataModel : NSObject
158/**
159 * @brief 当前设备根据活动开始时间查询某个活动详情
160 * The current device queries an event details based on the event start time
161 * @param macAddr mac地址 | Mac address
162 * @param timeStr 活动开始时间 | Event start time
163 * @return model IDOSyncActivityDataInfoBluetoothModel
164 */
165+ (__kindof IDOSyncActivityDataInfoBluetoothModel *)queryOneActivityDataWithTimeStr:(NSString *)timeStr
166 macAddr:(NSString *)macAddr;
167
168/**
169 * @brief 当前设备根据日期查询某天的活动集合
170 * The current device queries the collection of events for a certain day based on the date
171 * @param macAddr mac地址 | Mac address
172 * @param year 年份 | year
173 * @param month 月份 | month
174 * @param day 日期 | day
175 * @return 活动集合 | Activity collection
176 */
177+ (NSArray <__kindof IDOSyncActivityDataInfoBluetoothModel *>*)queryOneDayActivityDataWithMacAddr:(NSString *)macAddr
178 year:(NSInteger)year
179 month:(NSInteger)month
180 day:(NSInteger)day;
181
182
183/**
184 * @brief 当前设备活动分页查询活动集合 | Current Device Activity Paging Query Activity Collection
185 * @param pageIndex 页码 第几页 (如 : 0,1,2,3,4,...) | Page Number of pages (eg : 0,1,2,3,4,...)
186 * @param numOfPage 每页的数据个数 (如 : 10,20,30...) | The number of data per page (eg: 10, 20, 30...)
187 * @param macAddr mac地址 | Mac address
188 * @return 活动集合
189 */
190+ (NSArray <__kindof IDOSyncActivityDataInfoBluetoothModel *>*)queryOnePageActivityDataWithPageIndex:(NSInteger)pageIndex
191 numOfPage:(NSInteger)numOfPage
192 macAddr:(NSString *)macAddr;
193
194/**
195 * @brief 当前设备所有轨迹运动 | Current track motion of all devices
196 * @param macAddr mac 地址 | mac address
197 * @return 活动集合 | Activity collection
198 */
199+ (NSArray <__kindof IDOSyncActivityDataInfoBluetoothModel *>*)queryAllTrajectorySportActivitysWithMac:(NSString *)macAddr;
200
201/**
202 * @brief 当前设备所有轻运动 | Current equipment all light sports
203 * @param macAddr mac 地址 | mac address
204 * @return 活动集合 | Activity collection
205 */
206+ (NSArray <__kindof IDOSyncActivityDataInfoBluetoothModel *>*)queryAllLightSportActivitysWithMac:(NSString *)macAddr;
207@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncBpDataModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncBpDataModel.h
new file mode 100755
index 0000000..e475df2
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncBpDataModel.h
@@ -0,0 +1,191 @@
1//
2// IDOSyncBpDataModel.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/6.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
11#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
12#else
13#import "IDOBluetoothBaseModel.h"
14#endif
15
16@interface IDOSyncBpDataItemInfoBluetoothModel : IDOBluetoothBaseModel
17
18/**
19 较大收缩压 | Large systolic pressure
20 */
21@property (nonatomic,assign) NSInteger sysBlood;
22
23/**
24 较小舒张压 | Small diastolic pressure
25 */
26@property (nonatomic,assign) NSInteger diasBlood;
27
28/**
29 子时间偏移量 (分钟) | Subtime offset (minutes)
30 */
31@property (nonatomic,assign) NSInteger offset DEPRECATED_MSG_ATTRIBUTE("parameter is invalidp,please use \"timeStr\"");
32
33/**
34 序列号 | Serial number
35 */
36@property (nonatomic,assign) NSInteger serialNumber DEPRECATED_MSG_ATTRIBUTE("parameter is invalid,please use \"timeStr\"");
37
38/**
39 时间戳 精确到日期 date interval since 1970 (如:1444361933) | Timestamp date interval since 1970 (eg: 14443361933)
40 */
41@property (nonatomic,copy) NSString * dateStr;
42
43/**
44 时间戳 精确到分钟 time interval since 1970 (如:1444361933) | Timestamp time interval since 1970 (eg: 14443361933)
45 */
46@property (nonatomic,copy) NSString * timeStr;
47
48/**
49 本地设置数据,区分手环同步的数据 | Locally set data to distinguish the data of the bracelet synchronization
50 */
51@property (nonatomic,assign) BOOL isLocal;
52
53@end
54
55@interface IDOSyncBpDataInfoBluetoothModel : IDOBluetoothBaseModel
56
57/**
58 血压数据包量 | Blood pressure data package
59 */
60@property (nonatomic,assign) NSInteger itemsCount;
61
62/**
63 睡眠平均血压 | Average blood pressure in sleep
64 */
65@property (nonatomic,assign) NSInteger sleepAvgBp;
66
67/**
68 最大血压值 | Maximum blood pressure value
69 */
70@property (nonatomic,assign) NSInteger maxBp;
71
72/**
73 年份 | Year
74 */
75@property (nonatomic,assign) NSInteger year;
76
77/**
78 月份 | Month
79 */
80@property (nonatomic,assign) NSInteger month;
81
82/**
83 日期 | Date
84 */
85@property (nonatomic,assign) NSInteger day;
86
87/**
88 * 血压集合 只有定义好的查询方法才能转成model集合,自定义的查询方法无法直接转成model集合,需要再查询itemModel赋给当前属性
89 * Blood pressure collection Only defined query methods can be converted into model collections. Custom query methods cannot be directly
90 * converted into model collections. You need to query itemModel to assign current attributes.
91 */
92@property (nonatomic,copy) NSArray <IDOSyncBpDataItemInfoBluetoothModel *>* bloodbPressures;
93
94/**
95 时间戳 精确到日期 date interval since 1970 (如:1444361933) | Timestamp date interval since 1970 (eg: 14443361933)
96 */
97@property (nonatomic,copy) NSString * dateStr;
98
99/**
100 总时间偏移量 (分钟) | Total time offset (minutes)
101 */
102@property (nonatomic,assign) NSUInteger minuteOffset;
103
104/**
105 本地设置数据,区分手环同步的数据 | Locally set data to distinguish the data of the bracelet synchronization
106 */
107@property (nonatomic,assign) BOOL isLocal;
108
109@end
110
111@interface IDOSyncBpDataModel : NSObject
112/**
113 * @brief 查询当前设备某年12个月所有数据 (如果查询当月无数据,会创建空的数据对象,大于当月的数据不累加)
114 * Query all data of the current device for 12 months in a certain year (If there is no data in the current month, an empty data object will be created,
115 * and the data larger than the current month will not be accumulated)
116 * @param year 年 (如 : 2018) | year (eg 2018)
117 * @param isQuery 是否查询items | is query items
118 * @return 一年12个月的血压数据集合,其中IDOSyncBpDataInfoBluetoothModel对象是一天总血压数据模型
119 * A 12-month blood pressure data collection, where the IDOSyncBpDataInfoBluetoothModel object is a total blood pressure data model for the day
120 */
121+ (NSArray <NSArray<__kindof IDOSyncBpDataInfoBluetoothModel *>*> *)queryOneYearBloodPressuresWithYear:(NSInteger)year
122 macAddr:(NSString *)macAddr
123 isQueryItems:(BOOL)isQuery;
124
125/**
126 * @brief 查询当前设备某月份的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
127 * Query all data of the current device for a certain month (If there is no data on the query day, an empty data object will be created,
128 * which is larger than the data of the day)
129 * @param year 年 (如 : 2018) | Year (eg: 2018)
130 * @param month 月 (如 : 9) | Month (eg: 9)
131 * @param dates 当前查询月份的所有日期集合的指针 (格式 :[10/01...10/31])
132 * Pointer to all date collections for the current query month (format: [10/01...10/31])
133 * @param isQuery 是否查询items | is query items
134 * @return 一个月的血压数据集合,其中IDOSyncBpDataInfoBluetoothModel对象是一天总血压数据模型
135 * One month blood pressure data set, where the IDOSyncBpDataInfoBluetoothModel object is the total day blood pressure data model
136 */
137+ (NSArray <__kindof IDOSyncBpDataInfoBluetoothModel *>*)queryOneMonthBloodPressuresWithYear:(NSInteger)year
138 month:(NSInteger)month
139 macAddr:(NSString *)macAddr
140 datesOfMonth:(NSArray <NSString *>**)dates
141 isQueryItems:(BOOL)isQuery;
142
143/**
144 * @brief 查询当前设备某周的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
145 * Query all data of the current device for a certain week (If there is no data on the day of the query, an empty data object will be created,
146 * and the data larger than the current day will not be accumulated)
147 * @param weekIndex 周的查询索引 (0 : 当周, 1 : 上一周, 2 : 上两周 ...) | Week's query index (0: week, 1 : last week, 2 : last two weeks...)
148 * @param weekStartDay 星期的开始日 (0 : 星期日, 1 : 星期一, 2 : 星期二 ...) | Start of the week (0: Sunday, 1 : Monday, 2 : Tuesday ...)
149 * @param dates 当前查询周的所有日期集合的指针 (格式 :[10/01...10/07])
150 * Pointer to all date collections for the current query week (format: [10/01...10/07])
151 * @param isQuery 是否查询items | is query items
152 * @return 一周的血压数据集合,其中IDOSyncBpDataInfoBluetoothModel对象是一天总血压数据模型
153 * A week's blood pressure data collection, where the IDOSyncBpDataInfoBluetoothModel object is the total day blood pressure data model
154 */
155+ (NSArray <__kindof IDOSyncBpDataInfoBluetoothModel *>*)queryOneWeekBloodPressuresWithWeekIndex:(NSInteger)weekIndex
156 weekStartDay:(NSInteger)weekStartDay
157 macAddr:(NSString *)macAddr
158 datesOfWeek:(NSArray <NSString *>**)dates
159 isQueryItems:(BOOL)isQuery;
160
161/**
162 * @brief 查询当前设备某天血压数据并有详情数据
163 * Query current device blood pressure data for one day and have detailed data
164 * @param macAddr mac 地址 | mac address
165 * @param year 年份 | year
166 * @param month 月份 | month
167 * @param day 日期 | day
168 * @return 一天血压数据的集合和详情数据集合 | Collection of day blood pressure data and detailed data
169 */
170+ (NSArray<__kindof IDOSyncBpDataInfoBluetoothModel *> *)queryOneDayBloodPressureDetailWithMac:(NSString *)macAddr
171 year:(NSInteger)year
172 month:(NSInteger)month
173 day:(NSInteger)day;
174
175/**
176 * @brief 查询当前设备最近一天血压数据并有详情数据
177 * Query the current day's blood pressure data of the device and have detailed data
178 * @param macAddr mac 地址 | mac address
179 * @return 一天血压数据的集合和详情数据 | Collection of day blood pressure data and detailed data
180 */
181+ (__kindof IDOSyncBpDataInfoBluetoothModel *)queryLastDayBloodPressureDetailWithMac:(NSString *)macAddr;
182
183/**
184 * @brief 查询所有血压数据 血压包数大于0
185 * Query all blood pressure data The number of blood pressure packets is greater than 0
186 * @param macAddr mac 地址 | mac address
187 * @return 所有血压数据的集合和详情数据 | Collection and detailed data of all blood pressure data
188 */
189+ (NSArray <__kindof IDOSyncBpDataInfoBluetoothModel *>*)queryAllBloodPressuresWithMac:(NSString *)macAddr;
190@end
191
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncEnum.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncEnum.h
new file mode 100755
index 0000000..a559371
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncEnum.h
@@ -0,0 +1,316 @@
1//
2// IDOSyncEnum.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/3.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#ifndef IDOSyncEnum_h
10#define IDOSyncEnum_h
11
12/**
13 * 同步状态枚举
14 * Synchronization status enumeration
15 */
16typedef NS_ENUM(NSInteger, IDO_SYNC_COMPLETE_STATUS) {
17 /**
18 * 全部同步完成
19 * All sync completed
20 */
21 IDO_SYNC_GLOBAL_COMPLETE = 1,
22
23 /**
24 * 配置同步完成
25 * Configuration synchronization completed
26 */
27 IDO_SYNC_CONFIG_COMPLETE,
28
29 /**
30 * 配置同步完成异常
31 * Configure synchronization completion exception
32 */
33 IDO_SYNC_CONFIG_COMPLETE_EXCEPTION,
34
35 /**
36 * 健康同步完成
37 * Health synchronization completed
38 */
39 IDO_SYNC_HEALTH_COMPLETE,
40
41 /**
42 * 健康同步完成异常
43 * Health synchronization completes exception
44 */
45 IDO_SYNC_HEALTH_COMPLETE_EXCEPTION,
46
47 /**
48 * v3健康同步完成
49 * v3 health synchronization completed
50 */
51 IDO_SYNC_V3_HEALTH_COMPLETE,
52
53 /**
54 * v3健康同步完成异常
55 * v3 health synchronization completes exception
56 */
57 IDO_SYNC_V3_HEALTH_COMPLETE_EXCEPTION,
58
59 /**
60 * 活动同步完成
61 * Activity synchronization completed
62 */
63 IDO_SYNC_ACTIVITY_COMPLETE,
64
65 /**
66 * 活动同步完成异常
67 * Activity synchronization completes exception
68 */
69 IDO_SYNC_ACTIVITY_COMPLETE_EXCEPTION,
70
71 /**
72 * GPS同步完成
73 * GPS synchronization completed
74 */
75 IDO_SYNC_GPS_COMPLETE,
76
77 /**
78 * GPS同步完成异常
79 * GPS synchronization completes exception
80 */
81 IDO_SYNC_GPS_COMPLETE_EXCEPTION,
82
83};
84
85/**
86 * 当前同步类型枚举
87 * Current sync type enumeration
88 */
89typedef NS_ENUM(NSInteger, IDO_CURRENT_SYNC_TYPE) {
90 /**
91 * 当前同步配置
92 * Current synchronization configuration
93 */
94 IDO_SYNC_CONFIG_TYPE = 1,
95
96 /**
97 * 当前同步健康
98 * Current sync health
99 */
100 IDO_SYNC_HEALTH_TYPE,
101
102 /**
103 * 当前同步V3健康
104 * Current sync Blood oxygen and pressure
105 */
106 IDO_SYNC_V3_HEALTH_TYPE,
107
108 /**
109 * 当前同步活动
110 * Current synchronization activity
111 */
112 IDO_SYNC_ACTIVITY_TYPE,
113
114 /**
115 * 当前同步GPS
116 * Current synchronous GPS
117 */
118 IDO_SYNC_GPS_TYPE,
119
120};
121
122/**
123 * 同步配置数据类型
124 * Synchronous configuration data type
125 */
126typedef NS_ENUM(NSInteger, IDO_SYNC_CONFIG_DATA_TYPE) {
127 /*
128 * 不设置默认数据
129 * set none
130 */
131 IDO_SYNC_DEFAULT_NONE = 0,
132 /*
133 * 设置当前时间
134 * set time
135 */
136 IDO_SYNC_SET_TIME_TYPE = 1,
137 /*
138 * 设置闹钟
139 * set alarm
140 */
141 IDO_SYNC_SET_ALARM_TYPE,
142 /*
143 * 设置久坐
144 * set long sit
145 */
146 IDO_SYNC_SET_LONG_SIT_TYPE,
147 /*
148 * 设置防丢失
149 * set lost find
150 */
151 IDO_SYNC_SET_LOST_FIND_TYPE,
152 /*
153 * 设置寻找手机
154 * set find phone
155 */
156 IDO_SYNC_SET_FIND_PHONE_TYPE,
157 /*
158 * 设置运动目标(步数)
159 * set sport goal
160 */
161 IDO_SYNC_SET_SPORT_GOAL_TYPE,
162 /*
163 * 设置用户信息
164 * set user info
165 */
166 IDO_SYNC_SET_USER_INFO_TYPE,
167 /*
168 * 设置单位
169 * set unit
170 */
171 IDO_SYNC_SET_UNIT_TYPE,
172 /*
173 * 设置开启授权
174 * set open auth
175 */
176 IDO_SYNC_SET_AUTH_TYPE,
177 /*
178 * 设置心率模式
179 * set heart rate mode
180 */
181 IDO_SYNC_SET_HEART_RATE_MODE_TYPE,
182 /*
183 * 设置抬手
184 * set up hand gesture
185 */
186 IDO_SYNC_SET_UP_HAND_GESTURE_TYPE,
187 /*
188 * 设置勿扰模式
189 * set do not disturb
190 */
191 IDO_SYNC_SET_DO_NOT_DISTURB_TYPE,
192 /*
193 * 设置显示模式
194 * set display mode
195 */
196 IDO_SYNC_SET_DISPLAY_MODE_TYPE,
197 /*
198 * 设置一键呼叫
199 * set one key sos
200 */
201 IDO_SYNC_SET_ONE_KEY_SOS_TYPE,
202 /*
203 * 设置音乐开关
204 * set muisc on off
205 */
206 IDO_SYNC_SET_MUISC_ON_OFF_TYPE,
207 /*
208 * 设置天气开关
209 * set weather switch
210 */
211 IDO_SYNC_SET_WEATHER_SWITCH_TYPE,
212 /*
213 * 设置心率区间
214 * set heart rate interval
215 */
216 IDO_SYNC_SET_HEART_RATE_INTERVAL_TYPE,
217 /*
218 * 设置运动模式选择
219 * set sport mode select
220 */
221 IDO_SYNC_SET_SPORT_MODE_SELECT_TYPE,
222 /*
223 * 设置运动模式排序
224 * set sport mode sort
225 */
226 IDO_SYNC_SET_SPORT_MODE_SORT_TYPE,
227 /*
228 * 设置表盘
229 * set watch dial
230 */
231 IDO_SYNC_SET_WATCH_DIAL_TYPE,
232 /*
233 * 设置快捷方式
234 * set shortcut
235 */
236 IDO_SYNC_SET_SHORTCUT_TYPE,
237 /*
238 * 设置睡眠时间段
239 * set sleep period
240 */
241 IDO_SYNC_SET_SLEEP_PERIOD_TYPE,
242 /*
243 * 设置屏幕亮度
244 * set screen brightness
245 */
246 IDO_SYNC_SET_SCREEN_BRIGHTNESS_TYPE,
247 /*
248 * 设置女性生理周期提醒
249 * set menstruation remind
250 */
251 IDO_SYNC_SET_MENSTRUATION_REMIND_TYPE,
252 /*
253 * 设置女性生理周期
254 * set menstruation
255 */
256 IDO_SYNC_SET_SET_MENSTRUATION_TYPE,
257 /*
258 * 设置卡路里和距离目标
259 * set calorie distance goal
260 */
261 IDO_SYNC_SET_CALORIE_DISTANCE_GOAL_TYPE,
262 /*
263 * 设置GPS信息
264 * set gps config
265 */
266 IDO_SYNC_SET_CONFIG_GPS_TYPE,
267 /*
268 * 设置打开苹果通知开关
269 * set open ancs
270 */
271 IDO_SYNC_SET_BLE_OPEN_ANCS_TYPE,
272 /*
273 * 设置走路提醒
274 * set walk reminder
275 */
276 IDO_SYNC_SET_WALK_REMINDER_TYPE,
277 /*
278 * 设置血氧训练
279 * set breathe train
280 */
281 IDO_SYNC_SET_BREATHE_TRAIN_TYPE,
282 /*
283 * 设置活动识别开关
284 * set activity switch
285 */
286 IDO_SYNC_SET_ACTIVITY_SWITCH_TYPE,
287};
288
289/**
290 * 设置同步项类型
291 * set want to sync item type
292 */
293typedef NS_ENUM(NSInteger, IDO_WANT_TO_SYNC_ITEM_TYPE) {
294 /*
295 * 同步配置
296 * sync config
297 */
298 IDO_WANT_TO_SYNC_CONFIG_ITEM_TYPE = 1 << 0,
299 /*
300 * 同步健康
301 * sync health
302 */
303 IDO_WANT_TO_SYNC_HEALTH_ITEM_TYPE = 1 << 1,
304 /*
305 * 同步活动
306 * sync activity
307 */
308 IDO_WANT_TO_SYNC_ACTIVITY_ITEM_TYPE = 1 << 2,
309 /*
310 * 同步 GPS
311 * sync gps
312 */
313 IDO_WANT_TO_SYNC_GPS_ITEM_TYPE = 1 << 3
314};
315
316#endif /* IDOSyncEnum_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncGpsDataModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncGpsDataModel.h
new file mode 100755
index 0000000..d985aa1
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncGpsDataModel.h
@@ -0,0 +1,133 @@
1//
2// IDOSyncGpsDataModel.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/6.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
11#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
12#else
13#import "IDOBluetoothBaseModel.h"
14#endif
15
16@interface IDOSyncGpsDataItemInfoBluetoothModel : IDOBluetoothBaseModel
17
18/**
19 序列号 | Serial number
20 */
21@property (nonatomic,assign) NSInteger serialNumber;
22
23/**
24 经度 | Longitude
25 */
26@property (nonatomic,copy) NSString * latitudeStr;
27
28/**
29 纬度 | Latitude
30 */
31@property (nonatomic,copy) NSString * longitudeStr;
32
33/**
34 * 发起运动时间 时间戳 精确到秒 time interval since 1970 (如:1444361933)
35 * Initiate exercise time Timestamp time interval since 1970 (eg 14442361933)
36 */
37@property (nonatomic,copy) NSString * timeStr;
38
39/**
40 日期 精确到日期 date interval since 1970 (如:1444361933) | date interval since 1970 (eg: 14443361933)
41 */
42@property (nonatomic,copy) NSString * dateStr;
43
44@end
45
46
47@interface IDOSyncGpsDataInfoBluetoothModel : IDOBluetoothBaseModel
48
49/**
50 年份 | Year
51 */
52@property (nonatomic,assign) NSInteger year;
53
54/**
55 月份 | Month
56 */
57@property (nonatomic,assign) NSInteger month;
58
59/**
60 日期 | Date
61 */
62@property (nonatomic,assign) NSInteger day;
63
64/**
65 时 | hour
66 */
67@property (nonatomic,assign) NSInteger hour;
68
69/**
70 分 | minutes
71 */
72@property (nonatomic,assign) NSInteger minute;
73
74/**
75 秒 | seconds
76 */
77@property (nonatomic,assign) NSInteger second;
78
79/**
80 * 发起运动时间 时间戳 精确到秒 time interval since 1970 (如:1444361933)
81 * Initiate exercise time Timestamp time interval since 1970 (eg 14442361933)
82 */
83@property (nonatomic,copy) NSString * timeStr;
84
85/**
86 日期 精确到日期 date interval since 1970 (如:1444361933) | date interval since 1970 (eg: 14443361933)
87 */
88@property (nonatomic,copy) NSString * dateStr;
89
90/**
91 gps数据包数量 | gps packet number
92 */
93@property (nonatomic,assign) NSInteger itemsCount;
94
95/**
96 间隔时长 (单位:秒)| Interval length (unit:second)
97 */
98@property (nonatomic,assign) int interval;
99
100/**
101 运动发起端 (1 : 手环发起 0 : app发起) | Sports Initiator (1 : Bracelet Initiation 0 : app initiated)
102 */
103@property (nonatomic,assign) NSInteger startFrom;
104
105/**
106 * GPS 坐标点集合 只有定义好的查询方法才能转成model集合,自定义的查询方法无法直接转成model集合,需要再查询itemModel赋给当前属性
107 * GPS coordinate point set Only defined query methods can be converted into model collections. Custom query methods cannot be directly
108 * converted into model collections. You need to query itemModel to assign current attributes.
109 */
110@property (nonatomic,copy) NSArray <IDOSyncGpsDataItemInfoBluetoothModel *>* gpsItems;
111
112@end
113
114@interface IDOSyncGpsDataModel : NSObject
115/**
116 * @brief 根据时间戳查询某个活动的GPS信息 | Querying the GPS information of an activity based on the timestamp
117 * @param timeStr 时间戳 time interval since 1970 (如:1444361933) | Timestamp time interval since 1970 (eg: 14443361933)
118 * @param macAddr mac 地址 | mac address
119 * @return gps信息数据 坐标item对象集合 | gps information data coordinate item object collection
120 */
121+ (__kindof IDOSyncGpsDataInfoBluetoothModel *)queryOneActivityCoordinatesWithTimeStr:(NSString *)timeStr
122 macAddr:(NSString *)macAddr;
123
124/**
125 * @brief 根据时间戳查询某个活动是否存在轨迹 | Query whether an activity has a track based on a timestamp
126 * @param timeStr 时间戳 time interval since 1970 (如:1444361933) | Timestamp time interval since 1970 (eg: 14443361933)
127 * @param macAddr mac 地址 | mac address
128 * @return 是否存在轨迹 yes or no | Is there a track?
129 */
130+ (BOOL)queryActivityHasCoordinatesWithTimeStr:(NSString *)timeStr
131 macAddr:(NSString *)macAddr;
132@end
133
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncHeartRateDataModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncHeartRateDataModel.h
new file mode 100755
index 0000000..c160915
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncHeartRateDataModel.h
@@ -0,0 +1,442 @@
1//
2// IDOSyncHeartRateDataModel.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/6.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
11#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
12#else
13#import "IDOBluetoothBaseModel.h"
14#endif
15
16@interface IDOSyncHrDataItemInfoBluetoothModel : IDOBluetoothBaseModel
17
18/**
19 子时间偏移量 (单位:分钟) | Total time offset (unit: minute)
20 */
21@property (nonatomic,assign) NSInteger offset;
22
23/**
24 心率值 | Heart rate value
25 */
26@property (nonatomic,assign) NSInteger data;
27
28/**
29 时间戳 精确到日期 date interval since 1970 (如:1444361933) | Timestamp date interval since 1970 (eg: 14443361933)
30 */
31@property (nonatomic,copy) NSString * dateStr;
32
33/**
34 序列号 | Serial number
35 */
36@property (nonatomic,assign) NSInteger serialNumber;
37
38@end
39
40@interface IDOSyncHrDataInfoBluetoothModel : IDOBluetoothBaseModel
41
42/**
43 心率数据包数量 | Heart Rate Packets
44 */
45@property (nonatomic,assign) NSInteger itemsCount;
46
47/**
48 总时间偏移量 (单位:分钟) | Total time offset (unit: minute)
49 */
50@property (nonatomic,assign) NSUInteger minuteOffset;
51
52/**
53 静态心率 | Static heart rate
54 */
55@property (nonatomic,assign) NSUInteger silentHeartRate;
56
57/**
58 燃烧脂肪阀值 | Burning fat threshold
59 */
60@property (nonatomic,assign) NSUInteger burnFatThreshold;
61
62/**
63 肌肉锻炼阀值 | Muscle exercise threshold
64 */
65@property (nonatomic,assign) NSUInteger aerobicThreshold;
66
67/**
68 极限阀值 | Limit threshold
69 */
70@property (nonatomic,assign) NSUInteger limitThreshold;
71
72/**
73 脂肪燃烧时长 (单位 :分钟) | Fat burning time (unit: minute)
74 */
75@property (nonatomic,assign) NSUInteger burnFatMins;
76
77/**
78 肌肉锻炼时长 (单位 :分钟) | Muscle training time (unit: minute)
79 */
80@property (nonatomic,assign) NSUInteger aerobicMins;
81
82/**
83 极限运动时长 (单位 :分钟) | Extreme Sports Duration (Unit: Minutes)
84 */
85@property (nonatomic,assign) NSUInteger limitMins;
86
87/**
88 用户最大心率 | User maximum heart rate
89 */
90@property (nonatomic,assign) NSUInteger userMaxHr;
91
92/**
93 热身运动阈值 | warm up threshold
94 */
95@property (nonatomic,assign) NSUInteger warmUpThreshold;
96
97/**
98 热身运动时间 (单位 :分钟) | warm up mins
99 */
100@property (nonatomic,assign) NSUInteger warmUpMins;
101
102/**
103 无氧运动阈值 | anaerobic threshold
104 */
105@property (nonatomic,assign) NSUInteger anaerobicThreshold;
106
107/**
108 无氧运动时间 (单位 :分钟) | anaerobic mins
109 */
110@property (nonatomic,assign) NSUInteger anaerobicMins;
111
112/**
113 年份 | Year
114 */
115@property (nonatomic,assign) NSInteger year;
116
117/**
118 月份 | Month
119 */
120@property (nonatomic,assign) NSInteger month;
121
122/**
123 日期 | Date
124 */
125@property (nonatomic,assign) NSInteger day;
126
127/**
128 * 心率集合 只有定义好的查询方法才能转成model集合,自定义的查询方法无法直接转成model集合,需要再查询itemModel赋给当前属性
129 * Heart rate collection Only defined query methods can be converted into model collections. Custom query methods cannot be directly
130 * converted into model collections. You need to query itemModel to assign current attributes.
131 */
132@property (nonatomic,copy) NSArray <IDOSyncHrDataItemInfoBluetoothModel *>* heartRates;
133
134/**
135 时间戳 精确到日期 date interval since 1970 (如:1444361933) | Timestamp date interval since 1970 (eg: 14443361933)
136 */
137@property (nonatomic,copy) NSString * dateStr;
138
139@end
140
141@interface IDOSyncSecHrDataItemInfoBluetoothModel : IDOBluetoothBaseModel
142/**
143 子时间偏移量 (单位:秒钟) | Total time offset (unit: second)
144 */
145@property (nonatomic,assign) NSInteger offset;
146
147/**
148 心率值 | Heart rate value
149 */
150@property (nonatomic,assign) NSInteger hrValue;
151
152/**
153 时间戳 精确到日期 date interval since 1970 (如:1444361933) | Timestamp date interval since 1970 (eg: 14443361933)
154 */
155@property (nonatomic,copy) NSString * dateStr;
156
157/**
158 序列号 | Serial number
159 */
160@property (nonatomic,assign) NSInteger serialNumber;
161
162@end
163
164@interface IDOSyncSecHrDataInfoBluetoothModel : IDOBluetoothBaseModel
165/**
166 心率数据包数量 | Heart Rate Packets
167 */
168@property (nonatomic,assign) NSInteger itemsCount;
169
170/**
171 总时间偏移量 (单位:秒钟) | Total time offset (unit: second)
172 */
173@property (nonatomic,assign) NSUInteger secondOffset;
174
175/**
176 静态心率 | Static heart rate
177 */
178@property (nonatomic,assign) NSUInteger silentHeartRate;
179
180/**
181 燃烧脂肪阀值 | Burning fat threshold
182 */
183@property (nonatomic,assign) NSUInteger burnFatThreshold;
184
185/**
186 肌肉锻炼阀值 | Muscle exercise threshold
187 */
188@property (nonatomic,assign) NSUInteger aerobicThreshold;
189
190/**
191 极限阀值 | Limit threshold
192 */
193@property (nonatomic,assign) NSUInteger limitThreshold;
194
195/**
196 脂肪燃烧时长 (单位 :分钟) | Fat burning time (unit: minute)
197 */
198@property (nonatomic,assign) NSUInteger burnFatMins;
199
200/**
201 肌肉锻炼时长 (单位 :分钟) | Muscle training time (unit: minute)
202 */
203@property (nonatomic,assign) NSUInteger aerobicMins;
204
205/**
206 极限运动时长 (单位 :分钟) | Extreme Sports Duration (Unit: Minutes)
207 */
208@property (nonatomic,assign) NSUInteger limitMins;
209
210/**
211 用户最大心率 | User maximum heart rate
212 */
213@property (nonatomic,assign) NSUInteger userMaxHr;
214
215/**
216 热身运动阈值 | warm up threshold
217 */
218@property (nonatomic,assign) NSUInteger warmUpThreshold;
219
220/**
221 热身运动时间 (单位 :分钟) | warm up mins
222 */
223@property (nonatomic,assign) NSUInteger warmUpMins;
224
225/**
226 无氧运动阈值 | anaerobic threshold
227 */
228@property (nonatomic,assign) NSUInteger anaerobicThreshold;
229
230/**
231 无氧运动阈值 (单位 :分钟) | anaerobic mins
232 */
233@property (nonatomic,assign) NSUInteger anaerobicMins;
234
235/**
236 年份 | Year
237 */
238@property (nonatomic,assign) NSInteger year;
239
240/**
241 月份 | Month
242 */
243@property (nonatomic,assign) NSInteger month;
244
245/**
246 日期 | Date
247 */
248@property (nonatomic,assign) NSInteger day;
249
250/**
251 * 心率集合 只有定义好的查询方法才能转成model集合,自定义的查询方法无法直接转成model集合,需要再查询itemModel赋给当前属性
252 * Heart rate collection Only defined query methods can be converted into model collections. Custom query methods cannot be directly
253 * converted into model collections. You need to query itemModel to assign current attributes.
254 */
255@property (nonatomic,copy) NSArray <IDOSyncSecHrDataItemInfoBluetoothModel *>* heartRates;
256
257/**
258 * 5分钟间隔心率集合和总心率时长 | Heart rate set at 5-minute intervals and total heart rate duration
259 * @{@"total_offset":@(0),@"heart_rates":@[@{@"offset":@(0),@"value":@(0)}...]};
260 */
261@property (nonatomic,copy) NSDictionary * minutesHrDic;
262
263/**
264 时间戳 精确到日期 date interval since 1970 (如:1444361933) | Timestamp date interval since 1970 (eg: 14443361933)
265 */
266@property (nonatomic,copy) NSString * dateStr;
267
268@end
269
270
271@interface IDOSyncHeartRateDataModel : NSObject
272
273#pragma mark ======================== offset minunte ===============================
274/**
275 * @brief 查询当前设备某年12个月所有数据 (如果查询当月无数据,会创建空的数据对象,大于当月的数据不累加)
276 * Query all data of the current device for 12 months in a certain year (If there is no data in the query month, an empty data object will be created,
277 * and the data larger than the current month will not be accumulated)
278 * @param year 年 (如 : 2018) | Year (eg: 2018)
279 * @param macAddr mac 地址 | mac address
280 * @param isQuery 是否查询items | is query items
281 * @return 一年12个月的心率数据集合,其中IDOSyncHrDataInfoBluetoothModel对象是一天总心率数据模型
282 * Heart rate data collection for 12 months a year, where the IDOSyncHrDataInfoBluetoothModel object is the total heart rate data model for the day
283 */
284+ (NSArray <NSArray<__kindof IDOSyncHrDataInfoBluetoothModel *>*> *)queryOneYearHearRatesWithYear:(NSInteger)year
285 macAddr:(NSString *)macAddr
286 isQueryItems:(BOOL)isQuery;
287
288/**
289 * @brief 查询当前设备某月份的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
290 * Query all data of the current device for a certain month (If there is no data on the query day, an empty data object will be created,
291 * which is larger than the data of the day)
292 * @param year 年 (如 : 2018) | Year (eg: 2018)
293 * @param month 月 (如 : 9) | Month (eg: 9)
294 * @param macAddr mac 地址 | mac address
295 * @param dates 当前查询月份的所有日期集合的指针 (格式 :[10/01...10/31])
296 * Pointer to all date collections for the current query month (format: [10/01...10/31])
297 * @param isQuery 是否查询items | is query items
298 * @return 一个月的心率数据集合,其中IDOSyncHrDataInfoBluetoothModel对象是一天总心率数据模型
299 * A one-month heart rate data collection, where the IDOSyncHrDataInfoBluetoothModel object is the total heart rate data model for the day
300 */
301+ (NSArray <__kindof IDOSyncHrDataInfoBluetoothModel *>*)queryOneMonthHearRatesWithYear:(NSInteger)year
302 month:(NSInteger)month
303 macAddr:(NSString *)macAddr
304 datesOfMonth:(NSArray <NSString *>**)dates
305 isQueryItems:(BOOL)isQuery;
306
307/**
308 * @brief 查询当前设备某周的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
309 * Query all data of the current device for a certain week (If there is no data on the day of the query, an empty data object will be created,
310 * and the data larger than the current day will not be accumulated)
311 * @param weekIndex 周的查询索引 (0 : 当周, 1 : 上一周, 2 : 上两周 ...) | Week's query index (0: week, 1 : last week, 2 : last two weeks...)
312 * @param weekStartDay 星期的开始日 (0 : 星期日, 1 : 星期一, 2 : 星期二 ...) | Start of the week (0: Sunday, 1 : Monday, 2 : Tuesday ...)
313 * @param macAddr mac 地址 | mac address
314 * @param dates 当前查询周的所有日期集合的指针 (格式 :[10/01...10/07])
315 * Pointer to all date collections for the current query week (format: [10/01...10/07])
316 * @param isQuery 是否查询items | is query items
317 * @return 一周的心率数据集合,其中IDOSyncHrDataInfoBluetoothModel对象是一天总心率数据模型
318 * A week's heart rate data collection, where the IDOSyncHrDataInfoBluetoothModel object is the total heart rate data model for the day
319 */
320+ (NSArray <__kindof IDOSyncHrDataInfoBluetoothModel *>*)queryOneWeekHearRatesWithWeekIndex:(NSInteger)weekIndex
321 weekStartDay:(NSInteger)weekStartDay
322 macAddr:(NSString *)macAddr
323 datesOfWeek:(NSArray <NSString *>**)dates
324 isQueryItems:(BOOL)isQuery;
325
326/**
327 * @brief 查询当前设备某天心率数据并有详情数据 | Query current heart rate data of the current device and have detailed data
328 * @param macAddr mac 地址 | mac address
329 * @param year 年份 | year
330 * @param month 月份 | month
331 * @param day 日期 | day
332 * @return 一天心率数据的集合和详情数据集合 | Collection of day heart rate data and details data
333 */
334+ (NSArray<__kindof IDOSyncHrDataInfoBluetoothModel *> *)queryOneDayHearRatesDetailWithMac:(NSString *)macAddr
335 year:(NSInteger)year
336 month:(NSInteger)month
337 day:(NSInteger)day;
338
339/**
340 * @brief 查询所有心率数据 心率包个数大于0 | Query all heart rate data The number of heart rate packets is greater than 0
341 * @param macAddr mac 地址 | mac address
342 * @return 所有心率数据的集合 | Collection of all heart rate data and details data
343 */
344+ (NSArray <__kindof IDOSyncHrDataInfoBluetoothModel *>*)queryAllHearRatesWithMac:(NSString *)macAddr;
345
346
347/**
348 * @brief 查询所有心率数据 心率包个数大于0 只包含静心心率和日期时间戳
349 * Query all heart rate data The number of heart rate packets is greater than 0
350 * Contains only meditation heart rate and date and time stamp
351 * @param macAddr mac 地址 | mac address
352 * @return 所有心率数据的集合 | Collection of all heart rate data
353 */
354+ (NSArray <__kindof IDOSyncHrDataInfoBluetoothModel *>*)queryAllContractedHearRatesWithMac:(NSString *)macAddr;
355
356#pragma mark ======================== offset second ===============================
357
358/**
359 * @brief 查询当前设备某年12个月所有数据 (如果查询当月无数据,会创建空的数据对象,大于当月的数据不累加)
360 * Query all data of the current device for 12 months in a certain year (If there is no data in the query month, an empty data object will be created,
361 * and the data larger than the current month will not be accumulated)
362 * @param year 年 (如 : 2018) | Year (eg: 2018)
363 * @param macAddr mac 地址 | mac address
364 * @param isQuery 是否查询items | is query items
365 * @return 一年12个月的秒钟心率数据集合,其中IDOSyncSecHrDataInfoBluetoothModel对象是一天总心率数据模型
366 * second heart rate data collection for 12 months a year, where the IDOSyncSecHrDataInfoBluetoothModel object is the total heart rate data model for the day
367 */
368+ (NSArray <NSArray<__kindof IDOSyncSecHrDataInfoBluetoothModel *>*> *)queryOneYearSecHearRatesWithYear:(NSInteger)year
369 macAddr:(NSString *)macAddr
370 isQueryItems:(BOOL)isQuery;
371
372/**
373 * @brief 查询当前设备某月份的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
374 * Query all data of the current device for a certain month (If there is no data on the query day, an empty data object will be created,
375 * which is larger than the data of the day)
376 * @param year 年 (如 : 2018) | Year (eg: 2018)
377 * @param month 月 (如 : 9) | Month (eg: 9)
378 * @param macAddr mac 地址 | mac address
379 * @param dates 当前查询月份的所有日期集合的指针 (格式 :[10/01...10/31])
380 * Pointer to all date collections for the current query month (format: [10/01...10/31])
381 * @param isQuery 是否查询items | is query items
382 * @return 一个月的秒钟心率数据集合,其中IDOSyncSecHrDataInfoBluetoothModel对象是一天总心率数据模型
383 * one-month second heart rate data collection, where the IDOSyncSecHrDataInfoBluetoothModel object is the total heart rate data model for the day
384 */
385+ (NSArray <__kindof IDOSyncSecHrDataInfoBluetoothModel *>*)queryOneMonthSecHearRatesWithYear:(NSInteger)year
386 month:(NSInteger)month
387 macAddr:(NSString *)macAddr
388 datesOfMonth:(NSArray <NSString *>**)dates
389 isQueryItems:(BOOL)isQuery;
390
391/**
392 * @brief 查询当前设备某周的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
393 * Query all data of the current device for a certain week (If there is no data on the day of the query, an empty data object will be created,
394 * and the data larger than the current day will not be accumulated)
395 * @param weekIndex 周的查询索引 (0 : 当周, 1 : 上一周, 2 : 上两周 ...) | Week's query index (0: week, 1 : last week, 2 : last two weeks...)
396 * @param weekStartDay 星期的开始日 (0 : 星期日, 1 : 星期一, 2 : 星期二 ...) | Start of the week (0: Sunday, 1 : Monday, 2 : Tuesday ...)
397 * @param macAddr mac 地址 | mac address
398 * @param dates 当前查询周的所有日期集合的指针 (格式 :[10/01...10/07])
399 * Pointer to all date collections for the current query week (format: [10/01...10/07])
400 * @param isQuery 是否查询items | is query items
401 * @return 一周的秒钟心率数据集合,其中IDOSyncSecHrDataInfoBluetoothModel对象是一天总心率数据模型
402 * one week second heart rate data collection, where the IDOSyncSecHrDataInfoBluetoothModel object is the total heart rate data model for the day
403 */
404+ (NSArray <__kindof IDOSyncSecHrDataInfoBluetoothModel *>*)queryOneWeekSecHearRatesWithWeekIndex:(NSInteger)weekIndex
405 weekStartDay:(NSInteger)weekStartDay
406 macAddr:(NSString *)macAddr
407 datesOfWeek:(NSArray <NSString *>**)dates
408 isQueryItems:(BOOL)isQuery;
409
410/**
411 * @brief 查询当前设备某天秒钟心率数据并有详情数据 | Query current day second heart rate data of the current device and have detailed data
412 * @param macAddr mac 地址 | mac address
413 * @param year 年份 | year
414 * @param month 月份 | month
415 * @param day 日期 | day
416 * @param isQuery 是否查询items | is query items
417 * @return 一天秒钟心率数据的集合和详情数据集合 | Collection of day second heart rate data and details data
418 */
419+ (NSArray<__kindof IDOSyncSecHrDataInfoBluetoothModel *> *)queryOneDaySecHearRatesDetailWithMac:(NSString *)macAddr
420 year:(NSInteger)year
421 month:(NSInteger)month
422 day:(NSInteger)day
423 isQueryItems:(BOOL)isQuery;
424
425/**
426 * @brief 查询所有秒钟心率数据 心率包个数大于0 | Query all second heart rate data The number of heart rate packets is greater than 0
427 * @param macAddr mac 地址 | mac address
428 * @return 所有秒钟心率数据的集合 | Collection of all second heart rate data and details data
429 */
430+ (NSArray <__kindof IDOSyncSecHrDataInfoBluetoothModel *>*)queryAllSecHearRatesWithMac:(NSString *)macAddr;
431
432/**
433 * @brief 查询所有秒钟心率数据 心率包个数大于0 只包含静心心率和日期时间戳
434 * Query all second heart rate data The number of heart rate packets is greater than 0
435 * Contains only meditation heart rate and date and time stamp
436 * @param macAddr mac 地址 | mac address
437 * @return 所有心率数据的集合 | Collection of all heart rate data
438 */
439+ (NSArray <__kindof IDOSyncSecHrDataInfoBluetoothModel *>*)queryAllContractedSecHearRatesWithMac:(NSString *)macAddr;
440
441@end
442
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncManager.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncManager.h
new file mode 100755
index 0000000..7911ce7
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncManager.h
@@ -0,0 +1,161 @@
1//
2// IDOSyncManager.h
3// VeryfitSDK
4//
5// Created by hedongyang on 2018/5/25.
6// Copyright © 2018年 hedongyang. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
11#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
12#else
13#import "IDOSyncEnum.h"
14#endif
15
16@interface IDOSyncManager : NSObject
17
18/**
19 * 当前连接设备是否正在同步,⚠️配置同步不纳入正在同步中,其他(步数、心率、血压、睡眠、血氧、压力、活动、gps、游泳)数据同步纳入其中
20 * Whether the currently connected device is synchronizing, ⚠️ configuration synchronization is not included in the synchronization,
21 * and other (step, heart rate, blood pressure, sleep, activity, gps、swim) data synchronization is included.
22 */
23@property (nonatomic,assign,readonly) BOOL isSyncHealthRun;
24
25/**
26 * 当前连接设备是否在同步配置信息
27 * Is the currently connected device synchronizing configuration information?
28 */
29@property (nonatomic,assign,readonly) BOOL isSyncConfigRun;
30
31/**
32 * 当前连接设备是否需要同步配置
33 * Does the current connected device require synchronization configuration?
34 */
35@property (nonatomic,assign,readonly) BOOL isNeedSyncConfig;
36
37/**
38 * 设置需要同步的选项(同步配置、同步健康、同步活动、同步GPS)
39 * Set the options that need to be synchronized (sync config、sync health、sync activity、sync GPS)
40 */
41@property (nonatomic,assign) IDO_WANT_TO_SYNC_ITEM_TYPE wantToSyncType;
42
43/**
44 * 同步的数据是否存入SDK数据库中,默认YES
45 * Whether the synchronized data is stored in the SDK database, the default is YES
46 */
47@property (nonatomic,assign) BOOL isSave;
48
49/**
50 * 同步的数据超时时长,默认 60秒
51 * Synchronous data timeout duration, default 60 seconds
52 */
53@property (nonatomic,assign) NSInteger syncTimeout;
54
55/**
56 * 同步配置日志回调
57 * Synchronize configuration log callback
58 */
59@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncConfig)(void(^ _Nullable configLogCallback)(NSString * _Nullable logStr));
60
61/**
62 * 同步健康心率数据回调
63 * Synchronize healthy heart rate data callback
64 */
65@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncHeartRate)(void(^ _Nullable heartRateDataCallback)(NSString * _Nullable jsonStr));
66
67/**
68 * 同步健康睡眠数据回调
69 * Synchronize healthy sleep data callback
70 */
71@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncSleep)(void(^ _Nullable sleepDataCallback)(NSString * _Nullable jsonStr));
72
73/**
74 * 同步健康步数数据回调
75 * Synchronize health step data callback
76 */
77@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncSport)(void(^ _Nullable sportDataCallback)(NSString * _Nullable jsonStr));
78
79/**
80 * 同步健康血压数据回调
81 * Synchronize healthy blood pressure data callback
82 */
83@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncBp)(void(^ _Nullable bpDataCallback)(NSString * _Nullable jsonStr));
84
85/**
86 * 同步活动数据回调
87 * Synchronize active data callbacks
88 */
89@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncActivity)(void(^ _Nullable activityDataCallback)(NSString * _Nullable jsonStr));
90
91/**
92 * 同步gps数据回调
93 * Synchronize GPS data callbacks
94 */
95@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncGps)(void(^ _Nullable gpsDataCallback)(NSString * _Nullable jsonStr));
96
97/**
98 * 同步游泳数据回调
99 * Synchronize swim data callback
100 */
101@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncSwim)(void(^ _Nullable swimCallback)(NSString * _Nullable jsonStr));
102
103/**
104 * 同步健康血氧数据回调
105 * Synchronize healthy blood oxygen data callback
106 */
107@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncBloodOxygen)(void(^ _Nullable bloodOxygenDataCallback)(NSString * _Nullable jsonStr));
108
109/**
110 * 同步压力数据回调
111 * Synchronize pressure data callback
112 */
113@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncPressure)(void(^ _Nullable pressureCallback)(NSString * _Nullable jsonStr));
114
115/**
116 * 同步统一进度回调
117 * Synchronize unified progress callback
118 */
119@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncProgess)(void(^ _Nullable syncProgessCallback)(IDO_CURRENT_SYNC_TYPE type,float progress));
120
121/**
122 * 同步完成回调
123 * Synchronize completes the callback
124 */
125@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncComplete)(void(^ _Nullable syncCompleteCallback)(IDO_SYNC_COMPLETE_STATUS stateCode));
126
127/**
128 * 同步失败回调 如: 超时、断线、OTA
129 * Synchronize failed callback eg: timeout, disconnect, OTA
130 */
131@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^addSyncFailed)(void(^ _Nullable syncFailedCallback)(int errorCode));
132
133/**
134 * 删除当天数据回调
135 * Delete current day data callback
136 */
137@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^deleteCurrentDayData)(void(^ _Nullable deleteCallback)(BOOL success));
138
139/**
140 * 强制执行或不执行同步配置
141 * Enforce or not enforce the synchronize configuration
142 */
143@property (nonatomic,copy,nullable) IDOSyncManager *_Nonnull(^mandatorySyncConfig)(BOOL isSync);
144
145/**
146 * 初始化同步单例对象
147 * init sync manager
148 */
149IDOSyncManager * _Nonnull initSyncManager(void);
150
151/**
152 开始同步 | Start sync
153 */
154+ (void)startSync;
155
156/**
157 结束同步 | End sync
158 */
159+ (void)stopSync;
160
161@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncPressureDataModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncPressureDataModel.h
new file mode 100755
index 0000000..c6301aa
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncPressureDataModel.h
@@ -0,0 +1,158 @@
1//
2// IDOSyncPressureDataModel.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/6.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
11#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
12#else
13#import "IDOBluetoothBaseModel.h"
14#endif
15
16@interface IDOSyncPressureItemInfoBluetoothModel : IDOBluetoothBaseModel
17
18/**
19 日期 精确到日期 date interval since 1970 (如:1444361933) | Date time interval since 1970 (eg 14442361933)
20 */
21@property (nonatomic,copy) NSString * dateStr;
22
23/**
24 子时间偏移量 (分钟) | Subtime offset (minutes)
25 */
26@property (nonatomic,assign) NSUInteger offset;
27
28/**
29 压力值 | pressure value 0 ~ 255
30 */
31@property (nonatomic,assign) NSInteger pressureVal;
32
33/**
34 序列号 | Serial number
35 */
36@property (nonatomic,assign) NSInteger serialNumber;
37
38@end
39
40@interface IDOSyncPressureDataInfoBluetoothModel : IDOBluetoothBaseModel
41
42/**
43 年份 | Year
44 */
45@property (nonatomic,assign) NSInteger year;
46
47/**
48 月份 | Month
49 */
50@property (nonatomic,assign) NSInteger month;
51
52/**
53 日期 | Date
54 */
55@property (nonatomic,assign) NSInteger day;
56
57/**
58 日期 精确到日期 date interval since 1970 (如:1444361933) | Date time interval since 1970 (eg 14442361933)
59 */
60@property (nonatomic,copy) NSString * dateStr;
61
62/**
63 总时间偏移量 (分钟) | Total time offset (minutes)
64 */
65@property (nonatomic,assign) NSUInteger minuteOffset;
66
67/**
68 压力数据包量 | Pressure data package
69 */
70@property (nonatomic,assign) NSInteger itemsCount;
71
72/**
73 * @brief 压力集合 只有定义好的查询方法才能转成model集合,自定义的查询方法无法直接转成model集合,需要再查询itemModel赋给当前属性
74 * pressure collection Only defined query methods can be converted into model collections. Custom query methods cannot be directly converted
75 * into model collections. You need to query itemModel to assign current attributes.
76 */
77@property (nonatomic,copy) NSArray <IDOSyncPressureItemInfoBluetoothModel *>* pressures;
78
79@end
80
81@interface IDOSyncPressureDataModel : NSObject
82/**
83 * @brief 查询当前设备某年12个月所有数据 (如果查询当月无数据,会创建空的数据对象,大于当月的数据不累加)
84 * Query all data of the current device for 12 months in a certain year (If there is no data in the query month, an empty data object will be created,
85 * and the data larger than the current month will not be accumulated)
86 * @param year 年 (如 : 2018) | Year (eg: 2018)
87 * @param macAddr mac 地址 | mac address
88 * @param isQuery 是否查询items | is query items
89 * @return 一年12个月的压力数据集合,其中IDOSyncPressureDataInfoBluetoothModel对象是一天总血氧数据模型
90 * pressure data collection for 12 months a year, where the IDOSyncPressureDataInfoBluetoothModel object is the total pressure data model for the day
91 */
92+ (NSArray <NSArray<__kindof IDOSyncPressureDataInfoBluetoothModel *>*> *)queryOneYearPressureWithYear:(NSInteger)year
93 macAddr:(NSString *)macAddr
94 isQueryItems:(BOOL)isQuery;
95
96/**
97 * @brief 查询当前设备某月份的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
98 * Query all data of the current device for a certain month (If there is no data on the query day, an empty data object will be created,
99 * which is larger than the data of the day)
100 * @param year 年 (如 : 2018) | Year (eg: 2018)
101 * @param month 月 (如 : 9) | Month (eg: 9)
102 * @param macAddr mac 地址 | mac address
103 * @param dates 当前查询月份的所有日期集合的指针 (格式 :[10/01...10/31])
104 * Pointer to all date collections for the current query month (format: [10/01...10/31])
105 * @param isQuery 是否查询items | is query items
106 * @return 一个月的压力数据集合,其中IDOSyncPressureDataInfoBluetoothModel对象是一天总压力数据模型
107 * A one-month pressure data collection, where the IDOSyncPressureDataInfoBluetoothModel object is the total pressure data model for the day
108 */
109+ (NSArray <__kindof IDOSyncPressureDataInfoBluetoothModel *>*)queryOneMonthPressureWithYear:(NSInteger)year
110 month:(NSInteger)month
111 macAddr:(NSString *)macAddr
112 datesOfMonth:(NSArray <NSString *>**)dates
113 isQueryItems:(BOOL)isQuery;
114
115/**
116 * @brief 查询当前设备某周的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
117 * Query all data of the current device for a certain week (If there is no data on the day of the query, an empty data object will be created,
118 * and the data larger than the current day will not be accumulated)
119 * @param weekIndex 周的查询索引 (0 : 当周, 1 : 上一周, 2 : 上两周 ...) | Week's query index (0: week, 1 : last week, 2 : last two weeks...)
120 * @param weekStartDay 星期的开始日 (0 : 星期日, 1 : 星期一, 2 : 星期二 ...) | Start of the week (0: Sunday, 1 : Monday, 2 : Tuesday ...)
121 * @param macAddr mac 地址 | mac address
122 * @param dates 当前查询周的所有日期集合的指针 (格式 :[10/01...10/07])
123 * Pointer to all date collections for the current query week (format: [10/01...10/07])
124 * @param isQuery 是否查询items | is query items
125 * @return 一周的压力数据集合,其中IDOSyncPressureDataInfoBluetoothModel对象是一天总压力数据模型
126 * A week's pressure data collection, where the IDOSyncPressureDataInfoBluetoothModel object is the total pressure data model for the day
127 */
128+ (NSArray <__kindof IDOSyncPressureDataInfoBluetoothModel *>*)queryOneWeekPressureWithWeekIndex:(NSInteger)weekIndex
129 weekStartDay:(NSInteger)weekStartDay
130 macAddr:(NSString *)macAddr
131 datesOfWeek:(NSArray <NSString *>**)dates
132 isQueryItems:(BOOL)isQuery;
133
134/**
135 * @brief 查询当前设备某天压力数据并有详情数据
136 * Query current pressure data of the current device and have detailed data
137 * @param macAddr mac 地址 | mac address
138 * @param year 年份 | year
139 * @param month 月份 | month
140 * @param day 日期 | day
141 * @return 一天压力数据的集合和详情数据集合 | Collection of day pressure data and details data
142 */
143+ (NSArray <__kindof IDOSyncPressureDataInfoBluetoothModel *>*)queryOneDayPressureDetailWithMac:(NSString *)macAddr
144 Year:(NSInteger)year
145 month:(NSInteger)month
146 day:(NSInteger)day;
147
148/**
149 * @brief 查询所有压力数据,压力包个数大于0
150 * Query all pressure data The number of pressure packets is greater than 0
151 * @param macAddr mac地址 | mac address
152 * @return 所有压力数据的集合和详情数据(不包括当天数据)
153 * Collection of all pressure data and details data(Data for the day are not included)
154 */
155+ (NSArray <__kindof IDOSyncPressureDataInfoBluetoothModel *>*)queryAllPressuresWithMac:(NSString *)macAddr;
156
157@end
158
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSleepDataModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSleepDataModel.h
new file mode 100755
index 0000000..608df6b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSleepDataModel.h
@@ -0,0 +1,224 @@
1//
2// IDOSyncSleepDataModel.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/6.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
11#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
12#else
13#import "IDOBluetoothBaseModel.h"
14#endif
15
16@interface IDOSyncSleepDataItemInfoBluetoothModel : IDOBluetoothBaseModel
17
18/**
19 * 睡眠状态 睡眠状态(0x01: 醒着, 0x02:浅睡, 0x03:深睡)
20 * Sleep state Sleep state (0x01: awake, 0x02: light sleep, 0x03: deep sleep)
21 */
22@property (nonatomic,assign) NSInteger sleepStatus;
23
24/**
25 持续时间 | Duration
26 */
27@property (nonatomic,assign) NSInteger durations;
28
29/**
30 时间戳 精确到日期 date interval since 1970 (如:1444361933) | Timestamp date interval since 1970 (eg: 14443361933)
31 */
32@property (nonatomic,copy) NSString * dateStr;
33
34/**
35 时间戳 精确到分钟 start time interval since 1970 (如:1444361933) | Timestamp minute interval since 1970 (eg: 14443361933)
36 */
37@property (nonatomic,copy) NSString * startTimeStr;
38
39/**
40 序列号 | Serial number
41 */
42@property (nonatomic,assign) NSInteger serialNumber;
43
44@end
45
46@interface IDOSyncSleepDataInfoBluetoothModel : IDOBluetoothBaseModel
47
48/**
49 睡眠数据包数量 | Number of sleep packets
50 */
51@property (nonatomic,assign) NSInteger itemsCount;
52
53/**
54 睡眠结束时钟 | End of sleep clock
55 */
56@property (nonatomic,assign) NSInteger endHour;
57
58/**
59 睡眠结束分钟 | End of sleep minutes
60 */
61@property (nonatomic,assign) NSInteger endMinute;
62
63/**
64 总睡眠时长 (单位 :分钟) | Total sleep duration (unit: minute)
65 */
66@property (nonatomic,assign) NSInteger totalMinute;
67
68/**
69 浅睡眠次数 | Light sleep times
70 */
71@property (nonatomic,assign) NSInteger lightSleepCount;
72
73/**
74 深睡眠次数 | Deep sleep times
75 */
76@property (nonatomic,assign) NSInteger deepSleepCount;
77
78/**
79 醒来次数 | Wake up times
80 */
81@property (nonatomic,assign) NSInteger wakeCount;
82
83/**
84 醒来时长 | Wake up Duration
85 */
86@property (nonatomic,assign) NSInteger wakeMinute;
87
88/**
89 浅睡眠时长 | Light sleep duration
90 */
91@property (nonatomic,assign) NSInteger lightSleepMinute;
92
93/**
94 深睡眠时长 | Deep sleep duration
95 */
96@property (nonatomic,assign) NSInteger deepSleepMinute;
97
98/**
99 目标睡眠时长 (单位 : 分钟) | Target sleep duration (unit: minute)
100 */
101@property (nonatomic,assign) NSInteger goalSleepData;
102
103/**
104 * 睡眠数据集合 只有定义好的查询方法才能转成model集合,自定义的查询方法无法直接转成model集合,需要再查询itemModel赋给当前属性
105 * Sleep data collection Only defined query methods can be converted into model collections. Custom query methods cannot be directly converted
106 * into model collections. You need to query itemModel to assign current attributes.
107 */
108@property (nonatomic,copy) NSArray <IDOSyncSleepDataItemInfoBluetoothModel *> * sleepItems;
109
110/**
111 年份 | Year
112 */
113@property (nonatomic,assign) NSInteger year;
114
115/**
116 月份 | Month
117 */
118@property (nonatomic,assign) NSInteger month;
119
120/**
121 日期 | Date
122 */
123@property (nonatomic,assign) NSInteger day;
124
125/**
126 时间戳 精确到日期 date interval since 1970 (如:1444361933) | Timestamp date interval since 1970 (eg: 14443361933)
127 */
128@property (nonatomic,copy) NSString * dateStr;
129
130/**
131 时间戳 精确到分钟 start time interval since 1970 (如:1444361933) | Timestamp minute interval since 1970 (eg: 14443361933)
132 */
133@property (nonatomic,copy) NSString * startTimeStr;
134
135/**
136 睡眠评分 | sleep score (1-100)
137 */
138@property (nonatomic,assign) NSInteger sleepScore;
139
140@end
141
142@interface IDOSyncSleepDataModel : NSObject
143/**
144 * @brief 查询当前设备某年12个月所有数据 (如果查询当月无数据,会创建空的数据对象,大于当月的数据不累加)
145 * Query all data of the current device for 12 months in a certain year (If there is no data in the current month, an empty data object will be created,
146 * and the data larger than the current month will not be accumulated)
147 * @param year 年 (如 : 2018) | Year (eg: 2018)
148 * @param macAddr mac 地址 | mac address
149 * @param isQuery 是否查询items | is query items
150 * @return 一年12个月的睡眠数据集合,其中IDOSyncSleepDataInfoBluetoothModel对象是一天总睡眠数据模型
151 * 12 months of sleep data collection, IDOSyncSleepDataInfoBluetoothModel object is the total day sleep data model
152 */
153+ (NSArray <NSArray <__kindof IDOSyncSleepDataInfoBluetoothModel *>*>*)queryOneYearSleepsWithYear:(NSInteger)year
154 macAddr:(NSString *)macAddr
155 isQueryItems:(BOOL)isQuery;
156
157/**
158 * @brief 查询当前设备某月份的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
159 * Query all data of the current device for a certain month (If there is no data on the query day, an empty data object will be created,
160 * which is larger than the data of the day)
161 * @param year 年 (如 : 2018) | year year (eg 2018)
162 * @param month 月 (如 : 9) | Month (eg: 9)
163 * @param macAddr mac 地址 | mac address
164 * @param dates 当前查询月份的所有日期集合的指针 (格式 :[10/01...10/31])
165 * Pointer to all date collections for the current query month (format: [10/01...10/31])
166 * @param isQuery 是否查询items | is query items
167 * @return 一个月的睡眠数据集合,其中IDOSyncSleepDataInfoBluetoothModel对象是一天总睡眠数据模型
168 * A one-month sleep data collection, where the IDOSyncSleepDataInfoBluetoothModel object is the total day sleep data model
169 */
170+ (NSArray <__kindof IDOSyncSleepDataInfoBluetoothModel *>*)queryOneMonthSleepsWithYear:(NSInteger)year
171 month:(NSInteger)month
172 macAddr:(NSString *)macAddr
173 datesOfMonth:(NSArray <NSString *>**)dates
174 isQueryItems:(BOOL)isQuery;
175
176/**
177 * @brief 查询当前设备某周的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
178 * Query all data of the current device for a certain week (If there is no data on the day of the query, an empty data object will be created,
179 * and the data larger than the current day will not be accumulated)
180 * @param weekIndex 周的查询索引 (0 : 当周, 1 : 上一周, 2 : 上两周 ...) | Week's query index (0: week, 1 : last week, 2 : last two weeks...)
181 * @param weekStartDay 星期的开始日 (0 : 星期日, 1 : 星期一, 2 : 星期二 ...) | Start of the week (0: Sunday, 1 : Monday, 2 : Tuesday ...)
182 * @param macAddr mac 地址 | mac address
183 * @param dates 当前查询周的所有日期集合的指针 (格式 :[10/01...10/07]) | Pointer to all date collections for the current query week (format: [10/01...10/07])
184 * @param isQuery 是否查询items | is query items
185 * @return 一周的睡眠数据集合,其中IDOSyncSleepDataInfoBluetoothModel对象是一天总睡眠数据模型
186 * A week's sleep data collection, where the IDOSyncSleepDataInfoBluetoothModel object is the total day sleep data model
187 */
188+ (NSArray <__kindof IDOSyncSleepDataInfoBluetoothModel *>*)queryOneWeekSleepsWithWeekIndex:(NSInteger)weekIndex
189 weekStartDay:(NSInteger)weekStartDay
190 macAddr:(NSString *)macAddr
191 datesOfWeek:(NSArray <NSString *>**)dates
192 isQueryItems:(BOOL)isQuery;
193
194/**
195 * @brief 查询当前设备某天睡眠数据并有详情数据 | Query the current device's sleep data and have detailed data
196 * @param macAddr mac 地址 | mac address
197 * @param year 年份 | year
198 * @param month 月份 | month
199 * @param day 日期 | day
200 * @return 一天睡眠数据的集合和详情数据集合 | Collection of daily sleep data and detailed data
201 */
202+ (NSArray <__kindof IDOSyncSleepDataInfoBluetoothModel *>*)queryOneDaySleepsDetailWithMac:(NSString *)macAddr
203 year:(NSInteger)year
204 month:(NSInteger)month
205 day:(NSInteger)day;
206
207/**
208 * @brief 查询所有睡眠数据 睡眠时长大于0 | Query all sleep data Sleep duration is greater than 0
209 * @param macAddr mac 地址 | mac address
210 * @return 所有睡眠数据的集合 | Collection and details of all sleep data
211 */
212+ (NSArray <__kindof IDOSyncSleepDataInfoBluetoothModel *>*)queryAllSleepsWithMac:(NSString *)macAddr;
213
214
215/**
216 * @brief 查询所有睡眠数据 睡眠时长大于0 只包含睡眠总时长和日期时间戳
217 * Query all sleep data Sleep duration is greater than 0 Just the total amount of sleep and the date and timestamp
218 * @param macAddr mac 地址 | mac address
219 * @return 所有睡眠数据的集合 | Collection of all sleep data
220 */
221+ (NSArray <__kindof IDOSyncSleepDataInfoBluetoothModel *>*)queryAllContractedSleepsWithMac:(NSString *)macAddr;
222
223@end
224
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSpo2DataModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSpo2DataModel.h
new file mode 100755
index 0000000..ec06a91
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSpo2DataModel.h
@@ -0,0 +1,175 @@
1//
2// IDOSyncSpo2DataModel.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/6.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
11#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
12#else
13#import "IDOBluetoothBaseModel.h"
14#endif
15
16@interface IDOSyncBloodOxygenItemInfoBluetoothModel : IDOBluetoothBaseModel
17
18/**
19 日期 time interval since 1970 (如:1444361933) | Date time interval since 1970 (eg 14442361933)
20 */
21@property (nonatomic,copy) NSString * dateStr;
22
23/**
24 子时间偏移量 (秒钟) | Subtime offset (second)
25 */
26@property (nonatomic,assign) NSUInteger offset;
27
28/**
29 血氧值 | Blood oxygen value 0 ~ 255
30 */
31@property (nonatomic,assign) NSInteger spo2Val;
32
33/**
34 序列号 | Serial number
35 */
36@property (nonatomic,assign) NSInteger serialNumber;
37
38@end
39
40@interface IDOSyncBloodOxygenDataInfoBluetoothModel : IDOBluetoothBaseModel
41
42/**
43 年份 | Year
44 */
45@property (nonatomic,assign) NSInteger year;
46
47/**
48 月份 | Month
49 */
50@property (nonatomic,assign) NSInteger month;
51
52/**
53 日期 | Date
54 */
55@property (nonatomic,assign) NSInteger day;
56
57/**
58 日期 精确到日期 date interval since 1970 (如:1444361933) | Date time interval since 1970 (eg 14442361933)
59 */
60@property (nonatomic,copy) NSString * dateStr;
61
62/**
63 总时间偏移量 (秒钟) | Total time offset (second)
64 */
65@property (nonatomic,assign) NSUInteger minuteOffset;
66
67/**
68 血氧数据包量 | Blood pressure data package
69 */
70@property (nonatomic,assign) NSInteger itemsCount;
71
72/**
73 * 血氧集合 只有定义好的查询方法才能转成model集合,自定义的查询方法无法直接转成model集合,需要再查询itemModel赋给当前属性
74 * blood oxygen collection Only defined query methods can be converted into model collections. Custom query methods cannot be directly converted
75 * into model collections. You need to query itemModel to assign current attributes.
76 */
77@property (nonatomic,copy) NSArray <IDOSyncBloodOxygenItemInfoBluetoothModel *>* bloodOxygens;
78
79/**
80 平均血氧 | Average blood oxygen
81 */
82@property (nonatomic,assign) NSInteger avgBloodOxygen;
83
84/**
85 最大血氧 | Maximum blood oxygen
86 */
87@property (nonatomic,assign) NSInteger maxBloodOxygen;
88
89/**
90 最小血氧 | Most blood oxygen
91 */
92@property (nonatomic,assign) NSInteger minBloodOxygen;
93
94@end
95
96
97@interface IDOSyncSpo2DataModel : NSObject
98/**
99 * @brief 查询当前设备某年12个月所有数据 (如果查询当月无数据,会创建空的数据对象,大于当月的数据不累加)
100 * Query all data of the current device for 12 months in a certain year (If there is no data in the query month, an empty data object will be created,
101 * and the data larger than the current month will not be accumulated)
102 * @param year 年 (如 : 2018) | Year (eg: 2018)
103 * @param macAddr mac 地址 | mac address
104 * @param isQuery 是否查询items | is query items
105 * @return 一年12个月的血氧数据集合,其中IDOSyncBloodOxygenDataInfoBluetoothModel对象是一天总血氧数据模型
106 * Blood oxygen data collection for 12 months a year, where the IDOSyncBloodOxygenDataInfoBluetoothModel object is the total blood oxygen data model for the day
107 */
108+ (NSArray <NSArray<__kindof IDOSyncBloodOxygenDataInfoBluetoothModel *>*> *)queryOneYearBloodOxygenWithYear:(NSInteger)year
109 macAddr:(NSString *)macAddr
110 isQueryItems:(BOOL)isQuery;
111
112/**
113 * @brief 查询当前设备某月份的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
114 * Query all data of the current device for a certain month (If there is no data on the query day, an empty data object will be created,
115 * which is larger than the data of the day)
116 * @param year 年 (如 : 2018) | Year (eg: 2018)
117 * @param month 月 (如 : 9) | Month (eg: 9)
118 * @param macAddr mac 地址 | mac address
119 * @param dates 当前查询月份的所有日期集合的指针 (格式 :[10/01...10/31])
120 * Pointer to all date collections for the current query month (format: [10/01...10/31])
121 * @param isQuery 是否查询items | is query items
122 * @return 一个月的血氧数据集合,其中IDOSyncBloodOxygenDataInfoBluetoothModel对象是一天总血氧数据模型
123 * A one-month blood oxygen data collection, where the IDOSyncHrDataInfoBluetoothModel object is the total blood oxygen data model for the day
124 */
125+ (NSArray <__kindof IDOSyncBloodOxygenDataInfoBluetoothModel *>*)queryOneMonthBloodOxygenWithYear:(NSInteger)year
126 month:(NSInteger)month
127 macAddr:(NSString *)macAddr
128 datesOfMonth:(NSArray <NSString *>**)dates
129 isQueryItems:(BOOL)isQuery;
130
131/**
132 * @brief 查询当前设备某周的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
133 * Query all data of the current device for a certain week (If there is no data on the day of the query, an empty data object will be created,
134 * and the data larger than the current day will not be accumulated)
135 * @param weekIndex 周的查询索引 (0 : 当周, 1 : 上一周, 2 : 上两周 ...) | Week's query index (0: week, 1 : last week, 2 : last two weeks...)
136 * @param weekStartDay 星期的开始日 (0 : 星期日, 1 : 星期一, 2 : 星期二 ...) | Start of the week (0: Sunday, 1 : Monday, 2 : Tuesday ...)
137 * @param macAddr mac 地址 | mac address
138 * @param dates 当前查询周的所有日期集合的指针 (格式 :[10/01...10/07])
139 * Pointer to all date collections for the current query week (format: [10/01...10/07])
140 * @param isQuery 是否查询items | is query items
141 * @return 一周的血氧数据集合,其中IDOSyncBloodOxygenDataInfoBluetoothModel对象是一天总血氧数据模型
142 * A week's blood oxygen data collection, where the IDOSyncBloodOxygenDataInfoBluetoothModel object is the total blood oxygen data model for the day
143 */
144+ (NSArray <__kindof IDOSyncBloodOxygenDataInfoBluetoothModel *>*)queryOneWeekBloodOxygenWithWeekIndex:(NSInteger)weekIndex
145 weekStartDay:(NSInteger)weekStartDay
146 macAddr:(NSString *)macAddr
147 datesOfWeek:(NSArray <NSString *>**)dates
148 isQueryItems:(BOOL)isQuery;
149
150/**
151 * @brief 查询当前设备某天血氧数据并有详情数据
152 * Query current blood oxygen data of the current device and have detailed data
153 * @param macAddr mac 地址 | mac address
154 * @param year 年份 | year
155 * @param month 月份 | month
156 * @param day 日期 | day
157 * @return 一天血氧数据的集合和详情数据结合 | Collection of day blood oxygen data and details data
158 */
159+ (NSArray <__kindof IDOSyncBloodOxygenDataInfoBluetoothModel *>*)queryOneDayBloodOxygenDetailWithMac:(NSString *)macAddr
160 year:(NSInteger)year
161 month:(NSInteger)month
162 day:(NSInteger)day;
163
164/**
165 * @brief 查询所有血氧数据,血氧包个数大于0
166 * Query all blood oxygen data The number of blood oxygen packets is greater than 0
167 * @param macAddr mac地址 | mac address
168 * @return 所有血氧数据的集合和详情数据(不包括当天数据)
169 * Collection of all blood oxygen data and details data
170 */
171+ (NSArray <__kindof IDOSyncBloodOxygenDataInfoBluetoothModel *>*)queryAllBloodOxygensWithMac:(NSString *)macAddr;
172
173
174@end
175
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSportDataModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSportDataModel.h
new file mode 100755
index 0000000..5db27b8
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSportDataModel.h
@@ -0,0 +1,221 @@
1//
2// IDOSyncSportDataModel.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/6.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
11#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
12#else
13#import "IDOBluetoothBaseModel.h"
14#endif
15
16@interface IDOSyncSportDataItemInfoBluetoothModel : IDOBluetoothBaseModel
17
18/**
19 运动模式 | Sports mode (unit: number of steps)
20 */
21@property (nonatomic,assign) NSInteger mode;
22
23/**
24 运动步数 | Number of steps
25 */
26@property (nonatomic,assign) NSInteger sportCount;
27
28/**
29 活跃时间 (秒) | Active time (seconds)
30 */
31@property (nonatomic,assign) NSInteger activeTime;
32
33/**
34 卡路里(大卡) | Calories (unit: big card)
35 */
36@property (nonatomic,assign) NSInteger calories;
37
38/**
39 运动距离(米) | Sport distance (unit: m)
40 */
41@property (nonatomic,assign) NSInteger distance;
42
43/**
44 运动时间日期 精确到日期 | Sports time and date
45 */
46@property (nonatomic,copy) NSString * dateStr;
47
48/**
49 序列号 | Serial number
50 */
51@property (nonatomic,assign) NSInteger serialNumber;
52
53@end
54
55@interface IDOSyncSportDataInfoBluetoothModel : IDOBluetoothBaseModel
56
57/**
58 运动数据包数量 | Number of sports packets
59 */
60@property (nonatomic,assign) NSInteger itemsCount;
61
62/**
63 年份 | Year
64 */
65@property (nonatomic,assign) NSInteger year;
66
67/**
68 月份 | Month
69 */
70@property (nonatomic,assign) NSInteger month;
71
72/**
73 日期 | Date
74 */
75@property (nonatomic,assign) NSInteger day;
76
77/**
78 时间戳 精确到日期 date interval since 1970 (如:1444361933) | Timestamp date interval since 1970 (eg: 14443361933)
79 */
80@property (nonatomic,copy) NSString * dateStr;
81
82/**
83 * 运动数据集合 只有定义好的查询方法才能转成model集合,自定义的查询方法无法直接转成model集合,需要再查询itemModel赋给当前属性
84 * Motion data collection Only defined query methods can be converted into model collections. Custom query methods cannot be directly
85 * converted into model collections. You need to query itemModel to assign current attributes.
86 */
87@property (nonatomic,copy) NSArray <IDOSyncSportDataItemInfoBluetoothModel *>* sportItems;
88
89/**
90 运动总步数(单位 :步数) | Total number of steps in sports (unit: number of steps)
91 */
92@property (nonatomic,assign) NSInteger totalStep;
93
94/**
95 运动总消耗卡路里(单位 :大卡) | Total calories burned by exercise (unit: big card)
96 */
97@property (nonatomic,assign) NSInteger totalCalories;
98
99/**
100 运动总距离(单位 :米) | Total distance of movement (unit: m)
101 */
102@property (nonatomic,assign) NSInteger totalDistances;
103
104/**
105 运动总时长 (秒) | Total length of exercise (seconds)
106 */
107@property (nonatomic,assign) NSInteger totalActiveTime;
108
109/**
110 开始偏移量 | Start offset
111 */
112@property (nonatomic,assign) NSInteger minuteOffset;
113
114/**
115 产生数据间隔 | Generate data interval
116 */
117@property (nonatomic,assign) NSInteger perMinute;
118
119/**
120 目标运动数量 | Number of target sports
121 */
122@property (nonatomic,assign) NSInteger goalSportData;
123
124/**
125 一天步数items个数 | one day total items count
126 */
127@property (nonatomic,assign) NSInteger totalCount;
128
129/**
130 只有用于 Donha app | Only for the Donha app
131 关键字 0:无效;1:超;2:浪;3:稳;4:慢;5:懒;6:香;7:安;8:困;9:燃;10:暖;11:动;12:佛;13:秀;14:拼;15:惯;16:凉;
132 */
133@property (nonatomic,assign) NSInteger keyWord;
134
135@end
136
137
138@interface IDOSyncSportDataModel : NSObject
139/**
140 * @brief 查询当前设备某年12个月所有数据 (如果查询当月无数据,会创建空的数据对象,大于当月的数据不累加)
141 * Query all data of the current device for 12 months in a certain year (If there is no data in the current month, an empty data object will be created,
142 * and the data larger than the current month will not be accumulated)
143 * @param year 年 (如 : 2018) | Year (eg: 2018)
144 * @param macAddr mac 地址 | mac address
145 * @param isQuery 是否查询items | is query items
146 * @return 一年12个月的运动数据集合,其中IDOSyncSportDataInfoBluetoothModel对象是一天总运动数据模型
147 * A 12-month sports data collection, where the IDOSyncSportDataInfoBluetoothModel object is a total day motion data model
148 */
149+ (NSArray <NSArray <__kindof IDOSyncSportDataInfoBluetoothModel *> *>*)queryOneYearSportsWithYear:(NSInteger)year
150 macAddr:(NSString *)macAddr
151 isQueryItems:(BOOL)isQuery;
152
153/**
154 * @brief 查询当前设备某月份的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
155 * Query all data of the current device for a certain month (If there is no data on the query day, an empty data object will be created,
156 * which is larger than the data of the day)
157 * @param year 年 (如 : 2018) | Year (eg: 2018)
158 * @param month 月 (如 : 9) | Month (eg: 9)
159 * @param macAddr mac 地址 | mac address
160 * @param dates 当前查询月份的所有日期集合的指针 (格式 :[10/01...10/31])
161 * Pointer to all date collections for the current query month (format: [10/01...10/31])
162 * @param isQuery 是否查询items | is query items
163 * @return 一个月的运动数据集合,其中IDOSyncSportDataInfoBluetoothModel对象是一天总运动数据模型
164 * One month of motion data collection, where the IDOSyncSportDataInfoBluetoothModel object is the total day motion data model
165 */
166+ (NSArray <__kindof IDOSyncSportDataInfoBluetoothModel *>*)queryOneMonthSportsWithYear:(NSInteger)year
167 month:(NSInteger)month
168 macAddr:(NSString *)macAddr
169 datesOfMonth:(NSArray <NSString *>**)dates
170 isQueryItems:(BOOL)isQuery;
171
172/**
173 * @brief 查询当前设备某周的所有数据 (如果查询当天无数据,会创建空的数据对象,大于当天的数据不累加)
174 * Query all data of the current device for a certain week (If there is no data on the day of the query, an empty data object will be created,
175 * and the data larger than the current day will not be accumulated)
176 * @param weekIndex 周的查询索引 (0 : 当周, 1 : 上一周, 2 : 上两周 ...) | Week's query index (0: week, 1 : last week, 2 : last two weeks...)
177 * @param weekStartDay 星期的开始日 (0 : 星期日, 1 : 星期一, 2 : 星期二 ...) | Start of the week (0: Sunday, 1 : Monday, 2 : Tuesday ...)
178 * @param macAddr mac 地址 | mac address
179 * @param dates 当前查询周的所有日期集合的指针 (格式 :[10/01...10/07])
180 * Pointer to all date collections for the current query week (format: [10/01...10/07])
181 * @param isQuery 是否查询items | is query items
182 * @return 一周的运动数据集合,其中IDOSyncSportDataInfoBluetoothModel对象是一天总运动数据模型
183 * A week of motion data collection, where the IDOSyncSportDataInfoBluetoothModel object is the total day motion data model
184 */
185+ (NSArray <__kindof IDOSyncSportDataInfoBluetoothModel *>*)queryOneWeekSportsWithWeekIndex:(NSInteger)weekIndex
186 weekStartDay:(NSInteger)weekStartDay
187 macAddr:(NSString *)macAddr
188 datesOfWeek:(NSArray <NSString *>**)dates
189 isQueryItems:(BOOL)isQuery;
190
191
192/**
193 * @brief 查询当前设备某天运动据并有详情数据 | Query the current device's mobile data and have detailed data
194 * @param macAddr mac 地址 | mac address
195 * @param year 年份 | year
196 * @param month 月份 | month
197 * @param day 日期 | day
198 * @return 一天运动数据的集合和详情数据集合 | Collection of daily exercise data and detailed data
199 */
200+ (NSArray <__kindof IDOSyncSportDataInfoBluetoothModel *>*)queryOneDaySportDetailWithMac:(NSString *)macAddr
201 year:(NSInteger)year
202 month:(NSInteger)month
203 day:(NSInteger)day;
204
205/**
206 * @brief 查询所有运动数据 步数大于0 | Query all motion data Steps greater than 0
207 * @param macAddr mac 地址 | mac address
208 * @return 所有运动数据的集合 | Collection of all the motion data
209 */
210+ (NSArray <__kindof IDOSyncSportDataInfoBluetoothModel *>*)queryAllSportsWithMac:(NSString *)macAddr;
211
212/**
213 * @brief 查询所有运动数据 步数大于0 只包含总步数和日期时间戳
214 * Query all motion data Steps greater than 0 ; Contains only the total number of steps and the date and time stamp
215 * @param macAddr mac 地址 | mac address
216 * @return 所有运动数据的集合 | Collection of all the motion data
217 */
218+ (NSArray <__kindof IDOSyncSportDataInfoBluetoothModel *>*)queryAllContractedSportsWithMac:(NSString *)macAddr;
219
220@end
221
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSwimDataModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSwimDataModel.h
new file mode 100755
index 0000000..2719fdb
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOSyncSwimDataModel.h
@@ -0,0 +1,188 @@
1//
2// IDOSyncSwimDataModel.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/6.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
12#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
13#else
14#import "IDOBluetoothBaseModel.h"
15#endif
16
17@interface IDOSyncSwimItemDataInfoBluetoothModel : IDOBluetoothBaseModel
18/**
19 开始时间 精确到秒 | start time interval since 1970 (eg 14442361933)
20 */
21@property (nonatomic,copy) NSString * timeStr;
22
23/**
24 持续时间 (单位:秒) | duration (unit:second)
25 */
26@property (nonatomic,assign) NSInteger duration;
27
28/**
29 划水次数 | strokes number
30 */
31@property (nonatomic,assign) NSInteger strokesNumber;
32
33/**
34 评分 | swolf
35 */
36@property (nonatomic,assign) NSInteger swolf;
37
38/**
39 序列号 | Serial number
40 */
41@property (nonatomic,assign) NSInteger serialNumber;
42
43/**
44 * 每一趟的泳姿 | swimming posture
45 * 0x00 : 混合泳; 0x01 : 自由泳; 0x02 : 蛙泳; 0x03 : 仰泳; 0x04 : 蝶泳;
46 * 0x00: medley; 0x01: freestyle; 0x02: breaststroke; 0x03: backstroke; 0x04: butterfly stroke;
47 */
48@property (nonatomic,assign) NSInteger swimmingPosture;
49
50/**
51 每一趟的距离 (单位:米) | distance (unit:m)
52 */
53@property (nonatomic,assign) NSInteger distance;
54
55@end
56
57@interface IDOSyncSwimmingDataInfoBluetoothModel : IDOBluetoothBaseModel
58/**
59 年份 | Year
60 */
61@property (nonatomic,assign) NSInteger year;
62
63/**
64 月份 | Month
65 */
66@property (nonatomic,assign) NSInteger month;
67
68/**
69 日期 | Date
70 */
71@property (nonatomic,assign) NSInteger day;
72
73/**
74 时 | hour
75 */
76@property (nonatomic,assign) NSInteger hour;
77
78/**
79 分 | minutes
80 */
81@property (nonatomic,assign) NSInteger minute;
82
83/**
84 秒 | seconds
85 */
86@property (nonatomic,assign) NSInteger second;
87
88/**
89 日期 精确到日期 date interval since 1970 (如:1444361933) | Date time interval since 1970 (eg 14442361933)
90 */
91@property (nonatomic,copy) NSString * dateStr;
92
93/**
94 开始时间 精确到秒 | start time interval since 1970 (eg 14442361933)
95 */
96@property (nonatomic,copy) NSString * timeStr;
97
98/**
99 游泳类型 0x00:无效,0x01:室内游泳,0x02:开阔水域游泳 | 0x00:invalid,0x01:Indoor swimming,0x02:Open water swimming
100 */
101@property (nonatomic,assign) NSInteger type;
102
103/**
104 卡路里(单 位:大卡) | Calories (Unit: Big Card)
105 */
106@property (nonatomic,assign) NSInteger calories;
107
108/**
109 距离(单位: 米) | Distance (in meters)
110 */
111@property (nonatomic,assign) NSInteger distance;
112
113/**
114 游泳趟数 | Swimming train number
115 */
116@property (nonatomic,assign) NSInteger trips;
117
118/**
119 平均 swolf | average swolf
120 */
121@property (nonatomic,assign) NSInteger averageSwolf;
122
123/**
124 总划水次数 | total strokes number
125 */
126@property (nonatomic,assign) NSInteger totalStrokesNumber;
127
128/**
129 * 主泳姿 | swimming posture
130 * 0x00 : 混合泳; 0x01 : 自由泳; 0x02 : 蛙泳; 0x03 : 仰泳; 0x04 : 蝶泳;
131 * 0x00: medley; 0x01: freestyle; 0x02: breaststroke; 0x03: backstroke; 0x04: butterfly stroke;
132 */
133@property (nonatomic,assign) NSInteger swimmingPosture;
134
135/**
136 泳池距离 (单位:cm) | pool distance (unit:cm)
137 */
138@property (nonatomic,assign) NSInteger poolDistance;
139
140/**
141 游泳数据包量 | swimming data package
142 */
143@property (nonatomic,assign) NSInteger itemsCount;
144
145/**
146 * @brief 游泳集合 只有定义好的查询方法才能转成model集合,自定义的查询方法无法直接转成model集合,需要再查询itemModel赋给当前属性
147 * swimming collection Only defined query methods can be converted into model collections. Custom query methods cannot be directly converted
148 * into model collections. You need to query itemModel to assign current attributes.
149 */
150@property (nonatomic,copy) NSArray <IDOSyncSwimItemDataInfoBluetoothModel *>* swimmingItems;
151
152/**
153 用户确认的距离 | confirm distance
154 */
155@property (nonatomic,assign) NSInteger confirmDistance;
156
157/**
158 游泳持续时长 单位:分钟 | duration unit:minute
159 */
160@property (nonatomic,assign) NSInteger duration;
161
162@end
163
164
165@interface IDOSyncSwimDataModel : NSObject
166/**
167 * @brief 当前设备根据游泳开始时间查询某个游泳详情
168 * The current device queries an swim details based on the event start time
169 * @param macAddr mac地址 | Mac address
170 * @param timeStr 游泳开始时间 | swim start time
171 * @return model IDOSyncSwimmingDataInfoBluetoothModel
172 */
173+ (__kindof IDOSyncSwimmingDataInfoBluetoothModel *)querySwimDataWithTimeStr:(NSString *)timeStr
174 macAddr:(NSString *)macAddr;
175
176/**
177 * @brief 当前设备查询一天所有游泳数据
178 * The current device queries an swim details based on the event start time
179 * @param macAddr mac地址 | Mac address
180 * @param dateStr 日期时间戳 | Date time stamp
181 * @param isQuery 是否查询items | is query items
182 * @return 一天游泳数据的集合 | Collection of day swim data
183 */
184+ (NSArray <__kindof IDOSyncSwimmingDataInfoBluetoothModel *>*)querySwimDataWithDateStr:(NSString *)dateStr
185 macAddr:(NSString *)macAddr
186 isQueryItems:(BOOL)isQuery;
187
188@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOTranEnum.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOTranEnum.h
new file mode 100755
index 0000000..53d7ad3
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOTranEnum.h
@@ -0,0 +1,93 @@
1//
2// IDOTranEnum.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/7.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#ifndef IDOTranEnum_h
10#define IDOTranEnum_h
11
12/**
13 压缩类型 | compression type
14 */
15typedef NS_ENUM(NSInteger, IDO_DATA_TRAN_COMPRESSION_TYPE) {
16 /**
17 不适用压缩 | no use
18 */
19 IDO_DATA_TRAN_COMPRESSION_NO_USE_TYPE = 0,
20 /**
21 zlib压缩 | zlib
22 */
23 IDO_DATA_TRAN_COMPRESSION_ZLIB_TYPE = 1,
24 /**
25 fastlz压缩 | fastlz
26 */
27 IDO_DATA_TRAN_COMPRESSION_FASTLZ_TYPE = 2,
28
29};
30
31/**
32 文件传输类型 | file transfer type
33 */
34typedef NS_ENUM(NSInteger, IDO_DATA_FILE_TRAN_TYPE) {
35 /**
36 AGPS 文件 | AGPS file type
37 */
38 IDO_DATA_FILE_TRAN_AGPS_TYPE = 1,
39 /**
40 表盘 文件 | dial file type
41 */
42 IDO_DATA_FILE_TRAN_DIAL_TYPE = 2,
43 /**
44 字库 文件 | word file type
45 */
46 IDO_DATA_FILE_TRAN_WORD_TYPE = 3,
47 /**
48 图片文件 | photo file type
49 */
50 IDO_DATA_FILE_TRAN_PHOTO_TYPE = 4
51};
52
53/**
54 文件传输状态 | file transfer state type
55 */
56typedef NS_ENUM(NSInteger, IDO_DATA_FILE_TRAN_STATE_TYPE) {
57 /**
58 文件传输初始值 | transmission init
59 */
60 IDO_DATA_FILE_TRAN_INIT_TYPE = 0,
61 /**
62 文件开始传输 | start transmission
63 */
64 IDO_DATA_FILE_TRAN_START_TYPE = 1,
65 /**
66 文件传输中 | transmissioning
67 */
68 IDO_DATA_FILE_TRAN_ING_TYPE = 2,
69 /**
70 文件传输成功 | transmission success
71 */
72 IDO_DATA_FILE_TRAN_SUCCESS_TYPE = 3,
73 /**
74 文件传输失败 | transmission failed
75 */
76 IDO_DATA_FILE_TRAN_FAILED_TYPE = 4,
77 /**
78 文件开始写入 | start write
79 */
80 IDO_DATA_FILE_WRITE_TYPE = 5,
81 /**
82 文件写入成功 | write success
83 */
84 IDO_DATA_FILE_WRITE_SUCCESS_TYPE = 6,
85 /**
86 文件写入失败 | write failed
87 */
88 IDO_DATA_FILE_WRITE_FAILED_TYPE = 7,
89
90};
91
92
93#endif /* IDOTranEnum_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOTransferFileManager.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOTransferFileManager.h
new file mode 100755
index 0000000..bf390b1
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOTransferFileManager.h
@@ -0,0 +1,116 @@
1//
2// IDOTransferFileManager.h
3// IDOBluetooth
4//
5// Created by hedongyang on 2018/9/30.
6// Copyright © 2018年 apple. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
11#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
12#else
13#import "IDOTranEnum.h"
14#endif
15
16@interface IDOTransferFileManager : NSObject
17
18/**
19 * 传输文件类型 agps文件、表盘文件、字库文件、图片文件
20 * Transfer file type agps file, dial file
21 */
22@property (nonatomic,assign) IDO_DATA_FILE_TRAN_TYPE transferType;
23
24/**
25 * 传输文件压缩类型 不适用压缩、zlib压缩、fastlz压缩
26 * Transfer file compression types not suitable for compression, zlib compression, fastlz compression
27 */
28@property (nonatomic,assign) IDO_DATA_TRAN_COMPRESSION_TYPE compressionType;
29
30/**
31 * 传输文件过程状态
32 * Transfer file process status
33 */
34@property (nonatomic,assign) IDO_DATA_FILE_TRAN_STATE_TYPE tranStateType;
35
36/**
37 * 设置传输文件包文个数 默认 10
38 * Set the number of transfer file packet default 10
39 */
40@property (nonatomic,assign) NSInteger numberPackets;
41
42/**
43 * 传输文件名称
44 * Transfer file name
45 */
46@property (nonatomic,copy,nullable) NSString * fileName;
47
48/**
49 * 传输文件路径
50 * Transfer file path
51 */
52@property (nonatomic,copy,nullable) NSString * filePath;
53
54/*
55 * 传输文件的二进制数据
56 * Transfer the binary data of the file
57 */
58@property (nonatomic,copy,nullable) NSData * fileData;
59
60/**
61 * 蓝牙写入数据是否响应
62 * Bluetooth sends data in response
63 */
64@property (nonatomic,assign) BOOL isResponse;
65
66/**
67 * 是否设置连接参数
68 * Set connection parameters
69 */
70@property (nonatomic,assign) BOOL isSetConnectParam;
71
72/**
73 * 检测文件回调
74 * Detect file callback
75 */
76@property (nonatomic,copy,nullable) IDOTransferFileManager *_Nonnull(^addDetection)(void(^ _Nullable detectionCallback)(int errorCode));
77
78/**
79 * 文件传输进度回调 (1-100)
80 * file transfer progress (1-100)
81 */
82@property (nonatomic,copy,nullable) IDOTransferFileManager *_Nonnull(^addProgress)(void(^ _Nullable progressCallback)(int progress));
83
84/**
85 * 文件传输完成回调
86 * File transfer complete callback
87 */
88@property (nonatomic,copy,nullable) IDOTransferFileManager *_Nonnull(^addTransfer)(void(^ _Nullable transferComplete)(int errorCode));
89
90/**
91 * 文件写入完成回调 agps文件传输完成后需要查询写入状态
92 * File write complete callback
93 */
94@property (nonatomic,copy,nullable) IDOTransferFileManager *_Nonnull(^addWrite)(void(^ _Nullable writeComplete)(int errorCode));
95
96/**
97 * 初始化传输文件管理对象(单例)
98 * Initialize the transfer file management object (singleton)
99 */
100IDOTransferFileManager * _Nonnull initTransferManager(void);
101
102/**
103 * 文件开始传输
104 * file start transfer
105 */
106+ (void)startTransfer;
107
108/**
109 * 文件结束传输
110 * file stop transfer
111 */
112+ (void)stopTransfer;
113
114
115
116@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOWatchDialInfoModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOWatchDialInfoModel.h
new file mode 100755
index 0000000..2e5c7db
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOWatchDialInfoModel.h
@@ -0,0 +1,95 @@
1//
2// IDOWatchDialInfoModel.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/21.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
10#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
11#else
12#import "IDOBluetoothBaseModel.h"
13#endif
14
15@interface IDOWatchScreenInfoModel : IDOBluetoothBaseModel
16/**
17 表盘家族名称 | family name
18 */
19@property (nonatomic,copy) NSString * familyName;
20/**
21 宽度 | width
22 */
23@property (nonatomic,assign) NSInteger width;
24/**
25 高度 | height
26 */
27@property (nonatomic,assign) NSInteger height;
28/**
29 颜色格式 | color format
30 */
31@property (nonatomic,assign) NSInteger colorFormat;
32/**
33 尺寸 * 100 | size * 100
34 */
35@property (nonatomic,assign) NSInteger size;
36
37/**
38 * @brief 查询数据库,如果查询不到初始化新的model对象
39 * Query the database, if the query does not initialize a new model object
40 * @return IDOWatchScreenInfoModel
41 */
42+ (__kindof IDOWatchScreenInfoModel *)currentModel;
43
44@end
45
46@interface IDOWatchDialInfoItemModel : IDOBluetoothBaseModel
47/**
48 表盘名称(唯一标示) | file name (only sign)
49 */
50@property (nonatomic,copy) NSString * fileName;
51
52/**
53 * 操作 0x00:查询正在使用表盘 0x01:设置表盘 0x02:删除表盘
54 * Operation 0x00: query is using the dial 0x01: set the dial 0x02: delete the dial
55 */
56@property (nonatomic,assign) NSInteger operate;
57
58@end
59
60
61@interface IDOWatchDialInfoModel : IDOBluetoothBaseModel
62/**
63 * 文件个数
64 * file count
65 */
66@property (nonatomic,assign) NSInteger fileCount;
67/**
68 * 剩余空间 KB
69 * remaining Space
70 */
71@property (nonatomic,assign) NSInteger remainingSpace;
72/**
73 * 单个文件最大size KB
74 * file max size
75 */
76@property (nonatomic,assign) NSInteger fileMaxSize;
77/**
78 * 当前设置的表盘名称
79 * name of the dial currently set
80*/
81@property (nonatomic,copy) NSString * currentDialName;
82/**
83 * 当前手环所有表盘信息集合
84 * Current bracelet all dial information set
85 */
86@property (nonatomic,strong) NSArray <IDOWatchDialInfoItemModel *>* dialArray;
87
88/**
89 * @brief 查询数据库,如果查询不到初始化新的model对象
90 * Query the database, if the query does not initialize a new model object
91 * @return IDOWatchDialInfoModel
92 */
93+ (__kindof IDOWatchDialInfoModel *)currentModel;
94
95@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOWatchDialManager.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOWatchDialManager.h
new file mode 100755
index 0000000..3145921
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOWatchDialManager.h
@@ -0,0 +1,75 @@
1//
2// IDOWatchDialManager.h
3// IDOBluetoothInternal
4//
5// Created by 何东阳 on 2019/8/21.
6// Copyright © 2019 何东阳. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11typedef void(^ _Nullable setComplete)(IDOWatchDialInfoModel * _Nullable model,int errorCode);
12
13@interface IDOWatchDialManager : NSObject
14
15/**
16 * 表盘文件传输路径 (zip)
17 * Transfer file path
18 */
19@property (nonatomic,copy,nullable) NSString * filePath;
20
21/**
22 * 获取当前设备屏幕信息
23 * Gets the current device screen information
24 */
25@property (nonatomic,copy,nullable) IDOWatchDialManager *_Nonnull(^getDialScreenInfo)(void(^ _Nullable dialScreenCallback)(IDOWatchScreenInfoModel * _Nullable model,int errorCode));
26
27/**
28 * 获取当前设备所有表盘信息
29 * Gets all dial information of the current device
30 */
31@property (nonatomic,copy,nullable) IDOWatchDialManager *_Nonnull(^getDialListInfo)(void(^ _Nullable dialListCallback)(IDOWatchDialInfoModel * _Nullable model,int errorCode));
32
33/**
34 * 获取当前设备当前表盘信息
35 * Gets current dial information of the current device
36 */
37@property (nonatomic,copy,nullable) IDOWatchDialManager *_Nonnull(^getCurrentDialInfo)(void(^ _Nullable currentDialCallback)(IDOWatchDialInfoModel * _Nullable model,int errorCode));
38
39/**
40 * 设置当前表盘并回调
41 * Set the current dial and call back
42 */
43@property (nonatomic,copy,nullable) IDOWatchDialManager *_Nonnull(^setCurrentDial)(setComplete block,IDOWatchDialInfoItemModel * _Nullable model);
44
45/**
46 * 表盘传输进度回调 (1-100)
47 * file transfer progress (1-100)
48 */
49@property (nonatomic,copy,nullable) IDOWatchDialManager *_Nonnull(^addDialProgress)(void(^ _Nullable progressCallback)(int progress));
50
51/**
52 * 表盘传输完成回调
53 * File transfer complete callback
54 */
55@property (nonatomic,copy,nullable) IDOWatchDialManager *_Nonnull(^addDialTransfer)(void(^ _Nullable transferComplete)(int errorCode));
56
57/**
58 * 初始化表盘传输管理对象(单例)
59 * Initialize the transfer file management object (singleton)
60 */
61IDOWatchDialManager * _Nonnull initWatchDialManager(void);
62
63/**
64 * 表盘开始传输
65 * file start transfer
66 */
67+ (void)startDialTransfer;
68
69/**
70 * 表盘结束传输
71 * file stop transfer
72 */
73+ (void)stopDialTransfer;
74
75@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOWeightBluetoothModel.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOWeightBluetoothModel.h
new file mode 100755
index 0000000..8b0fc1b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDOWeightBluetoothModel.h
@@ -0,0 +1,124 @@
1//
2// IDOWeightBluetoothModel.h
3// IDOBluetooth
4//
5// Created by 何东阳 on 2018/10/27.
6// Copyright © 2018年 apple. All rights reserved.
7//
8
9#if __has_include(<IDOBluetoothInternal/IDOBluetoothInternal.h>)
10#elif __has_include(<IDOBlueProtocol/IDOBlueProtocol.h>)
11#else
12#import "IDOBluetoothBaseModel.h"
13#endif
14
15@interface IDOWeightBluetoothModel : IDOBluetoothBaseModel
16
17/**
18 年份 | Year
19 */
20@property (nonatomic,assign) NSInteger year;
21
22/**
23 月份 | Month
24 */
25@property (nonatomic,assign) NSInteger month;
26
27/**
28 日期 | Date
29 */
30@property (nonatomic,assign) NSInteger day;
31
32/*
33 * 日期时间戳 time interval since 1970 (如:1444361933)
34 * Date Timestamp time interval since 1970 (eg 14442361933)
35 */
36@property (nonatomic,copy) NSString * dateStr;
37
38/*
39 * 时间戳 time interval since 1970 (如:1444361933)
40 * Timestamp time interval since 1970 (eg: 14443361933)
41 */
42@property (nonatomic,copy) NSString * timeStamp;
43
44/*
45 体重值 | Weight value
46 */
47@property (nonatomic,copy) NSString * weightValue;
48
49/*
50 体重单位 0是磅 1是公斤 | Weight unit 0 is pound 1 is kg
51 */
52@property (nonatomic,copy) NSString * weightUnit;
53
54/*
55 最后一次记录的体重单位 0是磅 1是公斤 | Last recorded weight unit 0 is pound 1 is kg
56 */
57@property (nonatomic,copy) NSString * lastWeightUnit;
58
59/*
60 最后一次记录的体重 | Last recorded weight
61 */
62@property (nonatomic,copy) NSString * lastWeightValue;
63
64/*
65 手动输入? | Manual input
66 */
67@property (nonatomic,assign) BOOL isHandsRecord;
68
69/*
70 BMI
71 */
72@property (nonatomic,copy) NSString * bmi;
73
74/*
75 体脂率 | Body fat rate
76 */
77@property (nonatomic,copy) NSString * bodyFat;
78
79/*
80 内脏脂肪 | Visceral fat
81 */
82@property (nonatomic,copy) NSString * visFat;
83
84/*
85 体水分 | Body water
86 */
87@property (nonatomic,copy) NSString * water;
88
89/*
90 蛋白质 | Protein
91 */
92@property (nonatomic,copy) NSString * protein;
93
94/*
95 骨量 | Bone mass
96 */
97@property (nonatomic,copy) NSString * bone;
98
99/**
100 * @brief 查询数据库,如果查询不到初始化新的model对象
101 * Query the database, if the query does not initialize a new model object
102 * @return IDOUserWeightModel
103 */
104+ (__kindof IDOWeightBluetoothModel *)currentModel;
105
106/**
107 * @brief 查询指定日期前七次体重数据,如果没有数据会初始化体重为0的数据对象
108 * Query the weight data seven times before the specified date, if there is no data, initialize the data object with weight 0
109 * @return IDOUserWeightModel
110 */
111+ (NSArray <__kindof IDOWeightBluetoothModel *>*)querySevenTimesRecentlyWithDateStr:(NSString *)dateStr;
112
113/**
114 * @brief 查询当前设备某天体重详情数据 | Query current device weight data for one day
115 * @param year 年份 | year
116 * @param month 月份 | month
117 * @param day 日期 | day
118 * @return 体重详情数据 | Weight details data
119 */
120+ (__kindof IDOWeightBluetoothModel *)queryOneDayDataWithYear:(NSInteger)year
121 month:(NSInteger)month
122 day:(NSInteger)day;
123
124@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IHSDKCloudUser.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IHSDKCloudUser.h
new file mode 100644
index 0000000..201af0f
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IHSDKCloudUser.h
@@ -0,0 +1,104 @@
1//
2// IHSDKCloudUser.h
3// iHealthDemoCode
4//
5// Created by daiqingquan on 16/5/5.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "HealthUser.h"
11
12
13
14@interface IHSDKCloudUser : NSObject
15
16@property (strong, nonatomic) NSString *thirdUserID;
17
18
19/**
20 * Initialize IHSDKCloudUser class
21 */
22
23+(IHSDKCloudUser*)commandGetSDKUserInstance;
24
25
26/** User authentication
27
28 * Import Parameters:
29 tempUser included properties: clientID, clientSecret, userAccount
30 userAccount: either email or mobile phone number (mobile phone number is not currently supported yet)
31 clientID & clientSecret: the only identification for users of the SDK, requires registration from iHealth administrator, please email: heguangming@ihealthlabs.com.cn for more information.
32
33 * Return Parameters:
34 * @param userValidationSuccess The return parameters of ’‘userid’, ‘height’, ’clientID’, and ‘clientSecret’ after verification
35
36 The interpretation for the verification:
37 UserAuthen_RegisterSuccess: New-user registration succeeded.
38 UserAuthen_LoginSuccess: User login succeeded.
39 UserAuthen_CombinedSuccess: The user is an iHealth user as well, measurement via SDK has been activated, and the data from the measurement belongs to the user.
40 UserAuthen_TrySuccess: Testing without internet connection succeeded.
41 UserAuthen_InvalidateUserInfo: Userid/clientID/clientSecret verification failed.
42 UserAuthen_SDKInvalidateRight: SDK has not been authorized.
43 UserAuthen_UserInvalidateRight: User has not been authorized.
44 UserAuthen_InternetError: Internet error, verification failed.
45 The measurement via SDK will be operated in the case of 1-4, and will be terminated if any of 5-8 occurs. The interface needs to be re-called after analyzing the return parameters.
46 Notice: when a new user registers via SDK, an ‘iHealth disclaimer’ will pop up automatically, and will require the user to agree in order to continue. SDK applications require an Internet connection; there is 10-day trial period if the SDK cannot connect to the internet, the SDK is fully functional during tryout period, but will be terminated without a working internet connection after 10 days.
47
48 * @param userDeviceAccess
49 (
50 OpenApiActivity,
51 OpenApiBG,
52 OpenApiBP,
53 OpenApiFood,
54 OpenApiSleep,
55 OpenApiSpO2,
56 OpenApiSport,
57 OpenApiUserInfo,
58 OpenApiWeight
59 )
60
61 * @param userValidationReturn userID
62 * @paramdisposeValidationErrorBlock: Error code
63
64 */
65
66-(void)commandSDKUserValidation:(HealthUser *)tempUser UserDeviceAccess:(DisposeSDKUserDeviceAccess)userDeviceAccess UserValidationSuccess:(DisposeSDKUserValidationSuccess)userValidationSuccess UserValidationReturn:(DisposeSDKUserValidationReturn)userValidationReturn DisposeErrorBlock:(DisposeSDKUserValidationErrorBlock)disposeValidationErrorBlock;
67
68/** User authentication with AppSecret
69
70 * Import Parameters:
71 appSecret
72 * Return Parameters:
73 * @param userValidationSuccess UserAuthen_AppSecretVerifySuccess
74
75 * @param disposeValidationErrorBlock UserAuthen_AppSecretVerifyFailed
76
77*/
78-(void)commandSDKUserValidationWithAppSecret:(NSString *)appSecret UserValidationSuccess:(DisposeSDKUserValidationSuccess)userValidationSuccess DisposeErrorBlock:(DisposeSDKUserValidationErrorBlock)disposeValidationErrorBlock;
79
80
81/** User authentication with License
82
83 * Import Parameters:
84
85 licenseData
86
87 * Return Parameters:
88
89 * @param userDeviceAccess
90 (
91 {
92 deviceName = am3s;
93 expiredDate = "2017-05-15";
94 },
95
96 )
97 * @param userValidationSuccess UserAuthen_AppSecretVerifySuccess
98
99 * @param disposeValidationErrorBlock UserAuthen_AppSecretVerifyFailed
100
101 */
102-(void)commandSDKUserValidationWithLicense:(NSData *)licenseData UserDeviceAccess:(DisposeSDKUserDeviceAccess)userDeviceAccess UserValidationSuccess:(DisposeSDKUserValidationSuccess)userValidationSuccess DisposeErrorBlock:(DisposeSDKUserValidationErrorBlock)disposeValidationErrorBlock;
103
104@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/KN550BT.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/KN550BT.h
new file mode 100644
index 0000000..867f059
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/KN550BT.h
@@ -0,0 +1,115 @@
1//
2// KN550BT.h
3// testShareCommunication
4//
5// Created by my on 8/10/13.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BPAV10Device.h"
11#import <UIKit/UIKit.h>
12
13
14/**
15 KN550BT device class
16 */
17@interface KN550BT : BPAV10Device <BPBasicBTLEProtocol,BPOfflineDataTransferProtocol>
18
19@property (nonatomic, assign, readonly) BOOL isSupportDisplayConfig;
20
21
22#pragma mark - Hypogenous query
23
24/**
25 * Synchronize time and judge if the device supports the function of up Air Measurement, arm Measurement, Angle Sensor, Angle Setting, HSD, Offline Memory, mutable Groups Upload, Self Upgrade. ‘True’ means yes or on, ‘False’ means no or off.
26 * @param function A block to return the function and states that the device supports.
27 * @param error A block to refer ‘error’ in ‘Establish measurement connection’ in KN550BT.
28 */
29-(void)commandFunction:(BlockDeviceFunction)function errorBlock:(BlockError)error;
30
31/**
32 * Query battery remaining energy.
33 * @param energyValue A block to return the device battery remaining energy percentage, ‘80’ stands for 80%.
34 * @param error A block to return the error in ‘Establish measurement connection’
35 */
36-(void)commandEnergy:(BlockEnergyValue)energyValue errorBlock:(BlockError)error;
37
38
39/**
40 * Upload offline data total Count.
41 * @param totalCount item quantity of total data.
42 * @param error A block to return the error.
43 */
44-(void)commandTransferMemoryTotalCount:(BlockBachCount)totalCount errorBlock:(BlockError)error;
45
46/**
47 * Upload offline data.
48 * @param totalCount item quantity of total data
49 * @param progress upload completion ratio , from 0.0 to 1.0 or 0%~100%, 100% means upload completed.
50 * @param uploadDataArray offline data set, including measurement time, systolic pressure, diastolic pressure, pulse rate, irregular judgment. corresponding KEYs are time, sys, dia, heartRate, irregular.
51 * @param error error codes.
52 * Specification:
53 * 1. BPError0 = 0: Unable to take measurements due to arm/wrist movements.
54 * 2. BPError1: Failed to detect systolic pressure.
55 * 3. BPError2: Failed to detect diastolic pressure.
56 * 4. BPError3: Pneumatic system blocked or cuff is too tight during inflation.
57 * 5. BPError4: Pneumatic system leakage or cuff is too loose during inflation.
58 * 6. BPError5: Cuff pressure reached over 300mmHg.
59 * 7. BPError6: Cuff pressure reached over 15 mmHg for more than 160 seconds.
60 * 8. BPError7: Data retrieving error.
61 * 9. BPError8: Data retrieving error.
62 * 10. BPError9: Data retrieving error.
63 * 11. BPError10: Data retrieving error.
64 * 12. BPError11: Communication Error.
65 * 13. BPError12: Communication Error.
66 * 14. BPError13: Low battery.
67 * 15. BPError14: Device bluetooth set failed.
68 * 16. BPError15: Systolic exceeds 260mmHg or diastolic exceeds 199mmHg.
69 * 17. BPError16: Systolic below 60mmHg or diastolic below 40mmHg.
70 * 18. BPError17: Arm/wrist movement beyond range.
71 * 19. BPNormalError=30: device error, error message displayed automatically.
72 * 20. BPOverTimeError: Abnormal communication.
73 * 21. BPNoRespondError: Abnormal communication.
74 * 22. BPBeyondRangeError: device is out of communication range.
75 * 23. BPDidDisconnect: device is disconnected.
76 * 24. BPAskToStopMeasure: measurement has been stopped.
77 * 25. BPInputParameterError=400: Parameter input error.
78 */
79-(void)commandTransferMemoryDataWithTotalCount:(BlockBachCount)totalCount progress:(BlockBachProgress)progress dataArray:(BlockBachArray)uploadDataArray errorBlock:(BlockError)error;
80
81/**
82 * Set units for the Device
83 * @param UnitName The unit name string that KN550BT show result should use, must be @"mmHg" or @"kPa".
84 * @param setResult This block return means set success.
85 * @param error A block to return the error in set Unit communication.
86 */
87-(void)commandSetUnit:(NSString *)UnitName disposeSetReslut:(BlockSuccess)setResult errorBlock:(BlockError)error;
88
89
90/**
91 * Disconnect current device
92 */
93-(void)commandDisconnectDevice;
94
95
96/**
97 get status of device display
98
99 @param displayStatusBlock feedback status
100 @param errorBlock A block to return the error
101 */
102-(void)commandGetStatusOfDisplay:(BlockDisplayStatus)displayStatusBlock error:(BlockError)errorBlock;
103
104
105/**
106 set status of device display
107
108 @param backLightOn turn on back light or not
109 @param clockOn show clock or not
110 @param successBlock This block return means set success
111 @param errorBlock A block to return the error
112 */
113-(void)commandSetStatusOfDisplayForBackLight:(BOOL)backLightOn andClock:(BOOL)clockOn resultSuccess:(BlockSuccess)successBlock error:(BlockError)errorBlock;
114
115@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/KN550BTController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/KN550BTController.h
new file mode 100644
index 0000000..bdc6f05
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/KN550BTController.h
@@ -0,0 +1,32 @@
1//
2// KN550BTController.h
3// testShareCommunication
4//
5// Created by my on 8/10/13.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "BPController.h"
11
12/**
13 KN550BT controller class
14 */
15@interface KN550BTController : BPController{
16 NSMutableArray *KN550BTDeviceArray;
17}
18
19/**
20 * Initialize KN550BT controller class
21 */
22+(KN550BTController *)shareKN550BTController;
23
24/**
25 * Get all KN550BT instance,Access control class instance after receiving KN550BTConnectNoti, then use instance to call KN550BT related communication methods.
26 */
27-(NSArray *)getAllCurrentKN550BTInstace;
28
29
30
31
32@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ManageDeviceController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ManageDeviceController.h
new file mode 100644
index 0000000..a6c9cc4
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ManageDeviceController.h
@@ -0,0 +1,34 @@
1//
2// ManageDeviceController.h
3// iHealthDemoCode
4//
5// Created by daiqingquan on 16/7/3.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 ManageDeviceController
13 */
14@interface ManageDeviceController : NSObject
15
16+(ManageDeviceController *)commandGetInstance;
17
18/**
19 * Get All Connect iHealth device
20 */
21
22- (NSArray *)commandGetAllConnectDeviceArray;
23
24/**
25 * Dicconnect iHealth device with bluretooth low energy
26 * @param uuidString iHealth device currentUUID, you can get it from device property.
27 */
28
29-(void)commandDisconnectSelectDevice:(NSString *)uuidString;
30
31-(void)commandConnectReadDeviceIDPS:(NSString *)uuidString;
32
33
34@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13B.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13B.h
new file mode 100644
index 0000000..e31b2ad
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13B.h
@@ -0,0 +1,33 @@
1//
2// NT13B.h
3// iHealthSDKStatic
4//
5// Created by user on 2019/9/20.
6// Copyright © 2019 ihealthSDK. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "NT13BMacroFile.h"
11NS_ASSUME_NONNULL_BEGIN
12
13@interface NT13B : NSObject
14
15@property (strong, nonatomic) NSString *currentUUID;
16@property (strong, nonatomic) NSString *serialNumber;
17
18/**
19 * Get Measure Data
20 * @param resultBlock result NSDictionary key: bodyFlag (1:Humanity 0:object)unit(1:NT13BTemperatureUnit_C 2:NT13BTemperatureUnit_F)
21 */
22-(void)commandStartMeasure:(DisposeMeasureBlock)resultBlock;
23
24
25/**
26 * Disconnect connection
27 * @param disconnectBlock yes = success, no = fail.
28 */
29-(void)commandDisconnect:(DisposeDisconnectBlock)disconnectBlock;
30
31@end
32
33NS_ASSUME_NONNULL_END
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13BController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13BController.h
new file mode 100644
index 0000000..5ccd4fd
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13BController.h
@@ -0,0 +1,28 @@
1//
2// NT13BController.h
3// iHealthSDKStatic
4//
5// Created by user on 2019/9/20.
6// Copyright © 2019 ihealthSDK. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11NS_ASSUME_NONNULL_BEGIN
12
13@interface NT13BController : NSObject
14
15/**
16 * Initialize NT13B controller class
17 */
18+(NT13BController *)shareIHNT13BController;
19
20
21/**
22 * Access control class instance after receiving NT13BConnectNoti, then use instance to call NT13B related communication methods
23 */
24-(NSArray *)getAllCurrentNT13BInstace;
25
26@end
27
28NS_ASSUME_NONNULL_END
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13BHeader.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13BHeader.h
new file mode 100644
index 0000000..b765126
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13BHeader.h
@@ -0,0 +1,16 @@
1//
2// NT13BHeader.h
3// iHealthSDKStatic
4//
5// Created by user on 2019/9/20.
6// Copyright © 2019 ihealthSDK. All rights reserved.
7//
8
9#ifndef NT13BHeader_h
10#define NT13BHeader_h
11
12#import "NT13B.h"
13#import "NT13BController.h"
14#import "NT13BMacroFile.h"
15
16#endif /* NT13BHeader_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13BMacroFile.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13BMacroFile.h
new file mode 100644
index 0000000..ce76451
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/NT13BMacroFile.h
@@ -0,0 +1,34 @@
1//
2// NT13BMacroFile.h
3// iHealthSDKStatic
4//
5// Created by user on 2019/9/20.
6// Copyright © 2019 ihealthSDK. All rights reserved.
7//
8
9#ifndef NT13BMacroFile_h
10#define NT13BMacroFile_h
11#define NT13BDiscover @"NT13BDiscover"
12#define NT13BConnectFailed @"NT13BConnectFailed"
13#define NT13BConnectNoti @"NT13BConnectNoti"
14#define NT13BDisConnectNoti @"NT13BDisConnectNoti"
15
16
17/**
18 TemperatureUnit
19 */
20typedef NS_ENUM(NSInteger, NT13BTemperatureUnit) {
21 /// NotDefined
22 NT13BTemperatureUnit_NotDefined = 0,
23 /// Degrees Celsius
24 NT13BTemperatureUnit_C,
25 /// Fahrenheit
26 NT13BTemperatureUnit_F,
27};
28
29typedef void (^DisposeMeasureBlock)(NSDictionary *result);
30
31typedef void (^DisposeDisconnectBlock)(BOOL result);
32
33
34#endif /* NT13BMacroFile_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO1.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO1.h
new file mode 100644
index 0000000..1b3c907
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO1.h
@@ -0,0 +1,82 @@
1//
2// PO1.h
3// testShareCommunication
4//
5// Created by daiqingquan on 13-11-29.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "POMacroFile.h"
11
12
13/**
14 PO1
15 */
16@interface PO1 : NSObject
17
18@property (strong, nonatomic) NSString *currentUUID;
19@property (strong, nonatomic) NSString *serialNumber;
20@property (strong, nonatomic) NSString *firmwareVersion;
21
22
23/**
24 * Get device IDPS
25 * @param function A block to return the function and states that the device supports.
26 * {
27 MAC = 60A4232504ED;
28 accessoryName = "Pulse Oximeter";
29 firmwareVersion = "1.0.0";
30 hardwareVersion = "1.0.0";
31 manufaturer = iHealth;
32 modelNumber = "PO1 11070";
33 protocol = "com.jiuan.PO1";
34 }
35 * @param errorBlock A block to refer ‘error’ in ‘Establish measurement connection’ in PO1.
36 */
37-(void)commandFunction:(DisposePO1DeviceFunctionBlock)function DisposeErrorBlock:(DisposePO1ErrorBlock)errorBlock;
38
39/**
40 * Query power status
41 * @param batteryBlock Battery,from 0~100
42 * @param errorBlock Communication error codes
43 */
44-(void)commandPO1GetDeviceBattery:(DisposePO1BatteryBlock)batteryBlock withErrorBlock:(DisposePO1ErrorBlock)errorBlock;
45
46
47/**
48Measure data Notification
49
50 PO1NotificationMeasureData
51
52You need to listen to this message to get real-time measurements
53
54 The unit of PI is %.
55
56Content of measurement results:
57{
58 PI = "5.8";
59 bpm = 90;
60 height = 4;
61 spo2 = 98;
62 wave = (
63 42,
64 41,
65 41,
66 41,
67 40
68 );
69}
70 */
71
72
73/*
74 Disconnect current device
75 */
76
77-(void)commandDisconnectDevice;
78
79@end
80
81
82
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO1Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO1Controller.h
new file mode 100644
index 0000000..2fe88b6
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO1Controller.h
@@ -0,0 +1,29 @@
1//
2// PO1Controller.h
3// testShareCommunication
4//
5// Created by daiqingquan on 13-11-29.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 PO1Controller
13 */
14@interface PO1Controller : NSObject
15/**
16 * Initialize PO1 controller class
17 */
18+(PO1Controller *)shareIHPO1Controller;
19
20
21/**
22 * Access control class instance after receiving PO1ConnectNoti, then use instance to call PO1 related communication methods
23 */
24-(NSArray *)getAllCurrentPO1Instace;
25
26
27
28
29@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO3.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO3.h
new file mode 100644
index 0000000..5f4c70a
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO3.h
@@ -0,0 +1,96 @@
1//
2// PO3.h
3// testShareCommunication
4//
5// Created by daiqingquan on 13-11-29.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "POMacroFile.h"
11
12
13/**
14 PO3
15 */
16@interface PO3 : NSObject
17
18@property (strong, nonatomic) NSString *currentUUID;
19@property (strong, nonatomic) NSString *serialNumber;
20@property (strong, nonatomic) NSString *firmwareVersion;
21
22
23
24/**
25 * Restore Sync time
26 * @param syncTimeBlock Sync completed. Yes = Success, No = Fail.
27 * @param errorBlock Communication error codes
28 */
29-(void)commandPO3SyncTime:(DisposePO3SyncTimeBlock)syncTimeBlock withErrorBlock:(DisposePO3ErrorBlock)errorBlock;
30
31
32
33
34/**
35 * Restore Real-time measurements
36 * @param startMeasure Start measurement, Return no for fail, return yes for success.
37 * @param measureData SpO2 values, including SpO2, pulse rate, pulse intensity. Corresponding keys are spo2, bpm, wave, and pi.
38 * @param finishMeasure Finish measurement. No for fail, yes for success.
39 * @param errorBlock Communication error codes
40 */
41
42-(void)commandPO3StartMeasure:(DisposePO3StartMeasure)startMeasure withMeasureData:(DisposePO3MeasureData)measureData withFinishMeasure:(DisposePO3FinishMeasure)finishMeasure withErrorBlock:(DisposePO3ErrorBlock)errorBlock;
43
44
45
46
47/**
48 * Restore Historical data
49 * @param offlineDataCount Number of historical offline data measurements.
50 * @param offlineData date, spo2, bpm, and wave.
51 * @param offlineWaveData Pulse intensity, corresponding key: wave
52 * @param finishUpload End transmission of data, yes for success, no for fail.
53 * @param errorBlock Communication error codes
54 */
55-(void)commandPO3OfflineDataCount:(DisposePO3OfflineDataCount)offlineDataCount withOfflineData:(DisposePO3OfflineData)offlineData withOfflineWaveData:(DisposePO3OfflineWaveData)offlineWaveData withFinishMeasure:(DisposePO3FinishUpload)finishUpload withErrorBlock:(DisposePO3ErrorBlock)errorBlock;
56
57
58
59
60/**
61 * Query power status
62 * @param batteryBlock Battery,from 0~100
63 * @param errorBlock Communication error codes
64 */
65-(void)commandPO3GetDeviceBattery:(DisposePO3BatteryBlock)batteryBlock withErrorBlock:(DisposePO3ErrorBlock)errorBlock;
66
67
68
69/**
70 * Disconnect connection
71 * @param disconnectBlock yes = success, no = fail.
72 * @param errorBlock Communication error codes
73 */
74-(void)commandPO3Disconnect:(DisposePO3DisconnectBlock)disconnectBlock withErrorBlock:(DisposePO3ErrorBlock)errorBlock;
75
76/**
77 * Only a specific version supports this feature, if the version does not support this feature, an error that does not support the feature will be returned
78 * @param spo2 spo2
79 * @param bpm bpm
80 * @param height height
81 * @param disposePO3EndMeasureResult yes = success, no = fail.
82 * @param errorBlock Communication error codes
83 */
84-(void)commandPO3EndMeasureWithSpo2:(NSNumber*)spo2 bpm:(NSNumber*)bpm height:(NSNumber*)height disposePO3EndMeasureResult:(DisposePO3EndMeasure)disposePO3EndMeasureResult withErrorBlock:(DisposePO3ErrorBlock)errorBlock;
85
86
87/**
88 * Turn Off Bluetooth(Only a specific version supports this feature, if the version does not support this feature, an error that does not support the feature will be returned)
89 * @param disconnectBlock yes = success, no = fail.
90 * @param errorBlock Communication error codes
91 */
92-(void)commandPO3TurnOffBT:(DisposePO3TurnOffBT)disposePO3TurnOffBTBlock withErrorBlock:(DisposePO3ErrorBlock)errorBlock;
93
94@end
95
96
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO3Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO3Controller.h
new file mode 100644
index 0000000..94e9b7b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PO3Controller.h
@@ -0,0 +1,29 @@
1//
2// PO3Controller.h
3// testShareCommunication
4//
5// Created by daiqingquan on 13-11-29.
6// Copyright (c) 2013年 my. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 PO3Controller
13 */
14@interface PO3Controller : NSObject
15/**
16 * Initialize PO3 controller class
17 */
18+(PO3Controller *)shareIHPO3Controller;
19
20
21/**
22 * Access control class instance after receiving PO3ConnectNoti, then use instance to call PO3 related communication methods
23 */
24-(NSArray *)getAllCurrentPO3Instace;
25
26
27
28
29@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/POHeader.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/POHeader.h
new file mode 100644
index 0000000..8bd2300
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/POHeader.h
@@ -0,0 +1,20 @@
1//
2// POHeader.h
3// POSDK
4//
5// Created by 小翼 on 14-8-13.
6// Copyright (c) 2014年 hejiasu. All rights reserved.
7//
8
9#ifndef POSDK_POHeader_h
10#define POSDK_POHeader_h
11
12#import "PO1.h"
13#import "PO1Controller.h"
14#import "PO3.h"
15#import "PO3Controller.h"
16#import "POMacroFile.h"
17#import "HealthUser.h"
18
19#endif
20
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/POMacroFile.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/POMacroFile.h
new file mode 100644
index 0000000..21d7f7f
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/POMacroFile.h
@@ -0,0 +1,142 @@
1//
2// POMacroFile.h
3// POSDK
4//
5// Created by 小翼 on 14-8-11.
6// Copyright (c) 2014年 hejiasu. All rights reserved.
7//
8
9#import "HealthUser.h"
10
11#ifndef POSDK_POMacroFile_h
12#define POSDK_POMacroFile_h
13
14#define PO3DeviceID @"ID"
15#define PO3SDKRightApi @"OpenApiSpO2"
16
17#define PO3Discover @"PO3Discover"
18#define PO3ConnectFailed @"PO3ConnectFailed"
19#define PO3ConnectNoti @"PO3ConnectNoti"
20#define PO3DisConnectNoti @"PO3DisConnectNoti"
21
22#define PO1Discover @"PO1Discover"
23#define PO1ConnectFailed @"PO1ConnectFailed"
24#define PO1ConnectNoti @"PO1ConnectNoti"
25#define PO1DisConnectNoti @"PO1DisConnectNoti"
26/**
27 PO3 error code
28 */
29typedef NS_ENUM(NSUInteger, PO3ErrorID) {
30 /// Bluetooth Communication Error
31 PO3Error_OverTime = 0,
32 /// Send failed
33 PO3Error_ResetDeviceFaild,
34 /// Device is disconnected
35 PO3Error_Disconnect,
36 /// ParameterError
37 PO3Error_ParameterError = 400,
38 /// firmware version is not supported
39 PO3Error_FirmwareVersionIsNotSupported
40};
41
42typedef NS_ENUM(NSUInteger, PO1ErrorID) {
43 /// Bluetooth Communication Error
44 PO1Error_OverTime = 0,
45 /// Send failed
46 PO1Error_ResetDeviceFaild,
47 /// Device is disconnected
48 PO1Error_Disconnect,
49 /// ParameterError
50 PO1Error_ParameterError = 400,
51 /// firmware version is not supported
52 PO1Error_FirmwareVersionIsNotSupported
53};
54
55
56/**
57 PO3ErrorID
58 */
59typedef void (^DisposePO3ErrorBlock)(PO3ErrorID errorID);
60/**
61 sync time
62 */
63typedef void (^DisposePO3SyncTimeBlock)(BOOL resetSuc);
64/**
65 start measure
66 */
67typedef void (^DisposePO3StartMeasure)(BOOL resetSuc);
68/**
69 measure data
70 */
71typedef void (^DisposePO3MeasureData)(NSDictionary *measureDataDic);
72/**
73 finish measure
74 */
75typedef void (^DisposePO3FinishMeasure)(BOOL finishData);
76
77/**
78 offline data count
79 */
80typedef void (^DisposePO3OfflineDataCount)(NSNumber* dataCount);
81/**
82 offline data
83 */
84typedef void (^DisposePO3OfflineData)(NSDictionary *OfflineData);
85/**
86 offline wave data
87 */
88typedef void (^DisposePO3OfflineWaveData)(NSDictionary *offlineWaveDataDic);
89/**
90 finish upload
91 */
92typedef void (^DisposePO3FinishUpload)(BOOL resetSuc);
93/**
94 reset device
95 */
96typedef void (^DisposePO3ResetDeviceBlock)(BOOL resetSuc);
97/**
98 battery
99 */
100typedef void (^DisposePO3BatteryBlock)(NSNumber *battery);
101/**
102 disconnect
103 */
104typedef void (^DisposePO3DisconnectBlock)(BOOL resetSuc);
105/**
106 send data
107 */
108typedef void (^DisposeSendPO3DataBlock)(void);
109
110/**
111 end measure
112 */
113typedef void (^DisposePO3EndMeasure)(BOOL setSuc);
114
115/**
116 turn off bt
117 */
118typedef void (^DisposePO3TurnOffBT)(BOOL setSuc);
119
120
121/**
122 PO1ErrorID
123 */
124typedef void (^DisposePO1ErrorBlock)(PO1ErrorID errorID);
125/**
126 battery
127 */
128typedef void (^DisposePO1BatteryBlock)(NSNumber *battery);
129/**
130 disconnect
131 */
132typedef void (^DisposePO1DisconnectBlock)(BOOL resetSuc);
133
134/**
135 set beep
136 */
137typedef void (^DisposePO1SetDeviceBeep)(BOOL setResult);
138
139
140typedef void(^DisposePO1DeviceFunctionBlock)(NSDictionary *functionDict);
141
142#endif
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PT3SBT.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PT3SBT.h
new file mode 100644
index 0000000..5364d89
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PT3SBT.h
@@ -0,0 +1,167 @@
1//
2// PT3SBT.h
3// iHealthSDKStatic
4//
5// Created by user on 2020/9/7.
6// Copyright © 2020 ihealthSDK. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "PT3SBTMacroFile.h"
11NS_ASSUME_NONNULL_BEGIN
12
13@interface PT3SBT : NSObject
14
15@property (strong, nonatomic) NSString *serialNumber;
16@property (strong, nonatomic) NSString *currentUUID;
17
18/**
19 * Get device IDPS (After the PT3SBT device is successfully connected, the interface must be called to synchronize the device time. Otherwise, the offline data measurement time error will be caused)
20 * @param function A block to return the function and states that the device supports.
21 * {
22 MAC = D379D238F6B3;
23 accessoryName = PT;
24 firmwareVersion = "1.1.0";
25 hardwareVersion = "1.0.0";
26 manufaturer = iHealth;
27 modelNumber = PT3SBT;
28 protocol = "com.jiuan.PT3SBT";
29 }
30 * @param disposeErrorBlock A block to refer ‘error’ in ‘Establish measurement connection’ in PT3SBT.
31 */
32-(void)commandFunction:(DisposePT3SBTDeviceFunctionBlock)function DisposeErrorBlock:(DisposePT3SBTErrorBlock)disposeErrorBlock;
33
34/**
35 *Get Battery
36
37 * @param battery [Range:0~100]%
38 * @param disposeErrorBlock error code
39 */
40-(void)commandGetPT3SBTBattery:(DisposePT3SBTBatteryBlock)battery DiaposeErrorBlock:(DisposePT3SBTErrorBlock)disposeErrorBlock;
41
42
43/**
44 * Set Unit
45 * @param unitState
46 * /// Degrees Celsius
47 PT3SBTTemperatureUnit_C=1,
48 /// Fahrenheit
49 PT3SBTTemperatureUnit_F,
50 * @param disposeSetUnitResult YES:success NO:fail
51 * @param disposeErrorBlock This block returns error codes,please refer to error codes list in PT3SBTMacroFile.
52 */
53-(void)commandPT3SBTSetUnit:(PT3SBTTemperatureUnit)unitState
54 DisposeSetUnitResult:(DisposePT3SBTSetUnit)disposeSetUnitResult
55 DisposeErrorBlock:(DisposePT3SBTErrorBlock)disposeErrorBlock;
56
57/**
58 * Get Unit
59 * @param disposeGetUnitResult PT3SBTTemperatureUnit
60 * @param disposeErrorBlock This block returns error codes,please refer to error codes list in PT3SBTMacroFile.
61 */
62-(void)commandPT3SBTGetUnit:(DisposePT3SBTGetUnit)disposeGetUnitResult
63 DisposeErrorBlock:(DisposePT3SBTErrorBlock)disposeErrorBlock;
64
65/**
66 * Get memory data count
67 * @param disposeMemoryCount count
68 * @param disposeErrorBlock This block returns error codes,please refer to error codes list in PT3SBTMacroFile.
69 */
70-(void)commandPT3SBTGetMemoryCount:(DisposePT3SBTGetMemoryCount)disposeMemoryCount
71 DisposeErrorBlock:(DisposePT3SBTErrorBlock)disposeErrorBlock;
72
73/**
74 Tranfer offline history records.
75 For PT3SBT, after calling this method, you should call commandDeleteMemorryData: method. Otherwise, the measure date may be wrong.
76 [
77 {
78 Distance = 1783;
79 TS = 1600064558;
80 Tamb = 274;
81 Tbody = 3520;
82 Tex = 268;
83 Tobj = 273;
84 Vbat = 282;
85 }
86]
87 @param disposeMemoryData The offline history records detail, result means result, date means the measurement time.
88 @param disposeErrorBlock This block returns error codes,please refer to error codes list in PT3SBTMacroFile.
89 */
90-(void)commandGetMemorryData:(DisposePT3SBTMemoryData)disposeMemoryData
91 DisposeErrorBlock:(DisposePT3SBTErrorBlock)disposeErrorBlock;
92
93/**
94 Delete offline history records
95
96 @param disposeDeleteData YES or NO
97 @param disposeErrorBlock This block returns error codes,please refer to error codes list in PT3SBTMacroFile.
98 */
99-(void)commandDeleteMemorryData:(DisposePT3SBTDeleteData)disposeDeleteData
100 DisposeErrorBlock:(DisposePT3SBTErrorBlock)disposeErrorBlock;
101
102/**
103 Measure data Notification
104
105 PT3SBTNotificationGetResult
106
107 You need to listen to this message to get real-time measurements
108
109 Content of measurement results:
110 {
111 Distance = 1663;
112 Tamb = 275;
113 Tbody = 3521;
114 Tex = 269;
115 Tobj = 274;
116 Vbat = 281;
117 }
118*/
119
120/**
121 PT3SBT unit change Notification
122
123 PT3SBTNotificationDeviceUnitChange
124
125 If the PT3SBT unit changes, you will receive this notification
126
127 /// Degrees Celsius
128 PT3SBTTemperatureUnit_C=1,
129 /// Fahrenheit
130 PT3SBTTemperatureUnit_F,
131
132 Content of PT3SBTNotificationDeviceUnitChange results:
133 {
134 unit=1;
135 }
136*/
137
138/**
139 Get Device Info
140
141 @param disposeDeviceInfo device info
142 {
143 "Amb16_OBJ37_Temp" = 4209;
144 "Amb25_ByCb2" = 2459;
145 "Amb25_NtcR25" = 10028;
146 "Check_AmbTemp" = 2438;
147 "Corr16_AmbTemp" = 1807;
148 "Corr25_AmbTemp" = 2484;
149 "Corr_k1_Value" = 10336;
150 "Corr_k2_Value" = 9896;
151 "Distance_CorrValue" = 284;
152 Version = 1112;
153 VersionDate = 200904;
154 }
155 @param disposeErrorBlock This block returns error codes,please refer to error codes list in PT3SBTMacroFile.
156 */
157-(void)commandGetDeviceInfo:(DisposePT3SBTDeviceInfo)disposeDeviceInfo
158 DisposeErrorBlock:(DisposePT3SBTErrorBlock)disposeErrorBlock;
159
160/**
161 * Disconnect current device
162 */
163-(void)commandDisconnectDevice;
164
165@end
166
167NS_ASSUME_NONNULL_END
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PT3SBTController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PT3SBTController.h
new file mode 100644
index 0000000..1d62f0b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PT3SBTController.h
@@ -0,0 +1,27 @@
1//
2// PT3SBTController.h
3// iHealthSDKStatic
4//
5// Created by user on 2020/9/7.
6// Copyright © 2020 ihealthSDK. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11NS_ASSUME_NONNULL_BEGIN
12
13@interface PT3SBTController : NSObject
14
15/**
16 * Initialize PT3SBT controller class
17 */
18+(PT3SBTController *)shareIHPT3SBTController;
19
20/**
21 * Get all scale instance,use hsInstance to call PT3SBT related communication methods.
22 */
23-(NSArray *)getAllCurrentPT3SBTInstace;
24
25@end
26
27NS_ASSUME_NONNULL_END
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PT3SBTMacroFile.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PT3SBTMacroFile.h
new file mode 100644
index 0000000..014e7ae
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/PT3SBTMacroFile.h
@@ -0,0 +1,92 @@
1//
2// PT3SBTMacroFile.h
3// iHealthSDKStatic
4//
5// Created by user on 2020/9/7.
6// Copyright © 2020 ihealthSDK. All rights reserved.
7//
8
9#ifndef PT3SBTMacroFile_h
10#define PT3SBTMacroFile_h
11
12
13/**
14 PT3SBT Device Error Code
15 */
16typedef NS_ENUM(int, PT3SBTDeviceError) {
17 PT3SBTDeviceError_Unknown = -1,// device send wrong error code
18 PT3SBTDeviceError_CommunicationTimeout = 0,
19 PT3SBTDeviceError_ReceivedCommandError,
20 PT3SBTDeviceError_InputParameterError,
21 PT3SBTDeviceError_MoreThanMaxNumbersOfUser,
22 PT3SBTDeviceError_WriteFlashError,
23 PT3SBTDeviceError_Disconnect,
24};
25
26typedef void(^DisposePT3SBTDeviceFunctionBlock)(NSDictionary *functionDict);
27
28typedef void(^DisposePT3SBTErrorBlock)(PT3SBTDeviceError error);
29
30/**
31 battery
32
33 @param battary battery
34 */
35typedef void (^DisposePT3SBTBatteryBlock)(NSNumber *battary);
36
37/**
38 TemperatureUnit
39 */
40typedef NS_ENUM(NSInteger, PT3SBTTemperatureUnit) {
41 /// Degrees Celsius
42 PT3SBTTemperatureUnit_C=1,
43 /// Fahrenheit
44 PT3SBTTemperatureUnit_F,
45};
46/**
47 set unit result
48
49 @param setResult YES:success NO:fail
50 */
51typedef void (^DisposePT3SBTSetUnit)(BOOL setResult);
52/**
53 get unit
54
55 @param unit PT3SBTTemperatureUnit
56 */
57typedef void (^DisposePT3SBTGetUnit)(PT3SBTTemperatureUnit unit);
58
59/**
60 get memory data count
61
62 @param count data
63 */
64typedef void (^DisposePT3SBTGetMemoryCount)(NSNumber* count);
65
66/**
67 get memory data
68
69 @param memoryDataArray data
70 */
71typedef void (^DisposePT3SBTMemoryData)(NSMutableArray *memoryDataArray);
72
73/**
74 delete offline measurement data result block
75
76 @param deleteResult YES:success NO:fail
77 */
78typedef void (^DisposePT3SBTDeleteData)(BOOL deleteResult);
79
80/**
81 get device info
82
83 @param deviceInfoDic data
84 */
85typedef void (^DisposePT3SBTDeviceInfo)(NSDictionary *deviceInfoDic);
86
87#define PT3SBTDiscover @"PT3SBTDiscover"
88#define PT3SBTConnectFailed @"PT3SBTConnectFailed"
89#define PT3SBTConnectNoti @"PT3SBTConnectNoti"
90#define PT3SBTDisConnectNoti @"PT3SBTDisConnectNoti"
91
92#endif /* PT3SBTMacroFile_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKFlowUpdateDevice.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKFlowUpdateDevice.h
new file mode 100644
index 0000000..7459bd9
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKFlowUpdateDevice.h
@@ -0,0 +1,196 @@
1//
2// SDKUpdateDevice.h
3// iHealthDemoCode
4//
5// Created by daiqingquan on 16/7/27.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 UpdateDeviceError
13 */
14typedef NS_ENUM(NSUInteger, UpdateFlowDeviceError) {
15 /// UpdateNetworkError
16 UpdateFlowNetworkError=200,
17 /// Before starting the upgrade must go to query version first
18 UpdateFlowOrderError=201,
19 /// UpdateDeviceDisconnect
20 UpdateFlowDeviceDisconnect = 300,
21 /// UpdateDeviceEnd
22 UpdateFlowDeviceEnd = 301,
23 /// UpdateInputError
24 UpdateFlowInputError=302,
25 /// UpdateErrorUnKnow
26 UpdateFlowErrorUnKnow=303,
27 /// UpdateErrorLowPower
28 UpdateFlowErrorLowPower=304,
29 /// UpdateErrorMeasuring
30 UpdateFlowErrorMeasuring=305,
31 /// cannot update
32 UpdateFlowNOUpdateUpgrade=400,
33};
34
35/**
36 UpdateModelStatus
37 */
38typedef NS_ENUM(NSUInteger, UpdateFlowModelStatus) {
39 /// not busy
40 UpdateFlowModelStatusFree = 1,
41 /// busy
42 UpdateFlowModelStatusBusy
43};
44
45/**
46 UpdateDeviceType
47 */
48typedef NS_ENUM(NSUInteger, UpdateFlowDeviceType) {
49 /// HS2S
50 UpdateFlowDeviceType_HS2S,
51 /// BG1S
52 UpdateFlowDeviceType_BG1S,
53 /// PT3SBT
54 UpdateFlowDeviceType_PT3SBT,
55 /// BG5S
56 UpdateFlowDeviceType_BG5S,
57};
58
59
60/**
61 DisposeUpdateVersionResult
62
63 @param updateVersionDic information dictionary
64 */
65typedef void (^DisposeUpdateFlowVersionResult)(NSDictionary * updateVersionDic);
66
67/**
68 DisposeUpdateErrorBlock
69
70 @param errorID UpdateDeviceError enum
71 */
72typedef void (^DisposeUpdateFlowErrorBlock)(UpdateFlowDeviceError errorID);
73
74/**
75 UpdateModuleState
76
77 @param updateModuleState UpdateModelStatus enum
78 */
79typedef void (^UpdateFlowModuleState)(NSNumber*updateModuleState);
80
81/**
82 DisposeEndUpdateResult
83
84 @param endUpdate <#endUpdate description#>
85 */
86typedef void (^DisposeEndUpdateFlowResult)(NSNumber* endUpdate);
87
88/**
89 DisposeDownloadFirmwareStart
90 */
91typedef void (^DisposeFlowDownloadFirmwareStart)(void);
92
93/**
94 DisposeDownloadFirmwareFinish
95 */
96typedef void (^DisposeFlowDownloadFirmwareFinish)(void);
97
98/**
99 DisposeUpdateProgress
100
101 @param progress 0-100
102 */
103typedef void (^DisposeUpdateFlowProgress)(NSNumber *progress);
104
105/**
106 DisposeUpdateResult
107
108 @param updateResult <#updateResult description#>
109 */
110typedef void (^DisposeUpdateFlowResult)(NSNumber*updateResult);
111
112/**
113 TransferSuccess
114
115 @param transferSuccess <#transferSuccess description#>
116 */
117typedef void (^TransferFlowSuccess)(NSNumber*transferSuccess);
118
119/**
120 DisposeDownloadProgress
121
122 @param progress 0-100
123 */
124typedef void (^DisposeFlowDownloadProgress)(NSNumber *progress);
125
126
127/**
128 SDKUpdateDevice
129 */
130@interface SDKFlowUpdateDevice : NSObject
131
132@property(nonatomic,strong)NSString *currentDeviceUUID;
133
134/**
135 * Initialize SDKFlowUpdateDevice controller class
136 */
137+(SDKFlowUpdateDevice*)shareSDKUpdateDeviceInstance;
138
139/**
140 Get device Version and cloudDeviceVersion.
141
142 @param uuidString device UUID
143 @param deviceType UpdateFlowDeviceType enum
144 @param updateVersionDic include:DeviceType、DeviceVersion、DeviceStatus(1:YES,0:NO)、CloudDeviceVersion、KeepUpdateFlag(flag,0:firstUpdate,1:go on update)、CloudUpdateServer(1:enforce update 0: optional update).
145 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
146 @note DeviceVerion means firmware version in Flash, may not match with the current running firmware version.
147 */
148-(void)commandGetUpdateVersionWithDeviceUUID:(NSString*)uuidString DeviceType:(UpdateFlowDeviceType)deviceType DisposeUpdateVersionResult:(DisposeUpdateFlowVersionResult)updateVersionDic DisposeErrorBlock:(DisposeUpdateFlowErrorBlock)disposeErrorBlock;
149/**
150 * Get Update Module State.
151 * @param updateModuleState (0:free,1:uploading)
152 */
153-(void)commandGetUpdateModuleState:(UpdateFlowModuleState)updateModuleState;
154/**
155 Stop Update.
156 @param uuidString device UUID
157 @param deviceType UpdateFlowDeviceType enum
158 @param endUpdateResult (bool 1:sucess,0:fail)
159 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
160 */
161-(void)commandEndUpdateWithDeviceUUID:(NSString*)uuidString DeviceType:(UpdateFlowDeviceType)deviceType DisposeEndUpdateResult:(DisposeEndUpdateFlowResult)endUpdateResult DisposeErrorBlock:(DisposeUpdateFlowErrorBlock)disposeErrorBlock;
162
163/**
164 Update Device with local file
165
166 @param uuidString device UUID
167 @param deviceType UpdateFlowDeviceType enum
168 @param infoFilePath path of info file
169 @param upadteFilePath path of update file
170 @param disposeUpdateProgress Update Device progress(0-100)
171 @param disposeUpdateResult Update Device result(bool 1:sucess,0:fail)Applicable to the protocol of 100.
172 @param transferSuccess TransferSuccess
173 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
174 */
175-(void)commandStartUpdateWithDeviceUUID:(NSString*)uuidString DeviceType:(UpdateFlowDeviceType)deviceType InfoFilePath:(NSString*)infoFilePath UpadteFilePath:(NSString*)upadteFilePath DisposeUpdateProgress:(DisposeUpdateFlowProgress)disposeUpdateProgress DisposeUpdateResult:(DisposeUpdateFlowResult)disposeUpdateResult TransferSuccess:(TransferFlowSuccess)transferSuccess DisposeErrorBlock:(DisposeUpdateFlowErrorBlock)disposeErrorBlock;
176
177/**
178 Update Device showing download progress
179
180 @param uuidString device UUID
181 @param deviceType UpdateFlowDeviceType enum
182 @param disposeDownloadFirmwareStart start update firmware from cloud
183 @param disposeDownloadFirmwareFinish finish update firmware from cloud
184 @param disposeDownloadProgress Update Device progress(0-100)
185 @param disposeUpdateProgress Download file progress(0-100)
186 @param disposeUpdateResult Update Device result(bool 1:sucess,0:fail).
187 @param transferSuccess TransferSuccess .
188 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
189 */
190-(void)commandStartUpdateWithDeviceUUID:(NSString*)uuidString DeviceType:(UpdateFlowDeviceType)deviceType DownloadFirmwareStart:(DisposeFlowDownloadFirmwareStart)disposeDownloadFirmwareStart DisposeDownloadFirmwareFinish:(DisposeFlowDownloadFirmwareFinish)disposeDownloadFirmwareFinish DisposeDownloadProgress:(DisposeFlowDownloadProgress)disposeDownloadProgress DisposeUpdateProgress:(DisposeUpdateFlowProgress)disposeUpdateProgress DisposeUpdateResult:(DisposeUpdateFlowResult)disposeUpdateResult TransferSuccess:(TransferFlowSuccess)transferSuccess DisposeErrorBlock:(DisposeUpdateFlowErrorBlock)disposeErrorBlock;
191
192
193
194-(void)commandsetCloudModel:(NSNumber*)cloudModel;
195
196@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKInfo.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKInfo.h
new file mode 100644
index 0000000..dccb813
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKInfo.h
@@ -0,0 +1,30 @@
1//
2// SDKInfo.h
3// iHealthSDKStatic
4//
5// Created by Lei Bao on 2017/10/19.
6// Copyright © 2017年 ihealthSDK. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 SDKInfo
13 */
14@interface SDKInfo : NSObject
15
16/**
17 Get sdk version
18
19 @return sdk version
20 */
21+ (NSString *)version;
22
23/**
24 Get sdk uuid. It will change with every App's installation
25
26 @return sdk uuid (128-bit)
27 */
28+ (NSString *)uuid;
29
30@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKUpdateDevice.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKUpdateDevice.h
new file mode 100644
index 0000000..be07c02
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/SDKUpdateDevice.h
@@ -0,0 +1,235 @@
1//
2// SDKUpdateDevice.h
3// iHealthDemoCode
4//
5// Created by daiqingquan on 16/7/27.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 UpdateDeviceError
13 */
14typedef NS_ENUM(NSUInteger, UpdateDeviceError) {
15 /// UpdateNetworkError
16 UpdateNetworkError=200,
17 /// Before starting the upgrade must go to query version first
18 UpdateOrderError=201,
19 /// UpdateDeviceDisconnect
20 UpdateDeviceDisconnect = 300,
21 /// UpdateDeviceEnd
22 UpdateDeviceEnd = 301,
23 /// UpdateInputError
24 UpdateInputError=302,
25 /// cannot update
26 NOUpdateUpgrade=400,
27};
28
29/**
30 UpdateModelStatus
31 */
32typedef NS_ENUM(NSUInteger, UpdateModelStatus) {
33 /// not busy
34 UpdateModelStatusFree = 1,
35 /// busy
36 UpdateModelStatusBusy
37};
38
39/**
40 UpdateDeviceType
41 */
42typedef NS_ENUM(NSUInteger, UpdateDeviceType) {
43 /// AM3
44 UpdateDeviceType_AM3 = 1,
45 /// AM3S
46 UpdateDeviceType_AM3S,
47 /// AM4
48 UpdateDeviceType_AM4,
49 /// PO3
50 UpdateDeviceType_PO3,
51 /// HS4
52 UpdateDeviceType_HS4,
53 /// BP5S
54 UpdateDeviceType_BP5S,
55 /// ECG
56 UpdateDeviceType_ECG,
57 /// ABPM
58 UpdateDeviceType_ABPM,
59 /// HS2
60 UpdateDeviceType_HS2,
61};
62
63
64/**
65 DisposeUpdateVersionResult
66
67 @param updateVersionDic information dictionary
68 */
69typedef void (^DisposeUpdateVersionResult)(NSDictionary * updateVersionDic);
70
71/**
72 DisposeUpdateErrorBlock
73
74 @param errorID UpdateDeviceError enum
75 */
76typedef void (^DisposeUpdateErrorBlock)(UpdateDeviceError errorID);
77
78/**
79 UpdateModuleState
80
81 @param updateModuleState UpdateModelStatus enum
82 */
83typedef void (^UpdateModuleState)(NSNumber*updateModuleState);
84
85/**
86 DisposeEndUpdateResult
87
88 @param endUpdate <#endUpdate description#>
89 */
90typedef void (^DisposeEndUpdateResult)(NSNumber* endUpdate);
91
92/**
93 DisposeDownloadFirmwareStart
94 */
95typedef void (^DisposeDownloadFirmwareStart)(void);
96
97/**
98 DisposeDownloadFirmwareFinish
99 */
100typedef void (^DisposeDownloadFirmwareFinish)(void);
101
102/**
103 DisposeUpdateProgress
104
105 @param progress 0-100
106 */
107typedef void (^DisposeUpdateProgress)(NSNumber *progress);
108
109/**
110 DisposeUpdateResult
111
112 @param updateResult <#updateResult description#>
113 */
114typedef void (^DisposeUpdateResult)(NSNumber*updateResult);
115
116/**
117 TransferSuccess
118
119 @param transferSuccess <#transferSuccess description#>
120 */
121typedef void (^TransferSuccess)(NSNumber*transferSuccess);
122
123/**
124 DisposeDownloadProgress
125
126 @param progress 0-100
127 */
128typedef void (^DisposeDownloadProgress)(NSNumber *progress);
129
130
131/**
132 SDKUpdateDevice
133 */
134@interface SDKUpdateDevice : NSObject
135
136@property(nonatomic,strong)NSString *currentDeviceUUID;
137
138/**
139 * Initialize SDKUpdateDevice controller class
140 */
141+(SDKUpdateDevice*)shareSDKUpdateDeviceInstance;
142
143/**
144 Get device Version and cloudDeviceVersion.
145
146 @param uuidString device UUID
147 @param updateVersionDic include:DeviceType、DeviceVersion、DeviceStatus(1:YES,0:NO)、CloudDeviceVersion、KeepUpdateFlag(flag,0:firstUpdate,1:go on update)、CloudUpdateServer(1:enforce update 0: optional update)、UpdateProtocolVersion(100:Equipment upgrades returned directly after the success or failure 101:Upgrade is complete only on behalf of the firmware successfully transferred, reconnect the device after the upgrade success or failure).
148 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
149 @note DeviceVerion means firmware version in Flash, may not match with the current running firmware version.
150 */
151-(void)commandGetUpdateVersionWithDeviceUUID:(NSString*)uuidString DisposeUpdateVersionResult:(DisposeUpdateVersionResult)updateVersionDic DisposeErrorBlock:(DisposeUpdateErrorBlock)disposeErrorBlock;
152/**
153 * Get Update Module State.
154 * @param updateModuleState (0:free,1:uploading)
155 */
156-(void)commandGetUpdateModuleState:(UpdateModuleState)updateModuleState;
157/**
158 Stop Update.
159 @param uuidString device UUID
160 @param endUpdateResult (bool 1:sucess,0:fail)
161 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
162 */
163-(void)commandEndUpdateWithDeviceUUID:(NSString*)uuidString DisposeEndUpdateResult:(DisposeEndUpdateResult)endUpdateResult DisposeErrorBlock:(DisposeUpdateErrorBlock)disposeErrorBlock;
164
165/**
166 Update Device.
167 @param uuidString device UUID
168 @param disposeDownloadFirmwareStart start update firmware from cloud.
169 @param disposeDownloadFirmwareFinish finish update firmware from cloud.
170 @param disposeUpdateProgress Update Device progress(0-100).
171 @param disposeUpdateResult Update Device result(bool 1:sucess,0:fail)Applicable to the protocol of 100.
172 @param transferSuccess TransferSuccess Applicable to the protocol of 101.
173 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
174 */
175
176-(void)commandStartUpdateWithDeviceUUID:(NSString*)uuidString DownloadFirmwareStart:(DisposeDownloadFirmwareStart)disposeDownloadFirmwareStart DisposeDownloadFirmwareFinish:(DisposeDownloadFirmwareFinish)disposeDownloadFirmwareFinish DisposeUpdateProgress:(DisposeUpdateProgress)disposeUpdateProgress DisposeUpdateResult:(DisposeUpdateResult)disposeUpdateResult TransferSuccess:(TransferSuccess)transferSuccess DisposeErrorBlock:(DisposeUpdateErrorBlock)disposeErrorBlock;
177
178/**
179 Update Device with local file
180
181 @param uuidString device UUID
182 @param deviceType UpdateDeviceType enum
183 @param infoFilePath path of info file
184 @param upadteFilePath path of update file
185 @param fileCRC info file CRC
186 @param disposeUpdateProgress Update Device progress(0-100)
187 @param disposeUpdateResult Update Device result(bool 1:sucess,0:fail)Applicable to the protocol of 100.
188 @param transferSuccess TransferSuccess Applicable to the protocol of 101.
189 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
190 */
191-(void)commandStartUpdateWithDeviceUUID:(NSString*)uuidString DeviceType:(UpdateDeviceType)deviceType InfoFilePath:(NSString*)infoFilePath UpadteFilePath:(NSString*)upadteFilePath FileCRC:(NSNumber*)fileCRC DisposeUpdateProgress:(DisposeUpdateProgress)disposeUpdateProgress DisposeUpdateResult:(DisposeUpdateResult)disposeUpdateResult TransferSuccess:(TransferSuccess)transferSuccess DisposeErrorBlock:(DisposeUpdateErrorBlock)disposeErrorBlock;
192
193/**
194 Update Device showing download progress
195
196 @param uuidString device UUID
197 @param disposeDownloadFirmwareStart start update firmware from cloud
198 @param disposeDownloadFirmwareFinish finish update firmware from cloud
199 @param disposeDownloadProgress Update Device progress(0-100)
200 @param disposeUpdateProgress Download file progress(0-100)
201 @param disposeUpdateResult Update Device result(bool 1:sucess,0:fail)Applicable to the protocol of 100.
202 @param transferSuccess TransferSuccess Applicable to the protocol of 101.
203 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
204 */
205-(void)commandStartUpdateWithDeviceUUID:(NSString*)uuidString DownloadFirmwareStart:(DisposeDownloadFirmwareStart)disposeDownloadFirmwareStart DisposeDownloadFirmwareFinish:(DisposeDownloadFirmwareFinish)disposeDownloadFirmwareFinish DisposeDownloadProgress:(DisposeDownloadProgress)disposeDownloadProgress DisposeUpdateProgress:(DisposeUpdateProgress)disposeUpdateProgress DisposeUpdateResult:(DisposeUpdateResult)disposeUpdateResult TransferSuccess:(TransferSuccess)transferSuccess DisposeErrorBlock:(DisposeUpdateErrorBlock)disposeErrorBlock;
206
207
208/**
209 Update Device showing download progress
210
211 @param uuidString device UUID
212 @param disposeDownloadFirmwareStart start update firmware from cloud
213 @param disposeDownloadFirmwareFinish finish update firmware from cloud
214 @param disposeDownloadProgress Update Device progress(0-100)
215 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
216 */
217-(void)commandStartDownloadWithDeviceUUID:(NSString*)uuidString DownloadFirmwareStart:(DisposeDownloadFirmwareStart)disposeDownloadFirmwareStart DisposeDownloadFirmwareFinish:(DisposeDownloadFirmwareFinish)disposeDownloadFirmwareFinish DisposeDownloadProgress:(DisposeDownloadProgress)disposeDownloadProgress DisposeErrorBlock:(DisposeUpdateErrorBlock)disposeErrorBlock;
218
219
220/**
221 Update Device (You must download the firmware before calling this interface)
222
223 @param uuidString device UUID
224
225 @param disposeUpdateProgress Download file progress(0-100)
226 @param disposeUpdateResult Update Device result(bool 1:sucess,0:fail)Applicable to the protocol of 100.
227 @param transferSuccess TransferSuccess Applicable to the protocol of 101.
228 @param disposeErrorBlock Update error codes, see UpdateDeviceError error descriptions.
229 */
230-(void)commandStartUpdateWithDeviceUUID:(NSString*)uuidString DisposeUpdateProgress:(DisposeUpdateProgress)disposeUpdateProgress DisposeUpdateResult:(DisposeUpdateResult)disposeUpdateResult TransferSuccess:(TransferSuccess)transferSuccess DisposeErrorBlock:(DisposeUpdateErrorBlock)disposeErrorBlock;
231
232
233-(void)commandsetCloudModel:(NSNumber*)cloudModel;
234
235@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ScanDeviceController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ScanDeviceController.h
new file mode 100644
index 0000000..a8700f9
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/ScanDeviceController.h
@@ -0,0 +1,47 @@
1//
2// ScanDeviceController.h
3// iHealthDemoCode
4//
5// Created by zhiwei jing on 1/24/16.
6// Copyright © 2016 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "HealthHeader.h"
11
12/**
13 ScanDeviceController
14 */
15@interface ScanDeviceController : NSObject
16
17+(ScanDeviceController *)commandGetInstance;
18
19/**
20 Start scan iHealth device with bluetooth low energy (scan maintains 12s, then auto stop scan)
21
22 @param tempDeviceType HealthDeviceType enum
23 @note Before call the Api, should register discover Notification. such as :[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(devicePO3Discover:) name:PO3Discover object:nil];
24 You will get two type result:
25 {
26 DeviceName = PO3;
27 ID = 60EC1538-46B7-3830-DDE2-0642AC9649F3;
28 }
29 or
30 {
31 DeviceName = PO3;
32 SerialNumber = 883314776729;
33 }
34 Then call [ConnectDeviceController :commandContectDeviceWithDeviceType:andSerialNub] to connect.
35 Attentation: Stop scan befroe connect device, otherwise connect may fail.
36 @return 0
37 */
38-(int)commandScanDeviceType:(HealthDeviceType)tempDeviceType;
39
40
41/**
42 * Stop scan iHealth device with bluretooth low energy
43 * @param tempDeviceType iHealth DeviceType
44 */
45-(int)commandStopScanDeviceType:(HealthDeviceType)tempDeviceType;
46
47@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3.h
new file mode 100644
index 0000000..ebcaef7
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3.h
@@ -0,0 +1,104 @@
1//
2// THV3.h
3// iHealthDemoCode
4//
5// Created by Realank on 2016/12/23.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 THV3RcvDataType
13 */
14typedef NS_ENUM(NSUInteger, THV3RcvDataType) {
15 /// recieve real time temperature
16 THV3RcvDataRT,
17 /// recieve button event
18 THV3RcvDataButtonStatus,
19};
20
21/**
22 THV3RcvButtonType
23 */
24typedef NS_ENUM(NSUInteger, THV3RcvButtonType) {
25 /// placeholder
26 THV3RcvBtnNone,
27 /// power button
28 THV3RcvBtnPower,
29 /// audio button
30 THV3RcvBtnAudio,
31 /// M button
32 THV3RcvBtnMemory,
33 /// unit button
34 THV3RcvBtnCF
35
36};
37
38/**
39 THV3Status
40 */
41typedef NS_ENUM(NSUInteger, THV3Status) {
42 /// not init
43 THV3StatusUnInit,
44 /// init time
45 THV3StatusInitTime,
46 /// init configuration
47 THV3StatusInitConfig,
48 /// working
49 THV3StatusWorking,
50};
51
52@interface THV3HistoryData : NSObject
53@property (nonatomic, strong) NSDate* measureDate;
54@property (nonatomic, assign) float temperature;
55@property (nonatomic, assign) BOOL isHumanBody;
56@end
57
58/**
59 ReceiveHistoryBlock
60
61 @param dataArray THV3HistoryData object's array
62 */
63typedef void(^ReceiveHistoryBlock)(NSArray<THV3HistoryData*>* dataArray);
64
65/**
66 ConfigResultBlock
67
68 @param success YES:success NO:fail
69 */
70typedef void(^ConfigResultBlock)(BOOL success);
71
72@interface THV3 : NSObject
73
74@property (nonatomic, assign) THV3Status status;//status to flag whether device is ready
75@property (strong, nonatomic) NSString *name;
76@property (strong, nonatomic) NSString *currentUUID;
77//‘serialNumber’ is for separating different device when multiple device have been connected.
78@property (strong, nonatomic) NSString *serialNumber;//MAC
79@property (strong, nonatomic) NSTimer *firmwareVersion;
80
81@property (nonatomic, assign) THV3RcvDataType rtDataType;
82@property (nonatomic, strong) THV3HistoryData* rtTemperature;// for temperature
83@property (nonatomic, assign) BOOL voltIsNormal;// for battary
84@property (nonatomic, assign) THV3RcvButtonType buttonType;//for button use
85@property (nonatomic, assign) BOOL isButtonOn;//for button use
86
87//status
88@property (nonatomic, assign) NSInteger idleTimeInterval;
89@property (nonatomic, assign) BOOL isUnitCelsius;
90@property (nonatomic, assign) BOOL isTargetHuman;
91@property (nonatomic, assign) BOOL isOfflineMode;
92
93- (void)readHistoryDataWithResultBlock:(ReceiveHistoryBlock)receivedDataBlock;
94
95- (void)configIdleTime:(NSUInteger)timeInterval withResultBlock:(ConfigResultBlock)resultBlock;
96- (void)configTemperUnit:(BOOL)isCelsius withResultBlock:(ConfigResultBlock)resultBlock;
97- (void)configMeasureTarget:(BOOL)isHumanBody withResultBlock:(ConfigResultBlock)resultBlock;
98- (void)configOfflineMode:(BOOL)isOffline withResultBlock:(ConfigResultBlock)resultBlock;
99
100/**
101 Disconnect device. If this method is called immediately after "readHistoryDataWithResultBlock:" method, the history data will not be cleared automatically.
102 */
103- (void)commandDisconnectDevice;
104@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3Controller.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3Controller.h
new file mode 100644
index 0000000..4f0090c
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3Controller.h
@@ -0,0 +1,30 @@
1//
2// THV3Controller.h
3// iHealthDemoCode
4//
5// Created by Realank on 2016/12/23.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 THV3Controller
13 */
14@interface THV3Controller : NSObject
15
16@property (nonatomic,assign) NSInteger defaultIdelTime;
17@property (nonatomic,assign) BOOL defaultUnitIsCelsius;
18@property (nonatomic,assign) BOOL defaultTargetIsHumanBody;
19@property (nonatomic,assign) BOOL defaultIsOffline;
20/**
21 * Initialize THV3 controller class
22 */
23+(THV3Controller *)sharedController;
24
25/**
26 * Get all THV3 instance,Access control class instance after receiving THV3ConnectNoti then use instance to call THV3 related communication methods.
27 */
28-(NSArray *)allCurrentInstance;
29
30@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3Macro.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3Macro.h
new file mode 100644
index 0000000..492a62c
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/THV3Macro.h
@@ -0,0 +1,17 @@
1//
2// THV3Macro.h
3// iHealthDemoCode
4//
5// Created by Realank on 2016/12/26.
6// Copyright © 2016年 zhiwei jing. All rights reserved.
7//
8
9#ifndef THV3Macro_h
10#define THV3Macro_h
11#import "THV3Controller.h"
12#define THV3Discover @"THV3Discover"
13#define THV3ConnectFailed @"THV3ConnectFailed"
14#define THV3ConnectNoti @"THV3ConnectNoti"
15#define THV3DisConnectNoti @"THV3DisConnectNoti"
16#define THV3_NEW_DATA @"THV3NewDataCome"
17#endif /* THV3Macro_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/TS28B.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/TS28B.h
new file mode 100644
index 0000000..0f49926
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/TS28B.h
@@ -0,0 +1,26 @@
1//
2// TS28B.h
3// iHealthSDKStatic
4//
5// Created by Lei Bao on 2017/6/13.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10@class CBPeripheral;
11
12@interface TS28B : NSObject
13
14@property (strong, nonatomic,readonly) CBPeripheral *peripheral;
15@property (copy, nonatomic) NSString *systemID;
16@property (copy, nonatomic) NSString *modelNumber;
17@property (copy, nonatomic) NSString *serialNumber;
18@property (copy, nonatomic) NSString *firmwareVersion;
19@property (copy, nonatomic) NSString *hardwareVersion;
20@property (copy, nonatomic) NSString *softwareVersion;
21@property (copy, nonatomic) NSString *manufacturerName;
22@property (copy, nonatomic) NSNumber *batteryValue;
23
24+ (instancetype)modelWithPeripheral:(CBPeripheral *)peripheral;
25
26@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/TS28BController.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/TS28BController.h
new file mode 100644
index 0000000..998a4c8
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/TS28BController.h
@@ -0,0 +1,142 @@
1//
2// TS28BController.h
3// iHealthSDKStatic
4//
5// Created by Lei Bao on 2017/6/13.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11/**
12 TemperatureType
13 */
14typedef NS_ENUM(NSInteger, TemperatureType) {
15 /// NotDefined
16 TemperatureType_NotDefined = 0,
17 /// Armpit
18 TemperatureType_Armpit,
19 /// Body
20 TemperatureType_Body,
21 /// Ear
22 TemperatureType_Ear,
23 /// Finger
24 TemperatureType_Finger,
25 /// GastroIntestinalTract
26 TemperatureType_GastroIntestinalTract,
27 /// Mouth
28 TemperatureType_Mouth,
29 /// Rectum
30 TemperatureType_Rectum,
31 /// Toe
32 TemperatureType_Toe,
33 /// Tympanum
34 TemperatureType_Tympanum,
35};
36
37/**
38 TemperatureUnit
39 */
40typedef NS_ENUM(NSInteger, TemperatureUnit) {
41 /// NotDefined
42 TemperatureUnit_NotDefined = 0,
43 /// Degrees Celsius
44 TemperatureUnit_C,
45 /// Fahrenheit
46 TemperatureUnit_F,
47};
48
49@class TS28B;
50@class TS28BController;
51
52/**
53 TS28BControllerDelegate
54 */
55@protocol TS28BControllerDelegate <NSObject>
56
57@optional
58
59/**
60 Discover device.
61
62 @param controller who calls this method
63 @param device Discovered device
64 */
65- (void)controller:(TS28BController *)controller didDiscoverDevice:(TS28B *)device;
66
67/**
68 Connect device successfully.After connect and read Device Information, this method will be called.
69
70 @param controller who calls this method
71 @param device Connected device
72 */
73- (void)controller:(TS28BController *)controller didConnectSuccessDevice:(TS28B *)device;
74
75/**
76 Connect device Fail.
77
78 @param controller who calls this method
79 @param device The spectific device
80 */
81- (void)controller:(TS28BController *)controller didConnectFailDevice:(TS28B *)device;
82
83/**
84 Device is disconnected. If you turn off your phone’s Bluetooth, please listen for the notification: @"BTLEPowerOff"
85
86 @param controller who calls this method
87 @param device The spectific device
88 */
89- (void)controller:(TS28BController *)controller didDisconnectDevice:(TS28B *)device;
90
91/**
92 Temperature is uploaded.
93
94 @param controller who calls this method
95 @param device The spectific device
96 @param value temperature value.
97 @param unit temperature unit.TemperatureUnit type, reference: https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.temperature_measurement.xml
98 @param date measure date
99 @param type measure location. TemperatureType type, reference: https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.temperature_type.xml
100 */
101- (void)controller:(TS28BController *)controller device:(TS28B *)device didUpdateTemperature:(float)value temperatureUnit:(TemperatureUnit)unit measureDate:(NSDate *)date measureLocation:(TemperatureType)type;
102
103@end
104
105/**
106 TS28BController
107 */
108@interface TS28BController : NSObject
109
110@property (weak, nonatomic) id<TS28BControllerDelegate> delegate;
111
112/**
113 Initialize TS28BController class
114
115 @return TS28BController class object
116 */
117+ (TS28BController *)sharedController;
118/**
119 Star to scan TS28B device
120 */
121- (void)startScan;
122
123/**
124 Stop scanning
125 */
126- (void)stopScan;
127
128/**
129 Connect with spectific device
130
131 @param device TS28B object. You can get it from - (void)controller:(TS28BController *)controller didDiscoverDevice:(TS28B *)device;
132 */
133- (void)connectDevice:(TS28B *)device;
134
135/**
136 Connect with spectific device
137
138 @param device TS28B object. You can get it from - (void)controller:(TS28BController *)controller didConnectSuccessDevice:(TS28B *)device;
139 */
140- (void)disconnectDevice:(TS28B *)device;
141
142@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/TS28BHeader.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/TS28BHeader.h
new file mode 100644
index 0000000..e5e54a7
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/TS28BHeader.h
@@ -0,0 +1,15 @@
1//
2// TS28BHeader.h
3// iHealthSDKStatic
4//
5// Created by Lei Bao on 2017/6/13.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#ifndef TS28BHeader_h
10#define TS28BHeader_h
11
12#import "TS28B.h"
13#import "TS28BController.h"
14
15#endif /* TS28BHeader_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/iHealthHS6.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/iHealthHS6.h
new file mode 100644
index 0000000..8e137d5
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/iHealthHS6.h
@@ -0,0 +1,174 @@
1//
2// iHealthHS6.h
3// iHealthHS6
4//
5// Created by daiqingquan on 15/11/25.
6// Copyright © 2015年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "HealthUser.h"
11#import "HSMacroFile.h"
12
13/*HS6 error instruction*/
14/*
15 error code:
16
17 7:User verify error;
18
19 101,102,103,104:networkerror
20
21 */
22
23
24
25/**
26 HS6
27 */
28@interface iHealthHS6 : NSObject
29
30+(iHealthHS6 *)shareIHHS6Controller;
31
32
33
34/**
35 Binding QR Device
36 When using the SDK for the first time, measuring method needs to be called to finish user verification.
37 Import parameter:
38 @param tempUser Properties included: clientID,clientSecret,userAccount,height,weight,isAthlete,birthday,sex.
39 clientID & clientSecret: the only identification for users of the SDK, requires registration from iHealth administrator, please email: daiqingquan@ihealthlabs.com.cn for more information.
40 @param tempDeviceID device Mac
41 Return parameters:
42 The measurement via SDK will be operated in the case of 1-4, and will be terminated if any of 5-8 occurs. The interface needs to be re-called after analyzing the return parameters.
43 Notice: when a new user registers via SDK, an ‘iHealth disclaimer’ will pop up automatically, and will require the user to agree in order to continue. SDK applications require an Internet connection; there is 10-day trial period if the SDK cannot connect to the internet, the SDK is fully functional during tryout period, but will be terminated without a working internet connection after 10 days.
44 @param result Action = 1;(1:bind sucess 2:full user bind faild 3,:ts error bind faild 4 other),
45 BineNum=10
46 MAC
47 Position = 1;(user in weight number)
48 SetWifi=0
49 Status = 1;(1:binding 2:unbind)
50 TS (time);
51 @param error error code
52 */
53-(void)cloudCommandUserBinedQRDeviceWithUser:(HealthUser *)tempUser deviceID:(NSString *)tempDeviceID binedResult:(BinedQRDeviceBlock)result binedError:(BinedQRDeviceErrorBlock)error;
54
55
56
57/**
58 unBind QR Device
59
60Import parameter:
61 @param tempUser Properties included:clientID,clientSecret,userAccount.
62
63 @param tempDeviceID device Mac
64Return parameters:
65 @param result Action = 1;(1:bind sucess 2:full user bind faild 3,:ts error bind faild 4 other),
66 MAC
67 Status = 2;(1:binding 2:unbind)
68 TS
69 @param error error code
70 */
71-(void)cloudCommandUserDisBinedQRDeviceForUser:(HealthUser *)tempUser withDeviceID:(NSString *)tempDeviceID disBinedResult:(DisBinedQRDeviceBlock)result disBinedError:(DisBinedQRDeviceErrorBlock)error;
72
73/**
74 * set HS6 wifi
75 * Import parameter:
76 * @param password - wifi password.
77 * Return parameters:
78
79 * @param disposeHS6SuccessBlock - set sucess
80
81 * @param disposeHS6FailBlock - set faild
82
83 * @param disposeHS6EndBlock - end set
84
85 * @param disposeHS6ErrorBlock - error code
86 * Error code definition:
87 * refer to “error” : HS6 error instruction.
88 */
89
90/**
91 Set HS6 wifi
92Import parameter:
93 @param password wifi password.
94
95Return parameters:
96 @param disposeHS6SuccessBlock set sucess
97 @param disposeHS6FailBlock set faild
98 @param disposeHS6EndBlock end set
99 @param disposeHS6ErrorBlock error code
100 */
101-(void)commandSetHS6WithPassWord:(NSString*)password disposeHS6SuccessBlock:(DisposeHS6SuccessBlock)disposeHS6SuccessBlock disposeHS6FailBlock:(DisposeHS6FailBlock)disposeHS6FailBlock disposeHS6EndBlock:(DisposeHS6EndBlock)disposeHS6EndBlock disposeHS6ErrorBlock:(DisposeHS6ErrorBlock)disposeHS6ErrorBlock;
102
103
104
105/**
106 Get open APItoken
107 Get AccessToken of HS6 user,and this method is a time consuming operation that cannot be calledin the main thread.
108 After get AccessToken, you can call openApi(http://developer.ihealthlabs.com) to pull data form iHealth cloud.
109 Import parameter:
110 @param tempUser Properties included: clientID,clientSecret,userAccount.
111 Return parameters:
112 @param getOpenAPIBlock (NSDictionary){@link iHealthDeviceHs6Callback#onNotify(String, String, String, String)} and its'
113 action is {@link #ACTION_HS6_GET_TOKEN}.
114
115 eg. {APIName="OpenApiActivity OpenApiBG OpenApiBP OpenApiFood OpenApiSleep OpenApiSpO2 OpenApiSport
116 OpenApiUserInfo OpenApiWeight",
117 AccessToken="9fuIPl3Bo6lqJfbYjXFjuPnNwNqVfxjiUE7cMCZSjrX22RJSoKf28jtIhI0v86wjV5GJ21bc6LvMNbfYG0QsZ7cYuUSO0EkaiFTST*GcjZvvTKxfEOmhQTfLXTXYAOA
118 wCoXlEs0DRqJaHZU5JS30ssyLNlqADPV9dlvWZitQmIfXjF6CSZM2SuRCD*bbbrqtwBsn*sC24OEoQCRpDau6wQ",
119 ClassParamentKey = {
120 "client_id" = 2a8387e3f4e94407a3a767a72dfd52ea;
121 "client_para" = 99;
122 "client_secret" = fd5e845c47944a818bc511fb7edb0a77;
123 hash = d86bf92a851bf9211851d8e6827eea55;
124 username = "he@12.com";
125 };
126 "Expires":3672000,
127 *"RefreshToken":"9fuIPl3Bo6lqJfbYjXFjuPnNwNqVfxjiUE7cMCZSjrX22RJSoKf28jtIhI0v86wjV5GJ21bc6LvMNbfYG0QsZ2TcvTQNInn85XdPIJRIe-9zB-eaY5utBVKmtLjJdEEmBlx5le5mT6oF7WBwVkwx*CUpSsdgUcyE3mG3FJnSHlajogaUSUgvMgmgUaVEMYzv4pcbCUltGNAMqJt5wwvBZA",
128 * "RefreshTokenExpires":31536000,
129 * "UUID":"",
130 * "UserID":"51027f3e09a14a55917e687c628a0f13",
131 * "UserNameKey"
132 * "UserOpenID"
133 * "UserRegion":"https:\/\/api.ihealthlabs.com.cn:8443",
134 * "client_para":"random_str"}
135 @param errorBlock HS6 error instruction.
136 */
137-(void)commandHS6GetOpenAPITokenWithUser:(HealthUser *)tempUser withSuccessBlock:(DisposeHS6GetOpenAPISuccessBlock)getOpenAPIBlock withErrorBlock:(DisposeHS6GetOpenAPIErrorBlock)errorBlock;
138
139
140
141
142
143
144
145/**
146 sync Weight Unit
147Import parameter:
148 @param tempUser Properties included:clientID,clientSecret,userAccount.
149 @param unit IHHS6SDKUnitWeight_kg,IHHS6SDKUnitWeight_lb,IHHS6SDKUnitWeight_oz
150Return parameters:
151 @param unitBlock YES or NO
152 @param errorBlock error code
153 */
154-(void)commandHS6WithUser:(HealthUser *)tempUser withSyncWeightUnit:(IHHS6SDKUnitWeight)unit withSuccessBlock:(DisposeHS6SyncWeightUnitSuccessBlock)unitBlock withErrorBlock:(DisposeHS6SyncWeightUnitErrorBlock)errorBlock;
155
156
157/**
158 DownloadHS6Data
159
160 Import parameter:
161 @param tempUser Properties included: clientID,clientSecret,userAccount
162 clientID & clientSecret: the only identification for users of the SDK, requires registration from iHealth administrator, please email: sdk@ihealthlabs.com.cn for more information.
163 @param downloadTS :From 1970, the number of ms, download data download all data after this point in time.
164 @param PageSize :Number of downloads per data.
165 Return parameters:
166 @param getHS6Data AllHS6Data
167
168 @param blockHS6LastTSFromCloud The last timestamp of the data download can be passed in at the next download, and all the data after the timestamp is downloaded.
169
170 @param errorBlock error code 101,102,103,104:networkerror 400:input error 209/225:The user doesn't exist
171 */
172-(void)commandDownloadHS6Data:(HealthUser *)tempUser withDownloadTS:(long)downloadTS withPageSize:(long)PageSize withSuccessBlock:(BlockHS6DataFromCloud)getHS6Data blockHS6LastTSFromCloud:(BlockHS6LastTSFromCloud)blockHS6LastTSFromCloud withErrorBlock:(DisposeHS6ErrorBlock)errorBlock;
173
174@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/libiHealthSDK2.7.5.a b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/libiHealthSDK2.7.5.a
new file mode 100644
index 0000000..68201d0
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/libiHealthSDK2.7.5.a
Binary files differ
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGModule.h
new file mode 100644
index 0000000..2702865
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGModule.h
@@ -0,0 +1,17 @@
1//
2// ECGModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2018/1/5.
6// Copyright © 2018年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTEventEmitter.h>
12#else
13#import "RCTEventEmitter.h"
14#endif
15@interface ECGModule : RCTEventEmitter<RCTBridgeModule>
16
17@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGModule.m
new file mode 100644
index 0000000..9cc04ea
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGModule.m
@@ -0,0 +1,245 @@
1//
2// ECGModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2018/1/5.
6// Copyright © 2018年 daiqingquan. All rights reserved.
7//
8
9#import "ECGModule.h"
10#import "ECGHeader.h"
11#import "ECGProfileModule.h"
12#import "ManageDeviceController.h"
13
14#define EVENT_NOTIFY @"event_notify_ecg"
15
16@implementation ECGModule
17
18
19RCT_EXPORT_MODULE()
20- (NSArray<NSString *> *)supportedEvents {
21 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
22 @"event_device_connected", @"event_device_connect_failed",
23 @"event_device_disconnect", @"event_authenticate_result",
24 @"event_notify_ts28b", @"event_notify_bg1",
25 @"action_connect_result_for_bg1"];
26}
27
28
29#pragma mark
30#pragma mark - constantsToExport
31- (NSDictionary *)constantsToExport{
32 return @{@"Event_Notify": EVENT_NOTIFY };
33
34}
35
36+ (BOOL)requiresMainQueueSetup
37{
38 return YES;
39}
40#pragma mark
41#pragma mark - Init
42-(id)init{
43 if (self=[super init]){
44 }
45 return self;
46}
47
48-(ECG3*)getECG3WithMac:(nonnull NSString*)mac{
49
50 ECG3Controller *controller = [ECG3Controller shareECG3Controller];
51 NSArray *ecgDeviceArray = [controller getAllCurrentECG3Instace];
52
53 for(ECG3 *tempECG3 in ecgDeviceArray){
54 if([mac isEqualToString:tempECG3.serialNumber]){
55 return tempECG3;
56 }
57 }
58
59 return nil;
60}
61
62#pragma mark -
63#pragma mark - Method
64
65RCT_EXPORT_METHOD(getAllConnectedDevices){
66
67
68 NSArray*ecg3array= [[ECG3Controller shareECG3Controller] getAllCurrentECG3Instace];
69
70 NSMutableArray*deviceMacArray=[NSMutableArray array];
71
72 for (int i=0; i<[ecg3array count]; i++) {
73
74 ECG3 *ecg3=[ecg3array objectAtIndex:i];
75 [deviceMacArray addObject:ecg3.serialNumber];
76 }
77
78 NSDictionary* deviceInfo = @{kACTION:kACTION_GET_ALL_CONNECTED_DEVICES,kDEVICES:deviceMacArray};
79
80 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
81
82
83}
84
85
86
87RCT_EXPORT_METHOD(getBattery:(nonnull NSString *)mac){
88
89 if ([self getECG3WithMac:mac]!=nil) {
90 __weak typeof(self) weakSelf = self;
91 [[self getECG3WithMac:mac] commandECG3GetBatteryInfo:^(NSNumber *battery) {
92
93 NSDictionary* deviceInfo = @{kACTION:kACTION_BATTERY_ECG,kBATTERY_ECG:battery,kMAC:mac,kType:@"ECG3"};
94 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
95
96 } withErrorBlock:^(ECG3ErrorID errorID) {
97 [weakSelf commandReturnECGError:errorID MAC:mac];
98 }];
99 }else{
100
101 [self commandReturnECGError:ECG3Error_Disconnect MAC:mac];
102
103 }
104
105
106}
107
108RCT_EXPORT_METHOD(sysTime:(nonnull NSString *)mac){
109
110 if ([self getECG3WithMac:mac]!=nil) {
111 __weak typeof(self) weakSelf = self;
112 [[self getECG3WithMac:mac] commandECG3SyncTime:^{
113
114 NSDictionary* deviceInfo = @{kACTION:kACTION_SYSTIME,kMAC:mac,kType:@"ECG3"};
115 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
116
117 } withErrorBlock:^(ECG3ErrorID errorId) {
118 [weakSelf commandReturnECGError:errorId MAC:mac];
119 }];
120
121 }else{
122 [self commandReturnECGError:ECG3Error_Disconnect MAC:mac];
123 }
124}
125
126RCT_EXPORT_METHOD(stopMeasure:(nonnull NSString *)mac){
127
128
129 if ([self getECG3WithMac:mac]!=nil) {
130 __weak typeof(self) weakSelf = self;
131 [[self getECG3WithMac:mac] commandECG3FinishMeasure:^{
132
133
134 NSDictionary* deviceInfo = @{kACTION:kACTION_STOPMEASURE_ECG,kMAC:mac,kType:@"ECG3"};
135 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
136
137 } withErrorBlock:^(ECG3ErrorID errorId) {
138 [weakSelf commandReturnECGError:errorId MAC:mac];
139 }];
140
141 }else{
142
143 [self commandReturnECGError:ECG3Error_Disconnect MAC:mac];
144 }
145
146}
147
148
149RCT_EXPORT_METHOD(startMeasure:(nonnull NSString *)mac){
150
151 if ([self getECG3WithMac:mac]!=nil) {
152 __weak typeof(self) weakSelf = self;
153 [[self getECG3WithMac:mac] commandECG3StartMeasure:^{
154
155 } withWaveData:^(NSArray *waveDataArray) {
156
157 NSDictionary* deviceInfo = @{kACTION:kACTION_MEASURE_WAVEData,kMEASURE_WAVEData:waveDataArray,kMAC:mac,kType:@"ECG3"};
158 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
159
160 } withPulseResult:^(BOOL hasHR, NSUInteger HR) {
161
162 NSDictionary* deviceInfo = @{kACTION:kACTION_MEASURE_ECGPulse,kMEASURE_ECGPulse:@(HR),kMAC:mac,kType:@"ECG3"};
163 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
164
165 } withErrorBlock:^(ECG3ErrorID errorId) {
166
167 if (errorId>= ECG3Error_ElectrodeLoss && errorId <= ECG3Error_ElectrodeLossTimeout) {
168 NSDictionary* deviceInfo = @{kACTION:kACTION_ELECTRODE_STATUS,kELECTRODE_STATUS:@(errorId),kMAC:mac,kType:@"ECG3"};
169 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
170 } else {
171 [weakSelf commandReturnECGError:errorId MAC:mac];
172 }
173
174 }];
175
176
177 }else{
178 [self commandReturnECGError:ECG3Error_Disconnect MAC:mac];
179 }
180
181}
182
183RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
184 if ([self getECG3WithMac:mac]!=nil) {
185 [[ManageDeviceController commandGetInstance] commandDisconnectSelectDevice:[self getECG3WithMac:mac].currentUUID];
186 }
187}
188
189-(void)commandReturnECGError:(ECG3ErrorID)errorID MAC:(NSString *)MAC{
190
191
192 NSMutableDictionary*deviceInfo=[NSMutableDictionary dictionary];
193
194 [deviceInfo setValue:kACTION_ERROR_ECG forKey:kACTION];
195
196 NSString*errorDes=[NSString string];
197
198 switch (errorID) {
199 case ECG3Error_ElectrodeLoss:
200 errorDes=@"Electrode Loss";
201 break;
202 case ECG3Error_ElectrodeLossRecovery:
203 errorDes=@"Electrode Loss Recovery";
204 break;
205 case ECG3Error_ElectrodeLossTimeout:
206 errorDes=@"Electrode Loss Timeout";
207 break;
208 case ECG3Error_SDCardCommunicationError:
209 errorDes=@"SDCard Communication Error";
210 break;
211 case ECG3Error_SampleModuleError:
212 errorDes=@"Sample Module Error";
213 break;
214 case ECG3Error_LowPower:
215 errorDes=@"Low Power";
216 break;
217 case ECG3Error_DeviceMemoryFull:
218 errorDes=@"Device Memory Full";
219 break;
220 case ECG3Error_Disconnect:
221 errorDes=@"Disconnect";
222 break;
223 case ECG3Error_ParameterError:
224 errorDes=@"Parameter Error";
225 break;
226 case ECG3Error_CommandTimeout:
227 errorDes=@"Command timeout";
228 break;
229 default:
230 break;
231 }
232
233 [deviceInfo setValue:[NSNumber numberWithInt:errorID] forKey:kERROR_NUM_ECG];
234
235 [deviceInfo setValue:errorDes forKey:kERROR_DESCRIPTION_ECG];
236
237 [deviceInfo setValue:@"ECG3" forKey:kType];
238 if (MAC) {
239 [deviceInfo setValue:MAC forKey:kMAC];
240 }
241
242 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
243}
244
245@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGProfileModule.h
new file mode 100644
index 0000000..1966a64
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGProfileModule.h
@@ -0,0 +1,75 @@
1//
2// ECGProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2018/1/5.
6// Copyright © 2018年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15
16#pragma mark - General
17
18#define kACTION @"action"
19#define kMAC @"mac"
20#define kType @"type"
21
22#define kACTION_GET_ALL_CONNECTED_DEVICES @"ACTION_GET_ALL_CONNECTED_DEVICES"
23#define kDEVICES @"devices"
24
25#pragma mark - ECG3
26// Error
27#define kACTION_ERROR_ECG @"ACTION_ERROR_ECG"
28#define kERROR_NUM_ECG @"ERROR_NUM_ECG"
29#define kERROR_DESCRIPTION_ECG @"ERROR_DESCRIPTION_ECG"
30// Battery
31#define kACTION_BATTERY_ECG @"ACTION_BATTERY_ECG"
32#define kBATTERY_ECG @"BATTERY_ECG"
33// Sync time
34#define kACTION_SYSTIME @"ACTION_SYSTIME"
35// Start measure
36#define kACTION_MEASURE_WAVEData @"ACTION_MEASURE_WAVEData"
37#define kACTION_MEASURE_ECGPulse @"ACTION_MEASURE_ECGPulse"
38#define kMEASURE_WAVEData @"MEASURE_WAVEData"
39#define kMEASURE_ECGPulse @"MEASURE_ECGPulse"
40// Stop measure
41#define kACTION_STOPMEASURE_ECG @"ACTION_STOPMEASURE_ECG"
42// Electrod status
43#define kACTION_ELECTRODE_STATUS @"ACTION_ELECTRODE_STATUS"
44#define kELECTRODE_STATUS @"ELECTRODE_STATUS"
45
46#pragma mark - ECG3USB
47// Error
48#define kACTION_ERROR_ECGUSB @"ACTION_ERROR_ECGUSB"
49#define kERROR_DESCRIPTION_ECGUSB @"ERROR_DESCRIPTION_ECGUSB"
50#define kERROR_NUM_ECGUSB @"ERROR_NUM_ECGUSB"
51// Sync data
52#define kACTION_SYNCDATA_ECGUSB @"ACTION_SYNCDATA_ECGUSB"
53#define kACTION_STARTSYNCDATA_ECGUSB @"ACTION_STARTSYNCDATA_ECGUSB"
54#define kACTION_SYNCDATAINFO_ECGUSB @"ACTION_SYNCDATAINFO_ECGUSB"
55#define kDATAINFO @"DATAINFO"
56#define kACTION_FINISHSYNCDATA_ECGUSB @"ACTION_FINISHSYNCDATA_ECGUSB"
57#define kACTION_SYNCDATAPROGRESS_ECGUSB @"ACTION_SYNCDATAPROGRESS_ECGUSB"
58#define kPROGRESS @"PROGRESS"
59// Delete data
60#define kACTION_DELETEDATA_ECGUSB @"ACTION_DELETEDATA_ECGUSB"
61// SPLICE
62#define kACTION_SPLICE @"ACTION_SPLICE"
63#define kSPLICE_DATA @"SPLICE_DATA"
64#define kSPLICE_ERROR_DESCRIPTION @"SPLICE_ERROR_DESCRIPTION"
65// Get cache
66#define kACTION_GET_CACHE @"ACTION_GET_CACHE"
67#define kGET_CACHE_DATA @"GET_CACHE_DATA"
68// Filter
69#define kACTION_FILTER @"ACTION_FILTER"
70#define kFILTER_DATA @"FILTER_DATA"
71#define kFILTER_ERROR_DESCRIPTION @"FILTER_ERROR_DESCRIPTION"
72
73@interface ECGProfileModule : NSObject<RCTBridgeModule>
74
75@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGProfileModule.m
new file mode 100644
index 0000000..c7e8103
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGProfileModule.m
@@ -0,0 +1,76 @@
1//
2// ECGProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2018/1/5.
6// Copyright © 2018年 daiqingquan. All rights reserved.
7//
8
9#import "ECGProfileModule.h"
10
11@implementation ECGProfileModule
12
13RCT_EXPORT_MODULE()
14
15#pragma mark
16#pragma mark - constantsToExport
17
18
19- (NSDictionary *)constantsToExport
20{
21 return @{
22 kACTION_GET_ALL_CONNECTED_DEVICES:kACTION_GET_ALL_CONNECTED_DEVICES,
23
24 kACTION_ERROR_ECG:kACTION_ERROR_ECG,
25 kERROR_NUM_ECG:kERROR_NUM_ECG,
26 kERROR_DESCRIPTION_ECG:kERROR_DESCRIPTION_ECG,
27
28 kACTION_BATTERY_ECG:kACTION_BATTERY_ECG,
29 kBATTERY_ECG:kBATTERY_ECG,
30
31 kACTION_SYSTIME:kACTION_SYSTIME,
32
33 kACTION_MEASURE_WAVEData:kACTION_MEASURE_WAVEData,
34 kACTION_MEASURE_ECGPulse:kACTION_MEASURE_ECGPulse,
35 kMEASURE_WAVEData:kMEASURE_WAVEData,
36 kMEASURE_ECGPulse:kMEASURE_ECGPulse,
37
38 kACTION_STOPMEASURE_ECG:kACTION_STOPMEASURE_ECG,
39
40 kACTION_ELECTRODE_STATUS:kACTION_ELECTRODE_STATUS,
41 kELECTRODE_STATUS:kELECTRODE_STATUS,
42
43 kACTION_ERROR_ECGUSB:kACTION_ERROR_ECGUSB,
44 kERROR_NUM_ECGUSB:kERROR_NUM_ECGUSB,
45 kERROR_DESCRIPTION_ECGUSB:kERROR_DESCRIPTION_ECGUSB,
46
47 kACTION_SYNCDATA_ECGUSB:kACTION_SYNCDATA_ECGUSB,
48 kACTION_STARTSYNCDATA_ECGUSB:kACTION_STARTSYNCDATA_ECGUSB,
49 kACTION_SYNCDATAINFO_ECGUSB:kACTION_SYNCDATAINFO_ECGUSB,
50 kDATAINFO:kDATAINFO,
51 kACTION_FINISHSYNCDATA_ECGUSB:kACTION_FINISHSYNCDATA_ECGUSB,
52 kACTION_SYNCDATAPROGRESS_ECGUSB:kACTION_SYNCDATAPROGRESS_ECGUSB,
53 kPROGRESS:kPROGRESS,
54
55 kACTION_DELETEDATA_ECGUSB:kACTION_DELETEDATA_ECGUSB,
56
57 kACTION_SPLICE:kACTION_SPLICE,
58 kSPLICE_DATA:kSPLICE_DATA,
59 kSPLICE_ERROR_DESCRIPTION:kSPLICE_ERROR_DESCRIPTION,
60
61 kACTION_GET_CACHE:kACTION_GET_CACHE,
62 kGET_CACHE_DATA:kGET_CACHE_DATA,
63
64 kACTION_FILTER:kACTION_FILTER,
65 kFILTER_DATA:kFILTER_DATA,
66 kFILTER_ERROR_DESCRIPTION:kFILTER_ERROR_DESCRIPTION,
67
68 };
69};
70
71+ (BOOL)requiresMainQueueSetup
72{
73 return YES;
74}
75
76@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGUSBModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGUSBModule.h
new file mode 100644
index 0000000..370dedb
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGUSBModule.h
@@ -0,0 +1,18 @@
1//
2// ECGUSBModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2018/1/5.
6// Copyright © 2018年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTEventEmitter.h>
12#else
13#import "RCTEventEmitter.h"
14#endif
15
16@interface ECGUSBModule : RCTEventEmitter<RCTBridgeModule>
17
18@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGUSBModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGUSBModule.m
new file mode 100644
index 0000000..10db55d
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/ECGUSBModule.m
@@ -0,0 +1,258 @@
1//
2// ECGUSBModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2018/1/5.
6// Copyright © 2018年 daiqingquan. All rights reserved.
7//
8
9#import "ECGUSBModule.h"
10#import "ECGHeader.h"
11#import "ECGProfileModule.h"
12
13#define EVENT_NOTIFY @"event_notify_ecgusb"
14
15@implementation ECGUSBModule
16
17
18
19RCT_EXPORT_MODULE()
20- (NSArray<NSString *> *)supportedEvents {
21 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
22 @"event_device_connected", @"event_device_connect_failed",
23 @"event_device_disconnect", @"event_authenticate_result",
24 @"event_notify_ts28b", @"event_notify_bg1",
25 @"action_connect_result_for_bg1"];
26}
27
28
29
30#pragma mark
31#pragma mark - constantsToExport
32- (NSDictionary *)constantsToExport
33{
34 return @{@"Event_Notify": EVENT_NOTIFY };
35
36}
37+ (BOOL)requiresMainQueueSetup
38{
39 return YES;
40}
41#pragma mark
42#pragma mark - Method
43
44RCT_EXPORT_METHOD(getAllConnectedDevices){
45
46 ECG3USB *ecg=[[ECG3USBController shareECG3USBController] getCurrentECG3USBInstace];
47
48 if (ecg!=nil) {
49
50 NSDictionary* deviceInfo = @{kACTION:kACTION_GET_ALL_CONNECTED_DEVICES,kDEVICES:ecg.serialNumber};
51 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
52 }
53
54
55}
56RCT_EXPORT_METHOD(getIdps){
57
58
59 NSMutableDictionary*deviceInfo=[NSMutableDictionary dictionary];
60
61 [deviceInfo setValue:@(404) forKey:kERROR_NUM_ECGUSB];
62
63 [deviceInfo setValue:@"This method iOS is not supported" forKey:kERROR_DESCRIPTION_ECGUSB];
64
65 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
66}
67/**
68 Sync Data
69
70 @param startBlock means start
71 @param progressBlock 0-100
72 @param resultBlock You can get filtered data from the NSDocumentDirectory path.
73 Abnormal Point Marked by User: OBData_FileName.txt
74 Filtered ECG Data: ECGAnalyseResult_FileName.txt
75 Lead Off Begin Point: ECGLeadOffBegin_FileName.txt
76 Lead Off End Point: ECGLeadOffEnd_FileName.txt
77 ECG HR Information EveryHour: ECGHREveryHour_FileName.txt
78 Abnormal Point Filtered by Algorithm: ECGOBbyFilter_FileName.txt
79 ECG HR Information for Day: ECGDetail_FileName.txt
80 @param errorBlock error
81 */
82
83RCT_EXPORT_METHOD(syncData){
84
85 ECG3USB *device = [[ECG3USBController shareECG3USBController] getCurrentECG3USBInstace];
86 if (device) {
87 __weak typeof(self) weakSelf = self;
88 [device syncDataWithStartBlock:^{
89
90 NSDictionary* deviceInfo = @{kACTION:kACTION_STARTSYNCDATA_ECGUSB,kMAC:device.serialNumber,kType:@"ECG3USB"};
91 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
92
93 } progressBlock:^(NSUInteger progress) {
94
95 NSDictionary* deviceInfo = @{kACTION:kACTION_SYNCDATAPROGRESS_ECGUSB,kPROGRESS:@(progress),kMAC:device.serialNumber,kType:@"ECG3USB"};
96 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
97
98 } resultBlock:^(NSArray *resultArray, BOOL finish) {
99
100 NSDictionary* deviceInfo = @{kACTION:kACTION_SYNCDATAINFO_ECGUSB,kDATAINFO:resultArray,kMAC:device.serialNumber,kType:@"ECG3USB"};
101 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
102
103 } errorBlock:^(ECG3USBError errorID) {
104
105 [weakSelf commandReturnECGUSBError:errorID MAC:device.serialNumber];
106 }];
107
108 }else{
109 [self commandReturnECGUSBError:ECG3USBError_DeviceDisconnect MAC:@""];
110 }
111}
112
113-(void)commandReturnECGUSBError:(ECG3USBError)errorID MAC:(NSString*)mac{
114
115
116 NSMutableDictionary*deviceInfo=[NSMutableDictionary dictionary];
117 [deviceInfo setValue:@"ECG3USB" forKey:kType];
118 if (mac) {
119 [deviceInfo setValue:mac forKey:kMAC];
120 }
121 [deviceInfo setValue:@"ACTION_ERROR_ECGUSB" forKey:kACTION];
122
123 NSString*errorDes=[NSString string];
124
125 switch (errorID) {
126 case ECG3USBError_QuerySDCardInfoTimeout:
127 errorDes=@"Query command timeout";
128 break;
129 case ECG3USBError_SDCardInfoError:
130 errorDes=@"Received SD card info is wrong";
131 break;
132 case ECG3USBError_SDCardError:
133 errorDes=@"Receive devce's error log: SD card error";
134 break;
135 case ECG3USBError_iOSDeviceFlashNotEnough:
136 errorDes=@"There is not enough space for ECG's offline data";
137 break;
138 case ECG3USBError_AFilePackageIndexNotMatch:
139 errorDes=@"Receive wrong data";
140 break;
141 case ECG3USBError_BFilePackageIndexNotMatch:
142 errorDes=@"Receive wrong data";
143 break;
144 case ECG3USBError_ReceiveDataTimeout:
145 errorDes=@"Receive data timeout";
146 break;
147 case ECG3USBError_SaveFileError:
148 errorDes=@"Save file error";
149 break;
150 case ECG3USBError_DeviceDisconnect:
151 errorDes=@"Device is disconnected";
152 break;
153 case ECG3USBError_DeviceReplyFormatFail:
154 errorDes=@"Format fail";
155 break;
156 case ECG3USBError_DeviceFormatTimeout:
157 errorDes=@"Format command timeout.";
158 break;
159 case ECG3USBError_CommandTimeout:
160 errorDes=@"Command timeout";
161 break;
162
163 default:
164 break;
165 }
166
167 [deviceInfo setValue:@(errorID) forKey:kERROR_NUM_ECGUSB];
168
169 [deviceInfo setValue:errorDes forKey:kERROR_DESCRIPTION_ECGUSB];
170
171 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
172}
173
174/**
175 Format SD Card
176
177 @param successBlock Success
178 @param progressBlock 0-100
179 @param failBlock Fail
180 */
181
182RCT_EXPORT_METHOD(deleteData){
183
184 ECG3USB *device = [[ECG3USBController shareECG3USBController] getCurrentECG3USBInstace];
185 if (device) {
186 __weak typeof(self) weakSelf = self;
187 [device formatSDCard:^{
188 NSDictionary* deviceInfo = @{kACTION:kACTION_DELETEDATA_ECGUSB,kType:@"ECG3USB",kMAC:device.serialNumber};
189 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
190 } progressBlock:^(NSUInteger progress) {
191
192 } errorBlock:^(ECG3USBError error) {
193 [weakSelf commandReturnECGUSBError:error MAC:device.serialNumber];
194 }];
195
196 }else{
197 [self commandReturnECGUSBError:ECG3USBError_DeviceDisconnect MAC:@""];
198 }
199}
200
201/**
202 Splice data
203
204 @param fileNames An Array with FileName value from ECG3USBSyncResultBlock
205 @param success a block contains a dictionary with two keys: success(@{@"DataFileName":dataFileName,@"MarkFileName":markFileName});
206 @param error a block contains error message
207 */
208RCT_EXPORT_METHOD(spliceData:(nonnull NSArray*)array){
209 __weak typeof(self) weakSelf = self;
210 [ECG3USB spliceWithFileNames:array successBlock:^(NSDictionary *dic) {
211 NSDictionary* deviceInfo = @{kACTION:kACTION_SPLICE,kSPLICE_DATA:dic,kType:@"ECG3USB",kMAC:@""};
212 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
213 } errorBlock:^(ECG3USBError error, NSString *message) {
214 NSDictionary* deviceInfo = @{kACTION:kACTION_SPLICE,kSPLICE_ERROR_DESCRIPTION:message,kType:@"ECG3USB",kMAC:@""};
215 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
216 }];
217}
218
219RCT_EXPORT_METHOD(getCache){
220 ECG3USB *device = [[ECG3USBController shareECG3USBController] getCurrentECG3USBInstace];
221 if (device) {
222 __weak typeof(self) weakSelf = self;
223 [device getCacheDataWithBlock:^(NSArray *array) {
224 NSDictionary* deviceInfo = @{kACTION:kACTION_GET_CACHE,kGET_CACHE_DATA:array,kMAC:device.serialNumber,kType:@"ECG3USB"};
225 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
226 }];
227 }else{
228 [self commandReturnECGUSBError:ECG3USBError_DeviceDisconnect MAC:@""];
229 }
230}
231
232RCT_EXPORT_METHOD(getFilterDataByFileName:(nonnull NSString*)dataFileName markName:(nonnull NSString *)markFileName){
233 ECG3USB *device = [[ECG3USBController shareECG3USBController] getCurrentECG3USBInstace];
234 if (device) {
235 if (!dataFileName || !markFileName){
236 NSString *message = @"input parameter cannot be null";
237 NSDictionary* deviceInfo = @{kACTION:kACTION_SPLICE,kFILTER_ERROR_DESCRIPTION:message,kType:@"ECG3USB",kMAC:device.serialNumber};
238 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
239 } else {
240 __weak typeof(self) weakSelf = self;
241 [device getFilterDataWithDic:@{@"MarkFileName":markFileName,@"DataFileName":dataFileName} success:^(NSArray *resultArray, BOOL finish) {
242 NSDictionary* deviceInfo = @{kACTION:kACTION_FILTER,kFILTER_DATA:resultArray,kMAC:device.serialNumber,kType:@"ECG3USB"};
243 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
244 } error:^(NSString *message) {
245 NSDictionary* deviceInfo = @{kACTION:kACTION_SPLICE,kFILTER_ERROR_DESCRIPTION:message,kType:@"ECG3USB",kMAC:device.serialNumber};
246 [weakSelf sendEventWithName:EVENT_NOTIFY body:deviceInfo];
247
248 }];
249 }
250
251
252
253 }else{
254 [self commandReturnECGUSBError:ECG3USBError_DeviceDisconnect MAC:@""];
255 }
256}
257
258@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2Module.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2Module.h
new file mode 100644
index 0000000..42d9d21
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2Module.h
@@ -0,0 +1,19 @@
1//
2// HS2Module.h
3// ReactNativeIOSLibrary
4//
5// Created by jing on 2018/11/26.
6// Copyright © 2018年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16@interface HS2Module : RCTEventEmitter<RCTBridgeModule>
17
18@end
19
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2Module.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2Module.m
new file mode 100644
index 0000000..376f2f3
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2Module.m
@@ -0,0 +1,277 @@
1//
2// HS2Module.m
3// ReactNativeIOSLibrary
4//
5// Created by jing on 2018/11/26.
6// Copyright © 2018年 daiqingquan. All rights reserved.
7//
8
9#import "HS2Module.h"
10#import "HSProfileModule.h"
11#import "HSMacroFile.h"
12#import "HS2Controller.h"
13#import "HS2.h"
14#import "iHealthDeviceManagerModule.h"
15#import "ManageDeviceController.h"
16
17#define EVENT_NOTIFY @"HS2.MODULE.NOTIFY"
18
19@implementation HS2Module
20
21RCT_EXPORT_MODULE()
22- (NSArray<NSString *> *)supportedEvents {
23 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
24 @"event_device_connected", @"event_device_connect_failed",
25 @"event_device_disconnect", @"event_authenticate_result",
26 @"event_notify_ts28b", @"event_notify_bg1",
27 @"action_connect_result_for_bg1"];
28}
29
30
31#pragma mark-init
32
33-(NSDictionary *)constantsToExport{
34 return @{
35 @"Event_Notify" : EVENT_NOTIFY
36 };
37}
38
39+ (BOOL)requiresMainQueueSetup
40{
41 return YES;
42}
43
44-(HS2 *)getHS2WithMac:(NSString *)mac{
45 HS2Controller *controller = [HS2Controller shareIHHs2Controller];
46 NSArray *hs2DeviceArray = [controller getAllCurrentHS2Instace];
47 for (HS2 *tempHS2 in hs2DeviceArray) {
48 if ([mac isEqualToString:tempHS2.deviceID]){
49 return tempHS2;
50 break;
51 }
52 }
53 return nil;
54}
55
56#pragma mark
57#pragma mark - Method
58
59
60#pragma mark-获取连接设备
61RCT_EXPORT_METHOD(getAllConnectedDevices){
62
63
64 NSArray*hs2array= [[HS2Controller shareIHHs2Controller] getAllCurrentHS2Instace];
65
66 NSMutableArray*deviceMacArray=[NSMutableArray array];
67
68 for (int i=0; i<[hs2array count]; i++) {
69
70 HS2*hs2=[hs2array objectAtIndex:i];
71
72 [deviceMacArray addObject:hs2.deviceID];
73
74 }
75
76 NSDictionary* deviceInfo = @{@"action":@"action_get_all_connected_devices",@"devices":deviceMacArray};
77 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
78
79
80}
81
82RCT_EXPORT_METHOD(getBattery:(nonnull NSString*)mac){
83 if ([self getHS2WithMac:mac] != nil) {
84
85 [[self getHS2WithMac:mac]commandGetHS2Battery:^(NSNumber *battary) {
86
87 NSDictionary *deviceInfo = @{@"mac":mac,@"action":ACTION_BATTARY_HS,BATTERY_HS:battary};
88
89 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
90
91 } DiaposeErrorBlock:^(HS2DeviceError errorID) {
92
93 }];
94
95 }
96}
97RCT_EXPORT_METHOD(getOfflineData:(nonnull NSString*)mac){
98 if ([self getHS2WithMac:mac] != nil) {
99
100 NSLog(@"上传离线数据");
101
102 [[self getHS2WithMac:mac]commandHS2TransferMemorryData:^(NSDictionary *startDataDictionary) {
103
104 } DisposeProgress:^(NSNumber *progress) {
105
106 } MemorryData:^(NSArray *historyDataArray) {
107 if(historyDataArray != nil){
108
109 if(historyDataArray.count){
110
111 NSMutableArray*dataArray=[NSMutableArray array];
112
113 for (int i=0; i<historyDataArray.count; i++) {
114
115 NSDate *tempDate = [[historyDataArray objectAtIndex:i] objectForKey:@"date"];
116
117
118 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
119 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
120 NSString *dateStr = [mydateFormatter stringFromDate:tempDate];
121
122
123 NSDictionary*dic=@{DATAID:[[historyDataArray objectAtIndex:i] objectForKey:@"dataID"],MEASUREMENT_DATE_HS:dateStr,WEIGHT_HS:[[historyDataArray objectAtIndex:i] objectForKey:@"weight"]};
124
125 [dataArray addObject:dic];
126 }
127
128
129 NSDictionary *deviceInfo = @{@"mac":mac,@"action":ACTION_HISTORICAL_DATA_HS,HISTORDATA_HS:dataArray};
130
131 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
132 NSLog(@"historyDataArray:%@",historyDataArray);
133
134 }
135
136 }
137 } FinishTransmission:^{
138 NSDictionary *deviceInfo = @{@"mac":mac,@"action":ACTION_HISTORICAL_DATA_COMPLETE_HS};
139
140 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
141 } DisposeErrorBlock:^(HS2DeviceError errorID) {
142 NSString *errorMassage = [NSString string];
143 NSLog(@"errorID:%d",errorID);
144 switch (errorID) {
145 case 1:
146 errorMassage = @"Battery level is low";
147 break;
148 case 2:
149 errorMassage = @"The Scale failed to initialize.";
150 break;
151 case 5:
152 errorMassage = @"Bluetooth connection error.";
153 break;
154 case 7:
155 errorMassage = @"Invalidate.";
156 break;
157 case 8:
158 errorMassage = @"Scale memory access error.";
159 break;
160 case 9:
161 errorMassage = @"No History Data.";
162 break;
163 case 10:
164 errorMassage = @"Device disconnect.";
165 break;
166 // case 11:
167 // errorMassage = @"Communication error.";
168 // break;
169 default:
170 break;
171 }
172 if(errorID == 9){
173 NSDictionary *deviceInfo = @{@"mac":mac,@"action":ACTION_NO_HISTORICALDATA,ERROR_DESCRIPTION_HS:@"No History Data."};
174
175 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
176 }
177 else if(errorID != 11){
178 NSDictionary *deviceInfo = @{@"mac":mac,@"action":ACTION_ERROR_HS,ERROR_NUM_HS:errorMassage};
179
180 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];}
181 }];
182
183 }
184}
185
186
187RCT_EXPORT_METHOD(measureOnline:(nonnull NSString*)mac :(nonnull NSNumber*)unit :(nonnull NSNumber*)userId){
188 if ([self getHS2WithMac:mac] != nil) {
189 HSUnit tempUnit;
190
191 switch ([unit intValue]) {
192 case 1:
193 tempUnit=HSUnit_Kg;
194 break;
195 case 2:
196 tempUnit=HSUnit_LB;
197 break;
198 case 3:
199 tempUnit=HSUnit_ST;
200 break;
201 default:
202 tempUnit=HSUnit_Kg;
203 break;
204 }
205
206 [[self getHS2WithMac:mac]commandHS2MeasureWithUint:tempUnit Weight:^(NSNumber *unStableWeight) {
207 NSDictionary *deviceInfo = @{@"mac":mac,@"action":ACTION_LIVEDATA_HS,LIVEDATA_HS:unStableWeight};
208 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
209 } StableWeight:^(NSDictionary *StableWeightDic) {
210 NSDictionary *deviceInfo =@{@"mac":mac,@"action":ACTION_ONLINE_RESULT_HS,DATAID:[StableWeightDic valueForKey:@"dataID"],WEIGHT_HS:[StableWeightDic valueForKey:@"Weight"] };
211
212 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
213 } DisposeErrorBlock:^(HS2DeviceError errorID) {
214 NSString *errorMassage = [NSString string];
215 switch (errorID) {
216 case 1:
217 errorMassage = @"Battery level is low.";
218 break;
219 case 2:
220 errorMassage = @"The Scale failed to initialize.";
221 break;
222 case 3:
223 errorMassage = @"Maximum weight has been exceeded.";
224 break;
225 case 4:
226 errorMassage = @"The Scale can't capture a steady reading.";
227 break;
228 case 5:
229 errorMassage = @"Bluetooth connection error.";
230 break;
231 case 6:
232 errorMassage = @"Movement while measuring.";
233 break;
234 case 7:
235 errorMassage = @"Invalidate.";
236 break;
237 case 10:
238 errorMassage = @"Device disconnect.";
239 break;
240 case 11:
241 errorMassage = @"Communication error.";
242 break;
243 case 12:
244 errorMassage = @"HS4DeviceRecWeightError.";
245 break;
246 default:
247 break;
248 }
249
250 NSDictionary *deviceInfo = @{@"mac":mac,@"action":ACTION_ERROR_HS,ERROR_NUM_HS:errorMassage};
251 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
252 }];
253
254
255 }
256
257}
258
259RCT_EXPORT_METHOD(disconnect:(nonnull NSString*)mac){
260 if ([self getHS2WithMac:mac] != nil){
261
262 [[self getHS2WithMac:mac]commandDisconnectDevice];
263 NSLog(@"End device connnect!");
264
265 }else{
266
267 }
268}
269- (void)sendErrorWithCode:(NSInteger)errorCode{
270 [self sendEventWithAction:@"ACTION_ERROR_HS" keyString:@"value" valueString:@(errorCode)];
271}
272
273- (void)sendEventWithAction:(NSString*)actionName keyString:(NSString*)key valueString:(id)value{
274 [self sendEventWithName:@"HS2.MODULE.NOTIFY" body:@{@"action":actionName,key:value}];
275}
276
277@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SModule.h
new file mode 100644
index 0000000..6352636
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SModule.h
@@ -0,0 +1,19 @@
1//
2// HS2Module.h
3// ReactNativeIOSLibrary
4//
5// Created by jing on 2018/11/26.
6// Copyright © 2018年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16@interface HS2SModule : RCTEventEmitter<RCTBridgeModule>
17
18@end
19
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SModule.m
new file mode 100644
index 0000000..c048ca8
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SModule.m
@@ -0,0 +1,1052 @@
1//
2// HS2Module.m
3// ReactNativeIOSLibrary
4//
5// Created by jing on 2018/11/26.
6// Copyright © 2018年 daiqingquan. All rights reserved.
7//
8
9#import "HS2SModule.h"
10#import "HS2SProfileModule.h"
11#import "HSMacroFile.h"
12#import "HS2SController.h"
13#import "HS2S.h"
14#import "iHealthDeviceManagerModule.h"
15#import "ManageDeviceController.h"
16
17#define EVENT_NOTIFY @"HS2S.MODULE.NOTIFY"
18#define kMAC_KEY @"mac"
19#define kACTION_KEY @"action"
20#define kTYPE_KEY @"type"
21
22#define kTYPE_HS2S @"HS2S"
23
24@implementation HS2SModule
25
26RCT_EXPORT_MODULE()
27- (NSArray<NSString *> *)supportedEvents {
28 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
29 @"event_device_connected", @"event_device_connect_failed",
30 @"event_device_disconnect", @"event_authenticate_result",
31 @"event_notify_ts28b", @"event_notify_bg1",
32 @"action_connect_result_for_bg1"];
33}
34
35
36#pragma mark-init
37
38-(NSDictionary *)constantsToExport{
39 return @{
40 @"Event_Notify" : EVENT_NOTIFY
41 };
42}
43
44+ (BOOL)requiresMainQueueSetup
45{
46 return YES;
47}
48
49-(HS2S *)getHS2SWithMac:(NSString *)mac{
50 HS2SController *controller = [HS2SController shareIHHS2SController];
51 NSArray *hs2sDeviceArray = [controller getAllCurrentHS2SInstace];
52 for (HS2S *tempHS2S in hs2sDeviceArray) {
53 if ([mac isEqualToString:tempHS2S.serialNumber]){
54 return tempHS2S;
55 break;
56 }
57 }
58 return nil;
59}
60
61#pragma mark
62#pragma mark - Method
63
64
65#pragma mark-获取连接设备
66RCT_EXPORT_METHOD(getAllConnectedDevices){
67
68
69 NSArray*hs2sarray= [[HS2SController shareIHHS2SController] getAllCurrentHS2SInstace];
70
71 NSMutableArray*deviceMacArray=[NSMutableArray array];
72
73 for (int i=0; i<[hs2sarray count]; i++) {
74
75 HS2S*hs2s=[hs2sarray objectAtIndex:i];
76
77 [deviceMacArray addObject:hs2s.serialNumber];
78
79 }
80
81 NSDictionary* deviceInfo = @{kACTION_KEY:ACTION_GET_ALL_CONNECTED_DEVICES,@"devices":deviceMacArray};
82 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
83
84
85}
86
87RCT_EXPORT_METHOD(getDeviceInfo:(nonnull NSString*)mac){
88 if ([self getHS2SWithMac:mac] != nil) {
89
90 [[self getHS2SWithMac:mac] commandGetHS2SDeviceInfo:^(NSDictionary *deviceInfo) {
91
92
93 NSDictionary* deviceInfoDic = @{kMAC_KEY:mac,
94 kTYPE_KEY:kTYPE_HS2S,
95 kACTION_KEY:ACTION_GET_HS2S_DEVICE_INFO,
96 HS2S_DEVICE_BATTERY:[deviceInfo valueForKey:@"Battary"],
97 HS2S_DEVICE_UNIT:[deviceInfo valueForKey:@"Unit"],
98 HS2S_DEVICE_USER_COUNT:[deviceInfo valueForKey:@"UserCount"]
99 };
100 [self sendEventWithName:EVENT_NOTIFY body:deviceInfoDic];
101
102 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
103
104 [self sendHS2SErrorCode:errorID mac:mac];
105 }];
106
107 }
108}
109
110RCT_EXPORT_METHOD(getBattery:(nonnull NSString*)mac){
111 if ([self getHS2SWithMac:mac] != nil) {
112
113 [[self getHS2SWithMac:mac]commandGetHS2SBattery:^(NSNumber *battary) {
114
115 NSDictionary *deviceInfo = @{kMAC_KEY:mac,kTYPE_KEY:kTYPE_HS2S,kACTION_KEY:ACTION_BATTARY_HS,BATTERY_HS:battary};
116
117 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
118
119
120 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
121
122 [self sendHS2SErrorCode:errorID mac:mac];
123
124 }];
125
126 }
127}
128RCT_EXPORT_METHOD(setUnit:(nonnull NSString*)mac :(nonnull NSNumber*)unit){
129
130
131 if ([self getHS2SWithMac:mac] != nil) {
132
133 HSUnit tempUnit;
134
135 switch ([unit intValue]) {
136 case 1:
137 tempUnit=HSUnit_Kg;
138 break;
139 case 2:
140 tempUnit=HSUnit_LB;
141 break;
142 case 3:
143 tempUnit=HSUnit_ST;
144 break;
145 default:
146 tempUnit=HSUnit_Kg;
147 break;
148 }
149
150
151 __weak typeof(self) weakSelf = self;
152
153 [[self getHS2SWithMac:mac] commandSetHS2SUnit:tempUnit result:^(BOOL result) {
154
155 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
156
157 kMAC_KEY:mac,
158
159 kTYPE_KEY:kTYPE_HS2S,
160
161 kACTION_KEY:ACTION_SET_HS2S_UNIT,
162
163 HS2S_SET_RESULT:[NSNumber numberWithBool:result]
164
165 }];
166
167 } DisposeErrorBlock:^(HS2SDeviceError errorID) {
168
169 [self sendHS2SErrorCode:errorID mac:mac];
170
171 }];
172
173 }
174
175}
176
177RCT_EXPORT_METHOD(getUserInfo:(nonnull NSString*)mac){
178
179 if ([self getHS2SWithMac:mac] != nil) {
180
181 __weak typeof(self) weakSelf = self;
182
183 [[self getHS2SWithMac:mac]commandGetHS2SUserInfo:^(NSDictionary *userInfo) {
184
185
186 NSMutableArray*tempUserArray=[userInfo valueForKey:@"UserInfo"];
187
188 NSMutableArray*resultArray=[NSMutableArray array];
189
190
191 if (tempUserArray>0) {
192
193 for (int i=0; i<tempUserArray.count; i++) {
194
195 NSMutableDictionary*tempDic=[tempUserArray objectAtIndex:i];
196
197 NSMutableDictionary*resultDic=[NSMutableDictionary dictionary];
198
199 [resultDic setValue:[tempDic valueForKey:@"UserInfo_Fitness"] forKey:HS2S_BODYBUILDING];
200
201 [resultDic setValue:[tempDic valueForKey:@"UserInfo_ImpedanceMark"] forKey:HS2S_IMPEDANCE];
202
203 [resultDic setValue:[tempDic valueForKey:@"UserInfo_Height"] forKey:HS2S_HEIGHT];
204
205 [resultDic setValue:[tempDic valueForKey:@"UserInfo_Age"] forKey:HS2S_AGE];
206
207 [resultDic setValue:[tempDic valueForKey:@"UserInfo_SEX"] forKey:HS2S_GENDER];
208
209 [resultDic setValue:[tempDic valueForKey:@"UserInfo_Weight"] forKey:HS2S_WEIGTH];
210
211
212 [resultDic setValue:[tempDic valueForKey:@"UserInfo_CreatTS"] forKey:HS2S_CREATE_TIME];
213
214
215 NSString * userIDstr =[[NSString alloc] initWithData:[tempDic valueForKey:@"UserInfo_ID"] encoding:NSUTF8StringEncoding];
216
217 [resultDic setValue:userIDstr forKey:HS2S_USER_ID];
218
219 [resultArray addObject:resultDic];
220
221 }
222 }
223
224
225
226
227 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
228
229 kMAC_KEY:mac,
230
231 kTYPE_KEY:kTYPE_HS2S,
232
233 kACTION_KEY:ACTION_GET_HS2S_USER_INFO,
234
235 HS2S_USER_INFO_COUNT:[userInfo valueForKey:@"UserCount"],
236
237 HS2S_USER_INFO_ARRAY:resultArray
238 }];
239
240 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
241
242 [self sendHS2SErrorCode:errorID mac:mac];
243
244 }];
245
246 }
247}
248
249RCT_EXPORT_METHOD(updateUserInfo:(nonnull NSString*)mac :(nonnull NSString*)userID :(nonnull NSNumber*)createTS :(nonnull NSNumber*)weight :(nonnull NSNumber*)age :(nonnull NSNumber*)height :(nonnull NSNumber*)sex :(nonnull NSNumber*)impedanceMark :(nonnull NSNumber*)fitnessMark){
250
251 if ([self getHS2SWithMac:mac] != nil) {
252
253
254 HealthUser*user=[HealthUser new];
255
256
257 NSData *data =[userID dataUsingEncoding:NSUTF8StringEncoding];
258
259 user.hs2SUserID=data;
260
261 user.createTS=[createTS integerValue];
262
263 user.weight=weight;
264
265 user.age=age;
266
267 user.height=height;
268
269 if ([sex integerValue]==0) {
270
271 user.sex=UserSex_Female;
272
273 }else{
274
275 user.sex=UserSex_Male;
276 }
277
278 if ([impedanceMark integerValue]==0) {
279
280 user.impedanceMark=HS2SImpedanceMark_NO;
281
282 }else{
283
284 user.impedanceMark=HS2SImpedanceMark_YES;
285 }
286
287 if ([fitnessMark integerValue]==0) {
288
289 user.fitnessMark=HS2SFitnessMark_NO;
290
291 }else{
292
293 user.fitnessMark=HS2SFitnessMark_YES;
294 }
295
296 __weak typeof(self) weakSelf = self;
297
298 [[self getHS2SWithMac:mac] commandUpdateHS2SUserInfoWithUser:user result:^(BOOL result) {
299
300
301 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
302
303 kMAC_KEY:mac,
304
305 kTYPE_KEY:kTYPE_HS2S,
306
307 kACTION_KEY:ACTION_UPDATE_HS2S_USER_INFO,
308
309 HS2S_SET_RESULT:[NSNumber numberWithBool:result]
310
311 }];
312
313
314 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
315
316 [self sendHS2SErrorCode:errorID mac:mac];
317 }];
318
319 }
320
321}
322
323RCT_EXPORT_METHOD(deleteUser:(nonnull NSString*)mac :(nonnull NSString*)userID){
324
325
326 NSData *userIDData =[userID dataUsingEncoding:NSUTF8StringEncoding];
327
328
329 __weak typeof(self) weakSelf = self;
330
331 if ([self getHS2SWithMac:mac] != nil) {
332
333 [[self getHS2SWithMac:mac]commandDeleteHS2SUserWithUserID:userIDData result:^(BOOL result) {
334
335 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
336
337 kMAC_KEY:mac,
338
339 kTYPE_KEY:kTYPE_HS2S,
340
341 kACTION_KEY:ACTION_DELETE_HS2S_USER,
342
343 HS2S_SET_RESULT:[NSNumber numberWithBool:result]
344
345 }];
346
347 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
348
349 [self sendHS2SErrorCode:errorID mac:mac];
350 }];
351
352 }
353}
354
355RCT_EXPORT_METHOD(getMemoryDataCount:(nonnull NSString*)mac :(nonnull NSString*)userID){
356
357
358 NSData *userIDData =[userID dataUsingEncoding:NSUTF8StringEncoding];
359
360 __weak typeof(self) weakSelf = self;
361
362 if ([self getHS2SWithMac:mac] != nil) {
363
364 [[self getHS2SWithMac:mac]commandGetHS2SMemoryDataCountWithUserID:userIDData memoryCount:^(NSNumber *count) {
365
366 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
367
368 kMAC_KEY:mac,
369
370 kTYPE_KEY:kTYPE_HS2S,
371
372 kACTION_KEY:ACTION_GET_HS2S_MEMORY_COUNT,
373
374 MEMORY_COUNT:count
375
376 }];
377
378 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
379
380 [self sendHS2SErrorCode:errorID mac:mac];
381 }];
382
383 }
384}
385
386RCT_EXPORT_METHOD(getMemoryData:(nonnull NSString*)mac :(nonnull NSString*)userID){
387
388
389 NSData *userIDData =[userID dataUsingEncoding:NSUTF8StringEncoding];
390
391 __weak typeof(self) weakSelf = self;
392
393 if ([self getHS2SWithMac:mac] != nil) {
394
395 [[self getHS2SWithMac:mac]commandGetHS2SMemoryDataWithUserID:userIDData memoryData:^(NSArray *data) {
396
397
398
399 NSMutableArray*resultArray=[NSMutableArray array];
400
401
402 if (data>0) {
403
404 for (int i=0; i<data.count; i++) {
405
406 NSMutableDictionary*tempDic=[data objectAtIndex:i];
407
408 NSMutableDictionary*resultDic=[NSMutableDictionary dictionary];
409
410 [resultDic setValue:[tempDic valueForKey:@"UserInfo_Fitness"] forKey:HS2S_BODYBUILDING];
411
412 [resultDic setValue:[tempDic valueForKey:@"UserInfo_ImpedanceMark"] forKey:HS2S_IMPEDANCE];
413
414 [resultDic setValue:[tempDic valueForKey:@"UserInfo_Height"] forKey:HS2S_HEIGHT];
415
416 [resultDic setValue:[tempDic valueForKey:@"UserInfo_Age"] forKey:HS2S_AGE];
417
418 [resultDic setValue:[tempDic valueForKey:@"UserInfo_SEX"] forKey:HS2S_GENDER];
419
420// [resultDic setValue:[tempDic valueForKey:@"UserInfo_Weight"] forKey:HS2S_WEIGTH];
421
422 [resultDic setValue:[tempDic valueForKey:@"HS2SWeigthResult"] forKey:HS2S_WEIGTH];
423
424 NSDate *tempDate =[tempDic valueForKey:@"HS2SMeasureTS"];
425
426
427 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
428
429
430 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
431
432
433 NSString *dateStr = [mydateFormatter stringFromDate:tempDate];
434
435 [resultDic setValue:dateStr forKey:HS2S_MEASURE_TIME];
436
437 [resultDic setValue:[tempDic valueForKey:@"HS2SBodyWeightFlag"] forKey:HS2S_INSTRUCTION_TYPE];
438
439 if ([[tempDic valueForKey:@"HS2SBodyWeightFlag"] intValue]==1) {
440
441
442 [resultDic setValue:[tempDic valueForKey:@"HS2SFatWeight"] forKey:HS2S_FAT_WEIGHT];
443
444 [resultDic setValue:[tempDic valueForKey:@"HS2SFatControl"] forKey:HS2S_FAT_CONTROL];
445
446 [resultDic setValue:[tempDic valueForKey:@"HS2SWeightControl"] forKey:HS2S_WEIGHT_CONTROL];
447
448 [resultDic setValue:[tempDic valueForKey:@"HS2SStandardWeight"] forKey:HS2S_STANDARD_WEIGHT];
449
450 [resultDic setValue:[tempDic valueForKey:@"HS2SSkeletalMuscle"] forKey:HS2S_STANDARD_WEIGHT];
451
452 [resultDic setValue:[tempDic valueForKey:@"HS2SBodyWaterPercentAge"] forKey:HS2S_BODY_WATER_RATE];
453
454 [resultDic setValue:[tempDic valueForKey:@"HS2SMuscle"] forKey:HS2S_MUSCLE_MASS];
455
456 [resultDic setValue:[tempDic valueForKey:@"HS2SMuscleControl"] forKey:HS2S_MUSCLE_CONTROL];
457
458 [resultDic setValue:[tempDic valueForKey:@"HS2SProteinPercentAge"] forKey:HS2S_PHYSICAL_AGE];
459
460 [resultDic setValue:[tempDic valueForKey:@"HS2SVFR"] forKey:HS2S_VISCERAL_FAT_GRADE];
461
462 [resultDic setValue:[tempDic valueForKey:@"HS2SResultBodyFatPercentAge"] forKey:HS2S_BODY_FIT_PERCENTAGE];
463
464 [resultDic setValue:[tempDic valueForKey:@"HS2SBoneMineral"] forKey:HS2S_BONE_SALT_CONTENT];
465
466
467 }
468
469 [resultArray addObject:resultDic];
470
471 }
472 }
473
474
475
476 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
477
478 kMAC_KEY:mac,
479
480 kTYPE_KEY:kTYPE_HS2S,
481
482 kACTION_KEY:ACTION_GET_HS2S_MEMORY_DATA,
483
484 MEMORY_DATA:resultArray
485
486 }];
487
488 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
489
490 [self sendHS2SErrorCode:errorID mac:mac];
491
492 }];
493
494 }
495}
496
497RCT_EXPORT_METHOD(deleteMemoryData:(nonnull NSString*)mac :(nonnull NSString*)userID){
498
499
500 NSData *userIDData =[userID dataUsingEncoding:NSUTF8StringEncoding];
501
502 __weak typeof(self) weakSelf = self;
503
504 if ([self getHS2SWithMac:mac] != nil) {
505
506 [[self getHS2SWithMac:mac]commandDeleteHS2SMemoryDataWithUserID:userIDData result:^(BOOL result) {
507
508 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
509
510 kMAC_KEY:mac,
511
512 kTYPE_KEY:kTYPE_HS2S,
513
514 kACTION_KEY:ACTION_DELETE_HS2S_MEMORY_DATA,
515
516 HS2S_SET_RESULT:[NSNumber numberWithBool:result]
517
518 }];
519
520 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
521
522 [self sendHS2SErrorCode:errorID mac:mac];
523
524 }];
525
526 }
527}
528
529RCT_EXPORT_METHOD(getAnonymousMemoryDataCount:(nonnull NSString*)mac){
530
531 __weak typeof(self) weakSelf = self;
532
533 if ([self getHS2SWithMac:mac] != nil) {
534
535 [[self getHS2SWithMac:mac]commandGetHS2SAnonymousMemoryDataCount:^(NSNumber *count) {
536
537 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
538
539 kMAC_KEY:mac,
540
541 kTYPE_KEY:kTYPE_HS2S,
542
543 kACTION_KEY:ACTION_GET_HS2S_ANONYMOUS_MEMORY_COUNT,
544
545 MEMORY_COUNT:count
546
547 }];
548
549 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
550
551 [self sendHS2SErrorCode:errorID mac:mac];
552
553 }];
554
555 }
556}
557
558RCT_EXPORT_METHOD(getAnonymousMemoryData:(nonnull NSString*)mac){
559
560
561 __weak typeof(self) weakSelf = self;
562
563
564 if ([self getHS2SWithMac:mac] != nil) {
565
566 [[self getHS2SWithMac:mac]commandGetHS2SAnonymousMemoryData:^(NSArray *data) {
567
568
569 NSMutableArray*resultArray=[NSMutableArray array];
570
571
572 if (data>0) {
573
574 for (int i=0; i<data.count; i++) {
575
576 NSMutableDictionary*tempDic=[data objectAtIndex:i];
577
578 NSMutableDictionary*resultDic=[NSMutableDictionary dictionary];
579
580
581 NSDate *tempDate =[tempDic valueForKey:@"HS2SMeasureTS"];
582
583 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
584
585 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
586
587 NSString *dateStr = [mydateFormatter stringFromDate:tempDate];
588
589 [resultDic setValue:[tempDic valueForKey:@"HS2SWeigthResult"] forKey:HS2S_WEIGTH];
590
591 [resultDic setValue:dateStr forKey:HS2S_MEASURE_TIME];
592
593 [resultArray addObject:resultDic];
594
595 }
596 }
597
598
599 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
600
601 kMAC_KEY:mac,
602
603 kTYPE_KEY:kTYPE_HS2S,
604
605 kACTION_KEY:ACTION_GET_HS2S_ANONYMOUS_MEMORY_DATA,
606
607 MEMORY_DATA:resultArray
608
609 }];
610
611 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
612
613 [self sendHS2SErrorCode:errorID mac:mac];
614
615 }];
616
617 }
618}
619
620RCT_EXPORT_METHOD(deleteAnonymousMemoryData:(nonnull NSString*)mac){
621
622 __weak typeof(self) weakSelf = self;
623
624
625 if ([self getHS2SWithMac:mac] != nil) {
626
627 [[self getHS2SWithMac:mac]commandDeleteHS2SAnonymousMemoryData:^(BOOL result) {
628
629 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
630
631 kMAC_KEY:mac,
632
633 kTYPE_KEY:kTYPE_HS2S,
634
635 kACTION_KEY:ACTION_DELETE_HS2S_ANONYMOUS_MEMORY_DATA,
636
637 HS2S_SET_RESULT:[NSNumber numberWithBool:result]
638
639 }];
640
641 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
642
643 [self sendHS2SErrorCode:errorID mac:mac];
644
645 }];
646
647 }
648}
649
650RCT_EXPORT_METHOD(measure:(nonnull NSString*)mac :(nonnull NSNumber*)userType :(nonnull NSString*)userID :(nonnull NSNumber*)createTS :(nonnull NSNumber*)weight :(nonnull NSNumber*)age :(nonnull NSNumber*)height :(nonnull NSNumber*)sex :(nonnull NSNumber*)impedanceMark :(nonnull NSNumber*)fitnessMark){
651
652
653 if ([self getHS2SWithMac:mac] != nil) {
654
655
656 HealthUser*user=[HealthUser new];
657
658
659 if ([userType integerValue]==0) {
660
661 user.userType=UserType_Guest;
662
663 }else{
664
665 user.userType=UserType_Normal;
666 }
667
668
669 NSData *data =[userID dataUsingEncoding:NSUTF8StringEncoding];
670
671
672 user.hs2SUserID=data;
673
674 user.createTS=[createTS integerValue];
675
676 user.weight=weight;
677
678 user.age=age;
679
680 user.height=height;
681
682 if ([sex integerValue]==0) {
683
684 user.sex=UserSex_Female;
685
686 }else{
687
688 user.sex=UserSex_Male;
689 }
690
691 if ([impedanceMark integerValue]==0) {
692
693 user.impedanceMark=HS2SImpedanceMark_NO;
694
695 }else{
696
697 user.impedanceMark=HS2SImpedanceMark_YES;
698 }
699
700 if ([fitnessMark integerValue]==0) {
701
702 user.fitnessMark=HS2SFitnessMark_NO;
703
704 }else{
705
706 user.fitnessMark=HS2SFitnessMark_YES;
707 }
708
709
710 [[self getHS2SWithMac:mac]commandStartHS2SMeasureWithUser:user weight:^(NSNumber *unStableWeight) {
711
712 NSDictionary *deviceInfo = @{kMAC_KEY:mac,kTYPE_KEY:kTYPE_HS2S,kACTION_KEY:ACTION_HS2S_ONLINE_DATA,HS2S_WEIGTH:unStableWeight};
713 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
714
715 } stableWeight:^(NSNumber *stableWeight) {
716
717 NSDictionary *deviceInfo =@{kMAC_KEY:mac,kTYPE_KEY:kTYPE_HS2S,kACTION_KEY:ACTION_HS2S_ONLINE_RESULT,HS2S_WEIGTH:stableWeight };
718
719 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
720
721 } weightAndBodyInfo:^(NSDictionary *weightAndBodyInfoDic) {
722
723 NSMutableDictionary*resultDic=[NSMutableDictionary dictionary];
724
725 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"UserInfo_Fitness"] forKey:HS2S_BODYBUILDING];
726
727 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"UserInfo_ImpedanceMark"] forKey:HS2S_IMPEDANCE];
728
729 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"UserInfo_Height"] forKey:HS2S_HEIGHT];
730
731 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"UserInfo_Age"] forKey:HS2S_AGE];
732
733 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"UserInfo_SEX"] forKey:HS2S_GENDER];
734
735 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"HS2SWeigthResult"] forKey:HS2S_WEIGTH];
736
737 NSDate *tempDate =[weightAndBodyInfoDic valueForKey:@"HS2SMeasureTS"];
738
739
740 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
741
742 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
743
744 NSString *dateStr = [mydateFormatter stringFromDate:tempDate];
745
746
747 [resultDic setValue:dateStr forKey:HS2S_MEASURE_TIME];
748
749 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"HS2SBodyWeightFlag"] forKey:HS2S_INSTRUCTION_TYPE];
750
751 if ([[weightAndBodyInfoDic valueForKey:@"HS2SBodyWeightFlag"] intValue]==1) {
752
753
754 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"HS2SFatWeight"] forKey:HS2S_FAT_WEIGHT];
755
756 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"HS2SFatControl"] forKey:HS2S_FAT_CONTROL];
757
758 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"HS2SWeightControl"] forKey:HS2S_WEIGHT_CONTROL];
759
760 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"HS2SStandardWeight"] forKey:HS2S_STANDARD_WEIGHT];
761
762 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"HS2SSkeletalMuscle"] forKey:HS2S_STANDARD_WEIGHT];
763
764 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"HS2SBodyWaterPercentAge"] forKey:HS2S_BODY_WATER_RATE];
765
766 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"HS2SMuscle"] forKey:HS2S_MUSCLE_MASS];
767
768 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"HS2SMuscleControl"] forKey:HS2S_MUSCLE_CONTROL];
769
770 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"HS2SProteinPercentAge"] forKey:HS2S_PHYSICAL_AGE];
771
772 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"HS2SVFR"] forKey:HS2S_VISCERAL_FAT_GRADE];
773
774 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"HS2SResultBodyFatPercentAge"] forKey:HS2S_BODY_FIT_PERCENTAGE];
775
776 [resultDic setValue:[weightAndBodyInfoDic valueForKey:@"HS2SBoneMineral"] forKey:HS2S_BONE_SALT_CONTENT];
777
778
779 }
780
781
782 NSDictionary *deviceInfo =@{kMAC_KEY:mac,kTYPE_KEY:kTYPE_HS2S,kACTION_KEY:ACTION_HS2S_BODYFAT_RESULT,HS2S_DATA_BODY_FAT_RESULT:resultDic };
783
784 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
785
786
787 } disposeHS2SMeasureFinish:^{
788
789 NSDictionary *deviceInfo =@{kMAC_KEY:mac,kTYPE_KEY:kTYPE_HS2S,kACTION_KEY:ACTION_HS2S_MEASURE_FINISH};
790
791 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
792
793 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
794
795 [self sendHS2SErrorCode:errorID mac:mac];
796
797 }];
798
799 }
800}
801
802
803RCT_EXPORT_METHOD(resetDevice:(nonnull NSString*)mac){
804
805
806 __weak typeof(self) weakSelf = self;
807
808
809 if ([self getHS2SWithMac:mac] != nil) {
810
811 [[self getHS2SWithMac:mac]commandResetHS2SDevice:^(BOOL result) {
812
813 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
814
815 kMAC_KEY:mac,
816
817 kTYPE_KEY:kTYPE_HS2S,
818
819 kACTION_KEY:ACTION_HS2S_RESET_DEVICE,
820
821 HS2S_SET_RESULT:[NSNumber numberWithBool:result]
822
823 }];
824
825 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
826
827 [self sendHS2SErrorCode:errorID mac:mac];
828
829 }];
830
831 }
832}
833
834//RCT_EXPORT_METHOD(broadCastTypeDevice:(nonnull NSString*)mac){
835//
836//
837// __weak typeof(self) weakSelf = self;
838//
839//
840// if ([self getHS2SWithMac:mac] != nil) {
841//
842// [[self getHS2SWithMac:mac]commandBroadCastTypeHS2SDevice:^(BOOL result) {
843//
844// [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
845//
846// kMAC_KEY:mac,
847//
848// kTYPE_KEY:kTYPE_HS2S,
849//
850// kACTION_KEY:ACTION_BroadCastType_DEVICE,
851//
852// HS2S_SET_RESULT:[NSNumber numberWithBool:result]
853//
854// }];
855//
856// } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
857//
858// [self sendHS2SErrorCode:errorID mac:mac];
859//
860// }];
861//
862// }
863//}
864
865
866RCT_EXPORT_METHOD(setDeviceLightUp:(nonnull NSString*)mac){
867
868
869 __weak typeof(self) weakSelf = self;
870
871
872 if ([self getHS2SWithMac:mac] != nil) {
873
874
875 [[self getHS2SWithMac:mac] commandSetHS2SDeviceLightUp:^(BOOL result) {
876 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
877
878 kMAC_KEY:mac,
879
880 kTYPE_KEY:kTYPE_HS2S,
881
882 kACTION_KEY:ACTION_HS2S_LightUp_DEVICE,
883
884 HS2S_SET_RESULT:[NSNumber numberWithBool:result]
885
886 }];
887 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
888
889 [self sendHS2SErrorCode:errorID mac:mac];
890
891 }];
892
893
894 }
895}
896
897
898RCT_EXPORT_METHOD(enterHS2SHeartRateMeasurementMode:(nonnull NSString*)mac){
899
900
901 __weak typeof(self) weakSelf = self;
902
903
904 if ([self getHS2SWithMac:mac] != nil) {
905
906
907 [[self getHS2SWithMac:mac] commandEnterHS2SHeartRateMeasurementMode:^(NSDictionary *heartResultDic) {
908
909 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
910
911 kMAC_KEY:mac,
912
913 kTYPE_KEY:kTYPE_HS2S,
914
915 kACTION_KEY:ACTION_HS2S_MEASURE_HEARTRATE,
916
917 HS2S_MEASURE_HEARTRATE_RESULT:heartResultDic
918
919 }];
920
921 } measurementStatus:^(NSNumber *measurementStatus) {
922
923
924 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
925
926 kMAC_KEY:mac,
927
928 kTYPE_KEY:kTYPE_HS2S,
929
930 kACTION_KEY:ACTION_HS2S_MEASURE_HEARTRATE_DEVICE_STATUS,
931
932 HS2S_DEVICE_STATUS:measurementStatus
933
934 }];
935
936 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
937
938 [self sendHS2SErrorCode:errorID mac:mac];
939
940 }];
941
942
943 }
944}
945
946
947RCT_EXPORT_METHOD(exitHS2SHeartRateMeasurementMode:(nonnull NSString*)mac){
948
949
950 __weak typeof(self) weakSelf = self;
951
952
953 if ([self getHS2SWithMac:mac] != nil) {
954
955
956 [[self getHS2SWithMac:mac] commandExitHS2SHeartRateMeasurementMode:^(BOOL result) {
957
958
959 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
960
961 kMAC_KEY:mac,
962
963 kTYPE_KEY:kTYPE_HS2S,
964
965 kACTION_KEY:ACTION_HS2S_EXIT_MEASURE_HEARTRATE_STATUS,
966
967 HS2S_SET_RESULT:[NSNumber numberWithBool:result]
968
969 }];
970
971 } DiaposeErrorBlock:^(HS2SDeviceError errorID) {
972
973
974 [self sendHS2SErrorCode:errorID mac:mac];
975
976 }];
977
978
979 }
980}
981
982
983
984
985-(void)sendHS2SErrorCode:(HS2SDeviceError)errorID mac:(NSString*)mac{
986
987
988 NSString *errorMassage = [NSString string];
989 switch (errorID) {
990 case 0:
991 errorMassage = @"HS2SDeviceError_CommunicationTimeout";
992 break;
993 case 1:
994 errorMassage = @"HS2SDeviceError_ReceivedCommandError";
995 break;
996 case 2:
997 errorMassage = @"HS2SDeviceError_InputParameterError";
998 break;
999 case 3:
1000 errorMassage = @"HS2SDeviceError_MoreThanMaxNumbersOfUser";
1001 break;
1002 case 4:
1003 errorMassage = @"HS2SDeviceError_WriteFlashError";
1004 break;
1005 case 5:
1006 errorMassage = @"HS2SDeviceError_UserNotExist";
1007 break;
1008 case 6:
1009 errorMassage = @"HS2SDeviceError_StartMeasureError";
1010 break;
1011 case 7:
1012 errorMassage = @"HS2SDeviceError_MeasureTimeout";
1013 break;
1014 case 8:
1015 errorMassage = @"HS2SDeviceError_MeasureOverweight";
1016 break;
1017
1018 case 9:
1019 errorMassage = @"HS2SDeviceError_Disconnect";
1020 break;
1021 case 10:
1022 errorMassage = @"HS2SDeviceError_Unsupported";
1023 break;
1024
1025 default:
1026 break;
1027 }
1028
1029 NSDictionary *deviceInfo = @{kMAC_KEY:mac,kACTION_KEY:ACTION_ERROR_HS,ERROR_NUM_HS:errorMassage};
1030 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
1031
1032
1033}
1034
1035RCT_EXPORT_METHOD(disconnect:(nonnull NSString*)mac){
1036 if ([self getHS2SWithMac:mac] != nil){
1037
1038 [[self getHS2SWithMac:mac]commandDisconnectDevice];
1039 NSLog(@"End device connnect!");
1040
1041 }else{
1042
1043 }
1044}
1045
1046
1047- (void)sendEventWithAction:(NSString*)actionName keyString:(NSString*)key valueString:(id)value{
1048 [self sendEventWithName:EVENT_NOTIFY body:@{kACTION_KEY:actionName,key:value}];
1049}
1050
1051@end
1052
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SProfileModule.h
new file mode 100644
index 0000000..07862b4
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SProfileModule.h
@@ -0,0 +1,169 @@
1//
2// HSProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by ihealth on 16/12/2.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15
16@interface HS2SProfileModule : NSObject<RCTBridgeModule>
17
18#define ACTION_LIVEDATA_HS @"liveData_hs"
19#define LIVEDATA_HS @"value"
20
21#define ACTION_ONLINE_RESULT_HS @"online_result_hs"
22#define DATAID @"dataID"
23#define WEIGHT_HS @"value"
24#define FAT_HS @""
25#define WATER_HS @""
26#define MUSCLE_HS @""
27#define SKELETON_HS @""
28#define FATELEVEL_HS @""
29#define DCI_HS @""
30
31#define ACTION_GET_ALL_CONNECTED_DEVICES @"action_get_all_connected_devices"
32#define ACTION_HISTORICAL_DATA_HS @"historicaldata_hs"
33#define HISTORDATA_HS @"historyData"
34#define MEASUREMENT_DATE_HS @"date"
35#define ACTION_HISTORICAL_DATA_COMPLETE_HS @"finishTranslate"
36#define ACTION_NO_HISTORICALDATA @"noHistoryData"
37#define BATTERY_HS @"battery_hs"
38#define ACTION_BATTARY_HS @"action_get_battery_hs"
39#define ACTION_ERROR_HS @"error_hs"
40#define ERROR_NUM_HS @"error"
41#define ERROR_ID_ILLEGAL_ARGUMENT @"400"
42#define ERROR_ID_WIFI_DISABLED @""
43#define ERROR_DESCRIPTION_HS @"description"
44
45
46
47#define ACTION_GET_HS2S_DEVICE_INFO @"action_get_device_info"
48
49#define ACTION_SET_HS2S_UNIT @"action_set_unit"
50
51#define ACTION_GET_HS2S_USER_INFO @"action_get_user_info"
52
53#define ACTION_UPDATE_HS2S_USER_INFO @"action_create_or_update_user_info"
54
55#define ACTION_DELETE_HS2S_USER @"action_delete_user_info"
56
57#define ACTION_GET_HS2S_MEMORY_COUNT @"action_history_data_num"
58
59#define ACTION_GET_HS2S_MEMORY_DATA @"action_history_data"
60
61#define ACTION_DELETE_HS2S_MEMORY_DATA @"action_delete_history_data"
62
63#define ACTION_GET_HS2S_ANONYMOUS_MEMORY_COUNT @"action_anonymous_data_num"
64
65#define ACTION_GET_HS2S_ANONYMOUS_MEMORY_DATA @"action_anonymous_data"
66
67#define ACTION_DELETE_HS2S_ANONYMOUS_MEMORY_DATA @"action_delete_anonymous_history_data"
68
69#define ACTION_HS2S_ONLINE_DATA @"action_online_real_time_data"
70
71#define ACTION_HS2S_ONLINE_RESULT @"action_online_result"
72
73#define ACTION_HS2S_BODYFAT_RESULT @"action_body_fat_result"
74
75#define ACTION_ONLINE_WEIGHTANDBody_INFO @"online_weigthandbody_info"
76
77#define ACTION_BroadCastType_DEVICE @"broadCastType_device"
78
79#define ACTION_RESET_DEVICE @"reset_device"
80
81#define ACTION_MEASURE_FINISH @"measure_finish"
82
83#define HS2S_DEVICE_INFO @"device_info"
84
85#define HS2S_DEVICE_BATTERY @"battery"
86
87#define HS2S_DEVICE_UNIT @"unit_current"
88
89#define HS2S_DEVICE_USER_COUNT @"user_count"
90
91#define HS2S_USER_INFO_ARRAY @"user_info_array"
92
93#define HS2S_USER_INFO_COUNT @"user_info_count"
94
95#define HS2S_BODYBUILDING @"body_building"
96
97#define HS2S_IMPEDANCE @"impedance"
98
99#define HS2S_HEIGHT @"height"
100
101#define HS2S_AGE @"age"
102
103#define HS2S_GENDER @"gender"
104
105#define HS2S_WEIGTH @"weight"
106
107#define HS2S_CREATE_TIME @"create_time"
108
109#define HS2S_INSTRUCTION_TYPE @"instruction_type"
110
111#define HS2S_USER_ID @"user_id"
112
113#define MEMORY_COUNT @"history_data_count"
114
115#define MEMORY_DATA @"history_data"
116
117#define HS2S_DATA_BODY_FAT_RESULT @"data_body_fat_result"
118
119#define HS2S_SET_RESULT @"result"
120
121#define ACTION_HS2S_MEASURE_FINISH @"action_measure_finish_at_critical"
122
123#define ACTION_HS2S_RESET_DEVICE @"action_restore_fatory_settings"
124
125#define HS2S_FAT_WEIGHT @"fat_weight"
126
127#define HS2S_FAT_CONTROL @"fat_control"
128
129#define HS2S_WEIGHT_CONTROL @"weight_control"
130
131#define HS2S_STANDARD_WEIGHT @"standard_weight"
132
133#define HS2S_SKELETAL_MUSCLE_MASS @"skeletal_muscle_mass"
134
135#define HS2S_BODY_WATER_RATE @"body_water_rate"
136
137#define HS2S_MUSCLE_MASS @"muscle_mass"
138
139#define HS2S_MUSCLE_CONTROL @"muscle_control"
140
141#define HS2S_PHYSICAL_AGE @"physical_age"
142
143#define HS2S_VISCERAL_FAT_GRADE @"visceral_fat_grade"
144
145#define HS2S_PROTEIN_RATE @"protein_rate"
146
147#define HS2S_BONE_SALT_CONTENT @"bone_salt_content"
148
149#define HS2S_BODY_FIT_PERCENTAGE @"body_fit_percentage"
150
151#define HS2S_MEASURE_TIME @"measure_time"
152
153
154#define ACTION_HS2S_LightUp_DEVICE @"action_lightup_settings"
155
156#define HS2S_DEVICE_STATUS @"device_status"
157
158#define ACTION_HS2S_MEASURE_HEARTRATE_DEVICE_STATUS @"action_measure_heartrate_device_status"
159
160#define ACTION_HS2S_MEASURE_HEARTRATE @"action_measure_heartrate"
161
162#define HS2S_MEASURE_HEARTRATE_RESULT @"measure_heartrate_result"
163
164
165#define ACTION_HS2S_EXIT_MEASURE_HEARTRATE_STATUS @"action_exit_measure_heartrate_status"
166
167
168
169@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SProfileModule.m
new file mode 100644
index 0000000..f906a83
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS2SProfileModule.m
@@ -0,0 +1,167 @@
1//
2// HSProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by ihealth on 16/12/2.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "HS2SProfileModule.h"
10
11@implementation HS2SProfileModule
12
13RCT_EXPORT_MODULE()
14
15#pragma mark
16#pragma mark - constantsToExport
17@synthesize bridge = _bridge;
18
19-(NSDictionary *)constantsToExport{
20 return @{
21 @"ACTION_LIVEDATA_HS" : ACTION_LIVEDATA_HS,
22 @"LIVEDATA_HS" : LIVEDATA_HS,
23
24 @"ACTION_ONLINE_RESULT_HS" : ACTION_ONLINE_RESULT_HS,
25 @"DATAID" : DATAID,
26 @"WEIGHT_HS" : WEIGHT_HS,
27 @"FAT_HS" : FAT_HS,
28 @"WATER_HS" : WATER_HS,
29 @"MUSCLE_HS" : MUSCLE_HS,
30 @"SKELETON_HS" : SKELETON_HS,
31 @"FATELEVEL_HS" : FATELEVEL_HS,
32 @"DCI_HS" : DCI_HS,
33
34
35 @"ACTION_HISTORICAL_DATA_HS" : ACTION_HISTORICAL_DATA_HS,
36 @"HISTORDATA_HS" :HISTORDATA_HS,
37 @"MEASUREMENT_DATE_HS" : MEASUREMENT_DATE_HS,
38 @"ACTION_HISTORICAL_DATA_COMPLETE_HS" :ACTION_HISTORICAL_DATA_COMPLETE_HS,
39 @"ACTION_NO_HISTORICALDATA" : ACTION_NO_HISTORICALDATA,
40
41 @"ACTION_ERROR_HS" : ACTION_ERROR_HS,
42 @"ERROR_NUM_HS" : ERROR_NUM_HS,
43 @"ERROR_ID_ILLEGAL_ARGUMENT" : ERROR_ID_ILLEGAL_ARGUMENT,
44 @"ERROR_ID_WIFI_DISABLED" : ERROR_ID_WIFI_DISABLED,
45 @"ERROR_DESCRIPTION_HS" : ERROR_DESCRIPTION_HS,
46
47 @"ACTION_GET_ALL_CONNECTED_DEVICES":ACTION_GET_ALL_CONNECTED_DEVICES,
48
49 @"ACTION_BATTERY_HS":ACTION_BATTARY_HS,
50 @"BATTERY_HS":BATTERY_HS,
51
52 @"ACTION_GET_HS2S_DEVICE_INFO":ACTION_GET_HS2S_DEVICE_INFO,
53
54 @"ACTION_SET_HS2S_UNIT":ACTION_SET_HS2S_UNIT,
55
56 @"HS2S_DEVICE_INFO":HS2S_DEVICE_INFO,
57
58 @"HS2S_SET_RESULT":HS2S_SET_RESULT,
59
60 @"ACTION_GET_HS2S_USER_INFO":ACTION_GET_HS2S_USER_INFO,
61
62 @"HS2S_USER_INFO_ARRAY":HS2S_USER_INFO_ARRAY,
63
64 @"HS2S_USER_INFO_COUNT":HS2S_USER_INFO_COUNT,
65
66 @"ACTION_UPDATE_HS2S_USER_INFO":ACTION_UPDATE_HS2S_USER_INFO,
67
68 @"ACTION_DELETE_HS2S_USER":ACTION_DELETE_HS2S_USER,
69
70 @"ACTION_GET_HS2S_MEMORY_COUNT":ACTION_GET_HS2S_MEMORY_COUNT,
71
72 @"MEMORY_COUNT":MEMORY_COUNT,
73
74 @"ACTION_GET_HS2S_MEMORY_DATA":ACTION_GET_HS2S_MEMORY_DATA,
75
76 @"MEMORY_DATA":MEMORY_DATA,
77
78 @"ACTION_GET_HS2S_ANONYMOUS_MEMORY_COUNT":ACTION_GET_HS2S_ANONYMOUS_MEMORY_COUNT,
79
80 @"ACTION_GET_HS2S_ANONYMOUS_MEMORY_DATA":ACTION_GET_HS2S_ANONYMOUS_MEMORY_DATA,
81
82 @"ACTION_DELETE_HS2S_ANONYMOUS_MEMORY_DATA":ACTION_DELETE_HS2S_ANONYMOUS_MEMORY_DATA,
83
84 @"ACTION_ONLINE_WEIGHTANDBody_INFO":ACTION_ONLINE_WEIGHTANDBody_INFO,
85
86 @"ACTION_MEASURE_FINISH":ACTION_MEASURE_FINISH,
87
88 @"ACTION_RESET_DEVICE":ACTION_RESET_DEVICE,
89
90 @"ACTION_BroadCastType_DEVICE":ACTION_BroadCastType_DEVICE,
91
92 @"HS2S_DEVICE_BATTERY":HS2S_DEVICE_BATTERY,
93
94 @"HS2S_DEVICE_UNIT":HS2S_DEVICE_UNIT,
95
96 @"HS2S_DEVICE_USER_COUNT":HS2S_DEVICE_USER_COUNT,
97
98 @"HS2S_BODYBUILDING":HS2S_BODYBUILDING,
99
100 @"HS2S_IMPEDANCE":HS2S_IMPEDANCE,
101
102 @"HS2S_HEIGHT":HS2S_HEIGHT,
103
104 @"HS2S_AGE":HS2S_AGE,
105
106 @"HS2S_GENDER":HS2S_GENDER,
107
108 @"HS2S_WEIGTH":HS2S_WEIGTH,
109
110 @"HS2S_CREATE_TIME":HS2S_CREATE_TIME,
111
112 @"HS2S_USER_ID":HS2S_USER_ID,
113
114 @"HS2S_INSTRUCTION_TYPE":HS2S_INSTRUCTION_TYPE,
115
116 @"HS2S_DATA_BODY_FAT_RESULT":HS2S_DATA_BODY_FAT_RESULT,
117
118 @"ACTION_HS2S_ONLINE_DATA":ACTION_HS2S_ONLINE_DATA,
119
120 @"ACTION_HS2S_ONLINE_RESULT":ACTION_HS2S_ONLINE_RESULT,
121
122 @"ACTION_HS2S_BODYFAT_RESULT":ACTION_HS2S_BODYFAT_RESULT,
123
124 @"ACTION_HS2S_MEASURE_FINISH":ACTION_HS2S_MEASURE_FINISH,
125
126 @"ACTION_HS2S_RESET_DEVICE":ACTION_HS2S_RESET_DEVICE,
127
128 @"HS2S_FAT_WEIGHT":HS2S_FAT_WEIGHT,
129
130 @"HS2S_FAT_CONTROL":HS2S_FAT_CONTROL,
131
132 @"HS2S_WEIGHT_CONTROL":HS2S_WEIGHT_CONTROL,
133
134 @"HS2S_WEIGHT_CONTROL":HS2S_WEIGHT_CONTROL,
135
136 @"HS2S_STANDARD_WEIGHT":HS2S_STANDARD_WEIGHT,
137
138 @"HS2S_SKELETAL_MUSCLE_MASS":HS2S_SKELETAL_MUSCLE_MASS,
139
140 @"HS2S_BODY_WATER_RATE":HS2S_BODY_WATER_RATE,
141
142 @"HS2S_MUSCLE_MASS":HS2S_MUSCLE_MASS,
143
144 @"HS2S_MUSCLE_CONTROL":HS2S_MUSCLE_CONTROL,
145
146 @"HS2S_PHYSICAL_AGE":HS2S_PHYSICAL_AGE,
147
148 @"HS2S_VISCERAL_FAT_GRADE":HS2S_VISCERAL_FAT_GRADE,
149
150 @"HS2S_PROTEIN_RATE":HS2S_PROTEIN_RATE,
151
152 @"HS2S_BONE_SALT_CONTENT":HS2S_BONE_SALT_CONTENT,
153
154 @"HS2S_BODY_FIT_PERCENTAGE":HS2S_BODY_FIT_PERCENTAGE,
155
156 @"HS2S_MEASURE_TIME":HS2S_MEASURE_TIME,
157
158 };
159
160}
161
162
163+ (BOOL)requiresMainQueueSetup
164{
165 return YES;
166}
167@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS4SModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS4SModule.h
new file mode 100644
index 0000000..7f4b43e
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS4SModule.h
@@ -0,0 +1,20 @@
1//
2// HS4SModule.h
3// ReactNativeIOSLibrary
4//
5// Created by ihealth on 16/12/2.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16
17
18@interface HS4SModule : RCTEventEmitter<RCTBridgeModule>
19
20@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS4SModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS4SModule.m
new file mode 100644
index 0000000..8538c6f
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS4SModule.m
@@ -0,0 +1,257 @@
1//
2// HS4SModule.m
3// ReactNativeIOSLibrary
4//
5// Created by ihealth on 16/12/2.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "HS4SModule.h"
10#import "HSProfileModule.h"
11#import "HSMacroFile.h"
12#import "HS4Controller.h"
13#import "HS4.h"
14#import "iHealthDeviceManagerModule.h"
15#import "ManageDeviceController.h"
16
17
18#define EVENT_NOTIFY @"HS4.MODULE.NOTIFY"
19
20@implementation HS4SModule
21
22
23RCT_EXPORT_MODULE()
24- (NSArray<NSString *> *)supportedEvents {
25 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
26 @"event_device_connected", @"event_device_connect_failed",
27 @"event_device_disconnect", @"event_authenticate_result",
28 @"event_notify_ts28b", @"event_notify_bg1",
29 @"action_connect_result_for_bg1"];
30}
31
32
33#pragma mark-init
34
35-(NSDictionary *)constantsToExport{
36 return @{
37 @"Event_Notify" : EVENT_NOTIFY
38 };
39}
40
41+ (BOOL)requiresMainQueueSetup
42{
43 return YES;
44}
45-(HS4 *)getHS4WithMac:(NSString *)mac{
46 HS4Controller *controller = [HS4Controller shareIHHs4Controller];
47 NSArray *hs4DeviceArray = [controller getAllCurrentHS4Instace];
48 for (HS4 *tempHS4 in hs4DeviceArray) {
49 if ([mac isEqualToString:tempHS4.deviceID]){
50 return tempHS4;
51 break;
52 }
53 }
54 return nil;
55}
56
57#pragma mark
58#pragma mark - Notification
59#pragma mark - HS4
60-(void)DeviceConnectForHS4S:(NSNotification *)notify{
61 HS4Controller *controller = [HS4Controller shareIHHs4Controller];
62 NSArray *hs4DeviceArray = [controller getAllCurrentHS4Instace];
63
64 HS4 *hs4Instance = [hs4DeviceArray objectAtIndex:0];
65}
66
67#pragma mark
68#pragma mark - Method
69
70
71#pragma mark-获取连接设备
72RCT_EXPORT_METHOD(getAllConnectedDevices){
73
74
75 NSArray*hs4array= [[HS4Controller shareIHHs4Controller] getAllCurrentHS4Instace];
76
77 NSMutableArray*deviceMacArray=[NSMutableArray array];
78
79 for (int i=0; i<[hs4array count]; i++) {
80
81 HS4*hs4=[hs4array objectAtIndex:i];
82
83 [deviceMacArray addObject:hs4.deviceID];
84
85 }
86
87 NSDictionary* deviceInfo = @{@"action":@"action_get_all_connected_devices",@"devices":deviceMacArray};
88 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
89
90
91}
92
93
94RCT_EXPORT_METHOD(getOfflineData:(nonnull NSString*)mac){
95 if ([self getHS4WithMac:mac] != nil) {
96
97 NSLog(@"上传离线数据");
98 [[self getHS4WithMac:mac]commandTransferMemorryData:^(NSDictionary *startDataDictionary) {
99
100
101 } DisposeProgress:^(NSNumber *progress) {
102
103 } MemorryData:^(NSArray *historyDataArray) {
104
105 if(historyDataArray != nil){
106
107 if(historyDataArray.count){
108
109 NSMutableArray*dataArray=[NSMutableArray array];
110
111 for (int i=0; i<historyDataArray.count; i++) {
112
113 NSDate *tempDate = [[historyDataArray objectAtIndex:i] objectForKey:@"date"];
114
115
116 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
117 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
118 NSString *dateStr = [mydateFormatter stringFromDate:tempDate];
119
120
121 NSDictionary*dic=@{DATAID:[[historyDataArray objectAtIndex:i] objectForKey:@"dataID"],MEASUREMENT_DATE_HS:dateStr,WEIGHT_HS:[[historyDataArray objectAtIndex:i] objectForKey:@"weight"]};
122
123 [dataArray addObject:dic];
124 }
125
126
127 NSDictionary *deviceInfo = @{@"mac":mac,@"action":ACTION_HISTORICAL_DATA_HS,HISTORDATA_HS:dataArray};
128
129 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
130 NSLog(@"historyDataArray:%@",historyDataArray);
131
132 }
133
134 }
135 } FinishTransmission:^{
136 NSDictionary *deviceInfo = @{@"mac":mac,@"action":ACTION_HISTORICAL_DATA_COMPLETE_HS};
137
138 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
139 } DisposeErrorBlock:^(HS4DeviceError errorID) {
140 NSString *errorMassage = [NSString string];
141 NSLog(@"errorID:%d",errorID);
142 switch (errorID) {
143 case 1:
144 errorMassage = @"Battery level is low";
145 break;
146 case 2:
147 errorMassage = @"The Scale failed to initialize.";
148 break;
149 case 5:
150 errorMassage = @"Bluetooth connection error.";
151 break;
152 case 7:
153 errorMassage = @"Invalidate.";
154 break;
155 case 8:
156 errorMassage = @"Scale memory access error.";
157 break;
158 case 9:
159 errorMassage = @"No History Data.";
160 break;
161 case 10:
162 errorMassage = @"Device disconnect.";
163 break;
164// case 11:
165// errorMassage = @"Communication error.";
166// break;
167 default:
168 break;
169 }
170 if(errorID == 9){
171 NSDictionary *deviceInfo = @{@"mac":mac,@"action":ACTION_NO_HISTORICALDATA,ERROR_DESCRIPTION_HS:@"No History Data."};
172
173 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
174 }
175 else if(errorID != 11){
176 NSDictionary *deviceInfo = @{@"mac":mac,@"action":ACTION_ERROR_HS,ERROR_NUM_HS:errorMassage};
177
178 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];}
179 }];
180 }
181}
182
183
184RCT_EXPORT_METHOD(measureOnline:(nonnull NSString*)mac :(nonnull NSNumber*)unit :(nonnull NSNumber*)userId){
185 if ([self getHS4WithMac:mac] != nil) {
186
187 [[self getHS4WithMac:mac]commandMeasureWithUint:unit.intValue Weight:^(NSNumber *unStableWeight) {
188 NSDictionary *deviceInfo = @{@"mac":mac,@"action":ACTION_LIVEDATA_HS,LIVEDATA_HS:unStableWeight};
189 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
190
191 } StableWeight:^(NSDictionary *StableWeightDic) {
192 NSDictionary *deviceInfo =@{@"mac":mac,@"action":ACTION_ONLINE_RESULT_HS,DATAID:[StableWeightDic valueForKey:@"dataID"],WEIGHT_HS:[StableWeightDic valueForKey:@"Weight"] };
193
194 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
195 } DisposeErrorBlock:^(HS4DeviceError errorID) {
196 NSString *errorMassage = [NSString string];
197 switch (errorID) {
198 case 1:
199 errorMassage = @"Battery level is low.";
200 break;
201 case 2:
202 errorMassage = @"The Scale failed to initialize.";
203 break;
204 case 3:
205 errorMassage = @"Maximum weight has been exceeded.";
206 break;
207 case 4:
208 errorMassage = @"The Scale can't capture a steady reading.";
209 break;
210 case 5:
211 errorMassage = @"Bluetooth connection error.";
212 break;
213 case 6:
214 errorMassage = @"Movement while measuring.";
215 break;
216 case 7:
217 errorMassage = @"Invalidate.";
218 break;
219 case 10:
220 errorMassage = @"Device disconnect.";
221 break;
222 case 11:
223 errorMassage = @"Communication error.";
224 break;
225 case 12:
226 errorMassage = @"HS4DeviceRecWeightError.";
227 break;
228 default:
229 break;
230 }
231
232 NSDictionary *deviceInfo = @{@"mac":mac,@"action":ACTION_ERROR_HS,ERROR_NUM_HS:errorMassage};
233 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
234 }];
235 }
236
237}
238
239RCT_EXPORT_METHOD(disconnect:(nonnull NSString*)mac){
240 if ([self getHS4WithMac:mac] != nil){
241
242 [[self getHS4WithMac:mac]commandDisconnectDevice];
243 NSLog(@"End device connnect!");
244
245 }else{
246
247 }
248}
249- (void)sendErrorWithCode:(NSInteger)errorCode{
250 [self sendEventWithAction:@"ACTION_ERROR_HS" keyString:@"value" valueString:@(errorCode)];
251}
252
253- (void)sendEventWithAction:(NSString*)actionName keyString:(NSString*)key valueString:(id)value{
254 [self sendEventWithName:@"HS4.MODULE.NOTIFY" body:@{@"action":actionName,key:value}];
255}
256
257@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6Module.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6Module.h
new file mode 100644
index 0000000..cebc0f1
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6Module.h
@@ -0,0 +1,25 @@
1//
2// HS6Module.h
3// ReactNativeIOSLibrary
4//
5// Created by ihealth on 16/12/12.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11
12#if __has_include(<React/RCTAssert.h>)
13#import <React/RCTEventEmitter.h>
14#else
15#import "RCTEventEmitter.h"
16#endif
17
18
19
20
21@interface HS6Module : RCTEventEmitter<RCTBridgeModule>
22
23
24
25@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6Module.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6Module.m
new file mode 100644
index 0000000..401697b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6Module.m
@@ -0,0 +1,339 @@
1//
2// HS6Module.m
3// ReactNativeIOSLibrary
4//
5// Created by ihealth on 16/12/12.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "HS6Module.h"
10#import "HS6ProfileModule.h"
11#import "HSMacroFile.h"
12#import "iHealthHS6.h"
13#import "HealthUser.h"
14#import "iHealthDeviceManagerModule.h"
15
16#define EVENT_NOTIFY @"HS6.MODULE.NOTIFY"
17
18#define HS6_CLIENT_ID @"e33d489fdd6d4961a33c4065f7cedb30"
19
20#define HS6_CLIENT_SECRET @"17075697306e4930b87beffc58ceb2a4"
21
22@implementation HS6Module{
23
24 NSString*userAccount;
25
26}
27
28
29RCT_EXPORT_MODULE()
30- (NSArray<NSString *> *)supportedEvents {
31 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
32 @"event_device_connected", @"event_device_connect_failed",
33 @"event_device_disconnect", @"event_authenticate_result",
34 @"event_notify_ts28b", @"event_notify_bg1",
35 @"action_connect_result_for_bg1"];
36}
37
38
39#pragma mark-init
40
41-(NSDictionary *)constantsToExport{
42 return @{
43 @"Event_Notify" : EVENT_NOTIFY
44 };
45}
46+ (BOOL)requiresMainQueueSetup
47{
48 return YES;
49}
50- (void)sendErrorWithCode:(NSInteger)errorCode{
51 [self sendEventWithAction:@"ACTION_ERROR_HS" keyString:@"value" valueString:@(errorCode)];
52}
53
54- (void)sendEventWithAction:(NSString*)actionName keyString:(NSString*)key valueString:(id)value{
55 [self sendEventWithName:@"HS6.MODULE.NOTIFY" body:@{@"action":actionName,key:value}];
56}
57
58#pragma mark
59#pragma mark - Method
60 RCT_EXPORT_METHOD(init:(nonnull NSString*)userName){
61
62 [iHealthHS6 shareIHHS6Controller];
63
64 userAccount=[userName copy];
65
66 NSLog(@"Set User Succeed!");
67}
68
69/**
70 * set HS6 wifi
71 * Import parameter:
72 * @param password - wifi password.
73 * Return parameters:
74
75 * @param disposeHS6SuccessBlock - set sucess
76
77 * @param disposeHS6FailBlock - set faild
78
79 * @param disposeHS6EndBlock - end set
80
81 * @param disposeHS6ErrorBlock - error code
82 * Error code definition:
83 * refer to “error” : HS6 error instruction.
84 */
85
86/**
87 Set HS6 wifi
88 Import parameter:
89 @param password wifi password.
90
91 Return parameters:
92 @param disposeHS6SuccessBlock set sucess
93 @param disposeHS6FailBlock set faild
94 @param disposeHS6EndBlock end set
95 @param disposeHS6ErrorBlock error code
96 */
97
98RCT_EXPORT_METHOD(setWifi:(nonnull NSString*)ssid :(nonnull NSString*)password){
99
100
101 iHealthHS6 *hs6Controller = [iHealthHS6 shareIHHS6Controller];
102 if (hs6Controller != nil) {
103 [hs6Controller commandSetHS6WithPassWord:password disposeHS6SuccessBlock:^(NSDictionary *deviceInfo) {
104
105 NSMutableArray*deviceArray=[NSMutableArray array];
106
107 [deviceArray addObject:@true];
108
109 NSDictionary *deviceInf = @{@"action":ACTION_HS6_SETWIFI,SETWIFI_RESULT:deviceArray};
110
111 [self sendEventWithName:EVENT_NOTIFY body:deviceInf];
112 NSLog(@"WIFI sucess");
113 } disposeHS6FailBlock:^(NSString *failmsg) {
114 NSDictionary *deviceInf = @{@"action":ACTION_HS6_SETWIFI,SETWIFI_RESULT:failmsg};
115 [self sendEventWithName:EVENT_NOTIFY body:deviceInf];
116
117 } disposeHS6EndBlock:^(NSDictionary *deviceDic) {
118 NSLog(@"set WIFI over");
119
120 } disposeHS6ErrorBlock:^(NSNumber *error) {
121 NSDictionary *deviceInf = @{@"action":ACTION_HS6_ERROR,HS6_ERROR:[NSNumber numberWithInteger:error]};
122
123 [self sendEventWithName:EVENT_NOTIFY body:deviceInf];
124 }];
125 }
126 }
127
128/**
129 Binding QR Device
130 When using the SDK for the first time, measuring method needs to be called to finish user verification.
131
132 @param tempDeviceID device Mac
133 Return parameters:
134 The measurement via SDK will be operated in the case of 1-4, and will be terminated if any of 5-8 occurs. The interface needs to be re-called after analyzing the return parameters.
135 Notice: when a new user registers via SDK, an ‘iHealth disclaimer’ will pop up automatically, and will require the user to agree in order to continue. SDK applications require an Internet connection; there is 10-day trial period if the SDK cannot connect to the internet, the SDK is fully functional during tryout period, but will be terminated without a working internet connection after 10 days.
136 @param result Action = 1;(1:bind sucess 2:full user bind faild 3,:ts error bind faild 4 other),
137 BineNum=10
138 MAC
139 Position = 1;(user in weight number)
140 SetWifi=0
141 Status = 1;(1:binding 2:unbind)
142 TS (time);
143 @param error error code
144 */
145
146RCT_EXPORT_METHOD(bindDeviceHS6:(nonnull NSString*)birthday :(nonnull NSNumber*)weight :(nonnull NSNumber*)height :(nonnull NSNumber*)isSporter :(nonnull NSNumber*)gender :(nonnull NSString*)serialNumber){
147 iHealthHS6 *hs6Controller = [iHealthHS6 shareIHHS6Controller];
148 if (hs6Controller != nil) {
149 HealthUser* healthUser = [[HealthUser alloc] init];
150 healthUser.userAccount = userAccount;
151 healthUser.clientID = HS6_CLIENT_ID;
152 healthUser.clientSecret = HS6_CLIENT_SECRET;
153
154
155 NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
156
157 [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
158
159 healthUser.birthday=[dateFormatter dateFromString:birthday];
160
161 healthUser.weight=weight;
162
163 healthUser.height=height;
164
165 healthUser.isAthlete=isSporter.intValue;
166
167 healthUser.sex=gender.intValue;
168
169 [hs6Controller cloudCommandUserBinedQRDeviceWithUser:healthUser deviceID:serialNumber binedResult:^(NSArray *resultArray) {
170
171 NSDictionary*deviceDic=[resultArray objectAtIndex:0];
172
173 NSMutableArray*deviceArray=[NSMutableArray array];
174
175 NSDictionary *deviceBackDic = @{BIND_HS6_RESULT:[deviceDic objectForKey:@"Action"],HS6_MODEL:[deviceDic objectForKey:@"Status"],HS6_POSITION:[deviceDic objectForKey:@"Position"],HS6_SETTED_WIFI:[deviceDic objectForKey:@"SetWifi"]};
176
177 [deviceArray addObject:deviceBackDic];
178
179 NSDictionary *deviceInf = @{@"action":ACTION_HS6_BIND,HS6_BIND_EXTRA:deviceArray};
180 NSLog(@"ResultArray%@",resultArray);
181 [self sendEventWithName:EVENT_NOTIFY body:deviceInf];
182 } binedError:^(NSString *errorCode) {
183 NSDictionary *deviceInf = @{@"action":ACTION_HS6_ERROR,HS6_ERROR:errorCode};
184 [self sendEventWithName:EVENT_NOTIFY body:deviceInf];
185
186 }];
187 }
188}
189/**
190 unBind QR Device
191
192 Import parameter:
193 @param tempUser Properties included: clientID,clientSecret,userAccount,height.
194 clientID & clientSecret: the only identification for users of the SDK, requires registration from iHealth administrator, please email: sdk@ihealthlabs.com.cn for more information.
195 @param serialNumber device Mac
196 Return parameters:
197 @param result Action = 1;(1:bind sucess 2:full user bind faild 3,:ts error bind faild 4 other),
198 MAC
199 Status = 2;(1:binding 2:unbind)
200 TS
201 @param error error code
202 */
203RCT_EXPORT_METHOD(unBindDeviceHS6:(nonnull NSString*)serialNumber){
204
205 iHealthHS6 *hs6Controller = [iHealthHS6 shareIHHS6Controller];
206
207 if (hs6Controller != nil) {
208 HealthUser* healthUser = [[HealthUser alloc] init];
209 healthUser.userAccount = userAccount;
210 healthUser.clientID = HS6_CLIENT_ID;
211 healthUser.clientSecret = HS6_CLIENT_SECRET;
212
213 [hs6Controller cloudCommandUserDisBinedQRDeviceForUser:healthUser withDeviceID:serialNumber disBinedResult:^(NSArray *resultArray) {
214 NSDictionary *deviceInf = @{@"action":ACTION_HS6_UNBIND,HS6_UNBIND_RESULT:resultArray};
215
216 NSLog(@"unBindDeviceHS6:%@",resultArray);
217 [self sendEventWithName:EVENT_NOTIFY body:deviceInf];
218
219 } disBinedError:^(NSString *errorCode) {
220 NSDictionary *deviceInf = @{@"action":ACTION_HS6_ERROR,HS6_ERROR:[NSString stringWithFormat:@"%@", errorCode]};
221 [self sendEventWithName:EVENT_NOTIFY body:deviceInf];
222 }];
223 }
224}
225
226RCT_EXPORT_METHOD(getToken:(nonnull NSString*)clientId :(nonnull NSString*)clientSecret:(nonnull NSString*)username :(nonnull NSString*)clientPara){
227
228 iHealthHS6 *hs6Controller = [iHealthHS6 shareIHHS6Controller];
229
230 if (hs6Controller != nil) {
231 HealthUser* healthUser = [[HealthUser alloc] init];
232 healthUser.userAccount = username;
233 healthUser.clientID = clientId;
234 healthUser.clientSecret = clientSecret;
235
236
237 [hs6Controller commandHS6GetOpenAPITokenWithUser:healthUser withSuccessBlock:^(NSDictionary*openAPIInfoDic) {
238 NSDictionary *deviceInf = @{@"action":ACTION_HS6_GET_TOKEN,GET_TOKEN_RESULT:openAPIInfoDic};
239 NSLog(@"openAPIInfoDic%@",openAPIInfoDic);
240 [self sendEventWithName:EVENT_NOTIFY body:deviceInf];
241 } withErrorBlock:^(NSDictionary *errorCode) {
242
243 if (errorCode!=nil && [errorCode isKindOfClass:[NSDictionary class]]) {
244 NSDictionary *deviceInf = @{@"action":ACTION_HS6_ERROR, HS6_ERROR:[errorCode valueForKey:@"ErrorCode"],HS6_ERROR:[errorCode valueForKey:@"ErrorDescription"]};
245
246 [self sendEventWithName:EVENT_NOTIFY body:deviceInf];
247 }
248
249 }];
250 }
251}
252
253/**
254 sync Weight Unit
255 Import parameter:
256 @param tempUser Properties included: clientID,clientSecret,userAccount,serialNub.
257 @param unit IHHS6SDKUnitWeight_kg,IHHS6SDKUnitWeight_lb,IHHS6SDKUnitWeight_oz
258
259 /// kg
260 IHHS6SDKUnitWeight_kg = 0,
261 /// lb
262 IHHS6SDKUnitWeight_lbs =1 ,
263 /// st
264 IHHS6SDKUnitWeight_oz = 2,
265
266 Return parameters:
267 @param unitBlock YES or NO
268 @param errorBlock error code
269 */
270
271RCT_EXPORT_METHOD(setUnit:(nonnull NSString*)username :(nonnull NSNumber*)unitType){
272 iHealthHS6 *hs6Controller = [iHealthHS6 shareIHHS6Controller];
273 if (hs6Controller != nil) {
274 HealthUser* healthUser = [[HealthUser alloc] init];
275 healthUser.userAccount = username;
276 healthUser.clientID = HS6_CLIENT_ID;
277 healthUser.clientSecret = HS6_CLIENT_SECRET;
278
279 [hs6Controller commandHS6WithUser:healthUser withSyncWeightUnit:unitType.intValue withSuccessBlock:^(BOOL syncWeightUnit) {
280 NSDictionary *deviceInf = @{@"action":ACTION_HS6_SET_UNIT,SET_UNIT_RESULT:[NSNumber numberWithBool:syncWeightUnit]};
281 NSLog(@"setUnitResult:%d",syncWeightUnit);
282 [self sendEventWithName:EVENT_NOTIFY body:deviceInf];
283
284 } withErrorBlock:^(NSString *errorCode) {
285 NSDictionary *deviceInf = @{@"action":ACTION_HS6_ERROR,HS6_ERROR:errorCode};
286 [self sendEventWithName:EVENT_NOTIFY body:deviceInf];
287 }];
288 }
289
290}
291
292/**
293 DownloadHS6Data
294
295 Import parameter:
296 @param tempUser Properties included: clientID,clientSecret,userAccount
297 clientID & clientSecret: the only identification for users of the SDK, requires registration from iHealth administrator, please email: sdk@ihealthlabs.com.cn for more information.
298 @param downloadTS :From 1970, the number of seconds, download data download all data after this point in time.
299 Return parameters:
300 @param getHS6Data AllHS6Data
301
302 @param blockHS6LastTSFromCloud The last timestamp of the data download can be passed in at the next download, and all the data after the timestamp is downloaded.
303
304 @param errorBlock error code 101,102,103,104:networkerror 400:input error 209:The user doesn't exist
305 */
306
307RCT_EXPORT_METHOD(getCloudData:(nonnull NSString*)clientId :(nonnull NSString*)clientSecret :(nonnull NSString*)username :(nonnull NSNumber*)ts :(nonnull NSNumber*)pageSize){
308
309 iHealthHS6 *hs6Controller = [iHealthHS6 shareIHHS6Controller];
310
311 if (hs6Controller != nil) {
312 HealthUser* healthUser = [[HealthUser alloc] init];
313 healthUser.userAccount = username;
314 healthUser.clientID = clientId;
315 healthUser.clientSecret = clientSecret;
316
317 [hs6Controller commandDownloadHS6Data:healthUser withDownloadTS:[ts longValue] withPageSize:[pageSize longValue] withSuccessBlock:^(NSDictionary *dataDic) {
318
319 NSDictionary *deviceInf = @{@"action":ACTION_HS6_GET_CLOUDDATA,HS6_CLOUDDATA:dataDic};
320 [self sendEventWithName:EVENT_NOTIFY body:deviceInf];
321
322 } blockHS6LastTSFromCloud:^(NSNumber *lastTS) {
323
324 NSDictionary *deviceInf = @{@"action":ACTION_HS6_GET_CLOUDDATA_LASTTS,HS6_CLOUDDATA_LASTTS:lastTS};
325 [self sendEventWithName:EVENT_NOTIFY body:deviceInf];
326
327
328 } withErrorBlock:^(NSNumber *error) {
329
330 NSDictionary *deviceInf = @{@"action":ACTION_HS6_ERROR,HS6_ERROR:error};
331 [self sendEventWithName:EVENT_NOTIFY body:deviceInf];
332
333 }];
334
335
336 }
337}
338
339@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6ProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6ProfileModule.h
new file mode 100644
index 0000000..7974898
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6ProfileModule.h
@@ -0,0 +1,51 @@
1//
2// HS6ProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by ihealth on 16/12/20.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15
16@interface HS6ProfileModule : NSObject<RCTBridgeModule>
17
18//HS6
19#define ACTION_HS6_SETWIFI @"hs6_setwifi"
20#define SETWIFI_RESULT @"setWifiResult"
21
22#define ACTION_HS6_BIND @"hs6_bind"
23#define HS6_BIND_EXTRA @"bindData"
24#define BIND_HS6_RESULT @"bindResult"
25#define HS6_MODEL @"model"
26#define HS6_POSITION @"position"
27#define HS6_SETTED_WIFI @"settedWifi"
28
29#define ACTION_HS6_UNBIND @"hs6_unbind"
30#define HS6_UNBIND_RESULT @"unBind"
31
32#define ACTION_HS6_GET_TOKEN @"hs6_get_token"
33#define GET_TOKEN_RESULT @"getTokenResult"
34
35#define ACTION_HS6_SET_UNIT @"hs6_set_unit"
36#define SET_UNIT_RESULT @"setUnitResult"
37
38#define ACTION_HS6_ERROR @"hs6_error"
39#define HS6_ERROR @"hs6_error"
40
41
42#define ACTION_HS6_GET_CLOUDDATA @"hs6_get_clouddata"
43#define HS6_CLOUDDATA @"HS6_CLOUDDATA"
44#define ACTION_HS6_GET_CLOUDDATA_LASTTS @"hs6_get_clouddata_lastts"
45#define HS6_CLOUDDATA_LASTTS @"HS6_CLOUDDATA_LASTTS"
46#define ACTION_HS6_GET_CLOUDDATA_LEFTNUM @"hs6_get_clouddata_leftnum"
47#define HS6_CLOUDDATA_LEFTNUM @"HS6_CLOUDDATA_LEFTNUM"
48
49
50
51@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6ProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6ProfileModule.m
new file mode 100644
index 0000000..83ff55b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HS6ProfileModule.m
@@ -0,0 +1,70 @@
1//
2// HS6ProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by ihealth on 16/12/20.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "HS6ProfileModule.h"
10
11@implementation HS6ProfileModule
12RCT_EXPORT_MODULE()
13
14#pragma mark
15#pragma mark - constantsToExport
16@synthesize bridge = _bridge;
17
18-(NSDictionary *)constantsToExport{
19
20
21 return @{
22
23 @"ACTION_HS6_SETWIFI":ACTION_HS6_SETWIFI,
24
25 @"SETWIFI_RESULT":SETWIFI_RESULT,
26
27 @"ACTION_HS6_BIND":ACTION_HS6_BIND,
28
29 @"HS6_BIND_EXTRA":HS6_BIND_EXTRA,
30
31 @"BIND_HS6_RESULT":BIND_HS6_RESULT,
32
33 @"HS6_MODEL":HS6_MODEL,
34
35 @"HS6_POSITION":HS6_POSITION,
36
37 @"HS6_SETTED_WIFI":HS6_SETTED_WIFI,
38
39 @"ACTION_HS6_UNBIND":ACTION_HS6_UNBIND,
40
41 @"HS6_UNBIND_RESULT":HS6_UNBIND_RESULT,
42
43 @"ACTION_HS6_GET_TOKEN":ACTION_HS6_GET_TOKEN,
44
45 @"GET_TOKEN_RESULT":GET_TOKEN_RESULT,
46
47 @"ACTION_HS6_SET_UNIT":ACTION_HS6_SET_UNIT,
48
49 @"SET_UNIT_RESULT":SET_UNIT_RESULT,
50
51 @"ACTION_HS6_GET_CLOUDDATA":ACTION_HS6_GET_CLOUDDATA,
52
53 @"HS6_CLOUDDATA":HS6_CLOUDDATA,
54
55 @"ACTION_HS6_GET_CLOUDDATA_LASTTS":ACTION_HS6_GET_CLOUDDATA_LASTTS,
56
57 @"HS6_CLOUDDATA_LASTTS":HS6_CLOUDDATA_LASTTS,
58
59 @"ACTION_HS6_GET_CLOUDDATA_LEFTNUM":ACTION_HS6_GET_CLOUDDATA_LEFTNUM,
60
61 @"HS6_CLOUDDATA_LEFTNUM":HS6_CLOUDDATA_LEFTNUM,
62
63 @"ACTION_HS6_ERROR":ACTION_HS6_ERROR,
64
65 @"HS6_ERROR":HS6_ERROR,
66 };
67
68
69}
70@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HSProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HSProfileModule.h
new file mode 100644
index 0000000..506c300
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HSProfileModule.h
@@ -0,0 +1,60 @@
1//
2// HSProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by ihealth on 16/12/2.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15
16@interface HSProfileModule : NSObject<RCTBridgeModule>
17
18#define ACTION_LIVEDATA_HS @"liveData_hs"
19#define LIVEDATA_HS @"value"
20
21#define ACTION_ONLINE_RESULT_HS @"online_result_hs"
22#define DATAID @"dataID"
23#define WEIGHT_HS @"value"
24#define FAT_HS @""
25#define WATER_HS @""
26#define MUSCLE_HS @""
27#define SKELETON_HS @""
28#define FATELEVEL_HS @""
29#define DCI_HS @""
30
31#define ACTION_GET_ALL_CONNECTED_DEVICES @"action_get_all_connected_devices"
32#define ACTION_HISTORICAL_DATA_HS @"historicaldata_hs"
33#define HISTORDATA_HS @"historyData"
34#define MEASUREMENT_DATE_HS @"date"
35#define ACTION_HISTORICAL_DATA_COMPLETE_HS @"finishTranslate"
36#define ACTION_NO_HISTORICALDATA @"noHistoryData"
37#define BATTERY_HS @"battery_hs"
38#define ACTION_BATTARY_HS @"action_get_battery_hs"
39#define ACTION_ERROR_HS @"error_hs"
40#define ERROR_NUM_HS @"error"
41#define ERROR_ID_ILLEGAL_ARGUMENT @"400"
42#define ERROR_ID_WIFI_DISABLED @""
43#define ERROR_DESCRIPTION_HS @"description"
44
45
46#define ACTION_ONLINE_WEIGHTANDBody_INFO @"online_weigthandbody_info"
47
48#define ACTION_BroadCastType_DEVICE @"broadCastType_device"
49
50#define ACTION_RESET_DEVICE @"reset_device"
51
52#define ACTION_MEASURE_FINISH @"measure_finish"
53
54#define MEMORY_COUNT @"history_data_count"
55
56#define MEMORY_DATA @"history_data"
57
58
59
60@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HSProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HSProfileModule.m
new file mode 100644
index 0000000..b76347c
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/HSProfileModule.m
@@ -0,0 +1,79 @@
1//
2// HSProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by ihealth on 16/12/2.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "HSProfileModule.h"
10
11@implementation HSProfileModule
12
13RCT_EXPORT_MODULE()
14
15#pragma mark
16#pragma mark - constantsToExport
17@synthesize bridge = _bridge;
18
19-(NSDictionary *)constantsToExport{
20 return @{
21 @"ACTION_LIVEDATA_HS" : ACTION_LIVEDATA_HS,
22 @"LIVEDATA_HS" : LIVEDATA_HS,
23
24 @"ACTION_ONLINE_RESULT_HS" : ACTION_ONLINE_RESULT_HS,
25 @"DATAID" : DATAID,
26 @"WEIGHT_HS" : WEIGHT_HS,
27 @"FAT_HS" : FAT_HS,
28 @"WATER_HS" : WATER_HS,
29 @"MUSCLE_HS" : MUSCLE_HS,
30 @"SKELETON_HS" : SKELETON_HS,
31 @"FATELEVEL_HS" : FATELEVEL_HS,
32 @"DCI_HS" : DCI_HS,
33
34
35 @"ACTION_HISTORICAL_DATA_HS" : ACTION_HISTORICAL_DATA_HS,
36 @"HISTORDATA_HS" :HISTORDATA_HS,
37 @"MEASUREMENT_DATE_HS" : MEASUREMENT_DATE_HS,
38 @"ACTION_HISTORICAL_DATA_COMPLETE_HS" :ACTION_HISTORICAL_DATA_COMPLETE_HS,
39 @"ACTION_NO_HISTORICALDATA" : ACTION_NO_HISTORICALDATA,
40
41 @"ACTION_ERROR_HS" : ACTION_ERROR_HS,
42 @"ERROR_NUM_HS" : ERROR_NUM_HS,
43 @"ERROR_ID_ILLEGAL_ARGUMENT" : ERROR_ID_ILLEGAL_ARGUMENT,
44 @"ERROR_ID_WIFI_DISABLED" : ERROR_ID_WIFI_DISABLED,
45 @"ERROR_DESCRIPTION_HS" : ERROR_DESCRIPTION_HS,
46
47 @"ACTION_GET_ALL_CONNECTED_DEVICES":ACTION_GET_ALL_CONNECTED_DEVICES,
48
49 @"ACTION_BATTERY_HS":ACTION_BATTARY_HS,
50 @"BATTERY_HS":BATTERY_HS,
51
52
53
54 @"MEMORY_COUNT":MEMORY_COUNT,
55
56
57
58 @"MEMORY_DATA":MEMORY_DATA,
59
60
61
62 @"ACTION_ONLINE_WEIGHTANDBody_INFO":ACTION_ONLINE_WEIGHTANDBody_INFO,
63
64 @"ACTION_MEASURE_FINISH":ACTION_MEASURE_FINISH,
65
66 @"ACTION_RESET_DEVICE":ACTION_RESET_DEVICE,
67
68 @"ACTION_BroadCastType_DEVICE":ACTION_BroadCastType_DEVICE,
69
70
71 };
72
73}
74
75+ (BOOL)requiresMainQueueSetup
76{
77 return YES;
78}
79@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BModule.h
new file mode 100644
index 0000000..029c17d
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BModule.h
@@ -0,0 +1,20 @@
1//
2// NT13BModule.h
3// ReactNativeIOSLibrary
4//
5// Created by user on 2019/11/12.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTEventEmitter.h>
12#else
13#import "RCTEventEmitter.h"
14#endif
15
16@interface NT13BModule : RCTEventEmitter<RCTBridgeModule>
17
18@end
19
20
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BModule.m
new file mode 100644
index 0000000..158de43
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BModule.m
@@ -0,0 +1,103 @@
1//
2// NT13BModule.m
3// ReactNativeIOSLibrary
4//
5// Created by user on 2019/11/12.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import "NT13BModule.h"
10#import "NT13BHeader.h"
11#import "NT13BProfileModule.h"
12
13@implementation NT13BModule
14RCT_EXPORT_MODULE()
15- (NSArray<NSString *> *)supportedEvents {
16 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
17 @"event_device_connected", @"event_device_connect_failed",
18 @"event_device_disconnect", @"event_authenticate_result",
19 @"event_notify_ts28b", @"event_notify_bg1",
20 @"action_connect_result_for_bg1"];
21}
22
23
24- (NSDictionary *)constantsToExport
25{
26 return @{ @"Event_Notify": NT13B_EVENT_NOTIFY ,
27
28 };
29}
30
31+ (BOOL)requiresMainQueueSetup
32{
33 return YES;
34}
35
36
37-(NT13B*)getDeviceWithMac:(NSString*)mac{
38
39 NT13BController *controller = [NT13BController shareIHNT13BController];
40 NSArray *nt13bDeviceArray = [controller getAllCurrentNT13BInstace];
41
42 for(NT13B *tempDevice in nt13bDeviceArray){
43 if([mac isEqualToString:tempDevice.serialNumber]){
44
45 return tempDevice;
46 }
47 }
48 return nil;
49}
50
51RCT_EXPORT_METHOD(getAllConnectedDevices){
52
53
54 NSArray*nt13bDeviceArray= [[NT13BController shareIHNT13BController] getAllCurrentNT13BInstace];
55
56 NSMutableArray*deviceMacArray=[NSMutableArray array];
57
58 for (int i=0; i<[nt13bDeviceArray count]; i++) {
59
60 NT13B *nt13b = [nt13bDeviceArray objectAtIndex:i];
61
62 [deviceMacArray addObject:nt13b.serialNumber];
63
64 }
65
66 NSDictionary* deviceInfo = @{NT13B_ACTION:kACTION_GET_ALL_CONNECTED_DEVICES,NT13B_DEVICE:deviceMacArray};
67
68 [self sendEventWithName:NT13B_EVENT_NOTIFY body:deviceInfo];
69}
70
71RCT_EXPORT_METHOD(measure:(nonnull NSString *)mac){
72
73
74 if ([self getDeviceWithMac:mac] != nil) {
75
76 [[self getDeviceWithMac:mac] commandStartMeasure:^(NSDictionary *result) {
77
78 NSDictionary* deviceInfo = @{NT13B_ACTION:@"action_measurement_result",NT13B_THERMOMETER_TYPE:[result objectForKey:@"bodyFlag"],NT13B_UNIT_FLAG:[result objectForKey:@"unit"],NT13B_RESULT:[result objectForKey:@"result"]};
79
80 [self sendEventWithName:NT13B_EVENT_NOTIFY body:deviceInfo];
81
82
83
84 }];
85
86 }
87
88}
89
90//断开连接
91RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
92 if ([self getDeviceWithMac:mac]!=nil) {
93
94 [[self getDeviceWithMac:mac] commandDisconnect:^(BOOL result) {
95
96
97 }];
98 }else{
99
100 }
101}
102
103@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BProfileModule.h
new file mode 100644
index 0000000..6680366
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BProfileModule.h
@@ -0,0 +1,36 @@
1//
2// NT13BProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by user on 2019/11/14.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15
16
17@interface NT13BProfileModule : NSObject<RCTBridgeModule>
18
19#define NT13B_EVENT_NOTIFY @"event_notify_nt13b"
20
21#define NT13B_ACTION @"action"
22
23#define NT13B_DEVICE @"devices"
24
25#define NT13B_KEY_MAC @"mac"
26
27#define kACTION_GET_ALL_CONNECTED_DEVICES @"ACTION_GET_ALL_CONNECTED_DEVICES"
28
29#define NT13B_RESULT @"result"
30
31#define NT13B_UNIT_FLAG @"unit_flag"
32
33#define NT13B_THERMOMETER_TYPE @"thermometer_type"
34
35@end
36
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BProfileModule.m
new file mode 100644
index 0000000..558d2dd
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/NT13BProfileModule.m
@@ -0,0 +1,39 @@
1//
2// NT13BProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by user on 2019/11/14.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import "NT13BProfileModule.h"
10
11@implementation NT13BProfileModule
12
13RCT_EXPORT_MODULE()
14
15#pragma mark
16#pragma mark - constantsToExport
17
18
19- (NSDictionary *)constantsToExport
20{
21 return @{
22 @"ACTION_MEASUREMENT_RESULT":@"action_measurement_result",
23 NT13B_ACTION:@"action",
24 NT13B_DEVICE:@"device",
25 NT13B_KEY_MAC:@"mac",
26 kACTION_GET_ALL_CONNECTED_DEVICES:kACTION_GET_ALL_CONNECTED_DEVICES,
27 NT13B_RESULT:@"result",
28 NT13B_UNIT_FLAG:@"unit_flag",
29 NT13B_THERMOMETER_TYPE:@"thermometer_type"
30 };
31};
32
33
34+ (BOOL)requiresMainQueueSetup
35{
36 return YES;
37}
38
39@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1Module.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1Module.h
new file mode 100755
index 0000000..97a656d
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1Module.h
@@ -0,0 +1,19 @@
1//
2// PO3Module.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16@interface PO1Module : RCTEventEmitter<RCTBridgeModule>
17
18
19@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1Module.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1Module.m
new file mode 100644
index 0000000..1fb2b9c
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1Module.m
@@ -0,0 +1,167 @@
1//
2// PO1Module.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "PO1Module.h"
10#import "PO1.h"
11#import "PO1Controller.h"
12#import "PO1ProfileModule.h"
13
14@implementation PO1Module{
15
16
17 NSMutableDictionary*resultDic;
18
19}
20
21#define EVENT_NOTIFY @"event_notify_po1"
22#define kMAC_KEY @"mac"
23#define kACTION_KEY @"action"
24
25
26RCT_EXPORT_MODULE()
27- (NSArray<NSString *> *)supportedEvents {
28 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
29 @"event_device_connected", @"event_device_connect_failed",
30 @"event_device_disconnect", @"event_authenticate_result",
31 @"event_notify_ts28b", @"event_notify_bg1",
32 @"action_connect_result_for_bg1"];
33}
34
35
36
37#pragma mark
38#pragma mark - constantsToExport
39- (NSDictionary *)constantsToExport
40{
41 return @{ @"Event_Notify": EVENT_NOTIFY };
42
43}
44
45+ (BOOL)requiresMainQueueSetup
46{
47 return YES;
48}
49#pragma mark
50#pragma mark - Init
51-(id)init
52{
53 if (self=[super init])
54 {
55
56 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(devicePO1Measure:) name:@"PO1NotificationMeasureData" object:nil];
57
58 }
59
60
61 return self;
62}
63
64
65-(void)devicePO1Measure:(NSNotification *)tempNoti{
66
67 NSDictionary*measureDataDic= [tempNoti userInfo];
68
69 NSLog(@"devicePO1Measure:%@",measureDataDic);
70
71 NSDictionary* deviceInfo = @{kACTION_KEY:@"ACTION_BO_MEASUREMENT",@"WAVE":[measureDataDic valueForKey:@"wave"],@"PI":[measureDataDic valueForKey:@"PI"],@"PULSE_FORCE":[measureDataDic valueForKey:@"height"],@"BLOOD_OXYGEN":[measureDataDic valueForKey:@"spo2"],@"PULSE":[measureDataDic valueForKey:@"bpm"]};
72 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
73}
74
75
76-(void)dealloc{
77 [[NSNotificationCenter defaultCenter]removeObserver:self];
78}
79
80-(PO1*)getPO1WithMac:(NSString*)mac{
81
82 PO1Controller *controller = [PO1Controller shareIHPO1Controller];
83 NSArray *poDeviceArray = [controller getAllCurrentPO1Instace];
84
85 for(PO1 *tempPO1 in poDeviceArray){
86 if([mac isEqualToString:tempPO1.serialNumber]){
87
88 return tempPO1;
89 break;
90 }
91 }
92
93 return nil;
94}
95
96#pragma mark
97#pragma mark - Method
98
99RCT_EXPORT_METHOD(getAllConnectedDevices){
100
101
102 NSArray*po1array= [[PO1Controller shareIHPO1Controller] getAllCurrentPO1Instace];
103
104 NSMutableArray*deviceMacArray=[NSMutableArray array];
105
106 for (int i=0; i<[po1array count]; i++) {
107
108 PO1*po1=[po1array objectAtIndex:i];
109
110 [deviceMacArray addObject:po1.serialNumber];
111
112 }
113
114 NSDictionary* deviceInfo = @{kACTION_KEY:@"ACTION_GET_ALL_CONNECTED_DEVICES",@"devices":deviceMacArray};
115
116 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
117
118
119}
120
121
122
123RCT_EXPORT_METHOD(getBattery:(nonnull NSString *)mac){
124
125 if ([self getPO1WithMac:mac]!=nil) {
126
127
128 [[self getPO1WithMac:mac] commandPO1GetDeviceBattery:^(NSNumber *battery) {
129
130 NSDictionary* deviceInfo = @{kACTION_KEY:@"ACTION_GET_BATTERY",@"BATTERY":battery};
131 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
132
133 } withErrorBlock:^(PO1ErrorID errorID) {
134
135 }];
136 }else{
137
138 NSDictionary* deviceInfo = @{kACTION_KEY:@"ACTION_ERROR_PO1",@"ERROR_DESCRIPTION":@"disconnect"};
139 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
140
141 }
142
143
144}
145
146RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
147
148
149 if ([self getPO1WithMac:mac]!=nil) {
150
151 [[self getPO1WithMac:mac] commandDisconnectDevice];
152
153 }else{
154
155
156
157 }
158
159
160
161}
162
163
164
165
166
167@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1ProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1ProfileModule.h
new file mode 100755
index 0000000..35fefd5
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1ProfileModule.h
@@ -0,0 +1,20 @@
1//
2// POProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15@interface PO1ProfileModule : NSObject<RCTBridgeModule>
16
17
18
19
20@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1ProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1ProfileModule.m
new file mode 100755
index 0000000..fee17dc
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO1ProfileModule.m
@@ -0,0 +1,58 @@
1//
2// POProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "PO1ProfileModule.h"
10
11@implementation PO1ProfileModule
12
13
14RCT_EXPORT_MODULE()
15
16#pragma mark
17#pragma mark - constantsToExport
18
19
20- (NSDictionary *)constantsToExport
21{
22 return @{
23 @"ACTION_GET_BATTERY":@"ACTION_GET_BATTERY",
24
25 @"ACTION_BO_MEASUREMENT":@"ACTION_BO_MEASUREMENT",
26
27 @"ACTION_ERROR_PO1":@"ACTION_ERROR_PO1",
28
29 @"ACTION_GET_ALL_CONNECTED_DEVICES":@"ACTION_GET_ALL_CONNECTED_DEVICES",
30
31 @"BATTERY":@"BATTERY",
32
33 @"ERROR_DESCRIPTION":@"ERROR_DESCRIPTION",
34
35 @"ERROR_ID":@"ERROR_ID",
36
37 @"STATUS":@"STATUS",
38
39 @"BLOOD_OXYGEN":@"BLOOD_OXYGEN",
40
41 @"PULSE":@"PULSE",
42
43 @"PULSE_FORCE":@"PULSE_FORCE",
44
45 @"PI":@"PI",
46
47 @"WAVE":@"WAVE",
48
49 };
50};
51
52
53+ (BOOL)requiresMainQueueSetup
54{
55 return YES;
56}
57
58@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO3Module.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO3Module.h
new file mode 100755
index 0000000..897d7b0
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO3Module.h
@@ -0,0 +1,19 @@
1//
2// PO3Module.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16@interface PO3Module : RCTEventEmitter<RCTBridgeModule>
17
18
19@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO3Module.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO3Module.m
new file mode 100644
index 0000000..6c1ddec
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PO3Module.m
@@ -0,0 +1,260 @@
1//
2// PO3Module.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "PO3Module.h"
10#import "PO3.h"
11#import "PO3Controller.h"
12#import "POProfileModule.h"
13#import "ManageDeviceController.h"
14
15@implementation PO3Module{
16
17
18 NSMutableDictionary*resultDic;
19
20}
21
22#define EVENT_NOTIFY @"event_notify_po3"
23
24
25RCT_EXPORT_MODULE()
26- (NSArray<NSString *> *)supportedEvents {
27 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
28 @"event_device_connected", @"event_device_connect_failed",
29 @"event_device_disconnect", @"event_authenticate_result",
30 @"event_notify_ts28b", @"event_notify_bg1",
31 @"action_connect_result_for_bg1"];
32}
33
34
35
36#pragma mark
37#pragma mark - constantsToExport
38- (NSDictionary *)constantsToExport
39{
40 return @{ @"Event_Notify": EVENT_NOTIFY };
41
42}
43
44+ (BOOL)requiresMainQueueSetup
45{
46 return YES;
47}
48#pragma mark
49#pragma mark - Init
50-(id)init
51{
52 if (self=[super init])
53 {
54
55
56 }
57 return self;
58}
59
60-(PO3*)getPO3WithMac:(NSString*)mac{
61
62 PO3Controller *controller = [PO3Controller shareIHPO3Controller];
63 NSArray *poDeviceArray = [controller getAllCurrentPO3Instace];
64
65 for(PO3 *tempPO3 in poDeviceArray){
66 if([mac isEqualToString:tempPO3.serialNumber]){
67
68 return tempPO3;
69 break;
70 }
71 }
72
73 return nil;
74}
75
76#pragma mark
77#pragma mark - Method
78
79RCT_EXPORT_METHOD(getAllConnectedDevices){
80
81
82 NSArray*po3array= [[PO3Controller shareIHPO3Controller] getAllCurrentPO3Instace];
83
84 NSMutableArray*deviceMacArray=[NSMutableArray array];
85
86 for (int i=0; i<[po3array count]; i++) {
87
88 PO3*po3=[po3array objectAtIndex:i];
89
90 [deviceMacArray addObject:po3.serialNumber];
91
92 }
93
94 NSDictionary* deviceInfo = @{@"action":@"ACTION_GET_ALL_CONNECTED_DEVICES",@"devices":deviceMacArray};
95
96 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
97
98
99}
100
101
102
103RCT_EXPORT_METHOD(getBattery:(nonnull NSString *)mac){
104
105 if ([self getPO3WithMac:mac]!=nil) {
106
107 [[self getPO3WithMac:mac] commandPO3SyncTime:^(BOOL resetSuc) {
108
109 } withErrorBlock:^(PO3ErrorID errorID) {
110
111 }];
112
113 [[self getPO3WithMac:mac] commandPO3GetDeviceBattery:^(NSNumber *battery) {
114
115 NSDictionary* deviceInfo = @{POACTION:@"ACTION_BATTERY_PO",PO_BATTERY:battery};
116 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
117
118 } withErrorBlock:^(PO3ErrorID errorID) {
119
120 }];
121 }else{
122
123 NSDictionary* deviceInfo = @{POACTION:@"ACTION_ERROR_PO",@"error_po":@"disconnect"};
124 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
125
126 }
127
128
129}
130
131
132RCT_EXPORT_METHOD(startMeasure:(nonnull NSString *)mac){
133
134
135 if ([self getPO3WithMac:mac]!=nil) {
136
137 [[self getPO3WithMac:mac] commandPO3StartMeasure:^(BOOL resetSuc) {
138
139 } withMeasureData:^(NSDictionary *measureDataDic) {
140
141 NSDictionary* deviceInfo = @{@"action":@"ACTION_LIVEDA_PO",@"pulseWave":[measureDataDic valueForKey:@"wave"],@"dataID":[measureDataDic valueForKey:@"dataID"],@"pi":[measureDataDic valueForKey:@"PI"],@"pulsestrength":[measureDataDic valueForKey:@"height"],@"bloodoxygen":[measureDataDic valueForKey:@"spo2"],@"heartrate":[measureDataDic valueForKey:@"bpm"]};
142 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
143
144 resultDic=[[NSMutableDictionary alloc] initWithDictionary:deviceInfo];
145
146 } withFinishMeasure:^(BOOL finishData) {
147
148 [resultDic setValue:@"ACTION_RESULTDATA_PO" forKey:POACTION];
149
150 [self sendEventWithName:EVENT_NOTIFY body:resultDic];
151
152 } withErrorBlock:^(PO3ErrorID errorID) {
153
154 }];
155
156 }else{
157
158 NSDictionary* deviceInfo = @{@"action":@"ACTION_ERROR_PO",@"error_po":@"disconnect"};
159 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
160
161 }
162
163}
164
165RCT_EXPORT_METHOD(getHistoryData:(nonnull NSString *)mac){
166
167
168
169 if ([self getPO3WithMac:mac]!=nil) {
170
171
172 [[self getPO3WithMac:mac] commandPO3SyncTime:^(BOOL resetSuc) {
173
174 } withErrorBlock:^(PO3ErrorID errorID) {
175
176 }];
177
178 NSMutableArray *resultArray = [[NSMutableArray alloc]init];
179
180 [[self getPO3WithMac:mac] commandPO3OfflineDataCount:^(NSNumber *dataCount) {
181
182 if(dataCount.intValue == 0){
183 NSDictionary *dic = @{POACTION:@"ACTION_NO_OFFLINEDATA_PO"};
184 [self sendEventWithName:EVENT_NOTIFY body:dic];
185 }
186
187 } withOfflineData:^(NSDictionary *OfflineData) {
188
189
190 NSDateFormatter *dateFormat = nil;
191
192 if (dateFormat == nil) {
193 dateFormat = [[NSDateFormatter alloc] init];
194 [dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//设定时间格式,这里可以设置成自己需要的格式
195 }
196
197 NSString *locationString=[dateFormat stringFromDate:[OfflineData valueForKey:@"date"]];
198
199
200 NSDictionary* deviceInfo = @{
201 POACTION:@"ACTION_OFFLINEDATA_PO",
202 @"measureDate":locationString,
203 @"dataID":[OfflineData valueForKey:@"dataID"],
204 @"pulseWave":[OfflineData valueForKey:@"wave"],
205 @"heartrate":[OfflineData valueForKey:@"bpm"],
206 @"bloodoxygen":[OfflineData valueForKey:@"spo2"]};
207
208
209 [resultArray addObject:deviceInfo];
210
211
212
213 } withOfflineWaveData:^(NSDictionary *offlineWaveDataDic) {
214
215 } withFinishMeasure:^(BOOL resetSuc) {
216
217 NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:resultArray,@"offLineData",@"ACTION_OFFLINEDATA_PO",POACTION, nil];
218 [self sendEventWithName:EVENT_NOTIFY body:dic];
219
220
221 } withErrorBlock:^(PO3ErrorID errorID) {
222
223 }];
224
225 }else{
226
227
228
229 }
230
231
232
233
234}
235
236
237RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
238
239
240
241
242 if ([self getPO3WithMac:mac]!=nil) {
243
244 [[ManageDeviceController commandGetInstance] commandDisconnectSelectDevice:[self getPO3WithMac:mac].currentUUID];
245
246 }else{
247
248
249
250 }
251
252
253
254}
255
256
257
258
259
260@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/POProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/POProfileModule.h
new file mode 100755
index 0000000..e25456a
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/POProfileModule.h
@@ -0,0 +1,24 @@
1//
2// POProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15@interface POProfileModule : NSObject<RCTBridgeModule>
16
17
18
19#define POACTION @"action"
20#define PO_BATTERY @"BATTERY_PO"
21
22
23
24@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/POProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/POProfileModule.m
new file mode 100755
index 0000000..cc12195
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/POProfileModule.m
@@ -0,0 +1,48 @@
1//
2// POProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "POProfileModule.h"
10
11@implementation POProfileModule
12
13
14RCT_EXPORT_MODULE()
15
16#pragma mark
17#pragma mark - constantsToExport
18
19
20- (NSDictionary *)constantsToExport
21{
22 return @{
23 @"ACTION_BATTERY_PO":@"ACTION_BATTERY_PO",
24 @"BATTERY_PO":PO_BATTERY,
25 @"ACTION_LIVEDA_PO":@"ACTION_LIVEDA_PO",
26 @"PULSE_WAVE_PO":@"pulseWave",
27 @"PI_PO":@"pi",
28 @"PULSE_STRENGTH_PO":@"pulsestrength",
29 @"BLOOD_OXYGEN_PO":@"bloodoxygen",
30 @"PULSE_RATE_PO":@"heartrate",
31 @"ACTION_RESULTDATA_PO":@"ACTION_RESULTDATA_PO",
32 @"DATAID":@"dataID",
33 @"ACTION_OFFLINEDATA_PO":@"ACTION_OFFLINEDATA_PO",
34 @"OFFLINEDATA_PO":@"offLineData",
35 @"MEASURE_DATE_PO":@"MEASURE_DATE_PO",
36 @"ACTION_NO_OFFLINEDATA_PO":@"ACTION_NO_OFFLINEDATA_PO",
37 @"ACTION_ERROR_PO":@"ACTION_ERROR_PO",
38 @"ACTION_GET_ALL_CONNECTED_DEVICES":@"ACTION_GET_ALL_CONNECTED_DEVICES",
39 };
40};
41
42
43+ (BOOL)requiresMainQueueSetup
44{
45 return YES;
46}
47
48@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTModule.h
new file mode 100755
index 0000000..ecad38b
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTModule.h
@@ -0,0 +1,19 @@
1//
2// PO3Module.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTAssert.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16@interface PT3SBTModule : RCTEventEmitter<RCTBridgeModule>
17
18
19@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTModule.m
new file mode 100644
index 0000000..525bc70
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTModule.m
@@ -0,0 +1,347 @@
1//
2// PT3SBTModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "PT3SBTModule.h"
10#import "PT3SBT.h"
11#import "PT3SBTController.h"
12#import "PT3SBTProfileModule.h"
13
14@implementation PT3SBTModule{
15
16
17 NSMutableDictionary*resultDic;
18
19}
20
21#define EVENT_NOTIFY @"event_notify_pt3sbt"
22#define kMAC_KEY @"mac"
23#define kACTION_KEY @"action"
24
25
26RCT_EXPORT_MODULE()
27- (NSArray<NSString *> *)supportedEvents {
28 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
29 @"event_device_connected", @"event_device_connect_failed",
30 @"event_device_disconnect", @"event_authenticate_result",
31 @"event_notify_ts28b", @"event_notify_bg1",
32 @"action_connect_result_for_bg1"];
33}
34
35
36
37#pragma mark
38#pragma mark - constantsToExport
39- (NSDictionary *)constantsToExport
40{
41 return @{ @"Event_Notify": EVENT_NOTIFY };
42
43}
44
45+ (BOOL)requiresMainQueueSetup
46{
47 return YES;
48}
49#pragma mark
50#pragma mark - Init
51-(id)init
52{
53 if (self=[super init])
54 {
55
56 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(devicePT3SBTMeasure:) name:@"PT3SBTNotificationGetResult" object:nil];
57
58 }
59
60
61 return self;
62}
63
64//Content of measurement results:
65//{
66// Distance = 1663;
67// Tamb = 275;
68// Tbody = 3521;
69// Tex = 269;
70// Tobj = 274;
71// Vbat = 281;
72//}
73
74
75-(void)devicePT3SBTMeasure:(NSNotification *)tempNoti{
76
77 NSDictionary*measureDataDic= [tempNoti userInfo];
78
79 NSLog(@"devicePT3SBTMeasure:%@",measureDataDic);
80
81 NSDictionary* deviceInfo = @{
82 kACTION_KEY:kACTION_TEMPERATURE_MEASUREMENT,TEMPERATURE:[measureDataDic valueForKey:@"Tbody"]};
83 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
84}
85
86
87-(void)dealloc{
88 [[NSNotificationCenter defaultCenter]removeObserver:self];
89}
90
91-(PT3SBT*)getPT3SBTWithMac:(NSString*)mac{
92
93 PT3SBTController *controller = [PT3SBTController shareIHPT3SBTController];
94 NSArray *poDeviceArray = [controller getAllCurrentPT3SBTInstace];
95
96 for(PT3SBT *tempPT3SBT in poDeviceArray){
97 if([mac isEqualToString:tempPT3SBT.serialNumber]){
98
99 return tempPT3SBT;
100 break;
101 }
102 }
103
104 return nil;
105}
106
107#pragma mark
108#pragma mark - Method
109
110RCT_EXPORT_METHOD(getAllConnectedDevices){
111
112
113 NSArray*PT3SBTarray= [[PT3SBTController shareIHPT3SBTController] getAllCurrentPT3SBTInstace];
114
115 NSMutableArray*deviceMacArray=[NSMutableArray array];
116
117 for (int i=0; i<[PT3SBTarray count]; i++) {
118
119 PT3SBT*PT3SBT=[PT3SBTarray objectAtIndex:i];
120
121 [deviceMacArray addObject:PT3SBT.serialNumber];
122
123 }
124
125 NSDictionary* deviceInfo = @{kACTION_KEY:kACTION_GET_ALL_CONNECTED_DEVICES,@"devices":deviceMacArray};
126
127 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
128
129
130}
131
132#pragma mark 设置时间
133RCT_EXPORT_METHOD(setTime:(nonnull NSString *)mac){
134
135
136 if ([self getPT3SBTWithMac:mac]) {
137 __weak typeof(self) weakSelf = self;
138
139 [[self getPT3SBTWithMac:mac] commandFunction:^(NSDictionary *functionDict) {
140
141 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
142 kMAC_KEY:mac,
143 kACTION_KEY:kACTION_SET_TIME,
144 }];
145
146 } DisposeErrorBlock:^(PT3SBTDeviceError error) {
147
148 }];
149
150}
151
152}
153
154#pragma mark 设置单位
155RCT_EXPORT_METHOD(setUnit:(nonnull NSString *)mac :(nonnull NSNumber *)unit){
156
157 if ([self getPT3SBTWithMac:mac]) {
158
159 PT3SBTTemperatureUnit tempUnit = PT3SBTTemperatureUnit_C;
160 if ([unit isEqual:@(PT3SBTTemperatureUnit_C)]) {
161 tempUnit = PT3SBTTemperatureUnit_C;
162 } else if([unit isEqual:@(PT3SBTTemperatureUnit_F)]) {
163 tempUnit = PT3SBTTemperatureUnit_F;
164 } else {
165 tempUnit = PT3SBTTemperatureUnit_C;
166 return;
167 }
168 __weak typeof(self) weakSelf = self;
169
170 [[self getPT3SBTWithMac:mac] commandPT3SBTSetUnit:tempUnit DisposeSetUnitResult:^(BOOL setResult) {
171
172 [weakSelf sendEventWithName:EVENT_NOTIFY body:@{
173 kMAC_KEY:mac,
174 kACTION_KEY:kACTION_SET_UNIT,
175 }];
176
177 } DisposeErrorBlock:^(PT3SBTDeviceError error) {
178
179 }];
180
181
182 }
183}
184
185#pragma mark 获取单位
186RCT_EXPORT_METHOD(getUnit:(nonnull NSString *)mac){
187
188 if ([self getPT3SBTWithMac:mac]) {
189
190 [[self getPT3SBTWithMac:mac] commandPT3SBTGetUnit:^(PT3SBTTemperatureUnit unit) {
191
192 [self sendEventWithName:EVENT_NOTIFY body:@{
193 kMAC_KEY:mac,
194 UNIT:[NSNumber numberWithInt:unit],
195 kACTION_KEY:kACTION_GET_UNIT,
196 }];
197
198 } DisposeErrorBlock:^(PT3SBTDeviceError error) {
199
200 }];
201
202 }
203}
204
205#pragma mark 获取数据条数
206RCT_EXPORT_METHOD(getHistoryCount:(nonnull NSString *)mac){
207
208 if ([self getPT3SBTWithMac:mac]) {
209
210 [[self getPT3SBTWithMac:mac] commandPT3SBTGetMemoryCount:^(NSNumber *count) {
211
212 [self sendEventWithName:EVENT_NOTIFY body:@{
213 kMAC_KEY:mac,
214 COUNT:count,
215 kACTION_KEY:kACTION_GET_HISTORY_COUNT,
216 }];
217
218 } DisposeErrorBlock:^(PT3SBTDeviceError error) {
219
220 }];
221
222 }
223}
224
225#pragma mark 获取数据
226RCT_EXPORT_METHOD(getHistoryData:(nonnull NSString *)mac){
227
228 if ([self getPT3SBTWithMac:mac]) {
229
230 [[self getPT3SBTWithMac:mac] commandGetMemorryData:^(NSMutableArray *memoryDataArray) {
231
232
233 if(memoryDataArray != nil){
234
235 if(memoryDataArray.count){
236
237 NSMutableArray*dataArray=[NSMutableArray array];
238
239 for (int i=0; i<memoryDataArray.count; i++) {
240
241 NSNumber*ts=[[memoryDataArray objectAtIndex:i] objectForKey:@"TS"];
242
243 NSDate *tempDate = [NSDate dateWithTimeIntervalSince1970:[ts intValue]];
244
245
246 NSDateFormatter *mydateFormatter = [[NSDateFormatter alloc] init];
247 [mydateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
248 NSString *dateStr = [mydateFormatter stringFromDate:tempDate];
249
250
251 NSDictionary*dic=@{TS:dateStr,TEMPERATURE:[[memoryDataArray objectAtIndex:i] objectForKey:@"Tbody"]};
252
253 [dataArray addObject:dic];
254 }
255
256
257 NSDictionary *deviceInfo = @{kMAC_KEY:mac,kACTION_KEY:kACTION_GET_HISTORY_DATA,HISTORY:dataArray};
258
259 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
260 NSLog(@"historyDataArray:%@",memoryDataArray);
261
262 }else{
263
264 NSDictionary *deviceInfo = @{kMAC_KEY:mac,kACTION_KEY:kACTION_GET_HISTORY_DATA,HISTORY:[NSArray array]};
265
266 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
267
268 }
269
270 }
271
272
273
274 } DisposeErrorBlock:^(PT3SBTDeviceError error) {
275
276 }];
277
278 }
279}
280
281#pragma mark 删除数据
282RCT_EXPORT_METHOD(deleteHistory:(nonnull NSString *)mac){
283
284 if ([self getPT3SBTWithMac:mac]) {
285
286 [[self getPT3SBTWithMac:mac] commandDeleteMemorryData:^(BOOL deleteResult) {
287
288 [self sendEventWithName:EVENT_NOTIFY body:@{
289 kMAC_KEY:mac,
290 kACTION_KEY:kACTION_DELETE_HISTORY_DATA,
291 }];
292
293 } DisposeErrorBlock:^(PT3SBTDeviceError error) {
294
295 }];
296
297 }
298}
299
300
301RCT_EXPORT_METHOD(getBattery:(nonnull NSString *)mac){
302
303 if ([self getPT3SBTWithMac:mac]!=nil) {
304
305
306 [[self getPT3SBTWithMac:mac] commandGetPT3SBTBattery:^(NSNumber *battary) {
307
308 NSDictionary* deviceInfo = @{kACTION_KEY:kACTION_GET_BATTERY,BATTERY:battary};
309 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
310
311 } DiaposeErrorBlock:^(PT3SBTDeviceError error) {
312
313 }];
314
315
316 }else{
317
318 NSDictionary* deviceInfo = @{kACTION_KEY:@"ACTION_ERROR_PO",@"error_po":@"disconnect"};
319 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
320
321 }
322
323
324}
325
326RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
327
328
329 if ([self getPT3SBTWithMac:mac]!=nil) {
330
331 [[self getPT3SBTWithMac:mac] commandDisconnectDevice];
332
333 }else{
334
335
336
337 }
338
339
340
341}
342
343
344
345
346
347@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTProfileModule.h
new file mode 100755
index 0000000..e396c26
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTProfileModule.h
@@ -0,0 +1,52 @@
1//
2// POProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15@interface PT3SBTProfileModule : NSObject<RCTBridgeModule>
16
17
18#define kACTION_SET_TIME @"ACTION_SET_TIME"
19
20#define kACTION_GET_BATTERY @"ACTION_GET_BATTERY"
21
22#define kACTION_SET_UNIT @"ACTION_SET_UNIT"
23
24#define kACTION_GET_UNIT @"ACTION_GET_UNIT"
25
26#define kACTION_GET_HISTORY_COUNT @"ACTION_GET_HISTORY_COUNT"
27
28#define kACTION_GET_HISTORY_DATA @"ACTION_GET_HISTORY_DATA"
29
30#define kACTION_DELETE_HISTORY_DATA @"ACTION_DELETE_HISTORY_DATA"
31
32#define kACTION_TEMPERATURE_MEASUREMENT @"ACTION_TEMPERATURE_MEASUREMENT"
33
34#define kACTION_PUB_UNIT @"ACTION_PUB_UNIT"
35
36#define kACTION_GET_ALL_CONNECTED_DEVICES @"ACTION_GET_ALL_CONNECTED_DEVICES"
37
38#define STATUS @"STATUS"
39
40#define BATTERY @"BATTERY"
41
42#define UNIT @"UNIT"
43
44#define TS @"TS"
45
46#define COUNT @"COUNT"
47
48#define TEMPERATURE @"TEMPERATURE"
49
50#define HISTORY @"HISTORY"
51
52@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTProfileModule.m
new file mode 100755
index 0000000..f96b663
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/PT3SBTProfileModule.m
@@ -0,0 +1,49 @@
1//
2// POProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/12/4.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "PT3SBTProfileModule.h"
10
11@implementation PT3SBTProfileModule
12
13
14RCT_EXPORT_MODULE()
15
16#pragma mark
17#pragma mark - constantsToExport
18
19
20- (NSDictionary *)constantsToExport
21{
22 return @{
23 kACTION_SET_TIME:@"ACTION_SET_TIME",
24 kACTION_GET_BATTERY:@"ACTION_GET_BATTERY",
25 kACTION_SET_UNIT:@"ACTION_SET_UNIT",
26 kACTION_GET_UNIT:@"ACTION_GET_UNIT",
27 kACTION_GET_HISTORY_COUNT:@"ACTION_GET_HISTORY_COUNT",
28 kACTION_GET_HISTORY_DATA:@"ACTION_GET_HISTORY_DATA",
29 kACTION_DELETE_HISTORY_DATA:@"ACTION_DELETE_HISTORY_DATA",
30 kACTION_TEMPERATURE_MEASUREMENT:@"ACTION_TEMPERATURE_MEASUREMENT",
31 kACTION_PUB_UNIT:@"ACTION_PUB_UNIT",
32 kACTION_GET_ALL_CONNECTED_DEVICES:@"ACTION_GET_ALL_CONNECTED_DEVICES",
33 STATUS:@"STATUS",
34 BATTERY:@"BATTERY",
35 UNIT:@"UNIT",
36 TS:@"TS",
37 COUNT:@"COUNT",
38 TEMPERATURE:@"TEMPERATURE",
39 HISTORY:@"HISTORY",
40 };
41};
42
43
44+ (BOOL)requiresMainQueueSetup
45{
46 return YES;
47}
48
49@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/RNBGMacro.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/RNBGMacro.h
new file mode 100644
index 0000000..6edea70
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/RNBGMacro.h
@@ -0,0 +1,60 @@
1//
2// RNBGMacro.h
3// ReactNativeIOSLibrary
4//
5// Created by Lei Bao on 2017/5/25.
6// Copyright © 2017年 daiqingquan. All rights reserved.
7//
8
9#ifndef kRNBGMacro_h
10#define kRNBGMacro_h
11
12// Commom in BG5Module.js & BG5LModule.js
13#define kRN_ACTION_ERROR_BG @"ACTION_ERROR_BG"
14#define kRN_ACTION_KEEP_LINK @"ACTION_KEEP_LINK"
15#define kRN_ACTION_SET_TIME @"ACTION_SET_TIME"
16#define kRN_ACTION_SET_UNIT @"ACTION_SET_UNIT"
17#define kRN_ACTION_GET_BATTERY @"ACTION_GET_BATTERY"
18#define kRN_ACTION_START_MEASURE @"ACTION_START_MEASURE"
19#define kRN_ACTION_GET_OFFLINEDATA_COUNT @"ACTION_GET_OFFLINEDATA_COUNT"
20#define kRN_ACTION_GET_OFFLINEDATA @"ACTION_GET_OFFLINEDATA"
21#define kRN_ACTION_GET_OFFLINE_DATA @"ACTION_GET_OFFLINE_DATA"
22#define kRN_ACTION_DELETE_OFFLINEDATA @"ACTION_DELETE_OFFLINEDATA"
23#define kRN_ACTION_DELETE_OFFLINE_DATA @"ACTION_DELETE_OFFLINE_DATA"
24#define kRN_ACTION_SET_BOTTLEMESSAGE @"ACTION_SET_BOTTLEMESSAGE"
25#define kRN_ACTION_GET_BOTTLEMESSAGE @"ACTION_GET_BOTTLEMESSAGE"
26#define kRN_ACTION_SET_BOTTLEID @"ACTION_SET_BOTTLEID"
27#define kRN_ACTION_GET_BOTTLEID @"ACTION_GET_BOTTLEID"
28#define kRN_ACTION_STRIP_IN @"ACTION_STRIP_IN"
29#define kRN_ACTION_STRIP_OUT @"ACTION_STRIP_OUT"
30#define kRN_ACTION_GET_BLOOD @"ACTION_GET_BLOOD"
31#define kRN_ACTION_ONLINE_RESULT_BG @"ACTION_ONLINE_RESULT_BG"
32#define kRN_ACTION_CODE_ANALYSIS @"ACTION_CODE_ANALYSIS"
33#define kRN_ACTION_GET_ALL_CONNECTED_DEVICES @"ACTION_GET_ALL_CONNECTED_DEVICES"
34
35#define kRN_ERROR_NUM_BG @"ERROR_NUM_BG"
36#define kRN_ERROR_DESCRIPTION_BG @"ERROR_DESCRIPTION_BG"
37#define kRN_GET_BATTERY @"GET_BATTERY"
38#define kRN_GET_OFFLINEDATA_COUNT @"GET_OFFLINEDATA_COUNT"
39#define kRN_GET_OFFLINEDATA @"GET_OFFLINEDATA"
40#define kRN_SET_BOTTLEMESSAGE @"SET_BOTTLEMESSAGE"
41#define kRN_START_MODE @"START_MODE"
42#define kRN_GET_EXPIRECTIME @"GET_EXPIRECTIME"
43#define kRN_GET_USENUM @"GET_USENUM"
44#define kRN_GET_BOTTLEID @"GET_BOTTLEID"
45#define kRN_ONLINE_RESULT_BG @"ONLINE_RESULT_BG"
46#define kRN_DATA_ID @"DATA_ID"
47#define kRN_STRIP_NUM_BG @"STRIP_NUM_BG"
48#define kRN_STRIP_EXPIRETIME_BG @"STRIP_EXPIRETIME_BG"
49#define kRN_BOTTLEID_BG @"BOTTLEID_BG"
50#define kRN_ACTION_ADJUST_OFFLINE_DATA @"ADJUST_OFFLINE_DATA"
51#define kRN_ACTION_DELETE_USED_STRIP @"ACTION_DELETE_USED_STRIP"
52
53// Only for BG5
54
55
56// Only for BG5L
57
58
59
60#endif /* RNBGMacro_h */
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BModule.h
new file mode 100644
index 0000000..b2b8043
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BModule.h
@@ -0,0 +1,21 @@
1//
2// TS28BModule.h
3// ReactNativeIOSLibrary
4//
5// Created by user on 2019/11/12.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTEventEmitter.h>
12#else
13#import "RCTEventEmitter.h"
14#endif
15
16#import "TS28BHeader.h"
17
18@interface TS28BModule : RCTEventEmitter<RCTBridgeModule>
19
20@end
21
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BModule.m
new file mode 100644
index 0000000..5e51e7c
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BModule.m
@@ -0,0 +1,116 @@
1//
2// TS28BModule.m
3// ReactNativeIOSLibrary
4//
5// Created by user on 2019/11/12.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import "TS28BModule.h"
10#import "TS28BHeader.h"
11
12#define EVENT_NOTIFY @"event_notify_ts28b"
13#define kMAC_KEY @"mac"
14#define kACTION_KEY @"action"
15
16@interface TS28BModule()<TS28BControllerDelegate>
17
18@property (strong, nonatomic) TS28BController *ts28bController;
19
20
21
22@end
23
24@implementation TS28BModule
25
26
27RCT_EXPORT_MODULE()
28- (NSArray<NSString *> *)supportedEvents {
29 return @[@"event_notify", @"event_scan_device", @"event_scan_finish",
30 @"event_device_connected", @"event_device_connect_failed",
31 @"event_device_disconnect", @"event_authenticate_result",
32 @"event_notify_ts28b", @"event_notify_bg1",
33 @"action_connect_result_for_bg1"];
34}
35
36
37- (NSDictionary *)constantsToExport
38{
39 return @{ @"Event_Notify": EVENT_NOTIFY };
40}
41
42+ (BOOL)requiresMainQueueSetup
43{
44 return YES;
45}
46
47
48RCT_EXPORT_METHOD(getAllConnectedDevices){
49
50 [[NSNotificationCenter defaultCenter] postNotificationName:@"getAllTS28BConnectedDevices" object:self];
51}
52
53RCT_EXPORT_METHOD(measure:(nonnull NSString *)mac){
54
55
56 self.ts28bController = [TS28BController sharedController];
57
58 self.ts28bController.delegate = self;
59
60// if ([self getDeviceWithMac:mac] != nil) {
61//
62// [[self getDeviceWithMac:mac] commandStartMeasure:^(NSDictionary *result) {
63//
64// NSDictionary* deviceInfo = @{kACTION_KEY:@"ACTION_GET_MEASURE",@"bodyFlag":[result objectForKey:@"bodyFlag"],@"unit":[result objectForKey:@"unit"],@"result":[result objectForKey:@"result"]};
65//
66// [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
67//
68//
69//
70// }];
71//
72// }
73
74}
75
76//断开连接
77RCT_EXPORT_METHOD(disconnect:(nonnull NSString *)mac){
78
79 [[NSNotificationCenter defaultCenter] postNotificationName:@"disconnectTS28B" object:self];
80}
81
82#pragma mark - TS28B delegate
83
84- (void)controller:(TS28BController *)controller didDiscoverDevice:(TS28B *)device{
85 NSLog(@"搜索到设备的代理");
86
87
88
89}
90- (void)controller:(TS28BController *)controller didConnectSuccessDevice:(TS28B *)device{
91 NSLog(@"连接成功的代理");
92// self.connectedDevice = device;
93// NSLog(@"%@",[NSString stringWithFormat:@"连接成功:%@ \nSerial Number:%@\nModel Number%@\nFirmware:%@\nHardware:%@\nSoftware:%@\nManufacture:%@\nSystemID:%@",device.peripheral.name,device.serialNumber,device.modelNumber,device.firmwareVersion,device.hardwareVersion,device.softwareVersion,device.manufacturerName,device.systemID]);
94
95
96}
97- (void)controller:(TS28BController *)controller didConnectFailDevice:(TS28B *)device{
98 NSLog(@"连接失败的代理");
99// self.recordTextView.text = @"连接失败";
100
101}
102- (void)controller:(TS28BController *)controller didDisconnectDevice:(TS28B *)device{
103 NSLog(@"断开连接的代理");
104// self.recordTextView.text = @"连接断开";
105}
106- (void)controller:(TS28BController *)controller device:(TS28B *)device didUpdateTemperature:(float)value temperatureUnit:(TemperatureUnit)unit measureDate:(NSDate *)date measureLocation:(TemperatureType)type{
107
108// self.valueLabel.text = [NSString stringWithFormat:@"%.1f %@",value,(unit == TemperatureUnit_C)?@"C":@"F"];
109
110 NSDictionary* deviceInfo = @{kACTION_KEY:@"ACTION_GET_MEASURE",@"bodyFlag":[NSNumber numberWithInt:type],@"unit":[NSNumber numberWithInt:unit],@"result":[NSNumber numberWithFloat:value]};
111
112 [self sendEventWithName:EVENT_NOTIFY body:deviceInfo];
113}
114
115
116@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BProfileModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BProfileModule.h
new file mode 100644
index 0000000..a4ac23c
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BProfileModule.h
@@ -0,0 +1,38 @@
1//
2// TS28BProfileModule.h
3// ReactNativeIOSLibrary
4//
5// Created by user on 2019/11/14.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#if __has_include(<React/RCTAssert.h>)
11#import <React/RCTBridgeModule.h>
12#else
13#import "RCTBridgeModule.h"
14#endif
15NS_ASSUME_NONNULL_BEGIN
16
17@interface TS28BProfileModule : NSObject<RCTBridgeModule>
18
19
20#define TS28B_EVENT_NOTIFY @"event_notify_ts28b"
21
22#define TS28B_ACTION @"action"
23
24#define TS28B_DEVICE @"devices"
25
26#define TS28B_KEY_MAC @"mac"
27
28#define kACTION_GET_ALL_CONNECTED_DEVICES @"ACTION_GET_ALL_CONNECTED_DEVICES"
29
30#define TS28B_RESULT @"result"
31
32#define TS28B_UNIT_FLAG @"unit_flag"
33
34#define TS28B_THERMOMETER_TYPE @"thermometer_type"
35
36@end
37
38NS_ASSUME_NONNULL_END
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BProfileModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BProfileModule.m
new file mode 100644
index 0000000..21d65b5
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/TS28BProfileModule.m
@@ -0,0 +1,40 @@
1//
2// TS28BProfileModule.m
3// ReactNativeIOSLibrary
4//
5// Created by user on 2019/11/14.
6// Copyright © 2019 daiqingquan. All rights reserved.
7//
8
9#import "TS28BProfileModule.h"
10
11@implementation TS28BProfileModule
12
13
14RCT_EXPORT_MODULE()
15
16#pragma mark
17#pragma mark - constantsToExport
18
19
20- (NSDictionary *)constantsToExport
21{
22 return @{
23 @"ACTION_MEASUREMENT_RESULT":@"action_measurement_result",
24 TS28B_ACTION:@"action",
25 TS28B_DEVICE:@"device",
26 TS28B_KEY_MAC:@"mac",
27 kACTION_GET_ALL_CONNECTED_DEVICES:kACTION_GET_ALL_CONNECTED_DEVICES,
28 TS28B_RESULT:@"result",
29 TS28B_UNIT_FLAG:@"unit_flag",
30 TS28B_THERMOMETER_TYPE:@"thermometer_type"
31 };
32};
33
34
35+ (BOOL)requiresMainQueueSetup
36{
37 return YES;
38}
39
40@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/iHealthDeviceManagerModule.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/iHealthDeviceManagerModule.h
new file mode 100755
index 0000000..2719f9d
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/iHealthDeviceManagerModule.h
@@ -0,0 +1,27 @@
1//
2// iHealthDeviceManagerModule.h
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#if __has_include(<React/RCTEventEmitter.h>)
12#import <React/RCTEventEmitter.h>
13#else
14#import "RCTEventEmitter.h"
15#endif
16
17
18@interface iHealthDeviceManagerModule : RCTEventEmitter<RCTBridgeModule>
19{
20 NSDictionary *bg1IdpsDic;
21}
22
23+ (NSString*)autherizedUserID;
24+ (NSString*)autherizedClientID;
25+ (NSString*)autherizedClientSecret;
26
27@end
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/iHealthDeviceManagerModule.m b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/iHealthDeviceManagerModule.m
new file mode 100755
index 0000000..c402987
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/iHealthDeviceManagerModule.m
@@ -0,0 +1,1338 @@
1//
2// iHealthDeviceManagerModule.m
3// ReactNativeIOSLibrary
4//
5// Created by daiqingquan on 2016/11/23.
6// Copyright © 2016年 daiqingquan. All rights reserved.
7//
8
9#import "iHealthDeviceManagerModule.h"
10#import "AMHeader.h"
11#import "BPHeader.h"
12#import "HSHeader.h"
13#import "BGHeader.h"
14#import "POHeader.h"
15#import "ECGHeader.h"
16#import "TS28BHeader.h"
17#import "NT13BHeader.h"
18#import "BGMacroFile.h"
19#import "ECGMacroFile.h"
20#import "THV3Macro.h"
21#import "NT13BMacroFile.h"
22#import "IHSDKCloudUser.h"
23#import "ManageDeviceController.h"
24#import "ScanDeviceController.h"
25#import "ConnectDeviceController.h"
26#import <MediaPlayer/MediaPlayer.h>
27
28#import "TS28BModule.h"
29
30#import "BG1S.h"
31
32#import "BG1SController.h"
33
34#import "PO1.h"
35
36#import "PO1Controller.h"
37
38#import "PO1ProfileModule.h"
39
40#import "PT3SBT.h"
41
42#import "PT3SBTController.h"
43
44#import "PT3SBTMacroFile.h"
45
46#define FetchUserInfo @"com.rn.ihealth.dm.userinfo"
47
48#define kEvent_Scan_Device @"event_scan_device"
49#define kEvent_Scan_Finish @"event_scan_finish"
50#define kEvent_Device_Connected @"event_device_connected"
51#define kEvent_Device_Connect_Failed @"event_device_connect_failed"
52#define kEvent_Device_Disconnect @"event_device_disconnect"
53#define kEvent_Authenticate_Result @"event_authenticate_result"
54
55#define kType_AM3S @"AM3S"
56#define kType_AM4 @"AM4"
57#define kType_AM5 @"AM5"
58#define kType_PO3 @"PO3"
59#define kType_BP5 @"BP5"
60#define kType_BP7 @"BP7"
61#define kType_BP3L @"BP3L"
62#define kType_BP5S @"BP5S"
63#define kType_BP7S @"BP7S"
64#define kType_KN550 @"KN550"
65#define kType_HS4 @"HS4"
66#define kType_HS4S @"HS4S"
67#define kType_HS2 @"HS2"
68#define kType_HS2S_PRO @"HS2S Pro"
69#define kType_BG1 @"BG1"
70#define kType_BG5 @"BG5"
71#define kType_BG5S @"BG5S"
72#define kType_ECG3 @"ECG3"
73#define kType_ECG3USB @"ECG3USB"
74#define kType_BTM @"FDIR_V3"
75#define kType_TS28B @"TS28B"
76#define kType_NT13B @"NT13B"
77#define kType_BG1S @"BG1S"
78#define kType_HS2S @"HS2S"
79#define kType_PO1 @"PO1"
80#define kType_PT3SBT @"PT3SBT"
81
82
83@interface iHealthDeviceManagerModule()<TS28BControllerDelegate>
84
85
86@property (strong, nonatomic) TS28BController *ts28bController;
87
88@property (strong, nonatomic) TS28B *ts28b;
89
90@end
91
92@implementation iHealthDeviceManagerModule
93
94RCT_EXPORT_MODULE()
95
96- (NSArray<NSString *> *)supportedEvents {
97 return @[
98 kEvent_Scan_Device,
99 kEvent_Scan_Finish,
100 kEvent_Device_Connected,
101 kEvent_Device_Connect_Failed,
102 kEvent_Device_Disconnect,
103 kEvent_Authenticate_Result,
104 @"event_notify_ts28b",
105 @"event_notify_bg1",
106 @"action_connect_result_for_bg1"
107 ];
108}
109
110+ (BOOL)requiresMainQueueSetup {
111 return YES;
112}
113
114#pragma mark - constantsToExport
115
116- (NSDictionary *)constantsToExport{
117 return @{
118 @"AM3S" :kType_AM3S,
119 @"AM4" :kType_AM4,
120 @"AM5" :kType_AM5,
121 @"PO3":kType_PO3,
122 @"PO3M":kType_PO3,
123 @"BP5":kType_BP5,
124 @"BP7":kType_BP7,
125 @"BP3L" :kType_BP3L,
126 @"BP5S" : kType_BP5S,
127 @"BP7S" : kType_BP7S,
128 @"KN550":kType_KN550,
129 @"HS4S" :kType_HS4,
130 @"HS4" :kType_HS4,
131 @"HS2" :kType_HS2,
132 @"BG1":kType_BG1,
133 @"BG5":kType_BG5,
134 @"BG5S":kType_BG5S,
135 @"ECG3":kType_ECG3,
136 @"ECG3USB":kType_ECG3USB,
137 @"BTM":kType_BTM,
138 @"NT13B":kType_NT13B,
139 @"TS28B":kType_TS28B,
140 @"BG1S":kType_BG1S,
141 @"HS2S":kType_HS2S,
142 @"HS2S Pro":kType_HS2S_PRO,
143 @"PO1":kType_PO1,
144 @"PT3SBT":kType_PT3SBT,
145 @"Event_Scan_Device":kEvent_Scan_Device,
146 @"Event_Scan_Finish":kEvent_Scan_Finish,
147 @"Event_Device_Connected":kEvent_Device_Connected,
148 @"Event_Device_Connect_Failed":kEvent_Device_Connect_Failed,
149 @"Event_Device_Disconnect":kEvent_Device_Disconnect,
150 @"Event_Authenticate_Result":kEvent_Authenticate_Result,
151 };
152};
153
154#pragma mark
155#pragma mark - Init
156-(id)init{
157 NSLog(@"iHealthScanner: *** iHealthDeviceManagerModule init CALLED ***");
158 if (self = [super init]){
159 NSLog(@"iHealthScanner: *** Registering NSNotification observers ***");
160 [ScanDeviceController commandGetInstance];
161 // AM3S
162 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:AM3SDiscover object:nil];
163 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:AM3SConnectFailed object:nil];
164 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:AM3SConnectNoti object:nil];
165 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:AM3SDisConnectNoti object:nil];
166 // AM4
167 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:AM4Discover object:nil];
168 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:AM4ConnectFailed object:nil];
169 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:AM4ConnectNoti object:nil];
170 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:AM4DisConnectNoti object:nil];
171
172 //AM5
173
174 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:AM5Discover object:nil];
175
176 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:AM5ConnectFailed object:nil];
177
178 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:AM5ConnectNoti object:nil];
179
180 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:AM5DisConnectNoti object:nil];
181
182 // PO3
183 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:PO3Discover object:nil];
184 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:PO3ConnectFailed object:nil];
185 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:PO3ConnectNoti object:nil];
186 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:PO3DisConnectNoti object:nil];
187 // BP5
188 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:BP5ConnectNoti object:nil];
189 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:BP5DisConnectNoti object:nil];
190 // BP7
191 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:BP7ConnectNoti object:nil];
192 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:BP7DisConnectNoti object:nil];
193 //BP3L
194 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:BP3LDiscover object:nil];
195 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:BP3LConnectFailed object:nil];
196 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:BP3LConnectNoti object:nil];
197 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:BP3LDisConnectNoti object:nil];
198
199 //BP5S
200 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:BP5SDiscover object:nil];
201 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:BP5SConnectFailed object:nil];
202 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:BP5SConnectNoti object:nil];
203 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:BP5SDisConnectNoti object:nil];
204
205 //BP7S
206 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:BP7SDiscover object:nil];
207 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:BP7SConnectNoti object:nil];
208 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:BP7SDisConnectNoti object:nil];
209 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:BP7SConnectFailed object:nil];
210
211 //KN550BT
212 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:KN550BTDiscover object:nil];
213 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:KN550BTConnectNoti object:nil];
214 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:KN550BTDisConnectNoti object:nil];
215 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:KN550BTConnectFailed object:nil];
216 // HS4S
217 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:HS4Discover object:nil];
218 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:HS4ConnectFailed object:nil];
219 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:HS4ConnectNoti object:nil];
220 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:HS4DisConnectNoti object:nil];
221 // HS2
222 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:HS2Discover object:nil];
223 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:HS2ConnectFailed object:nil];
224 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:HS2ConnectNoti object:nil];
225 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:HS2DisConnectNoti object:nil];
226
227
228 // HS2S
229 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:HS2SDiscover object:nil];
230 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:HS2SConnectFailed object:nil];
231 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:HS2SConnectNoti object:nil];
232 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:HS2SDisConnectNoti object:nil];
233
234 //BG1
235 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(bg1Discover:) name:kNotificationNameNeedAudioPermission object:nil];
236 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(bg1Connect:) name:kNotificationNameAudioDeviceInsert object:nil];
237 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceBG1Disconnect:) name:kNotificationNameBG1DidDisConnect object:nil];
238 //BG5
239 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:BG5ConnectNoti object:nil];
240 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:BG5DisConnectNoti object:nil];
241
242 // BG5S
243 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:kNotificationNameBG5SDidDiscover object:nil];
244 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:kNotificationNameBG5SConnectFail object:nil];
245 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:kNotificationNameBG5SConnectSuccess object:nil];
246 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:kNotificationNameBG5SDidDisConnect object:nil];
247
248 //ECG3
249 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:ECG3Discover object:nil];
250 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:ECG3ConnectFailed object:nil];
251 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:ECG3ConnectNoti object:nil];
252 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:ECG3DisConnectNoti object:nil];
253
254 //ECG3USB
255 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:ECGUSBConnectNoti object:nil];
256 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:ECGUSBDisConnectNoti object:nil];
257
258 //BTM(THV3)
259 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:THV3Discover object:nil];
260 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:THV3ConnectFailed object:nil];
261 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:THV3ConnectNoti object:nil];
262 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:THV3DisConnectNoti object:nil];
263 //NT13B
264
265 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:NT13BDiscover object:nil];
266 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:NT13BConnectFailed object:nil];
267 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:NT13BConnectNoti object:nil];
268 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:NT13BDisConnectNoti object:nil];
269
270 //TS28B
271
272
273
274 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(disconnectTS28B) name:@"disconnectTS28B" object:nil];
275 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(getAllTS28BConnectedDevices) name:@"getAllTS28BConnectedDevices" object:nil];
276
277
278 //BG1S
279
280 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:BG1SDiscover object:nil];
281 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:BG1SConnectFailed object:nil];
282 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:BG1SConnectNoti object:nil];
283 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:BG1SDisConnectNoti object:nil];
284 // PO1
285 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:PO1Discover object:nil];
286 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:PO1ConnectFailed object:nil];
287 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:PO1ConnectNoti object:nil];
288 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:PO1DisConnectNoti object:nil];
289 // PT3SBT
290 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:PT3SBTDiscover object:nil];
291 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:PT3SBTConnectFailed object:nil];
292 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:PT3SBTConnectNoti object:nil];
293 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:PT3SBTDisConnectNoti object:nil];
294
295 [AM3Controller shareIHAM3Controller];
296 [AM3SController_V2 shareIHAM3SController];
297 [AM4Controller shareIHAM4Controller];
298 [AM5Controller shareAM5Controller];
299 [BP3LController shareBP3LController];
300 [BP5Controller shareBP5Controller];
301 [BP7Controller shareBP7Controller];
302 [BP5SController sharedController];
303 [BG5Controller shareIHBg5Controller];
304 [BG5SController sharedController];
305 [ECG3Controller shareECG3Controller];
306 [ECG3USBController shareECG3USBController];
307 [HS4Controller shareIHHs4Controller];
308 [HS2Controller shareIHHs2Controller];
309 [HS2SController shareIHHS2SController];
310 [THV3Controller sharedController];
311 [NT13BController shareIHNT13BController];
312 [BG1SController shareIHBG1SController];
313 [PO1Controller shareIHPO1Controller];
314 [PT3SBTController shareIHPT3SBTController];
315
316 }
317 return self;
318}
319
320- (void)dealloc{
321 [[NSNotificationCenter defaultCenter]removeObserver:self];
322}
323
324#pragma mark -
325
326-(void)disconnectTS28B{
327
328 [self.ts28bController disconnectDevice:self.ts28b];
329
330}
331-(void)getAllTS28BConnectedDevices{
332
333 if (self.ts28b==nil) {
334 return;
335 }
336
337 NSDictionary* deviceInfo = @{@"event_notify_ts28b":@"ACTION_GET_ALL_CONNECTED_DEVICES",@"devices":self.ts28b.serialNumber};
338
339 [self sendEventWithName:@"event_notify_ts28b" body:deviceInfo];
340}
341
342- (NSString*)serialNumebr:(NSDictionary*)userInfo{
343 if (!userInfo){
344 return nil;
345 }
346 NSString* serialNumber = userInfo[@"SerialNumber"];
347 NSString* deviceId = userInfo[@"ID"];
348 if (serialNumber && serialNumber.length > 0){
349 return serialNumber;
350 } else if (deviceId && deviceId.length > 0){
351 return deviceId;
352 }
353 return nil;
354}
355
356#pragma mark - Notification
357
358#pragma mark - BG1
359-(void)bg1Discover:(NSNotification*)info {
360
361
362 // NSDictionary* deviceInfo = @{@"mac":@"",@"type":@"BG1"};
363 // [self sendEventWithName:kEvent_Scan_Device body:deviceInfo];
364
365}
366
367-(void)bg1Connect:(NSNotification*)info {
368
369 [[MPMusicPlayerController applicationMusicPlayer] setVolume:1.0f];
370 NSDictionary* deviceInfo = @{@"mac":@"",@"type":@"BG1"};
371 [self sendEventWithName:kEvent_Scan_Device body:deviceInfo];
372
373
374 // NSDictionary* deviceInfo = @{@"mac":@"",@"type":@"BG1"};
375 // [self sendEventWithName:kEvent_Device_Connected body:deviceInfo];
376
377 BG1*myBG1=[[BG1Controller shareBG1Controller] getCurrentBG1Instance];
378
379 [myBG1 commandBG1DeviceModel:@0 withDiscoverBlock:^{
380
381 } withDiscoverBlock:^(NSDictionary *idpsDic) {
382
383 bg1IdpsDic = [NSDictionary dictionaryWithDictionary:idpsDic];
384
385 } withConnectBlock:^{
386
387 NSString *bg1Mac = @"";
388 if (bg1IdpsDic[@"SerialNumber"] != nil) {
389 bg1Mac = bg1IdpsDic[@"SerialNumber"];
390 }
391 NSDictionary* deviceInfo = @{@"mac":bg1Mac,@"type":@"BG1"};
392 [self sendEventWithName:kEvent_Device_Connected body:deviceInfo];
393
394 } withErrorBlock:^(BG1Error errorID) {
395
396 NSDictionary* deviceInfo = @{@"mac":@"",@"action":@"action_measure_error_for_bg1",@"action_measure_error_for_bg1":[NSNumber numberWithInt:errorID]};
397 [self sendEventWithName:@"event_notify_bg1" body:deviceInfo];
398
399 }];
400
401}
402
403-(void)deviceBG1Disconnect:(NSNotification*)info {
404
405 NSDictionary* deviceInfo = @{@"mac":@"",@"type":kType_BG1};
406 [self sendEventWithName:kEvent_Device_Disconnect body:deviceInfo];
407}
408
409#pragma mark - 发现BLE设备
410-(void)deviceDiscover:(NSNotification*)info {
411
412 NSLog(@"Native: device discover %@", info);
413
414 NSDictionary* userInfo = [info userInfo];
415 NSString* deviceName = userInfo[@"DeviceName"];
416
417 NSDictionary *deviceNameForType = @{
418 @"AM3S" :kType_AM3S,
419 @"AM4" :kType_AM4,
420 @"AM5" :kType_AM5,
421 @"PO3":kType_PO3,
422 @"PO3M":kType_PO3,
423 @"BP3L" :kType_BP3L,
424 @"BP5S" : kType_BP5S,
425 @"BP7S" : kType_BP7S,
426 @"KN-550BT":kType_KN550,
427 @"KN550":kType_KN550,
428 @"HS4S" :kType_HS4,
429 @"HS4" :kType_HS4,
430 @"HS2" :kType_HS2,
431 @"ECG3":kType_ECG3,
432 @"FDTH":kType_BTM,
433 @"BG5S":kType_BG5S,
434 @"NT13B":kType_NT13B,
435 @"TS28B":kType_TS28B,
436 @"BG1S":kType_BG1S,
437 @"HS2S":kType_HS2S,
438 @"PO1":kType_PO1,
439 @"PT3SBT":kType_PT3SBT,
440 };
441
442 if (deviceNameForType[deviceName] && [self serialNumebr:userInfo]){
443 NSString *sn = [self serialNumebr:userInfo];
444 [self sendEventWithName:kEvent_Scan_Device body:@{@"mac":sn,@"type":deviceNameForType[deviceName]}];
445 }
446}
447
448#pragma mark 连接成功 BT\BLE都用这个通知
449- (BOOL)isIAPDevice:(NSString*)deviceName{
450 NSArray *array = @[@"BP5",@"BP7",@"BG5",@"ECG"];
451 if (deviceName && [array containsObject:deviceName]){
452 return YES;
453 } else {
454 return NO;
455 }
456}
457-(void)deviceConnect:(NSNotification*)info {
458
459 NSDictionary* userInfo = [info userInfo];
460 NSLog(@"连接成功:%@",userInfo);
461 NSString* deviceName = userInfo[@"DeviceName"];
462
463 NSString* protocolString = userInfo[@"ProtocolString"];
464
465 if ([protocolString isEqualToString:@"NT13B_Protocol"]) {
466 deviceName=@"NT13B";
467 }
468
469 NSDictionary *deviceNameForType = @{
470 @"AM3S" :kType_AM3S,
471 @"AM4" :kType_AM4,
472 @"AM5" :kType_AM5,
473 @"PO3":kType_PO3,
474 @"PO3M":kType_PO3,
475 @"BP3L" :kType_BP3L,
476 @"BP5S" : kType_BP5S,
477 @"BP7S" : kType_BP7S,
478 @"KN-550BT":kType_KN550,
479 @"KN550":kType_KN550,
480 @"HS4S" :kType_HS4,
481 @"HS4" :kType_HS4,
482 @"HS2" :kType_HS2,
483 @"FDTH":kType_BTM,
484 @"BP5":kType_BP5,
485 @"BP7":kType_BP7,
486 @"BG5":kType_BG5,
487 @"BG5S":kType_BG5S,
488 @"ECG3":kType_ECG3,
489 @"ECG":kType_ECG3USB,// ECG3USB的连接通知里使用的设备名称是ECG,
490 @"NT13B":kType_NT13B,
491 @"TS28B":kType_TS28B,
492 @"BG1S":kType_BG1S,
493 @"HS2S":kType_HS2S,
494 @"HS2S Pro":kType_HS2S_PRO,
495 @"PO1":kType_PO1,
496 @"PT3SBT":kType_PT3SBT,
497 };
498
499 if (deviceNameForType[deviceName] && [self serialNumebr:userInfo]){
500 NSString *sn = [self serialNumebr:userInfo];
501 if ([self isIAPDevice:deviceName]){
502 [self sendEventWithName:kEvent_Scan_Device body:@{@"mac":sn,@"type":deviceNameForType[deviceName]}];
503 }
504 [self sendEventWithName:kEvent_Device_Connected body:@{@"mac":sn,@"type":deviceNameForType[deviceName]}];
505 }
506}
507#pragma mark 连接断开 BT\BLE都用这个通知
508-(void)deviceDisconnect:(NSNotification*)info {
509 NSDictionary* userInfo = [info userInfo];
510 NSString* deviceName = userInfo[@"DeviceName"];
511
512 NSString* protocolString = userInfo[@"ProtocolString"];
513
514 if ([protocolString isEqualToString:@"NT13B_Protocol"]) {
515 deviceName=@"NT13B";
516 }
517
518 if ([protocolString isEqualToString:@"com.jiuan.PO1"]) {
519 deviceName=@"PO1";
520 }
521
522 NSDictionary *deviceNameForType = @{
523 @"AM3S" :kType_AM3S,
524 @"AM4" :kType_AM4,
525 @"AM5" :kType_AM5,
526 @"PO3":kType_PO3,
527 @"PO3M":kType_PO3,
528 @"BP3L" :kType_BP3L,
529 @"BP5S" : kType_BP5S,
530 @"BP7S" : kType_BP7S,
531 @"KN-550BT":kType_KN550,
532 @"KN550":kType_KN550,
533 @"HS4S" :kType_HS4,
534 @"HS4" :kType_HS4,
535 @"HS2" :kType_HS2,
536 @"FDTH":kType_BTM,
537 @"BP5":kType_BP5,
538 @"BP7":kType_BP7,
539 @"BG5":kType_BG5,
540 @"BG5S":kType_BG5S,
541 @"ECG3":kType_ECG3,
542 @"ECG":kType_ECG3USB,// ECG3USB的连接通知里使用的设备名称是ECG,
543 @"NT13B":kType_NT13B,
544 @"TS28B":kType_TS28B,
545 @"BG1S":kType_BG1S,
546 @"HS2S":kType_HS2S,
547 @"HS2S Pro":kType_HS2S_PRO,
548 @"PO1":kType_PO1,
549 @"PT3SBT":kType_PT3SBT,
550 };
551
552 if (deviceNameForType[deviceName] && [self serialNumebr:userInfo]){
553 NSString *sn = [self serialNumebr:userInfo];
554 [self sendEventWithName:kEvent_Device_Disconnect body:@{@"mac":sn,@"type":deviceNameForType[deviceName]}];
555 }
556}
557#pragma mark - 连接失败,BLE设备
558-(void)deviceConnectFailed:(NSNotification*)info {
559 NSDictionary* userInfo = [info userInfo];
560 NSString* deviceName = userInfo[@"DeviceName"];
561
562 NSString* protocolString = userInfo[@"ProtocolString"];
563
564 if ([protocolString isEqualToString:@"NT13B_Protocol"]) {
565 deviceName=@"NT13B";
566 }
567
568 NSDictionary *deviceNameForType = @{
569 @"AM3S" :kType_AM3S,
570 @"AM4" :kType_AM4,
571 @"AM5" :kType_AM5,
572 @"PO3":kType_PO3,
573 @"PO3M":kType_PO3,
574 @"BP3L" :kType_BP3L,
575 @"BP5S" : kType_BP5S,
576 @"BG5S" :kType_BG5S,
577 @"BP7S" : kType_BP7S,
578 @"KN-550BT":kType_KN550,
579 @"KN550":kType_KN550,
580 @"HS4S" :kType_HS4,
581 @"HS4" :kType_HS4,
582 @"HS2" :kType_HS2,
583 @"FDTH":kType_BTM,
584 @"ECG3":kType_ECG3,
585 @"NT13B":kType_NT13B,
586 @"TS28B":kType_TS28B,
587 @"BG1S":kType_BG1S,
588 @"HS2S":kType_HS2S,
589 @"HS2S Pro":kType_HS2S_PRO,
590 @"PO1":kType_PO1,
591 @"PT3SBT":kType_PT3SBT,
592 };
593
594 if (deviceNameForType[deviceName] && [self serialNumebr:userInfo]){
595 NSString *sn = [self serialNumebr:userInfo];
596 [self sendEventWithName:kEvent_Device_Connect_Failed body:@{@"mac":sn,@"type":deviceNameForType[deviceName]}];
597 }
598}
599
600#pragma mark - Method
601
602RCT_EXPORT_METHOD(sdkAuthWithLicense:(nonnull NSString *)license){
603
604
605 NSArray * arr = [license componentsSeparatedByString:@"."];
606
607
608 NSString*licenseName=[NSString stringWithFormat:@"%@",[arr objectAtIndex:0]];
609
610
611 NSString *filePath = [[NSBundle mainBundle] pathForResource:licenseName ofType:@"pem"];
612
613
614 NSData*data = [NSData dataWithContentsOfFile:filePath];
615
616
617
618 if (data!=nil) {
619
620 [[IHSDKCloudUser commandGetSDKUserInstance] commandSDKUserValidationWithLicense:data UserDeviceAccess:^(NSArray *DeviceAccessArray) {
621
622 NSLog(@"DeviceAccessArray :%@",DeviceAccessArray);
623
624 } UserValidationSuccess:^(UserAuthenResult result) {
625
626 if (result==UserAuthen_LoginSuccess || result==UserAuthen_RegisterSuccess|| result==UserAuthen_TrySuccess ) {
627 [self sendEventWithName:kEvent_Authenticate_Result body:@{@"access":@1}];
628 }else{
629
630 [self sendEventWithName:kEvent_Authenticate_Result body:@{@"access":@0}];
631
632 }
633
634 } DisposeErrorBlock:^(UserAuthenResult errorID) {
635
636 [self sendEventWithName:kEvent_Authenticate_Result body:@{@"access":@0}];
637
638
639
640
641
642 }];
643
644 }else{
645
646
647 [self sendEventWithName:kEvent_Authenticate_Result body:@{@"access":@0}];
648
649 }
650
651
652
653
654}
655
656-(void)ensureInitialized {
657 static dispatch_once_t onceToken;
658 dispatch_once(&onceToken, ^{
659 NSLog(@"iHealthScanner: *** ensureInitialized - registering observers ***");
660 [ScanDeviceController commandGetInstance];
661
662 // AM3S
663 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:AM3SDiscover object:nil];
664 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:AM3SConnectFailed object:nil];
665 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:AM3SConnectNoti object:nil];
666 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:AM3SDisConnectNoti object:nil];
667 // AM4
668 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:AM4Discover object:nil];
669 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:AM4ConnectFailed object:nil];
670 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:AM4ConnectNoti object:nil];
671 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:AM4DisConnectNoti object:nil];
672 // AM5
673 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:AM5Discover object:nil];
674 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:AM5ConnectFailed object:nil];
675 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:AM5ConnectNoti object:nil];
676 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:AM5DisConnectNoti object:nil];
677 // PO3
678 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:PO3Discover object:nil];
679 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:PO3ConnectFailed object:nil];
680 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:PO3ConnectNoti object:nil];
681 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:PO3DisConnectNoti object:nil];
682 // BP5
683 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:BP5ConnectNoti object:nil];
684 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:BP5DisConnectNoti object:nil];
685 // BP7
686 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:BP7ConnectNoti object:nil];
687 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:BP7DisConnectNoti object:nil];
688 // BP3L
689 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:BP3LDiscover object:nil];
690 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:BP3LConnectFailed object:nil];
691 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:BP3LConnectNoti object:nil];
692 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:BP3LDisConnectNoti object:nil];
693 // BP5S
694 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:BP5SDiscover object:nil];
695 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:BP5SConnectFailed object:nil];
696 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:BP5SConnectNoti object:nil];
697 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:BP5SDisConnectNoti object:nil];
698 // BP7S
699 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:BP7SDiscover object:nil];
700 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:BP7SConnectNoti object:nil];
701 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:BP7SDisConnectNoti object:nil];
702 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:BP7SConnectFailed object:nil];
703 // KN550BT
704 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:KN550BTDiscover object:nil];
705 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:KN550BTConnectNoti object:nil];
706 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:KN550BTDisConnectNoti object:nil];
707 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:KN550BTConnectFailed object:nil];
708 // HS4S
709 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:HS4Discover object:nil];
710 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:HS4ConnectFailed object:nil];
711 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:HS4ConnectNoti object:nil];
712 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:HS4DisConnectNoti object:nil];
713 // HS2
714 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:HS2Discover object:nil];
715 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:HS2ConnectFailed object:nil];
716 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:HS2ConnectNoti object:nil];
717 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:HS2DisConnectNoti object:nil];
718 // HS2S
719 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:HS2SDiscover object:nil];
720 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:HS2SConnectFailed object:nil];
721 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:HS2SConnectNoti object:nil];
722 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:HS2SDisConnectNoti object:nil];
723 // BG1
724 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(bg1Discover:) name:kNotificationNameNeedAudioPermission object:nil];
725 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(bg1Connect:) name:kNotificationNameAudioDeviceInsert object:nil];
726 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceBG1Disconnect:) name:kNotificationNameBG1DidDisConnect object:nil];
727 // BG5
728 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:BG5ConnectNoti object:nil];
729 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:BG5DisConnectNoti object:nil];
730 // BG5S
731 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:kNotificationNameBG5SDidDiscover object:nil];
732 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:kNotificationNameBG5SConnectFail object:nil];
733 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:kNotificationNameBG5SConnectSuccess object:nil];
734 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:kNotificationNameBG5SDidDisConnect object:nil];
735 // ECG3
736 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:ECG3Discover object:nil];
737 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:ECG3ConnectFailed object:nil];
738 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:ECG3ConnectNoti object:nil];
739 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:ECG3DisConnectNoti object:nil];
740 // ECG3USB
741 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:ECGUSBConnectNoti object:nil];
742 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:ECGUSBDisConnectNoti object:nil];
743 // BTM(THV3)
744 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:THV3Discover object:nil];
745 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:THV3ConnectFailed object:nil];
746 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:THV3ConnectNoti object:nil];
747 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:THV3DisConnectNoti object:nil];
748 // NT13B
749 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:NT13BDiscover object:nil];
750 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:NT13BConnectFailed object:nil];
751 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:NT13BConnectNoti object:nil];
752 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:NT13BDisConnectNoti object:nil];
753 // TS28B
754 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(disconnectTS28B) name:@"disconnectTS28B" object:nil];
755 // PO1
756 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:PO1Discover object:nil];
757 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:PO1ConnectFailed object:nil];
758 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:PO1ConnectNoti object:nil];
759 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:PO1DisConnectNoti object:nil];
760 // PT3SBT
761 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:PT3SBTDiscover object:nil];
762 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:PT3SBTConnectFailed object:nil];
763 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:PT3SBTConnectNoti object:nil];
764 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:PT3SBTDisConnectNoti object:nil];
765 // BG1S
766 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDiscover:) name:BG1SDiscover object:nil];
767 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnectFailed:) name:BG1SConnectFailed object:nil];
768 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceConnect:) name:BG1SConnectNoti object:nil];
769 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(deviceDisconnect:) name:BG1SDisConnectNoti object:nil];
770
771 NSLog(@"iHealthScanner: *** ensureInitialized DONE ***");
772 });
773}
774
775RCT_EXPORT_METHOD(startDiscovery:(nonnull NSString *)deviceType){
776 [self ensureInitialized];
777 NSLog(@"iHealthScanner: startDiscovery called with type=%@", deviceType);
778 if ([deviceType isEqualToString:kType_BP5]){
779
780 NSArray*bp5array = [[BP5Controller shareBP5Controller] getAllCurrentBP5Instace];
781 if (bp5array.count) {
782 for (int i=0; i<bp5array.count; i++) {
783 BP5*mybp5=[bp5array objectAtIndex:i];
784 NSDictionary* deviceInfo = [[NSDictionary alloc]init];
785 deviceInfo = @{@"mac":mybp5.serialNumber,@"type":kType_BP5};
786 [self sendEventWithName:kEvent_Scan_Device body:deviceInfo];
787 }
788 }
789 }else if ([deviceType isEqualToString:kType_BP7]){
790
791 NSArray*bp7array = [[BP7Controller shareBP7Controller] getAllCurrentBP7Instace];
792 if (bp7array.count) {
793 for (int i=0; i<bp7array.count; i++) {
794 BP7*mybp7=[bp7array objectAtIndex:i];
795 NSDictionary* deviceInfo = [[NSDictionary alloc]init];
796 deviceInfo = @{@"mac":mybp7.serialNumber,@"type":kType_BP7};
797 [self sendEventWithName:kEvent_Scan_Device body:deviceInfo];
798 }
799 }
800 } else if ([deviceType isEqualToString:kType_BG1]){
801
802 [[BG1Controller shareBG1Controller] initBGAudioModule];
803 } else if ([deviceType isEqualToString:kType_BG5]){
804
805 NSArray*bg5array = [[BG5Controller shareIHBg5Controller] getAllCurrentBG5Instace];
806 if (bg5array.count) {
807 for (int i=0; i<bg5array.count; i++) {
808 BG5*mybg5=[bg5array objectAtIndex:i];
809 NSDictionary* deviceInfo = [[NSDictionary alloc]init];
810 deviceInfo = @{@"mac":mybg5.serialNumber,@"type":kType_BG5};
811 [self sendEventWithName:kEvent_Scan_Device body:deviceInfo];
812 }
813 }
814 } else if ([deviceType isEqualToString:kType_ECG3USB]){
815
816 ECG3USB*myecg3 = [[ECG3USBController shareECG3USBController] getCurrentECG3USBInstace];
817 if (myecg3!=nil) {
818 NSDictionary* deviceInfo = [[NSDictionary alloc]init];
819 deviceInfo = @{@"mac":myecg3.serialNumber,@"type":kType_ECG3USB};
820 [self sendEventWithName:kEvent_Scan_Device body:deviceInfo];
821 }
822 } else if ([deviceType isEqualToString:kType_AM3S]){
823
824 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_AM3S];
825 } else if ([deviceType isEqualToString:kType_AM4]){
826
827 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_AM4];
828
829 } else if ([deviceType isEqualToString:kType_AM5]){
830
831 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_AM5];
832
833 } else if ([deviceType isEqualToString:kType_BP3L]){
834
835 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_BP3L];
836 } else if ([deviceType isEqualToString:kType_BP5S]){
837
838 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_BP5S];
839 } else if ([deviceType isEqualToString:kType_BP7S]){
840
841 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_BP7S];
842 } else if ([deviceType isEqualToString:kType_KN550]){
843
844 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_KN550BT];
845 } else if ([deviceType isEqualToString:kType_HS4] ||[deviceType isEqualToString:kType_HS4S]){
846
847 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_HS4];
848 } else if ([deviceType isEqualToString:kType_HS2]){
849
850 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_HS2];
851 }else if ([deviceType isEqualToString:kType_PO3]){
852
853 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_PO3];
854
855 } else if ([deviceType isEqualToString:kType_BTM]){
856
857 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_THV3];
858
859 }else if ([deviceType isEqualToString:kType_ECG3]){
860
861 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_ECG3];
862
863 }else if ([deviceType isEqualToString:kType_BG5S]){
864
865 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_BG5S];
866
867 }
868 else if ([deviceType isEqualToString:kType_NT13B]){
869
870 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_NT13B];
871
872 }else if ([deviceType isEqualToString:kType_BG1S]){
873
874 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_BG1S];
875
876 }else if ([deviceType isEqualToString:kType_HS2S]){
877
878 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_HS2S];
879
880 }
881
882 else if ([deviceType isEqualToString:kType_TS28B]){
883
884 self.ts28bController = [TS28BController sharedController];
885 self.ts28bController.delegate = self;
886 [self.ts28bController startScan];
887
888 }else if ([deviceType isEqualToString:kType_PO1]){
889
890 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_PO1];
891
892 }else if ([deviceType isEqualToString:kType_PT3SBT]){
893
894 [[ScanDeviceController commandGetInstance] commandScanDeviceType:HealthDeviceType_PT3SBT];
895
896 } else {
897 NSLog(@"iHealthScanner: unknown device type '%@', ignoring", deviceType);
898 }
899}
900
901
902#pragma mark - TS28B delegate
903
904- (void)controller:(TS28BController *)controller didDiscoverDevice:(TS28B *)device{
905 NSLog(@"搜索到设备的代理");
906
907 [self.ts28bController connectDevice:device];
908
909 [self sendEventWithName:kEvent_Scan_Device body:@{@"mac":device.serialNumber,@"type":@"TS28B"}];
910
911
912
913}
914- (void)controller:(TS28BController *)controller didConnectSuccessDevice:(TS28B *)device{
915 NSLog(@"连接成功的代理");
916// self.connectedDevice = device;
917// NSLog(@"%@",[NSString stringWithFormat:@"连接成功:%@ \nSerial Number:%@\nModel Number%@\nFirmware:%@\nHardware:%@\nSoftware:%@\nManufacture:%@\nSystemID:%@",device.peripheral.name,device.serialNumber,device.modelNumber,device.firmwareVersion,device.hardwareVersion,device.softwareVersion,device.manufacturerName,device.systemID]);
918
919 self.ts28b=device;
920
921 [self sendEventWithName:kEvent_Device_Connected body:@{@"mac":device.serialNumber,@"type":@"TS28B"}];
922}
923- (void)controller:(TS28BController *)controller didConnectFailDevice:(TS28B *)device{
924 NSLog(@"连接失败的代理");
925// self.recordTextView.text = @"连接失败";
926 [self sendEventWithName:kEvent_Device_Connect_Failed body:@{@"mac":device.peripheral.identifier,@"type":@"TS28B"}];
927}
928- (void)controller:(TS28BController *)controller didDisconnectDevice:(TS28B *)device{
929 NSLog(@"断开连接的代理");
930// self.recordTextView.text = @"连接断开";
931
932
933 [self sendEventWithName:kEvent_Device_Disconnect body:@{@"mac":device.serialNumber,@"type":@"TS28B"}];
934}
935- (void)controller:(TS28BController *)controller device:(TS28B *)device didUpdateTemperature:(float)value temperatureUnit:(TemperatureUnit)unit measureDate:(NSDate *)date measureLocation:(TemperatureType)type{
936
937// self.valueLabel.text = [NSString stringWithFormat:@"%.1f %@",value,(unit == TemperatureUnit_C)?@"C":@"F"];
938}
939
940
941
942RCT_EXPORT_METHOD(stopDiscovery){
943
944 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_AM3S];
945
946 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_AM4];
947
948 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_AM5];
949
950 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_BP3L];
951
952 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_BP5S];
953
954 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_BP7S];
955
956 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_KN550BT];
957
958 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_PO3];
959
960 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_HS4];
961
962 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_HS2];
963
964 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_ECG3];
965
966 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_ECG3];
967
968 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_THV3];
969
970 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_BG5S];
971
972 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_NT13B];
973
974 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_BG1S];
975
976
977 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_HS2S];
978
979 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_PO1];
980
981 [[ScanDeviceController commandGetInstance] commandStopScanDeviceType:HealthDeviceType_PT3SBT];
982
983 [self sendEventWithName:kEvent_Scan_Finish body:nil];
984}
985
986RCT_EXPORT_METHOD(connectDevice:(nonnull NSString *)mac type:(nonnull NSString *)deviceType){
987 if ([deviceType isEqualToString:kType_BP5]){
988
989 NSArray*bp5array = [[BP5Controller shareBP5Controller] getAllCurrentBP5Instace];
990 if (bp5array.count) {
991 for (int i=0; i<bp5array.count; i++) {
992 BP5*mybp5=[bp5array objectAtIndex:i];
993 NSDictionary* deviceInfo = @{@"mac":mybp5.serialNumber,@"type":kType_BP5};
994 [self sendEventWithName:kEvent_Device_Connected body:deviceInfo];
995 }
996 }
997
998 }else if ([deviceType isEqualToString:kType_BP7]){
999
1000 NSArray*bp7array = [[BP7Controller shareBP7Controller] getAllCurrentBP7Instace];
1001 if (bp7array.count) {
1002 for (int i=0; i<bp7array.count; i++) {
1003 BP7*mybp7=[bp7array objectAtIndex:i];
1004 NSDictionary* deviceInfo = @{@"mac":mybp7.serialNumber,@"type":kType_BP7};
1005 [self sendEventWithName:kEvent_Device_Connected body:deviceInfo];
1006 }
1007 }
1008
1009
1010 } else if ([deviceType isEqualToString:kType_BG1]){
1011
1012 BG1*myBG1=[[BG1Controller shareBG1Controller] getCurrentBG1Instance];
1013
1014 [myBG1 commandBG1DeviceModel:@0 withDiscoverBlock:^{
1015
1016 } withDiscoverBlock:^(NSDictionary *idpsDic) {
1017
1018 bg1IdpsDic = [NSDictionary dictionaryWithDictionary:idpsDic];
1019
1020 NSString *bg1Mac = @"";
1021 if (bg1IdpsDic[@"SerialNumber"] != nil) {
1022 bg1Mac = bg1IdpsDic[@"SerialNumber"];
1023 }
1024 NSDictionary*idpsDics=[[NSDictionary alloc] initWithObjectsAndKeys:[bg1IdpsDic valueForKey:@"FW"],@"FirmWare",[bg1IdpsDic valueForKey:@"HD"],@"HardWare",[bg1IdpsDic valueForKey:@"SerialNumber"],@"DeviceId",nil];
1025 NSDictionary* deviceInfo = @{@"mac":bg1Mac,@"type":@"BG1",@"description":@"Success.",@"connect_result_for_bg1":@0,@"idps":idpsDics};
1026 [self sendEventWithName:@"action_connect_result_for_bg1" body:deviceInfo];
1027
1028 } withConnectBlock:^{
1029
1030 NSString *bg1Mac = @"";
1031 if (bg1IdpsDic[@"SerialNumber"] != nil) {
1032 bg1Mac = bg1IdpsDic[@"SerialNumber"];
1033 }
1034 NSDictionary* deviceInfo = @{@"mac":bg1Mac,@"type":@"BG1"};
1035 [self sendEventWithName:kEvent_Device_Connected body:deviceInfo];
1036
1037 } withErrorBlock:^(BG1Error errorID) {
1038
1039 NSString *bg1Mac = @"";
1040 if (bg1IdpsDic[@"SerialNumber"] != nil) {
1041 bg1Mac = bg1IdpsDic[@"SerialNumber"];
1042 }
1043 NSString *descriptionStr = @"";
1044
1045 switch (errorID) {
1046 case BG1Error_LowBattery:
1047 descriptionStr=@"Battery is low.";
1048 break;
1049 case BG1Error_ResultOutOfMeasurementRage:
1050 descriptionStr=@"Glucose test result is out of the measurement range.";
1051 break;
1052 case BG1Error_UnvalidReferenceVoltage:
1053 descriptionStr=@"2.5V reference voltage error, not normal measurement, please repeat the test.";
1054 break;
1055 case BG1Error_StripUsed:
1056 descriptionStr=@"Strip is used or unknown moisture detected, discard the test strip and repeat the test with a new strip.";
1057 break;
1058 case BG1Error_CodeError:
1059 descriptionStr=@"CODE value check error. This error need let user scan code and call the send code function again,no alert need to show.";
1060 break;
1061 case BG1Error_RoomTemperatureOutOfRange1:
1062 case BG1Error_RoomTemperatureOutOfRange2:
1063 descriptionStr=@"The environmental temperature is beyond normal range, place the meter at room temperature for at least 30 minutes, then repeat the test.";
1064 break;
1065 case BG1Error_ResultLow:
1066 descriptionStr=@"Glucose test result is low.";
1067 break;
1068 case BG1Error_ResultHigh:
1069 descriptionStr=@"Glucose test result is high.";
1070 break;
1071 case BG1Error_DisConnented:
1072 descriptionStr=@"BG disConnented.";
1073 break;
1074 case BG1Error_SleepingMode:
1075 descriptionStr=@"BG sleeping mode.";
1076 break;
1077 case BG1Error_ParameterError:
1078 descriptionStr=@"Parameter input error.";
1079 break;
1080 default:
1081 descriptionStr=@"BG unknown.";
1082 break;
1083 }
1084
1085 NSDictionary* deviceInfo = @{@"mac":bg1Mac,@"action":@"action_measure_error_for_bg1",@"action_measure_error_for_bg1":[NSNumber numberWithInt:errorID],@"description":descriptionStr};
1086 [self sendEventWithName:@"event_notify_bg1" body:deviceInfo];
1087
1088 }];
1089
1090 } else if ([deviceType isEqualToString:kType_BG5]){
1091
1092 NSArray*bg5array = [[BG5Controller shareIHBg5Controller] getAllCurrentBG5Instace];
1093 if (bg5array.count) {
1094 for (int i=0; i<bg5array.count; i++) {
1095 BG5*mybg5=[bg5array objectAtIndex:i];
1096 NSDictionary* deviceInfo = [[NSDictionary alloc]init];
1097 deviceInfo = @{@"mac":mybg5.serialNumber,@"type":kType_BG5};
1098 [self sendEventWithName:kEvent_Device_Connected body:deviceInfo];
1099 }
1100
1101
1102 }
1103 } else if ([deviceType isEqualToString:kType_AM3S]){
1104
1105 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_AM3S andSerialNub:mac];
1106 }else if ([deviceType isEqualToString:kType_AM4]){
1107
1108 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_AM4 andSerialNub:mac];
1109
1110 }else if ([deviceType isEqualToString:kType_AM5]){
1111
1112 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_AM5 andSerialNub:mac];
1113
1114 }else if ([deviceType isEqualToString:kType_BP3L]){
1115
1116 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_BP3L andSerialNub:mac];
1117 }else if ([deviceType isEqualToString:kType_BP5S]){
1118
1119 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_BP5S andSerialNub:mac];
1120 }else if ([deviceType isEqualToString:kType_BP7S]){
1121
1122 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_BP7S andSerialNub:mac];
1123 }else if ([deviceType isEqualToString:kType_KN550]){
1124
1125 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_KN550BT andSerialNub:mac];
1126 }else if ([deviceType isEqualToString:kType_HS4]||[deviceType isEqualToString:kType_HS4S]){
1127
1128 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_HS4 andSerialNub:mac];
1129 }else if ([deviceType isEqualToString:kType_HS2]){
1130
1131 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_HS2 andSerialNub:mac];
1132 }else if ([deviceType isEqualToString:kType_PO3]){
1133
1134 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_PO3 andSerialNub:mac];
1135
1136 }else if ([deviceType isEqualToString:kType_BTM]){
1137
1138 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_THV3 andSerialNub:mac];
1139
1140 }else if ([deviceType isEqualToString:kType_ECG3]){
1141
1142 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_ECG3 andSerialNub:mac];
1143
1144 }else if ([deviceType isEqualToString:kType_ECG3USB]) {
1145
1146 ECG3USB*myecg3 = [[ECG3USBController shareECG3USBController] getCurrentECG3USBInstace];
1147 if (myecg3!=nil) {
1148
1149 NSDictionary* deviceInfo = @{@"mac":myecg3.serialNumber,@"type":kType_ECG3USB};
1150 [self sendEventWithName:kEvent_Device_Connected body:deviceInfo];
1151 }
1152 }else if ([deviceType isEqualToString:kType_BG5S]){
1153
1154 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_BG5S andSerialNub:mac];
1155
1156 }else if ([deviceType isEqualToString:kType_NT13B]){
1157
1158 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_NT13B andSerialNub:mac];
1159
1160 }else if ([deviceType isEqualToString:kType_TS28B]){
1161
1162 [self sendEventWithName:kEvent_Device_Connected body:@{@"mac":self.ts28b.serialNumber,@"type":@"TS28B"}];
1163
1164 }else if ([deviceType isEqualToString:kType_BG1S]){
1165
1166 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_BG1S andSerialNub:mac];
1167
1168 }else if ([deviceType isEqualToString:kType_HS2S]){
1169
1170 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_HS2S andSerialNub:mac];
1171 }else if ([deviceType isEqualToString:kType_PO1]){
1172
1173 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_PO1 andSerialNub:mac];
1174
1175 }else if ([deviceType isEqualToString:kType_PT3SBT]){
1176
1177 [[ConnectDeviceController commandGetInstance] commandContectDeviceWithDeviceType:HealthDeviceType_PO1 andSerialNub:mac];
1178
1179 }
1180
1181}
1182
1183
1184RCT_EXPORT_METHOD(getDevicesIDPS:(nonnull NSString *)mac callback:(RCTResponseSenderBlock)callback){
1185
1186
1187// {
1188// BTFirmwareVersion = "1.0.4";
1189// DeviceName = HS4S;
1190// FirmwareVersion = "1.0.2";
1191// HardwareVersion = "5.0.1";
1192// ID = "97FB0E73-7CE7-4B27-A7CE-EB76E9770002";
1193// Manufacture = iHealth;
1194// ModelNumber = "HS4S 11070";
1195// ProtocolString = "com.jiuan.BWSV01";
1196// SerialNumber = 8CDE529FD9DA;
1197// Type = 2;
1198// }
1199//
1200 // {"protocolstring":"com.jiuan.AMV12","accessoryname":"AM4","firmwareversion":"138","hardwareversion":"100","manufacture":"iHealth","serialnumber":"004D32079148","modenumber":"AM4 11070"}
1201
1202 NSArray*deviceArray=[[ManageDeviceController commandGetInstance] commandGetAllConnectDeviceArray];
1203
1204 if(deviceArray.count){
1205
1206 for (int i=0; i<deviceArray.count; i++) {
1207
1208 if ([mac isEqualToString:[[deviceArray objectAtIndex:i] valueForKey:@"SerialNumber"]]) {
1209
1210 NSDictionary*deviceDic=[deviceArray objectAtIndex:i];
1211
1212 NSMutableDictionary*dic=[[NSMutableDictionary alloc] init];
1213
1214 [dic setObject:[deviceDic objectForKey:@"ProtocolString"] forKey:@"protocolstring"];
1215
1216 [dic setObject:[deviceDic objectForKey:@"DeviceName"] forKey:@"accessoryname"];
1217
1218 if ([[deviceDic objectForKey:@"DeviceName"] isEqualToString:@"AM5"]) {
1219 [dic setObject:@"1.0.0" forKey:@"firmwareversion"];
1220
1221 [dic setObject:@"1.0.0" forKey:@"hardwareversion"];
1222
1223 [dic setObject:@"AM5" forKey:@"modenumber"];
1224 }else{
1225
1226 [dic setObject:[deviceDic objectForKey:@"FirmwareVersion"] forKey:@"firmwareversion"];
1227
1228 [dic setObject:[deviceDic objectForKey:@"HardwareVersion"] forKey:@"hardwareversion"];
1229
1230 [dic setObject:[deviceDic objectForKey:@"ModelNumber"] forKey:@"modenumber"];
1231 }
1232
1233
1234
1235
1236
1237 if(![[deviceDic objectForKey:@"DeviceName"] isEqualToString:@"BP5"] && ![[deviceDic objectForKey:@"DeviceName"] isEqualToString:@"BP7"]&& ![[deviceDic objectForKey:@"DeviceName"] isEqualToString:@"AM5"]){
1238
1239 [dic setObject:[deviceDic objectForKey:@"Manufacture"] forKey:@"manufacture"];
1240 }
1241
1242
1243 [dic setObject:[deviceDic objectForKey:@"SerialNumber"] forKey:@"serialNumber"];
1244
1245
1246
1247
1248 callback(@[dic]);
1249
1250 }
1251
1252 }
1253
1254 }else{
1255
1256
1257
1258 }
1259
1260
1261
1262}
1263
1264RCT_EXPORT_METHOD(authenConfigureInfo:(NSString *)userID clientID:(NSString *)clientID clientSecret:(NSString *)clientSecret){
1265
1266 HealthUser *currentUser = [[HealthUser alloc]init];
1267 currentUser.userAccount = userID;
1268 currentUser.clientID = clientID;
1269 currentUser.clientSecret = clientSecret;
1270
1271 [[IHSDKCloudUser commandGetSDKUserInstance]commandSDKUserValidation:currentUser UserDeviceAccess:^(NSArray *DeviceAccessArray) {
1272
1273 } UserValidationSuccess:^(UserAuthenResult result) {
1274 [self authenResult:result userID:userID clientID:clientID clientSecret:clientSecret];
1275
1276 } UserValidationReturn:^(NSString *userID) {
1277
1278 } DisposeErrorBlock:^(UserAuthenResult errorID) {
1279 if (errorID == UserAuthen_UserInvalidateRight) {
1280 [self authenResult:UserAuthen_LoginSuccess userID:userID clientID:clientID clientSecret:clientSecret];
1281 }else{
1282 [self authenResult:errorID userID:userID clientID:clientID clientSecret:clientSecret];
1283 }
1284
1285 }];
1286
1287}
1288
1289- (void)authenResult:(UserAuthenResult)result userID:(NSString*)userID clientID:(NSString*)clientID clientSecret:(NSString*)clientSecret{
1290 if (result <= UserAuthen_TrySuccess) {
1291 NSArray* userInfo = @[userID,clientID,clientSecret];
1292 [[NSUserDefaults standardUserDefaults] setObject:userInfo forKey:FetchUserInfo];
1293 }else{
1294 [[NSUserDefaults standardUserDefaults] removeObjectForKey:FetchUserInfo];
1295 }
1296 [self sendEventWithName:kEvent_Authenticate_Result body:@{@"authen":@(result)}];
1297}
1298
1299RCT_EXPORT_METHOD(authenAppSecret:(NSString *)appSecret){
1300
1301
1302 [[IHSDKCloudUser commandGetSDKUserInstance] commandSDKUserValidationWithAppSecret:appSecret UserValidationSuccess:^(UserAuthenResult result) {
1303
1304 [self sendEventWithName:kEvent_Authenticate_Result body:@{@"authen":@(result)}];
1305
1306 } DisposeErrorBlock:^(UserAuthenResult errorID) {
1307
1308 }];
1309
1310}
1311
1312RCT_EXPORT_METHOD(disconnectDevice:(NSString*)mac type:(NSString*)type){
1313 NSLog(@"API disconnectDevice is not avaliable in iOS platform, please the specific device's disconnect API.");
1314}
1315
1316+ (NSArray*)userInfos{
1317 NSArray* userInfos = [[NSUserDefaults standardUserDefaults] objectForKey:FetchUserInfo];
1318 if (userInfos.count == 3) {
1319 return userInfos;
1320 }else{
1321 return nil;
1322 }
1323}
1324
1325+ (NSString*)autherizedUserID{
1326 return [[self userInfos] objectAtIndex:0];
1327}
1328
1329+ (NSString*)autherizedClientID{
1330 return [[self userInfos] objectAtIndex:1];
1331}
1332
1333+ (NSString*)autherizedClientSecret{
1334 return [[self userInfos] objectAtIndex:2];
1335}
1336
1337
1338@end