@@ -18,7 +18,7 @@ The preamble is 232 bit 0x55..5556.
18
18
The data packet is Manchester coded.
19
19
20
20
Specification:
21
- - Monitoring temperature range: -40 C to 130 C
21
+ - Monitoring temperature range: -127 C to 127 C
22
22
- Monitoring air pressure range: 0.1 bar to 12.0 bar
23
23
- 433 MHz FSK
24
24
@@ -29,11 +29,11 @@ Data layout (nibbles):
29
29
- U: 4 bit state, decoding unknown, not included in checksum, could be sync
30
30
- I: 32 bit ID
31
31
- W: 8 bit wheel position
32
- - F: 4 bit unknown flags (seen: 0x3)
32
+ - F: 4 bit status flags: 0x8 = unknown. 0x4 = pressure alert. 0x2|0x1 = battery status (where 00 = low battery).
33
33
- P: 12 bit Pressure (kPa)
34
- - T: 8 bit Temperature (deg. C, possibly signed? )
34
+ - T: 8 bit Temperature (deg. C, signed)
35
35
- C: 8 bit Checksum (XOR on bytes 0 to 7)
36
- - ?: 4 bit unknown (seems static)
36
+ - ?: 4 bit unknown (seems static, probably a decoding artifact )
37
37
38
38
Example data:
39
39
@@ -66,27 +66,29 @@ static int tpms_truck_decode(r_device *decoder, bitbuffer_t *bitbuffer, unsigned
66
66
return 0 ; // DECODE_FAIL_MIC;
67
67
}
68
68
69
- int state = packet_bits .bb [0 ][0 ] >> 4 ; // fixed 0xa? could be sync
70
- unsigned id = (unsigned )b [0 ] << 24 | b [1 ] << 16 | b [2 ] << 8 | b [3 ];
71
- int wheel = b [4 ];
72
- int flags = b [5 ] >> 4 ;
73
- int pressure = (b [5 ] & 0x0f ) << 8 | b [6 ];
74
- int temperature = b [7 ];
69
+ unsigned id = (unsigned )(b [0 ] << 24 ) | (b [1 ] << 16 ) | (b [2 ] << 8 ) | b [3 ];
70
+ int wheel = b [4 ];
71
+ int flags = (b [5 ] >> 4 );
72
+ int pressure = ((b [5 ] & 0x0f ) << 8 ) | b [6 ];
73
+ int temperature = b [7 ];
74
+ int pressure_alert = (flags & 0x4 ) == 0x4 ;
75
+ int battery_ok = (flags & 0x3 ) == 0x3 ; // 0x3 = battery ok, 0x0 = battery low, else unknown.
75
76
76
77
char id_str [4 * 2 + 1 ];
77
78
snprintf (id_str , sizeof (id_str ), "%08x" , id );
78
79
79
80
/* clang-format off */
80
81
data_t * data = data_make (
81
- "model" , "" , DATA_STRING , "Truck" ,
82
- "type" , "" , DATA_STRING , "TPMS" ,
83
- "id" , "" , DATA_STRING , id_str ,
84
- "wheel" , "" , DATA_INT , wheel ,
85
- "pressure_kPa" , "Pressure" , DATA_FORMAT , "%.0f kPa" , DATA_DOUBLE , (float )pressure ,
86
- "temperature_C" , "Temperature" , DATA_FORMAT , "%.0f C" , DATA_DOUBLE , (float )temperature ,
87
- "state" , "State?" , DATA_FORMAT , "%x" , DATA_INT , state ,
88
- "flags" , "Flags?" , DATA_FORMAT , "%x" , DATA_INT , flags ,
89
- "mic" , "Integrity" , DATA_STRING , "CHECKSUM" ,
82
+ "model" , "" , DATA_STRING , "Truck" ,
83
+ "type" , "" , DATA_STRING , "TPMS" ,
84
+ "id" , "" , DATA_STRING , id_str ,
85
+ "wheel" , "" , DATA_INT , wheel ,
86
+ "pressure_kPa" , "Pressure" , DATA_FORMAT , "%.0f kPa" , DATA_DOUBLE , (float )pressure ,
87
+ "temperature_C" , "Temperature" , DATA_FORMAT , "%.0f C" , DATA_DOUBLE , (float )temperature ,
88
+ "pressure_alert" , "Pressure Alert" , DATA_COND , pressure_alert , DATA_INT , pressure_alert ,
89
+ "battery_ok" , "Battery Ok" , DATA_INT , battery_ok ,
90
+ "flags" , "Flag?" , DATA_FORMAT , "%x" , DATA_INT , flags ,
91
+ "mic" , "Integrity" , DATA_STRING , "CHECKSUM" ,
90
92
NULL );
91
93
/* clang-format on */
92
94
0 commit comments