soapy_support
Utomnia 7 years ago committed by Dimitri Stolnikov
parent 46e95395e0
commit ac1d8ec02d
  1. 19
      lib/sdrplay/sdrplay_source_c.cc

@ -238,7 +238,7 @@ int sdrplay_source_c::work( int noutput_items,
{
for (int i = _buf_offset; i < _dev->samplesPerPacket; i++)
{
*out++ = gr_complex( float(_bufi[i]) * (1.0f/4096.0f), float(_bufq[i]) * (1.0f/4096.0f) );
*out++ = gr_complex( float(_bufi[i]) * (1.0f/2048.0f), float(_bufq[i]) * (1.0f/2048.0f) );
}
cnt -= (_dev->samplesPerPacket - _buf_offset);
}
@ -248,7 +248,7 @@ int sdrplay_source_c::work( int noutput_items,
mir_sdr_ReadPacket(_bufi.data(), _bufq.data(), &sampNum, &grChanged, &rfChanged, &fsChanged);
for (int i = 0; i < _dev->samplesPerPacket; i++)
{
*out++ = gr_complex( float(_bufi[i]) * (1.0f/32768.0f), float(_bufq[i]) * (1.0f/32768.0f) );
*out++ = gr_complex( float(_bufi[i]) * (1.0f/2048.0f), float(_bufq[i]) * (1.0f/2048.0f) );
}
cnt -= _dev->samplesPerPacket;
}
@ -259,7 +259,7 @@ int sdrplay_source_c::work( int noutput_items,
mir_sdr_ReadPacket(_bufi.data(), _bufq.data(), &sampNum, &grChanged, &rfChanged, &fsChanged);
for (int i = 0; i < cnt; i++)
{
*out++ = gr_complex( float(_bufi[i]) * (1.0f/4096.0f), float(_bufq[i]) * (1.0f/4096.0f) );
*out++ = gr_complex( float(_bufi[i]) * (1.0f/2048.0f), float(_bufq[i]) * (1.0f/2048.0f) );
}
_buf_offset = cnt;
}
@ -441,6 +441,7 @@ bool sdrplay_source_c::set_gain_mode( bool automatic, size_t chan )
if (automatic)
{
/* Start AGC */
std::cerr << "AGC not yet implemented" << std::endl;
}
std::cerr << "set_gain_mode end" << std::endl;
@ -572,7 +573,17 @@ double sdrplay_source_c::set_bandwidth( double bandwidth, size_t chan )
double sdrplay_source_c::get_bandwidth( size_t chan )
{
return (double)_dev->bwType * 1000.0;
double tmpbw=0.0f;
if (_dev->bwType == mir_sdr_BW_0_200) tmpbw = 200e3;
else if (_dev->bwType == mir_sdr_BW_0_300) tmpbw = 300e3;
else if (_dev->bwType == mir_sdr_BW_0_600) tmpbw = 600e3;
else if (_dev->bwType == mir_sdr_BW_1_536) tmpbw = 1536e3;
else if (_dev->bwType == mir_sdr_BW_5_000) tmpbw = 5000e3;
else if (_dev->bwType == mir_sdr_BW_6_000) tmpbw = 6000e3;
else if (_dev->bwType == mir_sdr_BW_7_000) tmpbw = 7000e3;
else tmpbw = 8000e3;
return (double)tmpbw;
}
osmosdr::freq_range_t sdrplay_source_c::get_bandwidth_range( size_t chan )

Loading…
Cancel
Save