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.
Files changed (178) hide show
  1. package/CapacitorPluginIhealth.podspec +35 -0
  2. package/README.md +214 -0
  3. package/android/build.gradle +58 -0
  4. package/android/src/main/AndroidManifest.xml +2 -0
  5. package/android/src/main/java/com/managemyhealth/plugins/ihealth/ihealth.java +11 -0
  6. package/android/src/main/java/com/managemyhealth/plugins/ihealth/ihealthPlugin.java +22 -0
  7. package/android/src/main/res/.gitkeep +0 -0
  8. package/dist/docs.json +450 -0
  9. package/dist/esm/definitions.d.ts +29 -0
  10. package/dist/esm/definitions.js +2 -0
  11. package/dist/esm/definitions.js.map +1 -0
  12. package/dist/esm/index.d.ts +4 -0
  13. package/dist/esm/index.js +7 -0
  14. package/dist/esm/index.js.map +1 -0
  15. package/dist/esm/web.d.ts +37 -0
  16. package/dist/esm/web.js +42 -0
  17. package/dist/esm/web.js.map +1 -0
  18. package/dist/plugin.cjs.js +58 -0
  19. package/dist/plugin.cjs.js.map +1 -0
  20. package/dist/plugin.js +61 -0
  21. package/dist/plugin.js.map +1 -0
  22. package/ios/Plugin/Info.plist +24 -0
  23. package/ios/Plugin/Plugin-Bridging-Header.h +35 -0
  24. package/ios/Plugin/iHealthSDKHeaders/ABI.h +82 -0
  25. package/ios/Plugin/iHealthSDKHeaders/ABIController.h +28 -0
  26. package/ios/Plugin/iHealthSDKHeaders/ABPM.h +144 -0
  27. package/ios/Plugin/iHealthSDKHeaders/ABPMController.h +25 -0
  28. package/ios/Plugin/iHealthSDKHeaders/AM3.h +188 -0
  29. package/ios/Plugin/iHealthSDKHeaders/AM3Controller.h +29 -0
  30. package/ios/Plugin/iHealthSDKHeaders/AM3SController_V2.h +29 -0
  31. package/ios/Plugin/iHealthSDKHeaders/AM3S_V2.h +227 -0
  32. package/ios/Plugin/iHealthSDKHeaders/AM4.h +223 -0
  33. package/ios/Plugin/iHealthSDKHeaders/AM4Controller.h +31 -0
  34. package/ios/Plugin/iHealthSDKHeaders/AM5.h +335 -0
  35. package/ios/Plugin/iHealthSDKHeaders/AM5Controller.h +30 -0
  36. package/ios/Plugin/iHealthSDKHeaders/AM5Header.h +20 -0
  37. package/ios/Plugin/iHealthSDKHeaders/AMHeader.h +27 -0
  38. package/ios/Plugin/iHealthSDKHeaders/AMMacroFile.h +1171 -0
  39. package/ios/Plugin/iHealthSDKHeaders/BG1.h +53 -0
  40. package/ios/Plugin/iHealthSDKHeaders/BG1Controller.h +46 -0
  41. package/ios/Plugin/iHealthSDKHeaders/BG1S.h +64 -0
  42. package/ios/Plugin/iHealthSDKHeaders/BG1SController.h +25 -0
  43. package/ios/Plugin/iHealthSDKHeaders/BG3.h +83 -0
  44. package/ios/Plugin/iHealthSDKHeaders/BG3Controller.h +28 -0
  45. package/ios/Plugin/iHealthSDKHeaders/BG5.h +158 -0
  46. package/ios/Plugin/iHealthSDKHeaders/BG5Controller.h +28 -0
  47. package/ios/Plugin/iHealthSDKHeaders/BG5S.h +294 -0
  48. package/ios/Plugin/iHealthSDKHeaders/BG5SController.h +29 -0
  49. package/ios/Plugin/iHealthSDKHeaders/BGController.h +32 -0
  50. package/ios/Plugin/iHealthSDKHeaders/BGDevice.h +42 -0
  51. package/ios/Plugin/iHealthSDKHeaders/BGHeader.h +23 -0
  52. package/ios/Plugin/iHealthSDKHeaders/BGMacroFile.h +507 -0
  53. package/ios/Plugin/iHealthSDKHeaders/BP3.h +77 -0
  54. package/ios/Plugin/iHealthSDKHeaders/BP3Controller.h +27 -0
  55. package/ios/Plugin/iHealthSDKHeaders/BP3L.h +58 -0
  56. package/ios/Plugin/iHealthSDKHeaders/BP3LController.h +30 -0
  57. package/ios/Plugin/iHealthSDKHeaders/BP5.h +32 -0
  58. package/ios/Plugin/iHealthSDKHeaders/BP5C.h +131 -0
  59. package/ios/Plugin/iHealthSDKHeaders/BP5CController.h +25 -0
  60. package/ios/Plugin/iHealthSDKHeaders/BP5Controller.h +25 -0
  61. package/ios/Plugin/iHealthSDKHeaders/BP5S.h +97 -0
  62. package/ios/Plugin/iHealthSDKHeaders/BP5SController.h +27 -0
  63. package/ios/Plugin/iHealthSDKHeaders/BP5SRW.h +101 -0
  64. package/ios/Plugin/iHealthSDKHeaders/BP5SRWController.h +26 -0
  65. package/ios/Plugin/iHealthSDKHeaders/BP7.h +141 -0
  66. package/ios/Plugin/iHealthSDKHeaders/BP7Controller.h +25 -0
  67. package/ios/Plugin/iHealthSDKHeaders/BP7S.h +106 -0
  68. package/ios/Plugin/iHealthSDKHeaders/BP7SController.h +32 -0
  69. package/ios/Plugin/iHealthSDKHeaders/BPAV10Device.h +15 -0
  70. package/ios/Plugin/iHealthSDKHeaders/BPBTLEDevice.h +17 -0
  71. package/ios/Plugin/iHealthSDKHeaders/BPBV10Device.h +20 -0
  72. package/ios/Plugin/iHealthSDKHeaders/BPContinua.h +56 -0
  73. package/ios/Plugin/iHealthSDKHeaders/BPContinuaController.h +30 -0
  74. package/ios/Plugin/iHealthSDKHeaders/BPController.h +40 -0
  75. package/ios/Plugin/iHealthSDKHeaders/BPDevice.h +131 -0
  76. package/ios/Plugin/iHealthSDKHeaders/BPHeader.h +54 -0
  77. package/ios/Plugin/iHealthSDKHeaders/BPLoopMeasureSettingModel.h +120 -0
  78. package/ios/Plugin/iHealthSDKHeaders/BPM1AE.h +80 -0
  79. package/ios/Plugin/iHealthSDKHeaders/BPMacroFile.h +247 -0
  80. package/ios/Plugin/iHealthSDKHeaders/BPV24Device.h +16 -0
  81. package/ios/Plugin/iHealthSDKHeaders/BPV25Device.h +17 -0
  82. package/ios/Plugin/iHealthSDKHeaders/ConnectDeviceController.h +27 -0
  83. package/ios/Plugin/iHealthSDKHeaders/DFUController.h +160 -0
  84. package/ios/Plugin/iHealthSDKHeaders/DFUDeviceFirmwareInfo.h +56 -0
  85. package/ios/Plugin/iHealthSDKHeaders/DFUHeader.h +19 -0
  86. package/ios/Plugin/iHealthSDKHeaders/DFUMacro.h +264 -0
  87. package/ios/Plugin/iHealthSDKHeaders/DFUServerFirmwareInfo.h +48 -0
  88. package/ios/Plugin/iHealthSDKHeaders/ECG3.h +94 -0
  89. package/ios/Plugin/iHealthSDKHeaders/ECG3Controller.h +30 -0
  90. package/ios/Plugin/iHealthSDKHeaders/ECG3USB.h +145 -0
  91. package/ios/Plugin/iHealthSDKHeaders/ECG3USBController.h +31 -0
  92. package/ios/Plugin/iHealthSDKHeaders/ECGHeader.h +20 -0
  93. package/ios/Plugin/iHealthSDKHeaders/ECGMacroFile.h +84 -0
  94. package/ios/Plugin/iHealthSDKHeaders/HFSmartLink.h +88 -0
  95. package/ios/Plugin/iHealthSDKHeaders/HFSmartLinkDeviceInfo.h +14 -0
  96. package/ios/Plugin/iHealthSDKHeaders/HS2.h +64 -0
  97. package/ios/Plugin/iHealthSDKHeaders/HS2Controller.h +25 -0
  98. package/ios/Plugin/iHealthSDKHeaders/HS2S.h +399 -0
  99. package/ios/Plugin/iHealthSDKHeaders/HS2SController.h +27 -0
  100. package/ios/Plugin/iHealthSDKHeaders/HS3.h +63 -0
  101. package/ios/Plugin/iHealthSDKHeaders/HS3Controller.h +32 -0
  102. package/ios/Plugin/iHealthSDKHeaders/HS4.h +64 -0
  103. package/ios/Plugin/iHealthSDKHeaders/HS4Controller.h +26 -0
  104. package/ios/Plugin/iHealthSDKHeaders/HS5.h +141 -0
  105. package/ios/Plugin/iHealthSDKHeaders/HS5Controller.h +38 -0
  106. package/ios/Plugin/iHealthSDKHeaders/HSHeader.h +25 -0
  107. package/ios/Plugin/iHealthSDKHeaders/HSMacroFile.h +709 -0
  108. package/ios/Plugin/iHealthSDKHeaders/HealthHeader.h +67 -0
  109. package/ios/Plugin/iHealthSDKHeaders/HealthUser.h +126 -0
  110. package/ios/Plugin/iHealthSDKHeaders/IDOBindEnum.h +49 -0
  111. package/ios/Plugin/iHealthSDKHeaders/IDOBlueDataResponse.h +66 -0
  112. package/ios/Plugin/iHealthSDKHeaders/IDOBlueEnum.h +213 -0
  113. package/ios/Plugin/iHealthSDKHeaders/IDOBluetoothBaseModel.h +112 -0
  114. package/ios/Plugin/iHealthSDKHeaders/IDOBluetoothEngine.h +283 -0
  115. package/ios/Plugin/iHealthSDKHeaders/IDOBluetoothManager.h +166 -0
  116. package/ios/Plugin/iHealthSDKHeaders/IDOBluetoothServices.h +75 -0
  117. package/ios/Plugin/iHealthSDKHeaders/IDOCalculateBluetoothModel.h +263 -0
  118. package/ios/Plugin/iHealthSDKHeaders/IDOCommonMacro.h +89 -0
  119. package/ios/Plugin/iHealthSDKHeaders/IDODataExchangeModel.h +128 -0
  120. package/ios/Plugin/iHealthSDKHeaders/IDODataMigrationManager.h +79 -0
  121. package/ios/Plugin/iHealthSDKHeaders/IDOErrorCodeToStr.h +19 -0
  122. package/ios/Plugin/iHealthSDKHeaders/IDOFoundationCommand.h +1178 -0
  123. package/ios/Plugin/iHealthSDKHeaders/IDOGetInfoBluetoothModel.h +1924 -0
  124. package/ios/Plugin/iHealthSDKHeaders/IDOLogEnum.h +165 -0
  125. package/ios/Plugin/iHealthSDKHeaders/IDOPeripheralModel.h +59 -0
  126. package/ios/Plugin/iHealthSDKHeaders/IDORecordDeviceLog.h +56 -0
  127. package/ios/Plugin/iHealthSDKHeaders/IDOSetInfoBluetoothModel.h +1760 -0
  128. package/ios/Plugin/iHealthSDKHeaders/IDOSyncActivityDataModel.h +207 -0
  129. package/ios/Plugin/iHealthSDKHeaders/IDOSyncBpDataModel.h +191 -0
  130. package/ios/Plugin/iHealthSDKHeaders/IDOSyncEnum.h +316 -0
  131. package/ios/Plugin/iHealthSDKHeaders/IDOSyncGpsDataModel.h +133 -0
  132. package/ios/Plugin/iHealthSDKHeaders/IDOSyncHeartRateDataModel.h +442 -0
  133. package/ios/Plugin/iHealthSDKHeaders/IDOSyncManager.h +161 -0
  134. package/ios/Plugin/iHealthSDKHeaders/IDOSyncPressureDataModel.h +158 -0
  135. package/ios/Plugin/iHealthSDKHeaders/IDOSyncSleepDataModel.h +224 -0
  136. package/ios/Plugin/iHealthSDKHeaders/IDOSyncSpo2DataModel.h +175 -0
  137. package/ios/Plugin/iHealthSDKHeaders/IDOSyncSportDataModel.h +221 -0
  138. package/ios/Plugin/iHealthSDKHeaders/IDOSyncSwimDataModel.h +188 -0
  139. package/ios/Plugin/iHealthSDKHeaders/IDOTranEnum.h +93 -0
  140. package/ios/Plugin/iHealthSDKHeaders/IDOTransferFileManager.h +116 -0
  141. package/ios/Plugin/iHealthSDKHeaders/IDOWatchDialInfoModel.h +95 -0
  142. package/ios/Plugin/iHealthSDKHeaders/IDOWatchDialManager.h +75 -0
  143. package/ios/Plugin/iHealthSDKHeaders/IDOWeightBluetoothModel.h +124 -0
  144. package/ios/Plugin/iHealthSDKHeaders/IHSDKCloudUser.h +104 -0
  145. package/ios/Plugin/iHealthSDKHeaders/KN550BT.h +115 -0
  146. package/ios/Plugin/iHealthSDKHeaders/KN550BTController.h +32 -0
  147. package/ios/Plugin/iHealthSDKHeaders/ManageDeviceController.h +34 -0
  148. package/ios/Plugin/iHealthSDKHeaders/NT13B.h +33 -0
  149. package/ios/Plugin/iHealthSDKHeaders/NT13BController.h +28 -0
  150. package/ios/Plugin/iHealthSDKHeaders/NT13BHeader.h +16 -0
  151. package/ios/Plugin/iHealthSDKHeaders/NT13BMacroFile.h +34 -0
  152. package/ios/Plugin/iHealthSDKHeaders/PO1.h +82 -0
  153. package/ios/Plugin/iHealthSDKHeaders/PO1Controller.h +29 -0
  154. package/ios/Plugin/iHealthSDKHeaders/PO3.h +96 -0
  155. package/ios/Plugin/iHealthSDKHeaders/PO3Controller.h +29 -0
  156. package/ios/Plugin/iHealthSDKHeaders/POHeader.h +20 -0
  157. package/ios/Plugin/iHealthSDKHeaders/POMacroFile.h +142 -0
  158. package/ios/Plugin/iHealthSDKHeaders/PT3SBT.h +167 -0
  159. package/ios/Plugin/iHealthSDKHeaders/PT3SBTController.h +27 -0
  160. package/ios/Plugin/iHealthSDKHeaders/PT3SBTMacroFile.h +92 -0
  161. package/ios/Plugin/iHealthSDKHeaders/SDKFlowUpdateDevice.h +196 -0
  162. package/ios/Plugin/iHealthSDKHeaders/SDKInfo.h +30 -0
  163. package/ios/Plugin/iHealthSDKHeaders/SDKUpdateDevice.h +235 -0
  164. package/ios/Plugin/iHealthSDKHeaders/ScanDeviceController.h +47 -0
  165. package/ios/Plugin/iHealthSDKHeaders/THV3.h +104 -0
  166. package/ios/Plugin/iHealthSDKHeaders/THV3Controller.h +30 -0
  167. package/ios/Plugin/iHealthSDKHeaders/THV3Macro.h +17 -0
  168. package/ios/Plugin/iHealthSDKHeaders/TS28B.h +26 -0
  169. package/ios/Plugin/iHealthSDKHeaders/TS28BController.h +142 -0
  170. package/ios/Plugin/iHealthSDKHeaders/TS28BHeader.h +15 -0
  171. package/ios/Plugin/iHealthSDKHeaders/iHealthHS6.h +174 -0
  172. package/ios/Plugin/ihealth.swift +8 -0
  173. package/ios/Plugin/ihealthPlugin.h +10 -0
  174. package/ios/Plugin/ihealthPlugin.m +16 -0
  175. package/ios/Plugin/ihealthPlugin.swift +1502 -0
  176. package/ios/Plugin/libiHealthSDK2.7.8.a +0 -0
  177. package/ios/Plugin/test.m +9 -0
  178. package/package.json +78 -0
@@ -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
+ */
21
+ typedef 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
+ */
31
+ typedef 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
+ */
42
+ typedef 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
+ */
52
+ typedef 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
+ */
64
+ typedef 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
+ */
117
+ typedef void (^DisposeBG1DiscoverBlock)(void);
118
+
119
+ /**
120
+ BG1 IDPS
121
+
122
+ @param idpsDic IDPS dictionary
123
+ */
124
+ typedef void (^DisposeBG1IDPSBlock)(NSDictionary* idpsDic);
125
+
126
+ /**
127
+ Connect BG1 successfully
128
+ */
129
+ typedef void (^DisposeBG1ConnectBlock)(void);
130
+
131
+ /**
132
+ BG1 error block
133
+
134
+ @param errorID BG1Error enum
135
+ */
136
+ typedef void (^DisposeBG1ErrorBlock)(BG1Error errorID);
137
+
138
+ /**
139
+ BG1 send code result
140
+ */
141
+ typedef void (^DisposeBG1SendCodeResultBlock)(void);
142
+
143
+ /**
144
+ Strip is insered
145
+ */
146
+ typedef void (^DisposeBGStripInBlock)(void);
147
+ //
148
+ /**
149
+ Strip is pulled off
150
+ */
151
+ typedef void (^DisposeBGStripOutBlock)(void);
152
+
153
+ /**
154
+ Blood is droped
155
+ */
156
+ typedef void (^DisposeBGBloodBlock)(void);
157
+
158
+ /**
159
+ Measurement result block
160
+
161
+ @param result dictionary
162
+ */
163
+ typedef void (^DisposeBGResultBlock)(NSDictionary* result);
164
+
165
+ /**
166
+ BG send code result block
167
+
168
+ @param sendOk YES: success NO:fail
169
+ */
170
+ typedef void (^DisposeBGSendCodeBlock)(BOOL sendOk);
171
+
172
+ /**
173
+ BG error block
174
+
175
+ @param errorID BG error code
176
+ */
177
+ typedef void (^DisposeBGErrorBlock)(NSNumber* errorID);
178
+
179
+ /**
180
+ BG5 keep connection result
181
+
182
+ @param sendOk YES:success NO:fail
183
+ */
184
+ typedef void (^DisposeBG5KeepConnectBlock)(BOOL sendOk);
185
+
186
+ /**
187
+ BG5 set time result
188
+
189
+ @param setResult YES:success NO:fail
190
+ */
191
+ typedef void (^DisposeBGSetTime)(BOOL setResult);
192
+
193
+ /**
194
+ BG5 set unit result
195
+
196
+ @param setResult YES:success NO:fail
197
+ */
198
+ typedef void (^DisposeBGSetUnit)(BOOL setResult);
199
+
200
+ /**
201
+ BG5 get bottleID result
202
+
203
+ @param bottleID bottleID
204
+ */
205
+ typedef void (^DisposeBGBottleID)(NSNumber *bottleID);
206
+
207
+ /**
208
+ BG5 offline measurement data quantity block
209
+
210
+ @param dataCount quantity
211
+ */
212
+ typedef void (^DisposeBGDataCount)(NSNumber* dataCount);
213
+
214
+ /**
215
+ BG5 offline measurement data block
216
+
217
+ @param historyDataDic data
218
+ */
219
+ typedef void (^DisposeBGHistoryData)(NSDictionary *historyDataDic);
220
+
221
+ /**
222
+ BG5 delete offline measurement data result block
223
+
224
+ @param deleteOk YES:success NO:fail
225
+ */
226
+ typedef void (^DisposeBGDeleteData)(BOOL deleteOk);
227
+
228
+ /**
229
+ BG5 send bottle ID result block
230
+
231
+ @param sendOk YES:success NO:fail
232
+ */
233
+ typedef void(^DisposeBGSendBottleIDBlock)(BOOL sendOk);
234
+
235
+ /**
236
+ BG5 get code information
237
+
238
+ @param codeDic dictionary
239
+ */
240
+ typedef void (^DisposeBGCodeDic)(NSDictionary *codeDic);
241
+
242
+ /**
243
+ BG5 send code result block
244
+
245
+ @param sendOk YES:success NO:fail
246
+ */
247
+ typedef void (^DisposeBGSendCodeBlock)(BOOL sendOk);
248
+
249
+ /**
250
+ BG5 open mode block
251
+
252
+ @param mode BGOpenMode enum
253
+ */
254
+ typedef void (^DisposeBGStartModel)(BGOpenMode mode);
255
+
256
+ /**
257
+ BG device battery block
258
+
259
+ @param energy normal range:0-100;255 means in charging
260
+ */
261
+ typedef 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
+ */
275
+ typedef 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
+ */
330
+ typedef 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
+ */
369
+ typedef 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
+ */
413
+ typedef 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
+ */
424
+ typedef 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
+ */
438
+ typedef void(^BG5SStateInfoBlock)(BG5SStateInfo *stateInfo);
439
+
440
+ /**
441
+ BG5SRecordBlock
442
+
443
+ @param array offline measurement data array
444
+ */
445
+ typedef void(^BG5SRecordBlock)(NSArray *array);
446
+ /**
447
+ Block without return parameters
448
+ */
449
+ typedef void(^BG5SSuccessBlock)(void);
450
+
451
+ /**
452
+ Block show the result of setting code
453
+
454
+ @param success YES:success NO:fail
455
+ */
456
+ typedef void(^BG5SSetCodeResultBlock)(BOOL success);
457
+
458
+
459
+ typedef 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
+ */
469
+ typedef 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
+
481
+ typedef 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
+
498
+ typedef void(^BlockBG1SDeviceFunction)(NSDictionary *functionDict);
499
+
500
+ typedef void(^BlockBG1SError)(BG1SDeviceError error);
501
+
502
+ /**
503
+ Strip is insered
504
+ */
505
+ typedef void (^DisposeBG1SStripInBlock)(BOOL inORout);
506
+
507
+ #endif
@@ -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
@@ -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
@@ -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
@@ -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