Skip to content

Commit

Permalink
Merge pull request #326 from quandify/cubicmeter-1.1-unused-code
Browse files Browse the repository at this point in the history
Removed unused functions
  • Loading branch information
J2thatsme authored Nov 13, 2024
2 parents 0ebf6e7 + 71ebf57 commit ed2c822
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 42 deletions.
2 changes: 1 addition & 1 deletion types/quandify/cubicmeter-1.1-copper/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"manufacturer": "Quandify",
"url": "https://quandify.com/cubicmeter",
"description": "The CubicMeter 1.1 is a non-invasive water flow meter with leakage detection capabilities that communicates over LoRaWAN.",
"description": "Clamp-on water flow meter and leak sensor.",
"author": "Quandify AB",
"firmwareVersion": "V1.0.0",
"loraDeviceClass": "A",
Expand Down
20 changes: 0 additions & 20 deletions types/quandify/cubicmeter-1.1-copper/uplink.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,26 +257,6 @@ const parseErrorCode = function (errorCode) {
}
};

// Convert a hex string to decimal array
const 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;
};

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

return hexToDecArray(bufString);
};

const decArrayToStr = function (byteArray) {
return Array.from(byteArray, (byte) => (`0${(byte & 0xff).toString(16)}`).slice(-2).toUpperCase()).join("");
};
Expand Down
2 changes: 1 addition & 1 deletion types/quandify/cubicmeter-1.1-plastic/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"manufacturer": "Quandify",
"url": "https://quandify.com/cubicmeter",
"description": "The CubicMeter 1.1 is a non-invasive water flow meter with leakage detection capabilities that communicates over LoRaWAN.",
"description": "Clamp-on water flow meter and leak sensor.",
"author": "Quandify AB",
"firmwareVersion": "V1.0.0",
"loraDeviceClass": "A",
Expand Down
20 changes: 0 additions & 20 deletions types/quandify/cubicmeter-1.1-plastic/uplink.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,26 +257,6 @@ const parseErrorCode = function (errorCode) {
}
};

// Convert a hex string to decimal array
const 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;
};

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

return hexToDecArray(bufString);
};

const decArrayToStr = function (byteArray) {
return Array.from(byteArray, (byte) => (`0${(byte & 0xff).toString(16)}`).slice(-2).toUpperCase()).join("");
};
Expand Down

0 comments on commit ed2c822

Please sign in to comment.