I have a unique data payload which holds the temp of my sigfox device as ascii encoded hex.
542031382032430d is an example of my payload
3243 is the high temp value in the data.
To get the actual temp value from this data I first have to convert the pair of hex (32, 43) into ascii (2, C), then put those two together and convert the resulting hex string (2C) into decimal (44)
I am able to pull the values out using mutate and have them sitting as separate strings in my data payload (data.body.temp1, data.body.temp2).
Converting these to ascii is where i am having real issues
in theory i should be able to do the following using the function node:
var temp1 = payload.data.body.temp1
var temp2 = payload.data.body.temp2
char a = (char)temp1;
char b =(char)temp2;
payload.data.body.tempas1 = a;
payload.data.body.tempas2 = b;
but the char command doesn’t work in Losant so I’m stuck.
Any suggestions on how i might be able to achieve what I’m trying to do?