mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-21 23:55:13 -05:00
BladeRF input: communicate Fc Pos change to buddy to align center frequencies
This commit is contained in:
parent
5c09985664
commit
2a1f0a0d0e
@ -35,31 +35,37 @@ public:
|
||||
|
||||
public:
|
||||
uint64_t getCenterFrequency() const { return m_centerFrequency; }
|
||||
int getFcPos() const { return m_fcPos; }
|
||||
int getDevSampleRate() const { return m_devSampleRate; }
|
||||
bool getRxElseTx() const { return m_rxElseTx; }
|
||||
|
||||
static MsgReportBuddyChange* create(
|
||||
uint64_t centerFrequency,
|
||||
int fcPos,
|
||||
int devSampleRate,
|
||||
bool rxElseTx)
|
||||
{
|
||||
return new MsgReportBuddyChange(
|
||||
centerFrequency,
|
||||
fcPos,
|
||||
devSampleRate,
|
||||
rxElseTx);
|
||||
}
|
||||
|
||||
private:
|
||||
uint64_t m_centerFrequency; //!< Center frequency
|
||||
int m_fcPos; //!< Center frequency position
|
||||
int m_devSampleRate; //!< device/host sample rate
|
||||
bool m_rxElseTx; //!< tells which side initiated the message
|
||||
|
||||
MsgReportBuddyChange(
|
||||
uint64_t centerFrequency,
|
||||
int fcPos,
|
||||
int devSampleRate,
|
||||
bool rxElseTx) :
|
||||
Message(),
|
||||
m_centerFrequency(centerFrequency),
|
||||
m_fcPos(fcPos),
|
||||
m_devSampleRate(devSampleRate),
|
||||
m_rxElseTx(rxElseTx)
|
||||
{ }
|
||||
|
@ -602,6 +602,13 @@ bool BladeRF2Input::handleMessage(const Message& message)
|
||||
{
|
||||
settings.m_devSampleRate = report.getDevSampleRate();
|
||||
settings.m_centerFrequency = report.getCenterFrequency();
|
||||
settings.m_fcPos = (BladeRF2InputSettings::fcPos_t) report.getFcPos();
|
||||
|
||||
BladeRF2InputThread *inputThread = findThread();
|
||||
|
||||
if (inputThread) {
|
||||
inputThread->setFcPos(requestedChannel, (int) settings.m_fcPos);
|
||||
}
|
||||
|
||||
status = bladerf_get_bandwidth(dev, BLADERF_CHANNEL_RX(requestedChannel), &tmp_uint);
|
||||
|
||||
@ -878,6 +885,7 @@ bool BladeRF2Input::applySettings(const BladeRF2InputSettings& settings, bool fo
|
||||
{
|
||||
DeviceBladeRF2Shared::MsgReportBuddyChange *report = DeviceBladeRF2Shared::MsgReportBuddyChange::create(
|
||||
settings.m_centerFrequency,
|
||||
(int) settings.m_fcPos,
|
||||
settings.m_devSampleRate,
|
||||
true);
|
||||
(*itSource)->getSampleSourceInputMessageQueue()->push(report);
|
||||
@ -894,6 +902,7 @@ bool BladeRF2Input::applySettings(const BladeRF2InputSettings& settings, bool fo
|
||||
{
|
||||
DeviceBladeRF2Shared::MsgReportBuddyChange *report = DeviceBladeRF2Shared::MsgReportBuddyChange::create(
|
||||
settings.m_centerFrequency,
|
||||
(int) settings.m_fcPos,
|
||||
settings.m_devSampleRate,
|
||||
true);
|
||||
(*itSink)->getSampleSinkInputMessageQueue()->push(report);
|
||||
|
Loading…
Reference in New Issue
Block a user