|No such thing as a small change|
Re: help with XS pointersby bliako (Prior)
|on Jul 31, 2020 at 11:32 UTC||Need Help??|
After you posted more code, I can see that:
And so this:my $device = rtlsdr_get_device_name( $index );
returns the device name as a string, given device index (integer), and not a pointer to a rtlsdr_dev_t structure as you assumed.
I am guessing that one must open a device by specifying the index. The function rtlsdr_open() should probably return the status as an integer and allocates internally the device, that's what I assume when it tells you to supply the double pointer for device: "Give me a memory location and I will do the internal decoration".
Here is a stand-alone C example to demonstrate this pattern:
How does that translate to Perl? Hmmm again a guess: