Zane zTrack One Operating Manual page 8

Table of Contents

Advertisement

temp = (bytes[8] & 0x0F) * 100;
temp += ((bytes[9] & 0xF0) >> 4 ) * 10;
temp += bytes[9] & 0x0F;
if( bytes[8] & 80)
temp /= -10;
else
temp /= 10;
decoded.temp = temp;
bat = ((bytes[10] & 0xF0) >> 4) * 10;
bat += bytes[10] & 0x0F;
decoded.battery = bat + "%";
}
else
if (port == 207 || port == 205){
temp = (bytes[0] & 0x0F) * 100;
temp += ((bytes[1] & 0xF0) >> 4 ) * 10;
temp += bytes[1] & 0x0F;
if( bytes[0] & 80)
temp /= -10;
else
temp /= 10;
decoded.temp = temp;
bat = ((bytes[2] & 0xF0) >> 4) * 10;
bat += bytes[2] & 0x0F;
decoded.battery = bat + "%";
}
return decoded;
}
Example result for payload:
44 5D 64 06 12 5D 02 AC 02 08 59
{
"alt": 684,
"battery": "59%",
"lat": 48.06901647305881,
"lon": 8.53837455233921,
"temp": 20.8
}
www.zane.hu
8

Advertisement

Table of Contents
loading

Related Products for Zane zTrack One

Table of Contents