restrict IF to 2170-2740 MHz
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 238 KiB After Width: | Height: | Size: 237 KiB |
@ -14,7 +14,7 @@
|
|||||||
id="svg8"
|
id="svg8"
|
||||||
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
|
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
|
||||||
sodipodi:docname="block-diagram.svg"
|
sodipodi:docname="block-diagram.svg"
|
||||||
inkscape:export-filename="C:\Users\Martin\Documents\hackrf\docs\images\block-diagram.png"
|
inkscape:export-filename="block-diagram.png"
|
||||||
inkscape:export-xdpi="96"
|
inkscape:export-xdpi="96"
|
||||||
inkscape:export-ydpi="96">
|
inkscape:export-ydpi="96">
|
||||||
<defs
|
<defs
|
||||||
@ -1837,7 +1837,7 @@
|
|||||||
id="tspan3054"
|
id="tspan3054"
|
||||||
x="207.43335"
|
x="207.43335"
|
||||||
y="99.483337"
|
y="99.483337"
|
||||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';stroke-width:0.264583">2150–2750 MHz</tspan></text>
|
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';stroke-width:0.264583">2170–2740 MHz</tspan></text>
|
||||||
<text
|
<text
|
||||||
xml:space="preserve"
|
xml:space="preserve"
|
||||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';text-align:center;text-anchor:middle;stroke-width:0.264583"
|
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';text-align:center;text-anchor:middle;stroke-width:0.264583"
|
||||||
@ -2845,17 +2845,17 @@
|
|||||||
x="16.933332"
|
x="16.933332"
|
||||||
y="177.39795"
|
y="177.39795"
|
||||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:2.64583px;line-height:1.1;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';stroke-width:0.264583"
|
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:2.64583px;line-height:1.1;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';stroke-width:0.264583"
|
||||||
id="tspan810">1–2150 MHz: 5–15 dBm</tspan><tspan
|
id="tspan810">1–2170 MHz: 5–15 dBm</tspan><tspan
|
||||||
sodipodi:role="line"
|
sodipodi:role="line"
|
||||||
x="16.933332"
|
x="16.933332"
|
||||||
y="180.30836"
|
y="180.30836"
|
||||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:2.64583px;line-height:1.1;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';stroke-width:0.264583"
|
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:2.64583px;line-height:1.1;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';stroke-width:0.264583"
|
||||||
id="tspan812">2150–2750 MHz: 13–15 dBm</tspan><tspan
|
id="tspan812">2170–2740 MHz: 13–15 dBm</tspan><tspan
|
||||||
sodipodi:role="line"
|
sodipodi:role="line"
|
||||||
x="16.933332"
|
x="16.933332"
|
||||||
y="183.21878"
|
y="183.21878"
|
||||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:2.64583px;line-height:1.1;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';stroke-width:0.264583"
|
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:2.64583px;line-height:1.1;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';stroke-width:0.264583"
|
||||||
id="tspan816">2750–4000 MHz: 0–5 dBm</tspan><tspan
|
id="tspan816">2740–4000 MHz: 0–5 dBm</tspan><tspan
|
||||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:2.64583px;line-height:1.1;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';stroke-width:0.264583"
|
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:2.64583px;line-height:1.1;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';stroke-width:0.264583"
|
||||||
sodipodi:role="line"
|
sodipodi:role="line"
|
||||||
id="tspan822"
|
id="tspan822"
|
||||||
@ -3603,7 +3603,7 @@
|
|||||||
id="tspan1878"
|
id="tspan1878"
|
||||||
x="226.48334"
|
x="226.48334"
|
||||||
y="147.10834"
|
y="147.10834"
|
||||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';stroke-width:0.264583">> 2750 MHz</tspan></text>
|
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';stroke-width:0.264583">> 2740 MHz</tspan></text>
|
||||||
<text
|
<text
|
||||||
xml:space="preserve"
|
xml:space="preserve"
|
||||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';text-align:center;text-anchor:middle;stroke-width:0.264583"
|
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';text-align:center;text-anchor:middle;stroke-width:0.264583"
|
||||||
@ -3614,7 +3614,7 @@
|
|||||||
id="tspan1882"
|
id="tspan1882"
|
||||||
x="226.48334"
|
x="226.48334"
|
||||||
y="164.04167"
|
y="164.04167"
|
||||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';stroke-width:0.264583">< 2150 MHz</tspan></text>
|
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';stroke-width:0.264583">< 2170 MHz</tspan></text>
|
||||||
<path
|
<path
|
||||||
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.529167;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000;stop-opacity:1"
|
style="opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.529167;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000;stop-opacity:1"
|
||||||
d="m 247.65003,118.53335 27.51665,-1e-5"
|
d="m 247.65003,118.53335 27.51665,-1e-5"
|
||||||
@ -4255,7 +4255,7 @@
|
|||||||
x="129.11667"
|
x="129.11667"
|
||||||
y="134.40834"
|
y="134.40834"
|
||||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';text-align:start;text-anchor:start;stroke-width:0.264583"
|
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:4.23333px;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';text-align:start;text-anchor:start;stroke-width:0.264583"
|
||||||
id="tspan1553">Diagram Revision: A</tspan><tspan
|
id="tspan1553">Diagram Revision: B</tspan><tspan
|
||||||
sodipodi:role="line"
|
sodipodi:role="line"
|
||||||
x="129.11667"
|
x="129.11667"
|
||||||
y="138.29544"
|
y="138.29544"
|
||||||
|
Before Width: | Height: | Size: 263 KiB After Width: | Height: | Size: 263 KiB |
@ -11,12 +11,12 @@ What is the Transmit Power of HackRF?
|
|||||||
HackRF One's absolute maximum TX power varies by operating frequency:
|
HackRF One's absolute maximum TX power varies by operating frequency:
|
||||||
|
|
||||||
* 1 MHz to 10 MHz: 5 dBm to 15 dBm, generally increasing as frequency increases (see this `blog post <https://greatscottgadgets.com/2015/05-15-hackrf-one-at-1-mhz/>`__)
|
* 1 MHz to 10 MHz: 5 dBm to 15 dBm, generally increasing as frequency increases (see this `blog post <https://greatscottgadgets.com/2015/05-15-hackrf-one-at-1-mhz/>`__)
|
||||||
* 10 MHz to 2150 MHz: 5 dBm to 15 dBm, generally decreasing as frequency increases
|
* 10 MHz to 2170 MHz: 5 dBm to 15 dBm, generally decreasing as frequency increases
|
||||||
* 2150 MHz to 2750 MHz: 13 dBm to 15 dBm
|
* 2170 MHz to 2740 MHz: 13 dBm to 15 dBm
|
||||||
* 2750 MHz to 4000 MHz: 0 dBm to 5 dBm, decreasing as frequency increases
|
* 2740 MHz to 4000 MHz: 0 dBm to 5 dBm, decreasing as frequency increases
|
||||||
* 4000 MHz to 6000 MHz: -10 dBm to 0 dBm, generally decreasing as frequency increases
|
* 4000 MHz to 6000 MHz: -10 dBm to 0 dBm, generally decreasing as frequency increases
|
||||||
|
|
||||||
Through most of the frequency range up to 4 GHz, the maximum TX power is between 0 and 10 dBm. The frequency range with best performance is 2150 MHz to 2750 MHz.
|
Through most of the frequency range up to 4 GHz, the maximum TX power is between 0 and 10 dBm. The frequency range with best performance is 2170 MHz to 2740 MHz.
|
||||||
|
|
||||||
Overall, the output power is enough to perform over-the-air experiments at close range or to drive an external amplifier. If you connect an external amplifier, you should also use an external bandpass filter for your operating frequency.
|
Overall, the output power is enough to perform over-the-air experiments at close range or to drive an external amplifier. If you connect an external amplifier, you should also use an external bandpass filter for your operating frequency.
|
||||||
|
|
||||||
|
@ -31,20 +31,22 @@
|
|||||||
#include <sgpio.h>
|
#include <sgpio.h>
|
||||||
#include <operacake.h>
|
#include <operacake.h>
|
||||||
|
|
||||||
#define FREQ_ONE_MHZ (1000 * 1000)
|
#define FREQ_ONE_MHZ (1000ULL * 1000)
|
||||||
|
|
||||||
#define MIN_LP_FREQ_MHZ (0)
|
#define MIN_LP_FREQ_MHZ (0)
|
||||||
#define MAX_LP_FREQ_MHZ (2150)
|
#define MAX_LP_FREQ_MHZ (2170ULL)
|
||||||
|
|
||||||
#define MIN_BYPASS_FREQ_MHZ (2150)
|
#define ABS_MIN_BYPASS_FREQ_MHZ (2150ULL)
|
||||||
#define MAX_BYPASS_FREQ_MHZ (2750)
|
#define MIN_BYPASS_FREQ_MHZ (MAX_LP_FREQ_MHZ)
|
||||||
|
#define MAX_BYPASS_FREQ_MHZ (2740ULL)
|
||||||
|
#define ABS_MAX_BYPASS_FREQ_MHZ (2750ULL)
|
||||||
|
|
||||||
#define MIN_HP_FREQ_MHZ (2750)
|
#define MIN_HP_FREQ_MHZ (MAX_BYPASS_FREQ_MHZ)
|
||||||
#define MID1_HP_FREQ_MHZ (3600)
|
#define MID1_HP_FREQ_MHZ (3600ULL)
|
||||||
#define MID2_HP_FREQ_MHZ (5100)
|
#define MID2_HP_FREQ_MHZ (5100ULL)
|
||||||
#define MAX_HP_FREQ_MHZ (7250)
|
#define MAX_HP_FREQ_MHZ (7250ULL)
|
||||||
|
|
||||||
#define MIN_LO_FREQ_HZ (84375000)
|
#define MIN_LO_FREQ_HZ (84375000ULL)
|
||||||
#define MAX_LO_FREQ_HZ (5400000000ULL)
|
#define MAX_LO_FREQ_HZ (5400000000ULL)
|
||||||
|
|
||||||
static uint32_t max2837_freq_nominal_hz = 2560000000;
|
static uint32_t max2837_freq_nominal_hz = 2560000000;
|
||||||
@ -63,8 +65,8 @@ bool set_freq(const uint64_t freq)
|
|||||||
uint32_t MAX2837_freq_hz;
|
uint32_t MAX2837_freq_hz;
|
||||||
uint64_t real_mixer_freq_hz;
|
uint64_t real_mixer_freq_hz;
|
||||||
|
|
||||||
const uint32_t freq_mhz = freq / 1000000;
|
const uint32_t freq_mhz = freq / FREQ_ONE_MHZ;
|
||||||
const uint32_t freq_hz = freq % 1000000;
|
const uint32_t freq_hz = freq % FREQ_ONE_MHZ;
|
||||||
|
|
||||||
success = true;
|
success = true;
|
||||||
|
|
||||||
@ -73,10 +75,10 @@ bool set_freq(const uint64_t freq)
|
|||||||
if (freq_mhz < MAX_LP_FREQ_MHZ) {
|
if (freq_mhz < MAX_LP_FREQ_MHZ) {
|
||||||
rf_path_set_filter(&rf_path, RF_PATH_FILTER_LOW_PASS);
|
rf_path_set_filter(&rf_path, RF_PATH_FILTER_LOW_PASS);
|
||||||
#ifdef RAD1O
|
#ifdef RAD1O
|
||||||
max2837_freq_nominal_hz = 2300000000;
|
max2837_freq_nominal_hz = 2300 * FREQ_ONE_MHZ;
|
||||||
#else
|
#else
|
||||||
/* IF is graduated from 2650 MHz to 2343 MHz */
|
/* IF is graduated from 2650 MHz to 2340 MHz */
|
||||||
max2837_freq_nominal_hz = 2650000000 - (freq / 7);
|
max2837_freq_nominal_hz = (2650 * FREQ_ONE_MHZ) - (freq / 7);
|
||||||
#endif
|
#endif
|
||||||
mixer_freq_mhz = (max2837_freq_nominal_hz / FREQ_ONE_MHZ) + freq_mhz;
|
mixer_freq_mhz = (max2837_freq_nominal_hz / FREQ_ONE_MHZ) + freq_mhz;
|
||||||
/* Set Freq and read real freq */
|
/* Set Freq and read real freq */
|
||||||
@ -91,15 +93,18 @@ bool set_freq(const uint64_t freq)
|
|||||||
sgpio_cpld_stream_rx_set_q_invert(&sgpio_config, 0);
|
sgpio_cpld_stream_rx_set_q_invert(&sgpio_config, 0);
|
||||||
} else if ((freq_mhz >= MIN_HP_FREQ_MHZ) && (freq_mhz <= MAX_HP_FREQ_MHZ)) {
|
} else if ((freq_mhz >= MIN_HP_FREQ_MHZ) && (freq_mhz <= MAX_HP_FREQ_MHZ)) {
|
||||||
if (freq_mhz < MID1_HP_FREQ_MHZ) {
|
if (freq_mhz < MID1_HP_FREQ_MHZ) {
|
||||||
/* IF is graduated from 2150 MHz to 2750 MHz */
|
/* IF is graduated from 2170 MHz to 2740 MHz */
|
||||||
max2837_freq_nominal_hz =
|
max2837_freq_nominal_hz = (MIN_BYPASS_FREQ_MHZ * FREQ_ONE_MHZ) +
|
||||||
2150000000 + (((freq - 2750000000) * 60) / 85);
|
(((freq - (MAX_BYPASS_FREQ_MHZ * FREQ_ONE_MHZ)) * 57) /
|
||||||
|
86);
|
||||||
} else if (freq_mhz < MID2_HP_FREQ_MHZ) {
|
} else if (freq_mhz < MID2_HP_FREQ_MHZ) {
|
||||||
/* IF is graduated from 2350 MHz to 2650 MHz */
|
/* IF is graduated from 2350 MHz to 2650 MHz */
|
||||||
max2837_freq_nominal_hz = 2350000000 + ((freq - 3600000000) / 5);
|
max2837_freq_nominal_hz = (2350 * FREQ_ONE_MHZ) +
|
||||||
|
((freq - (MID1_HP_FREQ_MHZ * FREQ_ONE_MHZ)) / 5);
|
||||||
} else {
|
} else {
|
||||||
/* IF is graduated from 2500 MHz to 2738 MHz */
|
/* IF is graduated from 2500 MHz to 2738 MHz */
|
||||||
max2837_freq_nominal_hz = 2500000000 + ((freq - 5100000000) / 9);
|
max2837_freq_nominal_hz = (2500 * FREQ_ONE_MHZ) +
|
||||||
|
((freq - (MID2_HP_FREQ_MHZ * FREQ_ONE_MHZ)) / 9);
|
||||||
}
|
}
|
||||||
rf_path_set_filter(&rf_path, RF_PATH_FILTER_HIGH_PASS);
|
rf_path_set_filter(&rf_path, RF_PATH_FILTER_HIGH_PASS);
|
||||||
mixer_freq_mhz = freq_mhz - (max2837_freq_nominal_hz / FREQ_ONE_MHZ);
|
mixer_freq_mhz = freq_mhz - (max2837_freq_nominal_hz / FREQ_ONE_MHZ);
|
||||||
@ -127,8 +132,8 @@ bool set_freq_explicit(
|
|||||||
const uint64_t lo_freq_hz,
|
const uint64_t lo_freq_hz,
|
||||||
const rf_path_filter_t path)
|
const rf_path_filter_t path)
|
||||||
{
|
{
|
||||||
if ((if_freq_hz < ((uint64_t) MIN_BYPASS_FREQ_MHZ * FREQ_ONE_MHZ)) ||
|
if ((if_freq_hz < ((uint64_t) ABS_MIN_BYPASS_FREQ_MHZ * FREQ_ONE_MHZ)) ||
|
||||||
(if_freq_hz > ((uint64_t) MAX_BYPASS_FREQ_MHZ * FREQ_ONE_MHZ))) {
|
(if_freq_hz > ((uint64_t) ABS_MAX_BYPASS_FREQ_MHZ * FREQ_ONE_MHZ))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,8 +94,10 @@ int gettimeofday(struct timeval* tv, void* ignored)
|
|||||||
#define FREQ_MIN_HZ (1000000ll) /* 1MHz */
|
#define FREQ_MIN_HZ (1000000ll) /* 1MHz */
|
||||||
#define FREQ_MAX_HZ (6000000000ll) /* 6000MHz */
|
#define FREQ_MAX_HZ (6000000000ll) /* 6000MHz */
|
||||||
#define FREQ_ABS_MAX_HZ (7250000000ll) /* 7250MHz */
|
#define FREQ_ABS_MAX_HZ (7250000000ll) /* 7250MHz */
|
||||||
#define IF_MIN_HZ (2150000000ll)
|
#define IF_ABS_MIN_HZ (2150000000ll)
|
||||||
#define IF_MAX_HZ (2750000000ll)
|
#define IF_MIN_HZ (2170000000ll)
|
||||||
|
#define IF_MAX_HZ (2740000000ll)
|
||||||
|
#define IF_ABS_MAX_HZ (2750000000ll)
|
||||||
#define LO_MIN_HZ (84375000ll)
|
#define LO_MIN_HZ (84375000ll)
|
||||||
#define LO_MAX_HZ (5400000000ll)
|
#define LO_MAX_HZ (5400000000ll)
|
||||||
#define DEFAULT_LO_HZ (1000000000ll)
|
#define DEFAULT_LO_HZ (1000000000ll)
|
||||||
@ -664,9 +666,11 @@ static void usage()
|
|||||||
u64toa((FREQ_MAX_HZ / FREQ_ONE_MHZ), &ascii_u64_data[1]),
|
u64toa((FREQ_MAX_HZ / FREQ_ONE_MHZ), &ascii_u64_data[1]),
|
||||||
u64toa((FREQ_ABS_MIN_HZ / FREQ_ONE_MHZ), &ascii_u64_data[2]),
|
u64toa((FREQ_ABS_MIN_HZ / FREQ_ONE_MHZ), &ascii_u64_data[2]),
|
||||||
u64toa((FREQ_ABS_MAX_HZ / FREQ_ONE_MHZ), &ascii_u64_data[3]));
|
u64toa((FREQ_ABS_MAX_HZ / FREQ_ONE_MHZ), &ascii_u64_data[3]));
|
||||||
printf("\t[-i if_freq_hz] # Intermediate Frequency (IF) in Hz [%sMHz to %sMHz].\n",
|
printf("\t[-i if_freq_hz] # Intermediate Frequency (IF) in Hz [%sMHz to %sMHz supported, %sMHz to %sMHz forceable].\n",
|
||||||
u64toa((IF_MIN_HZ / FREQ_ONE_MHZ), &ascii_u64_data[0]),
|
u64toa((IF_MIN_HZ / FREQ_ONE_MHZ), &ascii_u64_data[0]),
|
||||||
u64toa((IF_MAX_HZ / FREQ_ONE_MHZ), &ascii_u64_data[1]));
|
u64toa((IF_MAX_HZ / FREQ_ONE_MHZ), &ascii_u64_data[1]),
|
||||||
|
u64toa((IF_ABS_MIN_HZ / FREQ_ONE_MHZ), &ascii_u64_data[2]),
|
||||||
|
u64toa((IF_ABS_MAX_HZ / FREQ_ONE_MHZ), &ascii_u64_data[3]));
|
||||||
printf("\t[-o lo_freq_hz] # Front-end Local Oscillator (LO) frequency in Hz [%sMHz to %sMHz].\n",
|
printf("\t[-o lo_freq_hz] # Front-end Local Oscillator (LO) frequency in Hz [%sMHz to %sMHz].\n",
|
||||||
u64toa((LO_MIN_HZ / FREQ_ONE_MHZ), &ascii_u64_data[0]),
|
u64toa((LO_MIN_HZ / FREQ_ONE_MHZ), &ascii_u64_data[0]),
|
||||||
u64toa((LO_MAX_HZ / FREQ_ONE_MHZ), &ascii_u64_data[1]));
|
u64toa((LO_MAX_HZ / FREQ_ONE_MHZ), &ascii_u64_data[1]));
|
||||||
@ -920,14 +924,23 @@ int main(int argc, char** argv)
|
|||||||
usage();
|
usage();
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
if ((if_freq_hz > IF_MAX_HZ) || (if_freq_hz < IF_MIN_HZ)) {
|
if (((if_freq_hz > IF_MAX_HZ) || (if_freq_hz < IF_MIN_HZ)) &&
|
||||||
|
!force_ranges) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"argument error: if_freq_hz shall be between %s and %s.\n",
|
"argument error: if_freq_hz should be between %s and %s.\n",
|
||||||
u64toa(IF_MIN_HZ, &ascii_u64_data[0]),
|
u64toa(IF_MIN_HZ, &ascii_u64_data[0]),
|
||||||
u64toa(IF_MAX_HZ, &ascii_u64_data[1]));
|
u64toa(IF_MAX_HZ, &ascii_u64_data[1]));
|
||||||
usage();
|
usage();
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
if ((if_freq_hz > IF_ABS_MAX_HZ) || (if_freq_hz < IF_ABS_MIN_HZ)) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"argument error: if_freq_hz must be between %s and %s.\n",
|
||||||
|
u64toa(IF_ABS_MIN_HZ, &ascii_u64_data[0]),
|
||||||
|
u64toa(IF_ABS_MAX_HZ, &ascii_u64_data[1]));
|
||||||
|
usage();
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
if ((lo_freq_hz > LO_MAX_HZ) || (lo_freq_hz < LO_MIN_HZ)) {
|
if ((lo_freq_hz > LO_MAX_HZ) || (lo_freq_hz < LO_MIN_HZ)) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"argument error: lo_freq_hz shall be between %s and %s.\n",
|
"argument error: lo_freq_hz shall be between %s and %s.\n",
|
||||||
@ -966,7 +979,7 @@ int main(int argc, char** argv)
|
|||||||
u64toa(freq_hz, &ascii_u64_data[0]));
|
u64toa(freq_hz, &ascii_u64_data[0]));
|
||||||
|
|
||||||
} else if (automatic_tuning) {
|
} else if (automatic_tuning) {
|
||||||
if (((freq_hz > FREQ_MAX_HZ) | (freq_hz < FREQ_MIN_HZ)) &&
|
if (((freq_hz > FREQ_MAX_HZ) || (freq_hz < FREQ_MIN_HZ)) &&
|
||||||
!force_ranges) {
|
!force_ranges) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"argument error: freq_hz should be between %s and %s.\n",
|
"argument error: freq_hz should be between %s and %s.\n",
|
||||||
|
@ -1456,6 +1456,13 @@ int ADDCALL hackrf_set_freq_explicit(
|
|||||||
uint8_t length;
|
uint8_t length;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Restriction to the range 2170-2740 MHz is strongly recommended for
|
||||||
|
* HackRF One and Jawbreaker. We permit IF as low as 2150 MHz and as
|
||||||
|
* high as 2750 MHz for backwards compatibility and for
|
||||||
|
* experimentation, but settings outside the recommended range may not
|
||||||
|
* work on all devices.
|
||||||
|
*/
|
||||||
if (if_freq_hz < 2150000000 || if_freq_hz > 2750000000) {
|
if (if_freq_hz < 2150000000 || if_freq_hz > 2750000000) {
|
||||||
return HACKRF_ERROR_INVALID_PARAM;
|
return HACKRF_ERROR_INVALID_PARAM;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user