FReq: Variable length exhaustive substitution (aka RC format)
Is your feature request related to a problem?
When I decoded a 433MHz fan remote, I used URH to examine and RE the IQ capture. In "RC switch" radio format, there's a high/low (or inverted low/high) bit timing sync for sync/preamble, a high/low bit timing sequence for symbol 1, and a bit sequence for symbol 0, and sometimes a postamble. But crucially these sequences can be different lengths sometimes. The substitution feature doesn't work with this. Each sequence is always two level changes though. See better explanation in the docs linked below.
Describe the solution you'd like
The solution that comes to mind is to have a sort of exhaustive substitution of symbols. By enforcing that it's exhaustive and unambiguous, this could avoid the problem of multiple valid substitutions. A bit sequence could still be used to match different pulse lengths, by the LCM of the sequence lengths.
By also allowing reordering of symbol matching preference, a greedy matching algorithm would be fine even if allowing ambiguous symbols. Also, it would be fine to just fail out (stop decoding) if the sequence became invalid.
Describe alternatives you've considered
A more specific RC-switch format decoder could be used, where you set the symbol patterns (sync, one, zero, postamble) in terms of 'number of pulses'. But this isn't much less work than the more generic version which is more flexible.
Additional context
Check out my blog post where I have some screenshots and explain more about the decoding I did: https://blog.s0.is/blog/mercator-ceiling-fan-remote-433mhz-protocol
ESPHome's RC_switch_raw remote transmitter docs: https://esphome.io/components/remote_transmitter/#remote_transmitter-rc_switch-protocol
The original arduino library for this style of coding: https://github.com/sui77/rc-switch
Thanks!
Source: jopohl/urh