You see, the basic receive function goes like this:
function [samples, timestamp_out, actual_count, overrun] = receive(obj, num_samples, chan,timeout_ms, timestamp_in)
if nargin < 3
chan = 0;
end
if nargin < 4
timeout_ms = 1000;
end
if nargin < 5
timestamp_in = 0;
end
if ~obj.running
error('please start device');
end
f32=single(zeros(2*num_samples, 1));
metad = libstruct('lms_stream_meta_t');
if timestamp_in == 0
metad.waitForTimestamp=false;
else
metad.waitForTimestamp=true;
end
metad.timestamp=timestamp_in;
if chan==0
rx_stream=obj.rx0_stream;
if isempty(rx_stream)
error('rx0 stream not enabled');
end
else
rx_stream=obj.rx1_stream;
if isempty(rx_stream)
error('rx1 stream not enabled');
end
end
[actual_count, ~, f32, ~]=calllib('libLimeSuite', 'LMS_RecvStream', rx_stream,f32,num_samples,metad,timeout_ms);
samples=(double(f32(1:2:end)) + double(f32(2:2:end))*1j);
timestamp_out = metad.timestamp;
end
Now, in the example that has been provided by jocover, for channel number 1, the OO call resembels:
Samples_Received = dev.receive(Number_Of_Samples_To_Be_Received,0).
However, for channel number 2, chan =1 and not chan = 0.
therefore as from above, nargin>3 but still <4. Therefore i assume the OO call would now be:
Samples_Received = dev.receive(dev, Number_Of_Samples_To_Be_Received,1)
Is that right?
If so, where do i get the value of the variable ‘dev’ from?
Would you like to see the entire limesdr.m program???