const char *
rtlsdr_get_device_name(index)
uint32_t index
####
int
rtlsdr_open(dev, index)
SDR::RTLSDR **dev
uint32_t index
####
#include
#include
typedef struct { int a; } s_t;
int open_device(s_t **dev, int index);
int main(void){
s_t *device = NULL;
open_device(&device, 1);
printf("A=%d\n", device->a);
free(device);
}
int open_device(s_t **dev, int index){
*dev = (s_t *)malloc(sizeof(s_t));
(*dev)->a = 42;
return 1;
}
####
my $serial_number = "00000001"; # from dmesg output
my $index = rtlsdr_get_index_by_serial( $serial_number ); # it returns 0, this is not an error value so I think is good
my $name = rtlsdr_get_device_name( $index );
print "device name '$name'\n";
my $device = undef; # = SDL::...->new() ??? # i don't think so/how?
my $status = rtlsdr_open( \$device , $index)
print "status $status for index $index\n";