capacitor-plugin-ihealth 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapacitorPluginIhealth.podspec +35 -0
- package/README.md +214 -0
- package/android/build.gradle +58 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/managemyhealth/plugins/ihealth/ihealth.java +11 -0
- package/android/src/main/java/com/managemyhealth/plugins/ihealth/ihealthPlugin.java +22 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +450 -0
- package/dist/esm/definitions.d.ts +29 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +37 -0
- package/dist/esm/web.js +42 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +58 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +61 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/Info.plist +24 -0
- package/ios/Plugin/Plugin-Bridging-Header.h +35 -0
- package/ios/Plugin/iHealthSDKHeaders/ABI.h +82 -0
- package/ios/Plugin/iHealthSDKHeaders/ABIController.h +28 -0
- package/ios/Plugin/iHealthSDKHeaders/ABPM.h +144 -0
- package/ios/Plugin/iHealthSDKHeaders/ABPMController.h +25 -0
- package/ios/Plugin/iHealthSDKHeaders/AM3.h +188 -0
- package/ios/Plugin/iHealthSDKHeaders/AM3Controller.h +29 -0
- package/ios/Plugin/iHealthSDKHeaders/AM3SController_V2.h +29 -0
- package/ios/Plugin/iHealthSDKHeaders/AM3S_V2.h +227 -0
- package/ios/Plugin/iHealthSDKHeaders/AM4.h +223 -0
- package/ios/Plugin/iHealthSDKHeaders/AM4Controller.h +31 -0
- package/ios/Plugin/iHealthSDKHeaders/AM5.h +335 -0
- package/ios/Plugin/iHealthSDKHeaders/AM5Controller.h +30 -0
- package/ios/Plugin/iHealthSDKHeaders/AM5Header.h +20 -0
- package/ios/Plugin/iHealthSDKHeaders/AMHeader.h +27 -0
- package/ios/Plugin/iHealthSDKHeaders/AMMacroFile.h +1171 -0
- package/ios/Plugin/iHealthSDKHeaders/BG1.h +53 -0
- package/ios/Plugin/iHealthSDKHeaders/BG1Controller.h +46 -0
- package/ios/Plugin/iHealthSDKHeaders/BG1S.h +64 -0
- package/ios/Plugin/iHealthSDKHeaders/BG1SController.h +25 -0
- package/ios/Plugin/iHealthSDKHeaders/BG3.h +83 -0
- package/ios/Plugin/iHealthSDKHeaders/BG3Controller.h +28 -0
- package/ios/Plugin/iHealthSDKHeaders/BG5.h +158 -0
- package/ios/Plugin/iHealthSDKHeaders/BG5Controller.h +28 -0
- package/ios/Plugin/iHealthSDKHeaders/BG5S.h +294 -0
- package/ios/Plugin/iHealthSDKHeaders/BG5SController.h +29 -0
- package/ios/Plugin/iHealthSDKHeaders/BGController.h +32 -0
- package/ios/Plugin/iHealthSDKHeaders/BGDevice.h +42 -0
- package/ios/Plugin/iHealthSDKHeaders/BGHeader.h +23 -0
- package/ios/Plugin/iHealthSDKHeaders/BGMacroFile.h +507 -0
- package/ios/Plugin/iHealthSDKHeaders/BP3.h +77 -0
- package/ios/Plugin/iHealthSDKHeaders/BP3Controller.h +27 -0
- package/ios/Plugin/iHealthSDKHeaders/BP3L.h +58 -0
- package/ios/Plugin/iHealthSDKHeaders/BP3LController.h +30 -0
- package/ios/Plugin/iHealthSDKHeaders/BP5.h +32 -0
- package/ios/Plugin/iHealthSDKHeaders/BP5C.h +131 -0
- package/ios/Plugin/iHealthSDKHeaders/BP5CController.h +25 -0
- package/ios/Plugin/iHealthSDKHeaders/BP5Controller.h +25 -0
- package/ios/Plugin/iHealthSDKHeaders/BP5S.h +97 -0
- package/ios/Plugin/iHealthSDKHeaders/BP5SController.h +27 -0
- package/ios/Plugin/iHealthSDKHeaders/BP5SRW.h +101 -0
- package/ios/Plugin/iHealthSDKHeaders/BP5SRWController.h +26 -0
- package/ios/Plugin/iHealthSDKHeaders/BP7.h +141 -0
- package/ios/Plugin/iHealthSDKHeaders/BP7Controller.h +25 -0
- package/ios/Plugin/iHealthSDKHeaders/BP7S.h +106 -0
- package/ios/Plugin/iHealthSDKHeaders/BP7SController.h +32 -0
- package/ios/Plugin/iHealthSDKHeaders/BPAV10Device.h +15 -0
- package/ios/Plugin/iHealthSDKHeaders/BPBTLEDevice.h +17 -0
- package/ios/Plugin/iHealthSDKHeaders/BPBV10Device.h +20 -0
- package/ios/Plugin/iHealthSDKHeaders/BPContinua.h +56 -0
- package/ios/Plugin/iHealthSDKHeaders/BPContinuaController.h +30 -0
- package/ios/Plugin/iHealthSDKHeaders/BPController.h +40 -0
- package/ios/Plugin/iHealthSDKHeaders/BPDevice.h +131 -0
- package/ios/Plugin/iHealthSDKHeaders/BPHeader.h +54 -0
- package/ios/Plugin/iHealthSDKHeaders/BPLoopMeasureSettingModel.h +120 -0
- package/ios/Plugin/iHealthSDKHeaders/BPM1AE.h +80 -0
- package/ios/Plugin/iHealthSDKHeaders/BPMacroFile.h +247 -0
- package/ios/Plugin/iHealthSDKHeaders/BPV24Device.h +16 -0
- package/ios/Plugin/iHealthSDKHeaders/BPV25Device.h +17 -0
- package/ios/Plugin/iHealthSDKHeaders/ConnectDeviceController.h +27 -0
- package/ios/Plugin/iHealthSDKHeaders/DFUController.h +160 -0
- package/ios/Plugin/iHealthSDKHeaders/DFUDeviceFirmwareInfo.h +56 -0
- package/ios/Plugin/iHealthSDKHeaders/DFUHeader.h +19 -0
- package/ios/Plugin/iHealthSDKHeaders/DFUMacro.h +264 -0
- package/ios/Plugin/iHealthSDKHeaders/DFUServerFirmwareInfo.h +48 -0
- package/ios/Plugin/iHealthSDKHeaders/ECG3.h +94 -0
- package/ios/Plugin/iHealthSDKHeaders/ECG3Controller.h +30 -0
- package/ios/Plugin/iHealthSDKHeaders/ECG3USB.h +145 -0
- package/ios/Plugin/iHealthSDKHeaders/ECG3USBController.h +31 -0
- package/ios/Plugin/iHealthSDKHeaders/ECGHeader.h +20 -0
- package/ios/Plugin/iHealthSDKHeaders/ECGMacroFile.h +84 -0
- package/ios/Plugin/iHealthSDKHeaders/HFSmartLink.h +88 -0
- package/ios/Plugin/iHealthSDKHeaders/HFSmartLinkDeviceInfo.h +14 -0
- package/ios/Plugin/iHealthSDKHeaders/HS2.h +64 -0
- package/ios/Plugin/iHealthSDKHeaders/HS2Controller.h +25 -0
- package/ios/Plugin/iHealthSDKHeaders/HS2S.h +399 -0
- package/ios/Plugin/iHealthSDKHeaders/HS2SController.h +27 -0
- package/ios/Plugin/iHealthSDKHeaders/HS3.h +63 -0
- package/ios/Plugin/iHealthSDKHeaders/HS3Controller.h +32 -0
- package/ios/Plugin/iHealthSDKHeaders/HS4.h +64 -0
- package/ios/Plugin/iHealthSDKHeaders/HS4Controller.h +26 -0
- package/ios/Plugin/iHealthSDKHeaders/HS5.h +141 -0
- package/ios/Plugin/iHealthSDKHeaders/HS5Controller.h +38 -0
- package/ios/Plugin/iHealthSDKHeaders/HSHeader.h +25 -0
- package/ios/Plugin/iHealthSDKHeaders/HSMacroFile.h +709 -0
- package/ios/Plugin/iHealthSDKHeaders/HealthHeader.h +67 -0
- package/ios/Plugin/iHealthSDKHeaders/HealthUser.h +126 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOBindEnum.h +49 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOBlueDataResponse.h +66 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOBlueEnum.h +213 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOBluetoothBaseModel.h +112 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOBluetoothEngine.h +283 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOBluetoothManager.h +166 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOBluetoothServices.h +75 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOCalculateBluetoothModel.h +263 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOCommonMacro.h +89 -0
- package/ios/Plugin/iHealthSDKHeaders/IDODataExchangeModel.h +128 -0
- package/ios/Plugin/iHealthSDKHeaders/IDODataMigrationManager.h +79 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOErrorCodeToStr.h +19 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOFoundationCommand.h +1178 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOGetInfoBluetoothModel.h +1924 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOLogEnum.h +165 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOPeripheralModel.h +59 -0
- package/ios/Plugin/iHealthSDKHeaders/IDORecordDeviceLog.h +56 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOSetInfoBluetoothModel.h +1760 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOSyncActivityDataModel.h +207 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOSyncBpDataModel.h +191 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOSyncEnum.h +316 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOSyncGpsDataModel.h +133 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOSyncHeartRateDataModel.h +442 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOSyncManager.h +161 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOSyncPressureDataModel.h +158 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOSyncSleepDataModel.h +224 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOSyncSpo2DataModel.h +175 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOSyncSportDataModel.h +221 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOSyncSwimDataModel.h +188 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOTranEnum.h +93 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOTransferFileManager.h +116 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOWatchDialInfoModel.h +95 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOWatchDialManager.h +75 -0
- package/ios/Plugin/iHealthSDKHeaders/IDOWeightBluetoothModel.h +124 -0
- package/ios/Plugin/iHealthSDKHeaders/IHSDKCloudUser.h +104 -0
- package/ios/Plugin/iHealthSDKHeaders/KN550BT.h +115 -0
- package/ios/Plugin/iHealthSDKHeaders/KN550BTController.h +32 -0
- package/ios/Plugin/iHealthSDKHeaders/ManageDeviceController.h +34 -0
- package/ios/Plugin/iHealthSDKHeaders/NT13B.h +33 -0
- package/ios/Plugin/iHealthSDKHeaders/NT13BController.h +28 -0
- package/ios/Plugin/iHealthSDKHeaders/NT13BHeader.h +16 -0
- package/ios/Plugin/iHealthSDKHeaders/NT13BMacroFile.h +34 -0
- package/ios/Plugin/iHealthSDKHeaders/PO1.h +82 -0
- package/ios/Plugin/iHealthSDKHeaders/PO1Controller.h +29 -0
- package/ios/Plugin/iHealthSDKHeaders/PO3.h +96 -0
- package/ios/Plugin/iHealthSDKHeaders/PO3Controller.h +29 -0
- package/ios/Plugin/iHealthSDKHeaders/POHeader.h +20 -0
- package/ios/Plugin/iHealthSDKHeaders/POMacroFile.h +142 -0
- package/ios/Plugin/iHealthSDKHeaders/PT3SBT.h +167 -0
- package/ios/Plugin/iHealthSDKHeaders/PT3SBTController.h +27 -0
- package/ios/Plugin/iHealthSDKHeaders/PT3SBTMacroFile.h +92 -0
- package/ios/Plugin/iHealthSDKHeaders/SDKFlowUpdateDevice.h +196 -0
- package/ios/Plugin/iHealthSDKHeaders/SDKInfo.h +30 -0
- package/ios/Plugin/iHealthSDKHeaders/SDKUpdateDevice.h +235 -0
- package/ios/Plugin/iHealthSDKHeaders/ScanDeviceController.h +47 -0
- package/ios/Plugin/iHealthSDKHeaders/THV3.h +104 -0
- package/ios/Plugin/iHealthSDKHeaders/THV3Controller.h +30 -0
- package/ios/Plugin/iHealthSDKHeaders/THV3Macro.h +17 -0
- package/ios/Plugin/iHealthSDKHeaders/TS28B.h +26 -0
- package/ios/Plugin/iHealthSDKHeaders/TS28BController.h +142 -0
- package/ios/Plugin/iHealthSDKHeaders/TS28BHeader.h +15 -0
- package/ios/Plugin/iHealthSDKHeaders/iHealthHS6.h +174 -0
- package/ios/Plugin/ihealth.swift +8 -0
- package/ios/Plugin/ihealthPlugin.h +10 -0
- package/ios/Plugin/ihealthPlugin.m +16 -0
- package/ios/Plugin/ihealthPlugin.swift +1502 -0
- package/ios/Plugin/libiHealthSDK2.7.8.a +0 -0
- package/ios/Plugin/test.m +9 -0
- package/package.json +78 -0
@@ -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
|
+
*/
|
14
|
+
typedef NS_ENUM(NSUInteger, THV3RcvDataType) {
|
15
|
+
/// recieve real time temperature
|
16
|
+
THV3RcvDataRT,
|
17
|
+
/// recieve button event
|
18
|
+
THV3RcvDataButtonStatus,
|
19
|
+
};
|
20
|
+
|
21
|
+
/**
|
22
|
+
THV3RcvButtonType
|
23
|
+
*/
|
24
|
+
typedef 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
|
+
*/
|
41
|
+
typedef 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
|
+
*/
|
63
|
+
typedef void(^ReceiveHistoryBlock)(NSArray<THV3HistoryData*>* dataArray);
|
64
|
+
|
65
|
+
/**
|
66
|
+
ConfigResultBlock
|
67
|
+
|
68
|
+
@param success YES:success NO:fail
|
69
|
+
*/
|
70
|
+
typedef 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
|
@@ -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
|
@@ -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 */
|
@@ -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
|
@@ -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
|
+
*/
|
14
|
+
typedef 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
|
+
*/
|
40
|
+
typedef 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
|
@@ -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 */
|
@@ -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
|
+
|
60
|
+
Import parameter:
|
61
|
+
@param tempUser Properties included:clientID,clientSecret,userAccount.
|
62
|
+
|
63
|
+
@param tempDeviceID device Mac
|
64
|
+
Return 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
|
92
|
+
Import parameter:
|
93
|
+
@param password wifi password.
|
94
|
+
|
95
|
+
Return 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
|
147
|
+
Import parameter:
|
148
|
+
@param tempUser Properties included:clientID,clientSecret,userAccount.
|
149
|
+
@param unit IHHS6SDKUnitWeight_kg,IHHS6SDKUnitWeight_lb,IHHS6SDKUnitWeight_oz
|
150
|
+
Return 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
|
@@ -0,0 +1,10 @@
|
|
1
|
+
#import <UIKit/UIKit.h>
|
2
|
+
|
3
|
+
//! Project version number for Plugin.
|
4
|
+
FOUNDATION_EXPORT double PluginVersionNumber;
|
5
|
+
|
6
|
+
//! Project version string for Plugin.
|
7
|
+
FOUNDATION_EXPORT const unsigned char PluginVersionString[];
|
8
|
+
|
9
|
+
// In this header, you should import all the public headers of your framework using statements like #import <Plugin/PublicHeader.h>
|
10
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
#import <Capacitor/Capacitor.h>
|
3
|
+
|
4
|
+
// Define the plugin using the CAP_PLUGIN Macro, and
|
5
|
+
// each method the plugin supports using the CAP_PLUGIN_METHOD macro.
|
6
|
+
CAP_PLUGIN(ihealthPlugin, "ihealth",
|
7
|
+
CAP_PLUGIN_METHOD(authoriseiHealthSdk, CAPPluginReturnPromise);
|
8
|
+
CAP_PLUGIN_METHOD(scanDiscover, CAPPluginReturnPromise);
|
9
|
+
CAP_PLUGIN_METHOD(connectDevice, CAPPluginReturnPromise);
|
10
|
+
CAP_PLUGIN_METHOD(isBluetoothEnabled, CAPPluginReturnPromise);
|
11
|
+
CAP_PLUGIN_METHOD(initialiseCentralManager, CAPPluginReturnPromise);
|
12
|
+
CAP_PLUGIN_METHOD(getConnectedDeviceInstance, CAPPluginReturnPromise);
|
13
|
+
CAP_PLUGIN_METHOD(disconnectDevice, CAPPluginReturnPromise);
|
14
|
+
CAP_PLUGIN_METHOD(deleteDeviceData, CAPPluginReturnPromise);
|
15
|
+
CAP_PLUGIN_METHOD(getDeviceOfflineData, CAPPluginReturnPromise);
|
16
|
+
)
|