Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Remove Carrier' encoding truncates initial input #997

Merged
merged 2 commits into from
Aug 13, 2022

Conversation

delta512
Copy link
Contributor

@delta512 delta512 commented Aug 9, 2022

Hi,
I had an issue while trying to fuzz a remote control switch, despite successful decoding.

The issue

Basically, the raw signal gets perfectly decoded by a 'Remove Carrier' function with a 0_0_0_0_0_0_0_0_0_0_0_0_0 pattern. (12 data symbols interleaved with 0s)

However, the inverse function truncates the very first 0_ pair, whatever the value of the input data.
This happens if the very first character does not represent input data, as the code does not enter the if statement.
This makes the for loop skip the first input sequence altogether.

The proposed fix

I managed to solve this problem by inverting the two actions within the for loop (i.e. consume the carrier first).
Once all the input is consumed, the remaining carrier pattern is appended until it wraps around.

I hope you'll find this useful too!

Commit 8fbab14

Addresses truncation by consuming any leading carrier symbol before the for loop.

Commit 523a1d9

Addresses an issue with 8fbab14 where extra carrier symbols get included, due to the pattern wrapping around after all input data has been consumed.

Fix the encoding part of the 'Remove Carrier' decoding function by
flushing any initial carrier symbols before processing actual data.
Process carrier symbols before each input data symbol.
Append any trailing carrier symbol until the pattern wraps around.
@CLAassistant
Copy link

CLAassistant commented Aug 9, 2022

CLA assistant check
All committers have signed the CLA.

@andynoack andynoack merged commit 95702ab into jopohl:master Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants