Skip to content

Commit 58020e3

Browse files
committed
Fix coding, model and docs
1 parent d25bbf8 commit 58020e3

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

src/devices/tpms_trw.c

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ TRW TPMS Sensor.
1616
1717
FCC-ID: GQ4-70T
1818
19-
- OEM and Chinese OEM models
19+
- OEM and Clone OEM models
2020
- Used into Chrysler car from 2014 until 2022 : car models https://www.chryslertpms.com/chrysler-tpms-types-fitment
2121
2222
- OOK then FSK rf signals, mode detail here : https://fcc.report/FCC-ID/GQ4-70T/2201535
@@ -32,15 +32,15 @@ S.a issue #3256
3232
3333
- PRE : 7FFF (FSK) or 0001 (OOK)
3434
35-
- M:{8} Mode/Model : 0x5c, 0x5d or 0x5e (Always 0x5c for Chinese OEM model)
35+
- M:{8} Mode/Model : 0x5c, 0x5d or 0x5e (Always 0x5c for Clone OEM model)
3636
- I:{32} Sensor ID
37-
- F:{4} Flag status : 0x6 = pressure drop (OEM) , 0x9 pressure increase (OEM) or drop (Chinese OEM), 0xb or 0xc alternatly in Motion
38-
- N:{4} Seq number : 0,1,2,3,0,1,2,3... for OEM, 1,2,3,4,1,2,3,4... for Chinese OEM
37+
- F:{4} Flag status : 0x6 = pressure drop (OEM) , 0x9 pressure increase (OEM) or drop (Clone OEM), 0xb or 0xc alternatly in Motion
38+
- N:{4} Seq number : 0,1,2,3,0,1,2,3... for OEM, 1,2,3,4,1,2,3,4... for Clone OEM
3939
- P:{8} Pressure PSI, scale 2.5
4040
- T:{8} Temperature C, offset 50
4141
- S:{8} Motion status, 0x0e parked, other value in motion, not yet guesses
4242
- C:{8} CRC-8/SMBUS, poly 0x07, init 0x00, final XOR 0x00
43-
- X:{4} Trailing bit but 0x4 OEM, 0x0 Chinese OEM
43+
- X:{4} Trailing bit but 0x4 OEM, 0x0 Clone OEM
4444
4545
*/
4646

@@ -117,13 +117,12 @@ static int tpms_trw_decode(r_device *decoder, bitbuffer_t *bitbuffer, int type)
117117
"flags", "Flags", DATA_FORMAT, "%01x", DATA_INT, flags,
118118
"alert", "Alert", DATA_COND, flags == 0x6 || flags == 0x9, DATA_STRING, "Pressure increase/decrease !",
119119
"seq_num", "Seq Num", DATA_INT, seq_num,
120-
"pressure_PSI", "Pressure", DATA_FORMAT, "%.0f PSI", DATA_DOUBLE, pressure_psi,
121-
"temperature_C", "Temperature", DATA_FORMAT, "%.1f C", DATA_DOUBLE, (double)temperature_C,
120+
"pressure_PSI", "Pressure", DATA_FORMAT, "%.1f PSI", DATA_DOUBLE, pressure_psi,
121+
"temperature_C", "Temperature", DATA_FORMAT, "%.0f C", DATA_DOUBLE, (double)temperature_C,
122122
"motion_flags", "Motion flags", DATA_FORMAT, "%02x", DATA_INT, motion_flags,
123123
"motion_status", "Motion", DATA_STRING, motion_flags == 0x0e ? "Parked" : "Moving",
124-
//"inflate", "Inflate", DATA_INT, infl_detected,
125124
"oem_model", "OEM Model", DATA_COND, oem_model == 0x4, DATA_STRING, "OEM",
126-
"oem_model", "OEM Model", DATA_COND, oem_model == 0x0, DATA_STRING, "Chinese OEM",
125+
"oem_model", "OEM Model", DATA_COND, oem_model == 0x0, DATA_STRING, "Clone",
127126
"mic", "Integrity", DATA_STRING, "CRC",
128127
NULL);
129128
/* clang-format on */
@@ -156,11 +155,13 @@ static char const *const output_fields[] = {
156155
"mode",
157156
"id",
158157
//"battery_ok",
159-
"pressure_kPa",
160-
"temperature_C",
161-
"seq_num",
162158
"flags",
159+
"alert",
160+
"seq_num",
161+
"pressure_PSI",
162+
"temperature_C",
163163
"motion_flags",
164+
"motion_status",
164165
//"fast_leak",
165166
//"inflate",
166167
"oem_model",
@@ -169,21 +170,21 @@ static char const *const output_fields[] = {
169170
};
170171

171172
r_device const tpms_trw_ook = {
172-
.name = "TRW TPMS OOK OEM and Chinese models",
173+
.name = "TRW TPMS OOK OEM and Clone models",
173174
.modulation = OOK_PULSE_MANCHESTER_ZEROBIT,
174175
.short_width = 52,
175176
.long_width = 52,
176-
.reset_limit = 200,
177+
.reset_limit = 150,
177178
.decode_fn = &tpms_trw_callback_ook,
178179
.fields = output_fields,
179180
};
180181

181182
r_device const tpms_trw_fsk = {
182-
.name = "TRW TPMS FSK OEM and Chinese models",
183+
.name = "TRW TPMS FSK OEM and Clone models",
183184
.modulation = FSK_PULSE_MANCHESTER_ZEROBIT,
184185
.short_width = 52,
185186
.long_width = 52,
186-
.reset_limit = 200,
187+
.reset_limit = 150,
187188
.decode_fn = &tpms_trw_callback_fsk,
188189
.fields = output_fields,
189190
};

0 commit comments

Comments
 (0)