Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaime-Trinidad authored Jan 14, 2025
2 parents 05d72ea + 0265156 commit ee5699f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion vendor/radio-bridge/radio_bridge_packet_decoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,18 @@ function Generic_Decoder(bytes , port) {
default: ThermocoupleEvent = "Undefined"; break;
}
// decode is across 16-bits
Temperature = parseInt(((bytes[3] * 256) + bytes[4]) / 16);
negativeNumber = 0xFFFF0000;
Temp16bits = ((bytes[3] << 8) | bytes[4]);

if(Temp16bits & 0x8000)
{
Temperature = (negativeNumber | Temp16bits)/16;
}
else
{
Temperature = Temp16bits/16;
}

Faults = bytes[5];
// decode each bit in the fault byte
FaultColdOutsideRange = (Faults >> 7) & 0x01;
Expand Down

0 comments on commit ee5699f

Please sign in to comment.