Is there a problem with calling an expression inside another expression ? Cause when I do:
create expression int js:hexToBin(hex) [
var bin = '';
for (var i = 0; i <= hex.length - 1; i += 1) {
bin += ('0000' + parseInt(hex.substr(i, 1), 16).toString(2)).slice(-4);
};
parseInt(bin, 2);
];
create expression int js:getTemperature(hex) [
hexToBin(hex.substring(4, 6));
];
I got an error \"hexToBin\" is not defined. (getTemperature#2). But when I put all of the code in getTemperature it works properly.