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

Add stop for exceeding maximum frequency separation #21

Closed
E3V3A opened this issue Jul 5, 2017 · 2 comments
Closed

Add stop for exceeding maximum frequency separation #21

E3V3A opened this issue Jul 5, 2017 · 2 comments

Comments

@E3V3A
Copy link

E3V3A commented Jul 5, 2017

Since the RTL-SDR cannot fetch more than 2 MHz bandwidth, the frequencies provided in the list may not be separated by more than this. However, the binary happily accepts anything, and continues execution with unknown consequences.

I propose to implement a stop for this.

@E3V3A E3V3A changed the title Add automatic test for maximum provided frequency separation Add stop for exceeding maximum frequency separation Jul 5, 2017
@E3V3A
Copy link
Author

E3V3A commented Jul 23, 2017

Rewrite this:

if ((Fd[nbch - 1] - Fd[0]) > RTLINRATE - 4 * INTRATE) {
		fprintf(stderr, "Frequencies too far apart\n");
		return -1;
}

To:

if ((Fd[nbch - 1] - Fd[0]) > RTLINRATE - 4 * INTRATE) {
		fprintf(stderr, "ERROR: Frequencies are too far apart: df=%.2f MHz\n", (float)(Fd[nbch - 1] - Fd[0]));
		exit(1);
}

PS. I compiled this in my head, so I haven't tested it...

This also fixes issue (2) in #20.

@TLeconte
Copy link
Owner

TLeconte commented Aug 5, 2017

Ok thanks fix it by just returning 0 in ChooseFc (returning -1 is not a good idea for an unsigned int return function)

@TLeconte TLeconte closed this as completed Aug 5, 2017
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

No branches or pull requests

2 participants