Debian Codegraph @

libairspyhf/src/airspyhf.c

raw symbols ◀ ▶ SCIP
23 Debian patches touch this file
•1 /*
2 Copyright (c) 2013-2023, Youssef Touil <[email protected]>
3 Copyright (c) 2013-2017, Ian Gilmour <[email protected]>
4 Copyright (c) 2013-2017, Benjamin Vernoux <[email protected]>
5 Copyright (c) 2013, Michael Ossmann <[email protected]>
6 Copyright (c) 2012, Jared Boone <[email protected]>
7
8 All rights reserved.
9
10 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
11
12 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
13 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15 Neither the name of Airspy HF+ nor the names of its contributors may be used to endorse or promote products derived from this software
16 without specific prior written permission.
17
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
19 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26 #ifdef _WIN32
27 #define HAVE_STRUCT_TIMESPEC
28 #define _CRT_SECURE_NO_WARNINGS
29 #endif
30
31 #include <stdio.h>
32 #include <stdlib.h>
33 #include <string.h>
34 #include <libusb.h>
35 #include <pthread.h>
36 #include <math.h>
37
38 #include "iqbalancer.h"cxx . . $ `<file>/libairspyhf/src/iqbalancer.h`/
39 #include "airspyhf.h"cxx . . $ `<file>/libairspyhf/src/airspyhf.h`/
40 #include "airspyhf_commands.h"cxx . . $ `<file>/libairspyhf/src/airspyhf_commands.h`/
41
42 #ifndef bool
43 typedef int boolcxx . . $ bool#;
44 #define truecxx . . $ `libairspyhf/src/airspyhf.c:44:9`! 1
45 #define falsecxx . . $ `libairspyhf/src/airspyhf.c:45:9`! 0
46 #endif
47
48 #ifndef M_PIcxx . . $ `<external>/11263917310783833665/math.h:1121:10`!
49 #define M_PI (3.14159265359)
50 #endif
51
52 #define MAXcxx . . $ `libairspyhf/src/airspyhf.c:52:9`!(a,b) ((a) > (b) ? a : b)
53 #define MINcxx . . $ `libairspyhf/src/airspyhf.c:53:9`!(a,b) ((a) < (b) ? a : b)
54
•55 #define SAMPLES_TO_TRANSFERcxx . . $ `libairspyhf/src/airspyhf.c:55:9`! (1024 * 4)
56 #define SERIAL_NUMBER_UNUSEDcxx . . $ `libairspyhf/src/airspyhf.c:56:9`! (0)
•57 #define FILE_DESCRIPTOR_UNUSEDcxx . . $ `libairspyhf/src/airspyhf.c:57:9`! (-1)
58 #define RAW_BUFFER_COUNTcxx . . $ `libairspyhf/src/airspyhf.c:58:9`! (8)
59 #define AIRSPYHF_SERIAL_SIZEcxx . . $ `libairspyhf/src/airspyhf.c:59:9`! (28)
60
61 #define MAX_SAMPLERATE_INDEXcxx . . $ `libairspyhf/src/airspyhf.c:61:9`! (100)
62 #define DEFAULT_SAMPLERATEcxx . . $ `libairspyhf/src/airspyhf.c:62:9`! (768000)
63
64 #define DEFAULT_ATT_STEP_COUNTcxx . . $ `libairspyhf/src/airspyhf.c:64:9`! (9)
65 #define DEFAULT_ATT_STEP_INCREMENTcxx . . $ `libairspyhf/src/airspyhf.c:65:9`! (6.0f)
66
67 #define CALIBRATION_MAGICcxx . . $ `libairspyhf/src/airspyhf.c:67:9`! (0xA5CA71B0)
68
69 #define DEFAULT_IF_SHIFTcxx . . $ `libairspyhf/src/airspyhf.c:69:9`! (5000)
70 #define MIN_ZERO_IF_LOcxx . . $ `libairspyhf/src/airspyhf.c:70:9`! (180)
71 #define MIN_LOW_IF_LOcxx . . $ `libairspyhf/src/airspyhf.c:71:9`! (84)
72
73 #define STR_PREFIX_SERIAL_AIRSPYHF_SIZEcxx . . $ `libairspyhf/src/airspyhf.c:73:9`! (12)
74 static const char str_prefix_serial_airspyhfcxx . . $ str_prefix_serial_airspyhf.[STR_PREFIX_SERIAL_AIRSPYHF_SIZEcxx . . $ `libairspyhf/src/airspyhf.c:73:9`!] =
75 { 'A', 'I', 'R', 'S', 'P', 'Y', 'H', 'F', ' ', 'S', 'N', ':' };
76
77 #define INITIAL_PHASEcxx . . $ `libairspyhf/src/airspyhf.c:77:9`! (0.00006f)
78 #define INITIAL_AMPLITUDEcxx . . $ `libairspyhf/src/airspyhf.c:78:9`! (-0.0045f)
79
80 #define LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`! (500)
81
•82 #pragma pack(push,1)
83
84 typedef structcxx . . $ $anonymous_type_cdf340db482188bb_0# {
85 int16_tcxx . . $ int16_t# imcxx . . $ $anonymous_type_cdf340db482188bb_0#im.;
86 int16_tcxx . . $ int16_t# recxx . . $ $anonymous_type_cdf340db482188bb_0#re.;
87 } airspyhf_complex_int16_tcxx . . $ airspyhf_complex_int16_t#;
88
89 #pragma pack(pop)
90
91 typedef struct airspyhf_devicecxx . . $ airspyhf_device#
92 {
93 libusb_contextcxx . . $ libusb_context#* usb_contextcxx . . $ airspyhf_device#usb_context.;
94 libusb_device_handlecxx . . $ libusb_device_handle#* usb_devicecxx . . $ airspyhf_device#usb_device.;
95 struct libusb_transfercxx . . $ libusb_transfer#** transferscxx . . $ airspyhf_device#transfers.;
96 airspyhf_sample_block_cb_fncxx . . $ airspyhf_sample_block_cb_fn# callbackcxx . . $ airspyhf_device#callback.;
97 pthread_tcxx . . $ pthread_t# transfer_threadcxx . . $ airspyhf_device#transfer_thread.;
98 pthread_tcxx . . $ pthread_t# consumer_threadcxx . . $ airspyhf_device#consumer_thread.;
99 boolcxx . . $ bool# transfer_thread_runningcxx . . $ airspyhf_device#transfer_thread_running.;
•100 boolcxx . . $ bool# consumer_thread_runningcxx . . $ airspyhf_device#consumer_thread_running.;
101 pthread_cond_tcxx . . $ pthread_cond_t# consumer_cvcxx . . $ airspyhf_device#consumer_cv.;
•102 pthread_mutex_tcxx . . $ pthread_mutex_t# consumer_mpcxx . . $ airspyhf_device#consumer_mp.;
103 uint32_tcxx . . $ uint32_t# supported_samplerate_countcxx . . $ airspyhf_device#supported_samplerate_count.;
104 uint32_tcxx . . $ uint32_t# *supported_sampleratescxx . . $ airspyhf_device#supported_samplerates.;
•105 uint8_tcxx . . $ uint8_t# *samplerate_architecturescxx . . $ airspyhf_device#samplerate_architectures.;
106 uint32_tcxx . . $ uint32_t# supported_att_step_countcxx . . $ airspyhf_device#supported_att_step_count.;
107 float *supported_att_stepscxx . . $ airspyhf_device#supported_att_steps.;
108 volatile uint32_tcxx . . $ uint32_t# current_sampleratecxx . . $ airspyhf_device#current_samplerate.;
109 volatile double freq_hzcxx . . $ airspyhf_device#freq_hz.;
110 volatile uint32_tcxx . . $ uint32_t# freq_khzcxx . . $ airspyhf_device#freq_khz.;
111 volatile double freq_delta_hzcxx . . $ airspyhf_device#freq_delta_hz.;
112 volatile double freq_shiftcxx . . $ airspyhf_device#freq_shift.;
•113 volatile int32_tcxx . . $ int32_t# calibration_ppbcxx . . $ airspyhf_device#calibration_ppb.;
114 volatile int32_tcxx . . $ int32_t# calibration_vctcxocxx . . $ airspyhf_device#calibration_vctcxo.;
115 volatile uint32_tcxx . . $ uint32_t# frontend_optionscxx . . $ airspyhf_device#frontend_options.;
116 volatile float optimal_pointcxx . . $ airspyhf_device#optimal_point.;
117 uint8_tcxx . . $ uint8_t# enable_dspcxx . . $ airspyhf_device#enable_dsp.;
118 uint8_tcxx . . $ uint8_t# is_low_ifcxx . . $ airspyhf_device#is_low_if.;
119 float filter_gaincxx . . $ airspyhf_device#filter_gain.;
120 airspyhf_complex_float_tcxx . . $ airspyhf_complex_float_t# veccxx . . $ airspyhf_device#vec.;
121 struct iq_balancer_tcxx . . $ iq_balancer_t# *iq_balancercxx . . $ airspyhf_device#iq_balancer.;
•122 uint32_tcxx . . $ uint32_t# transfer_countcxx . . $ airspyhf_device#transfer_count.;
123 int32_tcxx . . $ int32_t# transfer_livecxx . . $ airspyhf_device#transfer_live.;
124 uint32_tcxx . . $ uint32_t# buffer_sizecxx . . $ airspyhf_device#buffer_size.;
125 uint32_tcxx . . $ uint32_t# dropped_bufferscxx . . $ airspyhf_device#dropped_buffers.;
126 uint32_tcxx . . $ uint32_t# dropped_buffers_queuecxx . . $ airspyhf_device#dropped_buffers_queue.[RAW_BUFFER_COUNTcxx . . $ `libairspyhf/src/airspyhf.c:58:9`!];
127 airspyhf_complex_int16_tcxx . . $ airspyhf_complex_int16_t# *received_samples_queuecxx . . $ airspyhf_device#received_samples_queue.[RAW_BUFFER_COUNTcxx . . $ `libairspyhf/src/airspyhf.c:58:9`!];
128 volatile boolcxx . . $ bool# streamingcxx . . $ airspyhf_device#streaming.;
129 volatile boolcxx . . $ bool# stop_requestedcxx . . $ airspyhf_device#stop_requested.;
130 volatile int received_samples_queue_headcxx . . $ airspyhf_device#received_samples_queue_head.;
•131 volatile int received_samples_queue_tailcxx . . $ airspyhf_device#received_samples_queue_tail.;
132 volatile int received_buffer_countcxx . . $ airspyhf_device#received_buffer_count.;
133 airspyhf_complex_float_tcxx . . $ airspyhf_complex_float_t# *output_buffercxx . . $ airspyhf_device#output_buffer.;
134 void* ctxcxx . . $ airspyhf_device#ctx.;
135 } airspyhf_device_tcxx . . $ airspyhf_device_t#;
136
137 typedef struct flash_configcxx . . $ flash_config#
138 {
139 uint32_tcxx . . $ uint32_t# magic_numbercxx . . $ flash_config#magic_number.;
140 int32_tcxx . . $ int32_t# calibration_ppbcxx . . $ flash_config#calibration_ppb.;
141 int32_tcxx . . $ int32_t# calibration_vctcxocxx . . $ flash_config#calibration_vctcxo.;
•142 uint32_tcxx . . $ uint32_t# frontend_optionscxx . . $ flash_config#frontend_options.;
143 } flash_config_tcxx . . $ flash_config_t#;
144
145 static const uint16_tcxx . . $ uint16_t# airspyhf_usb_vidcxx . . $ airspyhf_usb_vid. = 0x03EB;
146 static const uint16_tcxx . . $ uint16_t# airspyhf_usb_pidcxx . . $ airspyhf_usb_pid. = 0x800C;
147
148 static int airspyhf_config_readcxx . . $ airspyhf_config_read(d19a4bd7451812ec).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, uint8_tcxx . . $ uint8_t# *buffer, uint16_tcxx . . $ uint16_t# length);
149
150 static int cancel_transferscxx . . $ cancel_transfers(8c7809d1dae8c2a1).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device)
151 {
152 uint32_tcxx . . $ uint32_t# transfer_index;
•153 struct timevalcxx . . $ timeval# canceltv = { 0, 50 };
154
155 if (device->transferscxx . . $ airspyhf_device#transfers. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
156 {
157 for (transfer_index = 0; transfer_index<device->transfer_countcxx . . $ airspyhf_device#transfer_count.; transfer_index++)
158 {
159 if (device->transferscxx . . $ airspyhf_device#transfers.[transfer_index] != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
160 {
161 libusb_cancel_transfercxx . . $ libusb_cancel_transfer(d1d6c59b35b7dbb7).(device->transferscxx . . $ airspyhf_device#transfers.[transfer_index]);
162 }
163 }
164
165 for (transfer_index = 0; transfer_index < device->transfer_countcxx . . $ airspyhf_device#transfer_count. && device->transfer_livecxx . . $ airspyhf_device#transfer_live. > 0; transfer_index++)
166 libusb_handle_events_timeout_completedcxx . . $ libusb_handle_events_timeout_completed(168be73805301a0c).(device->usb_contextcxx . . $ airspyhf_device#usb_context., &canceltv, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
167
168 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
169 }
170 else
171 {
172 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
173 }
174 }
175
176 static int free_transferscxx . . $ free_transfers(8c7809d1dae8c2a1).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device)
177 {
178 int i;
179 uint32_tcxx . . $ uint32_t# transfer_index;
180
181 if (device->transferscxx . . $ airspyhf_device#transfers. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
182 {
183 freecxx . . $ free(5d22bdacc48458e8).(device->output_buffercxx . . $ airspyhf_device#output_buffer.);
184 device->output_buffercxx . . $ airspyhf_device#output_buffer. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
185
186 for (transfer_index = 0; transfer_index < device->transfer_countcxx . . $ airspyhf_device#transfer_count.; transfer_index++)
187 {
188 if (device->transferscxx . . $ airspyhf_device#transfers.[transfer_index] != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
189 {
190 freecxx . . $ free(5d22bdacc48458e8).(device->transferscxx . . $ airspyhf_device#transfers.[transfer_index]->buffercxx . . $ libusb_transfer#buffer.);
•191 libusb_free_transfercxx . . $ libusb_free_transfer(6aa7c12d948ffba5).(device->transferscxx . . $ airspyhf_device#transfers.[transfer_index]);
192 device->transferscxx . . $ airspyhf_device#transfers.[transfer_index] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
193 }
194 }
195 freecxx . . $ free(5d22bdacc48458e8).(device->transferscxx . . $ airspyhf_device#transfers.);
196 device->transferscxx . . $ airspyhf_device#transfers. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
197
198 for (i = 0; i < RAW_BUFFER_COUNTcxx . . $ `libairspyhf/src/airspyhf.c:58:9`!; i++)
199 {
200 if (device->received_samples_queuecxx . . $ airspyhf_device#received_samples_queue.[i] != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
201 {
202 freecxx . . $ free(5d22bdacc48458e8).(device->received_samples_queuecxx . . $ airspyhf_device#received_samples_queue.[i]);
203 device->received_samples_queuecxx . . $ airspyhf_device#received_samples_queue.[i] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
204 }
205 }
206 }
207
208 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
209 }
210
211 static int allocate_transferscxx . . $ allocate_transfers(8c7809d1dae8c2a1).(airspyhf_device_tcxx . . $ airspyhf_device_t#* const device)
212 {
213 int i;
214 uint32_tcxx . . $ uint32_t# transfer_index;
215
216 if (device->transferscxx . . $ airspyhf_device#transfers. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
217 {
218 device->output_buffercxx . . $ airspyhf_device#output_buffer. = (airspyhf_complex_float_tcxx . . $ airspyhf_complex_float_t# *) malloccxx . . $ malloc(bfcfa4d6b7f7ef64).((device->buffer_sizecxx . . $ airspyhf_device#buffer_size. / sizeof(airspyhf_complex_int16_tcxx . . $ airspyhf_complex_int16_t#)) * sizeof(airspyhf_complex_float_tcxx . . $ airspyhf_complex_float_t#));
219
220 for (i = 0; i < RAW_BUFFER_COUNTcxx . . $ `libairspyhf/src/airspyhf.c:58:9`!; i++)
221 {
222 device->received_samples_queuecxx . . $ airspyhf_device#received_samples_queue.[i] = (airspyhf_complex_int16_tcxx . . $ airspyhf_complex_int16_t# *) malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(device->buffer_sizecxx . . $ airspyhf_device#buffer_size.);
223 if (device->received_samples_queuecxx . . $ airspyhf_device#received_samples_queue.[i] == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
224 {
225 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
226 }
227
228 memsetcxx . . $ memset(d1de1e4fb215f1c6).(device->received_samples_queuecxx . . $ airspyhf_device#received_samples_queue.[i], 0, device->buffer_sizecxx . . $ airspyhf_device#buffer_size.);
229 }
230
231 device->transferscxx . . $ airspyhf_device#transfers. = (struct libusb_transfercxx . . $ libusb_transfer#**) calloccxx . . $ calloc(63a7bf2941bfcd7a).(device->transfer_countcxx . . $ airspyhf_device#transfer_count., sizeof(struct libusb_transfercxx . . $ libusb_transfer#));
232 if (device->transferscxx . . $ airspyhf_device#transfers. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
233 {
234 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
235 }
236
237 for (transfer_index = 0; transfer_index<device->transfer_countcxx . . $ airspyhf_device#transfer_count.; transfer_index++)
238 {
239 device->transferscxx . . $ airspyhf_device#transfers.[transfer_index] = libusb_alloc_transfercxx . . $ libusb_alloc_transfer(681d497ec4df4030).(0);
240 if (device->transferscxx . . $ airspyhf_device#transfers.[transfer_index] == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
241 {
242 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
243 }
244
245 libusb_fill_bulk_transfercxx . . $ libusb_fill_bulk_transfer(8af723ba29f5478e).(
246 device->transferscxx . . $ airspyhf_device#transfers.[transfer_index],
247 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
248 0,
249 (unsigned char*) malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(device->buffer_sizecxx . . $ airspyhf_device#buffer_size.),
250 device->buffer_sizecxx . . $ airspyhf_device#buffer_size.,
251 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
252 device,
253 0);
254
255 if (device->transferscxx . . $ airspyhf_device#transfers.[transfer_index]->buffercxx . . $ libusb_transfer#buffer. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
256 {
257 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
258 }
259 }
260 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
261 }
262 else
263 {
264 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
265 }
266 }
267
268 static int prepare_transferscxx . . $ prepare_transfers(8a891df5918b1498).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, const uint_fast8_tcxx . . $ uint_fast8_t# endpoint_address, libusb_transfer_cb_fncxx . . $ libusb_transfer_cb_fn# callback)
269 {
270 int error;
271 uint32_tcxx . . $ uint32_t# transfer_index;
272
273 if (device->transferscxx . . $ airspyhf_device#transfers. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
•274 {
275 for (transfer_index = 0; transfer_index<device->transfer_countcxx . . $ airspyhf_device#transfer_count.; transfer_index++)
276 {
277 device->transferscxx . . $ airspyhf_device#transfers.[transfer_index]->endpointcxx . . $ libusb_transfer#endpoint. = endpoint_address;
278 device->transferscxx . . $ airspyhf_device#transfers.[transfer_index]->callbackcxx . . $ libusb_transfer#callback. = callback;
279
280 error = libusb_submit_transfercxx . . $ libusb_submit_transfer(d1d6c59b35b7dbb7).(device->transferscxx . . $ airspyhf_device#transfers.[transfer_index]);
281 if (error != 0)
282 {
283 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
284 }
285 else
286 device->transfer_livecxx . . $ airspyhf_device#transfer_live.++;
287 }
288 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
289 }
290
291 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
292 }
293
294 static void multiply_complex_complexcxx . . $ multiply_complex_complex(2081ca7956a5abae).(airspyhf_complex_float_tcxx . . $ airspyhf_complex_float_t# *a, const airspyhf_complex_float_tcxx . . $ airspyhf_complex_float_t# *b)
295 {
296 float re = a->recxx . . $ $anonymous_type_804d0b7c756f111f_0#re. * b->recxx . . $ $anonymous_type_804d0b7c756f111f_0#re. - a->imcxx . . $ $anonymous_type_804d0b7c756f111f_0#im. * b->imcxx . . $ $anonymous_type_804d0b7c756f111f_0#im.;
297 a->imcxx . . $ $anonymous_type_804d0b7c756f111f_0#im. = a->imcxx . . $ $anonymous_type_804d0b7c756f111f_0#im. * b->recxx . . $ $anonymous_type_804d0b7c756f111f_0#re. + a->recxx . . $ $anonymous_type_804d0b7c756f111f_0#re. * b->imcxx . . $ $anonymous_type_804d0b7c756f111f_0#im.;
298 a->recxx . . $ $anonymous_type_804d0b7c756f111f_0#re. = re;
299 }
300
301 static void multiply_complex_realcxx . . $ multiply_complex_real(a67fa2011cfd6786).(airspyhf_complex_float_tcxx . . $ airspyhf_complex_float_t# *a, const float b)
302 {
303 a->recxx . . $ $anonymous_type_804d0b7c756f111f_0#re. *= b;
304 a->imcxx . . $ $anonymous_type_804d0b7c756f111f_0#im. *= b;
305 }
306
307 static inline void rotate_complexcxx . . $ rotate_complex(2081ca7956a5abae).(airspyhf_complex_float_tcxx . . $ airspyhf_complex_float_t# *vec, const airspyhf_complex_float_tcxx . . $ airspyhf_complex_float_t# *rot)
308 {
309 multiply_complex_complexcxx . . $ multiply_complex_complex(2081ca7956a5abae).(vec, rot);
310
311 float norm = 1.99f - (vec->recxx . . $ $anonymous_type_804d0b7c756f111f_0#re. * vec->recxx . . $ $anonymous_type_804d0b7c756f111f_0#re. + vec->imcxx . . $ $anonymous_type_804d0b7c756f111f_0#im. * vec->imcxx . . $ $anonymous_type_804d0b7c756f111f_0#im.);
312
313 multiply_complex_realcxx . . $ multiply_complex_real(a67fa2011cfd6786).(vec, norm);
314 }
315
316 static void convert_samplescxx . . $ convert_samples(51f28853b5d35486).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, airspyhf_complex_int16_tcxx . . $ airspyhf_complex_int16_t# *src, airspyhf_complex_float_tcxx . . $ airspyhf_complex_float_t# *dest, int count)
317 {
318 const float scale = 1.0f / 32768;
319
320 int i;
321 airspyhf_complex_float_tcxx . . $ airspyhf_complex_float_t# vec;
322 airspyhf_complex_float_tcxx . . $ airspyhf_complex_float_t# rot;
323 double angle;
324 float conversion_gain;
•325
326 conversion_gain = scale * device->filter_gaincxx . . $ airspyhf_device#filter_gain.;
327
328 for (i = 0; i < count; i++)
329 {
330 dest[i].recxx . . $ $anonymous_type_804d0b7c756f111f_0#re. = src[i].recxx . . $ $anonymous_type_cdf340db482188bb_0#re. * conversion_gain;
331 dest[i].imcxx . . $ $anonymous_type_804d0b7c756f111f_0#im. = src[i].imcxx . . $ $anonymous_type_cdf340db482188bb_0#im. * conversion_gain;
332 }
333
•334 if (device->enable_dspcxx . . $ airspyhf_device#enable_dsp.)
335 {
336 if (!device->is_low_ifcxx . . $ airspyhf_device#is_low_if.)
337 {
338 // Zero IF requires external IQ correction
•339 iq_balancer_processcxx . . $ iq_balancer_process(2440d05bc10d5281).(device->iq_balancercxx . . $ airspyhf_device#iq_balancer., dest, count, 0);
340 }
341
342 // Fine tuning
343 if (device->freq_shiftcxx . . $ airspyhf_device#freq_shift. != 0)
344 {
•345 angle = 2.0 * M_PIcxx . . $ `<external>/11263917310783833665/math.h:1121:10`! * device->freq_shiftcxx . . $ airspyhf_device#freq_shift. / (double) device->current_sampleratecxx . . $ airspyhf_device#current_samplerate.;
346
347 vec = device->veccxx . . $ airspyhf_device#vec.;
348
349 rot.recxx . . $ $anonymous_type_804d0b7c756f111f_0#re. = (float) cos(angle);
350 rot.imcxx . . $ $anonymous_type_804d0b7c756f111f_0#im. = (float) -sin(angle);
351
352 for (i = 0; i < count; i++)
353 {
354 rotate_complexcxx . . $ rotate_complex(2081ca7956a5abae).(&vec, &rot);
355 multiply_complex_complexcxx . . $ multiply_complex_complex(2081ca7956a5abae).(&dest[i], &vec);
356 }
357
358 device->veccxx . . $ airspyhf_device#vec. = vec;
359 }
360 }
361 }
362
363 static void* consumer_threadproccxx . . $ consumer_threadproc(9f162e79bfc6c74).(void *arg)
364 {
365 int sample_count;
366 airspyhf_complex_int16_tcxx . . $ airspyhf_complex_int16_t# *input_samples;
367 uint32_tcxx . . $ uint32_t# dropped_buffers;
368 airspyhf_device_tcxx . . $ airspyhf_device_t#* device = (airspyhf_device_tcxx . . $ airspyhf_device_t#*) arg;
369 airspyhf_transfer_tcxx . . $ airspyhf_transfer_t# transfer;
370
371 #ifdef _WIN32
372
•373 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
374
375 #endif
376
377 pthread_mutex_lockcxx . . $ pthread_mutex_lock(d89ae235521888f9).(&device->consumer_mpcxx . . $ airspyhf_device#consumer_mp.);
378
379 while (device->streamingcxx . . $ airspyhf_device#streaming. && !device->stop_requestedcxx . . $ airspyhf_device#stop_requested.)
380 {
381 while (device->received_buffer_countcxx . . $ airspyhf_device#received_buffer_count. == 0 && device->streamingcxx . . $ airspyhf_device#streaming. && !device->stop_requestedcxx . . $ airspyhf_device#stop_requested.)
382 {
383 pthread_cond_waitcxx . . $ pthread_cond_wait(6145be15a5d9db5d).(&device->consumer_cvcxx . . $ airspyhf_device#consumer_cv., &device->consumer_mpcxx . . $ airspyhf_device#consumer_mp.);
384 }
385 if (!device->streamingcxx . . $ airspyhf_device#streaming. || device->stop_requestedcxx . . $ airspyhf_device#stop_requested.)
386 {
387 break;
388 }
389
390 input_samples = (airspyhf_complex_int16_tcxx . . $ airspyhf_complex_int16_t# *) device->received_samples_queuecxx . . $ airspyhf_device#received_samples_queue.[device->received_samples_queue_tailcxx . . $ airspyhf_device#received_samples_queue_tail.];
391 dropped_buffers = device->dropped_buffers_queuecxx . . $ airspyhf_device#dropped_buffers_queue.[device->received_samples_queue_tailcxx . . $ airspyhf_device#received_samples_queue_tail.];
392 device->received_samples_queue_tailcxx . . $ airspyhf_device#received_samples_queue_tail. = (device->received_samples_queue_tailcxx . . $ airspyhf_device#received_samples_queue_tail. + 1) & (RAW_BUFFER_COUNTcxx . . $ `libairspyhf/src/airspyhf.c:58:9`! - 1);
393
394 pthread_mutex_unlockcxx . . $ pthread_mutex_unlock(d89ae235521888f9).(&device->consumer_mpcxx . . $ airspyhf_device#consumer_mp.);
395
396 sample_count = device->buffer_sizecxx . . $ airspyhf_device#buffer_size. / sizeof(airspyhf_complex_int16_tcxx . . $ airspyhf_complex_int16_t#);
397
398 convert_samplescxx . . $ convert_samples(51f28853b5d35486).(device, input_samples, device->output_buffercxx . . $ airspyhf_device#output_buffer., sample_count);
399
400 transfer.devicecxx . . $ $anonymous_type_804d0b7c756f111f_2#device. = device;
401 transfer.ctxcxx . . $ $anonymous_type_804d0b7c756f111f_2#ctx. = device->ctxcxx . . $ airspyhf_device#ctx.;
402 transfer.samplescxx . . $ $anonymous_type_804d0b7c756f111f_2#samples. = device->output_buffercxx . . $ airspyhf_device#output_buffer.;
403 transfer.sample_countcxx . . $ $anonymous_type_804d0b7c756f111f_2#sample_count. = sample_count;
404 transfer.dropped_samplescxx . . $ $anonymous_type_804d0b7c756f111f_2#dropped_samples. = (uint64_tcxx . . $ uint64_t#) dropped_buffers * (uint64_tcxx . . $ uint64_t#) sample_count;
405
406 if (device->callbackcxx . . $ airspyhf_device#callback.(&transfer) != 0)
407 {
408 device->streamingcxx . . $ airspyhf_device#streaming. = falsecxx . . $ `libairspyhf/src/airspyhf.c:45:9`!;
409 }
410
•411 pthread_mutex_lockcxx . . $ pthread_mutex_lock(d89ae235521888f9).(&device->consumer_mpcxx . . $ airspyhf_device#consumer_mp.);
412 device->received_buffer_countcxx . . $ airspyhf_device#received_buffer_count.--;
413 }
414
•415 device->streamingcxx . . $ airspyhf_device#streaming. = falsecxx . . $ `libairspyhf/src/airspyhf.c:45:9`!;
416
417 pthread_mutex_unlockcxx . . $ pthread_mutex_unlock(d89ae235521888f9).(&device->consumer_mpcxx . . $ airspyhf_device#consumer_mp.);
418
419 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
420 }
421
422 static void LIBUSB_CALLcxx . . $ `<external>/8540661316442904143/libusb.h:122:9`! airspyhf_libusb_transfer_callbackcxx . . $ airspyhf_libusb_transfer_callback(6aa7c12d948ffba5).(struct libusb_transfercxx . . $ libusb_transfer#* usb_transfer)
423 {
424 airspyhf_complex_int16_tcxx . . $ airspyhf_complex_int16_t# *temp;
425 airspyhf_device_tcxx . . $ airspyhf_device_t#* device = (airspyhf_device_tcxx . . $ airspyhf_device_t#*) usb_transfer->user_datacxx . . $ libusb_transfer#user_data.;
426
427 device->transfer_livecxx . . $ airspyhf_device#transfer_live.--;
428 if (!device->streamingcxx . . $ airspyhf_device#streaming. || device->stop_requestedcxx . . $ airspyhf_device#stop_requested.)
429 {
430 return;
431 }
432
433 if (usb_transfer->statuscxx . . $ libusb_transfer#status. == LIBUSB_TRANSFER_COMPLETEDcxx . . $ LIBUSB_TRANSFER_COMPLETED. && usb_transfer->actual_lengthcxx . . $ libusb_transfer#actual_length. == usb_transfer->lengthcxx . . $ libusb_transfer#length.)
434 {
435 pthread_mutex_lockcxx . . $ pthread_mutex_lock(d89ae235521888f9).(&device->consumer_mpcxx . . $ airspyhf_device#consumer_mp.);
436
437 if (device->received_buffer_countcxx . . $ airspyhf_device#received_buffer_count. < RAW_BUFFER_COUNTcxx . . $ `libairspyhf/src/airspyhf.c:58:9`!)
438 {
439 temp = device->received_samples_queuecxx . . $ airspyhf_device#received_samples_queue.[device->received_samples_queue_headcxx . . $ airspyhf_device#received_samples_queue_head.];
440 device->received_samples_queuecxx . . $ airspyhf_device#received_samples_queue.[device->received_samples_queue_headcxx . . $ airspyhf_device#received_samples_queue_head.] = (airspyhf_complex_int16_tcxx . . $ airspyhf_complex_int16_t# *) usb_transfer->buffercxx . . $ libusb_transfer#buffer.;
441 usb_transfer->buffercxx . . $ libusb_transfer#buffer. = (uint8_tcxx . . $ uint8_t# *) temp;
442
443 device->dropped_buffers_queuecxx . . $ airspyhf_device#dropped_buffers_queue.[device->received_samples_queue_headcxx . . $ airspyhf_device#received_samples_queue_head.] = device->dropped_bufferscxx . . $ airspyhf_device#dropped_buffers.;
444 device->dropped_bufferscxx . . $ airspyhf_device#dropped_buffers. = 0;
445
446 device->received_samples_queue_headcxx . . $ airspyhf_device#received_samples_queue_head. = (device->received_samples_queue_headcxx . . $ airspyhf_device#received_samples_queue_head. + 1) & (RAW_BUFFER_COUNTcxx . . $ `libairspyhf/src/airspyhf.c:58:9`! - 1);
447 device->received_buffer_countcxx . . $ airspyhf_device#received_buffer_count.++;
448
•449 pthread_cond_signalcxx . . $ pthread_cond_signal(98095c34a2b0149d).(&device->consumer_cvcxx . . $ airspyhf_device#consumer_cv.);
450 }
•451 else
452 {
453 device->dropped_bufferscxx . . $ airspyhf_device#dropped_buffers.++;
454 }
455
•456 pthread_mutex_unlockcxx . . $ pthread_mutex_unlock(d89ae235521888f9).(&device->consumer_mpcxx . . $ airspyhf_device#consumer_mp.);
457
458 if (libusb_submit_transfercxx . . $ libusb_submit_transfer(d1d6c59b35b7dbb7).(usb_transfer) != 0)
459 {
460 device->streamingcxx . . $ airspyhf_device#streaming. = falsecxx . . $ `libairspyhf/src/airspyhf.c:45:9`!;
461 }
462 else
463 device->transfer_livecxx . . $ airspyhf_device#transfer_live. ++;
464 }
465 else
466 {
467 device->streamingcxx . . $ airspyhf_device#streaming. = falsecxx . . $ `libairspyhf/src/airspyhf.c:45:9`!;
468 }
469 }
470
471 static void* transfer_threadproccxx . . $ transfer_threadproc(9f162e79bfc6c74).(void* arg)
472 {
473 airspyhf_device_tcxx . . $ airspyhf_device_t#* device = (struct airspyhf_devicecxx . . $ airspyhf_device#*) arg;
474 int error;
475 struct timevalcxx . . $ timeval# timeout = { 0, 500000 };
476
477 #ifdef _WIN32
478
•479 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
480
481 #endif
482
483 while (device->streamingcxx . . $ airspyhf_device#streaming. && !device->stop_requestedcxx . . $ airspyhf_device#stop_requested.)
484 {
485 error = libusb_handle_events_timeout_completedcxx . . $ libusb_handle_events_timeout_completed(168be73805301a0c).(device->usb_contextcxx . . $ airspyhf_device#usb_context., &timeout, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
486 if (error < 0)
487 {
488 if (error != LIBUSB_ERROR_INTERRUPTEDcxx . . $ LIBUSB_ERROR_INTERRUPTED.)
489 device->streamingcxx . . $ airspyhf_device#streaming. = falsecxx . . $ `libairspyhf/src/airspyhf.c:45:9`!;
490 }
491 }
492
493 device->streamingcxx . . $ airspyhf_device#streaming. = falsecxx . . $ `libairspyhf/src/airspyhf.c:45:9`!;
494
495 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
496 }
497
498 static int kill_io_threadscxx . . $ kill_io_threads(8c7809d1dae8c2a1).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device)
499 {
500 struct timevalcxx . . $ timeval# timeout = { 0, 0 };
501
502 if (device->stop_requestedcxx . . $ airspyhf_device#stop_requested.)
503 {
504 device->stop_requestedcxx . . $ airspyhf_device#stop_requested. = falsecxx . . $ `libairspyhf/src/airspyhf.c:45:9`!;
505 device->streamingcxx . . $ airspyhf_device#streaming. = falsecxx . . $ `libairspyhf/src/airspyhf.c:45:9`!;
506 cancel_transferscxx . . $ cancel_transfers(8c7809d1dae8c2a1).(device);
507
508 pthread_mutex_lockcxx . . $ pthread_mutex_lock(d89ae235521888f9).(&device->consumer_mpcxx . . $ airspyhf_device#consumer_mp.);
509 pthread_cond_signalcxx . . $ pthread_cond_signal(98095c34a2b0149d).(&device->consumer_cvcxx . . $ airspyhf_device#consumer_cv.);
510 pthread_mutex_unlockcxx . . $ pthread_mutex_unlock(d89ae235521888f9).(&device->consumer_mpcxx . . $ airspyhf_device#consumer_mp.);
511
512 if (device->transfer_thread_runningcxx . . $ airspyhf_device#transfer_thread_running.) {
513 pthread_joincxx . . $ pthread_join(269902cf949f12c5).(device->transfer_threadcxx . . $ airspyhf_device#transfer_thread., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
514 device->transfer_thread_runningcxx . . $ airspyhf_device#transfer_thread_running. = falsecxx . . $ `libairspyhf/src/airspyhf.c:45:9`!;
515 }
516 if (device->consumer_thread_runningcxx . . $ airspyhf_device#consumer_thread_running.) {
517 pthread_joincxx . . $ pthread_join(269902cf949f12c5).(device->consumer_threadcxx . . $ airspyhf_device#consumer_thread., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
518 device->consumer_thread_runningcxx . . $ airspyhf_device#consumer_thread_running. = falsecxx . . $ `libairspyhf/src/airspyhf.c:45:9`!;
519 }
520
521 libusb_handle_events_timeout_completedcxx . . $ libusb_handle_events_timeout_completed(168be73805301a0c).(device->usb_contextcxx . . $ airspyhf_device#usb_context., &timeout, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
522 }
523
524 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
525 }
526
527 static int create_io_threadscxx . . $ create_io_threads(b21bd461278d4411).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, airspyhf_sample_block_cb_fncxx . . $ airspyhf_sample_block_cb_fn# callback)
528 {
529 int result;
530 pthread_attr_tcxx . . $ pthread_attr_t# attr;
531
532 if (!device->streamingcxx . . $ airspyhf_device#streaming. && !device->stop_requestedcxx . . $ airspyhf_device#stop_requested.)
533 {
534 device->callbackcxx . . $ airspyhf_device#callback. = callback;
535 device->streamingcxx . . $ airspyhf_device#streaming. = truecxx . . $ `libairspyhf/src/airspyhf.c:44:9`!;
536
537 result = prepare_transferscxx . . $ prepare_transfers(8a891df5918b1498).(device, LIBUSB_ENDPOINT_INcxx . . $ LIBUSB_ENDPOINT_IN. | AIRSPYHF_ENDPOINT_INcxx . . $ `libairspyhf/src/airspyhf.h:36:9`!, (libusb_transfer_cb_fncxx . . $ libusb_transfer_cb_fn#)airspyhf_libusb_transfer_callbackcxx . . $ airspyhf_libusb_transfer_callback(6aa7c12d948ffba5).);
538 if (result != AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.)
539 {
540 return result;
541 }
542
543 device->received_samples_queue_headcxx . . $ airspyhf_device#received_samples_queue_head. = 0;
544 device->received_samples_queue_tailcxx . . $ airspyhf_device#received_samples_queue_tail. = 0;
545 device->received_buffer_countcxx . . $ airspyhf_device#received_buffer_count. = 0;
546
547 pthread_attr_initcxx . . $ pthread_attr_init(26f1688c57ac69c9).(&attr);
548 pthread_attr_setdetachstatecxx . . $ pthread_attr_setdetachstate(1c205214b8a99ab8).(&attr, PTHREAD_CREATE_JOINABLEcxx . . $ `<external>/14712363683955484316/pthread.h:40:9`!);
549
550 result = pthread_createcxx . . $ pthread_create(2141a84bcac899e5).(&device->consumer_threadcxx . . $ airspyhf_device#consumer_thread., &attr, consumer_threadproccxx . . $ consumer_threadproc(9f162e79bfc6c74)., device);
551 if (result != 0)
552 {
553 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
554 }
555 device->consumer_thread_runningcxx . . $ airspyhf_device#consumer_thread_running. = truecxx . . $ `libairspyhf/src/airspyhf.c:44:9`!;
556
557 result = pthread_createcxx . . $ pthread_create(2141a84bcac899e5).(&device->transfer_threadcxx . . $ airspyhf_device#transfer_thread., &attr, transfer_threadproccxx . . $ transfer_threadproc(9f162e79bfc6c74)., device);
558 if (result != 0)
559 {
560 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
561 }
562 device->transfer_thread_runningcxx . . $ airspyhf_device#transfer_thread_running. = truecxx . . $ `libairspyhf/src/airspyhf.c:44:9`!;
563
564 pthread_attr_destroycxx . . $ pthread_attr_destroy(26f1688c57ac69c9).(&attr);
565 }
566 else {
567 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
568 }
569
570 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
571 }
572
573 static void airspyhf_open_exitcxx . . $ airspyhf_open_exit(b68993dc5bd1b335).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device)
574 {
575 if (device->usb_devicecxx . . $ airspyhf_device#usb_device. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
576 {
577 libusb_release_interfacecxx . . $ libusb_release_interface(ae5c68eb3843917).(device->usb_devicecxx . . $ airspyhf_device#usb_device., 0);
578 libusb_closecxx . . $ libusb_close(21ef1a69fcf37170).(device->usb_devicecxx . . $ airspyhf_device#usb_device.);
579 device->usb_devicecxx . . $ airspyhf_device#usb_device. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
580 }
581 libusb_exitcxx . . $ libusb_exit(265e9f2c873ae37e).(device->usb_contextcxx . . $ airspyhf_device#usb_context.);
582 device->usb_contextcxx . . $ airspyhf_device#usb_context. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
583 }
584
585 static int airspyhf_read_samplerates_from_fwcxx . . $ airspyhf_read_samplerates_from_fw(ef403350d3b5d991).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, uint32_tcxx . . $ uint32_t#* buffer, const uint32_tcxx . . $ uint32_t# len)
586 {
587 int result;
588
589 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
590 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
591 LIBUSB_ENDPOINT_INcxx . . $ LIBUSB_ENDPOINT_IN. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
592 AIRSPYHF_GET_SAMPLERATEScxx . . $ AIRSPYHF_GET_SAMPLERATES.,
593 0,
594 len,
595 (unsigned char*) buffer,
596 (len > 0 ? len : 1) * (int16_tcxx . . $ int16_t#) sizeof(uint32_tcxx . . $ uint32_t#),
597 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
598
599 if (result < 1)
600 {
601 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
602 }
603 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
604 }
605
606 static int airspyhf_read_att_steps_from_fwcxx . . $ airspyhf_read_att_steps_from_fw(baab7b448cad015).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, void* buffer, const uint32_tcxx . . $ uint32_t# count)
607 {
608 int result;
609
610 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
611 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
•612 LIBUSB_ENDPOINT_INcxx . . $ LIBUSB_ENDPOINT_IN. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
613 AIRSPYHF_GET_ATT_STEPScxx . . $ AIRSPYHF_GET_ATT_STEPS.,
614 0,
615 count,
616 (unsigned char*) buffer,
617 (int16_tcxx . . $ int16_t#)(count > 0 ? (count * sizeof(float)) : sizeof(int32_tcxx . . $ int32_t#)),
618 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
619
620 if (result < 1)
621 {
622 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
623 }
624 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
625 }
626
627 static int airspyhf_read_samplerate_architectures_from_fwcxx . . $ airspyhf_read_samplerate_architectures_from_fw(264c2d89ccffe62d).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, uint8_tcxx . . $ uint8_t#* buffer, const uint32_tcxx . . $ uint32_t# len)
628 {
629 int result;
•630
631 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
•632 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
•633 LIBUSB_ENDPOINT_INcxx . . $ LIBUSB_ENDPOINT_IN. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
634 AIRSPYHF_GET_SAMPLERATE_ARCHITECTUREScxx . . $ AIRSPYHF_GET_SAMPLERATE_ARCHITECTURES.,
635 0,
636 len,
•637 (unsigned char*) buffer,
638 (len > 0 ? len : 1) * (int16_tcxx . . $ int16_t#) sizeof(uint32_tcxx . . $ uint32_t#),
•639 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
640
641 if (result < 1)
•642 {
643 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
644 }
645
646 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
•647 }
648
•649
•650 static void airspyhf_open_devicecxx . . $ airspyhf_open_device(8afd1601f39a988d).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device,
651 int* ret,
•652 uint16_tcxx . . $ uint16_t# vid,
653 uint16_tcxx . . $ uint16_t# pid,
•654 uint64_tcxx . . $ uint64_t# serial_number_val)
655 {
656 int i;
•657 int result;
658 libusb_device_handlecxx . . $ libusb_device_handle#** libusb_dev_handle;
659 int serial_number_len;
660 libusb_device_handlecxx . . $ libusb_device_handle#* dev_handle;
661 libusb_devicecxx . . $ libusb_device# *dev;
662 libusb_devicecxx . . $ libusb_device#** devices = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
•663
664 ssize_tcxx . . $ ssize_t# cnt;
•665 int serial_descriptor_index;
•666 struct libusb_device_descriptorcxx . . $ libusb_device_descriptor# device_descriptor;
667 unsigned char serial_number[AIRSPYHF_SERIAL_SIZEcxx . . $ `libairspyhf/src/airspyhf.c:59:9`! + 1];
•668
669 libusb_dev_handle = &device->usb_devicecxx . . $ airspyhf_device#usb_device.;
670 *libusb_dev_handle = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
671
•672 cnt = libusb_get_device_listcxx . . $ libusb_get_device_list(e324cf20e0602be4).(device->usb_contextcxx . . $ airspyhf_device#usb_context., &devices);
673 if (cnt < 0)
•674 {
675 *ret = AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
•676 return;
•677 }
678
679 i = 0;
680 while ((dev = devices[i++]) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
•681 {
682 libusb_get_device_descriptorcxx . . $ libusb_get_device_descriptor(e08c2cd47bc5f4fc).(dev, &device_descriptor);
683
•684 if ((device_descriptor.idVendorcxx . . $ libusb_device_descriptor#idVendor. == vid) &&
685 (device_descriptor.idProductcxx . . $ libusb_device_descriptor#idProduct. == pid))
686 {
687 if (serial_number_val != SERIAL_NUMBER_UNUSEDcxx . . $ `libairspyhf/src/airspyhf.c:56:9`!)
•688 {
689 serial_descriptor_index = device_descriptor.iSerialNumbercxx . . $ libusb_device_descriptor#iSerialNumber.;
690 if (serial_descriptor_index > 0)
691 {
692 if (libusb_opencxx . . $ libusb_open(a1a0977d9a332887).(dev, libusb_dev_handle) != 0)
693 {
694 *libusb_dev_handle = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
695 continue;
•696 }
697 dev_handle = *libusb_dev_handle;
698 serial_number_len = libusb_get_string_descriptor_asciicxx . . $ libusb_get_string_descriptor_ascii(fa0ddade8874c7d3).(dev_handle,
699 serial_descriptor_index,
700 serial_number,
•701 sizeof(serial_number));
702
703 if (serial_number_len == AIRSPYHF_SERIAL_SIZEcxx . . $ `libairspyhf/src/airspyhf.c:59:9`! && !memcmpcxx . . $ memcmp(36f949851efa3055).(str_prefix_serial_airspyhfcxx . . $ str_prefix_serial_airspyhf., serial_number, STR_PREFIX_SERIAL_AIRSPYHF_SIZEcxx . . $ `libairspyhf/src/airspyhf.c:73:9`!))
704 {
705 uint64_tcxx . . $ uint64_t# serial = SERIAL_NUMBER_UNUSEDcxx . . $ `libairspyhf/src/airspyhf.c:56:9`!;
•706 // use same code to determine device's serial number as in airspyhf_list_devices()
•707 {
708 char *start, *end;
•709 serial_number[AIRSPYHF_SERIAL_SIZEcxx . . $ `libairspyhf/src/airspyhf.c:59:9`!] = 0;
710 start = (char*)(serial_number + STR_PREFIX_SERIAL_AIRSPYHF_SIZEcxx . . $ `libairspyhf/src/airspyhf.c:73:9`!);
•711 end = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
712 serial = strtoullcxx . . $ strtoull(fa707f2e7d9ad629).(start, &end, 16);
•713 }
714 if (serial == serial_number_val)
715 {
716 result = libusb_set_configurationcxx . . $ libusb_set_configuration(ae5c68eb3843917).(dev_handle, 1);
717 if (result != 0)
•718 {
719 libusb_closecxx . . $ libusb_close(21ef1a69fcf37170).(dev_handle);
720 *libusb_dev_handle = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
721 continue;
•722 }
723 result = libusb_claim_interfacecxx . . $ libusb_claim_interface(ae5c68eb3843917).(dev_handle, 0);
724 if (result != 0)
725 {
726 libusb_closecxx . . $ libusb_close(21ef1a69fcf37170).(dev_handle);
•727 *libusb_dev_handle = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
728 continue;
729 }
730
731 result = libusb_set_interface_alt_settingcxx . . $ libusb_set_interface_alt_setting(5cbf58ed2a24bd39).(dev_handle, 0, 1);
732 if (result != 0)
733 {
•734 libusb_closecxx . . $ libusb_close(21ef1a69fcf37170).(dev_handle);
735 *libusb_dev_handle = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
736 continue;
737 }
738
•739 break;
740 }
•741 else
742 {
743 libusb_closecxx . . $ libusb_close(21ef1a69fcf37170).(dev_handle);
744 *libusb_dev_handle = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
745 continue;
•746 }
•747 }
748 else
749 {
750 libusb_closecxx . . $ libusb_close(21ef1a69fcf37170).(dev_handle);
•751 *libusb_dev_handle = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
752 continue;
753 }
754 }
•755 }
756 else
757 {
758 if (libusb_opencxx . . $ libusb_open(a1a0977d9a332887).(dev, libusb_dev_handle) == 0)
•759 {
760 dev_handle = *libusb_dev_handle;
761 result = libusb_set_configurationcxx . . $ libusb_set_configuration(ae5c68eb3843917).(dev_handle, 1);
•762 if (result != 0)
763 {
•764 libusb_closecxx . . $ libusb_close(21ef1a69fcf37170).(dev_handle);
•765 *libusb_dev_handle = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
•766 continue;
767 }
768 result = libusb_claim_interfacecxx . . $ libusb_claim_interface(ae5c68eb3843917).(dev_handle, 0);
769 if (result != 0)
770 {
771 libusb_closecxx . . $ libusb_close(21ef1a69fcf37170).(dev_handle);
772 *libusb_dev_handle = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
773 continue;
774 }
775
776 result = libusb_set_interface_alt_settingcxx . . $ libusb_set_interface_alt_setting(5cbf58ed2a24bd39).(dev_handle, 0, 1);
777 if (result != 0)
•778 {
•779 libusb_closecxx . . $ libusb_close(21ef1a69fcf37170).(dev_handle);
780 *libusb_dev_handle = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
•781 continue;
•782 }
783 break;
784 }
785 }
786 }
•787 }
•788 libusb_free_device_listcxx . . $ libusb_free_device_list(346f4e34ef547130).(devices, 1);
789
790 dev_handle = device->usb_devicecxx . . $ airspyhf_device#usb_device.;
•791 if (dev_handle == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
792 {
793 *ret = AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
794 return;
795 }
•796
•797 *ret = AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
798 return;
799 }
•800
801 static void airspyhf_open_device_fdcxx . . $ airspyhf_open_device_fd(a83a4afe9ce849d4).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device,
802 int* ret,
803 int fd) {
804 int result = -1;
805
806 #ifdef __ANDROID__
807 result = libusb_wrap_sys_device(device->usb_context, (intptr_t)fd, &device->usb_device);
808 #else
809 device->usb_devicecxx . . $ airspyhf_device#usb_device. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
810 *ret = AIRSPYHF_UNSUPPORTEDcxx . . $ AIRSPYHF_UNSUPPORTED.;
811 return;
812 #endif
813
814 if (result != 0 || device->usb_devicecxx . . $ airspyhf_device#usb_device. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
815 {
816 *ret = AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
817 return;
818 }
819
820 result = libusb_set_configurationcxx . . $ libusb_set_configuration(ae5c68eb3843917).(device->usb_devicecxx . . $ airspyhf_device#usb_device., 1);
821 if (result != 0)
822 {
823 libusb_closecxx . . $ libusb_close(21ef1a69fcf37170).(device->usb_devicecxx . . $ airspyhf_device#usb_device.);
824 device->usb_devicecxx . . $ airspyhf_device#usb_device. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
825 *ret = AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
826 return;
827 }
•828
829 result = libusb_claim_interfacecxx . . $ libusb_claim_interface(ae5c68eb3843917).(device->usb_devicecxx . . $ airspyhf_device#usb_device., 0);
830 if (result != 0)
831 {
832 libusb_closecxx . . $ libusb_close(21ef1a69fcf37170).(device->usb_devicecxx . . $ airspyhf_device#usb_device.);
833 device->usb_devicecxx . . $ airspyhf_device#usb_device. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
834 *ret = AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
835 return;
836 }
837
838 result = libusb_set_interface_alt_settingcxx . . $ libusb_set_interface_alt_setting(5cbf58ed2a24bd39).(device->usb_devicecxx . . $ airspyhf_device#usb_device., 0, 1);
839 if (result != 0)
840 {
841 libusb_closecxx . . $ libusb_close(21ef1a69fcf37170).(device->usb_devicecxx . . $ airspyhf_device#usb_device.);
842 device->usb_devicecxx . . $ airspyhf_device#usb_device. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
843 *ret = AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
844 return;
845 }
846
847 *ret = AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
848 return;
849 }
850
851 int airspyhf_list_devicescxx . . $ airspyhf_list_devices(ef7c1bc0ec9caab7).(uint64_tcxx . . $ uint64_t# *serials, int count)
852 {
853 libusb_device_handlecxx . . $ libusb_device_handle#* libusb_dev_handle;
854 struct libusb_contextcxx . . $ libusb_context# *context;
855 libusb_devicecxx . . $ libusb_device#** devices = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
856 libusb_devicecxx . . $ libusb_device# *dev;
857 struct libusb_device_descriptorcxx . . $ libusb_device_descriptor# device_descriptor;
858
859 int serial_descriptor_index;
860 int serial_number_len;
861 int output_count;
862 int i;
863 unsigned char serial_number[AIRSPYHF_SERIAL_SIZEcxx . . $ `libairspyhf/src/airspyhf.c:59:9`! + 1];
864
865 if (serials)
866 {
867 memsetcxx . . $ memset(d1de1e4fb215f1c6).(serials, 0, sizeof(uint64_tcxx . . $ uint64_t#) * count);
868 }
869
870 #ifdef __ANDROID__
871 // LibUSB does not support device discovery on android
872 libusb_set_option(NULL, LIBUSB_OPTION_NO_DEVICE_DISCOVERY, NULL);
873 #endif
874
875 if (libusb_initcxx . . $ libusb_init(37eedd7a9105db73).(&context) != 0)
876 {
877 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
878 }
879
880 if (libusb_get_device_listcxx . . $ libusb_get_device_list(e324cf20e0602be4).(context, &devices) < 0)
881 {
882 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
883 }
884
885 i = 0;
886 output_count = 0;
887 while ((dev = devices[i++]) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && (!serials || output_count < count))
888 {
889 libusb_get_device_descriptorcxx . . $ libusb_get_device_descriptor(e08c2cd47bc5f4fc).(dev, &device_descriptor);
890
891 if ((device_descriptor.idVendorcxx . . $ libusb_device_descriptor#idVendor. == airspyhf_usb_vidcxx . . $ airspyhf_usb_vid.) &&
892 (device_descriptor.idProductcxx . . $ libusb_device_descriptor#idProduct. == airspyhf_usb_pidcxx . . $ airspyhf_usb_pid.))
893 {
894 serial_descriptor_index = device_descriptor.iSerialNumbercxx . . $ libusb_device_descriptor#iSerialNumber.;
895 if (serial_descriptor_index > 0)
896 {
•897 if (libusb_opencxx . . $ libusb_open(a1a0977d9a332887).(dev, &libusb_dev_handle) != 0)
898 {
899 continue;
900 }
901
902 serial_number_len = libusb_get_string_descriptor_asciicxx . . $ libusb_get_string_descriptor_ascii(fa0ddade8874c7d3).(libusb_dev_handle,
903 serial_descriptor_index,
904 serial_number,
905 sizeof(serial_number));
906
907 if (serial_number_len == AIRSPYHF_SERIAL_SIZEcxx . . $ `libairspyhf/src/airspyhf.c:59:9`! && !memcmpcxx . . $ memcmp(36f949851efa3055).(str_prefix_serial_airspyhfcxx . . $ str_prefix_serial_airspyhf., serial_number, STR_PREFIX_SERIAL_AIRSPYHF_SIZEcxx . . $ `libairspyhf/src/airspyhf.c:73:9`!))
908 {
909 char *start, *end;
910 uint64_tcxx . . $ uint64_t# serial;
911
•912 serial_number[AIRSPYHF_SERIAL_SIZEcxx . . $ `libairspyhf/src/airspyhf.c:59:9`!] = 0;
•913 start = (char*)(serial_number + STR_PREFIX_SERIAL_AIRSPYHF_SIZEcxx . . $ `libairspyhf/src/airspyhf.c:73:9`!);
914 end = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
915 serial = strtoullcxx . . $ strtoull(fa707f2e7d9ad629).(start, &end, 16);
916 if (serial == 0 && start == end)
917 {
918 libusb_closecxx . . $ libusb_close(21ef1a69fcf37170).(libusb_dev_handle);
919 continue;
920 }
921
922 if (serials)
923 {
•924 serials[output_count] = serial;
925 }
926 output_count++;
927 }
•928
929 libusb_closecxx . . $ libusb_close(21ef1a69fcf37170).(libusb_dev_handle);
930 }
931 }
932 }
933
934 libusb_free_device_listcxx . . $ libusb_free_device_list(346f4e34ef547130).(devices, 1);
935 libusb_exitcxx . . $ libusb_exit(265e9f2c873ae37e).(context);
936 return output_count;
937 }
938
939 static int airspyhf_open_initcxx . . $ airspyhf_open_init(b0f5bbf1d0eb17e1).(airspyhf_device_tcxx . . $ airspyhf_device_t#** device, uint64_tcxx . . $ uint64_t# serial_number, int fd)
940 {
941 airspyhf_device_tcxx . . $ airspyhf_device_t#* lib_device;
942 flash_config_tcxx . . $ flash_config_t# config;
943 int libusb_error;
944 int result;
945
946 *device = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
947
948 lib_device = (airspyhf_device_tcxx . . $ airspyhf_device_t#*) calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(airspyhf_device_tcxx . . $ airspyhf_device_t#));
949 if (lib_device == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
950 {
951 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
952 }
953
954 #ifdef __ANDROID__
955 // LibUSB does not support device discovery on android
956 libusb_set_option(NULL, LIBUSB_OPTION_NO_DEVICE_DISCOVERY, NULL);
957 #endif
958
959 libusb_error = libusb_initcxx . . $ libusb_init(37eedd7a9105db73).(&lib_device->usb_contextcxx . . $ airspyhf_device#usb_context.);
960 if (libusb_error != 0)
961 {
962 freecxx . . $ free(5d22bdacc48458e8).(lib_device);
963 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
964 }
•965
966 if (fd == FILE_DESCRIPTOR_UNUSEDcxx . . $ `libairspyhf/src/airspyhf.c:57:9`!) {
967 airspyhf_open_devicecxx . . $ airspyhf_open_device(8afd1601f39a988d).(lib_device,
968 &result,
969 airspyhf_usb_vidcxx . . $ airspyhf_usb_vid.,
970 airspyhf_usb_pidcxx . . $ airspyhf_usb_pid.,
971 serial_number);
972 }
973 else {
974 airspyhf_open_device_fdcxx . . $ airspyhf_open_device_fd(a83a4afe9ce849d4).(lib_device,
975 &result,
976 fd);
977 }
978
979 if (lib_device->usb_devicecxx . . $ airspyhf_device#usb_device. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
980 {
981 libusb_exitcxx . . $ libusb_exit(265e9f2c873ae37e).(lib_device->usb_contextcxx . . $ airspyhf_device#usb_context.);
982 freecxx . . $ free(5d22bdacc48458e8).(lib_device);
983 return result;
984 }
985
986 lib_device->transferscxx . . $ airspyhf_device#transfers. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
987 lib_device->callbackcxx . . $ airspyhf_device#callback. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
988 lib_device->transfer_countcxx . . $ airspyhf_device#transfer_count. = 16;
989 lib_device->buffer_sizecxx . . $ airspyhf_device#buffer_size. = SAMPLES_TO_TRANSFERcxx . . $ `libairspyhf/src/airspyhf.c:55:9`! * sizeof(airspyhf_complex_int16_tcxx . . $ airspyhf_complex_int16_t#);
990 lib_device->streamingcxx . . $ airspyhf_device#streaming. = falsecxx . . $ `libairspyhf/src/airspyhf.c:45:9`!;
991 lib_device->stop_requestedcxx . . $ airspyhf_device#stop_requested. = falsecxx . . $ `libairspyhf/src/airspyhf.c:45:9`!;
992
993 lib_device->supported_sampleratescxx . . $ airspyhf_device#supported_samplerates. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
994 lib_device->samplerate_architecturescxx . . $ airspyhf_device#samplerate_architectures. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
995
996 result = airspyhf_read_samplerates_from_fwcxx . . $ airspyhf_read_samplerates_from_fw(ef403350d3b5d991).(lib_device, &lib_device->supported_samplerate_countcxx . . $ airspyhf_device#supported_samplerate_count., 0);
997 if (result == AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.)
998 {
999 lib_device->supported_sampleratescxx . . $ airspyhf_device#supported_samplerates. = (uint32_tcxx . . $ uint32_t# *)malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(lib_device->supported_samplerate_countcxx . . $ airspyhf_device#supported_samplerate_count. * sizeof(uint32_tcxx . . $ uint32_t#));
1000 result = airspyhf_read_samplerates_from_fwcxx . . $ airspyhf_read_samplerates_from_fw(ef403350d3b5d991).(lib_device, lib_device->supported_sampleratescxx . . $ airspyhf_device#supported_samplerates., lib_device->supported_samplerate_countcxx . . $ airspyhf_device#supported_samplerate_count.);
1001 if (result == AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.)
1002 {
1003 lib_device->samplerate_architecturescxx . . $ airspyhf_device#samplerate_architectures. = (uint8_tcxx . . $ uint8_t# *)malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(lib_device->supported_samplerate_countcxx . . $ airspyhf_device#supported_samplerate_count. * sizeof(uint8_tcxx . . $ uint8_t#));
•1004 result = airspyhf_read_samplerate_architectures_from_fwcxx . . $ airspyhf_read_samplerate_architectures_from_fw(264c2d89ccffe62d).(lib_device, lib_device->samplerate_architecturescxx . . $ airspyhf_device#samplerate_architectures., lib_device->supported_samplerate_countcxx . . $ airspyhf_device#supported_samplerate_count.);
1005 if (result != AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.)
1006 {
1007 memsetcxx . . $ memset(d1de1e4fb215f1c6).(lib_device->samplerate_architecturescxx . . $ airspyhf_device#samplerate_architectures., 0, lib_device->supported_samplerate_countcxx . . $ airspyhf_device#supported_samplerate_count. * sizeof(uint8_tcxx . . $ uint8_t#)); // Assume Zero IF for all
1008 result = AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.; // Clear this error for backward compatibility.
1009 }
1010 }
1011 else
1012 {
1013 freecxx . . $ free(5d22bdacc48458e8).(lib_device->supported_sampleratescxx . . $ airspyhf_device#supported_samplerates.);
1014 lib_device->supported_sampleratescxx . . $ airspyhf_device#supported_samplerates. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1015 }
1016 }
•1017
1018 if (result != AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.)
1019 {
1020 // Assume one default sample rate with Zero IF
1021
•1022 lib_device->supported_samplerate_countcxx . . $ airspyhf_device#supported_samplerate_count. = 1;
1023 lib_device->supported_sampleratescxx . . $ airspyhf_device#supported_samplerates. = (uint32_tcxx . . $ uint32_t# *) malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(lib_device->supported_samplerate_countcxx . . $ airspyhf_device#supported_samplerate_count. * sizeof(uint32_tcxx . . $ uint32_t#));
1024 lib_device->supported_sampleratescxx . . $ airspyhf_device#supported_samplerates.[0] = DEFAULT_SAMPLERATEcxx . . $ `libairspyhf/src/airspyhf.c:62:9`!;
1025
1026 lib_device->samplerate_architecturescxx . . $ airspyhf_device#samplerate_architectures. = (uint8_tcxx . . $ uint8_t# *) malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(lib_device->supported_samplerate_countcxx . . $ airspyhf_device#supported_samplerate_count. * sizeof(uint8_tcxx . . $ uint8_t#));
1027 lib_device->samplerate_architecturescxx . . $ airspyhf_device#samplerate_architectures.[0] = 0;
•1028 }
1029
1030 lib_device->current_sampleratecxx . . $ airspyhf_device#current_samplerate. = lib_device->supported_sampleratescxx . . $ airspyhf_device#supported_samplerates.[0];
1031 lib_device->is_low_ifcxx . . $ airspyhf_device#is_low_if. = lib_device->samplerate_architecturescxx . . $ airspyhf_device#samplerate_architectures.[0];
1032
1033 result = airspyhf_read_att_steps_from_fwcxx . . $ airspyhf_read_att_steps_from_fw(baab7b448cad015).(lib_device, &lib_device->supported_att_step_countcxx . . $ airspyhf_device#supported_att_step_count., 0);
1034 if (result == AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.)
1035 {
1036 lib_device->supported_att_stepscxx . . $ airspyhf_device#supported_att_steps. = (float*)malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(lib_device->supported_att_step_countcxx . . $ airspyhf_device#supported_att_step_count. * sizeof(float));
1037 result = airspyhf_read_att_steps_from_fwcxx . . $ airspyhf_read_att_steps_from_fw(baab7b448cad015).(lib_device, lib_device->supported_att_stepscxx . . $ airspyhf_device#supported_att_steps., lib_device->supported_att_step_countcxx . . $ airspyhf_device#supported_att_step_count.);
1038 if (result != AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.)
1039 {
1040 freecxx . . $ free(5d22bdacc48458e8).(lib_device->supported_att_stepscxx . . $ airspyhf_device#supported_att_steps.);
1041 lib_device->supported_att_stepscxx . . $ airspyhf_device#supported_att_steps. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
1042 lib_device->supported_att_step_countcxx . . $ airspyhf_device#supported_att_step_count. = 0;
1043 }
1044 }
1045
•1046 if (result != AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.)
1047 {
1048 // Assume ATT steps of the Airspy HF+ Discovery
•1049
1050 lib_device->supported_att_step_countcxx . . $ airspyhf_device#supported_att_step_count. = DEFAULT_ATT_STEP_COUNTcxx . . $ `libairspyhf/src/airspyhf.c:64:9`!;
1051 lib_device->supported_att_stepscxx . . $ airspyhf_device#supported_att_steps. = (float*)malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(lib_device->supported_att_step_countcxx . . $ airspyhf_device#supported_att_step_count. * sizeof(float));
1052 for (uint32_tcxx . . $ uint32_t# i = 0; i < lib_device->supported_att_step_countcxx . . $ airspyhf_device#supported_att_step_count.; i++)
•1053 {
•1054 lib_device->supported_att_stepscxx . . $ airspyhf_device#supported_att_steps.[i] = i * DEFAULT_ATT_STEP_INCREMENTcxx . . $ `libairspyhf/src/airspyhf.c:65:9`!;
1055 }
1056 }
•1057
1058 result = allocate_transferscxx . . $ allocate_transfers(8c7809d1dae8c2a1).(lib_device);
1059 if (result != 0)
1060 {
•1061 airspyhf_open_exitcxx . . $ airspyhf_open_exit(b68993dc5bd1b335).(lib_device);
1062 freecxx . . $ free(5d22bdacc48458e8).(lib_device);
1063 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1064 }
•1065
1066 pthread_cond_initcxx . . $ pthread_cond_init(fc876bc1ec1249fc).(&lib_device->consumer_cvcxx . . $ airspyhf_device#consumer_cv., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1067 pthread_mutex_initcxx . . $ pthread_mutex_init(db9d29dab44ea1aa).(&lib_device->consumer_mpcxx . . $ airspyhf_device#consumer_mp., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
1068
1069 lib_device->freq_hzcxx . . $ airspyhf_device#freq_hz. = 0;
1070 lib_device->freq_khzcxx . . $ airspyhf_device#freq_khz. = 0;
1071 lib_device->freq_delta_hzcxx . . $ airspyhf_device#freq_delta_hz. = 0;
1072 lib_device->freq_shiftcxx . . $ airspyhf_device#freq_shift. = 0;
1073 lib_device->veccxx . . $ airspyhf_device#vec..recxx . . $ $anonymous_type_804d0b7c756f111f_0#re. = 1.0f;
1074 lib_device->veccxx . . $ airspyhf_device#vec..imcxx . . $ $anonymous_type_804d0b7c756f111f_0#im. = 0.0f;
1075 lib_device->optimal_pointcxx . . $ airspyhf_device#optimal_point. = 0.0f;
1076 lib_device->filter_gaincxx . . $ airspyhf_device#filter_gain. = 1.0f;
1077 lib_device->enable_dspcxx . . $ airspyhf_device#enable_dsp. = 1;
1078
1079 if (airspyhf_config_readcxx . . $ airspyhf_config_read(d19a4bd7451812ec).(lib_device, (uint8_tcxx . . $ uint8_t# *) &config, sizeof(config)) == AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.)
1080 {
1081 if (config.magic_numbercxx . . $ flash_config#magic_number. == CALIBRATION_MAGICcxx . . $ `libairspyhf/src/airspyhf.c:67:9`!)
•1082 {
1083 lib_device->calibration_ppbcxx . . $ airspyhf_device#calibration_ppb. = config.calibration_ppbcxx . . $ flash_config#calibration_ppb.;
1084 airspyhf_set_vctcxo_calibrationcxx . . $ airspyhf_set_vctcxo_calibration(7be315573390cc5c).(lib_device, config.calibration_vctcxocxx . . $ flash_config#calibration_vctcxo.);
1085 airspyhf_set_frontend_optionscxx . . $ airspyhf_set_frontend_options(3b61eab5ff86a8).(lib_device, config.frontend_optionscxx . . $ flash_config#frontend_options.);
1086 }
1087 else
1088 {
1089 lib_device->calibration_ppbcxx . . $ airspyhf_device#calibration_ppb. = 0;
1090 lib_device->calibration_vctcxocxx . . $ airspyhf_device#calibration_vctcxo. = 0;
1091 lib_device->frontend_optionscxx . . $ airspyhf_device#frontend_options. = 0;
1092 }
1093 }
1094 else
1095 {
1096 lib_device->calibration_ppbcxx . . $ airspyhf_device#calibration_ppb. = 0;
1097 lib_device->calibration_vctcxocxx . . $ airspyhf_device#calibration_vctcxo. = 0;
1098 lib_device->frontend_optionscxx . . $ airspyhf_device#frontend_options. = 0;
1099 }
1100
1101 lib_device->iq_balancercxx . . $ airspyhf_device#iq_balancer. = iq_balancer_createcxx . . $ iq_balancer_create(2e14e5fd7abd6f76).(INITIAL_PHASEcxx . . $ `libairspyhf/src/airspyhf.c:77:9`!, INITIAL_AMPLITUDEcxx . . $ `libairspyhf/src/airspyhf.c:78:9`!);
•1102
1103 *device = lib_device;
1104
1105 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1106 }
1107
1108 void ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_lib_versioncxx . . $ airspyhf_lib_version(b3282ee75b22b0eb).(airspyhf_lib_version_tcxx . . $ airspyhf_lib_version_t#* lib_version)
1109 {
1110 lib_version->major_versioncxx . . $ $anonymous_type_804d0b7c756f111f_3#major_version. = AIRSPYHF_VER_MAJORcxx . . $ `libairspyhf/src/airspyhf.h:32:9`!;
1111 lib_version->minor_versioncxx . . $ $anonymous_type_804d0b7c756f111f_3#minor_version. = AIRSPYHF_VER_MINORcxx . . $ `libairspyhf/src/airspyhf.h:33:9`!;
1112 lib_version->revisioncxx . . $ $anonymous_type_804d0b7c756f111f_3#revision. = AIRSPYHF_VER_REVISIONcxx . . $ `libairspyhf/src/airspyhf.h:34:9`!;
1113 }
1114
1115 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_open_sncxx . . $ airspyhf_open_sn(896c01f2fcef2f64).(airspyhf_device_tcxx . . $ airspyhf_device_t#** device, uint64_tcxx . . $ uint64_t# serial_number)
1116 {
1117 int result;
1118
1119 result = airspyhf_open_initcxx . . $ airspyhf_open_init(b0f5bbf1d0eb17e1).(device, serial_number, FILE_DESCRIPTOR_UNUSEDcxx . . $ `libairspyhf/src/airspyhf.c:57:9`!);
1120 return result;
1121 }
1122
1123 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_open_fdcxx . . $ airspyhf_open_fd(6a76624df35972f5).(airspyhf_device_tcxx . . $ airspyhf_device_t#** device, int fd)
1124 {
1125 int result;
1126
1127 result = airspyhf_open_initcxx . . $ airspyhf_open_init(b0f5bbf1d0eb17e1).(device, SERIAL_NUMBER_UNUSEDcxx . . $ `libairspyhf/src/airspyhf.c:56:9`!, fd);
1128 return result;
1129 }
1130
1131 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_opencxx . . $ airspyhf_open(c3247397c26abfb6).(airspyhf_device_tcxx . . $ airspyhf_device_t#** device)
1132 {
1133 int result;
1134
1135 result = airspyhf_open_initcxx . . $ airspyhf_open_init(b0f5bbf1d0eb17e1).(device, SERIAL_NUMBER_UNUSEDcxx . . $ `libairspyhf/src/airspyhf.c:56:9`!, FILE_DESCRIPTOR_UNUSEDcxx . . $ `libairspyhf/src/airspyhf.c:57:9`!);
1136 return result;
1137 }
1138
1139 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_closecxx . . $ airspyhf_close(8c7809d1dae8c2a1).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device)
1140 {
1141 int result;
1142
1143 result = AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1144
1145 if (device != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
1146 {
1147 result = airspyhf_stopcxx . . $ airspyhf_stop(8c7809d1dae8c2a1).(device);
1148 free_transferscxx . . $ free_transfers(8c7809d1dae8c2a1).(device);
1149 airspyhf_open_exitcxx . . $ airspyhf_open_exit(b68993dc5bd1b335).(device);
1150
1151 freecxx . . $ free(5d22bdacc48458e8).(device->supported_sampleratescxx . . $ airspyhf_device#supported_samplerates.);
1152 freecxx . . $ free(5d22bdacc48458e8).(device->samplerate_architecturescxx . . $ airspyhf_device#samplerate_architectures.);
1153 freecxx . . $ free(5d22bdacc48458e8).(device->supported_att_stepscxx . . $ airspyhf_device#supported_att_steps.);
1154 iq_balancer_destroycxx . . $ iq_balancer_destroy(56baa6a3d2caeef9).(device->iq_balancercxx . . $ airspyhf_device#iq_balancer.);
1155
1156 pthread_cond_destroycxx . . $ pthread_cond_destroy(98095c34a2b0149d).(&device->consumer_cvcxx . . $ airspyhf_device#consumer_cv.);
1157 pthread_mutex_destroycxx . . $ pthread_mutex_destroy(d89ae235521888f9).(&device->consumer_mpcxx . . $ airspyhf_device#consumer_mp.);
1158
1159 freecxx . . $ free(5d22bdacc48458e8).(device);
1160 }
1161
1162 return result;
1163 }
1164
1165 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_get_output_sizecxx . . $ airspyhf_get_output_size(8c7809d1dae8c2a1).(airspyhf_device_tcxx . . $ airspyhf_device_t# * device)
1166 {
1167 // Todo: Make this configurable
1168 return SAMPLES_TO_TRANSFERcxx . . $ `libairspyhf/src/airspyhf.c:55:9`!;
1169 }
1170
1171 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_is_low_ifcxx . . $ airspyhf_is_low_if(8c7809d1dae8c2a1).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device)
1172 {
1173 return device->is_low_ifcxx . . $ airspyhf_device#is_low_if.;
1174 }
1175
1176 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_get_sampleratescxx . . $ airspyhf_get_samplerates(ef403350d3b5d991).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, uint32_tcxx . . $ uint32_t#* buffer, const uint32_tcxx . . $ uint32_t# len)
1177 {
1178 if (len == 0)
1179 {
1180 *buffer = device->supported_samplerate_countcxx . . $ airspyhf_device#supported_samplerate_count.;
1181 }
1182 else if (len <= device->supported_samplerate_countcxx . . $ airspyhf_device#supported_samplerate_count.)
1183 {
1184 memcpycxx . . $ memcpy(cc817cb175f282d).(buffer, device->supported_sampleratescxx . . $ airspyhf_device#supported_samplerates., len * sizeof(uint32_tcxx . . $ uint32_t#));
1185 }
1186 else
1187 {
1188 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1189 }
1190
1191 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1192 }
1193
1194 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_sampleratecxx . . $ airspyhf_set_samplerate(3b61eab5ff86a8).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, uint32_tcxx . . $ uint32_t# samplerate)
1195 {
1196 int result;
1197 uint32_tcxx . . $ uint32_t# i;
1198 uint8_tcxx . . $ uint8_t# gain;
1199
1200 if (samplerate > MAX_SAMPLERATE_INDEXcxx . . $ `libairspyhf/src/airspyhf.c:61:9`!)
1201 {
1202 for (i = 0; i < device->supported_samplerate_countcxx . . $ airspyhf_device#supported_samplerate_count.; i++)
1203 {
1204 if (samplerate == device->supported_sampleratescxx . . $ airspyhf_device#supported_samplerates.[i])
1205 {
1206 samplerate = i;
1207 break;
1208 }
1209 }
1210 }
•1211
1212 if (samplerate >= device->supported_samplerate_countcxx . . $ airspyhf_device#supported_samplerate_count.)
1213 {
1214 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1215 }
1216
1217 device->current_sampleratecxx . . $ airspyhf_device#current_samplerate. = device->supported_sampleratescxx . . $ airspyhf_device#supported_samplerates.[samplerate];
1218 device->is_low_ifcxx . . $ airspyhf_device#is_low_if. = device->samplerate_architecturescxx . . $ airspyhf_device#samplerate_architectures.[samplerate];
1219
1220 libusb_clear_haltcxx . . $ libusb_clear_halt(26f41c4669023bdf).(device->usb_devicecxx . . $ airspyhf_device#usb_device., LIBUSB_ENDPOINT_INcxx . . $ LIBUSB_ENDPOINT_IN. | 1);
1221
1222 if (!device->is_low_ifcxx . . $ airspyhf_device#is_low_if. && device->freq_khzcxx . . $ airspyhf_device#freq_khz. < MIN_ZERO_IF_LOcxx . . $ `libairspyhf/src/airspyhf.c:70:9`!)
1223 {
1224 uint8_tcxx . . $ uint8_t# buf[4];
1225 buf[0] = (uint8_tcxx . . $ uint8_t#)((MIN_ZERO_IF_LOcxx . . $ `libairspyhf/src/airspyhf.c:70:9`! >> 24) & 0xff);
1226 buf[1] = (uint8_tcxx . . $ uint8_t#)((MIN_ZERO_IF_LOcxx . . $ `libairspyhf/src/airspyhf.c:70:9`! >> 16) & 0xff);
1227 buf[2] = (uint8_tcxx . . $ uint8_t#)((MIN_ZERO_IF_LOcxx . . $ `libairspyhf/src/airspyhf.c:70:9`! >> 8) & 0xff);
1228 buf[3] = (uint8_tcxx . . $ uint8_t#)((MIN_ZERO_IF_LOcxx . . $ `libairspyhf/src/airspyhf.c:70:9`!) & 0xff);
1229
1230 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1231 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1232 LIBUSB_ENDPOINT_OUTcxx . . $ LIBUSB_ENDPOINT_OUT. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1233 AIRSPYHF_SET_FREQcxx . . $ AIRSPYHF_SET_FREQ.,
1234 0,
1235 0,
1236 (unsigned char*) &buf,
1237 sizeof(buf),
1238 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1239
1240 if (result < sizeof(buf))
1241 {
1242 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1243 }
1244
1245 device->freq_khzcxx . . $ airspyhf_device#freq_khz. = MIN_ZERO_IF_LOcxx . . $ `libairspyhf/src/airspyhf.c:70:9`!;
1246 }
1247
1248 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1249 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1250 LIBUSB_ENDPOINT_OUTcxx . . $ LIBUSB_ENDPOINT_OUT. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1251 AIRSPYHF_SET_SAMPLERATEcxx . . $ AIRSPYHF_SET_SAMPLERATE.,
1252 0,
1253 samplerate,
1254 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
1255 0,
1256 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1257
1258 if (result != 0)
1259 {
1260 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1261 }
1262
1263 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1264 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1265 LIBUSB_ENDPOINT_INcxx . . $ LIBUSB_ENDPOINT_IN. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1266 AIRSPYHF_GET_FILTER_GAINcxx . . $ AIRSPYHF_GET_FILTER_GAIN.,
•1267 0,
1268 0,
1269 &gain,
1270 sizeof(uint8_tcxx . . $ uint8_t#),
1271 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1272
1273 if (result == sizeof(uint8_tcxx . . $ uint8_t#))
1274 {
•1275 device->filter_gaincxx . . $ airspyhf_device#filter_gain. = powfcxx . . $ powf(d59a45cd3bfd2eda).(10.0f, (float) gain * -0.05f);
1276 }
1277 else
•1278 {
1279 device->filter_gaincxx . . $ airspyhf_device#filter_gain. = 1.0;
1280 }
1281
1282 airspyhf_set_freq_doublecxx . . $ airspyhf_set_freq_double(3f67ae1e757fcd16).(device, device->freq_hzcxx . . $ airspyhf_device#freq_hz.);
1283
1284 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1285 }
1286
•1287 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_receiver_modecxx . . $ airspyhf_set_receiver_mode(b46a2f0298a1223c).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, receiver_mode_tcxx . . $ receiver_mode_t# value)
1288 {
1289 int result;
•1290 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1291 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1292 LIBUSB_ENDPOINT_OUTcxx . . $ LIBUSB_ENDPOINT_OUT. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
•1293 AIRSPYHF_RECEIVER_MODEcxx . . $ AIRSPYHF_RECEIVER_MODE.,
1294 value,
1295 0,
1296 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
•1297 0,
1298 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1299
•1300 if (result != 0)
1301 {
1302 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1303 }
•1304
1305 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1306 }
1307
1308 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_startcxx . . $ airspyhf_start(26a6fb14f1caab1c).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, airspyhf_sample_block_cb_fncxx . . $ airspyhf_sample_block_cb_fn# callback, void* ctx)
1309 {
1310 int result;
1311
1312 memsetcxx . . $ memset(d1de1e4fb215f1c6).(device->dropped_buffers_queuecxx . . $ airspyhf_device#dropped_buffers_queue., 0, RAW_BUFFER_COUNTcxx . . $ `libairspyhf/src/airspyhf.c:58:9`! * sizeof(uint32_tcxx . . $ uint32_t#));
1313 device->dropped_bufferscxx . . $ airspyhf_device#dropped_buffers. = 0;
1314
•1315 device->veccxx . . $ airspyhf_device#vec..recxx . . $ $anonymous_type_804d0b7c756f111f_0#re. = 1.0f;
1316 device->veccxx . . $ airspyhf_device#vec..imcxx . . $ $anonymous_type_804d0b7c756f111f_0#im. = 0.0f;
1317
1318 result = airspyhf_set_receiver_modecxx . . $ airspyhf_set_receiver_mode(b46a2f0298a1223c).(device, RECEIVER_MODE_OFFcxx . . $ RECEIVER_MODE_OFF.);
1319 if (result != AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.)
1320 {
1321 return result;
1322 }
1323
1324 libusb_clear_haltcxx . . $ libusb_clear_halt(26f41c4669023bdf).(device->usb_devicecxx . . $ airspyhf_device#usb_device., LIBUSB_ENDPOINT_INcxx . . $ LIBUSB_ENDPOINT_IN. | AIRSPYHF_ENDPOINT_INcxx . . $ `libairspyhf/src/airspyhf.h:36:9`!);
•1325
1326 result = airspyhf_set_receiver_modecxx . . $ airspyhf_set_receiver_mode(b46a2f0298a1223c).(device, RECEIVER_MODE_ONcxx . . $ RECEIVER_MODE_ON.);
1327 if (result == AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.)
1328 {
1329 device->ctxcxx . . $ airspyhf_device#ctx. = ctx;
1330 result = create_io_threadscxx . . $ create_io_threads(b21bd461278d4411).(device, callback);
1331 }
1332
1333 return result;
1334 }
1335
1336 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_is_streamingcxx . . $ airspyhf_is_streaming(8c7809d1dae8c2a1).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device)
1337 {
1338 return device->streamingcxx . . $ airspyhf_device#streaming. && !device->stop_requestedcxx . . $ airspyhf_device#stop_requested.;
1339 }
1340
1341 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_stopcxx . . $ airspyhf_stop(8c7809d1dae8c2a1).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device)
1342 {
1343 int result1, result2;
1344 device->stop_requestedcxx . . $ airspyhf_device#stop_requested. = truecxx . . $ `libairspyhf/src/airspyhf.c:44:9`!;
•1345 result1 = airspyhf_set_receiver_modecxx . . $ airspyhf_set_receiver_mode(b46a2f0298a1223c).(device, RECEIVER_MODE_OFFcxx . . $ RECEIVER_MODE_OFF.);
1346 result2 = kill_io_threadscxx . . $ kill_io_threads(8c7809d1dae8c2a1).(device);
1347
1348 #ifndef _WIN32
1349 libusb_interrupt_event_handlercxx . . $ libusb_interrupt_event_handler(265e9f2c873ae37e).(device->usb_contextcxx . . $ airspyhf_device#usb_context.);
1350 #endif
1351
1352 if (result2 != AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.)
1353 {
1354 return result2;
1355 }
1356 return result1;
1357 }
1358
1359
1360 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_freqcxx . . $ airspyhf_set_freq(3b61eab5ff86a8).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, const uint32_tcxx . . $ uint32_t# freq_hz)
1361 {
1362 return airspyhf_set_freq_doublecxx . . $ airspyhf_set_freq_double(3f67ae1e757fcd16).(device, freq_hz);
1363 }
1364
1365 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_freq_doublecxx . . $ airspyhf_set_freq_double(3f67ae1e757fcd16).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, const double freq_hz)
1366 {
1367 int result;
1368 uint8_tcxx . . $ uint8_t# buf[4];
1369 double if_shift = (device->enable_dspcxx . . $ airspyhf_device#enable_dsp. && !device->is_low_ifcxx . . $ airspyhf_device#is_low_if.) ? DEFAULT_IF_SHIFTcxx . . $ `libairspyhf/src/airspyhf.c:69:9`! : 0;
1370 double adjusted_freq_hz = freq_hz * (1.0e9 + device->calibration_ppbcxx . . $ airspyhf_device#calibration_ppb.) * 1.0e-9;
1371 uint32_tcxx . . $ uint32_t# lo_low_khz = device->is_low_ifcxx . . $ airspyhf_device#is_low_if. ? MIN_LOW_IF_LOcxx . . $ `libairspyhf/src/airspyhf.c:71:9`! : MIN_ZERO_IF_LOcxx . . $ `libairspyhf/src/airspyhf.c:70:9`!;
1372 uint32_tcxx . . $ uint32_t# freq_khz = MAXcxx . . $ `libairspyhf/src/airspyhf.c:52:9`!(lo_low_khz, (uint32_t)round((adjusted_freq_hz + if_shift) * 1e-3));
1373
1374 if (device->freq_khzcxx . . $ airspyhf_device#freq_khz. != freq_khz)
1375 {
•1376 buf[0] = (uint8_tcxx . . $ uint8_t#)((freq_khz >> 24) & 0xff);
1377 buf[1] = (uint8_tcxx . . $ uint8_t#)((freq_khz >> 16) & 0xff);
1378 buf[2] = (uint8_tcxx . . $ uint8_t#)((freq_khz >> 8) & 0xff);
1379 buf[3] = (uint8_tcxx . . $ uint8_t#)((freq_khz) & 0xff);
1380
1381 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1382 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1383 LIBUSB_ENDPOINT_OUTcxx . . $ LIBUSB_ENDPOINT_OUT. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1384 AIRSPYHF_SET_FREQcxx . . $ AIRSPYHF_SET_FREQ.,
1385 0,
1386 0,
1387 (unsigned char*)&buf,
1388 sizeof(buf),
1389 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1390
1391 if (result < sizeof(buf))
1392 {
1393 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1394 }
1395
1396 device->freq_khzcxx . . $ airspyhf_device#freq_khz. = freq_khz;
1397
1398 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1399 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1400 LIBUSB_ENDPOINT_INcxx . . $ LIBUSB_ENDPOINT_IN. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1401 AIRSPYHF_GET_FREQ_DELTAcxx . . $ AIRSPYHF_GET_FREQ_DELTA.,
1402 0,
1403 0,
1404 (unsigned char*)&buf,
1405 sizeof(buf),
1406 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1407
1408 if (result == sizeof(buf))
1409 {
1410 device->freq_delta_hzcxx . . $ airspyhf_device#freq_delta_hz. = (((int8_tcxx . . $ int8_t#)buf[3] << 16) | (buf[2] << 8) | buf[1]) * 1e3 / (1 << buf[0]);
1411 }
1412
•1413 iq_balancer_set_optimal_pointcxx . . $ iq_balancer_set_optimal_point(c504ce643fd160b2).(device->iq_balancercxx . . $ airspyhf_device#iq_balancer., device->optimal_pointcxx . . $ airspyhf_device#optimal_point.);
1414 }
1415
1416 device->freq_hzcxx . . $ airspyhf_device#freq_hz. = freq_hz;
1417 device->freq_shiftcxx . . $ airspyhf_device#freq_shift. = adjusted_freq_hz - freq_khz * 1e3 + device->freq_delta_hzcxx . . $ airspyhf_device#freq_delta_hz.;
1418
1419 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1420 }
1421
1422 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_get_frontend_optionscxx . . $ airspyhf_get_frontend_options(5492bb74460c0419).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, uint32_tcxx . . $ uint32_t#* flags)
1423 {
1424 if (flags)
1425 {
1426 *flags = device->frontend_optionscxx . . $ airspyhf_device#frontend_options.;
1427 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1428 }
1429
1430 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1431 }
1432
1433 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_frontend_optionscxx . . $ airspyhf_set_frontend_options(3b61eab5ff86a8).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, uint32_tcxx . . $ uint32_t# flags)
1434 {
1435 int result;
1436
1437 device->frontend_optionscxx . . $ airspyhf_device#frontend_options. = flags;
1438
1439 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1440 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1441 LIBUSB_ENDPOINT_OUTcxx . . $ LIBUSB_ENDPOINT_OUT. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1442 AIRSPYHF_SET_FRONTEND_OPTIONScxx . . $ AIRSPYHF_SET_FRONTEND_OPTIONS.,
1443 (uint16_tcxx . . $ uint16_t#)(flags & 0xffff),
1444 (uint16_tcxx . . $ uint16_t#)(flags >> 16),
1445 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
1446 0,
1447 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1448
1449 if (result < 0)
1450 {
1451 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1452 }
1453 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1454 }
1455
1456 static int airspyhf_config_writecxx . . $ airspyhf_config_write(d19a4bd7451812ec).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, uint8_tcxx . . $ uint8_t# *buffer, uint16_tcxx . . $ uint16_t# length)
•1457 {
1458 int result;
1459 uint8_tcxx . . $ uint8_t# buf[256];
1460
1461 memsetcxx . . $ memset(d1de1e4fb215f1c6).(buf, 0, sizeof(buf));
1462
1463 memcpycxx . . $ memcpy(cc817cb175f282d).(buf, buffer, MINcxx . . $ `libairspyhf/src/airspyhf.c:53:9`!(length, sizeof(buf)));
1464
1465 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1466 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1467 LIBUSB_ENDPOINT_OUTcxx . . $ LIBUSB_ENDPOINT_OUT. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1468 AIRSPYHF_CONFIG_WRITEcxx . . $ AIRSPYHF_CONFIG_WRITE.,
1469 0,
1470 0,
1471 buf,
1472 sizeof(buf),
1473 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1474
•1475 if (result < sizeof(buf))
1476 {
1477 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1478 }
1479
1480 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1481 }
1482
1483 static int airspyhf_config_readcxx . . $ airspyhf_config_read(d19a4bd7451812ec).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, uint8_tcxx . . $ uint8_t# *buffer, uint16_tcxx . . $ uint16_t# length)
1484 {
1485 uint8_tcxx . . $ uint8_t# buf[256];
1486 int result;
1487
1488 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1489 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1490 LIBUSB_ENDPOINT_INcxx . . $ LIBUSB_ENDPOINT_IN. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1491 AIRSPYHF_CONFIG_READcxx . . $ AIRSPYHF_CONFIG_READ.,
1492 0,
1493 0,
1494 buf,
1495 sizeof(buf),
1496 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1497
1498 memcpycxx . . $ memcpy(cc817cb175f282d).(buffer, buf, MINcxx . . $ `libairspyhf/src/airspyhf.c:53:9`!(length, sizeof(buf)));
1499
1500 if (result < sizeof(buf))
1501 {
1502 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1503 }
1504
1505 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1506 }
1507
1508 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_get_calibrationcxx . . $ airspyhf_get_calibration(f510f6d1ef2143b9).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, int32_tcxx . . $ int32_t#* ppb)
1509 {
1510 if (ppb)
1511 {
1512 *ppb = device->calibration_ppbcxx . . $ airspyhf_device#calibration_ppb.;
1513 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1514 }
1515
1516 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1517 }
1518
1519 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_calibrationcxx . . $ airspyhf_set_calibration(bf53c478d047b2cb).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, int32_tcxx . . $ int32_t# ppb)
1520 {
1521 device->calibration_ppbcxx . . $ airspyhf_device#calibration_ppb. = ppb;
1522 return airspyhf_set_freq_doublecxx . . $ airspyhf_set_freq_double(3f67ae1e757fcd16).(device, device->freq_hzcxx . . $ airspyhf_device#freq_hz.);
1523 }
1524
1525 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_get_vctcxo_calibrationcxx . . $ airspyhf_get_vctcxo_calibration(b95c3368263492bb).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, uint16_tcxx . . $ uint16_t#* vc)
1526 {
1527 if (vc)
1528 {
1529 *vc = device->calibration_vctcxocxx . . $ airspyhf_device#calibration_vctcxo.;
1530 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1531 }
1532
1533 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1534 }
1535
1536 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_vctcxo_calibrationcxx . . $ airspyhf_set_vctcxo_calibration(7be315573390cc5c).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, uint16_tcxx . . $ uint16_t# vc)
1537 {
1538 int result;
1539 device->calibration_vctcxocxx . . $ airspyhf_device#calibration_vctcxo. = vc;
1540
1541 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1542 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1543 LIBUSB_ENDPOINT_OUTcxx . . $ LIBUSB_ENDPOINT_OUT. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1544 AIRSPYHF_SET_VCTCXO_CALIBRATIONcxx . . $ AIRSPYHF_SET_VCTCXO_CALIBRATION.,
1545 vc,
1546 0,
1547 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
1548 0,
1549 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1550
1551 if (result < 0)
1552 {
1553 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1554 }
1555 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1556 }
1557
1558 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_flash_configurationcxx . . $ airspyhf_flash_configuration(8c7809d1dae8c2a1).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device)
1559 {
1560 flash_config_tcxx . . $ flash_config_t# config;
1561 config.magic_numbercxx . . $ flash_config#magic_number. = CALIBRATION_MAGICcxx . . $ `libairspyhf/src/airspyhf.c:67:9`!;
1562 config.calibration_ppbcxx . . $ flash_config#calibration_ppb. = device->calibration_ppbcxx . . $ airspyhf_device#calibration_ppb.;
1563 config.calibration_vctcxocxx . . $ flash_config#calibration_vctcxo. = device->calibration_vctcxocxx . . $ airspyhf_device#calibration_vctcxo.;
1564 config.frontend_optionscxx . . $ flash_config#frontend_options. = device->frontend_optionscxx . . $ airspyhf_device#frontend_options.;
1565
1566 if (airspyhf_is_streamingcxx . . $ airspyhf_is_streaming(8c7809d1dae8c2a1).(device))
1567 {
1568 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1569 }
1570
1571 if (airspyhf_config_writecxx . . $ airspyhf_config_write(d19a4bd7451812ec).(device, (uint8_tcxx . . $ uint8_t# *)&config, sizeof(config)) != AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.)
1572 {
1573 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1574 }
1575
1576 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1577 }
1578
1579 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_optimal_iq_correction_pointcxx . . $ airspyhf_set_optimal_iq_correction_point(39475226412345f0).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, float w)
1580 {
1581 device->optimal_pointcxx . . $ airspyhf_device#optimal_point. = w;
1582 iq_balancer_set_optimal_pointcxx . . $ iq_balancer_set_optimal_point(c504ce643fd160b2).(device->iq_balancercxx . . $ airspyhf_device#iq_balancer., device->optimal_pointcxx . . $ airspyhf_device#optimal_point.);
1583 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1584 }
1585
1586 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_iq_balancer_configurecxx . . $ airspyhf_iq_balancer_configure(9682f519bafe42c5).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, int buffers_to_skip, int fft_integration, int fft_overlap, int correlation_integration)
1587 {
1588 iq_balancer_configurecxx . . $ iq_balancer_configure(bdd3903c2d61444).(device->iq_balancercxx . . $ airspyhf_device#iq_balancer., buffers_to_skip, fft_integration, fft_overlap, correlation_integration);
1589 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1590 }
1591
1592 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_lib_dspcxx . . $ airspyhf_set_lib_dsp(145ddc4e6302caa9).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, const uint8_tcxx . . $ uint8_t# flag)
1593 {
1594 device->enable_dspcxx . . $ airspyhf_device#enable_dsp. = flag;
1595 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1596 }
1597
1598 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_board_partid_serialno_readcxx . . $ airspyhf_board_partid_serialno_read(a67231f057e775bd).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, airspyhf_read_partid_serialno_tcxx . . $ airspyhf_read_partid_serialno_t#* read_partid_serialno)
1599 {
1600 uint8_tcxx . . $ uint8_t# length;
1601 int result;
1602
1603 length = sizeof(airspyhf_read_partid_serialno_tcxx . . $ airspyhf_read_partid_serialno_t#);
1604 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1605 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1606 LIBUSB_ENDPOINT_INcxx . . $ LIBUSB_ENDPOINT_IN. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1607 AIRSPYHF_GET_SERIALNO_BOARDIDcxx . . $ AIRSPYHF_GET_SERIALNO_BOARDID.,
1608 0,
1609 0,
1610 (unsigned char*)read_partid_serialno,
1611 length,
1612 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1613
1614 if (result < length)
1615 {
1616 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1617 }
1618
1619 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1620 }
1621
1622 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_version_string_readcxx . . $ airspyhf_version_string_read(164cd697071f7e15).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, char* version, uint8_tcxx . . $ uint8_t# length)
1623 {
1624 int result;
1625 char version_local[MAX_VERSION_STRING_SIZEcxx . . $ `libairspyhf/src/airspyhf.h:107:9`!];
1626
1627 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1628 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1629 LIBUSB_ENDPOINT_INcxx . . $ LIBUSB_ENDPOINT_IN. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1630 AIRSPYHF_GET_VERSION_STRINGcxx . . $ AIRSPYHF_GET_VERSION_STRING.,
1631 0,
1632 0,
1633 (unsigned char*) version_local,
1634 (MAX_VERSION_STRING_SIZEcxx . . $ `libairspyhf/src/airspyhf.h:107:9`! - 1),
1635 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1636
1637 if (result < 0)
1638 {
1639 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1640 }
1641 else
1642 {
1643 if (length > 0)
1644 {
1645 memcpycxx . . $ memcpy(cc817cb175f282d).(version, version_local, length - 1);
1646 version[length - 1] = 0;
1647 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1648 }
1649 else
1650 {
1651 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1652 }
1653 }
1654 }
1655
1656 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_get_att_stepscxx . . $ airspyhf_get_att_steps(baab7b448cad015).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, void* buffer, const uint32_tcxx . . $ uint32_t# len)
1657 {
1658 if (len == 0)
•1659 {
1660 *(uint32_tcxx . . $ uint32_t#*)buffer = device->supported_att_step_countcxx . . $ airspyhf_device#supported_att_step_count.;
1661 }
1662 else if (len <= device->supported_att_step_countcxx . . $ airspyhf_device#supported_att_step_count.)
1663 {
1664 memcpycxx . . $ memcpy(cc817cb175f282d).(buffer, device->supported_att_stepscxx . . $ airspyhf_device#supported_att_steps., len * sizeof(float));
1665 }
1666 else
1667 {
1668 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1669 }
1670
1671 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1672 }
1673
1674 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_attcxx . . $ airspyhf_set_att(39475226412345f0).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, float att)
1675 {
1676 int result;
1677 uint16_tcxx . . $ uint16_t# att_index = 0;
1678
1679 for (uint32_tcxx . . $ uint32_t# i = 0; i < device->supported_att_step_countcxx . . $ airspyhf_device#supported_att_step_count.; i++)
1680 {
1681 if (device->supported_att_stepscxx . . $ airspyhf_device#supported_att_steps.[i] >= att)
1682 {
1683 att_index = i;
1684 break;
1685 }
1686 }
1687
1688 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1689 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1690 LIBUSB_ENDPOINT_OUTcxx . . $ LIBUSB_ENDPOINT_OUT. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1691 AIRSPYHF_SET_ATTcxx . . $ AIRSPYHF_SET_ATT.,
1692 att_index,
1693 0,
1694 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
1695 0,
1696 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1697
1698 if (result < 0)
1699 {
1700 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1701 }
1702
1703 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1704 }
1705
1706 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_bias_teecxx . . $ airspyhf_set_bias_tee(29c5d5b98578033a).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, int8_tcxx . . $ int8_t# value)
1707 {
1708 int result;
1709
1710 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1711 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1712 LIBUSB_ENDPOINT_OUTcxx . . $ LIBUSB_ENDPOINT_OUT. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1713 AIRSPYHF_SET_BIAS_TEEcxx . . $ AIRSPYHF_SET_BIAS_TEE.,
1714 (uint16_tcxx . . $ uint16_t#)value,
1715 0,
1716 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
1717 0,
1718 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1719
1720 if (result < 0)
1721 {
1722 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1723 }
1724
1725 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1726 }
1727
1728 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_get_bias_tee_countcxx . . $ airspyhf_get_bias_tee_count(f510f6d1ef2143b9).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, int32_tcxx . . $ int32_t#* value)
1729 {
1730 uint8_tcxx . . $ uint8_t# length;
1731 int result;
1732
•1733 length = sizeof(int32_tcxx . . $ int32_t#);
1734 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1735 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1736 LIBUSB_ENDPOINT_INcxx . . $ LIBUSB_ENDPOINT_IN. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1737 AIRSPYHF_GET_BIAS_TEE_COUNTcxx . . $ AIRSPYHF_GET_BIAS_TEE_COUNT.,
1738 0,
1739 0,
1740 (unsigned char*)value,
1741 length,
1742 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1743
1744 if (result < length)
1745 {
1746 *value = 0;
1747 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1748 }
1749
1750 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1751 }
1752
1753 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_get_bias_tee_namecxx . . $ airspyhf_get_bias_tee_name(4c75e63972619ffc).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, int32_tcxx . . $ int32_t# index, char* version, uint8_tcxx . . $ uint8_t# length)
1754 {
1755 int result;
1756 char name_local[MAX_NAME_STRING_SIZEcxx . . $ `libairspyhf/src/airspyhf.h:106:9`!];
1757
1758 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1759 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1760 LIBUSB_ENDPOINT_INcxx . . $ LIBUSB_ENDPOINT_IN. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1761 AIRSPYHF_GET_BIAS_TEE_NAMEcxx . . $ AIRSPYHF_GET_BIAS_TEE_NAME.,
1762 0,
1763 (int16_tcxx . . $ int16_t#)index,
1764 (unsigned char*)name_local,
1765 (MAX_NAME_STRING_SIZEcxx . . $ `libairspyhf/src/airspyhf.h:106:9`! - 1),
1766 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1767
1768 if (result < 0)
1769 {
1770 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1771 }
1772 else
1773 {
1774 if (length > 0)
1775 {
1776 memcpycxx . . $ memcpy(cc817cb175f282d).(version, name_local, length - 1);
1777 version[length - 1] = 0;
1778 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1779 }
1780 else
1781 {
1782 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1783 }
1784 }
1785 }
1786
1787 // Legacy for HF+ dual and HF+ Discovery
1788
1789 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_hf_attcxx . . $ airspyhf_set_hf_att(145ddc4e6302caa9).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, uint8_tcxx . . $ uint8_t# att_index)
1790 {
1791 int result;
1792
1793 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1794 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1795 LIBUSB_ENDPOINT_OUTcxx . . $ LIBUSB_ENDPOINT_OUT. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1796 AIRSPYHF_SET_ATTcxx . . $ AIRSPYHF_SET_ATT.,
1797 (uint16_tcxx . . $ uint16_t#)att_index,
1798 0,
1799 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
1800 0,
1801 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1802
1803 if (result < 0)
1804 {
1805 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1806 }
1807
1808 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1809 }
1810
1811 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_hf_lnacxx . . $ airspyhf_set_hf_lna(145ddc4e6302caa9).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, uint8_tcxx . . $ uint8_t# flag)
1812 {
1813 int result;
1814
1815 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1816 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1817 LIBUSB_ENDPOINT_OUTcxx . . $ LIBUSB_ENDPOINT_OUT. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1818 AIRSPYHF_SET_LNAcxx . . $ AIRSPYHF_SET_LNA.,
1819 (uint16_tcxx . . $ uint16_t#) flag,
1820 0,
1821 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
1822 0,
1823 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1824
1825 if (result < 0)
1826 {
1827 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1828 }
1829
1830 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1831 }
1832
1833 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_user_outputcxx . . $ airspyhf_set_user_output(7d2e1608174c210e).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, airspyhf_user_output_tcxx . . $ airspyhf_user_output_t# pin, airspyhf_user_output_state_tcxx . . $ airspyhf_user_output_state_t# value)
1834 {
1835 int result;
1836
1837 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1838 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1839 LIBUSB_ENDPOINT_OUTcxx . . $ LIBUSB_ENDPOINT_OUT. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1840 AIRSPYHF_SET_USER_OUTPUTcxx . . $ AIRSPYHF_SET_USER_OUTPUT.,
1841 (uint16_tcxx . . $ uint16_t#)pin,
1842 (uint16_tcxx . . $ uint16_t#)value,
1843 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
1844 0,
1845 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1846
1847 if (result < 0)
1848 {
1849 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1850 }
1851
1852 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1853 }
1854
1855 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_hf_agccxx . . $ airspyhf_set_hf_agc(145ddc4e6302caa9).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, uint8_tcxx . . $ uint8_t# flag)
1856 {
1857 int result;
1858
1859 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1860 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1861 LIBUSB_ENDPOINT_OUTcxx . . $ LIBUSB_ENDPOINT_OUT. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1862 AIRSPYHF_SET_AGCcxx . . $ AIRSPYHF_SET_AGC.,
1863 (uint16_tcxx . . $ uint16_t#)flag,
1864 0,
1865 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
1866 0,
1867 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1868
1869 if (result < 0)
1870 {
1871 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1872 }
1873
1874 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1875 }
1876
1877 int ADDCALLcxx . . $ `libairspyhf/src/airspyhf.h:55:10`! airspyhf_set_hf_agc_thresholdcxx . . $ airspyhf_set_hf_agc_threshold(145ddc4e6302caa9).(airspyhf_device_tcxx . . $ airspyhf_device_t#* device, uint8_tcxx . . $ uint8_t# flag)
1878 {
1879 int result;
1880
1881 result = libusb_control_transfercxx . . $ libusb_control_transfer(fcce3e421b8d9f8d).(
1882 device->usb_devicecxx . . $ airspyhf_device#usb_device.,
1883 LIBUSB_ENDPOINT_OUTcxx . . $ LIBUSB_ENDPOINT_OUT. | LIBUSB_REQUEST_TYPE_VENDORcxx . . $ LIBUSB_REQUEST_TYPE_VENDOR. | LIBUSB_RECIPIENT_DEVICEcxx . . $ LIBUSB_RECIPIENT_DEVICE.,
1884 AIRSPYHF_SET_AGC_THRESHOLDcxx . . $ AIRSPYHF_SET_AGC_THRESHOLD.,
1885 (uint16_tcxx . . $ uint16_t#)flag,
1886 0,
1887 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
1888 0,
1889 LIBUSB_CTRL_TIMEOUT_MScxx . . $ `libairspyhf/src/airspyhf.c:80:9`!);
1890
1891 if (result < 0)
1892 {
1893 return AIRSPYHF_ERRORcxx . . $ AIRSPYHF_ERROR.;
1894 }
1895
1896 return AIRSPYHF_SUCCESScxx . . $ AIRSPYHF_SUCCESS.;
1897 }