Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unused functions crashing the decoder #841

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading