Because the libbladeRF tests were nested under the libbladeRF build, they were being built with the include paths, library paths, etc. used when building libbladeRF. This was masking build issues that libbladeRF users might experience, such as MS Visual Studio 12 and earlier failing due to a lack of a stdbool.h header. (We now include our stdbool.h, and have an option to disable our C99 compat includes.) Therefore, these tests have been moved in the build hierarchy to avoid cross-pollination of the libbladeRF build environment and the tests' build environment. This should better represent users building against libbladeRF, and hopefully bring issues to light earlier.
41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
/* This program is intended to exercise a situation where sync interfaces
|
|
* are initialized, but not used.
|
|
*
|
|
* Prior to the fix to issue #244, this yielded lockups.
|
|
*/
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <libbladeRF.h>
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
struct bladerf *dev;
|
|
int status;
|
|
|
|
status = bladerf_open(&dev, NULL);
|
|
if (status != 0) {
|
|
fprintf(stderr, "Failed to open device: %s\n",
|
|
bladerf_strerror(status));
|
|
return EXIT_FAILURE;
|
|
}
|
|
|
|
status = bladerf_sync_config(dev, BLADERF_MODULE_RX,
|
|
BLADERF_FORMAT_SC16_Q11,
|
|
64, 16384, 16, 3500);
|
|
|
|
if (status != 0) {
|
|
fprintf(stderr, "Failed to init RX: %s", bladerf_strerror(status));
|
|
}
|
|
|
|
status = bladerf_sync_config(dev, BLADERF_MODULE_TX,
|
|
BLADERF_FORMAT_SC16_Q11,
|
|
64, 16384, 16, 3500);
|
|
|
|
if (status != 0) {
|
|
fprintf(stderr, "Failed to init TX: %s\n", bladerf_strerror(status));
|
|
}
|
|
|
|
bladerf_close(dev);
|
|
return status;
|
|
}
|