Skip to content

Commit

Permalink
Improve Schrader EG53MA4 implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Jan 14, 2023
1 parent 67471e7 commit 2fa23ee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions protocols/schrader_eg53ma4_tpms.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ static bool decode(uint8_t *bits, uint32_t numbytes, uint32_t numbits, ProtoView
for (int j = 0; j < 9; j++) crc += raw[j];
if (crc != raw[9]) return false; /* Require sane CRC. */

float kpa = (float)raw[7]*2.5;
/* To convert the raw pressure to kPa, RTL433 uses 2.5, but is likely
* wrong. Searching on Google for users experimenting with the value
* reported, the value appears to be 2.75. */
float kpa = (float)raw[7]*2.75;
int temp_f = raw[8];
int temp_c = (temp_f-32)*5/9;
int temp_c = (temp_f-32)*5/9; /* Convert Fahrenheit to Celsius. */

snprintf(info->name,sizeof(info->name),"%s","Schrader EG53MA4 TPMS");
snprintf(info->raw,sizeof(info->raw),"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
Expand Down

0 comments on commit 2fa23ee

Please sign in to comment.