Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ble-glucose

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ble-glucose - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

38

index.js

@@ -90,3 +90,3 @@ /*

const features = await glucoseFeature.readValue();
console.log('Glucose features:', features.getUint16().toString(2).padStart(8, '0'));
console.log('Glucose features:', features.getUint16().toString(2).padStart(16, '0'));

@@ -250,18 +250,17 @@ this.glucoseMeasurement = await this.glucoseService.getCharacteristic('glucose_measurement');

static getSFLOAT(value, units) {
const SFLOAT = {
POSITIVE_INFINITY: 0x07FE,
NAN: 0x07FF,
NRES: 0x0800,
RESERVED_VALUE: 0x0801,
NEGATIVE_INFINITY: 0x0802,
};
switch (value) {
case 0x07FF:
return NaN;
case 0x0800:
return NaN;
case 0x07FE:
return Number.POSITIVE_INFINITY;
case 0x0802:
return Number.NEGATIVE_INFINITY;
case 0x0801:
return NaN;
default:
break;
}
const RESERVED_FLOAT_VALUES = [
Number.POSITIVE_INFINITY,
NaN,
NaN,
NaN,
Number.NEGATIVE_INFINITY,
];
let exponent = value >> 12;

@@ -282,8 +281,3 @@ let mantissa = value & 0x0FFF;

if (mantissa >= SFLOAT.POSITIVE_INFINITY &&
mantissa <= SFLOAT.NEGATIVE_INFINITY) {
return RESERVED_FLOAT_VALUES[mantissa - SFLOAT.POSITIVE_INFINITY];
}
if (mantissa >= SFLOAT.NRES) {
if (mantissa >= 0x0800) {
mantissa = -((0x0FFF + 1) - mantissa);

@@ -290,0 +284,0 @@ }

{
"name": "ble-glucose",
"version": "0.2.1",
"version": "0.2.2",
"description": "Reads blood glucose values from Bluetooth LE enabled meters",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc