capacitor-plugin-ihealth 1.1.0 → 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 CHANGED
@@ -22,7 +22,8 @@ npx cap sync
22
22
  * [`disconnectDevice()`](#disconnectdevice)
23
23
  * [`deleteDeviceData()`](#deletedevicedata)
24
24
  * [`getDeviceOfflineData()`](#getdeviceofflinedata)
25
- * [`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)
25
+ * [`startBP5SMeasurement()`](#startbp5smeasurement)
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)
26
27
  * [Interfaces](#interfaces)
27
28
  * [Type Aliases](#type-aliases)
28
29
 
@@ -142,15 +143,26 @@ getDeviceOfflineData() => Promise<{ value: any; }>
142
143
  --------------------
143
144
 
144
145
 
145
- ### 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], ...)
146
+ ### startBP5SMeasurement()
146
147
 
147
148
  ```typescript
148
- 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
149
+ startBP5SMeasurement() => Promise<{ value: any; }>
149
150
  ```
150
151
 
151
- | Param | Type |
152
- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
153
- | **`args`** | <code>[eventName: 'OnlineDeviceData', listenerFunc: (info: any) =&gt; void] \| [eventName: 'error', listenerFunc: (info: any) =&gt; void] \| [eventName: 'deviceDatafound', listenerFunc: (info: any) =&gt; void] \| [eventName: 'dataNotFound', listenerFunc: (info: any) =&gt; void] \| [eventName: 'deviceConnectFail', listenerFunc: (info: any) =&gt; void] \| [eventName: 'deviceDisconnect', listenerFunc: (info: any) =&gt; void] \| [eventName: 'deviceDiscover', listenerFunc: (info: any) =&gt; void] \| [eventName: 'deviceConnect', listenerFunc: (info: any) =&gt; void]</code> |
152
+ **Returns:** <code>Promise&lt;{ value: any; }&gt;</code>
153
+
154
+ --------------------
155
+
156
+
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
+
159
+ ```typescript
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
+ ```
162
+
163
+ | Param | Type |
164
+ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
165
+ | **`args`** | <code>[eventName: 'OnlineDeviceData', listenerFunc: (info: any) =&gt; void] \| [eventName: 'error', listenerFunc: (info: any) =&gt; void] \| [eventName: 'deviceDatafound', listenerFunc: (info: any) =&gt; void] \| [eventName: 'StartMeasurementFinished', listenerFunc: (info: any) =&gt; void] \| [eventName: 'dataNotFound', listenerFunc: (info: any) =&gt; void] \| [eventName: 'deviceConnectFail', listenerFunc: (info: any) =&gt; void] \| [eventName: 'deviceDisconnect', listenerFunc: (info: any) =&gt; void] \| [eventName: 'deviceDiscover', listenerFunc: (info: any) =&gt; void] \| [eventName: 'deviceConnect', listenerFunc: (info: any) =&gt; void]</code> |
154
166
 
155
167
  **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
156
168
 
package/dist/docs.json CHANGED
@@ -119,14 +119,24 @@
119
119
  "complexTypes": [],
120
120
  "slug": "getdeviceofflinedata"
121
121
  },
122
+ {
123
+ "name": "startBP5SMeasurement",
124
+ "signature": "() => Promise<{ value: any; }>",
125
+ "parameters": [],
126
+ "returns": "Promise<{ value: any; }>",
127
+ "tags": [],
128
+ "docs": "",
129
+ "complexTypes": [],
130
+ "slug": "startbp5smeasurement"
131
+ },
122
132
  {
123
133
  "name": "addListener",
124
- "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",
125
135
  "parameters": [
126
136
  {
127
137
  "name": "args",
128
138
  "docs": "",
129
- "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]"
130
140
  }
131
141
  ],
132
142
  "returns": "Promise<PluginListenerHandle> & PluginListenerHandle",
@@ -135,7 +145,7 @@
135
145
  "complexTypes": [
136
146
  "PluginListenerHandle"
137
147
  ],
138
- "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"
139
149
  }
140
150
  ],
141
151
  "properties": []
@@ -25,5 +25,8 @@ export interface ihealthPlugin {
25
25
  getDeviceOfflineData(): Promise<{
26
26
  value: any;
27
27
  }>;
28
- 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;
28
+ startBP5SMeasurement(): Promise<{
29
+ value: any;
30
+ }>;
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;
29
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 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"]}
package/dist/esm/web.d.ts CHANGED
@@ -34,4 +34,7 @@ export declare class ihealthWeb extends WebPlugin implements ihealthPlugin {
34
34
  getDeviceOfflineData(): Promise<{
35
35
  value: any;
36
36
  }>;
37
+ startBP5SMeasurement(): Promise<{
38
+ value: any;
39
+ }>;
37
40
  }
package/dist/esm/web.js CHANGED
@@ -38,5 +38,8 @@ export class ihealthWeb extends WebPlugin {
38
38
  async getDeviceOfflineData() {
39
39
  return this.options;
40
40
  }
41
+ async startBP5SMeasurement() {
42
+ return this.options;
43
+ }
41
44
  }
42
45
  //# sourceMappingURL=web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,UAAW,SAAQ,SAAS;IAAzC;;QACE,YAAO,GAAoB,EAAC,KAAK,EAAC,IAAI,EAAC,CAAC;IAsC1C,CAAC;IArCC,KAAK,CAAC,IAAI,CAAC,OAA0B;QACnC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,KAAK,CAAC,mBAAmB;QAEvB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACA,KAAK,CAAC,kBAAkB;QAEvB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACF,KAAK,CAAC,wBAAwB;QAE3B,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,KAAK,CAAC,YAAY,CAAC,OAAe;QACjC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAC,OAAO,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACJ,KAAK,CAAC,aAAa,CAAC,OAAe;QAChC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAC,OAAO,CAAC,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,KAAK,CAAC,0BAA0B,CAAC,OAAe;QAC9C,OAAO,CAAC,GAAG,CAAC,SAAS,EAAC,OAAO,CAAC,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACF,KAAK,CAAC,gBAAgB;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,KAAK,CAAC,gBAAgB;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,KAAK,CAAC,oBAAoB;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACJ","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { ihealthPlugin } from './definitions';\n\nexport class ihealthWeb extends WebPlugin implements ihealthPlugin {\n options: { value: any; } = {value:\"ok\"};\n async echo(options: { value: string }): Promise<{ value: string }> {\n console.log('ECHO', options);\n return options;\n }\n async authoriseiHealthSdk(): Promise<{ value: any }>{\n \n return this.options;\n }\n async isBluetoothEnabled(): Promise<{ value: any }>{\n \n return this.options;\n }\n\tasync initialiseCentralManager(): Promise<{ value: any }>{\n \n return this.options;\n }\n async scanDiscover(options: Object): Promise<{ value: any }>{\n console.log(\"options\",options);\n return this.options;\n }\n\tasync connectDevice(options: Object): Promise<any>{\n console.log(\"options\",options);\n return this.options;\n }\n async getConnectedDeviceInstance(options: Object): Promise<{ value: any }>{\n console.log(\"options\",options);\n return this.options;\n }\n\tasync disconnectDevice(): Promise<{ value: any }>{\n return this.options;\n }\n async deleteDeviceData(): Promise<{ value: any }>{\n return this.options;\n }\n async getDeviceOfflineData(): Promise<{ value: any }>{\n return this.options;\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,UAAW,SAAQ,SAAS;IAAzC;;QACE,YAAO,GAAoB,EAAC,KAAK,EAAC,IAAI,EAAC,CAAC;IA0C1C,CAAC;IAzCC,KAAK,CAAC,IAAI,CAAC,OAA0B;QACnC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,KAAK,CAAC,mBAAmB;QAEvB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACA,KAAK,CAAC,kBAAkB;QAEvB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACF,KAAK,CAAC,wBAAwB;QAE3B,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,KAAK,CAAC,YAAY,CAAC,OAAe;QACjC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAC,OAAO,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACJ,KAAK,CAAC,aAAa,CAAC,OAAe;QAChC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAC,OAAO,CAAC,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,KAAK,CAAC,0BAA0B,CAAC,OAAe;QAC9C,OAAO,CAAC,GAAG,CAAC,SAAS,EAAC,OAAO,CAAC,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACF,KAAK,CAAC,gBAAgB;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,KAAK,CAAC,gBAAgB;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,KAAK,CAAC,oBAAoB;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,KAAK,CAAC,oBAAoB;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CAEJ","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { ihealthPlugin } from './definitions';\n\nexport class ihealthWeb extends WebPlugin implements ihealthPlugin {\n options: { value: any; } = {value:\"ok\"};\n async echo(options: { value: string }): Promise<{ value: string }> {\n console.log('ECHO', options);\n return options;\n }\n async authoriseiHealthSdk(): Promise<{ value: any }>{\n \n return this.options;\n }\n async isBluetoothEnabled(): Promise<{ value: any }>{\n \n return this.options;\n }\n\tasync initialiseCentralManager(): Promise<{ value: any }>{\n \n return this.options;\n }\n async scanDiscover(options: Object): Promise<{ value: any }>{\n console.log(\"options\",options);\n return this.options;\n }\n\tasync connectDevice(options: Object): Promise<any>{\n console.log(\"options\",options);\n return this.options;\n }\n async getConnectedDeviceInstance(options: Object): Promise<{ value: any }>{\n console.log(\"options\",options);\n return this.options;\n }\n\tasync disconnectDevice(): Promise<{ value: any }>{\n return this.options;\n }\n async deleteDeviceData(): Promise<{ value: any }>{\n return this.options;\n }\n async getDeviceOfflineData(): Promise<{ value: any }>{\n return this.options;\n }\n async startBP5SMeasurement(): Promise<{ value: any }>{\n return this.options;\n }\n \n}\n"]}
@@ -47,6 +47,9 @@ class ihealthWeb extends core.WebPlugin {
47
47
  async getDeviceOfflineData() {
48
48
  return this.options;
49
49
  }
50
+ async startBP5SMeasurement() {
51
+ return this.options;
52
+ }
50
53
  }
51
54
 
52
55
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst ihealth = registerPlugin('ihealth', {\n web: () => import('./web').then(m => new m.ihealthWeb()),\n});\nexport * from './definitions';\nexport { ihealth };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ihealthWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.options = { value: \"ok\" };\n }\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async authoriseiHealthSdk() {\n return this.options;\n }\n async isBluetoothEnabled() {\n return this.options;\n }\n async initialiseCentralManager() {\n return this.options;\n }\n async scanDiscover(options) {\n console.log(\"options\", options);\n return this.options;\n }\n async connectDevice(options) {\n console.log(\"options\", options);\n return this.options;\n }\n async getConnectedDeviceInstance(options) {\n console.log(\"options\", options);\n return this.options;\n }\n async disconnectDevice() {\n return this.options;\n }\n async deleteDeviceData() {\n return this.options;\n }\n async getDeviceOfflineData() {\n return this.options;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;AAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;AAC5D,CAAC;;ACFM,MAAM,UAAU,SAASC,cAAS,CAAC;AAC1C,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;AAC5B,QAAQ,IAAI,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACvC,KAAK;AACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,mBAAmB,GAAG;AAChC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,kBAAkB,GAAG;AAC/B,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,wBAAwB,GAAG;AACrC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,YAAY,CAAC,OAAO,EAAE;AAChC,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACxC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,aAAa,CAAC,OAAO,EAAE;AACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACxC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,0BAA0B,CAAC,OAAO,EAAE;AAC9C,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACxC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,oBAAoB,GAAG;AACjC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst ihealth = registerPlugin('ihealth', {\n web: () => import('./web').then(m => new m.ihealthWeb()),\n});\nexport * from './definitions';\nexport { ihealth };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ihealthWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.options = { value: \"ok\" };\n }\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async authoriseiHealthSdk() {\n return this.options;\n }\n async isBluetoothEnabled() {\n return this.options;\n }\n async initialiseCentralManager() {\n return this.options;\n }\n async scanDiscover(options) {\n console.log(\"options\", options);\n return this.options;\n }\n async connectDevice(options) {\n console.log(\"options\", options);\n return this.options;\n }\n async getConnectedDeviceInstance(options) {\n console.log(\"options\", options);\n return this.options;\n }\n async disconnectDevice() {\n return this.options;\n }\n async deleteDeviceData() {\n return this.options;\n }\n async getDeviceOfflineData() {\n return this.options;\n }\n async startBP5SMeasurement() {\n return this.options;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;AAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;AAC5D,CAAC;;ACFM,MAAM,UAAU,SAASC,cAAS,CAAC;AAC1C,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;AAC5B,QAAQ,IAAI,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACvC,KAAK;AACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,mBAAmB,GAAG;AAChC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,kBAAkB,GAAG;AAC/B,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,wBAAwB,GAAG;AACrC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,YAAY,CAAC,OAAO,EAAE;AAChC,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACxC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,aAAa,CAAC,OAAO,EAAE;AACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACxC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,0BAA0B,CAAC,OAAO,EAAE;AAC9C,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACxC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,oBAAoB,GAAG;AACjC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,oBAAoB,GAAG;AACjC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -44,6 +44,9 @@ var capacitorihealth = (function (exports, core) {
44
44
  async getDeviceOfflineData() {
45
45
  return this.options;
46
46
  }
47
+ async startBP5SMeasurement() {
48
+ return this.options;
49
+ }
47
50
  }
48
51
 
49
52
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst ihealth = registerPlugin('ihealth', {\n web: () => import('./web').then(m => new m.ihealthWeb()),\n});\nexport * from './definitions';\nexport { ihealth };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ihealthWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.options = { value: \"ok\" };\n }\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async authoriseiHealthSdk() {\n return this.options;\n }\n async isBluetoothEnabled() {\n return this.options;\n }\n async initialiseCentralManager() {\n return this.options;\n }\n async scanDiscover(options) {\n console.log(\"options\", options);\n return this.options;\n }\n async connectDevice(options) {\n console.log(\"options\", options);\n return this.options;\n }\n async getConnectedDeviceInstance(options) {\n console.log(\"options\", options);\n return this.options;\n }\n async disconnectDevice() {\n return this.options;\n }\n async deleteDeviceData() {\n return this.options;\n }\n async getDeviceOfflineData() {\n return this.options;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;IAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IAC5D,CAAC;;ICFM,MAAM,UAAU,SAASC,cAAS,CAAC;IAC1C,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;IAC5B,QAAQ,IAAI,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACvC,KAAK;IACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,mBAAmB,GAAG;IAChC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,wBAAwB,GAAG;IACrC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,YAAY,CAAC,OAAO,EAAE;IAChC,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,aAAa,CAAC,OAAO,EAAE;IACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,0BAA0B,CAAC,OAAO,EAAE;IAC9C,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,oBAAoB,GAAG;IACjC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst ihealth = registerPlugin('ihealth', {\n web: () => import('./web').then(m => new m.ihealthWeb()),\n});\nexport * from './definitions';\nexport { ihealth };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ihealthWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.options = { value: \"ok\" };\n }\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async authoriseiHealthSdk() {\n return this.options;\n }\n async isBluetoothEnabled() {\n return this.options;\n }\n async initialiseCentralManager() {\n return this.options;\n }\n async scanDiscover(options) {\n console.log(\"options\", options);\n return this.options;\n }\n async connectDevice(options) {\n console.log(\"options\", options);\n return this.options;\n }\n async getConnectedDeviceInstance(options) {\n console.log(\"options\", options);\n return this.options;\n }\n async disconnectDevice() {\n return this.options;\n }\n async deleteDeviceData() {\n return this.options;\n }\n async getDeviceOfflineData() {\n return this.options;\n }\n async startBP5SMeasurement() {\n return this.options;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;IAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IAC5D,CAAC;;ICFM,MAAM,UAAU,SAASC,cAAS,CAAC;IAC1C,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;IAC5B,QAAQ,IAAI,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACvC,KAAK;IACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,mBAAmB,GAAG;IAChC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,wBAAwB,GAAG;IACrC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,YAAY,CAAC,OAAO,EAAE;IAChC,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,aAAa,CAAC,OAAO,EAAE;IACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,0BAA0B,CAAC,OAAO,EAAE;IAC9C,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,oBAAoB,GAAG;IACjC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,oBAAoB,GAAG;IACjC,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5B,KAAK;IACL;;;;;;;;;;;;;;;;;"}
@@ -13,4 +13,5 @@ CAP_PLUGIN(ihealthPlugin, "ihealth",
13
13
  CAP_PLUGIN_METHOD(disconnectDevice, CAPPluginReturnPromise);
14
14
  CAP_PLUGIN_METHOD(deleteDeviceData, CAPPluginReturnPromise);
15
15
  CAP_PLUGIN_METHOD(getDeviceOfflineData, CAPPluginReturnPromise);
16
+ CAP_PLUGIN_METHOD(startBP5SMeasurement, CAPPluginReturnPromise);
16
17
  )
@@ -238,7 +238,14 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
238
238
  "success": "success"
239
239
  ])
240
240
  }
241
-
241
+ @objc func startBP5SMeasurement(_ call:CAPPluginCall){
242
+ // DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
243
+ self.startBP5SMeasurement()
244
+ //}
245
+ call.resolve([
246
+ "success": "success"
247
+ ])
248
+ }
242
249
 
243
250
  func selectBPTrackAndScan() {
244
251
  removeDeviceObserver()
@@ -348,6 +355,11 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
348
355
  selector: #selector(self.deviceConnectFail),
349
356
  name: Notification.Name(connectfail),
350
357
  object: nil)
358
+ NotificationCenter.default.addObserver(
359
+ self,
360
+ selector: #selector(self.onlineMeasurementForPT3SBT),
361
+ name: Notification.Name("PT3SBTNotificationGetResult"),
362
+ object: nil)
351
363
  }
352
364
 
353
365
  @objc func deviceDiscover(notification:NSNotification) {
@@ -445,6 +457,9 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
445
457
  default:
446
458
  break
447
459
  }
460
+ call.resolve([
461
+ "success": "success"
462
+ ])
448
463
  }
449
464
  @objc func getDeviceOfflineData(_ call: CAPPluginCall) {
450
465
 
@@ -629,6 +644,7 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
629
644
  }, errorBlock: { error in
630
645
 
631
646
  })
647
+ self.notifyListeners("StartMeasurementFinished", data: nil)
632
648
  }
633
649
  func getBP5SDeviceInstances() {
634
650
 
@@ -645,9 +661,10 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
645
661
  }, errorBlock: { err in
646
662
 
647
663
  })
648
- DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
649
- self.startBP5SMeasurement()
650
- }
664
+ DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
665
+ // self.startBP5SMeasurement()
666
+ self.getBP5SOfflineData()
667
+ }
651
668
  }
652
669
  func getBG5SInstances() {
653
670
 
@@ -667,7 +684,13 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
667
684
 
668
685
  })
669
686
  DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
670
- self.startBG5SMeasurement()
687
+ self.myBBG5SDevice?.setUnit(BGUnit.mmolPL, successBlock: {
688
+ self.startBG5SMeasurement()
689
+ }, errorBlock: { Error, msg in
690
+ self.startBG5SMeasurement()
691
+ })
692
+
693
+
671
694
  }
672
695
  }
673
696
 
@@ -694,7 +717,7 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
694
717
  }
695
718
 
696
719
  func getPT3SBTInstances() {
697
-
720
+
698
721
  if let devices = PT3SBTController.shareIHPT().getAllCurrentPT3SBTInstace() as? [PT3SBT] {
699
722
  for device in devices {
700
723
 
@@ -708,10 +731,13 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
708
731
  }
709
732
  }
710
733
  myPT3SBTDevice?.commandFunction({ data in
734
+ //self.getPT3SBSOfflineData()
711
735
  }, disposeErrorBlock: { error in
736
+ //self.getPT3SBSOfflineData()
712
737
  })
713
738
  DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
714
- self.startPT3SBTMeasurement()
739
+ //self.startPT3SBTMeasurement()
740
+ self.getPT3SBSOfflineData()
715
741
  }
716
742
 
717
743
  }
@@ -726,7 +752,8 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
726
752
  }
727
753
  }
728
754
  DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
729
- self.startHS4SMeasurement()
755
+
756
+ self.getHS4SOfflineData()
730
757
  }
731
758
  }
732
759
  func getHS2SInstances() {
@@ -956,7 +983,6 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
956
983
 
957
984
  if(count == 0) {
958
985
  let userData = ["count": count] as [String : Any]
959
-
960
986
  self.notifyListeners("dataNotFound", data: userData)
961
987
  } else {
962
988
  self.myPT3SBTDevice?.commandGetMemorryData({ data in
@@ -966,7 +992,7 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
966
992
  }
967
993
  let userData = ["result": deviceDataArr, "deviceModel": "PT3SBT", "deviceMacAddress": self.deviceMacAddress,"isFromLive":false] as [String : Any]
968
994
  self.notifyListeners("deviceDatafound", data: userData)
969
- //self.deleteDataFromPT3SBT()
995
+ self.deleteDataFromPT3SBT()
970
996
  }, disposeErrorBlock: { error in
971
997
 
972
998
  let userData = ["error": error] as [String : Any]
@@ -1000,11 +1026,12 @@ public class ihealthPlugin: CAPPlugin,CBCentralManagerDelegate,BG5SDelegate {
1000
1026
  let userData = ["result": deviceDataArr, "deviceModel": "HS4S", "deviceMacAddress": self.deviceMacAddress,"isFromLive":false] as [String : Any]
1001
1027
  print(" deviceDatafound >> \(userData)")
1002
1028
  self.notifyListeners("deviceDatafound", data: userData)
1003
-
1029
+ self.startHS4SMeasurement()
1004
1030
  }, finishTransmission: {
1005
1031
  print(" finished")
1006
1032
  }, disposeErrorBlock: { error in
1007
1033
  print(" disposeErrorBlock >> \(error)")
1034
+ self.startHS4SMeasurement()
1008
1035
  self.HS4SError(errorID: error)
1009
1036
  })
1010
1037
  }
@@ -1191,7 +1218,7 @@ timerCount = timerCount+1
1191
1218
  }, errorBlock: { error in
1192
1219
 
1193
1220
  })
1194
-
1221
+ // self.notifyListeners("StartMeasurementFinished", data: nil)
1195
1222
  }
1196
1223
 
1197
1224
  func startPT3SBTMeasurement(){
@@ -1201,9 +1228,12 @@ timerCount = timerCount+1
1201
1228
  selector: #selector(self.onlineMeasurementForPT3SBT),
1202
1229
  name: Notification.Name("PT3SBTNotificationGetResult"),
1203
1230
  object: nil)
1231
+ //DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
1232
+ // self.notifyListeners("StartMeasurementFinished", data: nil)
1233
+ //}
1234
+
1204
1235
  }
1205
1236
  @objc func onlineMeasurementForPT3SBT(notification:NSNotification){
1206
- let notifyObject = notification.userInfo
1207
1237
  guard let userInfo = notification.userInfo as NSDictionary? as? [String: Any] else {return}
1208
1238
  // self.bridge?.viewController?.showToast(message: "PT3SBT \(userInfo)")
1209
1239
  let userData = ["result": [userInfo], "deviceModel": "PT3SBT", "deviceMacAddress": self.deviceMacAddress,"isFromLive":true] as [String : Any]
@@ -1233,8 +1263,9 @@ timerCount = timerCount+1
1233
1263
  }
1234
1264
 
1235
1265
  }, withErrorBlock: { err in
1236
- self.bridge?.viewController?.showToast(message: "PO3 start error else:\(err)")
1266
+ // self.bridge?.viewController?.showToast(message: "PO3 start error else:\(err)")
1237
1267
  })
1268
+ self.notifyListeners("StartMeasurementFinished", data: nil)
1238
1269
  }
1239
1270
  func startBG5SMeasurement(){
1240
1271
  self.myBBG5SDevice?.startMeasure(BGMeasureMode.noBlood, withSuccessBlock: {
@@ -1242,6 +1273,7 @@ timerCount = timerCount+1
1242
1273
  }, errorBlock: { err, msg in
1243
1274
 
1244
1275
  })
1276
+ self.notifyListeners("StartMeasurementFinished", data: nil)
1245
1277
  }
1246
1278
  func startHS2SMeasurement(){
1247
1279
  if let user = self.healthUser{
@@ -1261,7 +1293,7 @@ timerCount = timerCount+1
1261
1293
 
1262
1294
  })
1263
1295
  }
1264
-
1296
+ self.notifyListeners("StartMeasurementFinished", data: nil)
1265
1297
 
1266
1298
  }
1267
1299
  func startHS4SMeasurement(){
@@ -1278,9 +1310,9 @@ timerCount = timerCount+1
1278
1310
  self.notifyListeners("deviceDatafound", data: userData)
1279
1311
  //self.bridge?.viewController?.showToast(message: "stable weight:\(hs4sData)")
1280
1312
  }, disposeErrorBlock: { err in
1281
- self.bridge?.viewController?.showToast(message: "error in hs4s start\(err)")
1313
+ // self.bridge?.viewController?.showToast(message: "error in hs4s start\(err)")
1282
1314
  })
1283
-
1315
+ self.notifyListeners("StartMeasurementFinished", data: nil)
1284
1316
  }
1285
1317
 
1286
1318
  // MARK: Error CallBack Methods
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-plugin-ihealth",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "capacitor plugin to integrate ihealth sdk",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",