Skip to content

Commit

Permalink
Removed unused functions crashing the decoder (#841)
Browse files Browse the repository at this point in the history
* Removed unused functions crashing the decoder

* Updated product description
  • Loading branch information
peter-quandify authored Nov 15, 2024
1 parent 7eba612 commit c6ddfa2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
2 changes: 1 addition & 1 deletion vendor/quandify/cubicmeter-1-1-copper.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: CubicMeter 1.1 Copper
description: Non-invasive water meter and leakage sensor
description: Clamp-on water flow meter and leak sensor.

# Hardware versions (optional)
hardwareVersions:
Expand Down
2 changes: 1 addition & 1 deletion vendor/quandify/cubicmeter-1-1-plastic.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: CubicMeter 1.1 Plastic
description: Non-invasive water meter and leakage sensor
description: Clamp-on water flow meter and leak sensor.

# Hardware versions (optional)
hardwareVersions:
Expand Down
20 changes: 0 additions & 20 deletions vendor/quandify/cubicmeter-1-1-uplink.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,26 +277,6 @@ var normalizeUplink = function (input) {
};
};

// Convert a hex string to decimal array
var hexToDecArray = function (hexString) {
const size = 2;
const length = Math.ceil(hexString.length / size);
const decimalList = new Array(length);

for (let i = 0, o = 0; i < length; ++i, o += size) {
decimalList[i] = parseInt(hexString.substr(o, size), 16);
}

return decimalList;
};

var base64ToDecArray = function (base64String) {
const buffer = Buffer.from(base64String, 'base64');
const bufString = buffer.toString('hex');

return hexToDecArray(bufString);
};

var decArrayToStr = function (byteArray) {
return Array.from(byteArray, function (byte) {
return ('0' + (byte & 0xff).toString(16)).slice(-2).toUpperCase();
Expand Down

0 comments on commit c6ddfa2

Please sign in to comment.