JvanKatwijk / eti-stuff

experimental software for creating and interpreting eti frames
GNU General Public License v2.0
21 stars 12 forks source link

valid channel name check #54

Closed andimik closed 2 years ago

andimik commented 2 years ago

Before

If the optarg for -C is any other string than declared (like "text" in the sample below), the program assigns the value for 5A (which is the first entry in the list to be found in band-handler.cpp) instead of producing an error or set it to 0.

$ eti-cmdline-rtlsdr -Q -C text
tunedFrequency =  174928000

After

Now it's clear for the user, that his syntax was wrong (as the frequency got 0)

$ ./eti-cmdline-rtlsdr -Q -C text
tunedFrequency =  0

or illegal channel number

$ ./eti-cmdline-rtlsdr -Q -C 5E
tunedFrequency =  0
JvanKatwijk commented 2 years ago

Good point, but would not it be better to have the channel handler return an error code? Now the attached device gets the request to tune to frequency 0

Op ma 13 jun. 2022 om 22:04 schreef andimik @.***>:

Before

If the optarg for -C is any other string than declared (like "text" in the sample below), the program assigns the value for 5A (which is the first entry in the list to be found in band-handler.cpp) instead of producing an error or set it to 0.

$ eti-cmdline-rtlsdr -Q -C text tunedFrequency = 174928000

After

Now it's clear for the user, that his syntax was wrong (as the frequency got 0)

$ ./eti-cmdline-rtlsdr -Q -C text tunedFrequency = 0

or illegal channel number

$ ./eti-cmdline-rtlsdr -Q -C 5E tunedFrequency = 0


You can view, comment on, or merge this pull request online at:

https://github.com/JvanKatwijk/eti-stuff/pull/54 Commit Summary

File Changes

(1 file https://github.com/JvanKatwijk/eti-stuff/pull/54/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/JvanKatwijk/eti-stuff/pull/54, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCPHQBDYCANM3MSEN2NTJDVO6H3LANCNFSM5YVLG4HA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Jan van Katwijk