mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
SDRPlay API version 3.14 & RSP1B (#1817)
* #1812 sdrplay adds support for RSP1B and changes gain to expose LNA and Baseband gain settings for all tuners. * Updates build to 0.6.1 beta 1. --------- Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -87,6 +87,7 @@ import io.github.dsheirer.source.tuner.sdrplay.rsp1a.IControlRsp1a;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.rsp1a.Rsp1aTunerConfiguration;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.rsp1a.Rsp1aTunerController;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.rsp1a.Rsp1aTunerEditor;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.rsp1b.Rsp1bTunerEditor;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.rsp2.ControlRsp2;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.rsp2.DiscoveredRsp2Tuner;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.rsp2.IControlRsp2;
|
||||
@@ -451,6 +452,8 @@ public class TunerFactory
|
||||
return new Rsp1TunerEditor(userPreferences, tunerManager, discoveredRspTuner);
|
||||
case RSP1A:
|
||||
return new Rsp1aTunerEditor(userPreferences, tunerManager, discoveredRspTuner);
|
||||
case RSP1B:
|
||||
return new Rsp1bTunerEditor(userPreferences, tunerManager, discoveredRspTuner);
|
||||
case RSP2:
|
||||
return new Rsp2TunerEditor(userPreferences, tunerManager, discoveredRspTuner);
|
||||
case RSPdx:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -40,6 +40,7 @@ public enum TunerType
|
||||
RAFAELMICRO_R828D("R828D"),
|
||||
RSP_1("RSP1"),
|
||||
RSP_1A("RSP1A"),
|
||||
RSP_1B("RSP1B"),
|
||||
RSP_2("RSP2"),
|
||||
RSP_DUO_1("RSPduo Tuner 1"),
|
||||
RSP_DUO_2("RSPduo Tuner 2"),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -28,7 +28,6 @@ import io.github.dsheirer.source.tuner.sdrplay.api.callback.IStreamListener;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.Device;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.TunerSelect;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.control.AgcMode;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.GainReduction;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.IfMode;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.LoMode;
|
||||
import io.github.dsheirer.util.ThreadPool;
|
||||
@@ -45,10 +44,11 @@ public abstract class ControlRsp<T extends Device> implements IControlRsp
|
||||
private static final Logger mLog = LoggerFactory.getLogger(ControlRsp.class);
|
||||
private T mDevice;
|
||||
protected RspSampleRate mSampleRate = RspSampleRate.RATE_8_000;
|
||||
protected int mGain;
|
||||
protected int mLNA;
|
||||
protected int mBasebandGainReduction;
|
||||
private IDeviceEventListener mDeviceEventListener;
|
||||
private IStreamListener mStreamListener;
|
||||
protected WeakReference<IGainOverloadListener> mGainOverloadReference;
|
||||
protected WeakReference<ITunerStatusListener> mGainOverloadReference;
|
||||
|
||||
//Streaming control lock and boolean status indicator. Access to the boolean indicator is protected by the lock.
|
||||
protected ReentrantLock mStreamingLock = new ReentrantLock();
|
||||
@@ -242,21 +242,28 @@ public abstract class ControlRsp<T extends Device> implements IControlRsp
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the gain index
|
||||
* @param gain index value (0 - 28)
|
||||
* @throws SDRPlayException
|
||||
*/
|
||||
@Override
|
||||
public void setGain(int gain) throws SDRPlayException
|
||||
public void setGain(int lna, int gr) throws SDRPlayException
|
||||
{
|
||||
validateGain(gain);
|
||||
int lnaLimited = Math.max(lna, 0);
|
||||
lnaLimited = Math.min(lnaLimited, getMaximumLNASetting());
|
||||
|
||||
if(gain != mGain)
|
||||
int grLimited = Math.max(gr, 20);
|
||||
grLimited = Math.min(grLimited, 59);
|
||||
|
||||
if(lna != lnaLimited || gr != grLimited)
|
||||
{
|
||||
mGain = gain;
|
||||
getDevice().getTuner().setGain(mGain);
|
||||
mLog.warn("Setting gain - adjusted LNA from [" + lna + "] to [" + lnaLimited + "] and GR from [" + gr + "] to [" + grLimited + "]");
|
||||
}
|
||||
getDevice().getTuner().setGain(lnaLimited, grLimited);
|
||||
mLNA = lnaLimited;
|
||||
mBasebandGainReduction = grLimited;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getCurrentGain() throws SDRPlayException
|
||||
{
|
||||
return getDevice().getTuner().getGain().getGainValues().getCurrent();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -264,7 +271,7 @@ public abstract class ControlRsp<T extends Device> implements IControlRsp
|
||||
* @param listener to register
|
||||
*/
|
||||
@Override
|
||||
public void setGainOverloadListener(IGainOverloadListener listener)
|
||||
public void setGainOverloadListener(ITunerStatusListener listener)
|
||||
{
|
||||
if(mGainOverloadReference != null && mGainOverloadReference.get() != null)
|
||||
{
|
||||
@@ -289,7 +296,7 @@ public abstract class ControlRsp<T extends Device> implements IControlRsp
|
||||
//Notify an optional weakly referenced, registered listener that gain overload has been acknowledged.
|
||||
if(mGainOverloadReference != null)
|
||||
{
|
||||
IGainOverloadListener listener = mGainOverloadReference.get();
|
||||
ITunerStatusListener listener = mGainOverloadReference.get();
|
||||
|
||||
if(listener != null)
|
||||
{
|
||||
@@ -317,6 +324,17 @@ public abstract class ControlRsp<T extends Device> implements IControlRsp
|
||||
if(hasDevice())
|
||||
{
|
||||
getDevice().getTuner().setFrequency(frequency);
|
||||
|
||||
//Notify an optional weakly referenced, registered listener that gain overload has been acknowledged.
|
||||
if(mGainOverloadReference != null)
|
||||
{
|
||||
ITunerStatusListener listener = mGainOverloadReference.get();
|
||||
|
||||
if(listener != null)
|
||||
{
|
||||
ThreadPool.CACHED.submit(() -> listener.frequencyUpdated());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -343,27 +361,23 @@ public abstract class ControlRsp<T extends Device> implements IControlRsp
|
||||
}
|
||||
|
||||
/**
|
||||
* Current gain index
|
||||
* @return gain index
|
||||
* Current LNA gain setting
|
||||
* @return LNA gain
|
||||
*/
|
||||
@Override
|
||||
public int getGain()
|
||||
public int getLNA()
|
||||
{
|
||||
return mGain;
|
||||
return mLNA;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies that the requested gain index setting is within the range of valid gain values.
|
||||
* @param gain to validate
|
||||
* @throws SDRPlayException if the gain index value is outside the range of valid values.
|
||||
* Current Baseband gain reduction setting
|
||||
* @return baseband gain reduction
|
||||
*/
|
||||
protected void validateGain(int gain) throws SDRPlayException
|
||||
@Override
|
||||
public int getBasebandGainReduction()
|
||||
{
|
||||
if(gain < GainReduction.MIN_GAIN_INDEX || gain > GainReduction.MAX_GAIN_INDEX)
|
||||
{
|
||||
throw new SDRPlayException("Invalid gain index value [" + gain + "]. Valid range is " +
|
||||
GainReduction.MIN_GAIN_INDEX + " - " + GainReduction.MAX_GAIN_INDEX);
|
||||
}
|
||||
return mBasebandGainReduction;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -116,16 +116,36 @@ public interface IControlRsp
|
||||
double getCurrentSampleRate();
|
||||
|
||||
/**
|
||||
* Sets the gain index value.
|
||||
* @param gain index value (0 - 28)
|
||||
* Set the lna state and gain reduction dB values separately.
|
||||
* @param lna state (varies by tuner and frequency range)
|
||||
* @param basebandGainReduction setting (20-59)
|
||||
* @throws SDRPlayException
|
||||
*/
|
||||
void setGain(int gain) throws SDRPlayException;
|
||||
void setGain(int lna, int basebandGainReduction) throws SDRPlayException;
|
||||
|
||||
/**
|
||||
* Current gain index value
|
||||
* @return gain index value (0 - 28)
|
||||
* Current gain setting as reported by the device.
|
||||
* @return gain value in decibels
|
||||
*/
|
||||
int getGain();
|
||||
float getCurrentGain() throws SDRPlayException;
|
||||
|
||||
/**
|
||||
* Current LNA gain index value
|
||||
* @return LNA gain value.
|
||||
*/
|
||||
int getLNA();
|
||||
|
||||
/**
|
||||
* Maximum LNA setting index value.
|
||||
* @return max LNA that varies by tuner type.
|
||||
*/
|
||||
int getMaximumLNASetting();
|
||||
|
||||
/**
|
||||
* Current gain reduction value.
|
||||
* @return gain reduction value.
|
||||
*/
|
||||
int getBasebandGainReduction();
|
||||
|
||||
/**
|
||||
* Current IF AGC mode setting.
|
||||
@@ -143,5 +163,5 @@ public interface IControlRsp
|
||||
* Registers a listener to receive notifications of gain overload.
|
||||
* @param listener to register
|
||||
*/
|
||||
void setGainOverloadListener(IGainOverloadListener listener);
|
||||
void setGainOverloadListener(ITunerStatusListener listener);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -24,7 +24,16 @@ import io.github.dsheirer.source.tuner.sdrplay.api.device.TunerSelect;
|
||||
/**
|
||||
* Listener interface to receive notifications of gain overload in the RSP device.
|
||||
*/
|
||||
public interface IGainOverloadListener
|
||||
public interface ITunerStatusListener
|
||||
{
|
||||
/**
|
||||
* Notify that there is a gain overload event in the specified tuner
|
||||
* @param tunerSelect to id the tuner
|
||||
*/
|
||||
void notifyGainOverload(TunerSelect tunerSelect);
|
||||
|
||||
/**
|
||||
* Notify that the tuner's frequency has changed.
|
||||
*/
|
||||
void frequencyUpdated();
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -24,9 +24,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import io.github.dsheirer.source.tuner.configuration.TunerConfiguration;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.control.AgcMode;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.GainReduction;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.rsp1.Rsp1TunerConfiguration;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.rsp1a.Rsp1aTunerConfiguration;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.rsp1b.Rsp1bTunerConfiguration;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.rsp2.Rsp2TunerConfiguration;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.rspDuo.RspDuoTuner1Configuration;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.rspDuo.RspDuoTuner2Configuration;
|
||||
@@ -39,6 +39,7 @@ import io.github.dsheirer.source.tuner.sdrplay.rspDx.RspDxTunerConfiguration;
|
||||
@JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = Rsp1TunerConfiguration.class, name = "rsp1TunerConfiguration"),
|
||||
@JsonSubTypes.Type(value = Rsp1aTunerConfiguration.class, name = "rsp1aTunerConfiguration"),
|
||||
@JsonSubTypes.Type(value = Rsp1bTunerConfiguration.class, name = "rsp1bTunerConfiguration"),
|
||||
@JsonSubTypes.Type(value = Rsp2TunerConfiguration.class, name = "rsp2TunerConfiguration"),
|
||||
@JsonSubTypes.Type(value = RspDuoTuner1Configuration.class, name = "rspDuoTuner1Configuration"),
|
||||
@JsonSubTypes.Type(value = RspDuoTuner2Configuration.class, name = "rspDuoTuner2Configuration"),
|
||||
@@ -50,7 +51,8 @@ public abstract class RspTunerConfiguration extends TunerConfiguration
|
||||
public static final RspSampleRate DEFAULT_DUAL_TUNER_SAMPLE_RATE = RspSampleRate.DUO_RATE_2_000;
|
||||
|
||||
private RspSampleRate mRspSampleRate = DEFAULT_SINGLE_TUNER_SAMPLE_RATE;
|
||||
private int mGain = 24;
|
||||
private int mLNA = 0;
|
||||
private int mBasebandGainReduction = 50;
|
||||
private AgcMode mAgcMode = AgcMode.ENABLE;
|
||||
|
||||
/**
|
||||
@@ -87,25 +89,41 @@ public abstract class RspTunerConfiguration extends TunerConfiguration
|
||||
}
|
||||
|
||||
/**
|
||||
* Gain index to use
|
||||
* @return gain index, 0 - 28
|
||||
* LNA setting
|
||||
* @return LNA setting
|
||||
*/
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "gain")
|
||||
public int getGain()
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "lna")
|
||||
public int getLNA()
|
||||
{
|
||||
return mGain;
|
||||
return mLNA;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the gain index
|
||||
* @param gain index, 0 - 28
|
||||
* Sets the LNA state
|
||||
* @param LNA state, 0 - xx, varies by tuner and frequency range.
|
||||
*/
|
||||
public void setGain(int gain)
|
||||
public void setLNA(int lna)
|
||||
{
|
||||
if(GainReduction.MIN_GAIN_INDEX <= gain && gain <= GainReduction.MAX_GAIN_INDEX)
|
||||
{
|
||||
mGain = gain;
|
||||
}
|
||||
mLNA = lna;
|
||||
}
|
||||
|
||||
/**
|
||||
* Baseband gain reduction
|
||||
* @return gain reduction in range 20-59 dB
|
||||
*/
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "gr")
|
||||
public int getBasebandGainReduction()
|
||||
{
|
||||
return mBasebandGainReduction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the baseband gain reduction value.
|
||||
* @param basebandGainReduction value
|
||||
*/
|
||||
public void setBasebandGainReduction(int basebandGainReduction)
|
||||
{
|
||||
mBasebandGainReduction = basebandGainReduction;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -91,11 +91,13 @@ public abstract class RspTunerController<I extends IControlRsp> extends TunerCon
|
||||
|
||||
try
|
||||
{
|
||||
getControlRsp().setGain(rtc.getGain());
|
||||
int lna = rtc.getLNA();
|
||||
int gr = rtc.getBasebandGainReduction();
|
||||
getControlRsp().setGain(lna, gr);
|
||||
}
|
||||
catch(SDRPlayException se)
|
||||
{
|
||||
mLog.error("Error setting RSP gain index to " + rtc.getGain());
|
||||
mLog.error("Error setting RSP LNA [" + rtc.getLNA() + "] and baseband [" + rtc.getBasebandGainReduction() + "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -24,32 +24,37 @@ import io.github.dsheirer.source.tuner.manager.TunerManager;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.SDRPlayException;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.TunerSelect;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.control.AgcMode;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.GainReduction;
|
||||
import io.github.dsheirer.source.tuner.ui.TunerEditor;
|
||||
import io.github.dsheirer.util.ThreadPool;
|
||||
import java.awt.Color;
|
||||
import java.awt.EventQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JSlider;
|
||||
import javax.swing.JToggleButton;
|
||||
|
||||
/**
|
||||
* Abstract RSP tuner editor
|
||||
*/
|
||||
public abstract class RspTunerEditor<C extends RspTunerConfiguration> extends TunerEditor<RspTuner,C> implements IGainOverloadListener
|
||||
public abstract class RspTunerEditor<C extends RspTunerConfiguration> extends TunerEditor<RspTuner,C> implements ITunerStatusListener
|
||||
{
|
||||
private Logger mLog = LoggerFactory.getLogger(RspTunerEditor.class);
|
||||
private JSlider mGainSlider;
|
||||
private JLabel mGainValueLabel;
|
||||
protected static final String MANUAL = "Manual";
|
||||
protected static final String AUTOMATIC = "Automatic";
|
||||
private JToggleButton mAgcButton;
|
||||
private JLabel mGainValueLabel;
|
||||
private LnaSlider mLNASlider;
|
||||
private GainReductionSlider mBasebandSlider;
|
||||
private JButton mGainOverloadButton;
|
||||
private JPanel mGainPanel;
|
||||
private AtomicBoolean mGainOverloadAlert = new AtomicBoolean();
|
||||
|
||||
/**
|
||||
@@ -69,40 +74,23 @@ public abstract class RspTunerEditor<C extends RspTunerConfiguration> extends Tu
|
||||
}
|
||||
|
||||
/**
|
||||
* Gain reduction slider control
|
||||
* Gain controls panel
|
||||
* @return gain panel
|
||||
*/
|
||||
protected JSlider getGainSlider()
|
||||
protected JPanel getGainPanel()
|
||||
{
|
||||
if(mGainSlider == null)
|
||||
if(mGainPanel == null)
|
||||
{
|
||||
mGainSlider = new JSlider(JSlider.HORIZONTAL, GainReduction.MIN_GAIN_INDEX,
|
||||
GainReduction.MAX_GAIN_INDEX, GainReduction.MIN_GAIN_INDEX);
|
||||
mGainSlider.setEnabled(false);
|
||||
mGainSlider.setMajorTickSpacing(1);
|
||||
mGainSlider.setPaintTicks(true);
|
||||
mGainSlider.addChangeListener(event ->
|
||||
{
|
||||
int gain = mGainSlider.getValue();
|
||||
|
||||
if(hasTuner() && !isLoading())
|
||||
{
|
||||
try
|
||||
{
|
||||
getTunerController().getControlRsp().setGain(gain);
|
||||
save();
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
mLog.error("Couldn't set RSP gain to:" + gain, e);
|
||||
JOptionPane.showMessageDialog(mGainSlider, "Couldn't set RSP gain value to " + gain);
|
||||
}
|
||||
}
|
||||
|
||||
getGainValueLabel().setText(String.valueOf(gain));
|
||||
});
|
||||
mGainPanel = new JPanel();
|
||||
mGainPanel.setLayout(new MigLayout("insets 0","[][][grow,fill][][]",""));
|
||||
mGainPanel.add(getGainValueLabel());
|
||||
mGainPanel.add(getGainOverloadButton());
|
||||
mGainPanel.add(new JLabel()); //empty label to grow to fill space
|
||||
mGainPanel.add(new JLabel("IF Gain Mode:"));
|
||||
mGainPanel.add(getAgcButton());
|
||||
}
|
||||
|
||||
return mGainSlider;
|
||||
return mGainPanel;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,7 +114,7 @@ public abstract class RspTunerEditor<C extends RspTunerConfiguration> extends Tu
|
||||
{
|
||||
if(mAgcButton == null)
|
||||
{
|
||||
mAgcButton = new JToggleButton("IF AGC");
|
||||
mAgcButton = new JToggleButton(MANUAL);
|
||||
mAgcButton.setEnabled(false);
|
||||
mAgcButton.addActionListener(e -> {
|
||||
if(hasTuner() && !isLoading())
|
||||
@@ -134,6 +122,7 @@ public abstract class RspTunerEditor<C extends RspTunerConfiguration> extends Tu
|
||||
try
|
||||
{
|
||||
getTunerController().getControlRsp().setAgcMode(mAgcButton.isSelected() ? AgcMode.ENABLE : AgcMode.DISABLE);
|
||||
updateGainLabel();
|
||||
}
|
||||
catch(SDRPlayException se)
|
||||
{
|
||||
@@ -141,6 +130,15 @@ public abstract class RspTunerEditor<C extends RspTunerConfiguration> extends Tu
|
||||
}
|
||||
save();
|
||||
}
|
||||
|
||||
if(mAgcButton.isSelected())
|
||||
{
|
||||
getAgcButton().setText(AUTOMATIC);
|
||||
}
|
||||
else
|
||||
{
|
||||
getAgcButton().setText(MANUAL);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -175,6 +173,12 @@ public abstract class RspTunerEditor<C extends RspTunerConfiguration> extends Tu
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void frequencyUpdated()
|
||||
{
|
||||
updateLnaSlider();
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the alert styling of the disabled gain overload button to indicate an alert condition or a normal
|
||||
* operating condition.
|
||||
@@ -199,4 +203,173 @@ public abstract class RspTunerEditor<C extends RspTunerConfiguration> extends Tu
|
||||
mLog.info("Ignoring duplicate gain alerting - alert[" + alert + "] atomic [" + mGainOverloadAlert.get() + "]");
|
||||
}
|
||||
}
|
||||
|
||||
protected void updateLnaSlider()
|
||||
{
|
||||
if(hasTuner())
|
||||
{
|
||||
int max = getTunerController().getControlRsp().getMaximumLNASetting();
|
||||
if(max != getLNASlider().getMaximum())
|
||||
{
|
||||
EventQueue.invokeLater(() -> {
|
||||
setLoading(true);
|
||||
//Adjust the value if it's less than max
|
||||
getLNASlider().setValue(Math.min(getLNASlider().getValue(), max));
|
||||
getLNASlider().setMaximum(max);
|
||||
setLoading(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* LNA Gain Slider
|
||||
*/
|
||||
protected LnaSlider getLNASlider()
|
||||
{
|
||||
if(mLNASlider == null)
|
||||
{
|
||||
mLNASlider = new LnaSlider();
|
||||
mLNASlider.setEnabled(true);
|
||||
mLNASlider.setMajorTickSpacing(1);
|
||||
mLNASlider.setPaintTicks(true);
|
||||
mLNASlider.addChangeListener(event ->
|
||||
{
|
||||
JSlider source = (JSlider)event.getSource();
|
||||
|
||||
if(!source.getValueIsAdjusting())
|
||||
{
|
||||
updateGain();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return mLNASlider;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the gain settings when the LNA or Baseband gain value is changed by the user.
|
||||
*/
|
||||
private void updateGain()
|
||||
{
|
||||
int lna = getLNASlider().getLNA();
|
||||
int gr = getBasebandSlider().getGR();
|
||||
|
||||
if(hasTuner() && !isLoading())
|
||||
{
|
||||
try
|
||||
{
|
||||
getTunerController().getControlRsp().setGain(lna, gr);
|
||||
save();
|
||||
updateGainLabel();
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
mLog.error("Couldn't set RSP gain to LNA:" + lna + " Gain Reduction:" + gr, e);
|
||||
JOptionPane.showMessageDialog(mBasebandSlider, "Couldn't set RSP gain value to LNA:" + lna + " Gain Reduction:" + gr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void updateGainLabel()
|
||||
{
|
||||
try
|
||||
{
|
||||
float currentGain = getTunerController().getControlRsp().getCurrentGain();
|
||||
getGainValueLabel().setText((int)currentGain + " dB");
|
||||
}
|
||||
catch(SDRPlayException se)
|
||||
{
|
||||
mLog.error("Error accessing current gain value from RSP tuner", se);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Baseband Gain Reduction Slider
|
||||
*/
|
||||
protected GainReductionSlider getBasebandSlider()
|
||||
{
|
||||
if(mBasebandSlider == null)
|
||||
{
|
||||
mBasebandSlider = new GainReductionSlider();
|
||||
mBasebandSlider.setEnabled(true);
|
||||
mBasebandSlider.setMajorTickSpacing(1);
|
||||
mBasebandSlider.setPaintTicks(true);
|
||||
mBasebandSlider.addChangeListener(event ->
|
||||
{
|
||||
JSlider source = (JSlider)event.getSource();
|
||||
|
||||
if(!source.getValueIsAdjusting())
|
||||
{
|
||||
updateGain();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return mBasebandSlider;
|
||||
}
|
||||
|
||||
/**
|
||||
* JSlider implementation that inverts the scale to support LNA values.
|
||||
*/
|
||||
public class LnaSlider extends JSlider
|
||||
{
|
||||
/**
|
||||
* Constructs an instance
|
||||
*/
|
||||
public LnaSlider()
|
||||
{
|
||||
super(JSlider.HORIZONTAL, 0,9,9);
|
||||
}
|
||||
|
||||
/**
|
||||
* Slider value converted to the LNA scale.
|
||||
* @return lna value.
|
||||
*/
|
||||
public int getLNA()
|
||||
{
|
||||
return getMaximum() - getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the slider with the value converted from the provided LNA value.
|
||||
* @param lna value to apply
|
||||
*/
|
||||
public void setLNA(int lna)
|
||||
{
|
||||
setValue(getMaximum() - lna);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* JSlider implementation that inverts the scale to support Gain Reduction values.
|
||||
*/
|
||||
public class GainReductionSlider extends JSlider
|
||||
{
|
||||
/**
|
||||
* Constructs an instance
|
||||
*/
|
||||
public GainReductionSlider()
|
||||
{
|
||||
super(JSlider.HORIZONTAL, 0, 39, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* Slider value converted to the gain reduction scale.
|
||||
* @return gain reduction value.
|
||||
*/
|
||||
public int getGR()
|
||||
{
|
||||
return getBasebandSlider().getMaximum() - getBasebandSlider().getValue() + 20;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the slider with the value converted from the provided gain reduction value.
|
||||
* @param gainReduction value to apply
|
||||
*/
|
||||
public void setGR(int gainReduction)
|
||||
{
|
||||
setValue(getMaximum() - (gainReduction - 20));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -352,7 +352,7 @@ public class SDRplay
|
||||
*
|
||||
* @param deviceType to load parameters
|
||||
* @param deviceHandle to device
|
||||
* @return constructed device composite paramaters
|
||||
* @return constructed device composite parameters
|
||||
*/
|
||||
public CompositeParameters getCompositeParameters(DeviceType deviceType, MemorySegment deviceHandle) throws SDRPlayException
|
||||
{
|
||||
@@ -367,7 +367,7 @@ public class SDRplay
|
||||
|
||||
//The structure's memory is already allocated ... wrap a memory segment around it
|
||||
MemorySegment memorySegment = sdrplay_api_DeviceT.ofAddress(memoryAddress, getArena().scope());
|
||||
return CompositeParametersFactory.create(deviceType, memorySegment, getArena());
|
||||
return CompositeParametersFactory.create(getVersion(), deviceType, memorySegment, getArena());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -78,6 +78,7 @@ public enum UpdateReason
|
||||
EXTENSION_RSP_DX_RF_NOTCH_CONTROL(sdrplay_api_h.sdrplay_api_Update_RspDx_RfNotchControl(), "RSPdx RF Notch Control"),
|
||||
EXTENSION_RSP_DX_RF_DAB_NOTCH_CONTROL(sdrplay_api_h.sdrplay_api_Update_RspDx_RfDabNotchControl(), "RSPdx RF DAB Notch Control"),
|
||||
EXTENSION_RSP_DX_HDR_BANDWIDTH(sdrplay_api_h.sdrplay_api_Update_RspDx_HdrBw(), "RSPdx HDR Bandwidth"),
|
||||
EXTENSION_RSP_DUO_RESET_SLAVE_FLAGS(io.github.dsheirer.source.tuner.sdrplay.api.v3_14.sdrplay_api_h.sdrplay_api_Update_RspDuo_ResetSlaveFlags(), "RSPDuo Reset Slave Flags"),
|
||||
EXTENSION_NONE(sdrplay_api_h.sdrplay_api_Update_Ext1_None(), "NONE"),
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -33,7 +33,9 @@ public enum Version
|
||||
V3_09(3.09f, true),
|
||||
V3_10(3.10f, true),
|
||||
V3_11(3.11f, true),
|
||||
V3_12(3.12f, true);
|
||||
V3_12(3.12f, true),
|
||||
V3_13(3.13f, true), //No changes - OSX build only.
|
||||
V3_14(3.14f, true);
|
||||
|
||||
private float mValue;
|
||||
private boolean mSupported;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -125,6 +125,9 @@ public class DeviceFactory
|
||||
case RSP1A -> {
|
||||
return new Rsp1aDevice(sdrPlay, deviceStruct);
|
||||
}
|
||||
case RSP1B -> {
|
||||
return new Rsp1bDevice(sdrPlay, deviceStruct);
|
||||
}
|
||||
case RSP2 -> {
|
||||
return new Rsp2Device(sdrPlay, deviceStruct);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -28,6 +28,7 @@ public enum DeviceType
|
||||
{
|
||||
RSP1(sdrplay_api_h.SDRPLAY_RSP1_ID(), "RSP1"),
|
||||
RSP1A(sdrplay_api_h.SDRPLAY_RSP1A_ID(), "RSP1A"),
|
||||
RSP1B(io.github.dsheirer.source.tuner.sdrplay.api.v3_14.sdrplay_api_h.SDRPLAY_RSP1B_ID(), "RSP1B"),
|
||||
RSP2(sdrplay_api_h.SDRPLAY_RSP2_ID(), "RSP2"),
|
||||
RSPduo(sdrplay_api_h.SDRPLAY_RSPduo_ID(), "RSPduo"),
|
||||
RSPdx(sdrplay_api_h.SDRPLAY_RSPdx_ID(), "RSPdx"),
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.device;
|
||||
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.SDRPlayException;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.SDRplay;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite.Rsp1bCompositeParameters;
|
||||
|
||||
/**
|
||||
* RSP1B Device
|
||||
*/
|
||||
public class Rsp1bDevice extends Device<Rsp1bCompositeParameters, Rsp1bTuner>
|
||||
{
|
||||
private Rsp1bTuner mTuner1;
|
||||
|
||||
/**
|
||||
* Constructs an SDRPlay RSP1B device from the foreign memory segment
|
||||
*
|
||||
* @param sdrPlay api instance that created this device
|
||||
* @param deviceStruct parser
|
||||
*/
|
||||
Rsp1bDevice(SDRplay sdrPlay, IDeviceStruct deviceStruct)
|
||||
{
|
||||
super(sdrPlay, deviceStruct);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rsp1bTuner getTuner() throws SDRPlayException
|
||||
{
|
||||
if(!isSelected())
|
||||
{
|
||||
throw new SDRPlayException("Device must be selected before accessing the tuner");
|
||||
}
|
||||
|
||||
if(mTuner1 == null)
|
||||
{
|
||||
mTuner1 = new Rsp1bTuner(Rsp1bDevice.this, getAPI(), getTunerSelect(),
|
||||
getCompositeParameters().getDeviceParameters(), getCompositeParameters().getTunerAParameters(),
|
||||
getCompositeParameters().getControlAParameters());
|
||||
}
|
||||
|
||||
return mTuner1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.device;
|
||||
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.SDRPlayException;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.SDRplay;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.UpdateReason;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.control.ControlParameters;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.device.Rsp1aDeviceParameters;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp1aTunerParameters;
|
||||
|
||||
/**
|
||||
* RSP1B Tuner
|
||||
*
|
||||
* Note: the RSP1B uses the same device and tuner parameters structures as the RSP1A
|
||||
*/
|
||||
public class Rsp1bTuner extends RspTuner<Rsp1aDeviceParameters, Rsp1aTunerParameters>
|
||||
{
|
||||
/**
|
||||
* Constructs an instance
|
||||
* @param device parent for this tuner
|
||||
* @param sdrplay api
|
||||
* @param tunerSelect to specify which tuner
|
||||
* @param deviceParameters for this device
|
||||
* @param tunerParameters for this tuner
|
||||
* @param controlParameters for this device
|
||||
*/
|
||||
public Rsp1bTuner(Device device, SDRplay sdrplay, TunerSelect tunerSelect, Rsp1aDeviceParameters deviceParameters,
|
||||
Rsp1aTunerParameters tunerParameters, ControlParameters controlParameters)
|
||||
{
|
||||
super(device, sdrplay, tunerSelect, deviceParameters, tunerParameters, controlParameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the RF notch is enabled
|
||||
*/
|
||||
public boolean isRfNotch()
|
||||
{
|
||||
return getDeviceParameters().isRFNotch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the RF notch
|
||||
* @param enable setting
|
||||
* @throws SDRPlayException if there is an error
|
||||
*/
|
||||
public void setRfNotch(boolean enable) throws SDRPlayException
|
||||
{
|
||||
getDeviceParameters().setRFNotch(enable);
|
||||
update(UpdateReason.RSP1A_RF_NOTCH_CONTROL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the RF DAB notch is enabled
|
||||
*/
|
||||
public boolean isRfDabNotch()
|
||||
{
|
||||
return getDeviceParameters().isRfDabNotch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the RF DAB notch
|
||||
* @param enable value
|
||||
* @throws SDRPlayException if there is an error
|
||||
*/
|
||||
public void setRfDabNotch(boolean enable) throws SDRPlayException
|
||||
{
|
||||
getDeviceParameters().setRfDabNotch(enable);
|
||||
update(UpdateReason.RSP1A_RF_DAB_NOTCH_CONTROL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the Bias-T is enabled
|
||||
*/
|
||||
public boolean isBiasT()
|
||||
{
|
||||
return getTunerParameters().isBiasT();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the Bias-T
|
||||
* @param enable value
|
||||
* @throws SDRPlayException if there is an error
|
||||
*/
|
||||
public void setBiasT(boolean enable) throws SDRPlayException
|
||||
{
|
||||
getTunerParameters().setBiasT(enable);
|
||||
update(UpdateReason.RSP1A_BIAS_T_CONTROL);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -28,7 +28,6 @@ import io.github.dsheirer.source.tuner.sdrplay.api.parameter.control.ControlPara
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.device.DeviceParameters;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Bandwidth;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Gain;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.GainReduction;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.IfMode;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.LoMode;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.TunerParameters;
|
||||
@@ -49,8 +48,6 @@ public abstract class RspTuner<D extends DeviceParameters, T extends TunerParame
|
||||
private final T mTunerParameters;
|
||||
private final ControlParameters mControlParameters;
|
||||
|
||||
private GainReduction mGainReduction;
|
||||
|
||||
RspTuner(Device device, SDRplay sdrplay, TunerSelect tunerSelect, D deviceParameters, T tunerParameters,
|
||||
ControlParameters controlParameters)
|
||||
{
|
||||
@@ -180,7 +177,6 @@ public abstract class RspTuner<D extends DeviceParameters, T extends TunerParame
|
||||
try
|
||||
{
|
||||
getTunerParameters().getRfFrequency().setFrequency(frequency, false);
|
||||
updateGainReduction(frequency);
|
||||
return updateAsync(UpdateReason.TUNER_FREQUENCY_RF, UpdateReason.TUNER_FREQUENCY_RF);
|
||||
}
|
||||
catch(SDRPlayException se)
|
||||
@@ -193,39 +189,15 @@ public abstract class RspTuner<D extends DeviceParameters, T extends TunerParame
|
||||
}
|
||||
|
||||
/**
|
||||
* Gain reduction in use for this device with the current RF frequency
|
||||
* Sets the LNA state and Baseband Gain Reduction values.
|
||||
* @param lna state (varies by tuner and frequency range)
|
||||
* @param basebandGainReduction in range 20-59 dB
|
||||
* @throws SDRPlayException
|
||||
*/
|
||||
public GainReduction getGainReduction()
|
||||
public void setGain(int lna, int basebandGainReduction) throws SDRPlayException
|
||||
{
|
||||
if(mGainReduction == null)
|
||||
{
|
||||
updateGainReduction(getFrequency());
|
||||
}
|
||||
|
||||
return mGainReduction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the gain reduction, if necessary, for the specified RF frequency
|
||||
*
|
||||
* @param frequency value
|
||||
*/
|
||||
private void updateGainReduction(long frequency)
|
||||
{
|
||||
if(mGainReduction == null || !mGainReduction.isValidFor(frequency))
|
||||
{
|
||||
mGainReduction = GainReduction.lookup(getDevice().getDeviceType(), frequency);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects a gain value index from the current gain reduction values
|
||||
*
|
||||
* @param index of the gain reduction values to use
|
||||
*/
|
||||
public void setGain(int index) throws SDRPlayException
|
||||
{
|
||||
getTunerParameters().getGain().setGain(getGainReduction(), index);
|
||||
getTunerParameters().getGain().setLNA(lna);
|
||||
getTunerParameters().getGain().setGainReductionDb(basebandGainReduction);
|
||||
update(UpdateReason.TUNER_GAIN_REDUCTION);
|
||||
}
|
||||
|
||||
@@ -257,16 +229,6 @@ public abstract class RspTuner<D extends DeviceParameters, T extends TunerParame
|
||||
return getTunerParameters().getGain();
|
||||
}
|
||||
|
||||
/**
|
||||
* Current gain index value.
|
||||
* @return current gain index value or -1 if the current gain setting does not match the possible gain reduction options.
|
||||
*/
|
||||
public int getGainIndex()
|
||||
{
|
||||
int gainDb = getGain().getGainReductionDb();
|
||||
return getGainReduction().getGainIndex(gainDb);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables DC correction
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite;
|
||||
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.Version;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.control.ControlParameters;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.device.DeviceParameters;
|
||||
@@ -47,11 +48,12 @@ public class CompositeParameters<D extends DeviceParameters, T extends TunerPara
|
||||
/**
|
||||
* Constructs an instance from the foreign memory segment
|
||||
*
|
||||
* @param version of the API
|
||||
* @param deviceType to create
|
||||
* @param memorySegment for the composite structure in foreign memory
|
||||
* @param arena for allocating additional memory segments for the sub-structures.
|
||||
*/
|
||||
public CompositeParameters(DeviceType deviceType, MemorySegment memorySegment, Arena arena)
|
||||
public CompositeParameters(Version version, DeviceType deviceType, MemorySegment memorySegment, Arena arena)
|
||||
{
|
||||
MemorySegment parametersMemoryAddress = sdrplay_api_DeviceParamsT.devParams$get(memorySegment);
|
||||
MemorySegment parametersMemorySegment = sdrplay_api_DevParamsT.ofAddress(parametersMemoryAddress, arena.scope());
|
||||
@@ -59,7 +61,7 @@ public class CompositeParameters<D extends DeviceParameters, T extends TunerPara
|
||||
|
||||
MemorySegment memoryAddressRxA = sdrplay_api_DeviceParamsT.rxChannelA$get(memorySegment);
|
||||
MemorySegment memorySegmentRxA = sdrplay_api_RxChannelParamsT.ofAddress(memoryAddressRxA, arena.scope());
|
||||
mTunerAParameters = (T) TunerParametersFactory.create(deviceType, memorySegmentRxA);
|
||||
mTunerAParameters = (T) TunerParametersFactory.create(version, deviceType, memorySegmentRxA);
|
||||
|
||||
MemorySegment tunerAControlParametersMemorySegment = sdrplay_api_RxChannelParamsT.ctrlParams$slice(memorySegmentRxA);
|
||||
mControlAParameters = new ControlParameters(tunerAControlParametersMemorySegment);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite;
|
||||
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.Version;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
||||
import java.lang.foreign.Arena;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
@@ -30,29 +31,34 @@ public class CompositeParametersFactory
|
||||
{
|
||||
/**
|
||||
* Creates a composite parameters instance for the specified device type
|
||||
* @param version of the api
|
||||
* @param deviceType to create
|
||||
* @param memorySegment of foreign memory structure for the composite parameters
|
||||
* @param arena to allocate additional memory structures
|
||||
* @return instance
|
||||
*/
|
||||
public static CompositeParameters create(DeviceType deviceType, MemorySegment memorySegment, Arena arena)
|
||||
public static CompositeParameters create(Version version, DeviceType deviceType, MemorySegment memorySegment,
|
||||
Arena arena)
|
||||
{
|
||||
switch(deviceType)
|
||||
{
|
||||
case RSP1 -> {
|
||||
return new Rsp1CompositeParameters(memorySegment, arena);
|
||||
return new Rsp1CompositeParameters(version, memorySegment, arena);
|
||||
}
|
||||
case RSP1A -> {
|
||||
return new Rsp1aCompositeParameters(memorySegment, arena);
|
||||
return new Rsp1aCompositeParameters(version, memorySegment, arena);
|
||||
}
|
||||
case RSP1B -> {
|
||||
return new Rsp1bCompositeParameters(version, memorySegment, arena);
|
||||
}
|
||||
case RSP2 -> {
|
||||
return new Rsp2CompositeParameters(memorySegment, arena);
|
||||
return new Rsp2CompositeParameters(version, memorySegment, arena);
|
||||
}
|
||||
case RSPduo -> {
|
||||
return new RspDuoCompositeParameters(memorySegment, arena);
|
||||
return new RspDuoCompositeParameters(version, memorySegment, arena);
|
||||
}
|
||||
case RSPdx -> {
|
||||
return new RspDxCompositeParameters(memorySegment, arena);
|
||||
return new RspDxCompositeParameters(version, memorySegment, arena);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite;
|
||||
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.Version;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.device.Rsp1DeviceParameters;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp1TunerParameters;
|
||||
@@ -33,11 +34,12 @@ public class Rsp1CompositeParameters extends CompositeParameters<Rsp1DeviceParam
|
||||
/**
|
||||
* Constructs an instance from the foreign memory segment
|
||||
*
|
||||
* @param version of the API
|
||||
* @param memorySegment for the composite structure in foreign memory
|
||||
* @param arena for allocating additional memory segments for the sub-structures.
|
||||
*/
|
||||
public Rsp1CompositeParameters(MemorySegment memorySegment, Arena arena)
|
||||
public Rsp1CompositeParameters(Version version, MemorySegment memorySegment, Arena arena)
|
||||
{
|
||||
super(DeviceType.RSP1, memorySegment, arena);
|
||||
super(version, DeviceType.RSP1, memorySegment, arena);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite;
|
||||
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.Version;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.device.Rsp1aDeviceParameters;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp1aTunerParameters;
|
||||
@@ -33,11 +34,12 @@ public class Rsp1aCompositeParameters extends CompositeParameters<Rsp1aDevicePar
|
||||
/**
|
||||
* Constructs an instance from the foreign memory segment
|
||||
*
|
||||
* @param version of the API
|
||||
* @param memorySegment for the composite structure in foreign memory
|
||||
* @param arena for allocating additional memory segments for the sub-structures.
|
||||
*/
|
||||
public Rsp1aCompositeParameters(MemorySegment memorySegment, Arena arena)
|
||||
public Rsp1aCompositeParameters(Version version, MemorySegment memorySegment, Arena arena)
|
||||
{
|
||||
super(DeviceType.RSP1A, memorySegment, arena);
|
||||
super(version, DeviceType.RSP1A, memorySegment, arena);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite;
|
||||
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.Version;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.device.Rsp1aDeviceParameters;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp1aTunerParameters;
|
||||
import java.lang.foreign.Arena;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
|
||||
/**
|
||||
* RSP1B Composite parameters (device and tuner)
|
||||
*
|
||||
* Note: RSP1B uses RSP1A device and tuner parameters structures.
|
||||
*/
|
||||
public class Rsp1bCompositeParameters extends CompositeParameters<Rsp1aDeviceParameters, Rsp1aTunerParameters>
|
||||
{
|
||||
/**
|
||||
* Constructs an instance from the foreign memory segment
|
||||
*
|
||||
* @param version of the API
|
||||
* @param memorySegment for the composite structure in foreign memory
|
||||
* @param arena for allocating additional memory segments for the sub-structures.
|
||||
*/
|
||||
public Rsp1bCompositeParameters(Version version, MemorySegment memorySegment, Arena arena)
|
||||
{
|
||||
super(version, DeviceType.RSP1B, memorySegment, arena);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite;
|
||||
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.Version;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.device.Rsp2DeviceParameters;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp2TunerParameters;
|
||||
@@ -33,11 +34,12 @@ public class Rsp2CompositeParameters extends CompositeParameters<Rsp2DeviceParam
|
||||
/**
|
||||
* Constructs an instance from the foreign memory segment
|
||||
*
|
||||
* @param version of the API
|
||||
* @param memorySegment for the composite structure in foreign memory
|
||||
* @param arena for allocating additional memory segments for the sub-structures.
|
||||
*/
|
||||
public Rsp2CompositeParameters(MemorySegment memorySegment, Arena arena)
|
||||
public Rsp2CompositeParameters(Version version, MemorySegment memorySegment, Arena arena)
|
||||
{
|
||||
super(DeviceType.RSP2, memorySegment, arena);
|
||||
super(version, DeviceType.RSP2, memorySegment, arena);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite;
|
||||
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.Version;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.control.ControlParameters;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.device.RspDuoDeviceParameters;
|
||||
@@ -40,16 +41,17 @@ public class RspDuoCompositeParameters extends CompositeParameters<RspDuoDeviceP
|
||||
/**
|
||||
* Constructs an instance from the foreign memory segment
|
||||
*
|
||||
* @param version for constructing the correct version structure.
|
||||
* @param memorySegment for the composite structure in foreign memory
|
||||
* @param arena for allocating additional memory segments for the sub-structures.
|
||||
*/
|
||||
public RspDuoCompositeParameters(MemorySegment memorySegment, Arena arena)
|
||||
public RspDuoCompositeParameters(Version version, MemorySegment memorySegment, Arena arena)
|
||||
{
|
||||
super(DeviceType.RSPduo, memorySegment, arena);
|
||||
super(version, DeviceType.RSPduo, memorySegment, arena);
|
||||
|
||||
MemorySegment memoryAddressRxB = sdrplay_api_DeviceParamsT.rxChannelB$get(memorySegment);
|
||||
MemorySegment memorySegmentRxB = sdrplay_api_RxChannelParamsT.ofAddress(memoryAddressRxB, arena.scope());
|
||||
mTunerBParameters = (RspDuoTunerParameters) TunerParametersFactory.create(DeviceType.RSPduo, memorySegmentRxB);
|
||||
mTunerBParameters = (RspDuoTunerParameters) TunerParametersFactory.create(version, DeviceType.RSPduo, memorySegmentRxB);
|
||||
|
||||
MemorySegment tunerBControlParametersMemorySegment = sdrplay_api_RxChannelParamsT.ctrlParams$slice(memorySegmentRxB);
|
||||
mControlBParameters = new ControlParameters(tunerBControlParametersMemorySegment);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite;
|
||||
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.Version;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.device.RspDxDeviceParameters;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.RspDxTunerParameters;
|
||||
@@ -33,11 +34,12 @@ public class RspDxCompositeParameters extends CompositeParameters<RspDxDevicePar
|
||||
/**
|
||||
* Constructs an instance from the foreign memory segment
|
||||
*
|
||||
* @param version of the API
|
||||
* @param memorySegment for the composite structure in foreign memory
|
||||
* @param arena for allocating additional memory segments for the sub-structures.
|
||||
*/
|
||||
public RspDxCompositeParameters(MemorySegment memorySegment, Arena arena)
|
||||
public RspDxCompositeParameters(Version version, MemorySegment memorySegment, Arena arena)
|
||||
{
|
||||
super(DeviceType.RSPdx, memorySegment, arena);
|
||||
super(version, DeviceType.RSPdx, memorySegment, arena);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -40,7 +40,8 @@ public class DeviceParametersFactory
|
||||
case RSP1 -> {
|
||||
return new Rsp1DeviceParameters(memorySegment);
|
||||
}
|
||||
case RSP1A -> {
|
||||
//RSP1A and RSP1B share the same device parameters structures
|
||||
case RSP1A, RSP1B -> {
|
||||
return new Rsp1aDeviceParameters(memorySegment);
|
||||
}
|
||||
case RSP2 -> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -30,11 +30,17 @@ public enum EventType
|
||||
POWER_OVERLOAD_CHANGE(sdrplay_api_h.sdrplay_api_PowerOverloadChange(), "POWER OVERLOAD CHANGE"),
|
||||
DEVICE_REMOVED(sdrplay_api_h.sdrplay_api_DeviceRemoved(), "DEVICE REMOVED"),
|
||||
RSP_DUO_MODE_CHANGE(sdrplay_api_h.sdrplay_api_RspDuoModeChange(), "RSP-DUO MODE CHANGE"),
|
||||
DEVICE_FAILURE(io.github.dsheirer.source.tuner.sdrplay.api.v3_14.sdrplay_api_h.sdrplay_api_DeviceFailure(), "DEVICE FAILURE"),
|
||||
UNKNOWN(-1, "UNKNOWN");
|
||||
|
||||
private int mValue;
|
||||
private String mDescription;
|
||||
|
||||
/**
|
||||
* Constructs an instance
|
||||
* @param value of the entry
|
||||
* @param description for the entry
|
||||
*/
|
||||
EventType(int value, String description)
|
||||
{
|
||||
mValue = value;
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
/**
|
||||
* RSP Frequency Bands
|
||||
*/
|
||||
public enum FrequencyBand
|
||||
{
|
||||
BAND_0_12(1_000, 12_000_000, "0.001-12 MHz"),
|
||||
BAND_12_60(12_000_000, 60_000_000, "12-60 MHz"),
|
||||
BAND_60_250(60_000_000, 250_000_000, "60-250 MHz"),
|
||||
BAND_250_420(250_000_000, 420_000_000, "250-420 MHz"),
|
||||
BAND_420_1000(420_000_000, 1_000_000_000, "420-1000 MHz"),
|
||||
BAND_1000_2000(1_000_000_000, 2_000_000_000, "1000-2000 MHz"),
|
||||
UNKNOWN(-1, 0,"UNKNOWN");
|
||||
|
||||
private long mMinimum;
|
||||
private long mMaximum;
|
||||
private String mDescription;
|
||||
|
||||
FrequencyBand(long min, long max, String description)
|
||||
{
|
||||
mMinimum = min;
|
||||
mMaximum = max;
|
||||
mDescription = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Valid frequency bands
|
||||
*/
|
||||
public static EnumSet<FrequencyBand> VALID_FREQUENCY_BANDS = EnumSet.range(BAND_0_12, BAND_1000_2000);
|
||||
|
||||
/**
|
||||
* Minimum frequency
|
||||
* @return frequency in Hertz
|
||||
*/
|
||||
public long getMinimum()
|
||||
{
|
||||
return mMinimum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maximum frequency
|
||||
* @return frequency in Hertz
|
||||
*/
|
||||
public long getMaximum()
|
||||
{
|
||||
return mMaximum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lookup the entry from a return code
|
||||
* @param frequency to lookup
|
||||
* @return entry or UNKNOWN if the code is not recognized
|
||||
*/
|
||||
public static FrequencyBand fromValue(long frequency)
|
||||
{
|
||||
for(FrequencyBand band: FrequencyBand.values())
|
||||
{
|
||||
if(band.contains(frequency))
|
||||
{
|
||||
return band;
|
||||
}
|
||||
}
|
||||
|
||||
return UNKNOWN;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if this frequency band entry contains the specified frequency
|
||||
* @param frequency to check
|
||||
* @return true if this entry contains the frequency
|
||||
*/
|
||||
public boolean contains(long frequency)
|
||||
{
|
||||
return getMinimum() <= frequency && frequency < getMaximum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return mDescription;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -52,17 +52,6 @@ public class Gain
|
||||
return mMemorySegment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the LNA state and gain reduction from the set of gain reduction values using the specified index
|
||||
* @param gainReduction for the current frequency band
|
||||
* @param index into the gain values to use for LNA state and gain reduction
|
||||
*/
|
||||
public void setGain(GainReduction gainReduction, int index)
|
||||
{
|
||||
setLNA(gainReduction.getLnaState(index));
|
||||
setGainReductionDb(gainReduction.getGainReduction(index));
|
||||
}
|
||||
|
||||
/**
|
||||
* Current gain reduction
|
||||
* @return gain dB
|
||||
|
||||
@@ -1,354 +0,0 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner;
|
||||
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
||||
import java.util.EnumSet;
|
||||
|
||||
/**
|
||||
* RSP Gain Reduction values and LNA states for each RSP model.
|
||||
*
|
||||
* Use lookup() as convenience method to find a gain reduction entry for a device type and frequency band.
|
||||
*
|
||||
* Reference: SDRplay API Specification, Gain Reduction Tables
|
||||
* and https://github.com/SDRplay/RSPTCPServer/blob/master/rsp_tcp.c
|
||||
*/
|
||||
public enum GainReduction
|
||||
{
|
||||
RSP1_BAND_0_12(FrequencyBand.BAND_0_12,
|
||||
new int[]{ 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,56,53,50,47,44,41,58,55,52,49,46,43,45,42,58,55,52,49,46,43,41,38,35,32,29,26,23,20 }),
|
||||
RSP1_BAND_12_60(FrequencyBand.BAND_12_60,
|
||||
new int[]{ 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,56,53,50,47,44,41,58,55,52,49,46,43,45,42,58,55,52,49,46,43,41,38,35,32,29,26,23,20 }),
|
||||
RSP1_BAND_60_250(FrequencyBand.BAND_60_250,
|
||||
new int[]{ 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,56,53,50,47,44,41,58,55,52,49,46,43,45,42,58,55,52,49,46,43,41,38,35,32,29,26,23,20 }),
|
||||
RSP1_BAND_250_420(FrequencyBand.BAND_250_420,
|
||||
new int[]{ 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,56,53,50,47,44,41,58,55,52,49,46,43,45,42,58,55,52,49,46,43,41,38,35,32,29,26,23,20 }),
|
||||
RSP1_BAND_420_1000(FrequencyBand.BAND_420_1000,
|
||||
new int[]{ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0 },
|
||||
new int[]{ 59,57,54,52,50,47,45,43,40,38,36,33,31,29,27,24,22,27,24,22,32,29,27,25,22,27,25,22,20 }),
|
||||
RSP1_BAND_1000_2000(FrequencyBand.BAND_1000_2000,
|
||||
new int[]{ 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,57,55,52,50,48,46,43,41,44,42,53,51,49,47,44,42,45,43,40,38,36,34,31,29,27,25,22,20 }),
|
||||
|
||||
RSP1A_BAND_0_12(FrequencyBand.BAND_0_12,
|
||||
new int[]{ 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 4, 4, 3, 3, 3, 3, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,45,41,57,53,49,46,42,44,40,56,52,48,45,41,44,40,43,45,41,38,34,31,27,24,20 }),
|
||||
RSP1A_BAND_12_60(FrequencyBand.BAND_12_60,
|
||||
new int[]{ 9, 9, 9, 9, 9, 9, 8, 7, 7, 7, 7, 7, 6, 6, 5, 5, 4, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,45,41,42,58,54,51,47,43,46,42,44,41,43,42,44,40,43,45,42,38,34,31,27,24,20 }),
|
||||
RSP1A_BAND_60_250(FrequencyBand.BAND_60_250,
|
||||
new int[]{ 9, 9, 9, 9, 9, 9, 8, 7, 7, 7, 7, 7, 6, 6, 5, 5, 4, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,45,41,42,58,54,51,47,43,46,42,44,41,43,42,44,40,43,45,42,38,34,31,27,24,20 }),
|
||||
RSP1A_BAND_250_420(FrequencyBand.BAND_250_420,
|
||||
new int[]{ 9, 9, 9, 9, 9, 9, 8, 7, 7, 7, 7, 7, 6, 6, 5, 5, 4, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,45,41,42,58,54,51,47,43,46,42,44,41,43,42,44,40,43,45,42,38,34,31,27,24,20 }),
|
||||
RSP1A_BAND_420_1000(FrequencyBand.BAND_420_1000,
|
||||
new int[]{ 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 7, 6, 6, 5, 5, 4, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,44,41,56,52,49,45,41,44,46,42,45,41,44,40,44,40,42,46,42,38,35,31,27,24,20 }),
|
||||
RSP1A_BAND_1000_2000(FrequencyBand.BAND_1000_2000,
|
||||
new int[]{ 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 5, 5, 4, 4, 3, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,45,41,56,53,49,46,42,43,46,42,44,41,43,48,44,40,43,45,42,38,34,31,27,24,20 }),
|
||||
|
||||
RSP2_BAND_0_12(FrequencyBand.BAND_0_12,
|
||||
new int[]{ 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 5, 5, 4, 4, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,44,41,56,52,49,45,41,44,45,41,48,44,40,45,42,43,49,46,42,38,35,31,27,24,20 }),
|
||||
RSP2_BAND_12_60(FrequencyBand.BAND_12_60,
|
||||
new int[]{ 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 5, 5, 4, 4, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,44,41,56,52,49,45,41,44,45,41,48,44,40,45,42,43,49,46,42,38,35,31,27,24,20 }),
|
||||
RSP2_BAND_60_250(FrequencyBand.BAND_60_250,
|
||||
new int[]{ 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 5, 5, 4, 4, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,44,41,56,52,49,45,41,44,45,41,48,44,40,45,42,43,49,46,42,38,35,31,27,24,20 }),
|
||||
RSP2_BAND_250_420(FrequencyBand.BAND_250_420,
|
||||
new int[]{ 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 5, 5, 4, 4, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,44,41,56,52,49,45,41,44,45,41,48,44,40,45,42,43,49,46,42,38,35,31,27,24,20 }),
|
||||
RSP2_BAND_420_1000(FrequencyBand.BAND_420_1000,
|
||||
new int[]{ 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 3, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,56,53,50,48,45,42,58,55,52,49,47,44,41,43,40,44,41,42,46,43,40,37,34,31,29,26,23,20 }),
|
||||
RSP2_BAND_1000_2000(FrequencyBand.BAND_1000_2000,
|
||||
new int[]{ 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,56,54,51,48,45,43,40,56,54,51,48,45,43,40,43,41,44,41,44,42,39,36,34,31,28,25,23,20 }),
|
||||
|
||||
RSP_DUO_BAND_0_12(FrequencyBand.BAND_0_12,
|
||||
new int[]{ 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 4, 4, 3, 3, 3, 3, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,45,41,57,53,49,46,42,44,40,56,52,48,45,41,44,40,43,45,41,38,34,31,27,24,20 }),
|
||||
RSP_DUO_BAND_12_60(FrequencyBand.BAND_12_60,
|
||||
new int[]{ 9, 9, 9, 9, 9, 9, 8, 7, 7, 7, 7, 7, 6, 6, 5, 5, 4, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,45,41,42,58,54,51,47,43,46,42,44,41,43,42,44,40,43,45,42,38,34,31,27,24,20 }),
|
||||
RSP_DUO_BAND_60_250(FrequencyBand.BAND_60_250,
|
||||
new int[]{ 9, 9, 9, 9, 9, 9, 8, 7, 7, 7, 7, 7, 6, 6, 5, 5, 4, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,45,41,42,58,54,51,47,43,46,42,44,41,43,42,44,40,43,45,42,38,34,31,27,24,20 }),
|
||||
RSP_DUO_BAND_250_420(FrequencyBand.BAND_250_420,
|
||||
new int[]{ 9, 9, 9, 9, 9, 9, 8, 7, 7, 7, 7, 7, 6, 6, 5, 5, 4, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,45,41,42,58,54,51,47,43,46,42,44,41,43,42,44,40,43,45,42,38,34,31,27,24,20 }),
|
||||
RSP_DUO_BAND_420_1000(FrequencyBand.BAND_420_1000,
|
||||
new int[]{ 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 7, 6, 6, 5, 5, 4, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,44,41,56,52,49,45,41,44,46,42,45,41,44,40,44,40,42,46,42,38,35,31,27,24,20 }),
|
||||
RSP_DUO_BAND_1000_2000(FrequencyBand.BAND_1000_2000,
|
||||
new int[]{ 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 5, 5, 4, 4, 3, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,45,41,56,53,49,46,42,43,46,42,44,41,43,48,44,40,43,45,42,38,34,31,27,24,20 }),
|
||||
|
||||
RSP_DX_BAND_0_12(FrequencyBand.BAND_0_12,
|
||||
new int[]{ 18,18,18,18,18,18,17,16,14,13,12,11,10, 9, 7, 6, 5, 5, 5, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,45,41,41,40,43,42,42,41,41,40,42,42,47,44,40,43,42,42,41,38,34,31,27,24,20 }),
|
||||
RSP_DX_BAND_12_60(FrequencyBand.BAND_12_60,
|
||||
new int[]{ 26,26,26,26,26,25,23,22,20,19,17,16,14,13,11,10, 8, 7, 5, 5, 5, 3, 2, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,50,46,41,40,42,40,42,40,42,41,42,41,43,41,43,41,49,45,40,42,40,42,38,33,29,24,20 }),
|
||||
RSP_DX_BAND_60_250(FrequencyBand.BAND_60_250,
|
||||
new int[]{ 26,26,26,26,26,25,23,22,20,19,17,16,14,13,11,10, 8, 7, 5, 5, 5, 3, 2, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,50,46,41,40,42,40,42,40,42,41,42,41,43,41,43,41,49,45,40,42,40,42,38,33,29,24,20 }),
|
||||
RSP_DX_BAND_250_420(FrequencyBand.BAND_250_420,
|
||||
new int[]{ 27,27,27,27,27,26,24,23,21,20,18,17,15,14,12,11, 9, 8, 6, 6, 5, 3, 2, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,50,46,41,40,42,40,42,40,42,41,42,41,43,41,43,41,46,42,40,42,40,42,38,33,29,24,20 }),
|
||||
RSP_DX_BAND_420_1000(FrequencyBand.BAND_420_1000,
|
||||
new int[]{ 20,20,20,20,20,20,18,17,16,14,13,12,11, 9, 8, 7, 7, 5, 4, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,51,48,44,40,42,42,41,43,42,41,41,43,42,44,40,43,42,41,40,46,43,39,35,31,28,24,20 }),
|
||||
RSP_DX_BAND_1000_2000(FrequencyBand.BAND_1000_2000,
|
||||
new int[]{ 18,18,18,18,18,18,16,15,14,13,11,10, 9, 8, 7, 6, 6, 6, 5, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,44,40,43,42,41,41,43,42,41,41,40,48,45,41,40,42,42,41,42,39,35,31,27,24,20 }),
|
||||
|
||||
//HiZ Port - RSP2 and RSPduo
|
||||
RSP_2_AND_DUO_HIZ_BAND_0_12(FrequencyBand.BAND_0_12,
|
||||
new int[]{ 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,56,54,51,48,45,43,40,56,54,51,48,45,43,40,43,41,44,41,44,42,39,36,34,31,28,25,23,20 }),
|
||||
RSP_2_AND_DUO_HIZ_BAND_12_60(FrequencyBand.BAND_12_60,
|
||||
new int[]{ 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,56,54,51,48,45,43,40,56,54,51,48,45,43,40,43,41,44,41,44,42,39,36,34,31,28,25,23,20 }),
|
||||
|
||||
//RSPdx HDR Mode
|
||||
RSP_DX_HDR_BAND_0_2(FrequencyBand.BAND_0_12,
|
||||
new int[]{ 18,18,18,18,18,18,17,16,14,13,12,11,10, 9, 7, 6, 5, 5, 5, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0 },
|
||||
new int[]{ 59,55,52,48,45,41,41,40,43,42,42,41,41,40,42,42,47,44,40,43,42,42,41,38,34,31,27,24,20 }),
|
||||
|
||||
UNKNOWN(FrequencyBand.UNKNOWN, new int[]{}, new int[]{});
|
||||
|
||||
private FrequencyBand mFrequencyBand;
|
||||
private int[] mLnaStates;
|
||||
private int[] mGainReductions;
|
||||
|
||||
GainReduction(FrequencyBand frequencyBand, int[] lnaStates, int[] gainReductions)
|
||||
{
|
||||
mFrequencyBand = frequencyBand;
|
||||
mLnaStates = lnaStates;
|
||||
mGainReductions = gainReductions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifies the index of the gain reduction value from the array of possible gain reduction values.
|
||||
* @param gainReductionValue to lookup index
|
||||
* @return matching index or -1 if a matching index is not found.
|
||||
*/
|
||||
public int getGainIndex(int gainReductionValue)
|
||||
{
|
||||
for(int x = 0; x < mGainReductions.length; x++)
|
||||
{
|
||||
if(mGainReductions[x] == gainReductionValue)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Minimum index for gain values
|
||||
*/
|
||||
public static int MIN_GAIN_INDEX = 0;
|
||||
|
||||
/**
|
||||
* Maximum index for gain values
|
||||
*/
|
||||
public static int MAX_GAIN_INDEX = 28;
|
||||
|
||||
/**
|
||||
* Number of discrete gain steps available for each entry
|
||||
*/
|
||||
public static int GAIN_STEPS_AVAILABLE = 29;
|
||||
|
||||
/**
|
||||
* RSP1 Gain Reduction Tables
|
||||
*/
|
||||
public static EnumSet<GainReduction> RSP_1_GAINS = EnumSet.range(RSP1_BAND_0_12, RSP1_BAND_1000_2000);
|
||||
|
||||
/**
|
||||
* RSP1A Gain Reduction Tables
|
||||
*/
|
||||
public static EnumSet<GainReduction> RSP_1A_GAINS = EnumSet.range(RSP1A_BAND_0_12, RSP1A_BAND_1000_2000);
|
||||
|
||||
/**
|
||||
* RSP2 Gain Reduction Tables
|
||||
*/
|
||||
public static EnumSet<GainReduction> RSP_2_GAINS = EnumSet.range(RSP2_BAND_0_12, RSP2_BAND_1000_2000);
|
||||
|
||||
/**
|
||||
* RSPduo Gain Reduction Tables
|
||||
*/
|
||||
public static EnumSet<GainReduction> RSP_DUO_GAINS = EnumSet.range(RSP_DUO_BAND_0_12, RSP_DUO_BAND_1000_2000);
|
||||
|
||||
/**
|
||||
* RSPdx Gain Reduction Tables
|
||||
*/
|
||||
public static EnumSet<GainReduction> RSP_DX_GAINS = EnumSet.range(RSP_DX_BAND_0_12, RSP_DX_BAND_1000_2000);
|
||||
|
||||
/**
|
||||
* RSPdx HDR Mode Gain Reduction Tables
|
||||
*/
|
||||
public static EnumSet<GainReduction> RSP_DX_HDR_GAINS = EnumSet.of(RSP_DX_HDR_BAND_0_2);
|
||||
|
||||
/**
|
||||
* RSP2 and RSPduo HiZ Port Gain Reduction Tables
|
||||
*/
|
||||
public static EnumSet<GainReduction> RSP_HIZ_GAINS = EnumSet.range(RSP_2_AND_DUO_HIZ_BAND_0_12, RSP_2_AND_DUO_HIZ_BAND_12_60);
|
||||
|
||||
/**
|
||||
* Lookup the gain reduction entry for a device that matches the frequency band.
|
||||
*
|
||||
* Note: directly use the RSP_DX_HDR_GAINS and RSP_HIZ_GAINS enumeration sets to match for HDR or HIZ modes.
|
||||
*
|
||||
* @param deviceType to lookup
|
||||
* @param frequencyBand to match
|
||||
* @return entry or UNKNOWN
|
||||
*/
|
||||
public static GainReduction lookup(DeviceType deviceType, FrequencyBand frequencyBand)
|
||||
{
|
||||
switch(deviceType)
|
||||
{
|
||||
case RSP1 -> {
|
||||
return fromBand(frequencyBand, RSP_1_GAINS);
|
||||
}
|
||||
case RSP1A -> {
|
||||
return fromBand(frequencyBand, RSP_1A_GAINS);
|
||||
}
|
||||
case RSP2 -> {
|
||||
return fromBand(frequencyBand, RSP_2_GAINS);
|
||||
}
|
||||
case RSPduo -> {
|
||||
return fromBand(frequencyBand, RSP_DUO_GAINS);
|
||||
}
|
||||
case RSPdx -> {
|
||||
return fromBand(frequencyBand, RSP_DX_GAINS);
|
||||
}
|
||||
}
|
||||
|
||||
return UNKNOWN;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lookup the gain reduction entry for a device that matches the specified frequency
|
||||
* @param deviceType to lookup
|
||||
* @param frequency to map to a frequency band
|
||||
* @return gain reduction entry or UNKNOWN
|
||||
*/
|
||||
public static GainReduction lookup(DeviceType deviceType, long frequency)
|
||||
{
|
||||
FrequencyBand band = FrequencyBand.fromValue(frequency);
|
||||
return lookup(deviceType, band);
|
||||
}
|
||||
|
||||
/**
|
||||
* Look up the gain reduction value that matches the frequency band from the set of gain reduction values.
|
||||
* @param frequencyBand to lookup
|
||||
* @param values to choose from
|
||||
* @return matching entry or UNKNOWN
|
||||
*/
|
||||
private static GainReduction fromBand(FrequencyBand frequencyBand, EnumSet<GainReduction> values)
|
||||
{
|
||||
for(GainReduction gainReduction: values)
|
||||
{
|
||||
if(gainReduction.getFrequencyBand() == frequencyBand)
|
||||
{
|
||||
return gainReduction;
|
||||
}
|
||||
}
|
||||
|
||||
return UNKNOWN;
|
||||
}
|
||||
|
||||
/**
|
||||
* Frequency band for the range of LNA state and gain reduction values.
|
||||
*/
|
||||
public FrequencyBand getFrequencyBand()
|
||||
{
|
||||
return mFrequencyBand;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of LNA states
|
||||
*/
|
||||
private int[] getLnaStates()
|
||||
{
|
||||
return mLnaStates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of gain reduction values
|
||||
*/
|
||||
private int[] getGainReductions()
|
||||
{
|
||||
return mGainReductions;
|
||||
}
|
||||
|
||||
/**
|
||||
* LNA state value for the specified gain index
|
||||
* @param index for the gain (0 - 29)
|
||||
* @return lna state
|
||||
*/
|
||||
public int getLnaState(int index)
|
||||
{
|
||||
if(MIN_GAIN_INDEX <= index && index <= MAX_GAIN_INDEX)
|
||||
{
|
||||
return getLnaStates()[index];
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Unrecognized gain index [" + index + "] - valid range: " +
|
||||
MIN_GAIN_INDEX + " <> " + MAX_GAIN_INDEX);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gain reduction value for the specified gain index
|
||||
* @param index for the gain (0 - 29)
|
||||
* @return gain reduction value (dB)
|
||||
*/
|
||||
public int getGainReduction(int index)
|
||||
{
|
||||
if(MIN_GAIN_INDEX <= index && index <= MAX_GAIN_INDEX)
|
||||
{
|
||||
return getGainReductions()[index];
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Unrecognized gain index [" + index + "] - valid range: " +
|
||||
MIN_GAIN_INDEX + " <> " + MAX_GAIN_INDEX);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if this gain reduction entry is valid for the specified frequency by checking the frequency band
|
||||
* of this entry and testing for containment.
|
||||
* @param frequency to check
|
||||
* @return true if the frequency is contained in the frequency band for this entry.
|
||||
*/
|
||||
public boolean isValidFor(long frequency)
|
||||
{
|
||||
return getFrequencyBand().contains(frequency);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -19,14 +19,12 @@
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner;
|
||||
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.util.Flag;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_RspDuoTunerParamsT;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
|
||||
/**
|
||||
* RSPduo Tuner Parameters structure
|
||||
* RSPduo abstract Tuner Parameters structure
|
||||
*/
|
||||
public class RspDuoTunerParameters extends TunerParameters
|
||||
public abstract class RspDuoTunerParameters extends TunerParameters
|
||||
{
|
||||
private MemorySegment mRspDuoMemorySegment;
|
||||
|
||||
@@ -44,7 +42,7 @@ public class RspDuoTunerParameters extends TunerParameters
|
||||
/**
|
||||
* Foreign memory segment for this structure
|
||||
*/
|
||||
private MemorySegment getRspDuoMemorySegment()
|
||||
MemorySegment getRspDuoMemorySegment()
|
||||
{
|
||||
return mRspDuoMemorySegment;
|
||||
}
|
||||
@@ -52,80 +50,50 @@ public class RspDuoTunerParameters extends TunerParameters
|
||||
/**
|
||||
* Indicates if the Bias-T is enabled
|
||||
*/
|
||||
public boolean isBiasT()
|
||||
{
|
||||
return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.biasTEnable$get(getRspDuoMemorySegment()));
|
||||
}
|
||||
public abstract boolean isBiasT();
|
||||
|
||||
/**
|
||||
* Enables or disables the Bias-T
|
||||
*/
|
||||
public void setBiasT(boolean enable)
|
||||
{
|
||||
sdrplay_api_RspDuoTunerParamsT.biasTEnable$set(getRspDuoMemorySegment(), Flag.of(enable));
|
||||
}
|
||||
public abstract void setBiasT(boolean enable);
|
||||
|
||||
/**
|
||||
* Tuner 1 AM port setting
|
||||
*/
|
||||
public RspDuoAmPort getTuner1AmPort()
|
||||
{
|
||||
return RspDuoAmPort.fromValue(sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$get(getRspDuoMemorySegment()));
|
||||
}
|
||||
public abstract RspDuoAmPort getTuner1AmPort();
|
||||
|
||||
/**
|
||||
* Set Tuner 1 AM port setting
|
||||
*/
|
||||
public void setTuner1AmPort(RspDuoAmPort amPort)
|
||||
{
|
||||
sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$set(getRspDuoMemorySegment(), amPort.getValue());
|
||||
}
|
||||
public abstract void setTuner1AmPort(RspDuoAmPort amPort);
|
||||
|
||||
/**
|
||||
* Indicates if Tuner 1 AM notch is enabled
|
||||
*/
|
||||
public boolean isTuner1AmNotch()
|
||||
{
|
||||
return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$get(getRspDuoMemorySegment()));
|
||||
}
|
||||
public abstract boolean isTuner1AmNotch();
|
||||
|
||||
/**
|
||||
* Enables or disables the Tuner 1 AM notch
|
||||
*/
|
||||
public void setTuner1AmNotch(boolean enable)
|
||||
{
|
||||
sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable));
|
||||
}
|
||||
public abstract void setTuner1AmNotch(boolean enable);
|
||||
|
||||
/**
|
||||
* Indicates if the RF notch is enabled
|
||||
*/
|
||||
public boolean isRfNotch()
|
||||
{
|
||||
return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$get(getRspDuoMemorySegment()));
|
||||
}
|
||||
public abstract boolean isRfNotch();
|
||||
|
||||
/**
|
||||
* Enables or disables the RF notch
|
||||
*/
|
||||
public void setRfNotch(boolean enable)
|
||||
{
|
||||
sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable));
|
||||
}
|
||||
public abstract void setRfNotch(boolean enable);
|
||||
|
||||
/**
|
||||
* Indicates if the RF DAB notch is enabled
|
||||
*/
|
||||
public boolean isRfDabNotch()
|
||||
{
|
||||
return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$get(getRspDuoMemorySegment()));
|
||||
}
|
||||
public abstract boolean isRfDabNotch();
|
||||
|
||||
/**
|
||||
* Enables or disables the RF DAB notch
|
||||
*/
|
||||
public void setRfDabNotch(boolean enable)
|
||||
{
|
||||
sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable));
|
||||
}
|
||||
public abstract void setRfDabNotch(boolean enable);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner;
|
||||
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.util.Flag;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_RspDuoTunerParamsT;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
|
||||
/**
|
||||
* RSPduo Tuner Parameters structure for API Versions 3.07 - 3.12.
|
||||
*/
|
||||
public class RspDuoTunerParametersV3_07 extends RspDuoTunerParameters
|
||||
{
|
||||
/**
|
||||
* Constructs an instance from the foreign memory segment
|
||||
* @param tunerParametersMemorySegment of foreign memory structure
|
||||
* @param rspDuoMemorySegment of foreign memory structure
|
||||
*/
|
||||
RspDuoTunerParametersV3_07(MemorySegment tunerParametersMemorySegment, MemorySegment rspDuoMemorySegment)
|
||||
{
|
||||
super(tunerParametersMemorySegment, rspDuoMemorySegment);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the Bias-T is enabled
|
||||
*/
|
||||
public boolean isBiasT()
|
||||
{
|
||||
return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.biasTEnable$get(getRspDuoMemorySegment()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the Bias-T
|
||||
*/
|
||||
public void setBiasT(boolean enable)
|
||||
{
|
||||
sdrplay_api_RspDuoTunerParamsT.biasTEnable$set(getRspDuoMemorySegment(), Flag.of(enable));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tuner 1 AM port setting
|
||||
*/
|
||||
public RspDuoAmPort getTuner1AmPort()
|
||||
{
|
||||
return RspDuoAmPort.fromValue(sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$get(getRspDuoMemorySegment()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Tuner 1 AM port setting
|
||||
*/
|
||||
public void setTuner1AmPort(RspDuoAmPort amPort)
|
||||
{
|
||||
sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$set(getRspDuoMemorySegment(), amPort.getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if Tuner 1 AM notch is enabled
|
||||
*/
|
||||
public boolean isTuner1AmNotch()
|
||||
{
|
||||
return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$get(getRspDuoMemorySegment()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the Tuner 1 AM notch
|
||||
*/
|
||||
public void setTuner1AmNotch(boolean enable)
|
||||
{
|
||||
sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable));
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the RF notch is enabled
|
||||
*/
|
||||
public boolean isRfNotch()
|
||||
{
|
||||
return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$get(getRspDuoMemorySegment()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the RF notch
|
||||
*/
|
||||
public void setRfNotch(boolean enable)
|
||||
{
|
||||
sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable));
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the RF DAB notch is enabled
|
||||
*/
|
||||
public boolean isRfDabNotch()
|
||||
{
|
||||
return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$get(getRspDuoMemorySegment()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the RF DAB notch
|
||||
*/
|
||||
public void setRfDabNotch(boolean enable)
|
||||
{
|
||||
sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner;
|
||||
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.util.Flag;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_14.sdrplay_api_RspDuoTunerParamsT;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
|
||||
/**
|
||||
* RSPduo Tuner Parameters structure for API Versions 3.14+.
|
||||
*
|
||||
* Note: version 3.14 is different from version 3.07-3.12 because it adds the RspDuo_ResetSlaveFlagsT structure and
|
||||
* methods, however these are not used/implemented in this class or in the parent abstract class.
|
||||
*/
|
||||
public class RspDuoTunerParametersV3_14 extends RspDuoTunerParameters
|
||||
{
|
||||
/**
|
||||
* Constructs an instance from the foreign memory segment
|
||||
* @param tunerParametersMemorySegment of foreign memory structure
|
||||
* @param rspDuoMemorySegment of foreign memory structure
|
||||
*/
|
||||
RspDuoTunerParametersV3_14(MemorySegment tunerParametersMemorySegment, MemorySegment rspDuoMemorySegment)
|
||||
{
|
||||
super(tunerParametersMemorySegment, rspDuoMemorySegment);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the Bias-T is enabled
|
||||
*/
|
||||
public boolean isBiasT()
|
||||
{
|
||||
return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.biasTEnable$get(getRspDuoMemorySegment()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the Bias-T
|
||||
*/
|
||||
public void setBiasT(boolean enable)
|
||||
{
|
||||
sdrplay_api_RspDuoTunerParamsT.biasTEnable$set(getRspDuoMemorySegment(), Flag.of(enable));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tuner 1 AM port setting
|
||||
*/
|
||||
public RspDuoAmPort getTuner1AmPort()
|
||||
{
|
||||
return RspDuoAmPort.fromValue(sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$get(getRspDuoMemorySegment()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Tuner 1 AM port setting
|
||||
*/
|
||||
public void setTuner1AmPort(RspDuoAmPort amPort)
|
||||
{
|
||||
sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$set(getRspDuoMemorySegment(), amPort.getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if Tuner 1 AM notch is enabled
|
||||
*/
|
||||
public boolean isTuner1AmNotch()
|
||||
{
|
||||
return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$get(getRspDuoMemorySegment()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the Tuner 1 AM notch
|
||||
*/
|
||||
public void setTuner1AmNotch(boolean enable)
|
||||
{
|
||||
sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable));
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the RF notch is enabled
|
||||
*/
|
||||
public boolean isRfNotch()
|
||||
{
|
||||
return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$get(getRspDuoMemorySegment()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the RF notch
|
||||
*/
|
||||
public void setRfNotch(boolean enable)
|
||||
{
|
||||
sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable));
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the RF DAB notch is enabled
|
||||
*/
|
||||
public boolean isRfDabNotch()
|
||||
{
|
||||
return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$get(getRspDuoMemorySegment()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the RF DAB notch
|
||||
*/
|
||||
public void setRfDabNotch(boolean enable)
|
||||
{
|
||||
sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable));
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner;
|
||||
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.Version;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_RxChannelParamsT;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
@@ -34,7 +35,7 @@ public class TunerParametersFactory
|
||||
* @param memorySegment for the sdrplay_api_RxChannelParamsT structure
|
||||
* @return tuner parameters
|
||||
*/
|
||||
public static TunerParameters create(DeviceType deviceType, MemorySegment memorySegment)
|
||||
public static TunerParameters create(Version version, DeviceType deviceType, MemorySegment memorySegment)
|
||||
{
|
||||
MemorySegment tunerParametersMemorySegment = sdrplay_api_RxChannelParamsT.tunerParams$slice(memorySegment);
|
||||
|
||||
@@ -43,7 +44,8 @@ public class TunerParametersFactory
|
||||
case RSP1 -> {
|
||||
return new Rsp1TunerParameters(tunerParametersMemorySegment);
|
||||
}
|
||||
case RSP1A -> {
|
||||
//RSP1A and RSP1B share the same tuner parameters structures
|
||||
case RSP1A, RSP1B -> {
|
||||
MemorySegment rsp1AMemorySegment = sdrplay_api_RxChannelParamsT.rsp1aTunerParams$slice(memorySegment);
|
||||
return new Rsp1aTunerParameters(memorySegment, rsp1AMemorySegment);
|
||||
}
|
||||
@@ -52,8 +54,20 @@ public class TunerParametersFactory
|
||||
return new Rsp2TunerParameters(memorySegment, rsp2MemorySegment);
|
||||
}
|
||||
case RSPduo -> {
|
||||
MemorySegment rspDuoMemorySegment = sdrplay_api_RxChannelParamsT.rspDuoTunerParams$slice(memorySegment);
|
||||
return new RspDuoTunerParameters(memorySegment, rspDuoMemorySegment);
|
||||
if(version.gte(Version.V3_14))
|
||||
{
|
||||
MemorySegment rspDuoMemorySegment = io.github.dsheirer.source.tuner.sdrplay.api.v3_14.sdrplay_api_RxChannelParamsT.rspDuoTunerParams$slice(memorySegment);
|
||||
return new RspDuoTunerParametersV3_14(memorySegment, rspDuoMemorySegment);
|
||||
}
|
||||
else if(version.gte(Version.V3_07))
|
||||
{
|
||||
MemorySegment rspDuoMemorySegment = sdrplay_api_RxChannelParamsT.rspDuoTunerParams$slice(memorySegment);
|
||||
return new RspDuoTunerParametersV3_07(memorySegment, rspDuoMemorySegment);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("Unrecognized API version: " + version);
|
||||
}
|
||||
}
|
||||
case RSPdx -> {
|
||||
MemorySegment rspDxMemorySegment = sdrplay_api_RxChannelParamsT.rspDxTunerParams$slice(memorySegment);
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import static java.lang.foreign.ValueLayout.ADDRESS;
|
||||
import static java.lang.foreign.ValueLayout.JAVA_BOOLEAN;
|
||||
import static java.lang.foreign.ValueLayout.JAVA_BYTE;
|
||||
import static java.lang.foreign.ValueLayout.JAVA_DOUBLE;
|
||||
import static java.lang.foreign.ValueLayout.JAVA_FLOAT;
|
||||
import static java.lang.foreign.ValueLayout.JAVA_INT;
|
||||
import static java.lang.foreign.ValueLayout.JAVA_LONG;
|
||||
import static java.lang.foreign.ValueLayout.JAVA_SHORT;
|
||||
import static java.lang.foreign.ValueLayout.OfAddress;
|
||||
import static java.lang.foreign.ValueLayout.OfBoolean;
|
||||
import static java.lang.foreign.ValueLayout.OfByte;
|
||||
import static java.lang.foreign.ValueLayout.OfDouble;
|
||||
import static java.lang.foreign.ValueLayout.OfFloat;
|
||||
import static java.lang.foreign.ValueLayout.OfInt;
|
||||
import static java.lang.foreign.ValueLayout.OfLong;
|
||||
import static java.lang.foreign.ValueLayout.OfShort;
|
||||
final class Constants$root {
|
||||
|
||||
// Suppresses default constructor, ensuring non-instantiability.
|
||||
private Constants$root() {}
|
||||
static final OfBoolean C_BOOL$LAYOUT = JAVA_BOOLEAN;
|
||||
static final OfByte C_CHAR$LAYOUT = JAVA_BYTE;
|
||||
static final OfShort C_SHORT$LAYOUT = JAVA_SHORT;
|
||||
static final OfInt C_INT$LAYOUT = JAVA_INT;
|
||||
static final OfLong C_LONG$LAYOUT = JAVA_LONG;
|
||||
static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG;
|
||||
static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT;
|
||||
static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE;
|
||||
static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64).asUnbounded();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,253 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
// Generated by jextract
|
||||
|
||||
import java.lang.foreign.FunctionDescriptor;
|
||||
import java.lang.foreign.GroupLayout;
|
||||
import java.lang.foreign.Linker;
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.SymbolLookup;
|
||||
import java.lang.foreign.ValueLayout;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.invoke.MethodType;
|
||||
|
||||
import static java.lang.foreign.ValueLayout.ADDRESS;
|
||||
import static java.lang.foreign.ValueLayout.JAVA_DOUBLE;
|
||||
import static java.lang.foreign.ValueLayout.JAVA_LONG;
|
||||
|
||||
final class RuntimeHelper {
|
||||
|
||||
private static final Linker LINKER = Linker.nativeLinker();
|
||||
private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader();
|
||||
private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup();
|
||||
private static final SymbolLookup SYMBOL_LOOKUP;
|
||||
private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); };
|
||||
|
||||
final static SegmentAllocator CONSTANT_ALLOCATOR =
|
||||
(size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto());
|
||||
|
||||
static {
|
||||
System.loadLibrary("libsdrplay_api");
|
||||
SymbolLookup loaderLookup = SymbolLookup.loaderLookup();
|
||||
SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name));
|
||||
}
|
||||
|
||||
// Suppresses default constructor, ensuring non-instantiability.
|
||||
private RuntimeHelper() {}
|
||||
|
||||
static <T> T requireNonNull(T obj, String symbolName) {
|
||||
if (obj == null) {
|
||||
throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName);
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) {
|
||||
return SYMBOL_LOOKUP.find(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), symbol.scope())).orElse(null);
|
||||
}
|
||||
|
||||
static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) {
|
||||
return SYMBOL_LOOKUP.find(name).
|
||||
map(addr -> LINKER.downcallHandle(addr, fdesc)).
|
||||
orElse(null);
|
||||
}
|
||||
|
||||
static MethodHandle downcallHandle(FunctionDescriptor fdesc) {
|
||||
return LINKER.downcallHandle(fdesc);
|
||||
}
|
||||
|
||||
static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) {
|
||||
return SYMBOL_LOOKUP.find(name).
|
||||
map(addr -> VarargsInvoker.make(addr, fdesc)).
|
||||
orElse(null);
|
||||
}
|
||||
|
||||
static MethodHandle upcallHandle(Class<?> fi, String name, FunctionDescriptor fdesc) {
|
||||
try {
|
||||
return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType());
|
||||
} catch (Throwable ex) {
|
||||
throw new AssertionError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
static <Z> MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, SegmentScope scope) {
|
||||
try {
|
||||
fiHandle = fiHandle.bindTo(z);
|
||||
return LINKER.upcallStub(fiHandle, fdesc, scope);
|
||||
} catch (Throwable ex) {
|
||||
throw new AssertionError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, SegmentScope scope) {
|
||||
return MemorySegment.ofAddress(addr.address(), numElements * layout.byteSize(), scope);
|
||||
}
|
||||
|
||||
// Internals only below this point
|
||||
|
||||
private static final class VarargsInvoker {
|
||||
private static final MethodHandle INVOKE_MH;
|
||||
private final MemorySegment symbol;
|
||||
private final FunctionDescriptor function;
|
||||
|
||||
private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) {
|
||||
this.symbol = symbol;
|
||||
this.function = function;
|
||||
}
|
||||
|
||||
static {
|
||||
try {
|
||||
INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class));
|
||||
} catch (ReflectiveOperationException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) {
|
||||
VarargsInvoker invoker = new VarargsInvoker(symbol, function);
|
||||
MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1);
|
||||
MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class);
|
||||
for (MemoryLayout layout : function.argumentLayouts()) {
|
||||
mtype = mtype.appendParameterTypes(carrier(layout, false));
|
||||
}
|
||||
mtype = mtype.appendParameterTypes(Object[].class);
|
||||
boolean needsAllocator = function.returnLayout().isPresent() &&
|
||||
function.returnLayout().get() instanceof GroupLayout;
|
||||
if (needsAllocator) {
|
||||
mtype = mtype.insertParameterTypes(0, SegmentAllocator.class);
|
||||
} else {
|
||||
handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR);
|
||||
}
|
||||
return handle.asType(mtype);
|
||||
}
|
||||
|
||||
static Class<?> carrier(MemoryLayout layout, boolean ret) {
|
||||
if (layout instanceof ValueLayout valueLayout) {
|
||||
return valueLayout.carrier();
|
||||
} else if (layout instanceof GroupLayout) {
|
||||
return MemorySegment.class;
|
||||
} else {
|
||||
throw new AssertionError("Cannot get here!");
|
||||
}
|
||||
}
|
||||
|
||||
private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable {
|
||||
// one trailing Object[]
|
||||
int nNamedArgs = function.argumentLayouts().size();
|
||||
assert(args.length == nNamedArgs + 1);
|
||||
// The last argument is the array of vararg collector
|
||||
Object[] unnamedArgs = (Object[]) args[args.length - 1];
|
||||
|
||||
int argsCount = nNamedArgs + unnamedArgs.length;
|
||||
Class<?>[] argTypes = new Class<?>[argsCount];
|
||||
MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length];
|
||||
|
||||
int pos = 0;
|
||||
for (pos = 0; pos < nNamedArgs; pos++) {
|
||||
argLayouts[pos] = function.argumentLayouts().get(pos);
|
||||
}
|
||||
|
||||
assert pos == nNamedArgs;
|
||||
for (Object o: unnamedArgs) {
|
||||
argLayouts[pos] = variadicLayout(normalize(o.getClass()));
|
||||
pos++;
|
||||
}
|
||||
assert pos == argsCount;
|
||||
|
||||
FunctionDescriptor f = (function.returnLayout().isEmpty()) ?
|
||||
FunctionDescriptor.ofVoid(argLayouts) :
|
||||
FunctionDescriptor.of(function.returnLayout().get(), argLayouts);
|
||||
MethodHandle mh = LINKER.downcallHandle(symbol, f);
|
||||
boolean needsAllocator = function.returnLayout().isPresent() &&
|
||||
function.returnLayout().get() instanceof GroupLayout;
|
||||
if (needsAllocator) {
|
||||
mh = mh.bindTo(allocator);
|
||||
}
|
||||
// flatten argument list so that it can be passed to an asSpreader MH
|
||||
Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length];
|
||||
System.arraycopy(args, 0, allArgs, 0, nNamedArgs);
|
||||
System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length);
|
||||
|
||||
return mh.asSpreader(Object[].class, argsCount).invoke(allArgs);
|
||||
}
|
||||
|
||||
private static Class<?> unboxIfNeeded(Class<?> clazz) {
|
||||
if (clazz == Boolean.class) {
|
||||
return boolean.class;
|
||||
} else if (clazz == Void.class) {
|
||||
return void.class;
|
||||
} else if (clazz == Byte.class) {
|
||||
return byte.class;
|
||||
} else if (clazz == Character.class) {
|
||||
return char.class;
|
||||
} else if (clazz == Short.class) {
|
||||
return short.class;
|
||||
} else if (clazz == Integer.class) {
|
||||
return int.class;
|
||||
} else if (clazz == Long.class) {
|
||||
return long.class;
|
||||
} else if (clazz == Float.class) {
|
||||
return float.class;
|
||||
} else if (clazz == Double.class) {
|
||||
return double.class;
|
||||
} else {
|
||||
return clazz;
|
||||
}
|
||||
}
|
||||
|
||||
private Class<?> promote(Class<?> c) {
|
||||
if (c == byte.class || c == char.class || c == short.class || c == int.class) {
|
||||
return long.class;
|
||||
} else if (c == float.class) {
|
||||
return double.class;
|
||||
} else {
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
||||
private Class<?> normalize(Class<?> c) {
|
||||
c = unboxIfNeeded(c);
|
||||
if (c.isPrimitive()) {
|
||||
return promote(c);
|
||||
}
|
||||
if (c == MemorySegment.class) {
|
||||
return MemorySegment.class;
|
||||
}
|
||||
throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName());
|
||||
}
|
||||
|
||||
private MemoryLayout variadicLayout(Class<?> c) {
|
||||
if (c == long.class) {
|
||||
return JAVA_LONG;
|
||||
} else if (c == double.class) {
|
||||
return JAVA_DOUBLE;
|
||||
} else if (c == MemorySegment.class) {
|
||||
return ADDRESS;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unhandled variadic argument class: " + c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.FunctionDescriptor;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
final class constants$0 {
|
||||
|
||||
// Suppresses default constructor, ensuring non-instantiability.
|
||||
private constants$0() {}
|
||||
static final FunctionDescriptor sdrplay_api_StreamCallback_t$FUNC = FunctionDescriptor.ofVoid(
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_StreamCallback_t_UP$FUNC = FunctionDescriptor.ofVoid(
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_StreamCallback_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_StreamCallback_t.class, "apply", constants$0.sdrplay_api_StreamCallback_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_StreamCallback_t_DOWN$FUNC = FunctionDescriptor.ofVoid(
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_StreamCallback_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$0.sdrplay_api_StreamCallback_t_DOWN$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_EventCallback_t$FUNC = FunctionDescriptor.ofVoid(
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_EventCallback_t_UP$FUNC = FunctionDescriptor.ofVoid(
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_EventCallback_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_EventCallback_t.class, "apply", constants$0.sdrplay_api_EventCallback_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_EventCallback_t_DOWN$FUNC = FunctionDescriptor.ofVoid(
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_EventCallback_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$0.sdrplay_api_EventCallback_t_DOWN$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_Open_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final FunctionDescriptor sdrplay_api_Open_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final MethodHandle sdrplay_api_Open_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_Open_t.class, "apply", constants$0.sdrplay_api_Open_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_Open_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final MethodHandle sdrplay_api_Open_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$0.sdrplay_api_Open_t_DOWN$FUNC
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.FunctionDescriptor;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
final class constants$1 {
|
||||
|
||||
// Suppresses default constructor, ensuring non-instantiability.
|
||||
private constants$1() {}
|
||||
static final FunctionDescriptor sdrplay_api_Close_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final FunctionDescriptor sdrplay_api_Close_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final MethodHandle sdrplay_api_Close_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_Close_t.class, "apply", constants$1.sdrplay_api_Close_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_Close_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final MethodHandle sdrplay_api_Close_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$1.sdrplay_api_Close_t_DOWN$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_ApiVersion_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_ApiVersion_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_ApiVersion_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_ApiVersion_t.class, "apply", constants$1.sdrplay_api_ApiVersion_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_ApiVersion_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_ApiVersion_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$1.sdrplay_api_ApiVersion_t_DOWN$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_LockDeviceApi_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final FunctionDescriptor sdrplay_api_LockDeviceApi_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final MethodHandle sdrplay_api_LockDeviceApi_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_LockDeviceApi_t.class, "apply", constants$1.sdrplay_api_LockDeviceApi_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_LockDeviceApi_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final MethodHandle sdrplay_api_LockDeviceApi_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$1.sdrplay_api_LockDeviceApi_t_DOWN$FUNC
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.FunctionDescriptor;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
final class constants$10 {
|
||||
|
||||
// Suppresses default constructor, ensuring non-instantiability.
|
||||
private constants$10() {}
|
||||
static final FunctionDescriptor sdrplay_api_Update$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_Update$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_Update",
|
||||
constants$10.sdrplay_api_Update$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoActiveTuner$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_SwapRspDuoActiveTuner$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_SwapRspDuoActiveTuner",
|
||||
constants$10.sdrplay_api_SwapRspDuoActiveTuner$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoDualTunerModeSampleRate$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_DOUBLE$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_SwapRspDuoDualTunerModeSampleRate$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_SwapRspDuoDualTunerModeSampleRate",
|
||||
constants$10.sdrplay_api_SwapRspDuoDualTunerModeSampleRate$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoMode$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_DOUBLE$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_SwapRspDuoMode$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_SwapRspDuoMode",
|
||||
constants$10.sdrplay_api_SwapRspDuoMode$FUNC
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.FunctionDescriptor;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
final class constants$2 {
|
||||
|
||||
// Suppresses default constructor, ensuring non-instantiability.
|
||||
private constants$2() {}
|
||||
static final FunctionDescriptor sdrplay_api_UnlockDeviceApi_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final FunctionDescriptor sdrplay_api_UnlockDeviceApi_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final MethodHandle sdrplay_api_UnlockDeviceApi_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_UnlockDeviceApi_t.class, "apply", constants$2.sdrplay_api_UnlockDeviceApi_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_UnlockDeviceApi_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final MethodHandle sdrplay_api_UnlockDeviceApi_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$2.sdrplay_api_UnlockDeviceApi_t_DOWN$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_GetDevices_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_GetDevices_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_GetDevices_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_GetDevices_t.class, "apply", constants$2.sdrplay_api_GetDevices_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_GetDevices_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_GetDevices_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$2.sdrplay_api_GetDevices_t_DOWN$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_SelectDevice_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_SelectDevice_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_SelectDevice_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_SelectDevice_t.class, "apply", constants$2.sdrplay_api_SelectDevice_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_SelectDevice_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_SelectDevice_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$2.sdrplay_api_SelectDevice_t_DOWN$FUNC
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.FunctionDescriptor;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
final class constants$3 {
|
||||
|
||||
// Suppresses default constructor, ensuring non-instantiability.
|
||||
private constants$3() {}
|
||||
static final FunctionDescriptor sdrplay_api_ReleaseDevice_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_ReleaseDevice_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_ReleaseDevice_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_ReleaseDevice_t.class, "apply", constants$3.sdrplay_api_ReleaseDevice_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_ReleaseDevice_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_ReleaseDevice_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$3.sdrplay_api_ReleaseDevice_t_DOWN$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_GetErrorString_t$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_GetErrorString_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_GetErrorString_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_GetErrorString_t.class, "apply", constants$3.sdrplay_api_GetErrorString_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_GetErrorString_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_GetErrorString_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$3.sdrplay_api_GetErrorString_t_DOWN$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_GetLastError_t$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_GetLastError_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_GetLastError_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_GetLastError_t.class, "apply", constants$3.sdrplay_api_GetLastError_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_GetLastError_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_GetLastError_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$3.sdrplay_api_GetLastError_t_DOWN$FUNC
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.FunctionDescriptor;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
final class constants$4 {
|
||||
|
||||
// Suppresses default constructor, ensuring non-instantiability.
|
||||
private constants$4() {}
|
||||
static final FunctionDescriptor sdrplay_api_GetLastErrorByType_t$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_GetLastErrorByType_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_GetLastErrorByType_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_GetLastErrorByType_t.class, "apply", constants$4.sdrplay_api_GetLastErrorByType_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_GetLastErrorByType_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_GetLastErrorByType_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$4.sdrplay_api_GetLastErrorByType_t_DOWN$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_DisableHeartbeat_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final FunctionDescriptor sdrplay_api_DisableHeartbeat_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final MethodHandle sdrplay_api_DisableHeartbeat_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_DisableHeartbeat_t.class, "apply", constants$4.sdrplay_api_DisableHeartbeat_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_DisableHeartbeat_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final MethodHandle sdrplay_api_DisableHeartbeat_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$4.sdrplay_api_DisableHeartbeat_t_DOWN$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_DebugEnable_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_DebugEnable_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_DebugEnable_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_DebugEnable_t.class, "apply", constants$4.sdrplay_api_DebugEnable_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_DebugEnable_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_DebugEnable_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$4.sdrplay_api_DebugEnable_t_DOWN$FUNC
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.FunctionDescriptor;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
final class constants$5 {
|
||||
|
||||
// Suppresses default constructor, ensuring non-instantiability.
|
||||
private constants$5() {}
|
||||
static final FunctionDescriptor sdrplay_api_GetDeviceParams_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_GetDeviceParams_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_GetDeviceParams_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_GetDeviceParams_t.class, "apply", constants$5.sdrplay_api_GetDeviceParams_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_GetDeviceParams_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_GetDeviceParams_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$5.sdrplay_api_GetDeviceParams_t_DOWN$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_Init_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_Init_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_Init_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_Init_t.class, "apply", constants$5.sdrplay_api_Init_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_Init_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_Init_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$5.sdrplay_api_Init_t_DOWN$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_Uninit_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_Uninit_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_Uninit_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_Uninit_t.class, "apply", constants$5.sdrplay_api_Uninit_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_Uninit_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_Uninit_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$5.sdrplay_api_Uninit_t_DOWN$FUNC
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.FunctionDescriptor;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
final class constants$6 {
|
||||
|
||||
// Suppresses default constructor, ensuring non-instantiability.
|
||||
private constants$6() {}
|
||||
static final FunctionDescriptor sdrplay_api_Update_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_Update_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_Update_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_Update_t.class, "apply", constants$6.sdrplay_api_Update_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_Update_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_Update_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$6.sdrplay_api_Update_t_DOWN$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoActiveTuner_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoActiveTuner_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_SwapRspDuoActiveTuner_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_SwapRspDuoActiveTuner_t.class, "apply", constants$6.sdrplay_api_SwapRspDuoActiveTuner_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoActiveTuner_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_SwapRspDuoActiveTuner_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$6.sdrplay_api_SwapRspDuoActiveTuner_t_DOWN$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_DOUBLE$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_DOUBLE$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t.class, "apply", constants$6.sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_DOUBLE$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$6.sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_DOWN$FUNC
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.FunctionDescriptor;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
final class constants$7 {
|
||||
|
||||
// Suppresses default constructor, ensuring non-instantiability.
|
||||
private constants$7() {}
|
||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoMode_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_DOUBLE$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoMode_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_DOUBLE$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_SwapRspDuoMode_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_SwapRspDuoMode_t.class, "apply", constants$7.sdrplay_api_SwapRspDuoMode_t_UP$FUNC);
|
||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoMode_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_DOUBLE$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_SwapRspDuoMode_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||
constants$7.sdrplay_api_SwapRspDuoMode_t_DOWN$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_Open$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final MethodHandle sdrplay_api_Open$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_Open",
|
||||
constants$7.sdrplay_api_Open$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_Close$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final MethodHandle sdrplay_api_Close$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_Close",
|
||||
constants$7.sdrplay_api_Close$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_ApiVersion$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_ApiVersion$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_ApiVersion",
|
||||
constants$7.sdrplay_api_ApiVersion$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_LockDeviceApi$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final MethodHandle sdrplay_api_LockDeviceApi$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_LockDeviceApi",
|
||||
constants$7.sdrplay_api_LockDeviceApi$FUNC
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.FunctionDescriptor;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
final class constants$8 {
|
||||
|
||||
// Suppresses default constructor, ensuring non-instantiability.
|
||||
private constants$8() {}
|
||||
static final FunctionDescriptor sdrplay_api_UnlockDeviceApi$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final MethodHandle sdrplay_api_UnlockDeviceApi$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_UnlockDeviceApi",
|
||||
constants$8.sdrplay_api_UnlockDeviceApi$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_GetDevices$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_GetDevices$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_GetDevices",
|
||||
constants$8.sdrplay_api_GetDevices$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_SelectDevice$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_SelectDevice$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_SelectDevice",
|
||||
constants$8.sdrplay_api_SelectDevice$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_ReleaseDevice$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_ReleaseDevice$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_ReleaseDevice",
|
||||
constants$8.sdrplay_api_ReleaseDevice$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_GetErrorString$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_GetErrorString$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_GetErrorString",
|
||||
constants$8.sdrplay_api_GetErrorString$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_GetLastError$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_GetLastError$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_GetLastError",
|
||||
constants$8.sdrplay_api_GetLastError$FUNC
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.FunctionDescriptor;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
final class constants$9 {
|
||||
|
||||
// Suppresses default constructor, ensuring non-instantiability.
|
||||
private constants$9() {}
|
||||
static final FunctionDescriptor sdrplay_api_GetLastErrorByType$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_GetLastErrorByType$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_GetLastErrorByType",
|
||||
constants$9.sdrplay_api_GetLastErrorByType$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_DisableHeartbeat$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||
static final MethodHandle sdrplay_api_DisableHeartbeat$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_DisableHeartbeat",
|
||||
constants$9.sdrplay_api_DisableHeartbeat$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_DebugEnable$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_INT$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_DebugEnable$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_DebugEnable",
|
||||
constants$9.sdrplay_api_DebugEnable$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_GetDeviceParams$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_GetDeviceParams$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_GetDeviceParams",
|
||||
constants$9.sdrplay_api_GetDeviceParams$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_Init$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_Init$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_Init",
|
||||
constants$9.sdrplay_api_Init$FUNC
|
||||
);
|
||||
static final FunctionDescriptor sdrplay_api_Uninit$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||
Constants$root.C_POINTER$LAYOUT
|
||||
);
|
||||
static final MethodHandle sdrplay_api_Uninit$MH = RuntimeHelper.downcallHandle(
|
||||
"sdrplay_api_Uninit",
|
||||
constants$9.sdrplay_api_Uninit$FUNC
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* sdrplay_api_AgcControlT enable;
|
||||
* int setPoint_dBfs;
|
||||
* unsigned short attack_ms;
|
||||
* unsigned short decay_ms;
|
||||
* unsigned short decay_delay_ms;
|
||||
* unsigned short decay_threshold_dB;
|
||||
* int syncUpdate;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_AgcT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("enable"),
|
||||
Constants$root.C_INT$LAYOUT.withName("setPoint_dBfs"),
|
||||
Constants$root.C_SHORT$LAYOUT.withName("attack_ms"),
|
||||
Constants$root.C_SHORT$LAYOUT.withName("decay_ms"),
|
||||
Constants$root.C_SHORT$LAYOUT.withName("decay_delay_ms"),
|
||||
Constants$root.C_SHORT$LAYOUT.withName("decay_threshold_dB"),
|
||||
Constants$root.C_INT$LAYOUT.withName("syncUpdate")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_AgcT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle enable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("enable"));
|
||||
public static VarHandle enable$VH() {
|
||||
return sdrplay_api_AgcT.enable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_AgcControlT enable;
|
||||
* }
|
||||
*/
|
||||
public static int enable$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_AgcT.enable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_AgcControlT enable;
|
||||
* }
|
||||
*/
|
||||
public static void enable$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_AgcT.enable$VH.set(seg, x);
|
||||
}
|
||||
public static int enable$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_AgcT.enable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void enable$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_AgcT.enable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle setPoint_dBfs$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("setPoint_dBfs"));
|
||||
public static VarHandle setPoint_dBfs$VH() {
|
||||
return sdrplay_api_AgcT.setPoint_dBfs$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* int setPoint_dBfs;
|
||||
* }
|
||||
*/
|
||||
public static int setPoint_dBfs$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_AgcT.setPoint_dBfs$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* int setPoint_dBfs;
|
||||
* }
|
||||
*/
|
||||
public static void setPoint_dBfs$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_AgcT.setPoint_dBfs$VH.set(seg, x);
|
||||
}
|
||||
public static int setPoint_dBfs$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_AgcT.setPoint_dBfs$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void setPoint_dBfs$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_AgcT.setPoint_dBfs$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle attack_ms$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("attack_ms"));
|
||||
public static VarHandle attack_ms$VH() {
|
||||
return sdrplay_api_AgcT.attack_ms$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned short attack_ms;
|
||||
* }
|
||||
*/
|
||||
public static short attack_ms$get(MemorySegment seg) {
|
||||
return (short)sdrplay_api_AgcT.attack_ms$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned short attack_ms;
|
||||
* }
|
||||
*/
|
||||
public static void attack_ms$set(MemorySegment seg, short x) {
|
||||
sdrplay_api_AgcT.attack_ms$VH.set(seg, x);
|
||||
}
|
||||
public static short attack_ms$get(MemorySegment seg, long index) {
|
||||
return (short)sdrplay_api_AgcT.attack_ms$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void attack_ms$set(MemorySegment seg, long index, short x) {
|
||||
sdrplay_api_AgcT.attack_ms$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle decay_ms$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("decay_ms"));
|
||||
public static VarHandle decay_ms$VH() {
|
||||
return sdrplay_api_AgcT.decay_ms$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned short decay_ms;
|
||||
* }
|
||||
*/
|
||||
public static short decay_ms$get(MemorySegment seg) {
|
||||
return (short)sdrplay_api_AgcT.decay_ms$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned short decay_ms;
|
||||
* }
|
||||
*/
|
||||
public static void decay_ms$set(MemorySegment seg, short x) {
|
||||
sdrplay_api_AgcT.decay_ms$VH.set(seg, x);
|
||||
}
|
||||
public static short decay_ms$get(MemorySegment seg, long index) {
|
||||
return (short)sdrplay_api_AgcT.decay_ms$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void decay_ms$set(MemorySegment seg, long index, short x) {
|
||||
sdrplay_api_AgcT.decay_ms$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle decay_delay_ms$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("decay_delay_ms"));
|
||||
public static VarHandle decay_delay_ms$VH() {
|
||||
return sdrplay_api_AgcT.decay_delay_ms$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned short decay_delay_ms;
|
||||
* }
|
||||
*/
|
||||
public static short decay_delay_ms$get(MemorySegment seg) {
|
||||
return (short)sdrplay_api_AgcT.decay_delay_ms$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned short decay_delay_ms;
|
||||
* }
|
||||
*/
|
||||
public static void decay_delay_ms$set(MemorySegment seg, short x) {
|
||||
sdrplay_api_AgcT.decay_delay_ms$VH.set(seg, x);
|
||||
}
|
||||
public static short decay_delay_ms$get(MemorySegment seg, long index) {
|
||||
return (short)sdrplay_api_AgcT.decay_delay_ms$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void decay_delay_ms$set(MemorySegment seg, long index, short x) {
|
||||
sdrplay_api_AgcT.decay_delay_ms$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle decay_threshold_dB$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("decay_threshold_dB"));
|
||||
public static VarHandle decay_threshold_dB$VH() {
|
||||
return sdrplay_api_AgcT.decay_threshold_dB$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned short decay_threshold_dB;
|
||||
* }
|
||||
*/
|
||||
public static short decay_threshold_dB$get(MemorySegment seg) {
|
||||
return (short)sdrplay_api_AgcT.decay_threshold_dB$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned short decay_threshold_dB;
|
||||
* }
|
||||
*/
|
||||
public static void decay_threshold_dB$set(MemorySegment seg, short x) {
|
||||
sdrplay_api_AgcT.decay_threshold_dB$VH.set(seg, x);
|
||||
}
|
||||
public static short decay_threshold_dB$get(MemorySegment seg, long index) {
|
||||
return (short)sdrplay_api_AgcT.decay_threshold_dB$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void decay_threshold_dB$set(MemorySegment seg, long index, short x) {
|
||||
sdrplay_api_AgcT.decay_threshold_dB$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle syncUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("syncUpdate"));
|
||||
public static VarHandle syncUpdate$VH() {
|
||||
return sdrplay_api_AgcT.syncUpdate$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* int syncUpdate;
|
||||
* }
|
||||
*/
|
||||
public static int syncUpdate$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_AgcT.syncUpdate$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* int syncUpdate;
|
||||
* }
|
||||
*/
|
||||
public static void syncUpdate$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_AgcT.syncUpdate$VH.set(seg, x);
|
||||
}
|
||||
public static int syncUpdate$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_AgcT.syncUpdate$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void syncUpdate$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_AgcT.syncUpdate$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_ApiVersion_t)(float* apiVer);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_ApiVersion_t {
|
||||
|
||||
int apply(java.lang.foreign.MemorySegment dev);
|
||||
static MemorySegment allocate(sdrplay_api_ApiVersion_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$1.sdrplay_api_ApiVersion_t_UP$MH, fi, constants$1.sdrplay_api_ApiVersion_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_ApiVersion_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (java.lang.foreign.MemorySegment _dev) -> {
|
||||
try {
|
||||
return (int)constants$1.sdrplay_api_ApiVersion_t_DOWN$MH.invokeExact(symbol, _dev);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* sdrplay_api_StreamCallback_t StreamACbFn;
|
||||
* sdrplay_api_StreamCallback_t StreamBCbFn;
|
||||
* sdrplay_api_EventCallback_t EventCbFn;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_CallbackFnsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_POINTER$LAYOUT.withName("StreamACbFn"),
|
||||
Constants$root.C_POINTER$LAYOUT.withName("StreamBCbFn"),
|
||||
Constants$root.C_POINTER$LAYOUT.withName("EventCbFn")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_CallbackFnsT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle StreamACbFn$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("StreamACbFn"));
|
||||
public static VarHandle StreamACbFn$VH() {
|
||||
return sdrplay_api_CallbackFnsT.StreamACbFn$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_StreamCallback_t StreamACbFn;
|
||||
* }
|
||||
*/
|
||||
public static MemorySegment StreamACbFn$get(MemorySegment seg) {
|
||||
return (java.lang.foreign.MemorySegment)sdrplay_api_CallbackFnsT.StreamACbFn$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_StreamCallback_t StreamACbFn;
|
||||
* }
|
||||
*/
|
||||
public static void StreamACbFn$set(MemorySegment seg, MemorySegment x) {
|
||||
sdrplay_api_CallbackFnsT.StreamACbFn$VH.set(seg, x);
|
||||
}
|
||||
public static MemorySegment StreamACbFn$get(MemorySegment seg, long index) {
|
||||
return (java.lang.foreign.MemorySegment)sdrplay_api_CallbackFnsT.StreamACbFn$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void StreamACbFn$set(MemorySegment seg, long index, MemorySegment x) {
|
||||
sdrplay_api_CallbackFnsT.StreamACbFn$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static sdrplay_api_StreamCallback_t StreamACbFn(MemorySegment segment, SegmentScope scope) {
|
||||
return sdrplay_api_StreamCallback_t.ofAddress(StreamACbFn$get(segment), scope);
|
||||
}
|
||||
static final VarHandle StreamBCbFn$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("StreamBCbFn"));
|
||||
public static VarHandle StreamBCbFn$VH() {
|
||||
return sdrplay_api_CallbackFnsT.StreamBCbFn$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_StreamCallback_t StreamBCbFn;
|
||||
* }
|
||||
*/
|
||||
public static MemorySegment StreamBCbFn$get(MemorySegment seg) {
|
||||
return (java.lang.foreign.MemorySegment)sdrplay_api_CallbackFnsT.StreamBCbFn$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_StreamCallback_t StreamBCbFn;
|
||||
* }
|
||||
*/
|
||||
public static void StreamBCbFn$set(MemorySegment seg, MemorySegment x) {
|
||||
sdrplay_api_CallbackFnsT.StreamBCbFn$VH.set(seg, x);
|
||||
}
|
||||
public static MemorySegment StreamBCbFn$get(MemorySegment seg, long index) {
|
||||
return (java.lang.foreign.MemorySegment)sdrplay_api_CallbackFnsT.StreamBCbFn$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void StreamBCbFn$set(MemorySegment seg, long index, MemorySegment x) {
|
||||
sdrplay_api_CallbackFnsT.StreamBCbFn$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static sdrplay_api_StreamCallback_t StreamBCbFn(MemorySegment segment, SegmentScope scope) {
|
||||
return sdrplay_api_StreamCallback_t.ofAddress(StreamBCbFn$get(segment), scope);
|
||||
}
|
||||
static final VarHandle EventCbFn$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("EventCbFn"));
|
||||
public static VarHandle EventCbFn$VH() {
|
||||
return sdrplay_api_CallbackFnsT.EventCbFn$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_EventCallback_t EventCbFn;
|
||||
* }
|
||||
*/
|
||||
public static MemorySegment EventCbFn$get(MemorySegment seg) {
|
||||
return (java.lang.foreign.MemorySegment)sdrplay_api_CallbackFnsT.EventCbFn$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_EventCallback_t EventCbFn;
|
||||
* }
|
||||
*/
|
||||
public static void EventCbFn$set(MemorySegment seg, MemorySegment x) {
|
||||
sdrplay_api_CallbackFnsT.EventCbFn$VH.set(seg, x);
|
||||
}
|
||||
public static MemorySegment EventCbFn$get(MemorySegment seg, long index) {
|
||||
return (java.lang.foreign.MemorySegment)sdrplay_api_CallbackFnsT.EventCbFn$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void EventCbFn$set(MemorySegment seg, long index, MemorySegment x) {
|
||||
sdrplay_api_CallbackFnsT.EventCbFn$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static sdrplay_api_EventCallback_t EventCbFn(MemorySegment segment, SegmentScope scope) {
|
||||
return sdrplay_api_EventCallback_t.ofAddress(EventCbFn$get(segment), scope);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_Close_t)();
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_Close_t {
|
||||
|
||||
int apply();
|
||||
static MemorySegment allocate(sdrplay_api_Close_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$1.sdrplay_api_Close_t_UP$MH, fi, constants$1.sdrplay_api_Close_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_Close_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return () -> {
|
||||
try {
|
||||
return (int)constants$1.sdrplay_api_Close_t_DOWN$MH.invokeExact(symbol);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* sdrplay_api_DcOffsetT dcOffset;
|
||||
* sdrplay_api_DecimationT decimation;
|
||||
* sdrplay_api_AgcT agc;
|
||||
* sdrplay_api_AdsbModeT adsbMode;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_ControlParamsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("DCenable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("IQenable")
|
||||
).withName("dcOffset"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("enable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("decimationFactor"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("wideBandSignal")
|
||||
).withName("decimation"),
|
||||
MemoryLayout.paddingLayout(24),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("enable"),
|
||||
Constants$root.C_INT$LAYOUT.withName("setPoint_dBfs"),
|
||||
Constants$root.C_SHORT$LAYOUT.withName("attack_ms"),
|
||||
Constants$root.C_SHORT$LAYOUT.withName("decay_ms"),
|
||||
Constants$root.C_SHORT$LAYOUT.withName("decay_delay_ms"),
|
||||
Constants$root.C_SHORT$LAYOUT.withName("decay_threshold_dB"),
|
||||
Constants$root.C_INT$LAYOUT.withName("syncUpdate")
|
||||
).withName("agc"),
|
||||
Constants$root.C_INT$LAYOUT.withName("adsbMode")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_ControlParamsT.$struct$LAYOUT;
|
||||
}
|
||||
public static MemorySegment dcOffset$slice(MemorySegment seg) {
|
||||
return seg.asSlice(0, 2);
|
||||
}
|
||||
public static MemorySegment decimation$slice(MemorySegment seg) {
|
||||
return seg.asSlice(2, 3);
|
||||
}
|
||||
public static MemorySegment agc$slice(MemorySegment seg) {
|
||||
return seg.asSlice(8, 20);
|
||||
}
|
||||
static final VarHandle adsbMode$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("adsbMode"));
|
||||
public static VarHandle adsbMode$VH() {
|
||||
return sdrplay_api_ControlParamsT.adsbMode$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_AdsbModeT adsbMode;
|
||||
* }
|
||||
*/
|
||||
public static int adsbMode$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_ControlParamsT.adsbMode$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_AdsbModeT adsbMode;
|
||||
* }
|
||||
*/
|
||||
public static void adsbMode$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_ControlParamsT.adsbMode$VH.set(seg, x);
|
||||
}
|
||||
public static int adsbMode$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_ControlParamsT.adsbMode$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void adsbMode$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_ControlParamsT.adsbMode$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* unsigned char DCenable;
|
||||
* unsigned char IQenable;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_DcOffsetT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("DCenable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("IQenable")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_DcOffsetT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle DCenable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("DCenable"));
|
||||
public static VarHandle DCenable$VH() {
|
||||
return sdrplay_api_DcOffsetT.DCenable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char DCenable;
|
||||
* }
|
||||
*/
|
||||
public static byte DCenable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_DcOffsetT.DCenable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char DCenable;
|
||||
* }
|
||||
*/
|
||||
public static void DCenable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_DcOffsetT.DCenable$VH.set(seg, x);
|
||||
}
|
||||
public static byte DCenable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_DcOffsetT.DCenable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void DCenable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_DcOffsetT.DCenable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle IQenable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("IQenable"));
|
||||
public static VarHandle IQenable$VH() {
|
||||
return sdrplay_api_DcOffsetT.IQenable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char IQenable;
|
||||
* }
|
||||
*/
|
||||
public static byte IQenable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_DcOffsetT.IQenable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char IQenable;
|
||||
* }
|
||||
*/
|
||||
public static void IQenable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_DcOffsetT.IQenable$VH.set(seg, x);
|
||||
}
|
||||
public static byte IQenable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_DcOffsetT.IQenable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void IQenable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_DcOffsetT.IQenable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* unsigned char dcCal;
|
||||
* unsigned char speedUp;
|
||||
* int trackTime;
|
||||
* int refreshRateTime;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_DcOffsetTunerT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("dcCal"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("speedUp"),
|
||||
MemoryLayout.paddingLayout(16),
|
||||
Constants$root.C_INT$LAYOUT.withName("trackTime"),
|
||||
Constants$root.C_INT$LAYOUT.withName("refreshRateTime")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_DcOffsetTunerT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle dcCal$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("dcCal"));
|
||||
public static VarHandle dcCal$VH() {
|
||||
return sdrplay_api_DcOffsetTunerT.dcCal$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char dcCal;
|
||||
* }
|
||||
*/
|
||||
public static byte dcCal$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_DcOffsetTunerT.dcCal$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char dcCal;
|
||||
* }
|
||||
*/
|
||||
public static void dcCal$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_DcOffsetTunerT.dcCal$VH.set(seg, x);
|
||||
}
|
||||
public static byte dcCal$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_DcOffsetTunerT.dcCal$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void dcCal$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_DcOffsetTunerT.dcCal$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle speedUp$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("speedUp"));
|
||||
public static VarHandle speedUp$VH() {
|
||||
return sdrplay_api_DcOffsetTunerT.speedUp$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char speedUp;
|
||||
* }
|
||||
*/
|
||||
public static byte speedUp$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_DcOffsetTunerT.speedUp$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char speedUp;
|
||||
* }
|
||||
*/
|
||||
public static void speedUp$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_DcOffsetTunerT.speedUp$VH.set(seg, x);
|
||||
}
|
||||
public static byte speedUp$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_DcOffsetTunerT.speedUp$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void speedUp$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_DcOffsetTunerT.speedUp$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle trackTime$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("trackTime"));
|
||||
public static VarHandle trackTime$VH() {
|
||||
return sdrplay_api_DcOffsetTunerT.trackTime$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* int trackTime;
|
||||
* }
|
||||
*/
|
||||
public static int trackTime$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_DcOffsetTunerT.trackTime$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* int trackTime;
|
||||
* }
|
||||
*/
|
||||
public static void trackTime$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_DcOffsetTunerT.trackTime$VH.set(seg, x);
|
||||
}
|
||||
public static int trackTime$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_DcOffsetTunerT.trackTime$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void trackTime$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_DcOffsetTunerT.trackTime$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle refreshRateTime$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("refreshRateTime"));
|
||||
public static VarHandle refreshRateTime$VH() {
|
||||
return sdrplay_api_DcOffsetTunerT.refreshRateTime$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* int refreshRateTime;
|
||||
* }
|
||||
*/
|
||||
public static int refreshRateTime$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_DcOffsetTunerT.refreshRateTime$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* int refreshRateTime;
|
||||
* }
|
||||
*/
|
||||
public static void refreshRateTime$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_DcOffsetTunerT.refreshRateTime$VH.set(seg, x);
|
||||
}
|
||||
public static int refreshRateTime$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_DcOffsetTunerT.refreshRateTime$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void refreshRateTime$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_DcOffsetTunerT.refreshRateTime$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_DebugEnable_t)(void* dev,enum dbgLvl);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_DebugEnable_t {
|
||||
|
||||
int apply(java.lang.foreign.MemorySegment dev, int dbgLvl);
|
||||
static MemorySegment allocate(sdrplay_api_DebugEnable_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$4.sdrplay_api_DebugEnable_t_UP$MH, fi, constants$4.sdrplay_api_DebugEnable_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_DebugEnable_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (java.lang.foreign.MemorySegment _dev, int _dbgLvl) -> {
|
||||
try {
|
||||
return (int)constants$4.sdrplay_api_DebugEnable_t_DOWN$MH.invokeExact(symbol, _dev, _dbgLvl);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* unsigned char enable;
|
||||
* unsigned char decimationFactor;
|
||||
* unsigned char wideBandSignal;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_DecimationT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("enable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("decimationFactor"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("wideBandSignal")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_DecimationT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle enable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("enable"));
|
||||
public static VarHandle enable$VH() {
|
||||
return sdrplay_api_DecimationT.enable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char enable;
|
||||
* }
|
||||
*/
|
||||
public static byte enable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_DecimationT.enable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char enable;
|
||||
* }
|
||||
*/
|
||||
public static void enable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_DecimationT.enable$VH.set(seg, x);
|
||||
}
|
||||
public static byte enable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_DecimationT.enable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void enable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_DecimationT.enable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle decimationFactor$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("decimationFactor"));
|
||||
public static VarHandle decimationFactor$VH() {
|
||||
return sdrplay_api_DecimationT.decimationFactor$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char decimationFactor;
|
||||
* }
|
||||
*/
|
||||
public static byte decimationFactor$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_DecimationT.decimationFactor$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char decimationFactor;
|
||||
* }
|
||||
*/
|
||||
public static void decimationFactor$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_DecimationT.decimationFactor$VH.set(seg, x);
|
||||
}
|
||||
public static byte decimationFactor$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_DecimationT.decimationFactor$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void decimationFactor$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_DecimationT.decimationFactor$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle wideBandSignal$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("wideBandSignal"));
|
||||
public static VarHandle wideBandSignal$VH() {
|
||||
return sdrplay_api_DecimationT.wideBandSignal$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char wideBandSignal;
|
||||
* }
|
||||
*/
|
||||
public static byte wideBandSignal$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_DecimationT.wideBandSignal$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char wideBandSignal;
|
||||
* }
|
||||
*/
|
||||
public static void wideBandSignal$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_DecimationT.wideBandSignal$VH.set(seg, x);
|
||||
}
|
||||
public static byte wideBandSignal$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_DecimationT.wideBandSignal$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void wideBandSignal$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_DecimationT.wideBandSignal$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* double ppm;
|
||||
* sdrplay_api_FsFreqT fsFreq;
|
||||
* sdrplay_api_SyncUpdateT syncUpdate;
|
||||
* sdrplay_api_ResetFlagsT resetFlags;
|
||||
* sdrplay_api_TransferModeT mode;
|
||||
* unsigned int samplesPerPkt;
|
||||
* sdrplay_api_Rsp1aParamsT rsp1aParams;
|
||||
* sdrplay_api_Rsp2ParamsT rsp2Params;
|
||||
* sdrplay_api_RspDuoParamsT rspDuoParams;
|
||||
* sdrplay_api_RspDxParamsT rspDxParams;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_DevParamsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_DOUBLE$LAYOUT.withName("ppm"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_DOUBLE$LAYOUT.withName("fsHz"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("reCal"),
|
||||
MemoryLayout.paddingLayout(48)
|
||||
).withName("fsFreq"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("sampleNum"),
|
||||
Constants$root.C_INT$LAYOUT.withName("period")
|
||||
).withName("syncUpdate"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("resetGainUpdate"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("resetRfUpdate"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("resetFsUpdate")
|
||||
).withName("resetFlags"),
|
||||
MemoryLayout.paddingLayout(8),
|
||||
Constants$root.C_INT$LAYOUT.withName("mode"),
|
||||
Constants$root.C_INT$LAYOUT.withName("samplesPerPkt"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable")
|
||||
).withName("rsp1aParams"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("extRefOutputEn")
|
||||
).withName("rsp2Params"),
|
||||
MemoryLayout.paddingLayout(8),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("extRefOutputEn")
|
||||
).withName("rspDuoParams"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("hdrEnable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
||||
MemoryLayout.paddingLayout(16),
|
||||
Constants$root.C_INT$LAYOUT.withName("antennaSel"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"),
|
||||
MemoryLayout.paddingLayout(16)
|
||||
).withName("rspDxParams")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_DevParamsT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle ppm$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ppm"));
|
||||
public static VarHandle ppm$VH() {
|
||||
return sdrplay_api_DevParamsT.ppm$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* double ppm;
|
||||
* }
|
||||
*/
|
||||
public static double ppm$get(MemorySegment seg) {
|
||||
return (double)sdrplay_api_DevParamsT.ppm$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* double ppm;
|
||||
* }
|
||||
*/
|
||||
public static void ppm$set(MemorySegment seg, double x) {
|
||||
sdrplay_api_DevParamsT.ppm$VH.set(seg, x);
|
||||
}
|
||||
public static double ppm$get(MemorySegment seg, long index) {
|
||||
return (double)sdrplay_api_DevParamsT.ppm$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void ppm$set(MemorySegment seg, long index, double x) {
|
||||
sdrplay_api_DevParamsT.ppm$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static MemorySegment fsFreq$slice(MemorySegment seg) {
|
||||
return seg.asSlice(8, 16);
|
||||
}
|
||||
public static MemorySegment syncUpdate$slice(MemorySegment seg) {
|
||||
return seg.asSlice(24, 8);
|
||||
}
|
||||
public static MemorySegment resetFlags$slice(MemorySegment seg) {
|
||||
return seg.asSlice(32, 3);
|
||||
}
|
||||
static final VarHandle mode$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("mode"));
|
||||
public static VarHandle mode$VH() {
|
||||
return sdrplay_api_DevParamsT.mode$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_TransferModeT mode;
|
||||
* }
|
||||
*/
|
||||
public static int mode$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_DevParamsT.mode$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_TransferModeT mode;
|
||||
* }
|
||||
*/
|
||||
public static void mode$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_DevParamsT.mode$VH.set(seg, x);
|
||||
}
|
||||
public static int mode$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_DevParamsT.mode$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void mode$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_DevParamsT.mode$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle samplesPerPkt$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("samplesPerPkt"));
|
||||
public static VarHandle samplesPerPkt$VH() {
|
||||
return sdrplay_api_DevParamsT.samplesPerPkt$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned int samplesPerPkt;
|
||||
* }
|
||||
*/
|
||||
public static int samplesPerPkt$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_DevParamsT.samplesPerPkt$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned int samplesPerPkt;
|
||||
* }
|
||||
*/
|
||||
public static void samplesPerPkt$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_DevParamsT.samplesPerPkt$VH.set(seg, x);
|
||||
}
|
||||
public static int samplesPerPkt$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_DevParamsT.samplesPerPkt$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void samplesPerPkt$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_DevParamsT.samplesPerPkt$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static MemorySegment rsp1aParams$slice(MemorySegment seg) {
|
||||
return seg.asSlice(44, 2);
|
||||
}
|
||||
public static MemorySegment rsp2Params$slice(MemorySegment seg) {
|
||||
return seg.asSlice(46, 1);
|
||||
}
|
||||
public static MemorySegment rspDuoParams$slice(MemorySegment seg) {
|
||||
return seg.asSlice(48, 4);
|
||||
}
|
||||
public static MemorySegment rspDxParams$slice(MemorySegment seg) {
|
||||
return seg.asSlice(52, 12);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* sdrplay_api_DevParamsT* devParams;
|
||||
* sdrplay_api_RxChannelParamsT* rxChannelA;
|
||||
* sdrplay_api_RxChannelParamsT* rxChannelB;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_DeviceParamsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_POINTER$LAYOUT.withName("devParams"),
|
||||
Constants$root.C_POINTER$LAYOUT.withName("rxChannelA"),
|
||||
Constants$root.C_POINTER$LAYOUT.withName("rxChannelB")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_DeviceParamsT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle devParams$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("devParams"));
|
||||
public static VarHandle devParams$VH() {
|
||||
return sdrplay_api_DeviceParamsT.devParams$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_DevParamsT* devParams;
|
||||
* }
|
||||
*/
|
||||
public static MemorySegment devParams$get(MemorySegment seg) {
|
||||
return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceParamsT.devParams$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_DevParamsT* devParams;
|
||||
* }
|
||||
*/
|
||||
public static void devParams$set(MemorySegment seg, MemorySegment x) {
|
||||
sdrplay_api_DeviceParamsT.devParams$VH.set(seg, x);
|
||||
}
|
||||
public static MemorySegment devParams$get(MemorySegment seg, long index) {
|
||||
return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceParamsT.devParams$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void devParams$set(MemorySegment seg, long index, MemorySegment x) {
|
||||
sdrplay_api_DeviceParamsT.devParams$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle rxChannelA$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rxChannelA"));
|
||||
public static VarHandle rxChannelA$VH() {
|
||||
return sdrplay_api_DeviceParamsT.rxChannelA$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_RxChannelParamsT* rxChannelA;
|
||||
* }
|
||||
*/
|
||||
public static MemorySegment rxChannelA$get(MemorySegment seg) {
|
||||
return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceParamsT.rxChannelA$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_RxChannelParamsT* rxChannelA;
|
||||
* }
|
||||
*/
|
||||
public static void rxChannelA$set(MemorySegment seg, MemorySegment x) {
|
||||
sdrplay_api_DeviceParamsT.rxChannelA$VH.set(seg, x);
|
||||
}
|
||||
public static MemorySegment rxChannelA$get(MemorySegment seg, long index) {
|
||||
return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceParamsT.rxChannelA$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void rxChannelA$set(MemorySegment seg, long index, MemorySegment x) {
|
||||
sdrplay_api_DeviceParamsT.rxChannelA$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle rxChannelB$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rxChannelB"));
|
||||
public static VarHandle rxChannelB$VH() {
|
||||
return sdrplay_api_DeviceParamsT.rxChannelB$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_RxChannelParamsT* rxChannelB;
|
||||
* }
|
||||
*/
|
||||
public static MemorySegment rxChannelB$get(MemorySegment seg) {
|
||||
return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceParamsT.rxChannelB$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_RxChannelParamsT* rxChannelB;
|
||||
* }
|
||||
*/
|
||||
public static void rxChannelB$set(MemorySegment seg, MemorySegment x) {
|
||||
sdrplay_api_DeviceParamsT.rxChannelB$VH.set(seg, x);
|
||||
}
|
||||
public static MemorySegment rxChannelB$get(MemorySegment seg, long index) {
|
||||
return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceParamsT.rxChannelB$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void rxChannelB$set(MemorySegment seg, long index, MemorySegment x) {
|
||||
sdrplay_api_DeviceParamsT.rxChannelB$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,238 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* char SerNo[64];
|
||||
* unsigned char hwVer;
|
||||
* sdrplay_api_TunerSelectT tuner;
|
||||
* sdrplay_api_RspDuoModeT rspDuoMode;
|
||||
* unsigned char valid;
|
||||
* double rspDuoSampleFreq;
|
||||
* HANDLE dev;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_DeviceT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
MemoryLayout.sequenceLayout(64, Constants$root.C_CHAR$LAYOUT).withName("SerNo"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("hwVer"),
|
||||
MemoryLayout.paddingLayout(24),
|
||||
Constants$root.C_INT$LAYOUT.withName("tuner"),
|
||||
Constants$root.C_INT$LAYOUT.withName("rspDuoMode"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("valid"),
|
||||
MemoryLayout.paddingLayout(24),
|
||||
Constants$root.C_DOUBLE$LAYOUT.withName("rspDuoSampleFreq"),
|
||||
Constants$root.C_POINTER$LAYOUT.withName("dev")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_DeviceT.$struct$LAYOUT;
|
||||
}
|
||||
public static MemorySegment SerNo$slice(MemorySegment seg) {
|
||||
return seg.asSlice(0, 64);
|
||||
}
|
||||
static final VarHandle hwVer$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("hwVer"));
|
||||
public static VarHandle hwVer$VH() {
|
||||
return sdrplay_api_DeviceT.hwVer$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char hwVer;
|
||||
* }
|
||||
*/
|
||||
public static byte hwVer$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_DeviceT.hwVer$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char hwVer;
|
||||
* }
|
||||
*/
|
||||
public static void hwVer$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_DeviceT.hwVer$VH.set(seg, x);
|
||||
}
|
||||
public static byte hwVer$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_DeviceT.hwVer$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void hwVer$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_DeviceT.hwVer$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle tuner$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("tuner"));
|
||||
public static VarHandle tuner$VH() {
|
||||
return sdrplay_api_DeviceT.tuner$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_TunerSelectT tuner;
|
||||
* }
|
||||
*/
|
||||
public static int tuner$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_DeviceT.tuner$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_TunerSelectT tuner;
|
||||
* }
|
||||
*/
|
||||
public static void tuner$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_DeviceT.tuner$VH.set(seg, x);
|
||||
}
|
||||
public static int tuner$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_DeviceT.tuner$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void tuner$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_DeviceT.tuner$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle rspDuoMode$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rspDuoMode"));
|
||||
public static VarHandle rspDuoMode$VH() {
|
||||
return sdrplay_api_DeviceT.rspDuoMode$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_RspDuoModeT rspDuoMode;
|
||||
* }
|
||||
*/
|
||||
public static int rspDuoMode$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_DeviceT.rspDuoMode$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_RspDuoModeT rspDuoMode;
|
||||
* }
|
||||
*/
|
||||
public static void rspDuoMode$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_DeviceT.rspDuoMode$VH.set(seg, x);
|
||||
}
|
||||
public static int rspDuoMode$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_DeviceT.rspDuoMode$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void rspDuoMode$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_DeviceT.rspDuoMode$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle valid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("valid"));
|
||||
public static VarHandle valid$VH() {
|
||||
return sdrplay_api_DeviceT.valid$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char valid;
|
||||
* }
|
||||
*/
|
||||
public static byte valid$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_DeviceT.valid$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char valid;
|
||||
* }
|
||||
*/
|
||||
public static void valid$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_DeviceT.valid$VH.set(seg, x);
|
||||
}
|
||||
public static byte valid$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_DeviceT.valid$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void valid$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_DeviceT.valid$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle rspDuoSampleFreq$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rspDuoSampleFreq"));
|
||||
public static VarHandle rspDuoSampleFreq$VH() {
|
||||
return sdrplay_api_DeviceT.rspDuoSampleFreq$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* double rspDuoSampleFreq;
|
||||
* }
|
||||
*/
|
||||
public static double rspDuoSampleFreq$get(MemorySegment seg) {
|
||||
return (double)sdrplay_api_DeviceT.rspDuoSampleFreq$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* double rspDuoSampleFreq;
|
||||
* }
|
||||
*/
|
||||
public static void rspDuoSampleFreq$set(MemorySegment seg, double x) {
|
||||
sdrplay_api_DeviceT.rspDuoSampleFreq$VH.set(seg, x);
|
||||
}
|
||||
public static double rspDuoSampleFreq$get(MemorySegment seg, long index) {
|
||||
return (double)sdrplay_api_DeviceT.rspDuoSampleFreq$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void rspDuoSampleFreq$set(MemorySegment seg, long index, double x) {
|
||||
sdrplay_api_DeviceT.rspDuoSampleFreq$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle dev$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("dev"));
|
||||
public static VarHandle dev$VH() {
|
||||
return sdrplay_api_DeviceT.dev$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* HANDLE dev;
|
||||
* }
|
||||
*/
|
||||
public static MemorySegment dev$get(MemorySegment seg) {
|
||||
return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceT.dev$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* HANDLE dev;
|
||||
* }
|
||||
*/
|
||||
public static void dev$set(MemorySegment seg, MemorySegment x) {
|
||||
sdrplay_api_DeviceT.dev$VH.set(seg, x);
|
||||
}
|
||||
public static MemorySegment dev$get(MemorySegment seg, long index) {
|
||||
return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceT.dev$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void dev$set(MemorySegment seg, long index, MemorySegment x) {
|
||||
sdrplay_api_DeviceT.dev$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_DisableHeartbeat_t)();
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_DisableHeartbeat_t {
|
||||
|
||||
int apply();
|
||||
static MemorySegment allocate(sdrplay_api_DisableHeartbeat_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$4.sdrplay_api_DisableHeartbeat_t_UP$MH, fi, constants$4.sdrplay_api_DisableHeartbeat_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_DisableHeartbeat_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return () -> {
|
||||
try {
|
||||
return (int)constants$4.sdrplay_api_DisableHeartbeat_t_DOWN$MH.invokeExact(symbol);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* char file[256];
|
||||
* char function[256];
|
||||
* int line;
|
||||
* char message[1024];
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_ErrorInfoT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
MemoryLayout.sequenceLayout(256, Constants$root.C_CHAR$LAYOUT).withName("file"),
|
||||
MemoryLayout.sequenceLayout(256, Constants$root.C_CHAR$LAYOUT).withName("function"),
|
||||
Constants$root.C_INT$LAYOUT.withName("line"),
|
||||
MemoryLayout.sequenceLayout(1024, Constants$root.C_CHAR$LAYOUT).withName("message")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_ErrorInfoT.$struct$LAYOUT;
|
||||
}
|
||||
public static MemorySegment file$slice(MemorySegment seg) {
|
||||
return seg.asSlice(0, 256);
|
||||
}
|
||||
public static MemorySegment function$slice(MemorySegment seg) {
|
||||
return seg.asSlice(256, 256);
|
||||
}
|
||||
static final VarHandle line$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("line"));
|
||||
public static VarHandle line$VH() {
|
||||
return sdrplay_api_ErrorInfoT.line$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* int line;
|
||||
* }
|
||||
*/
|
||||
public static int line$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_ErrorInfoT.line$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* int line;
|
||||
* }
|
||||
*/
|
||||
public static void line$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_ErrorInfoT.line$VH.set(seg, x);
|
||||
}
|
||||
public static int line$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_ErrorInfoT.line$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void line$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_ErrorInfoT.line$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static MemorySegment message$slice(MemorySegment seg) {
|
||||
return seg.asSlice(516, 1024);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* void (*sdrplay_api_EventCallback_t)(enum eventId,enum tuner,union * params,void* cbContext);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_EventCallback_t {
|
||||
|
||||
void apply(int eventId, int tuner, java.lang.foreign.MemorySegment params, java.lang.foreign.MemorySegment cbContext);
|
||||
static MemorySegment allocate(sdrplay_api_EventCallback_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$0.sdrplay_api_EventCallback_t_UP$MH, fi, constants$0.sdrplay_api_EventCallback_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_EventCallback_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (int _eventId, int _tuner, java.lang.foreign.MemorySegment _params, java.lang.foreign.MemorySegment _cbContext) -> {
|
||||
try {
|
||||
constants$0.sdrplay_api_EventCallback_t_DOWN$MH.invokeExact(symbol, _eventId, _tuner, _params, _cbContext);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.UnionLayout;
|
||||
/**
|
||||
* {@snippet :
|
||||
* union {
|
||||
* sdrplay_api_GainCbParamT gainParams;
|
||||
* sdrplay_api_PowerOverloadCbParamT powerOverloadParams;
|
||||
* sdrplay_api_RspDuoModeCbParamT rspDuoModeParams;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_EventParamsT {
|
||||
|
||||
static final UnionLayout $union$LAYOUT = MemoryLayout.unionLayout(
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("gRdB"),
|
||||
Constants$root.C_INT$LAYOUT.withName("lnaGRdB"),
|
||||
Constants$root.C_DOUBLE$LAYOUT.withName("currGain")
|
||||
).withName("gainParams"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("powerOverloadChangeType")
|
||||
).withName("powerOverloadParams"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("modeChangeType")
|
||||
).withName("rspDuoModeParams")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_EventParamsT.$union$LAYOUT;
|
||||
}
|
||||
public static MemorySegment gainParams$slice(MemorySegment seg) {
|
||||
return seg.asSlice(0, 16);
|
||||
}
|
||||
public static MemorySegment powerOverloadParams$slice(MemorySegment seg) {
|
||||
return seg.asSlice(0, 4);
|
||||
}
|
||||
public static MemorySegment rspDuoModeParams$slice(MemorySegment seg) {
|
||||
return seg.asSlice(0, 4);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* double fsHz;
|
||||
* unsigned char syncUpdate;
|
||||
* unsigned char reCal;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_FsFreqT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_DOUBLE$LAYOUT.withName("fsHz"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("reCal"),
|
||||
MemoryLayout.paddingLayout(48)
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_FsFreqT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle fsHz$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fsHz"));
|
||||
public static VarHandle fsHz$VH() {
|
||||
return sdrplay_api_FsFreqT.fsHz$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* double fsHz;
|
||||
* }
|
||||
*/
|
||||
public static double fsHz$get(MemorySegment seg) {
|
||||
return (double)sdrplay_api_FsFreqT.fsHz$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* double fsHz;
|
||||
* }
|
||||
*/
|
||||
public static void fsHz$set(MemorySegment seg, double x) {
|
||||
sdrplay_api_FsFreqT.fsHz$VH.set(seg, x);
|
||||
}
|
||||
public static double fsHz$get(MemorySegment seg, long index) {
|
||||
return (double)sdrplay_api_FsFreqT.fsHz$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void fsHz$set(MemorySegment seg, long index, double x) {
|
||||
sdrplay_api_FsFreqT.fsHz$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle syncUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("syncUpdate"));
|
||||
public static VarHandle syncUpdate$VH() {
|
||||
return sdrplay_api_FsFreqT.syncUpdate$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char syncUpdate;
|
||||
* }
|
||||
*/
|
||||
public static byte syncUpdate$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_FsFreqT.syncUpdate$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char syncUpdate;
|
||||
* }
|
||||
*/
|
||||
public static void syncUpdate$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_FsFreqT.syncUpdate$VH.set(seg, x);
|
||||
}
|
||||
public static byte syncUpdate$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_FsFreqT.syncUpdate$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void syncUpdate$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_FsFreqT.syncUpdate$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle reCal$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("reCal"));
|
||||
public static VarHandle reCal$VH() {
|
||||
return sdrplay_api_FsFreqT.reCal$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char reCal;
|
||||
* }
|
||||
*/
|
||||
public static byte reCal$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_FsFreqT.reCal$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char reCal;
|
||||
* }
|
||||
*/
|
||||
public static void reCal$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_FsFreqT.reCal$VH.set(seg, x);
|
||||
}
|
||||
public static byte reCal$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_FsFreqT.reCal$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void reCal$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_FsFreqT.reCal$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* unsigned int gRdB;
|
||||
* unsigned int lnaGRdB;
|
||||
* double currGain;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_GainCbParamT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("gRdB"),
|
||||
Constants$root.C_INT$LAYOUT.withName("lnaGRdB"),
|
||||
Constants$root.C_DOUBLE$LAYOUT.withName("currGain")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_GainCbParamT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle gRdB$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("gRdB"));
|
||||
public static VarHandle gRdB$VH() {
|
||||
return sdrplay_api_GainCbParamT.gRdB$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned int gRdB;
|
||||
* }
|
||||
*/
|
||||
public static int gRdB$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_GainCbParamT.gRdB$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned int gRdB;
|
||||
* }
|
||||
*/
|
||||
public static void gRdB$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_GainCbParamT.gRdB$VH.set(seg, x);
|
||||
}
|
||||
public static int gRdB$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_GainCbParamT.gRdB$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void gRdB$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_GainCbParamT.gRdB$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle lnaGRdB$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("lnaGRdB"));
|
||||
public static VarHandle lnaGRdB$VH() {
|
||||
return sdrplay_api_GainCbParamT.lnaGRdB$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned int lnaGRdB;
|
||||
* }
|
||||
*/
|
||||
public static int lnaGRdB$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_GainCbParamT.lnaGRdB$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned int lnaGRdB;
|
||||
* }
|
||||
*/
|
||||
public static void lnaGRdB$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_GainCbParamT.lnaGRdB$VH.set(seg, x);
|
||||
}
|
||||
public static int lnaGRdB$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_GainCbParamT.lnaGRdB$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void lnaGRdB$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_GainCbParamT.lnaGRdB$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle currGain$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("currGain"));
|
||||
public static VarHandle currGain$VH() {
|
||||
return sdrplay_api_GainCbParamT.currGain$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* double currGain;
|
||||
* }
|
||||
*/
|
||||
public static double currGain$get(MemorySegment seg) {
|
||||
return (double)sdrplay_api_GainCbParamT.currGain$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* double currGain;
|
||||
* }
|
||||
*/
|
||||
public static void currGain$set(MemorySegment seg, double x) {
|
||||
sdrplay_api_GainCbParamT.currGain$VH.set(seg, x);
|
||||
}
|
||||
public static double currGain$get(MemorySegment seg, long index) {
|
||||
return (double)sdrplay_api_GainCbParamT.currGain$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void currGain$set(MemorySegment seg, long index, double x) {
|
||||
sdrplay_api_GainCbParamT.currGain$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* int gRdB;
|
||||
* unsigned char LNAstate;
|
||||
* unsigned char syncUpdate;
|
||||
* sdrplay_api_MinGainReductionT minGr;
|
||||
* sdrplay_api_GainValuesT gainVals;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_GainT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("gRdB"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("LNAstate"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
||||
MemoryLayout.paddingLayout(16),
|
||||
Constants$root.C_INT$LAYOUT.withName("minGr"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_FLOAT$LAYOUT.withName("curr"),
|
||||
Constants$root.C_FLOAT$LAYOUT.withName("max"),
|
||||
Constants$root.C_FLOAT$LAYOUT.withName("min")
|
||||
).withName("gainVals")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_GainT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle gRdB$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("gRdB"));
|
||||
public static VarHandle gRdB$VH() {
|
||||
return sdrplay_api_GainT.gRdB$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* int gRdB;
|
||||
* }
|
||||
*/
|
||||
public static int gRdB$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_GainT.gRdB$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* int gRdB;
|
||||
* }
|
||||
*/
|
||||
public static void gRdB$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_GainT.gRdB$VH.set(seg, x);
|
||||
}
|
||||
public static int gRdB$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_GainT.gRdB$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void gRdB$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_GainT.gRdB$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle LNAstate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("LNAstate"));
|
||||
public static VarHandle LNAstate$VH() {
|
||||
return sdrplay_api_GainT.LNAstate$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char LNAstate;
|
||||
* }
|
||||
*/
|
||||
public static byte LNAstate$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_GainT.LNAstate$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char LNAstate;
|
||||
* }
|
||||
*/
|
||||
public static void LNAstate$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_GainT.LNAstate$VH.set(seg, x);
|
||||
}
|
||||
public static byte LNAstate$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_GainT.LNAstate$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void LNAstate$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_GainT.LNAstate$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle syncUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("syncUpdate"));
|
||||
public static VarHandle syncUpdate$VH() {
|
||||
return sdrplay_api_GainT.syncUpdate$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char syncUpdate;
|
||||
* }
|
||||
*/
|
||||
public static byte syncUpdate$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_GainT.syncUpdate$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char syncUpdate;
|
||||
* }
|
||||
*/
|
||||
public static void syncUpdate$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_GainT.syncUpdate$VH.set(seg, x);
|
||||
}
|
||||
public static byte syncUpdate$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_GainT.syncUpdate$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void syncUpdate$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_GainT.syncUpdate$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle minGr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("minGr"));
|
||||
public static VarHandle minGr$VH() {
|
||||
return sdrplay_api_GainT.minGr$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_MinGainReductionT minGr;
|
||||
* }
|
||||
*/
|
||||
public static int minGr$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_GainT.minGr$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_MinGainReductionT minGr;
|
||||
* }
|
||||
*/
|
||||
public static void minGr$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_GainT.minGr$VH.set(seg, x);
|
||||
}
|
||||
public static int minGr$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_GainT.minGr$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void minGr$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_GainT.minGr$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static MemorySegment gainVals$slice(MemorySegment seg) {
|
||||
return seg.asSlice(12, 12);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* float curr;
|
||||
* float max;
|
||||
* float min;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_GainValuesT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_FLOAT$LAYOUT.withName("curr"),
|
||||
Constants$root.C_FLOAT$LAYOUT.withName("max"),
|
||||
Constants$root.C_FLOAT$LAYOUT.withName("min")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_GainValuesT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle curr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("curr"));
|
||||
public static VarHandle curr$VH() {
|
||||
return sdrplay_api_GainValuesT.curr$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* float curr;
|
||||
* }
|
||||
*/
|
||||
public static float curr$get(MemorySegment seg) {
|
||||
return (float)sdrplay_api_GainValuesT.curr$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* float curr;
|
||||
* }
|
||||
*/
|
||||
public static void curr$set(MemorySegment seg, float x) {
|
||||
sdrplay_api_GainValuesT.curr$VH.set(seg, x);
|
||||
}
|
||||
public static float curr$get(MemorySegment seg, long index) {
|
||||
return (float)sdrplay_api_GainValuesT.curr$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void curr$set(MemorySegment seg, long index, float x) {
|
||||
sdrplay_api_GainValuesT.curr$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle max$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max"));
|
||||
public static VarHandle max$VH() {
|
||||
return sdrplay_api_GainValuesT.max$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* float max;
|
||||
* }
|
||||
*/
|
||||
public static float max$get(MemorySegment seg) {
|
||||
return (float)sdrplay_api_GainValuesT.max$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* float max;
|
||||
* }
|
||||
*/
|
||||
public static void max$set(MemorySegment seg, float x) {
|
||||
sdrplay_api_GainValuesT.max$VH.set(seg, x);
|
||||
}
|
||||
public static float max$get(MemorySegment seg, long index) {
|
||||
return (float)sdrplay_api_GainValuesT.max$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void max$set(MemorySegment seg, long index, float x) {
|
||||
sdrplay_api_GainValuesT.max$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle min$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("min"));
|
||||
public static VarHandle min$VH() {
|
||||
return sdrplay_api_GainValuesT.min$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* float min;
|
||||
* }
|
||||
*/
|
||||
public static float min$get(MemorySegment seg) {
|
||||
return (float)sdrplay_api_GainValuesT.min$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* float min;
|
||||
* }
|
||||
*/
|
||||
public static void min$set(MemorySegment seg, float x) {
|
||||
sdrplay_api_GainValuesT.min$VH.set(seg, x);
|
||||
}
|
||||
public static float min$get(MemorySegment seg, long index) {
|
||||
return (float)sdrplay_api_GainValuesT.min$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void min$set(MemorySegment seg, long index, float x) {
|
||||
sdrplay_api_GainValuesT.min$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_GetDeviceParams_t)(void* dev,struct ** deviceParams);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_GetDeviceParams_t {
|
||||
|
||||
int apply(java.lang.foreign.MemorySegment dev, java.lang.foreign.MemorySegment deviceParams);
|
||||
static MemorySegment allocate(sdrplay_api_GetDeviceParams_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$5.sdrplay_api_GetDeviceParams_t_UP$MH, fi, constants$5.sdrplay_api_GetDeviceParams_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_GetDeviceParams_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (java.lang.foreign.MemorySegment _dev, java.lang.foreign.MemorySegment _deviceParams) -> {
|
||||
try {
|
||||
return (int)constants$5.sdrplay_api_GetDeviceParams_t_DOWN$MH.invokeExact(symbol, _dev, _deviceParams);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_GetDevices_t)(struct * devices,unsigned int* numDevs,unsigned int maxDevs);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_GetDevices_t {
|
||||
|
||||
int apply(java.lang.foreign.MemorySegment devices, java.lang.foreign.MemorySegment numDevs, int maxDevs);
|
||||
static MemorySegment allocate(sdrplay_api_GetDevices_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$2.sdrplay_api_GetDevices_t_UP$MH, fi, constants$2.sdrplay_api_GetDevices_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_GetDevices_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (java.lang.foreign.MemorySegment _devices, java.lang.foreign.MemorySegment _numDevs, int _maxDevs) -> {
|
||||
try {
|
||||
return (int)constants$2.sdrplay_api_GetDevices_t_DOWN$MH.invokeExact(symbol, _devices, _numDevs, _maxDevs);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* char* (*sdrplay_api_GetErrorString_t)(enum err);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_GetErrorString_t {
|
||||
|
||||
java.lang.foreign.MemorySegment apply(int err);
|
||||
static MemorySegment allocate(sdrplay_api_GetErrorString_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$3.sdrplay_api_GetErrorString_t_UP$MH, fi, constants$3.sdrplay_api_GetErrorString_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_GetErrorString_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (int _err) -> {
|
||||
try {
|
||||
return (java.lang.foreign.MemorySegment)constants$3.sdrplay_api_GetErrorString_t_DOWN$MH.invokeExact(symbol, _err);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct * (*sdrplay_api_GetLastErrorByType_t)(struct * device,int type,unsigned long long* time);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_GetLastErrorByType_t {
|
||||
|
||||
java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment device, int type, java.lang.foreign.MemorySegment time);
|
||||
static MemorySegment allocate(sdrplay_api_GetLastErrorByType_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$4.sdrplay_api_GetLastErrorByType_t_UP$MH, fi, constants$4.sdrplay_api_GetLastErrorByType_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_GetLastErrorByType_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (java.lang.foreign.MemorySegment _device, int _type, java.lang.foreign.MemorySegment _time) -> {
|
||||
try {
|
||||
return (java.lang.foreign.MemorySegment)constants$4.sdrplay_api_GetLastErrorByType_t_DOWN$MH.invokeExact(symbol, _device, _type, _time);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct * (*sdrplay_api_GetLastError_t)(struct * device);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_GetLastError_t {
|
||||
|
||||
java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment device);
|
||||
static MemorySegment allocate(sdrplay_api_GetLastError_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$3.sdrplay_api_GetLastError_t_UP$MH, fi, constants$3.sdrplay_api_GetLastError_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_GetLastError_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (java.lang.foreign.MemorySegment _device) -> {
|
||||
try {
|
||||
return (java.lang.foreign.MemorySegment)constants$3.sdrplay_api_GetLastError_t_DOWN$MH.invokeExact(symbol, _device);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_Init_t)(void* dev,struct * callbackFns,void* cbContext);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_Init_t {
|
||||
|
||||
int apply(java.lang.foreign.MemorySegment dev, java.lang.foreign.MemorySegment callbackFns, java.lang.foreign.MemorySegment cbContext);
|
||||
static MemorySegment allocate(sdrplay_api_Init_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$5.sdrplay_api_Init_t_UP$MH, fi, constants$5.sdrplay_api_Init_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_Init_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (java.lang.foreign.MemorySegment _dev, java.lang.foreign.MemorySegment _callbackFns, java.lang.foreign.MemorySegment _cbContext) -> {
|
||||
try {
|
||||
return (int)constants$5.sdrplay_api_Init_t_DOWN$MH.invokeExact(symbol, _dev, _callbackFns, _cbContext);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_LockDeviceApi_t)();
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_LockDeviceApi_t {
|
||||
|
||||
int apply();
|
||||
static MemorySegment allocate(sdrplay_api_LockDeviceApi_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$1.sdrplay_api_LockDeviceApi_t_UP$MH, fi, constants$1.sdrplay_api_LockDeviceApi_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_LockDeviceApi_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return () -> {
|
||||
try {
|
||||
return (int)constants$1.sdrplay_api_LockDeviceApi_t_DOWN$MH.invokeExact(symbol);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_Open_t)();
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_Open_t {
|
||||
|
||||
int apply();
|
||||
static MemorySegment allocate(sdrplay_api_Open_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$0.sdrplay_api_Open_t_UP$MH, fi, constants$0.sdrplay_api_Open_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_Open_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return () -> {
|
||||
try {
|
||||
return (int)constants$0.sdrplay_api_Open_t_DOWN$MH.invokeExact(symbol);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* sdrplay_api_PowerOverloadCbEventIdT powerOverloadChangeType;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_PowerOverloadCbParamT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("powerOverloadChangeType")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_PowerOverloadCbParamT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle powerOverloadChangeType$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("powerOverloadChangeType"));
|
||||
public static VarHandle powerOverloadChangeType$VH() {
|
||||
return sdrplay_api_PowerOverloadCbParamT.powerOverloadChangeType$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_PowerOverloadCbEventIdT powerOverloadChangeType;
|
||||
* }
|
||||
*/
|
||||
public static int powerOverloadChangeType$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_PowerOverloadCbParamT.powerOverloadChangeType$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_PowerOverloadCbEventIdT powerOverloadChangeType;
|
||||
* }
|
||||
*/
|
||||
public static void powerOverloadChangeType$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_PowerOverloadCbParamT.powerOverloadChangeType$VH.set(seg, x);
|
||||
}
|
||||
public static int powerOverloadChangeType$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_PowerOverloadCbParamT.powerOverloadChangeType$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void powerOverloadChangeType$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_PowerOverloadCbParamT.powerOverloadChangeType$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_ReleaseDevice_t)(struct * device);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_ReleaseDevice_t {
|
||||
|
||||
int apply(java.lang.foreign.MemorySegment dev);
|
||||
static MemorySegment allocate(sdrplay_api_ReleaseDevice_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$3.sdrplay_api_ReleaseDevice_t_UP$MH, fi, constants$3.sdrplay_api_ReleaseDevice_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_ReleaseDevice_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (java.lang.foreign.MemorySegment _dev) -> {
|
||||
try {
|
||||
return (int)constants$3.sdrplay_api_ReleaseDevice_t_DOWN$MH.invokeExact(symbol, _dev);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* unsigned char resetGainUpdate;
|
||||
* unsigned char resetRfUpdate;
|
||||
* unsigned char resetFsUpdate;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_ResetFlagsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("resetGainUpdate"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("resetRfUpdate"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("resetFsUpdate")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_ResetFlagsT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle resetGainUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("resetGainUpdate"));
|
||||
public static VarHandle resetGainUpdate$VH() {
|
||||
return sdrplay_api_ResetFlagsT.resetGainUpdate$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char resetGainUpdate;
|
||||
* }
|
||||
*/
|
||||
public static byte resetGainUpdate$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_ResetFlagsT.resetGainUpdate$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char resetGainUpdate;
|
||||
* }
|
||||
*/
|
||||
public static void resetGainUpdate$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_ResetFlagsT.resetGainUpdate$VH.set(seg, x);
|
||||
}
|
||||
public static byte resetGainUpdate$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_ResetFlagsT.resetGainUpdate$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void resetGainUpdate$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_ResetFlagsT.resetGainUpdate$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle resetRfUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("resetRfUpdate"));
|
||||
public static VarHandle resetRfUpdate$VH() {
|
||||
return sdrplay_api_ResetFlagsT.resetRfUpdate$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char resetRfUpdate;
|
||||
* }
|
||||
*/
|
||||
public static byte resetRfUpdate$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_ResetFlagsT.resetRfUpdate$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char resetRfUpdate;
|
||||
* }
|
||||
*/
|
||||
public static void resetRfUpdate$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_ResetFlagsT.resetRfUpdate$VH.set(seg, x);
|
||||
}
|
||||
public static byte resetRfUpdate$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_ResetFlagsT.resetRfUpdate$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void resetRfUpdate$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_ResetFlagsT.resetRfUpdate$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle resetFsUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("resetFsUpdate"));
|
||||
public static VarHandle resetFsUpdate$VH() {
|
||||
return sdrplay_api_ResetFlagsT.resetFsUpdate$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char resetFsUpdate;
|
||||
* }
|
||||
*/
|
||||
public static byte resetFsUpdate$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_ResetFlagsT.resetFsUpdate$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char resetFsUpdate;
|
||||
* }
|
||||
*/
|
||||
public static void resetFsUpdate$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_ResetFlagsT.resetFsUpdate$VH.set(seg, x);
|
||||
}
|
||||
public static byte resetFsUpdate$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_ResetFlagsT.resetFsUpdate$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void resetFsUpdate$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_ResetFlagsT.resetFsUpdate$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* double rfHz;
|
||||
* unsigned char syncUpdate;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_RfFreqT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_DOUBLE$LAYOUT.withName("rfHz"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
||||
MemoryLayout.paddingLayout(56)
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_RfFreqT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle rfHz$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfHz"));
|
||||
public static VarHandle rfHz$VH() {
|
||||
return sdrplay_api_RfFreqT.rfHz$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* double rfHz;
|
||||
* }
|
||||
*/
|
||||
public static double rfHz$get(MemorySegment seg) {
|
||||
return (double)sdrplay_api_RfFreqT.rfHz$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* double rfHz;
|
||||
* }
|
||||
*/
|
||||
public static void rfHz$set(MemorySegment seg, double x) {
|
||||
sdrplay_api_RfFreqT.rfHz$VH.set(seg, x);
|
||||
}
|
||||
public static double rfHz$get(MemorySegment seg, long index) {
|
||||
return (double)sdrplay_api_RfFreqT.rfHz$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void rfHz$set(MemorySegment seg, long index, double x) {
|
||||
sdrplay_api_RfFreqT.rfHz$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle syncUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("syncUpdate"));
|
||||
public static VarHandle syncUpdate$VH() {
|
||||
return sdrplay_api_RfFreqT.syncUpdate$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char syncUpdate;
|
||||
* }
|
||||
*/
|
||||
public static byte syncUpdate$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_RfFreqT.syncUpdate$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char syncUpdate;
|
||||
* }
|
||||
*/
|
||||
public static void syncUpdate$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_RfFreqT.syncUpdate$VH.set(seg, x);
|
||||
}
|
||||
public static byte syncUpdate$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_RfFreqT.syncUpdate$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void syncUpdate$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_RfFreqT.syncUpdate$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* unsigned char rfNotchEnable;
|
||||
* unsigned char rfDabNotchEnable;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_Rsp1aParamsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_Rsp1aParamsT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle rfNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfNotchEnable"));
|
||||
public static VarHandle rfNotchEnable$VH() {
|
||||
return sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char rfNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static byte rfNotchEnable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char rfNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static void rfNotchEnable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH.set(seg, x);
|
||||
}
|
||||
public static byte rfNotchEnable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void rfNotchEnable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle rfDabNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfDabNotchEnable"));
|
||||
public static VarHandle rfDabNotchEnable$VH() {
|
||||
return sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char rfDabNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static byte rfDabNotchEnable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char rfDabNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static void rfDabNotchEnable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH.set(seg, x);
|
||||
}
|
||||
public static byte rfDabNotchEnable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void rfDabNotchEnable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* unsigned char biasTEnable;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_Rsp1aTunerParamsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_Rsp1aTunerParamsT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle biasTEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("biasTEnable"));
|
||||
public static VarHandle biasTEnable$VH() {
|
||||
return sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char biasTEnable;
|
||||
* }
|
||||
*/
|
||||
public static byte biasTEnable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char biasTEnable;
|
||||
* }
|
||||
*/
|
||||
public static void biasTEnable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH.set(seg, x);
|
||||
}
|
||||
public static byte biasTEnable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void biasTEnable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* unsigned char extRefOutputEn;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_Rsp2ParamsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("extRefOutputEn")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_Rsp2ParamsT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle extRefOutputEn$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("extRefOutputEn"));
|
||||
public static VarHandle extRefOutputEn$VH() {
|
||||
return sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char extRefOutputEn;
|
||||
* }
|
||||
*/
|
||||
public static byte extRefOutputEn$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char extRefOutputEn;
|
||||
* }
|
||||
*/
|
||||
public static void extRefOutputEn$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH.set(seg, x);
|
||||
}
|
||||
public static byte extRefOutputEn$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void extRefOutputEn$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* unsigned char biasTEnable;
|
||||
* sdrplay_api_Rsp2_AmPortSelectT amPortSel;
|
||||
* sdrplay_api_Rsp2_AntennaSelectT antennaSel;
|
||||
* unsigned char rfNotchEnable;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_Rsp2TunerParamsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
||||
MemoryLayout.paddingLayout(24),
|
||||
Constants$root.C_INT$LAYOUT.withName("amPortSel"),
|
||||
Constants$root.C_INT$LAYOUT.withName("antennaSel"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||
MemoryLayout.paddingLayout(24)
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_Rsp2TunerParamsT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle biasTEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("biasTEnable"));
|
||||
public static VarHandle biasTEnable$VH() {
|
||||
return sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char biasTEnable;
|
||||
* }
|
||||
*/
|
||||
public static byte biasTEnable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char biasTEnable;
|
||||
* }
|
||||
*/
|
||||
public static void biasTEnable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH.set(seg, x);
|
||||
}
|
||||
public static byte biasTEnable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void biasTEnable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle amPortSel$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("amPortSel"));
|
||||
public static VarHandle amPortSel$VH() {
|
||||
return sdrplay_api_Rsp2TunerParamsT.amPortSel$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_Rsp2_AmPortSelectT amPortSel;
|
||||
* }
|
||||
*/
|
||||
public static int amPortSel$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_Rsp2TunerParamsT.amPortSel$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_Rsp2_AmPortSelectT amPortSel;
|
||||
* }
|
||||
*/
|
||||
public static void amPortSel$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_Rsp2TunerParamsT.amPortSel$VH.set(seg, x);
|
||||
}
|
||||
public static int amPortSel$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_Rsp2TunerParamsT.amPortSel$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void amPortSel$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_Rsp2TunerParamsT.amPortSel$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle antennaSel$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("antennaSel"));
|
||||
public static VarHandle antennaSel$VH() {
|
||||
return sdrplay_api_Rsp2TunerParamsT.antennaSel$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_Rsp2_AntennaSelectT antennaSel;
|
||||
* }
|
||||
*/
|
||||
public static int antennaSel$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_Rsp2TunerParamsT.antennaSel$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_Rsp2_AntennaSelectT antennaSel;
|
||||
* }
|
||||
*/
|
||||
public static void antennaSel$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_Rsp2TunerParamsT.antennaSel$VH.set(seg, x);
|
||||
}
|
||||
public static int antennaSel$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_Rsp2TunerParamsT.antennaSel$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void antennaSel$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_Rsp2TunerParamsT.antennaSel$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle rfNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfNotchEnable"));
|
||||
public static VarHandle rfNotchEnable$VH() {
|
||||
return sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char rfNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static byte rfNotchEnable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char rfNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static void rfNotchEnable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH.set(seg, x);
|
||||
}
|
||||
public static byte rfNotchEnable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void rfNotchEnable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* sdrplay_api_RspDuoModeCbEventIdT modeChangeType;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_RspDuoModeCbParamT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("modeChangeType")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_RspDuoModeCbParamT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle modeChangeType$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("modeChangeType"));
|
||||
public static VarHandle modeChangeType$VH() {
|
||||
return sdrplay_api_RspDuoModeCbParamT.modeChangeType$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_RspDuoModeCbEventIdT modeChangeType;
|
||||
* }
|
||||
*/
|
||||
public static int modeChangeType$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_RspDuoModeCbParamT.modeChangeType$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_RspDuoModeCbEventIdT modeChangeType;
|
||||
* }
|
||||
*/
|
||||
public static void modeChangeType$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_RspDuoModeCbParamT.modeChangeType$VH.set(seg, x);
|
||||
}
|
||||
public static int modeChangeType$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_RspDuoModeCbParamT.modeChangeType$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void modeChangeType$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_RspDuoModeCbParamT.modeChangeType$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* int extRefOutputEn;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_RspDuoParamsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("extRefOutputEn")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_RspDuoParamsT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle extRefOutputEn$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("extRefOutputEn"));
|
||||
public static VarHandle extRefOutputEn$VH() {
|
||||
return sdrplay_api_RspDuoParamsT.extRefOutputEn$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* int extRefOutputEn;
|
||||
* }
|
||||
*/
|
||||
public static int extRefOutputEn$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_RspDuoParamsT.extRefOutputEn$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* int extRefOutputEn;
|
||||
* }
|
||||
*/
|
||||
public static void extRefOutputEn$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_RspDuoParamsT.extRefOutputEn$VH.set(seg, x);
|
||||
}
|
||||
public static int extRefOutputEn$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_RspDuoParamsT.extRefOutputEn$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void extRefOutputEn$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_RspDuoParamsT.extRefOutputEn$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* unsigned char biasTEnable;
|
||||
* sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel;
|
||||
* unsigned char tuner1AmNotchEnable;
|
||||
* unsigned char rfNotchEnable;
|
||||
* unsigned char rfDabNotchEnable;
|
||||
* sdrplay_api_RspDuo_ResetSlaveFlagsT resetSlaveFlags;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_RspDuoTunerParamsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
||||
MemoryLayout.paddingLayout(24),
|
||||
Constants$root.C_INT$LAYOUT.withName("tuner1AmPortSel"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("tuner1AmNotchEnable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("resetGainUpdate"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("resetRfUpdate")
|
||||
).withName("resetSlaveFlags"),
|
||||
MemoryLayout.paddingLayout(24)
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_RspDuoTunerParamsT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle biasTEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("biasTEnable"));
|
||||
public static VarHandle biasTEnable$VH() {
|
||||
return sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char biasTEnable;
|
||||
* }
|
||||
*/
|
||||
public static byte biasTEnable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char biasTEnable;
|
||||
* }
|
||||
*/
|
||||
public static void biasTEnable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH.set(seg, x);
|
||||
}
|
||||
public static byte biasTEnable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void biasTEnable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle tuner1AmPortSel$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("tuner1AmPortSel"));
|
||||
public static VarHandle tuner1AmPortSel$VH() {
|
||||
return sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel;
|
||||
* }
|
||||
*/
|
||||
public static int tuner1AmPortSel$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel;
|
||||
* }
|
||||
*/
|
||||
public static void tuner1AmPortSel$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$VH.set(seg, x);
|
||||
}
|
||||
public static int tuner1AmPortSel$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void tuner1AmPortSel$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle tuner1AmNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("tuner1AmNotchEnable"));
|
||||
public static VarHandle tuner1AmNotchEnable$VH() {
|
||||
return sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char tuner1AmNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static byte tuner1AmNotchEnable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char tuner1AmNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static void tuner1AmNotchEnable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH.set(seg, x);
|
||||
}
|
||||
public static byte tuner1AmNotchEnable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void tuner1AmNotchEnable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle rfNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfNotchEnable"));
|
||||
public static VarHandle rfNotchEnable$VH() {
|
||||
return sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char rfNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static byte rfNotchEnable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char rfNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static void rfNotchEnable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH.set(seg, x);
|
||||
}
|
||||
public static byte rfNotchEnable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void rfNotchEnable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle rfDabNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfDabNotchEnable"));
|
||||
public static VarHandle rfDabNotchEnable$VH() {
|
||||
return sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char rfDabNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static byte rfDabNotchEnable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char rfDabNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static void rfDabNotchEnable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH.set(seg, x);
|
||||
}
|
||||
public static byte rfDabNotchEnable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void rfDabNotchEnable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static MemorySegment resetSlaveFlags$slice(MemorySegment seg) {
|
||||
return seg.asSlice(11, 2);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* unsigned char resetGainUpdate;
|
||||
* unsigned char resetRfUpdate;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_RspDuo_ResetSlaveFlagsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("resetGainUpdate"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("resetRfUpdate")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_RspDuo_ResetSlaveFlagsT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle resetGainUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("resetGainUpdate"));
|
||||
public static VarHandle resetGainUpdate$VH() {
|
||||
return sdrplay_api_RspDuo_ResetSlaveFlagsT.resetGainUpdate$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char resetGainUpdate;
|
||||
* }
|
||||
*/
|
||||
public static byte resetGainUpdate$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_RspDuo_ResetSlaveFlagsT.resetGainUpdate$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char resetGainUpdate;
|
||||
* }
|
||||
*/
|
||||
public static void resetGainUpdate$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_RspDuo_ResetSlaveFlagsT.resetGainUpdate$VH.set(seg, x);
|
||||
}
|
||||
public static byte resetGainUpdate$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_RspDuo_ResetSlaveFlagsT.resetGainUpdate$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void resetGainUpdate$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_RspDuo_ResetSlaveFlagsT.resetGainUpdate$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle resetRfUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("resetRfUpdate"));
|
||||
public static VarHandle resetRfUpdate$VH() {
|
||||
return sdrplay_api_RspDuo_ResetSlaveFlagsT.resetRfUpdate$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char resetRfUpdate;
|
||||
* }
|
||||
*/
|
||||
public static byte resetRfUpdate$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_RspDuo_ResetSlaveFlagsT.resetRfUpdate$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char resetRfUpdate;
|
||||
* }
|
||||
*/
|
||||
public static void resetRfUpdate$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_RspDuo_ResetSlaveFlagsT.resetRfUpdate$VH.set(seg, x);
|
||||
}
|
||||
public static byte resetRfUpdate$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_RspDuo_ResetSlaveFlagsT.resetRfUpdate$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void resetRfUpdate$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_RspDuo_ResetSlaveFlagsT.resetRfUpdate$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* unsigned char hdrEnable;
|
||||
* unsigned char biasTEnable;
|
||||
* sdrplay_api_RspDx_AntennaSelectT antennaSel;
|
||||
* unsigned char rfNotchEnable;
|
||||
* unsigned char rfDabNotchEnable;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_RspDxParamsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("hdrEnable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
||||
MemoryLayout.paddingLayout(16),
|
||||
Constants$root.C_INT$LAYOUT.withName("antennaSel"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"),
|
||||
MemoryLayout.paddingLayout(16)
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_RspDxParamsT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle hdrEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("hdrEnable"));
|
||||
public static VarHandle hdrEnable$VH() {
|
||||
return sdrplay_api_RspDxParamsT.hdrEnable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char hdrEnable;
|
||||
* }
|
||||
*/
|
||||
public static byte hdrEnable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_RspDxParamsT.hdrEnable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char hdrEnable;
|
||||
* }
|
||||
*/
|
||||
public static void hdrEnable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_RspDxParamsT.hdrEnable$VH.set(seg, x);
|
||||
}
|
||||
public static byte hdrEnable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_RspDxParamsT.hdrEnable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void hdrEnable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_RspDxParamsT.hdrEnable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle biasTEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("biasTEnable"));
|
||||
public static VarHandle biasTEnable$VH() {
|
||||
return sdrplay_api_RspDxParamsT.biasTEnable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char biasTEnable;
|
||||
* }
|
||||
*/
|
||||
public static byte biasTEnable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_RspDxParamsT.biasTEnable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char biasTEnable;
|
||||
* }
|
||||
*/
|
||||
public static void biasTEnable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_RspDxParamsT.biasTEnable$VH.set(seg, x);
|
||||
}
|
||||
public static byte biasTEnable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_RspDxParamsT.biasTEnable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void biasTEnable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_RspDxParamsT.biasTEnable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle antennaSel$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("antennaSel"));
|
||||
public static VarHandle antennaSel$VH() {
|
||||
return sdrplay_api_RspDxParamsT.antennaSel$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_RspDx_AntennaSelectT antennaSel;
|
||||
* }
|
||||
*/
|
||||
public static int antennaSel$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_RspDxParamsT.antennaSel$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_RspDx_AntennaSelectT antennaSel;
|
||||
* }
|
||||
*/
|
||||
public static void antennaSel$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_RspDxParamsT.antennaSel$VH.set(seg, x);
|
||||
}
|
||||
public static int antennaSel$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_RspDxParamsT.antennaSel$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void antennaSel$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_RspDxParamsT.antennaSel$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle rfNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfNotchEnable"));
|
||||
public static VarHandle rfNotchEnable$VH() {
|
||||
return sdrplay_api_RspDxParamsT.rfNotchEnable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char rfNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static byte rfNotchEnable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_RspDxParamsT.rfNotchEnable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char rfNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static void rfNotchEnable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_RspDxParamsT.rfNotchEnable$VH.set(seg, x);
|
||||
}
|
||||
public static byte rfNotchEnable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_RspDxParamsT.rfNotchEnable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void rfNotchEnable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_RspDxParamsT.rfNotchEnable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle rfDabNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfDabNotchEnable"));
|
||||
public static VarHandle rfDabNotchEnable$VH() {
|
||||
return sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned char rfDabNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static byte rfDabNotchEnable$get(MemorySegment seg) {
|
||||
return (byte)sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned char rfDabNotchEnable;
|
||||
* }
|
||||
*/
|
||||
public static void rfDabNotchEnable$set(MemorySegment seg, byte x) {
|
||||
sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH.set(seg, x);
|
||||
}
|
||||
public static byte rfDabNotchEnable$get(MemorySegment seg, long index) {
|
||||
return (byte)sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void rfDabNotchEnable$set(MemorySegment seg, long index, byte x) {
|
||||
sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* sdrplay_api_RspDx_HdrModeBwT hdrBw;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_RspDxTunerParamsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("hdrBw")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_RspDxTunerParamsT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle hdrBw$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("hdrBw"));
|
||||
public static VarHandle hdrBw$VH() {
|
||||
return sdrplay_api_RspDxTunerParamsT.hdrBw$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_RspDx_HdrModeBwT hdrBw;
|
||||
* }
|
||||
*/
|
||||
public static int hdrBw$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_RspDxTunerParamsT.hdrBw$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_RspDx_HdrModeBwT hdrBw;
|
||||
* }
|
||||
*/
|
||||
public static void hdrBw$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_RspDxTunerParamsT.hdrBw$VH.set(seg, x);
|
||||
}
|
||||
public static int hdrBw$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_RspDxTunerParamsT.hdrBw$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void hdrBw$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_RspDxTunerParamsT.hdrBw$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* sdrplay_api_TunerParamsT tunerParams;
|
||||
* sdrplay_api_ControlParamsT ctrlParams;
|
||||
* sdrplay_api_Rsp1aTunerParamsT rsp1aTunerParams;
|
||||
* sdrplay_api_Rsp2TunerParamsT rsp2TunerParams;
|
||||
* sdrplay_api_RspDuoTunerParamsT rspDuoTunerParams;
|
||||
* sdrplay_api_RspDxTunerParamsT rspDxTunerParams;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_RxChannelParamsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("bwType"),
|
||||
Constants$root.C_INT$LAYOUT.withName("ifType"),
|
||||
Constants$root.C_INT$LAYOUT.withName("loMode"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("gRdB"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("LNAstate"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
||||
MemoryLayout.paddingLayout(16),
|
||||
Constants$root.C_INT$LAYOUT.withName("minGr"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_FLOAT$LAYOUT.withName("curr"),
|
||||
Constants$root.C_FLOAT$LAYOUT.withName("max"),
|
||||
Constants$root.C_FLOAT$LAYOUT.withName("min")
|
||||
).withName("gainVals")
|
||||
).withName("gain"),
|
||||
MemoryLayout.paddingLayout(32),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_DOUBLE$LAYOUT.withName("rfHz"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
||||
MemoryLayout.paddingLayout(56)
|
||||
).withName("rfFreq"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("dcCal"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("speedUp"),
|
||||
MemoryLayout.paddingLayout(16),
|
||||
Constants$root.C_INT$LAYOUT.withName("trackTime"),
|
||||
Constants$root.C_INT$LAYOUT.withName("refreshRateTime")
|
||||
).withName("dcOffsetTuner"),
|
||||
MemoryLayout.paddingLayout(32)
|
||||
).withName("tunerParams"),
|
||||
MemoryLayout.structLayout(
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("DCenable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("IQenable")
|
||||
).withName("dcOffset"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("enable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("decimationFactor"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("wideBandSignal")
|
||||
).withName("decimation"),
|
||||
MemoryLayout.paddingLayout(24),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("enable"),
|
||||
Constants$root.C_INT$LAYOUT.withName("setPoint_dBfs"),
|
||||
Constants$root.C_SHORT$LAYOUT.withName("attack_ms"),
|
||||
Constants$root.C_SHORT$LAYOUT.withName("decay_ms"),
|
||||
Constants$root.C_SHORT$LAYOUT.withName("decay_delay_ms"),
|
||||
Constants$root.C_SHORT$LAYOUT.withName("decay_threshold_dB"),
|
||||
Constants$root.C_INT$LAYOUT.withName("syncUpdate")
|
||||
).withName("agc"),
|
||||
Constants$root.C_INT$LAYOUT.withName("adsbMode")
|
||||
).withName("ctrlParams"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable")
|
||||
).withName("rsp1aTunerParams"),
|
||||
MemoryLayout.paddingLayout(24),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
||||
MemoryLayout.paddingLayout(24),
|
||||
Constants$root.C_INT$LAYOUT.withName("amPortSel"),
|
||||
Constants$root.C_INT$LAYOUT.withName("antennaSel"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||
MemoryLayout.paddingLayout(24)
|
||||
).withName("rsp2TunerParams"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
||||
MemoryLayout.paddingLayout(24),
|
||||
Constants$root.C_INT$LAYOUT.withName("tuner1AmPortSel"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("tuner1AmNotchEnable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("resetGainUpdate"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("resetRfUpdate")
|
||||
).withName("resetSlaveFlags"),
|
||||
MemoryLayout.paddingLayout(24)
|
||||
).withName("rspDuoTunerParams"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("hdrBw")
|
||||
).withName("rspDxTunerParams")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_RxChannelParamsT.$struct$LAYOUT;
|
||||
}
|
||||
public static MemorySegment tunerParams$slice(MemorySegment seg) {
|
||||
return seg.asSlice(0, 72);
|
||||
}
|
||||
public static MemorySegment ctrlParams$slice(MemorySegment seg) {
|
||||
return seg.asSlice(72, 32);
|
||||
}
|
||||
public static MemorySegment rsp1aTunerParams$slice(MemorySegment seg) {
|
||||
return seg.asSlice(104, 1);
|
||||
}
|
||||
public static MemorySegment rsp2TunerParams$slice(MemorySegment seg) {
|
||||
return seg.asSlice(108, 16);
|
||||
}
|
||||
public static MemorySegment rspDuoTunerParams$slice(MemorySegment seg) {
|
||||
return seg.asSlice(124, 16);
|
||||
}
|
||||
public static MemorySegment rspDxTunerParams$slice(MemorySegment seg) {
|
||||
return seg.asSlice(140, 4);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_SelectDevice_t)(struct * device);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_SelectDevice_t {
|
||||
|
||||
int apply(java.lang.foreign.MemorySegment dev);
|
||||
static MemorySegment allocate(sdrplay_api_SelectDevice_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$2.sdrplay_api_SelectDevice_t_UP$MH, fi, constants$2.sdrplay_api_SelectDevice_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_SelectDevice_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (java.lang.foreign.MemorySegment _dev) -> {
|
||||
try {
|
||||
return (int)constants$2.sdrplay_api_SelectDevice_t_DOWN$MH.invokeExact(symbol, _dev);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* void (*sdrplay_api_StreamCallback_t)(short* xi,short* xq,struct * params,unsigned int numSamples,unsigned int reset,void* cbContext);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_StreamCallback_t {
|
||||
|
||||
void apply(java.lang.foreign.MemorySegment xi, java.lang.foreign.MemorySegment xq, java.lang.foreign.MemorySegment params, int numSamples, int reset, java.lang.foreign.MemorySegment cbContext);
|
||||
static MemorySegment allocate(sdrplay_api_StreamCallback_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$0.sdrplay_api_StreamCallback_t_UP$MH, fi, constants$0.sdrplay_api_StreamCallback_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_StreamCallback_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (java.lang.foreign.MemorySegment _xi, java.lang.foreign.MemorySegment _xq, java.lang.foreign.MemorySegment _params, int _numSamples, int _reset, java.lang.foreign.MemorySegment _cbContext) -> {
|
||||
try {
|
||||
constants$0.sdrplay_api_StreamCallback_t_DOWN$MH.invokeExact(symbol, _xi, _xq, _params, _numSamples, _reset, _cbContext);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* unsigned int firstSampleNum;
|
||||
* int grChanged;
|
||||
* int rfChanged;
|
||||
* int fsChanged;
|
||||
* unsigned int numSamples;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_StreamCbParamsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("firstSampleNum"),
|
||||
Constants$root.C_INT$LAYOUT.withName("grChanged"),
|
||||
Constants$root.C_INT$LAYOUT.withName("rfChanged"),
|
||||
Constants$root.C_INT$LAYOUT.withName("fsChanged"),
|
||||
Constants$root.C_INT$LAYOUT.withName("numSamples")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_StreamCbParamsT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle firstSampleNum$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("firstSampleNum"));
|
||||
public static VarHandle firstSampleNum$VH() {
|
||||
return sdrplay_api_StreamCbParamsT.firstSampleNum$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned int firstSampleNum;
|
||||
* }
|
||||
*/
|
||||
public static int firstSampleNum$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_StreamCbParamsT.firstSampleNum$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned int firstSampleNum;
|
||||
* }
|
||||
*/
|
||||
public static void firstSampleNum$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_StreamCbParamsT.firstSampleNum$VH.set(seg, x);
|
||||
}
|
||||
public static int firstSampleNum$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_StreamCbParamsT.firstSampleNum$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void firstSampleNum$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_StreamCbParamsT.firstSampleNum$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle grChanged$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("grChanged"));
|
||||
public static VarHandle grChanged$VH() {
|
||||
return sdrplay_api_StreamCbParamsT.grChanged$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* int grChanged;
|
||||
* }
|
||||
*/
|
||||
public static int grChanged$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_StreamCbParamsT.grChanged$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* int grChanged;
|
||||
* }
|
||||
*/
|
||||
public static void grChanged$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_StreamCbParamsT.grChanged$VH.set(seg, x);
|
||||
}
|
||||
public static int grChanged$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_StreamCbParamsT.grChanged$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void grChanged$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_StreamCbParamsT.grChanged$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle rfChanged$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfChanged"));
|
||||
public static VarHandle rfChanged$VH() {
|
||||
return sdrplay_api_StreamCbParamsT.rfChanged$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* int rfChanged;
|
||||
* }
|
||||
*/
|
||||
public static int rfChanged$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_StreamCbParamsT.rfChanged$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* int rfChanged;
|
||||
* }
|
||||
*/
|
||||
public static void rfChanged$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_StreamCbParamsT.rfChanged$VH.set(seg, x);
|
||||
}
|
||||
public static int rfChanged$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_StreamCbParamsT.rfChanged$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void rfChanged$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_StreamCbParamsT.rfChanged$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle fsChanged$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fsChanged"));
|
||||
public static VarHandle fsChanged$VH() {
|
||||
return sdrplay_api_StreamCbParamsT.fsChanged$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* int fsChanged;
|
||||
* }
|
||||
*/
|
||||
public static int fsChanged$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_StreamCbParamsT.fsChanged$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* int fsChanged;
|
||||
* }
|
||||
*/
|
||||
public static void fsChanged$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_StreamCbParamsT.fsChanged$VH.set(seg, x);
|
||||
}
|
||||
public static int fsChanged$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_StreamCbParamsT.fsChanged$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void fsChanged$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_StreamCbParamsT.fsChanged$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle numSamples$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("numSamples"));
|
||||
public static VarHandle numSamples$VH() {
|
||||
return sdrplay_api_StreamCbParamsT.numSamples$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned int numSamples;
|
||||
* }
|
||||
*/
|
||||
public static int numSamples$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_StreamCbParamsT.numSamples$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned int numSamples;
|
||||
* }
|
||||
*/
|
||||
public static void numSamples$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_StreamCbParamsT.numSamples$VH.set(seg, x);
|
||||
}
|
||||
public static int numSamples$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_StreamCbParamsT.numSamples$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void numSamples$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_StreamCbParamsT.numSamples$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_SwapRspDuoActiveTuner_t)(void* dev,enum * tuner,enum tuner1AmPortSel);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_SwapRspDuoActiveTuner_t {
|
||||
|
||||
int apply(java.lang.foreign.MemorySegment dev, java.lang.foreign.MemorySegment tuner, int tuner1AmPortSel);
|
||||
static MemorySegment allocate(sdrplay_api_SwapRspDuoActiveTuner_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$6.sdrplay_api_SwapRspDuoActiveTuner_t_UP$MH, fi, constants$6.sdrplay_api_SwapRspDuoActiveTuner_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_SwapRspDuoActiveTuner_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (java.lang.foreign.MemorySegment _dev, java.lang.foreign.MemorySegment _tuner, int _tuner1AmPortSel) -> {
|
||||
try {
|
||||
return (int)constants$6.sdrplay_api_SwapRspDuoActiveTuner_t_DOWN$MH.invokeExact(symbol, _dev, _tuner, _tuner1AmPortSel);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t)(double* currentSampleRate,double newSampleRate);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t {
|
||||
|
||||
int apply(java.lang.foreign.MemorySegment currentSampleRate, double newSampleRate);
|
||||
static MemorySegment allocate(sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$6.sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_UP$MH, fi, constants$6.sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (java.lang.foreign.MemorySegment _currentSampleRate, double _newSampleRate) -> {
|
||||
try {
|
||||
return (int)constants$6.sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_DOWN$MH.invokeExact(symbol, _currentSampleRate, _newSampleRate);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_SwapRspDuoMode_t)(struct * currDevice,struct ** deviceParams,enum rspDuoMode,double sampleRate,enum tuner,enum bwType,enum ifType,enum tuner1AmPortSel);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_SwapRspDuoMode_t {
|
||||
|
||||
int apply(java.lang.foreign.MemorySegment currDevice, java.lang.foreign.MemorySegment deviceParams, int rspDuoMode, double sampleRate, int tuner, int bwType, int ifType, int tuner1AmPortSel);
|
||||
static MemorySegment allocate(sdrplay_api_SwapRspDuoMode_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$7.sdrplay_api_SwapRspDuoMode_t_UP$MH, fi, constants$7.sdrplay_api_SwapRspDuoMode_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_SwapRspDuoMode_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (java.lang.foreign.MemorySegment _currDevice, java.lang.foreign.MemorySegment _deviceParams, int _rspDuoMode, double _sampleRate, int _tuner, int _bwType, int _ifType, int _tuner1AmPortSel) -> {
|
||||
try {
|
||||
return (int)constants$7.sdrplay_api_SwapRspDuoMode_t_DOWN$MH.invokeExact(symbol, _currDevice, _deviceParams, _rspDuoMode, _sampleRate, _tuner, _bwType, _ifType, _tuner1AmPortSel);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* unsigned int sampleNum;
|
||||
* unsigned int period;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_SyncUpdateT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("sampleNum"),
|
||||
Constants$root.C_INT$LAYOUT.withName("period")
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_SyncUpdateT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle sampleNum$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("sampleNum"));
|
||||
public static VarHandle sampleNum$VH() {
|
||||
return sdrplay_api_SyncUpdateT.sampleNum$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned int sampleNum;
|
||||
* }
|
||||
*/
|
||||
public static int sampleNum$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_SyncUpdateT.sampleNum$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned int sampleNum;
|
||||
* }
|
||||
*/
|
||||
public static void sampleNum$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_SyncUpdateT.sampleNum$VH.set(seg, x);
|
||||
}
|
||||
public static int sampleNum$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_SyncUpdateT.sampleNum$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void sampleNum$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_SyncUpdateT.sampleNum$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle period$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("period"));
|
||||
public static VarHandle period$VH() {
|
||||
return sdrplay_api_SyncUpdateT.period$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* unsigned int period;
|
||||
* }
|
||||
*/
|
||||
public static int period$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_SyncUpdateT.period$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* unsigned int period;
|
||||
* }
|
||||
*/
|
||||
public static void period$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_SyncUpdateT.period$VH.set(seg, x);
|
||||
}
|
||||
public static int period$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_SyncUpdateT.period$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void period$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_SyncUpdateT.period$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemoryLayout;
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentAllocator;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
import java.lang.foreign.StructLayout;
|
||||
import java.lang.invoke.VarHandle;
|
||||
/**
|
||||
* {@snippet :
|
||||
* struct {
|
||||
* sdrplay_api_Bw_MHzT bwType;
|
||||
* sdrplay_api_If_kHzT ifType;
|
||||
* sdrplay_api_LoModeT loMode;
|
||||
* sdrplay_api_GainT gain;
|
||||
* sdrplay_api_RfFreqT rfFreq;
|
||||
* sdrplay_api_DcOffsetTunerT dcOffsetTuner;
|
||||
* };
|
||||
* }
|
||||
*/
|
||||
public class sdrplay_api_TunerParamsT {
|
||||
|
||||
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("bwType"),
|
||||
Constants$root.C_INT$LAYOUT.withName("ifType"),
|
||||
Constants$root.C_INT$LAYOUT.withName("loMode"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_INT$LAYOUT.withName("gRdB"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("LNAstate"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
||||
MemoryLayout.paddingLayout(16),
|
||||
Constants$root.C_INT$LAYOUT.withName("minGr"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_FLOAT$LAYOUT.withName("curr"),
|
||||
Constants$root.C_FLOAT$LAYOUT.withName("max"),
|
||||
Constants$root.C_FLOAT$LAYOUT.withName("min")
|
||||
).withName("gainVals")
|
||||
).withName("gain"),
|
||||
MemoryLayout.paddingLayout(32),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_DOUBLE$LAYOUT.withName("rfHz"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
||||
MemoryLayout.paddingLayout(56)
|
||||
).withName("rfFreq"),
|
||||
MemoryLayout.structLayout(
|
||||
Constants$root.C_CHAR$LAYOUT.withName("dcCal"),
|
||||
Constants$root.C_CHAR$LAYOUT.withName("speedUp"),
|
||||
MemoryLayout.paddingLayout(16),
|
||||
Constants$root.C_INT$LAYOUT.withName("trackTime"),
|
||||
Constants$root.C_INT$LAYOUT.withName("refreshRateTime")
|
||||
).withName("dcOffsetTuner"),
|
||||
MemoryLayout.paddingLayout(32)
|
||||
);
|
||||
public static MemoryLayout $LAYOUT() {
|
||||
return sdrplay_api_TunerParamsT.$struct$LAYOUT;
|
||||
}
|
||||
static final VarHandle bwType$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("bwType"));
|
||||
public static VarHandle bwType$VH() {
|
||||
return sdrplay_api_TunerParamsT.bwType$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_Bw_MHzT bwType;
|
||||
* }
|
||||
*/
|
||||
public static int bwType$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_TunerParamsT.bwType$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_Bw_MHzT bwType;
|
||||
* }
|
||||
*/
|
||||
public static void bwType$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_TunerParamsT.bwType$VH.set(seg, x);
|
||||
}
|
||||
public static int bwType$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_TunerParamsT.bwType$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void bwType$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_TunerParamsT.bwType$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle ifType$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ifType"));
|
||||
public static VarHandle ifType$VH() {
|
||||
return sdrplay_api_TunerParamsT.ifType$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_If_kHzT ifType;
|
||||
* }
|
||||
*/
|
||||
public static int ifType$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_TunerParamsT.ifType$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_If_kHzT ifType;
|
||||
* }
|
||||
*/
|
||||
public static void ifType$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_TunerParamsT.ifType$VH.set(seg, x);
|
||||
}
|
||||
public static int ifType$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_TunerParamsT.ifType$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void ifType$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_TunerParamsT.ifType$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
static final VarHandle loMode$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("loMode"));
|
||||
public static VarHandle loMode$VH() {
|
||||
return sdrplay_api_TunerParamsT.loMode$VH;
|
||||
}
|
||||
/**
|
||||
* Getter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_LoModeT loMode;
|
||||
* }
|
||||
*/
|
||||
public static int loMode$get(MemorySegment seg) {
|
||||
return (int)sdrplay_api_TunerParamsT.loMode$VH.get(seg);
|
||||
}
|
||||
/**
|
||||
* Setter for field:
|
||||
* {@snippet :
|
||||
* sdrplay_api_LoModeT loMode;
|
||||
* }
|
||||
*/
|
||||
public static void loMode$set(MemorySegment seg, int x) {
|
||||
sdrplay_api_TunerParamsT.loMode$VH.set(seg, x);
|
||||
}
|
||||
public static int loMode$get(MemorySegment seg, long index) {
|
||||
return (int)sdrplay_api_TunerParamsT.loMode$VH.get(seg.asSlice(index*sizeof()));
|
||||
}
|
||||
public static void loMode$set(MemorySegment seg, long index, int x) {
|
||||
sdrplay_api_TunerParamsT.loMode$VH.set(seg.asSlice(index*sizeof()), x);
|
||||
}
|
||||
public static MemorySegment gain$slice(MemorySegment seg) {
|
||||
return seg.asSlice(12, 24);
|
||||
}
|
||||
public static MemorySegment rfFreq$slice(MemorySegment seg) {
|
||||
return seg.asSlice(40, 16);
|
||||
}
|
||||
public static MemorySegment dcOffsetTuner$slice(MemorySegment seg) {
|
||||
return seg.asSlice(56, 12);
|
||||
}
|
||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||
}
|
||||
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_Uninit_t)(void* dev);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_Uninit_t {
|
||||
|
||||
int apply(java.lang.foreign.MemorySegment dev);
|
||||
static MemorySegment allocate(sdrplay_api_Uninit_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$5.sdrplay_api_Uninit_t_UP$MH, fi, constants$5.sdrplay_api_Uninit_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_Uninit_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (java.lang.foreign.MemorySegment _dev) -> {
|
||||
try {
|
||||
return (int)constants$5.sdrplay_api_Uninit_t_DOWN$MH.invokeExact(symbol, _dev);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_UnlockDeviceApi_t)();
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_UnlockDeviceApi_t {
|
||||
|
||||
int apply();
|
||||
static MemorySegment allocate(sdrplay_api_UnlockDeviceApi_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$2.sdrplay_api_UnlockDeviceApi_t_UP$MH, fi, constants$2.sdrplay_api_UnlockDeviceApi_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_UnlockDeviceApi_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return () -> {
|
||||
try {
|
||||
return (int)constants$2.sdrplay_api_UnlockDeviceApi_t_DOWN$MH.invokeExact(symbol);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
*
|
||||
* 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, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
// Generated by jextract
|
||||
|
||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_14;
|
||||
|
||||
import java.lang.foreign.MemorySegment;
|
||||
import java.lang.foreign.SegmentScope;
|
||||
/**
|
||||
* {@snippet :
|
||||
* enum (*sdrplay_api_Update_t)(void* dev,enum tuner,enum reasonForUpdate,enum reasonForUpdateExt1);
|
||||
* }
|
||||
*/
|
||||
public interface sdrplay_api_Update_t {
|
||||
|
||||
int apply(java.lang.foreign.MemorySegment dev, int tuner, int reasonForUpdate, int reasonForUpdateExt1);
|
||||
static MemorySegment allocate(sdrplay_api_Update_t fi, SegmentScope scope) {
|
||||
return RuntimeHelper.upcallStub(constants$6.sdrplay_api_Update_t_UP$MH, fi, constants$6.sdrplay_api_Update_t$FUNC, scope);
|
||||
}
|
||||
static sdrplay_api_Update_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||
return (java.lang.foreign.MemorySegment _dev, int _tuner, int _reasonForUpdate, int _reasonForUpdateExt1) -> {
|
||||
try {
|
||||
return (int)constants$6.sdrplay_api_Update_t_DOWN$MH.invokeExact(symbol, _dev, _tuner, _reasonForUpdate, _reasonForUpdateExt1);
|
||||
} catch (Throwable ex$) {
|
||||
throw new AssertionError("should not reach here", ex$);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user