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

json has too much output #118

Open
andimik opened this issue Sep 16, 2024 · 1 comment
Open

json has too much output #118

andimik opened this issue Sep 16, 2024 · 1 comment
Labels
unusual encoder Encoder implementation has some unique interpretation of RDS

Comments

@andimik
Copy link
Contributor

andimik commented Sep 16, 2024

I wonder, why the json output prints too much data, although it is NOT repeated in the RDS data.

The attached example is quite short (841 bytes), but json will print the radiotext 4x

$ redsea -E -i hex < /tmp/austria.txt | grep Super
{"pi":"0xA3E0","bler":0,"group":"2A","tp":true,"prog_type":"Pop music","radiotext":"Superstars & Superhits"}
{"pi":"0xA3E0","bler":0,"group":"2A","tp":true,"prog_type":"Pop music","radiotext":"Superstars & Superhits"}
{"pi":"0xA3E0","bler":0,"group":"2A","tp":true,"prog_type":"Pop music","radiotext":"Superstars & Superhits"}
{"pi":"0xA3E0","bler":0,"group":"2A","tp":true,"prog_type":"Pop music","radiotext":"Superstars & Superhits"}

although it is transmitted only once.

Superstars & Superhits in hex is 53 75 70 65 72 73 74 61 72 73 20 26 61 6D 70 3B 20 53 75 70 65 72 68 69 74 73

which is only transmitted in these lines:

$ cat /tmp/austria.txt | grep 255
A3E0 255B 2020 2020
A3E0 255C 2020 2020
A3E0 255D 2020 2020
A3E0 255E 2020 2020
A3E0 255F 2020 2020
A3E0 2550 5375 7065
A3E0 2551 7273 7461
A3E0 2552 7273 2026
A3E0 2553 2053 7570
A3E0 2554 6572 6869
A3E0 2555 7473 0D20
A3E0 2556 2020 2020
A3E0 2557 2020 2020
A3E0 2558 2020 2020

(remark: in the example 0x2559 and 0x255A are missing but will be ignored because of the 0D value in 0x2555)

So I propose that redsea only prints valued that are received. This also will lead to better readable output.

austria.txt

@windytan
Copy link
Owner

Thanks for the report! You were wondering why: It's because the station sends end-of-string character 0D but keeps adding more 'invisible' characaters to the string nevertheless. I'm sure a workaround can be invented for this corner case, along with a nice little unit test, one day.

windytan added a commit that referenced this issue Dec 28, 2024
Add a separate test case for still-failing RadioText corner cases (#118).
@windytan windytan added the unusual encoder Encoder implementation has some unique interpretation of RDS label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unusual encoder Encoder implementation has some unique interpretation of RDS
Projects
None yet
Development

No branches or pull requests

2 participants