mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-07-05 00:18:22 +02:00
add sddc source prototype + add new ATV decoder + fix windows builds
This commit is contained in:
@ -0,0 +1,14 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(sddc_info)
|
||||
|
||||
# Get source files
|
||||
file(GLOB_RECURSE SRC "src/*.cpp")
|
||||
|
||||
# Create executable
|
||||
add_executable(${PROJECT_NAME} ${SRC})
|
||||
|
||||
# Link to librfnm
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE sddc)
|
||||
|
||||
# Create install directive
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
|
@ -0,0 +1,35 @@
|
||||
#include <stdio.h>
|
||||
#include <sddc.h>
|
||||
|
||||
int main() {
|
||||
// Set firmware image path for debugging
|
||||
sddc_set_firmware_path("C:/Users/ryzerth/Downloads/SDDC_FX3 (1).img");
|
||||
|
||||
// List available devices
|
||||
sddc_devinfo_t* devList;
|
||||
int count = sddc_get_device_list(&devList);
|
||||
if (count < 0) {
|
||||
fprintf(stderr, "Failed to list devices: %d\n", count);
|
||||
return -1;
|
||||
}
|
||||
else if (!count) {
|
||||
printf("No device found.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Show the devices in the list
|
||||
for (int i = 0; i < count; i++) {
|
||||
printf("Serial: %s\n", devList[i].serial);
|
||||
printf("Hardware: %s\n", sddc_model_to_string(devList[i].model));
|
||||
printf("Firmware: v%d.%d\n", devList[i].firmwareMajor, devList[i].firmwareMinor);
|
||||
|
||||
// Print separator if needed
|
||||
if (i != count-1) {
|
||||
printf("\n================================================\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Free the device list and exit
|
||||
sddc_free_device_list(devList);
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(sddc_rx)
|
||||
|
||||
# Get source files
|
||||
file(GLOB_RECURSE SRC "src/*.cpp")
|
||||
|
||||
# Create executable
|
||||
add_executable(${PROJECT_NAME} ${SRC})
|
||||
|
||||
# Link to librfnm
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE sddc)
|
||||
|
||||
# Create install directive
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
|
@ -0,0 +1,38 @@
|
||||
#include <stdio.h>
|
||||
#include <sddc.h>
|
||||
|
||||
int main() {
|
||||
// Set firmware image path for debugging
|
||||
sddc_set_firmware_path("C:/Users/ryzerth/Downloads/SDDC_FX3 (1).img");
|
||||
|
||||
// Open the device
|
||||
sddc_dev_t* dev;
|
||||
sddc_error_t err = sddc_open("0009072C00C40C32", &dev);
|
||||
if (err != SDDC_SUCCESS) {
|
||||
printf("Failed to open device: %s (%d)\n", sddc_error_to_string(err), err);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Configure the device
|
||||
sddc_set_samplerate(dev, 8e6);
|
||||
|
||||
// Start the device
|
||||
sddc_start(dev);
|
||||
|
||||
// Continuous read samples
|
||||
const int bufSize = 1e6;
|
||||
int16_t* buffer = new int16_t[bufSize];
|
||||
while (true) {
|
||||
// Read
|
||||
sddc_error_t err = sddc_rx(dev, buffer, bufSize);
|
||||
printf("Samples received: %d\n", err);
|
||||
}
|
||||
|
||||
// Stop the device
|
||||
sddc_stop(dev);
|
||||
|
||||
// Close the device
|
||||
sddc_close(dev);
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user