ble-glucose
Advanced tools
Comparing version 0.2.2 to 0.2.3
18
index.js
@@ -110,6 +110,22 @@ /* | ||
disconnect() { | ||
async disconnect() { | ||
if (!this.device) { | ||
return; | ||
} | ||
console.log('Stopping notifications and removing event listeners...'); | ||
if (this.glucoseMeasurement) { | ||
await this.glucoseMeasurement.stopNotifications(); | ||
await this.glucoseMeasurement.removeEventListener( | ||
'characteristicvaluechanged', | ||
this.handleNotifications, | ||
); | ||
} | ||
if (this.racp) { | ||
await this.racp.stopNotifications(); | ||
await this.racp.removeEventListener( | ||
'characteristicvaluechanged', | ||
this.handleNotifications, | ||
); | ||
} | ||
console.log('Notifications and event listeners stopped.'); | ||
console.log('Disconnecting from Bluetooth Device...'); | ||
@@ -116,0 +132,0 @@ if (this.device.gatt.connected) { |
{ | ||
"name": "ble-glucose", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Reads blood glucose values from Bluetooth LE enabled meters", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12116
277