tpms

package
v0.366.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package tpms decodes TPMS (Tire Pressure Monitoring System) Sub-GHz bit-streams into the format-independent fields a pentester can trust: the Manchester line-decoded payload bytes, the 32-bit sensor ID, and CRC-8 validity. TPMS sensors beacon on 315 MHz (North America) and 433.92 MHz (Europe/Asia) and are a prime Flipper Sub-GHz target — they uniquely identify (and so let you track) a specific vehicle, and the wire format has no authentication.

Wrap-vs-native judgement

Native. The hard, reusable part — recovering bytes from a Manchester-coded FSK/OOK bit-stream — is a public, deterministic transform (IEEE 802.3 and G.E. Thomas conventions). Operators bring a pre-demodulated bit-stream (rtl_433, a Flipper FSK Sub-GHz capture pre-extracted to bits, or Universal Radio Hacker) and decode offline, exactly as subghz_pocsag_decode does for paging.

What this package covers

  • Manchester line decoding under both conventions (IEEE 802.3: data 0 = "10", data 1 = "01"; G.E. Thomas: the inverse) at both bit alignments, auto-selecting the convention/alignment that yields the longest clean (no illegal "00"/"11" transition) decode — the correct one runs clean while the wrong one trips an illegal pair almost immediately.
  • Leading-preamble tolerance: the alternating "0101…" preamble that most TPMS sensors send before the payload decodes to a run of data bits and is reported, not rejected.
  • The decoded payload as hex, plus the 32-bit sensor ID — the first four payload bytes, which across virtually every TPMS family is the unique per-sensor identifier (the field-independent signal an operator uses to fingerprint or track a vehicle).
  • CRC-8 validity probing against the polynomials TPMS sensors commonly use (0x07 CCITT, 0x2F, 0x13), reported as a confidence/alignment hint.

What this package does NOT cover (deliberately out of scope)

  • Manufacturer-specific pressure / temperature / status field interpretation: the byte offsets and scaling differ per family (Schrader, Toyota, Ford, Renault, Citroën, GM, Hyundai, …) and cannot be verified here without per-model captures. The raw decoded bytes are surfaced so an operator can apply the relevant rtl_433 model layout. Encoding this without sample data would risk a confidently-wrong reading — worse than none for a security tool.
  • FSK/OOK demodulation (bring a pre-demodulated bit-stream).
  • Differential-Manchester / biphase-mark variants used by a minority of sensors (standard Manchester is the common case here).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	InputBits       int      `json:"input_bits"`
	LineCoding      string   `json:"line_coding"`
	BitAlignment    int      `json:"bit_alignment"`
	DecodedBits     int      `json:"decoded_bits"`
	DecodedBytes    int      `json:"decoded_bytes"`
	DecodedHex      string   `json:"decoded_hex"`
	SensorID        string   `json:"sensor_id,omitempty"`
	SensorIDDecimal *uint32  `json:"sensor_id_decimal,omitempty"`
	CRC8Matches     []string `json:"crc8_matches,omitempty"`
	Notes           []string `json:"notes,omitempty"`
}

Result is the structured decode of a TPMS bit-stream.

func Decode

func Decode(bitStr string) (*Result, error)

Decode parses a TPMS Sub-GHz bit-stream (a string of '0'/'1' characters; ':' '-' '_' / whitespace separators tolerated).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL