Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix negative temperatures on RainPoint-Soil #3212

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/devices/rainpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Data layout:
^^ unknown?
^^ channel (but maybe also other encoded data: 9F: CH1; B1: CH2; B7: CH3;)
^^ ^^ unknown? (second byte changes between 00 and 02)
^^ temperature (degrees)
^^ temperature (degrees, 2's complement)
^^ humidity (percentage)
^^ unknown?
^^ Checksum, simple 4-bit addition over 20 nibbles (reflected)
Expand Down Expand Up @@ -86,7 +86,7 @@ static int rainpoint_decode(r_device *decoder, bitbuffer_t *bitbuffer)
int id = (b[2] << 8) | b[3]; // just a guess
int flags = (b[4]); // just a guess
int status = (b[5] << 8) | b[6]; // just a guess
float temp_c = b[7];
float temp_c = (int8_t)b[7];
int moisture = b[8];
int chan = 0; // 9f: CH1, b1: CH2, b7: CH3
//int batt = 0;
Expand Down
Loading