1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-05 08:21:16 -05:00

Replace separate create channel methods (BS and CS): Lora Demod

This commit is contained in:
f4exb 2020-10-01 23:23:39 +02:00
parent ef65afea02
commit b8568feb47
2 changed files with 17 additions and 13 deletions

View File

@ -34,18 +34,23 @@ void LoRaPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI->registerRxChannel(LoRaDemod::m_channelIdURI, LoRaDemod::m_channelId, this); m_pluginAPI->registerRxChannel(LoRaDemod::m_channelIdURI, LoRaDemod::m_channelId, this);
} }
void LoRaPlugin::createRxChannel(DeviceAPI *deviceAPI, BasebandSampleSink **bs, ChannelAPI **cs) const
{
if (bs || cs)
{
LoRaDemod *instance = new LoRaDemod(deviceAPI);
if (bs) {
*bs = instance;
}
if (cs) {
*cs = instance;
}
}
}
PluginInstanceGUI* LoRaPlugin::createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const PluginInstanceGUI* LoRaPlugin::createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const
{ {
return LoRaDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel); return LoRaDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel);
} }
BasebandSampleSink* LoRaPlugin::createRxChannelBS(DeviceAPI *deviceAPI) const
{
return new LoRaDemod(deviceAPI);
}
ChannelAPI* LoRaPlugin::createRxChannelCS(DeviceAPI *deviceAPI) const
{
return new LoRaDemod(deviceAPI);
}

View File

@ -18,9 +18,8 @@ public:
const PluginDescriptor& getPluginDescriptor() const; const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual void createRxChannel(DeviceAPI *deviceAPI, BasebandSampleSink **bs, ChannelAPI **cs) const;
virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const; virtual PluginInstanceGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
virtual BasebandSampleSink* createRxChannelBS(DeviceAPI *deviceAPI) const;
virtual ChannelAPI* createRxChannelCS(DeviceAPI *deviceAPI) const;
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;