Closed smileyrekiere closed 6 months ago
This seems to be about HackRF?
Can you add information explaining: how is this linked to SoapySDR? What didn't work, and what (code, example, or wiki) needs to be fixed?
edit: indeed this references hackrf.h verbatim and does not concern SoapySDR. Closing.
@zuckschwerdt Thank-you for pointing out my error. I couldn't figure out why I couldn't find it in https://github.com/greatscottgadgets/hackrf/issues after I wrote it.
Compiling the Example TX code utilizing the transfer and flush callback that is in hackrf.h file, copied to another file rfgen_tx.c
There was a compile error when doing (note: possible fix below, others may run into this issue). If the fix is incorrect possibly understand why.
gcc -o rfgen_tx rfgen_tx.c -lm -lhackrf
~~~~~In file included from rfgen_tx.c:3: /usr/local/include/libhackrf/hackrf.h:1150:21: note: expected ‘hackrf_flush_cb_fn’ {aka ‘void ()(void , int)’} but argument is of type ‘void ()(hackrf_transfer )’ {aka ‘void ()(struct )’}
1150 | hackrf_flush_cb_fn callback,
Needed to change line * void flush_callback(hackrf_transfer transfer) { **
to: *void flush_callback(void transfer, int success) {**
to get the source to compile and run the file.
Verified the signal transmitted and debug printed
hackrf_open hackrf_open_setup libusb_get_configuration result: 0 hackrf_open_setup: set_hackrf_configuration result: 0 libusb_claim_interface result: 0 hackrf_set_freq hackrf_set_txvga_gain hackrf_enable_tx_flush hackrf_close
Thank-you for the Code Example provided by : // Transmit a 440Hz triangle wave through FM (144.5MHz) using the libhackrf API // Copyright (c) 2022 László Baráth "Uncle Dino" HA7DN https://github.com/Sasszem
hackrf_info: hackrf_info version: git-6211fbb0 libhackrf version: git-6211fbb0 (0.8) Found HackRF Index: 0 Serial number: 000000000000000057b068dc22276763 hackrf_open_setup libusb_get_configuration result: 0 hackrf_open_setup: set_hackrf_configuration result: 0 libusb_claim_interface result: 0 Board ID Number: 2 (HackRF One) Firmware Version: 2023.01.1 (API:1.07) Part ID Number: 0xa000cb3c 0x00644754 Hardware Revision: older than r6 Hardware supported by installed firmware: HackRF One hackrf_close
Host code also at 2023.