sdrangel/devices/bladerf2/devicebladerf2shared.h

79 wiersze
2.9 KiB
C
Czysty Zwykły widok Historia

2018-09-23 17:56:24 +00:00
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 Edouard Griffiths, F4EXB //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#ifndef DEVICES_BLADERF2_DEVICEBLADERF2SHARED_H_
#define DEVICES_BLADERF2_DEVICEBLADERF2SHARED_H_
2018-09-24 06:43:16 +00:00
#include "util/message.h"
2018-09-23 17:56:24 +00:00
#include "devicebladerf2.h"
class SampleSinkFifo;
class SampleSourceFifo;
class BladeRF2Input;
2018-09-23 17:56:24 +00:00
/**
* Structure shared by a buddy with other buddies
*/
class DEVICES_API DeviceBladeRF2Shared
{
public:
2018-09-24 06:43:16 +00:00
class MsgReportBuddyChange : public Message {
MESSAGE_CLASS_DECLARATION
public:
uint64_t getCenterFrequency() const { return m_centerFrequency; }
int getDevSampleRate() const { return m_devSampleRate; }
bool getRxElseTx() const { return m_rxElseTx; }
2018-09-24 06:43:16 +00:00
static MsgReportBuddyChange* create(
uint64_t centerFrequency,
int devSampleRate,
bool rxElseTx)
2018-09-24 06:43:16 +00:00
{
return new MsgReportBuddyChange(
centerFrequency,
devSampleRate,
rxElseTx);
2018-09-24 06:43:16 +00:00
}
private:
uint64_t m_centerFrequency; //!< Center frequency
int m_devSampleRate; //!< device/host sample rate
bool m_rxElseTx; //!< tells which side initiated the message
2018-09-24 06:43:16 +00:00
MsgReportBuddyChange(
uint64_t centerFrequency,
int devSampleRate,
bool rxElseTx) :
2018-09-24 06:43:16 +00:00
Message(),
m_centerFrequency(centerFrequency),
m_devSampleRate(devSampleRate),
2018-09-24 06:43:16 +00:00
m_rxElseTx(rxElseTx)
{ }
};
2018-09-23 17:56:24 +00:00
DeviceBladeRF2Shared();
~DeviceBladeRF2Shared();
DeviceBladeRF2 *m_dev;
int m_channel; //!< allocated channel (-1 if none)
BladeRF2Input *m_source;
2018-09-23 17:56:24 +00:00
};
#endif /* DEVICES_BLADERF2_DEVICEBLADERF2SHARED_H_ */