capacitor-plugin-ihealth 1.1.1 → 1.1.2
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/README.md +6 -6
- package/dist/docs.json +3 -3
- package/dist/esm/definitions.d.ts +1 -1
- package/dist/esm/definitions.js.map +1 -1
- package/ios/Plugin/ihealthPlugin.swift +41 -16
- package/package.json +1 -1
package/README.md
CHANGED
@@ -23,7 +23,7 @@ npx cap sync
|
|
23
23
|
* [`deleteDeviceData()`](#deletedevicedata)
|
24
24
|
* [`getDeviceOfflineData()`](#getdeviceofflinedata)
|
25
25
|
* [`startBP5SMeasurement()`](#startbp5smeasurement)
|
26
|
-
* [`addListener([eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] | [eventName: 'error', listenerFunc: (info: any) => void] | [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] | [eventName: 'dataNotFound', listenerFunc: (info: any) => void] | [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] | [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] | [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] | [eventName: 'deviceConnect', listenerFunc: (info: any) => void], ...)`](#addlistenereventname-onlinedevicedata-listenerfunc-info-any--void--eventname-error-listenerfunc-info-any--void--eventname-devicedatafound-listenerfunc-info-any--void--eventname-datanotfound-listenerfunc-info-any--void--eventname-deviceconnectfail-listenerfunc-info-any--void--eventname-devicedisconnect-listenerfunc-info-any--void--eventname-devicediscover-listenerfunc-info-any--void--eventname-deviceconnect-listenerfunc-info-any--void)
|
26
|
+
* [`addListener([eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] | [eventName: 'error', listenerFunc: (info: any) => void] | [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] | [eventName: 'StartMeasurementFinished', listenerFunc: (info: any) => void] | [eventName: 'dataNotFound', listenerFunc: (info: any) => void] | [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] | [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] | [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] | [eventName: 'deviceConnect', listenerFunc: (info: any) => void], ...)`](#addlistenereventname-onlinedevicedata-listenerfunc-info-any--void--eventname-error-listenerfunc-info-any--void--eventname-devicedatafound-listenerfunc-info-any--void--eventname-startmeasurementfinished-listenerfunc-info-any--void--eventname-datanotfound-listenerfunc-info-any--void--eventname-deviceconnectfail-listenerfunc-info-any--void--eventname-devicedisconnect-listenerfunc-info-any--void--eventname-devicediscover-listenerfunc-info-any--void--eventname-deviceconnect-listenerfunc-info-any--void)
|
27
27
|
* [Interfaces](#interfaces)
|
28
28
|
* [Type Aliases](#type-aliases)
|
29
29
|
|
@@ -154,15 +154,15 @@ startBP5SMeasurement() => Promise<{ value: any; }>
|
|
154
154
|
--------------------
|
155
155
|
|
156
156
|
|
157
|
-
### addListener([eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] | [eventName: 'error', listenerFunc: (info: any) => void] | [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] | [eventName: 'dataNotFound', listenerFunc: (info: any) => void] | [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] | [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] | [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] | [eventName: 'deviceConnect', listenerFunc: (info: any) => void], ...)
|
157
|
+
### addListener([eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] | [eventName: 'error', listenerFunc: (info: any) => void] | [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] | [eventName: 'StartMeasurementFinished', listenerFunc: (info: any) => void] | [eventName: 'dataNotFound', listenerFunc: (info: any) => void] | [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] | [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] | [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] | [eventName: 'deviceConnect', listenerFunc: (info: any) => void], ...)
|
158
158
|
|
159
159
|
```typescript
|
160
|
-
addListener(...args: [eventName: "OnlineDeviceData", listenerFunc: (info: any) => void] | [eventName: "error", listenerFunc: (info: any) => void] | [eventName: "deviceDatafound", listenerFunc: (info: any) => void] | [eventName: "dataNotFound", listenerFunc: (info: any) => void] | [eventName: "deviceConnectFail", listenerFunc: (info: any) => void] | [eventName: "deviceDisconnect", listenerFunc: (info: any) => void] | [eventName: "deviceDiscover", listenerFunc: (info: any) => void] | [eventName: "deviceConnect", listenerFunc: (info: any) => void]) => Promise<PluginListenerHandle> & PluginListenerHandle
|
160
|
+
addListener(...args: [eventName: "OnlineDeviceData", listenerFunc: (info: any) => void] | [eventName: "error", listenerFunc: (info: any) => void] | [eventName: "deviceDatafound", listenerFunc: (info: any) => void] | [eventName: "StartMeasurementFinished", listenerFunc: (info: any) => void] | [eventName: "dataNotFound", listenerFunc: (info: any) => void] | [eventName: "deviceConnectFail", listenerFunc: (info: any) => void] | [eventName: "deviceDisconnect", listenerFunc: (info: any) => void] | [eventName: "deviceDiscover", listenerFunc: (info: any) => void] | [eventName: "deviceConnect", listenerFunc: (info: any) => void]) => Promise<PluginListenerHandle> & PluginListenerHandle
|
161
161
|
```
|
162
162
|
|
163
|
-
| Param | Type
|
164
|
-
| ---------- |
|
165
|
-
| **`args`** | <code>[eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] \| [eventName: 'error', listenerFunc: (info: any) => void] \| [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] \| [eventName: 'dataNotFound', listenerFunc: (info: any) => void] \| [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] \| [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] \| [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] \| [eventName: 'deviceConnect', listenerFunc: (info: any) => void]</code> |
|
163
|
+
| Param | Type |
|
164
|
+
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
165
|
+
| **`args`** | <code>[eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] \| [eventName: 'error', listenerFunc: (info: any) => void] \| [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] \| [eventName: 'StartMeasurementFinished', listenerFunc: (info: any) => void] \| [eventName: 'dataNotFound', listenerFunc: (info: any) => void] \| [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] \| [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] \| [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] \| [eventName: 'deviceConnect', listenerFunc: (info: any) => void]</code> |
|
166
166
|
|
167
167
|
**Returns:** <code>Promise<<a href="#pluginlistenerhandle">PluginListenerHandle</a>> & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
|
168
168
|
|
package/dist/docs.json
CHANGED
@@ -131,12 +131,12 @@
|
|
131
131
|
},
|
132
132
|
{
|
133
133
|
"name": "addListener",
|
134
|
-
"signature": "(...args: [eventName: \"OnlineDeviceData\", listenerFunc: (info: any) => void] | [eventName: \"error\", listenerFunc: (info: any) => void] | [eventName: \"deviceDatafound\", listenerFunc: (info: any) => void] | [eventName: \"dataNotFound\", listenerFunc: (info: any) => void] | [eventName: \"deviceConnectFail\", listenerFunc: (info: any) => void] | [eventName: \"deviceDisconnect\", listenerFunc: (info: any) => void] | [eventName: \"deviceDiscover\", listenerFunc: (info: any) => void] | [eventName: \"deviceConnect\", listenerFunc: (info: any) => void]) => Promise<PluginListenerHandle> & PluginListenerHandle",
|
134
|
+
"signature": "(...args: [eventName: \"OnlineDeviceData\", listenerFunc: (info: any) => void] | [eventName: \"error\", listenerFunc: (info: any) => void] | [eventName: \"deviceDatafound\", listenerFunc: (info: any) => void] | [eventName: \"StartMeasurementFinished\", listenerFunc: (info: any) => void] | [eventName: \"dataNotFound\", listenerFunc: (info: any) => void] | [eventName: \"deviceConnectFail\", listenerFunc: (info: any) => void] | [eventName: \"deviceDisconnect\", listenerFunc: (info: any) => void] | [eventName: \"deviceDiscover\", listenerFunc: (info: any) => void] | [eventName: \"deviceConnect\", listenerFunc: (info: any) => void]) => Promise<PluginListenerHandle> & PluginListenerHandle",
|
135
135
|
"parameters": [
|
136
136
|
{
|
137
137
|
"name": "args",
|
138
138
|
"docs": "",
|
139
|
-
"type": "[eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] | [eventName: 'error', listenerFunc: (info: any) => void] | [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] | [eventName: 'dataNotFound', listenerFunc: (info: any) => void] | [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] | [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] | [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] | [eventName: 'deviceConnect', listenerFunc: (info: any) => void]"
|
139
|
+
"type": "[eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] | [eventName: 'error', listenerFunc: (info: any) => void] | [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] | [eventName: 'StartMeasurementFinished', listenerFunc: (info: any) => void] | [eventName: 'dataNotFound', listenerFunc: (info: any) => void] | [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] | [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] | [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] | [eventName: 'deviceConnect', listenerFunc: (info: any) => void]"
|
140
140
|
}
|
141
141
|
],
|
142
142
|
"returns": "Promise<PluginListenerHandle> & PluginListenerHandle",
|
@@ -145,7 +145,7 @@
|
|
145
145
|
"complexTypes": [
|
146
146
|
"PluginListenerHandle"
|
147
147
|
],
|
148
|
-
"slug": "addlistenereventname-onlinedevicedata-listenerfunc-info-any--void--eventname-error-listenerfunc-info-any--void--eventname-devicedatafound-listenerfunc-info-any--void--eventname-datanotfound-listenerfunc-info-any--void--eventname-deviceconnectfail-listenerfunc-info-any--void--eventname-devicedisconnect-listenerfunc-info-any--void--eventname-devicediscover-listenerfunc-info-any--void--eventname-deviceconnect-listenerfunc-info-any--void"
|
148
|
+
"slug": "addlistenereventname-onlinedevicedata-listenerfunc-info-any--void--eventname-error-listenerfunc-info-any--void--eventname-devicedatafound-listenerfunc-info-any--void--eventname-startmeasurementfinished-listenerfunc-info-any--void--eventname-datanotfound-listenerfunc-info-any--void--eventname-deviceconnectfail-listenerfunc-info-any--void--eventname-devicedisconnect-listenerfunc-info-any--void--eventname-devicediscover-listenerfunc-info-any--void--eventname-deviceconnect-listenerfunc-info-any--void"
|
149
149
|
}
|
150
150
|
],
|
151
151
|
"properties": []
|
@@ -28,5 +28,5 @@ export interface ihealthPlugin {
|
|
28
28
|
startBP5SMeasurement(): Promise<{
|
29
29
|
value: any;
|
30
30
|
}>;
|
31
|
-
addListener(...args: [eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] | [eventName: 'error', listenerFunc: (info: any) => void] | [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] | [eventName: 'dataNotFound', listenerFunc: (info: any) => void] | [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] | [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] | [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] | [eventName: 'deviceConnect', listenerFunc: (info: any) => void]): Promise<PluginListenerHandle> & PluginListenerHandle;
|
31
|
+
addListener(...args: [eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] | [eventName: 'error', listenerFunc: (info: any) => void] | [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] | [eventName: 'StartMeasurementFinished', listenerFunc: (info: any) => void] | [eventName: 'dataNotFound', listenerFunc: (info: any) => void] | [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] | [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] | [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] | [eventName: 'deviceConnect', listenerFunc: (info: any) => void]): Promise<PluginListenerHandle> & PluginListenerHandle;
|
32
32
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import { PluginListenerHandle } from \"@capacitor/core\";\n\nexport interface ihealthPlugin {\n authoriseiHealthSdk(): Promise<{ value: any }>;\n isBluetoothEnabled(): Promise<{ value: any }>;\n\tinitialiseCentralManager(): Promise<{ value: any }>;\n scanDiscover(options: Object): Promise<{ value: any }>;\n\tconnectDevice(options: Object): Promise<any>;\n getConnectedDeviceInstance(options: Object): Promise<{ value: any }>;\n\tdisconnectDevice(): Promise<{ value: any }>;\n deleteDeviceData(): Promise<{ value: any }>;\n getDeviceOfflineData(): Promise<{ value: any }>;\n startBP5SMeasurement(): Promise<{ value: any }>;\n addListener(...args: [eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] |[eventName: 'error', listenerFunc: (info: any) => void] | [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] | [eventName: 'dataNotFound', listenerFunc: (info: any) => void]|[eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] | [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] | [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] | [eventName: 'deviceConnect', listenerFunc: (info: any) => void]): Promise<PluginListenerHandle> & PluginListenerHandle;\n}\n"]}
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import { PluginListenerHandle } from \"@capacitor/core\";\n\nexport interface ihealthPlugin {\n authoriseiHealthSdk(): Promise<{ value: any }>;\n isBluetoothEnabled(): Promise<{ value: any }>;\n\tinitialiseCentralManager(): Promise<{ value: any }>;\n scanDiscover(options: Object): Promise<{ value: any }>;\n\tconnectDevice(options: Object): Promise<any>;\n getConnectedDeviceInstance(options: Object): Promise<{ value: any }>;\n\tdisconnectDevice(): Promise<{ value: any }>;\n deleteDeviceData(): Promise<{ value: any }>;\n getDeviceOfflineData(): Promise<{ value: any }>;\n startBP5SMeasurement(): Promise<{ value: any }>;\n addListener(...args: [eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] |[eventName: 'error', listenerFunc: (info: any) => void] | [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] | [eventName: 'StartMeasurementFinished', listenerFunc: (info: any) => void] | [eventName: 'dataNotFound', listenerFunc: (info: any) => void]|[eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] | [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] | [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] | [eventName: 'deviceConnect', listenerFunc: (info: any) => void]): Promise<PluginListenerHandle> & PluginListenerHandle;\n}\n"]}
|
@@ -355,6 +355,11 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
|
|
355
355
|
selector: #selector(self.deviceConnectFail),
|
356
356
|
name: Notification.Name(connectfail),
|
357
357
|
object: nil)
|
358
|
+
NotificationCenter.default.addObserver(
|
359
|
+
self,
|
360
|
+
selector: #selector(self.onlineMeasurementForPT3SBT),
|
361
|
+
name: Notification.Name("PT3SBTNotificationGetResult"),
|
362
|
+
object: nil)
|
358
363
|
}
|
359
364
|
|
360
365
|
@objc func deviceDiscover(notification:NSNotification) {
|
@@ -452,6 +457,9 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
|
|
452
457
|
default:
|
453
458
|
break
|
454
459
|
}
|
460
|
+
call.resolve([
|
461
|
+
"success": "success"
|
462
|
+
])
|
455
463
|
}
|
456
464
|
@objc func getDeviceOfflineData(_ call: CAPPluginCall) {
|
457
465
|
|
@@ -636,6 +644,7 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
|
|
636
644
|
}, errorBlock: { error in
|
637
645
|
|
638
646
|
})
|
647
|
+
self.notifyListeners("StartMeasurementFinished", data: nil)
|
639
648
|
}
|
640
649
|
func getBP5SDeviceInstances() {
|
641
650
|
|
@@ -652,9 +661,10 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
|
|
652
661
|
}, errorBlock: { err in
|
653
662
|
|
654
663
|
})
|
655
|
-
|
656
|
-
|
657
|
-
|
664
|
+
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
665
|
+
// self.startBP5SMeasurement()
|
666
|
+
self.getBP5SOfflineData()
|
667
|
+
}
|
658
668
|
}
|
659
669
|
func getBG5SInstances() {
|
660
670
|
|
@@ -674,7 +684,13 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
|
|
674
684
|
|
675
685
|
})
|
676
686
|
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
677
|
-
self.
|
687
|
+
self.myBBG5SDevice?.setUnit(BGUnit.mmolPL, successBlock: {
|
688
|
+
self.startBG5SMeasurement()
|
689
|
+
}, errorBlock: { Error, msg in
|
690
|
+
self.startBG5SMeasurement()
|
691
|
+
})
|
692
|
+
|
693
|
+
|
678
694
|
}
|
679
695
|
}
|
680
696
|
|
@@ -701,7 +717,7 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
|
|
701
717
|
}
|
702
718
|
|
703
719
|
func getPT3SBTInstances() {
|
704
|
-
|
720
|
+
|
705
721
|
if let devices = PT3SBTController.shareIHPT().getAllCurrentPT3SBTInstace() as? [PT3SBT] {
|
706
722
|
for device in devices {
|
707
723
|
|
@@ -715,10 +731,13 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
|
|
715
731
|
}
|
716
732
|
}
|
717
733
|
myPT3SBTDevice?.commandFunction({ data in
|
734
|
+
//self.getPT3SBSOfflineData()
|
718
735
|
}, disposeErrorBlock: { error in
|
736
|
+
//self.getPT3SBSOfflineData()
|
719
737
|
})
|
720
738
|
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
721
|
-
self.startPT3SBTMeasurement()
|
739
|
+
//self.startPT3SBTMeasurement()
|
740
|
+
self.getPT3SBSOfflineData()
|
722
741
|
}
|
723
742
|
|
724
743
|
}
|
@@ -733,7 +752,8 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
|
|
733
752
|
}
|
734
753
|
}
|
735
754
|
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
736
|
-
|
755
|
+
|
756
|
+
self.getHS4SOfflineData()
|
737
757
|
}
|
738
758
|
}
|
739
759
|
func getHS2SInstances() {
|
@@ -963,7 +983,6 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
|
|
963
983
|
|
964
984
|
if(count == 0) {
|
965
985
|
let userData = ["count": count] as [String : Any]
|
966
|
-
|
967
986
|
self.notifyListeners("dataNotFound", data: userData)
|
968
987
|
} else {
|
969
988
|
self.myPT3SBTDevice?.commandGetMemorryData({ data in
|
@@ -973,7 +992,7 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
|
|
973
992
|
}
|
974
993
|
let userData = ["result": deviceDataArr, "deviceModel": "PT3SBT", "deviceMacAddress": self.deviceMacAddress,"isFromLive":false] as [String : Any]
|
975
994
|
self.notifyListeners("deviceDatafound", data: userData)
|
976
|
-
|
995
|
+
self.deleteDataFromPT3SBT()
|
977
996
|
}, disposeErrorBlock: { error in
|
978
997
|
|
979
998
|
let userData = ["error": error] as [String : Any]
|
@@ -1007,11 +1026,12 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
|
|
1007
1026
|
let userData = ["result": deviceDataArr, "deviceModel": "HS4S", "deviceMacAddress": self.deviceMacAddress,"isFromLive":false] as [String : Any]
|
1008
1027
|
print(" deviceDatafound >> \(userData)")
|
1009
1028
|
self.notifyListeners("deviceDatafound", data: userData)
|
1010
|
-
|
1029
|
+
self.startHS4SMeasurement()
|
1011
1030
|
}, finishTransmission: {
|
1012
1031
|
print(" finished")
|
1013
1032
|
}, disposeErrorBlock: { error in
|
1014
1033
|
print(" disposeErrorBlock >> \(error)")
|
1034
|
+
self.startHS4SMeasurement()
|
1015
1035
|
self.HS4SError(errorID: error)
|
1016
1036
|
})
|
1017
1037
|
}
|
@@ -1198,7 +1218,7 @@ timerCount = timerCount+1
|
|
1198
1218
|
}, errorBlock: { error in
|
1199
1219
|
|
1200
1220
|
})
|
1201
|
-
|
1221
|
+
// self.notifyListeners("StartMeasurementFinished", data: nil)
|
1202
1222
|
}
|
1203
1223
|
|
1204
1224
|
func startPT3SBTMeasurement(){
|
@@ -1208,9 +1228,12 @@ timerCount = timerCount+1
|
|
1208
1228
|
selector: #selector(self.onlineMeasurementForPT3SBT),
|
1209
1229
|
name: Notification.Name("PT3SBTNotificationGetResult"),
|
1210
1230
|
object: nil)
|
1231
|
+
//DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
1232
|
+
// self.notifyListeners("StartMeasurementFinished", data: nil)
|
1233
|
+
//}
|
1234
|
+
|
1211
1235
|
}
|
1212
1236
|
@objc func onlineMeasurementForPT3SBT(notification:NSNotification){
|
1213
|
-
let notifyObject = notification.userInfo
|
1214
1237
|
guard let userInfo = notification.userInfo as NSDictionary? as? [String: Any] else {return}
|
1215
1238
|
// self.bridge?.viewController?.showToast(message: "PT3SBT \(userInfo)")
|
1216
1239
|
let userData = ["result": [userInfo], "deviceModel": "PT3SBT", "deviceMacAddress": self.deviceMacAddress,"isFromLive":true] as [String : Any]
|
@@ -1240,8 +1263,9 @@ timerCount = timerCount+1
|
|
1240
1263
|
}
|
1241
1264
|
|
1242
1265
|
}, withErrorBlock: { err in
|
1243
|
-
|
1266
|
+
// self.bridge?.viewController?.showToast(message: "PO3 start error else:\(err)")
|
1244
1267
|
})
|
1268
|
+
self.notifyListeners("StartMeasurementFinished", data: nil)
|
1245
1269
|
}
|
1246
1270
|
func startBG5SMeasurement(){
|
1247
1271
|
self.myBBG5SDevice?.startMeasure(BGMeasureMode.noBlood, withSuccessBlock: {
|
@@ -1249,6 +1273,7 @@ timerCount = timerCount+1
|
|
1249
1273
|
}, errorBlock: { err, msg in
|
1250
1274
|
|
1251
1275
|
})
|
1276
|
+
self.notifyListeners("StartMeasurementFinished", data: nil)
|
1252
1277
|
}
|
1253
1278
|
func startHS2SMeasurement(){
|
1254
1279
|
if let user = self.healthUser{
|
@@ -1268,7 +1293,7 @@ timerCount = timerCount+1
|
|
1268
1293
|
|
1269
1294
|
})
|
1270
1295
|
}
|
1271
|
-
|
1296
|
+
self.notifyListeners("StartMeasurementFinished", data: nil)
|
1272
1297
|
|
1273
1298
|
}
|
1274
1299
|
func startHS4SMeasurement(){
|
@@ -1285,9 +1310,9 @@ timerCount = timerCount+1
|
|
1285
1310
|
self.notifyListeners("deviceDatafound", data: userData)
|
1286
1311
|
//self.bridge?.viewController?.showToast(message: "stable weight:\(hs4sData)")
|
1287
1312
|
}, disposeErrorBlock: { err in
|
1288
|
-
|
1313
|
+
// self.bridge?.viewController?.showToast(message: "error in hs4s start\(err)")
|
1289
1314
|
})
|
1290
|
-
|
1315
|
+
self.notifyListeners("StartMeasurementFinished", data: nil)
|
1291
1316
|
}
|
1292
1317
|
|
1293
1318
|
// MARK: Error CallBack Methods
|