How dhogborg/go-pocsag works
go-pocsag is a command-line POCSAG pager-message decoder. Its workflow accepts WAV audio or raw sample bytes from standard input, scans for transmissions and converts samples to bits, then synchronizes and decodes protocol codewords into messages for terminal display and optional file output. The README also documents piping rtl_fm output and forcing BCD or alphanumeric decoding. The graph follows the sampled entry point and source; protocol details beyond those excerpts are represented only at the documented subsystem level.
Main entry points: main.go CLI workflow · stream.go Transmission scanner · pocsag.go POCSAG parser · util.go Bit utilities
Components 18
Input and scanning
- CLI workflow
main.go - WAV reader
internal/pocsag/file.go - WAV parser
internal/wav/wav.go - Transmission scanner
internal/pocsag/stream.go
POCSAG decoding
- POCSAG parser
internal/pocsag/pocsag.go - Batch synchronization
internal/pocsag/pocsag.go - Batch decoding
internal/pocsag/pocsag.go - Codeword decoding
internal/pocsag/pocsag.go - Parity correction
internal/pocsag/pocsag.go - Message assembly
internal/pocsag/pocsag.go - BCD / alpha decoding
internal/pocsag/pocsag.go
Shared primitives
- Sample-to-bit conversion
internal/utils/util.go - Bit utilities
internal/utils/util.go - Bit type
internal/datatypes/bit.go
Other components
- Operator / input
- rtl_fm
- Terminal
- Output files
Connections 20
- Operator / input → CLI workflow: provides input
- rtl_fm → CLI workflow: streams samples
- CLI workflow → WAV reader: reads WAV
- WAV reader → WAV parser: parses file
- CLI workflow → Transmission scanner: starts scan
- Transmission scanner → Sample-to-bit conversion: converts samples
- Transmission scanner → CLI workflow: sends bit batches
- CLI workflow → POCSAG parser: parses bits
- POCSAG parser → Batch synchronization: finds batches
- Batch synchronization → Bit utilities: checks preamble
- Batch synchronization → Batch decoding: decodes batch
- Batch decoding → Codeword decoding: decodes words
- Codeword decoding → Parity correction: corrects errors
- Codeword decoding → Bit utilities: converts bits
- POCSAG parser → Message assembly: assembles messages
- Message assembly → BCD / alpha decoding: decodes payload
- CLI workflow → Terminal: prints messages
- CLI workflow → Output files: writes messages
- Sample-to-bit conversion → Bit type: creates bits
- Bit utilities → Bit type: converts bits