mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-15 01:57:39 -05:00
#1588 Use JDK20 and Gradle 8.2. Updates SDRPlay API for compatibility with JDK20 Project Panama Foreign Memory/Function changes. (#1589)
Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
8
.github/workflows/gradle.yml
vendored
8
.github/workflows/gradle.yml
vendored
@@ -22,13 +22,13 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Set up JDK 19
|
- name: Set up JDK 20
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: '19'
|
java-version: '20'
|
||||||
distribution: 'liberica'
|
distribution: 'liberica'
|
||||||
java-package: 'jdk+fx'
|
java-package: 'jdk+fx'
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
with:
|
||||||
arguments: clean build
|
arguments: clean build
|
||||||
|
|||||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
|||||||
<component name="FrameworkDetectionExcludesConfiguration">
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
<file type="web" url="file://$PROJECT_DIR$" />
|
<file type="web" url="file://$PROJECT_DIR$" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="19" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="liberica-20" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
230
artifacts/sdrplay-api-headers/v3_08/sdrplay_api.h
Normal file
230
artifacts/sdrplay-api-headers/v3_08/sdrplay_api.h
Normal file
@@ -0,0 +1,230 @@
|
|||||||
|
#ifndef SDRPLAY_API_H
|
||||||
|
#define SDRPLAY_API_H
|
||||||
|
|
||||||
|
#include "sdrplay_api_dev.h"
|
||||||
|
#include "sdrplay_api_rx_channel.h"
|
||||||
|
#include "sdrplay_api_callback.h"
|
||||||
|
|
||||||
|
//#if defined(_M_X64) || defined(_M_IX86)
|
||||||
|
//#include "windows.h"
|
||||||
|
//#elif defined (__GNUC__)
|
||||||
|
typedef void *HANDLE;
|
||||||
|
//#endif
|
||||||
|
//
|
||||||
|
//#ifndef _SDRPLAY_DLL_QUALIFIER
|
||||||
|
//#if !defined(STATIC_LIB) && (defined(_M_X64) || defined(_M_IX86))
|
||||||
|
//#define _SDRPLAY_DLL_QUALIFIER __declspec(dllimport)
|
||||||
|
//#elif defined(STATIC_LIB) || defined(__GNUC__)
|
||||||
|
//#define _SDRPLAY_DLL_QUALIFIER
|
||||||
|
//#endif
|
||||||
|
//#endif // _SDRPLAY_DLL_QUALIFIER
|
||||||
|
|
||||||
|
// Application code should check that it is compiled against the same API version
|
||||||
|
// sdrplay_api_ApiVersion() returns the API version
|
||||||
|
#define SDRPLAY_API_VERSION (float)(3.08)
|
||||||
|
|
||||||
|
// API Constants
|
||||||
|
#define SDRPLAY_MAX_DEVICES (16)
|
||||||
|
#define SDRPLAY_MAX_TUNERS_PER_DEVICE (2)
|
||||||
|
|
||||||
|
#define SDRPLAY_MAX_SER_NO_LEN (64)
|
||||||
|
#define SDRPLAY_MAX_ROOT_NM_LEN (32)
|
||||||
|
|
||||||
|
#define SDRPLAY_RSP1_ID (1)
|
||||||
|
#define SDRPLAY_RSP1A_ID (255)
|
||||||
|
#define SDRPLAY_RSP2_ID (2)
|
||||||
|
#define SDRPLAY_RSPduo_ID (3)
|
||||||
|
#define SDRPLAY_RSPdx_ID (4)
|
||||||
|
|
||||||
|
// Enum types
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Success = 0,
|
||||||
|
sdrplay_api_Fail = 1,
|
||||||
|
sdrplay_api_InvalidParam = 2,
|
||||||
|
sdrplay_api_OutOfRange = 3,
|
||||||
|
sdrplay_api_GainUpdateError = 4,
|
||||||
|
sdrplay_api_RfUpdateError = 5,
|
||||||
|
sdrplay_api_FsUpdateError = 6,
|
||||||
|
sdrplay_api_HwError = 7,
|
||||||
|
sdrplay_api_AliasingError = 8,
|
||||||
|
sdrplay_api_AlreadyInitialised = 9,
|
||||||
|
sdrplay_api_NotInitialised = 10,
|
||||||
|
sdrplay_api_NotEnabled = 11,
|
||||||
|
sdrplay_api_HwVerError = 12,
|
||||||
|
sdrplay_api_OutOfMemError = 13,
|
||||||
|
sdrplay_api_ServiceNotResponding = 14,
|
||||||
|
sdrplay_api_StartPending = 15,
|
||||||
|
sdrplay_api_StopPending = 16,
|
||||||
|
sdrplay_api_InvalidMode = 17,
|
||||||
|
sdrplay_api_FailedVerification1 = 18,
|
||||||
|
sdrplay_api_FailedVerification2 = 19,
|
||||||
|
sdrplay_api_FailedVerification3 = 20,
|
||||||
|
sdrplay_api_FailedVerification4 = 21,
|
||||||
|
sdrplay_api_FailedVerification5 = 22,
|
||||||
|
sdrplay_api_FailedVerification6 = 23,
|
||||||
|
sdrplay_api_InvalidServiceVersion = 24
|
||||||
|
} sdrplay_api_ErrT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Update_None = 0x00000000,
|
||||||
|
|
||||||
|
// Reasons for master only mode
|
||||||
|
sdrplay_api_Update_Dev_Fs = 0x00000001,
|
||||||
|
sdrplay_api_Update_Dev_Ppm = 0x00000002,
|
||||||
|
sdrplay_api_Update_Dev_SyncUpdate = 0x00000004,
|
||||||
|
sdrplay_api_Update_Dev_ResetFlags = 0x00000008,
|
||||||
|
|
||||||
|
sdrplay_api_Update_Rsp1a_BiasTControl = 0x00000010,
|
||||||
|
sdrplay_api_Update_Rsp1a_RfNotchControl = 0x00000020,
|
||||||
|
sdrplay_api_Update_Rsp1a_RfDabNotchControl = 0x00000040,
|
||||||
|
|
||||||
|
sdrplay_api_Update_Rsp2_BiasTControl = 0x00000080,
|
||||||
|
sdrplay_api_Update_Rsp2_AmPortSelect = 0x00000100,
|
||||||
|
sdrplay_api_Update_Rsp2_AntennaControl = 0x00000200,
|
||||||
|
sdrplay_api_Update_Rsp2_RfNotchControl = 0x00000400,
|
||||||
|
sdrplay_api_Update_Rsp2_ExtRefControl = 0x00000800,
|
||||||
|
|
||||||
|
sdrplay_api_Update_RspDuo_ExtRefControl = 0x00001000,
|
||||||
|
|
||||||
|
sdrplay_api_Update_Master_Spare_1 = 0x00002000,
|
||||||
|
sdrplay_api_Update_Master_Spare_2 = 0x00004000,
|
||||||
|
|
||||||
|
// Reasons for master and slave mode
|
||||||
|
// Note: sdrplay_api_Update_Tuner_Gr MUST be the first value defined in this section!
|
||||||
|
sdrplay_api_Update_Tuner_Gr = 0x00008000,
|
||||||
|
sdrplay_api_Update_Tuner_GrLimits = 0x00010000,
|
||||||
|
sdrplay_api_Update_Tuner_Frf = 0x00020000,
|
||||||
|
sdrplay_api_Update_Tuner_BwType = 0x00040000,
|
||||||
|
sdrplay_api_Update_Tuner_IfType = 0x00080000,
|
||||||
|
sdrplay_api_Update_Tuner_DcOffset = 0x00100000,
|
||||||
|
sdrplay_api_Update_Tuner_LoMode = 0x00200000,
|
||||||
|
|
||||||
|
sdrplay_api_Update_Ctrl_DCoffsetIQimbalance = 0x00400000,
|
||||||
|
sdrplay_api_Update_Ctrl_Decimation = 0x00800000,
|
||||||
|
sdrplay_api_Update_Ctrl_Agc = 0x01000000,
|
||||||
|
sdrplay_api_Update_Ctrl_AdsbMode = 0x02000000,
|
||||||
|
sdrplay_api_Update_Ctrl_OverloadMsgAck = 0x04000000,
|
||||||
|
|
||||||
|
sdrplay_api_Update_RspDuo_BiasTControl = 0x08000000,
|
||||||
|
sdrplay_api_Update_RspDuo_AmPortSelect = 0x10000000,
|
||||||
|
sdrplay_api_Update_RspDuo_Tuner1AmNotchControl = 0x20000000,
|
||||||
|
sdrplay_api_Update_RspDuo_RfNotchControl = 0x40000000,
|
||||||
|
sdrplay_api_Update_RspDuo_RfDabNotchControl = 0x80000000,
|
||||||
|
} sdrplay_api_ReasonForUpdateT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Update_Ext1_None = 0x00000000,
|
||||||
|
|
||||||
|
// Reasons for master only mode
|
||||||
|
sdrplay_api_Update_RspDx_HdrEnable = 0x00000001,
|
||||||
|
sdrplay_api_Update_RspDx_BiasTControl = 0x00000002,
|
||||||
|
sdrplay_api_Update_RspDx_AntennaControl = 0x00000004,
|
||||||
|
sdrplay_api_Update_RspDx_RfNotchControl = 0x00000008,
|
||||||
|
sdrplay_api_Update_RspDx_RfDabNotchControl = 0x00000010,
|
||||||
|
sdrplay_api_Update_RspDx_HdrBw = 0x00000020,
|
||||||
|
|
||||||
|
// Reasons for master and slave mode
|
||||||
|
} sdrplay_api_ReasonForUpdateExtension1T;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_DbgLvl_Disable = 0,
|
||||||
|
sdrplay_api_DbgLvl_Verbose = 1,
|
||||||
|
sdrplay_api_DbgLvl_Warning = 2,
|
||||||
|
sdrplay_api_DbgLvl_Error = 3,
|
||||||
|
sdrplay_api_DbgLvl_Message = 4,
|
||||||
|
} sdrplay_api_DbgLvl_t;
|
||||||
|
|
||||||
|
// Device structure
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
char SerNo[SDRPLAY_MAX_SER_NO_LEN];
|
||||||
|
unsigned char hwVer;
|
||||||
|
sdrplay_api_TunerSelectT tuner;
|
||||||
|
sdrplay_api_RspDuoModeT rspDuoMode;
|
||||||
|
unsigned char valid;
|
||||||
|
double rspDuoSampleFreq;
|
||||||
|
HANDLE dev;
|
||||||
|
} sdrplay_api_DeviceT;
|
||||||
|
|
||||||
|
// Device parameter structure
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_DevParamsT *devParams;
|
||||||
|
sdrplay_api_RxChannelParamsT *rxChannelA;
|
||||||
|
sdrplay_api_RxChannelParamsT *rxChannelB;
|
||||||
|
} sdrplay_api_DeviceParamsT;
|
||||||
|
|
||||||
|
// Extended error message structure
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
char file[256];
|
||||||
|
char function[256];
|
||||||
|
int line;
|
||||||
|
char message[1024];
|
||||||
|
} sdrplay_api_ErrorInfoT;
|
||||||
|
|
||||||
|
// Comman API function types
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_Open_t)(void);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_Close_t)(void);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_ApiVersion_t)(float *apiVer);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_LockDeviceApi_t)(void);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_UnlockDeviceApi_t)(void);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_GetDevices_t)(sdrplay_api_DeviceT *devices, unsigned int *numDevs, unsigned int maxDevs);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_SelectDevice_t)(sdrplay_api_DeviceT *device);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_ReleaseDevice_t)(sdrplay_api_DeviceT *device);
|
||||||
|
typedef const char* (*sdrplay_api_GetErrorString_t)(sdrplay_api_ErrT err);
|
||||||
|
typedef sdrplay_api_ErrorInfoT* (*sdrplay_api_GetLastError_t)(sdrplay_api_DeviceT *device);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_DisableHeartbeat_t)(void);
|
||||||
|
|
||||||
|
// Device API function types
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_DebugEnable_t)(HANDLE dev, sdrplay_api_DbgLvl_t dbgLvl);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_GetDeviceParams_t)(HANDLE dev, sdrplay_api_DeviceParamsT **deviceParams);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_Init_t)(HANDLE dev, sdrplay_api_CallbackFnsT *callbackFns, void *cbContext);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_Uninit_t)(HANDLE dev);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_Update_t)(HANDLE dev, sdrplay_api_TunerSelectT tuner, sdrplay_api_ReasonForUpdateT reasonForUpdate, sdrplay_api_ReasonForUpdateExtension1T reasonForUpdateExt1);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_SwapRspDuoActiveTuner_t)(HANDLE dev, sdrplay_api_TunerSelectT *tuner, sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t)(double *currentSampleRate, double newSampleRate);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_SwapRspDuoMode_t)(sdrplay_api_DeviceT *currDevice, sdrplay_api_DeviceParamsT **deviceParams,
|
||||||
|
sdrplay_api_RspDuoModeT rspDuoMode, double sampleRate, sdrplay_api_TunerSelectT tuner,
|
||||||
|
sdrplay_api_Bw_MHzT bwType, sdrplay_api_If_kHzT ifType, sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel);
|
||||||
|
|
||||||
|
// API function definitions
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// // Comman API function definitions
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_Open(void);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_Close(void);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_ApiVersion(float *apiVer);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_LockDeviceApi(void);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_UnlockDeviceApi(void);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_GetDevices(sdrplay_api_DeviceT *devices, unsigned int *numDevs, unsigned int maxDevs);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_SelectDevice(sdrplay_api_DeviceT *device);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_ReleaseDevice(sdrplay_api_DeviceT *device);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER const char* sdrplay_api_GetErrorString(sdrplay_api_ErrT err);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrorInfoT* sdrplay_api_GetLastError(sdrplay_api_DeviceT *device);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_DisableHeartbeat(void); // Must be called before sdrplay_api_SelectDevice()
|
||||||
|
//
|
||||||
|
// // Device API function definitions
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_DebugEnable(HANDLE dev, sdrplay_api_DbgLvl_t enable);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_GetDeviceParams(HANDLE dev, sdrplay_api_DeviceParamsT **deviceParams);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_Init(HANDLE dev, sdrplay_api_CallbackFnsT *callbackFns, void *cbContext);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_Uninit(HANDLE dev);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_Update(HANDLE dev, sdrplay_api_TunerSelectT tuner, sdrplay_api_ReasonForUpdateT reasonForUpdate, sdrplay_api_ReasonForUpdateExtension1T reasonForUpdateExt1);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_SwapRspDuoActiveTuner(HANDLE dev, sdrplay_api_TunerSelectT *currentTuner, sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_SwapRspDuoDualTunerModeSampleRate(HANDLE dev, double *currentSampleRate, double newSampleRate);
|
||||||
|
// _SDRPLAY_DLL_QUALIFIER sdrplay_api_ErrT sdrplay_api_SwapRspDuoMode(sdrplay_api_DeviceT *currDevice, sdrplay_api_DeviceParamsT **deviceParams,
|
||||||
|
// sdrplay_api_RspDuoModeT rspDuoMode, double sampleRate, sdrplay_api_TunerSelectT tuner,
|
||||||
|
// sdrplay_api_Bw_MHzT bwType, sdrplay_api_If_kHzT ifType, sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_H
|
||||||
78
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_callback.h
Normal file
78
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_callback.h
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
#ifndef SDRPLAY_API_CALLBACK_H
|
||||||
|
#define SDRPLAY_API_CALLBACK_H
|
||||||
|
|
||||||
|
// Event callback enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Overload_Detected = 0,
|
||||||
|
sdrplay_api_Overload_Corrected = 1,
|
||||||
|
} sdrplay_api_PowerOverloadCbEventIdT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_MasterInitialised = 0,
|
||||||
|
sdrplay_api_SlaveAttached = 1,
|
||||||
|
sdrplay_api_SlaveDetached = 2,
|
||||||
|
sdrplay_api_SlaveInitialised = 3,
|
||||||
|
sdrplay_api_SlaveUninitialised = 4,
|
||||||
|
sdrplay_api_MasterDllDisappeared = 5,
|
||||||
|
sdrplay_api_SlaveDllDisappeared = 6,
|
||||||
|
} sdrplay_api_RspDuoModeCbEventIdT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_GainChange = 0,
|
||||||
|
sdrplay_api_PowerOverloadChange = 1,
|
||||||
|
sdrplay_api_DeviceRemoved = 2,
|
||||||
|
sdrplay_api_RspDuoModeChange = 3,
|
||||||
|
} sdrplay_api_EventT;
|
||||||
|
|
||||||
|
// Event callback parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned int gRdB;
|
||||||
|
unsigned int lnaGRdB;
|
||||||
|
double currGain;
|
||||||
|
} sdrplay_api_GainCbParamT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_PowerOverloadCbEventIdT powerOverloadChangeType;
|
||||||
|
} sdrplay_api_PowerOverloadCbParamT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_RspDuoModeCbEventIdT modeChangeType;
|
||||||
|
} sdrplay_api_RspDuoModeCbParamT;
|
||||||
|
|
||||||
|
// Event parameters overlay
|
||||||
|
typedef union
|
||||||
|
{
|
||||||
|
sdrplay_api_GainCbParamT gainParams;
|
||||||
|
sdrplay_api_PowerOverloadCbParamT powerOverloadParams;
|
||||||
|
sdrplay_api_RspDuoModeCbParamT rspDuoModeParams;
|
||||||
|
} sdrplay_api_EventParamsT;
|
||||||
|
|
||||||
|
// Stream callback parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned int firstSampleNum;
|
||||||
|
int grChanged;
|
||||||
|
int rfChanged;
|
||||||
|
int fsChanged;
|
||||||
|
unsigned int numSamples;
|
||||||
|
} sdrplay_api_StreamCbParamsT;
|
||||||
|
|
||||||
|
// Callback function prototypes
|
||||||
|
typedef void (*sdrplay_api_StreamCallback_t)(short *xi, short *xq, sdrplay_api_StreamCbParamsT *params, unsigned int numSamples, unsigned int reset, void *cbContext);
|
||||||
|
typedef void (*sdrplay_api_EventCallback_t)(sdrplay_api_EventT eventId, sdrplay_api_TunerSelectT tuner, sdrplay_api_EventParamsT *params, void *cbContext);
|
||||||
|
|
||||||
|
// Callback function struct
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_StreamCallback_t StreamACbFn;
|
||||||
|
sdrplay_api_StreamCallback_t StreamBCbFn;
|
||||||
|
sdrplay_api_EventCallback_t EventCbFn;
|
||||||
|
} sdrplay_api_CallbackFnsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_CALLBACK_H
|
||||||
55
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_control.h
Normal file
55
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_control.h
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
#ifndef SDRPLAY_API_CONTROL_H
|
||||||
|
#define SDRPLAY_API_CONTROL_H
|
||||||
|
|
||||||
|
// Control parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_AGC_DISABLE = 0,
|
||||||
|
sdrplay_api_AGC_100HZ = 1,
|
||||||
|
sdrplay_api_AGC_50HZ = 2,
|
||||||
|
sdrplay_api_AGC_5HZ = 3,
|
||||||
|
sdrplay_api_AGC_CTRL_EN = 4
|
||||||
|
} sdrplay_api_AgcControlT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_ADSB_DECIMATION = 0,
|
||||||
|
sdrplay_api_ADSB_NO_DECIMATION_LOWPASS = 1,
|
||||||
|
sdrplay_api_ADSB_NO_DECIMATION_BANDPASS_2MHZ = 2,
|
||||||
|
sdrplay_api_ADSB_NO_DECIMATION_BANDPASS_3MHZ = 3
|
||||||
|
} sdrplay_api_AdsbModeT;
|
||||||
|
|
||||||
|
// Control parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char DCenable; // default: 1
|
||||||
|
unsigned char IQenable; // default: 1
|
||||||
|
} sdrplay_api_DcOffsetT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char enable; // default: 0
|
||||||
|
unsigned char decimationFactor; // default: 1
|
||||||
|
unsigned char wideBandSignal; // default: 0
|
||||||
|
} sdrplay_api_DecimationT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_AgcControlT enable; // default: sdrplay_api_AGC_50HZ
|
||||||
|
int setPoint_dBfs; // default: -60
|
||||||
|
unsigned short attack_ms; // default: 0
|
||||||
|
unsigned short decay_ms; // default: 0
|
||||||
|
unsigned short decay_delay_ms; // default: 0
|
||||||
|
unsigned short decay_threshold_dB; // default: 0
|
||||||
|
int syncUpdate; // default: 0
|
||||||
|
} sdrplay_api_AgcT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_DcOffsetT dcOffset;
|
||||||
|
sdrplay_api_DecimationT decimation;
|
||||||
|
sdrplay_api_AgcT agc;
|
||||||
|
sdrplay_api_AdsbModeT adsbMode; //default: sdrplay_api_ADSB_DECIMATION
|
||||||
|
} sdrplay_api_ControlParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_CONTROL_H
|
||||||
51
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_dev.h
Normal file
51
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_dev.h
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
#ifndef SDRPLAY_API_DEV_H
|
||||||
|
#define SDRPLAY_API_DEV_H
|
||||||
|
|
||||||
|
#include "sdrplay_api_rsp1a.h"
|
||||||
|
#include "sdrplay_api_rsp2.h"
|
||||||
|
#include "sdrplay_api_rspDuo.h"
|
||||||
|
#include "sdrplay_api_rspDx.h"
|
||||||
|
|
||||||
|
// Dev parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_ISOCH = 0,
|
||||||
|
sdrplay_api_BULK = 1
|
||||||
|
} sdrplay_api_TransferModeT;
|
||||||
|
|
||||||
|
// Dev parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
double fsHz; // default: 2000000.0
|
||||||
|
unsigned char syncUpdate; // default: 0
|
||||||
|
unsigned char reCal; // default: 0
|
||||||
|
} sdrplay_api_FsFreqT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned int sampleNum; // default: 0
|
||||||
|
unsigned int period; // default: 0
|
||||||
|
} sdrplay_api_SyncUpdateT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char resetGainUpdate; // default: 0
|
||||||
|
unsigned char resetRfUpdate; // default: 0
|
||||||
|
unsigned char resetFsUpdate; // default: 0
|
||||||
|
} sdrplay_api_ResetFlagsT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
double ppm; // default: 0.0
|
||||||
|
sdrplay_api_FsFreqT fsFreq;
|
||||||
|
sdrplay_api_SyncUpdateT syncUpdate;
|
||||||
|
sdrplay_api_ResetFlagsT resetFlags;
|
||||||
|
sdrplay_api_TransferModeT mode; // default: sdrplay_api_ISOCH
|
||||||
|
unsigned int samplesPerPkt; // default: 0 (output param)
|
||||||
|
sdrplay_api_Rsp1aParamsT rsp1aParams;
|
||||||
|
sdrplay_api_Rsp2ParamsT rsp2Params;
|
||||||
|
sdrplay_api_RspDuoParamsT rspDuoParams;
|
||||||
|
sdrplay_api_RspDxParamsT rspDxParams;
|
||||||
|
} sdrplay_api_DevParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_DEV_H
|
||||||
22
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_rsp1a.h
Normal file
22
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_rsp1a.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef SDRPLAY_API_RSP1A_H
|
||||||
|
#define SDRPLAY_API_RSP1A_H
|
||||||
|
|
||||||
|
#define RSPIA_NUM_LNA_STATES 10
|
||||||
|
#define RSPIA_NUM_LNA_STATES_AM 7
|
||||||
|
#define RSPIA_NUM_LNA_STATES_LBAND 9
|
||||||
|
|
||||||
|
// RSP1A parameter enums
|
||||||
|
|
||||||
|
// RSP1A parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char rfNotchEnable; // default: 0
|
||||||
|
unsigned char rfDabNotchEnable; // default: 0
|
||||||
|
} sdrplay_api_Rsp1aParamsT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char biasTEnable; // default: 0
|
||||||
|
} sdrplay_api_Rsp1aTunerParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_RSP1A_H
|
||||||
35
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_rsp2.h
Normal file
35
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_rsp2.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#ifndef SDRPLAY_API_RSP2_H
|
||||||
|
#define SDRPLAY_API_RSP2_H
|
||||||
|
|
||||||
|
#define RSPII_NUM_LNA_STATES 9
|
||||||
|
#define RSPII_NUM_LNA_STATES_AMPORT 5
|
||||||
|
#define RSPII_NUM_LNA_STATES_420MHZ 6
|
||||||
|
|
||||||
|
// RSP2 parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Rsp2_ANTENNA_A = 5,
|
||||||
|
sdrplay_api_Rsp2_ANTENNA_B = 6,
|
||||||
|
} sdrplay_api_Rsp2_AntennaSelectT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Rsp2_AMPORT_1 = 1,
|
||||||
|
sdrplay_api_Rsp2_AMPORT_2 = 0,
|
||||||
|
} sdrplay_api_Rsp2_AmPortSelectT;
|
||||||
|
|
||||||
|
// RSP2 parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char extRefOutputEn; // default: 0
|
||||||
|
} sdrplay_api_Rsp2ParamsT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char biasTEnable; // default: 0
|
||||||
|
sdrplay_api_Rsp2_AmPortSelectT amPortSel; // default: sdrplay_api_Rsp2_AMPORT_2
|
||||||
|
sdrplay_api_Rsp2_AntennaSelectT antennaSel; // default: sdrplay_api_Rsp2_ANTENNA_A
|
||||||
|
unsigned char rfNotchEnable; // default: 0
|
||||||
|
} sdrplay_api_Rsp2TunerParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_RSP2_H
|
||||||
40
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_rspDuo.h
Normal file
40
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_rspDuo.h
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#ifndef SDRPLAY_API_RSPduo_H
|
||||||
|
#define SDRPLAY_API_RSPduo_H
|
||||||
|
|
||||||
|
#define RSPDUO_NUM_LNA_STATES 10
|
||||||
|
#define RSPDUO_NUM_LNA_STATES_AMPORT 5
|
||||||
|
#define RSPDUO_NUM_LNA_STATES_AM 7
|
||||||
|
#define RSPDUO_NUM_LNA_STATES_LBAND 9
|
||||||
|
|
||||||
|
// RSPduo parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_RspDuoMode_Unknown = 0,
|
||||||
|
sdrplay_api_RspDuoMode_Single_Tuner = 1,
|
||||||
|
sdrplay_api_RspDuoMode_Dual_Tuner = 2,
|
||||||
|
sdrplay_api_RspDuoMode_Master = 4,
|
||||||
|
sdrplay_api_RspDuoMode_Slave = 8,
|
||||||
|
} sdrplay_api_RspDuoModeT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_RspDuo_AMPORT_1 = 1,
|
||||||
|
sdrplay_api_RspDuo_AMPORT_2 = 0,
|
||||||
|
} sdrplay_api_RspDuo_AmPortSelectT;
|
||||||
|
|
||||||
|
// RSPduo parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int extRefOutputEn; // default: 0
|
||||||
|
} sdrplay_api_RspDuoParamsT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char biasTEnable; // default: 0
|
||||||
|
sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel; // default: sdrplay_api_RspDuo_AMPORT_2
|
||||||
|
unsigned char tuner1AmNotchEnable; // default: 0
|
||||||
|
unsigned char rfNotchEnable; // default: 0
|
||||||
|
unsigned char rfDabNotchEnable; // default: 0
|
||||||
|
} sdrplay_api_RspDuoTunerParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_RSPduo_H
|
||||||
45
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_rspDx.h
Normal file
45
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_rspDx.h
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
#ifndef SDRPLAY_API_RSPDX_H
|
||||||
|
#define SDRPLAY_API_RSPDX_H
|
||||||
|
|
||||||
|
#include "sdrplay_api_tuner.h"
|
||||||
|
|
||||||
|
#define RSPDX_NUM_LNA_STATES 28 // Number of LNA states in all bands (except where defined differently below)
|
||||||
|
#define RSPDX_NUM_LNA_STATES_AMPORT2_0_12 19 // Number of LNA states when using AM Port 2 between 0 and 12MHz
|
||||||
|
#define RSPDX_NUM_LNA_STATES_AMPORT2_12_60 20 // Number of LNA states when using AM Port 2 between 12 and 60MHz
|
||||||
|
#define RSPDX_NUM_LNA_STATES_VHF_BAND3 27 // Number of LNA states in VHF and Band3
|
||||||
|
#define RSPDX_NUM_LNA_STATES_420MHZ 21 // Number of LNA states in 420MHz band
|
||||||
|
#define RSPDX_NUM_LNA_STATES_LBAND 19 // Number of LNA states in L-band
|
||||||
|
#define RSPDX_NUM_LNA_STATES_DX 26 // Number of LNA states in DX path
|
||||||
|
|
||||||
|
// RSPdx parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_RspDx_ANTENNA_A = 0,
|
||||||
|
sdrplay_api_RspDx_ANTENNA_B = 1,
|
||||||
|
sdrplay_api_RspDx_ANTENNA_C = 2,
|
||||||
|
} sdrplay_api_RspDx_AntennaSelectT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_RspDx_HDRMODE_BW_0_200 = 0,
|
||||||
|
sdrplay_api_RspDx_HDRMODE_BW_0_500 = 1,
|
||||||
|
sdrplay_api_RspDx_HDRMODE_BW_1_200 = 2,
|
||||||
|
sdrplay_api_RspDx_HDRMODE_BW_1_700 = 3,
|
||||||
|
} sdrplay_api_RspDx_HdrModeBwT;
|
||||||
|
|
||||||
|
// RSPdx parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char hdrEnable; // default: 0
|
||||||
|
unsigned char biasTEnable; // default: 0
|
||||||
|
sdrplay_api_RspDx_AntennaSelectT antennaSel; // default: sdrplay_api_RspDx_ANTENNA_A
|
||||||
|
unsigned char rfNotchEnable; // default: 0
|
||||||
|
unsigned char rfDabNotchEnable; // default: 0
|
||||||
|
} sdrplay_api_RspDxParamsT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_RspDx_HdrModeBwT hdrBw; // default: sdrplay_api_RspDx_HDRMODE_BW_1_700
|
||||||
|
} sdrplay_api_RspDxTunerParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_RSPDX_H
|
||||||
21
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_rx_channel.h
Normal file
21
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_rx_channel.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#ifndef SDRPLAY_API_RX_CHANNEL_H
|
||||||
|
#define SDRPLAY_API_RX_CHANNEL_H
|
||||||
|
|
||||||
|
#include "sdrplay_api_tuner.h"
|
||||||
|
#include "sdrplay_api_control.h"
|
||||||
|
#include "sdrplay_api_rsp1a.h"
|
||||||
|
#include "sdrplay_api_rsp2.h"
|
||||||
|
#include "sdrplay_api_rspDuo.h"
|
||||||
|
#include "sdrplay_api_rspDx.h"
|
||||||
|
|
||||||
|
typedef 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;
|
||||||
|
} sdrplay_api_RxChannelParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_RX_CHANNEL_H
|
||||||
93
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_tuner.h
Normal file
93
artifacts/sdrplay-api-headers/v3_08/sdrplay_api_tuner.h
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
#ifndef SDRPLAY_API_TUNER_H
|
||||||
|
#define SDRPLAY_API_TUNER_H
|
||||||
|
|
||||||
|
#define MAX_BB_GR (59)
|
||||||
|
|
||||||
|
// Tuner parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_BW_Undefined = 0,
|
||||||
|
sdrplay_api_BW_0_200 = 200,
|
||||||
|
sdrplay_api_BW_0_300 = 300,
|
||||||
|
sdrplay_api_BW_0_600 = 600,
|
||||||
|
sdrplay_api_BW_1_536 = 1536,
|
||||||
|
sdrplay_api_BW_5_000 = 5000,
|
||||||
|
sdrplay_api_BW_6_000 = 6000,
|
||||||
|
sdrplay_api_BW_7_000 = 7000,
|
||||||
|
sdrplay_api_BW_8_000 = 8000
|
||||||
|
} sdrplay_api_Bw_MHzT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_IF_Undefined = -1,
|
||||||
|
sdrplay_api_IF_Zero = 0,
|
||||||
|
sdrplay_api_IF_0_450 = 450,
|
||||||
|
sdrplay_api_IF_1_620 = 1620,
|
||||||
|
sdrplay_api_IF_2_048 = 2048
|
||||||
|
} sdrplay_api_If_kHzT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_LO_Undefined = 0,
|
||||||
|
sdrplay_api_LO_Auto = 1,
|
||||||
|
sdrplay_api_LO_120MHz = 2,
|
||||||
|
sdrplay_api_LO_144MHz = 3,
|
||||||
|
sdrplay_api_LO_168MHz = 4
|
||||||
|
} sdrplay_api_LoModeT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_EXTENDED_MIN_GR = 0,
|
||||||
|
sdrplay_api_NORMAL_MIN_GR = 20
|
||||||
|
} sdrplay_api_MinGainReductionT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Tuner_Neither = 0,
|
||||||
|
sdrplay_api_Tuner_A = 1,
|
||||||
|
sdrplay_api_Tuner_B = 2,
|
||||||
|
sdrplay_api_Tuner_Both = 3,
|
||||||
|
} sdrplay_api_TunerSelectT;
|
||||||
|
|
||||||
|
// Tuner parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
float curr;
|
||||||
|
float max;
|
||||||
|
float min;
|
||||||
|
} sdrplay_api_GainValuesT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int gRdB; // default: 50
|
||||||
|
unsigned char LNAstate; // default: 0
|
||||||
|
unsigned char syncUpdate; // default: 0
|
||||||
|
sdrplay_api_MinGainReductionT minGr; // default: sdrplay_api_NORMAL_MIN_GR
|
||||||
|
sdrplay_api_GainValuesT gainVals; // output parameter
|
||||||
|
} sdrplay_api_GainT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
double rfHz; // default: 200000000.0
|
||||||
|
unsigned char syncUpdate; // default: 0
|
||||||
|
} sdrplay_api_RfFreqT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char dcCal; // default: 3 (Periodic mode)
|
||||||
|
unsigned char speedUp; // default: 0 (No speedup)
|
||||||
|
int trackTime; // default: 1 (=> time in uSec = (72 * 3 * trackTime) / 24e6 = 9uSec)
|
||||||
|
int refreshRateTime; // default: 2048 (=> time in uSec = (72 * 3 * refreshRateTime) / 24e6 = 18432uSec)
|
||||||
|
} sdrplay_api_DcOffsetTunerT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_Bw_MHzT bwType; // default: sdrplay_api_BW_0_200
|
||||||
|
sdrplay_api_If_kHzT ifType; // default: sdrplay_api_IF_Zero
|
||||||
|
sdrplay_api_LoModeT loMode; // default: sdrplay_api_LO_Auto
|
||||||
|
sdrplay_api_GainT gain;
|
||||||
|
sdrplay_api_RfFreqT rfFreq;
|
||||||
|
sdrplay_api_DcOffsetTunerT dcOffsetTuner;
|
||||||
|
} sdrplay_api_TunerParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_TUNER_H
|
||||||
18
build.gradle
18
build.gradle
@@ -53,12 +53,12 @@ repositories {
|
|||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
}
|
}
|
||||||
|
|
||||||
version = '0.6.0-alpha6'
|
version = '0.6.0-alpha7'
|
||||||
|
|
||||||
//Java 19 is required for this version of the Project Panama preview/incubator feature
|
//Java 20 is required for this version of the Project Panama preview/incubator feature
|
||||||
java {
|
java {
|
||||||
toolchain {
|
toolchain {
|
||||||
languageVersion = JavaLanguageVersion.of(19)
|
languageVersion = JavaLanguageVersion.of(20)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,16 +197,16 @@ String targetWindowsX86_64 = 'windows-x86_64-v' + version
|
|||||||
* author's development environment, but can be changed to your environment if you want to use this build pattern.
|
* author's development environment, but can be changed to your environment if you want to use this build pattern.
|
||||||
*/
|
*/
|
||||||
String jdk_base = '/home/denny/java_jdks/'
|
String jdk_base = '/home/denny/java_jdks/'
|
||||||
String jdk_linux_aarch64 = jdk_base + 'linux-arm64/jdk-19.0.1-full'
|
String jdk_linux_aarch64 = jdk_base + 'linux-arm64/jdk-20.0.1-full'
|
||||||
String jdk_linux_x86_64 = jdk_base + 'linux-x64/jdk-19.0.1-full'
|
String jdk_linux_x86_64 = jdk_base + 'linux-x64/jdk-20.0.1-full'
|
||||||
String jdk_osx_x86_64 = jdk_base + 'osx-x64/jdk-19.0.1-full.jdk'
|
String jdk_osx_x86_64 = jdk_base + 'osx-x64/jdk-20.0.1-full.jdk'
|
||||||
String jdk_osx_aarch64 = jdk_base + 'osx-arm64/jdk-19.0.1-full.jdk'
|
String jdk_osx_aarch64 = jdk_base + 'osx-arm64/jdk-20.0.1-full.jdk'
|
||||||
String jdk_windows_x86_64 = jdk_base + 'windows-x64/jdk-19.0.1-full'
|
String jdk_windows_x86_64 = jdk_base + 'windows-x64/jdk-20.0.1-full'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Download URLs to download the JDK as part of the gradle build packaging process
|
* Download URLs to download the JDK as part of the gradle build packaging process
|
||||||
*/
|
*/
|
||||||
def jdk_download_base = "https://download.bell-sw.com/java/19.0.1+11/bellsoft-jdk19.0.1+11-"
|
def jdk_download_base = "https://download.bell-sw.com/java/20.0.1+10/bellsoft-jdk20.0.1+10-"
|
||||||
def jdk_download_suffix = "-full.tar.gz"
|
def jdk_download_suffix = "-full.tar.gz"
|
||||||
def jdk_download_linux_aarch64 = jdk_download_base + "linux-aarch64" + jdk_download_suffix
|
def jdk_download_linux_aarch64 = jdk_download_base + "linux-aarch64" + jdk_download_suffix
|
||||||
def jdk_download_linux_x86_64 = jdk_download_base + "linux-amd64" + jdk_download_suffix
|
def jdk_download_linux_x86_64 = jdk_download_base + "linux-amd64" + jdk_download_suffix
|
||||||
|
|||||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# ******************************************************************************
|
# ******************************************************************************
|
||||||
# Copyright (C) 2014-2022 Dennis Sheirer
|
# Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ public class TunerFactory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case default:
|
default:
|
||||||
mLog.warn("Unrecognized SDRplay RSP Device Type: " + device.getDeviceType() + " SER#: " + device.getSerialNumber());
|
mLog.warn("Unrecognized SDRplay RSP Device Type: " + device.getDeviceType() + " SER#: " + device.getSerialNumber());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,37 @@
|
|||||||
SDRplay API 3.07
|
SDRplay API
|
||||||
Auto-created from sdrplay api header files using JDK 17 jextract tool:
|
|
||||||
|
|
||||||
|
All source class files are auto-created from sdrplay api header files using JDK 20 jextract tool:
|
||||||
|
|
||||||
|
Version 3.07 is the oldest supported version. Versions 3.08 through 3.11 are all functionally equivalent.
|
||||||
|
|
||||||
|
We use the JDK 20 jextract tool to generate java source files from the API include files that are
|
||||||
|
located in the /arctifacts directory.
|
||||||
|
|
||||||
|
With each new JDK release where they change something about the Foreign Function api, we have to regenerate
|
||||||
|
the java source files. My approach is to generate the java files into the source code directories alongside
|
||||||
|
the existing source files and then delete the existing files and rename the parent version package to the
|
||||||
|
same as was used by the existing classes so that we don't cause problems in any of the derivative classes.
|
||||||
|
|
||||||
|
If you need to find the SDRPlay API header/include files:
|
||||||
1. Install the sdrplay api
|
1. Install the sdrplay api
|
||||||
2. On Linux, headers are located here: /usr/local/include/*.h
|
2. On Linux, headers are located here: /usr/local/include/*.h
|
||||||
3. cd into the (project)/jSDRplay/sdrplay-api/src/main/java/ directory
|
3. On Windows, headers are located here: c:\Program Files\SDRPlay\api
|
||||||
4. Run: jextract -t io.github.dsheirer.sdrplay.api /usr/local/include/sdrplay_api.h -l libsdrplay_api --source
|
|
||||||
|
Generate Source Files from SDRPlay API Headers
|
||||||
|
- Download latest jextract tool and alias the jextract command.
|
||||||
|
- cd into the (project)/jSDRplay/sdrplay-api/src/main/java/ directory
|
||||||
|
|
||||||
|
Version 3.07
|
||||||
|
- cd into the same folder where the v3.07 header files are lcoated.
|
||||||
|
- jextract --source -t io.github.dsheirer.source.tuner.sdrplay.api.v3_08_1 -l libsdrplay_api --output ~/IdeaProjects/sdrtrunk/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_08_1/ sdrplay_api.h
|
||||||
|
- In the generated RuntimeHelper class, comment out this line: System.loadLibrary("libsdrplay_api");
|
||||||
|
|
||||||
|
Version 3.08
|
||||||
|
Note: API include files are from a windows 10 installer, with the windows DLL aspects commented out.
|
||||||
|
- cd into the same folder where the v3.08 header files are located.
|
||||||
|
- jextract --source -t io.github.dsheirer.source.tuner.sdrplay.api.v3_08_1 -l libsdrplay_api --output ~/IdeaProjects/sdrtrunk/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_08_1/ sdrplay_api.h
|
||||||
|
- In the generated RuntimeHelper class, comment out this line: System.loadLibrary("libsdrplay_api");
|
||||||
|
|
||||||
|
|
||||||
IntelliJ setup
|
IntelliJ setup
|
||||||
1. Run configuration
|
1. Run configuration
|
||||||
|
|||||||
@@ -36,9 +36,8 @@ import io.github.dsheirer.source.tuner.sdrplay.api.util.Flag;
|
|||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_DeviceT;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_DeviceT;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_ErrorInfoT;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_ErrorInfoT;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_h;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_h;
|
||||||
import java.lang.foreign.MemoryAddress;
|
import java.lang.foreign.Arena;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.ValueLayout;
|
import java.lang.foreign.ValueLayout;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -71,9 +70,9 @@ public class SDRplay
|
|||||||
private static final Logger mLog = LoggerFactory.getLogger(SDRplay.class);
|
private static final Logger mLog = LoggerFactory.getLogger(SDRplay.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Foreign memory allocation resource scope
|
* Foreign memory arenaallocation resource scope
|
||||||
*/
|
*/
|
||||||
private final MemorySession mGlobalMemorySession = MemorySession.global();
|
private final Arena mArena = Arena.openShared();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if libsdrplay_api.xx library was found and loaded.
|
* Indicates if libsdrplay_api.xx library was found and loaded.
|
||||||
@@ -89,7 +88,7 @@ public class SDRplay
|
|||||||
/**
|
/**
|
||||||
* Map of (reusable) callback functions for each device. Key value is the device handle memory address
|
* Map of (reusable) callback functions for each device. Key value is the device handle memory address
|
||||||
*/
|
*/
|
||||||
private final Map<MemoryAddress, CallbackFunctions> mDeviceCallbackFunctionsMap = new HashMap<>();
|
private final Map<MemorySegment, CallbackFunctions> mDeviceCallbackFunctionsMap = new HashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detected version of the API installed on the local system.
|
* Detected version of the API installed on the local system.
|
||||||
@@ -150,11 +149,11 @@ public class SDRplay
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Global Memory Session for this API instance
|
* Open Shared Memory Arena for this API instance
|
||||||
*/
|
*/
|
||||||
private MemorySession getGlobalMemorySession()
|
private Arena getArena()
|
||||||
{
|
{
|
||||||
return mGlobalMemorySession;
|
return mArena;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -220,9 +219,9 @@ public class SDRplay
|
|||||||
List<IDeviceStruct> deviceStructs = new ArrayList<>();
|
List<IDeviceStruct> deviceStructs = new ArrayList<>();
|
||||||
|
|
||||||
//Get a version-correct array of DeviceT structures
|
//Get a version-correct array of DeviceT structures
|
||||||
MemorySegment devicesArray = DeviceFactory.createDeviceArray(getVersion(), getGlobalMemorySession());
|
MemorySegment devicesArray = DeviceFactory.createDeviceArray(getVersion(), getArena());
|
||||||
|
|
||||||
MemorySegment deviceCount = getGlobalMemorySession().allocate(ValueLayout.JAVA_INT, 0);
|
MemorySegment deviceCount = getArena().allocate(ValueLayout.JAVA_INT, 0);
|
||||||
|
|
||||||
Status status = Status.fromValue(sdrplay_api_h.sdrplay_api_GetDevices(devicesArray, deviceCount,
|
Status status = Status.fromValue(sdrplay_api_h.sdrplay_api_GetDevices(devicesArray, deviceCount,
|
||||||
sdrplay_api_h.SDRPLAY_MAX_DEVICES()));
|
sdrplay_api_h.SDRPLAY_MAX_DEVICES()));
|
||||||
@@ -355,20 +354,20 @@ public class SDRplay
|
|||||||
* @param deviceHandle to device
|
* @param deviceHandle to device
|
||||||
* @return constructed device composite paramaters
|
* @return constructed device composite paramaters
|
||||||
*/
|
*/
|
||||||
public CompositeParameters getCompositeParameters(DeviceType deviceType, MemoryAddress deviceHandle) throws SDRPlayException
|
public CompositeParameters getCompositeParameters(DeviceType deviceType, MemorySegment deviceHandle) throws SDRPlayException
|
||||||
{
|
{
|
||||||
//Allocate a pointer that the api will fill with the memory address of the device parameters in memory.
|
//Allocate a pointer that the api will fill with the memory address of the device parameters in memory.
|
||||||
MemorySegment pointer = getGlobalMemorySession().allocate(ValueLayout.ADDRESS);
|
MemorySegment pointer = getArena().allocate(ValueLayout.ADDRESS);
|
||||||
Status status = Status.fromValue(sdrplay_api_h.sdrplay_api_GetDeviceParams(deviceHandle, pointer));
|
Status status = Status.fromValue(sdrplay_api_h.sdrplay_api_GetDeviceParams(deviceHandle, pointer));
|
||||||
|
|
||||||
if(status.success())
|
if(status.success())
|
||||||
{
|
{
|
||||||
//Get the memory address from the pointer's memory segment to where the structure is located
|
//Get the memory address from the pointer's memory segment to where the structure is located
|
||||||
MemoryAddress memoryAddress = pointer.get(ValueLayout.ADDRESS, 0);
|
MemorySegment memoryAddress = pointer.get(ValueLayout.ADDRESS, 0);
|
||||||
|
|
||||||
//The structure's memory is already allocated ... wrap a memory segment around it
|
//The structure's memory is already allocated ... wrap a memory segment around it
|
||||||
MemorySegment memorySegment = sdrplay_api_DeviceT.ofAddress(memoryAddress, mGlobalMemorySession);
|
MemorySegment memorySegment = sdrplay_api_DeviceT.ofAddress(memoryAddress, getArena().scope());
|
||||||
return CompositeParametersFactory.create(deviceType, memorySegment, mGlobalMemorySession);
|
return CompositeParametersFactory.create(deviceType, memorySegment, getArena());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -383,10 +382,10 @@ public class SDRplay
|
|||||||
* @param callbackFunctions to receive stream data from A and (optionally) B channels and events.
|
* @param callbackFunctions to receive stream data from A and (optionally) B channels and events.
|
||||||
* @throws SDRPlayException if the device is not selected of if unable to init the device
|
* @throws SDRPlayException if the device is not selected of if unable to init the device
|
||||||
*/
|
*/
|
||||||
private void init(MemoryAddress deviceHandle, MemorySegment callbackFunctions) throws SDRPlayException
|
private void init(MemorySegment deviceHandle, MemorySegment callbackFunctions) throws SDRPlayException
|
||||||
{
|
{
|
||||||
//Since we don't need/use the callback context ... setup as a pointer to the callback functions
|
//Since we don't need/use the callback context ... setup as a pointer to the callback functions
|
||||||
MemorySegment contextPointer = getGlobalMemorySession().allocate(ValueLayout.ADDRESS, callbackFunctions);
|
MemorySegment contextPointer = getArena().allocate(ValueLayout.ADDRESS, callbackFunctions);
|
||||||
Status status = Status.fromValue(sdrplay_api_h.sdrplay_api_Init(deviceHandle, callbackFunctions, contextPointer));
|
Status status = Status.fromValue(sdrplay_api_h.sdrplay_api_Init(deviceHandle, callbackFunctions, contextPointer));
|
||||||
|
|
||||||
if(!status.success())
|
if(!status.success())
|
||||||
@@ -404,14 +403,14 @@ public class SDRplay
|
|||||||
* @param streamListener to receive samples for stream A
|
* @param streamListener to receive samples for stream A
|
||||||
* @throws SDRPlayException if the device is not selected of if unable to init the device
|
* @throws SDRPlayException if the device is not selected of if unable to init the device
|
||||||
*/
|
*/
|
||||||
public void initA(Device device, MemoryAddress deviceHandle, IDeviceEventListener eventListener,
|
public void initA(Device device, MemorySegment deviceHandle, IDeviceEventListener eventListener,
|
||||||
IStreamListener streamListener) throws SDRPlayException
|
IStreamListener streamListener) throws SDRPlayException
|
||||||
{
|
{
|
||||||
CallbackFunctions callbackFunctions = mDeviceCallbackFunctionsMap.get(deviceHandle);
|
CallbackFunctions callbackFunctions = mDeviceCallbackFunctionsMap.get(deviceHandle);
|
||||||
|
|
||||||
if(callbackFunctions == null)
|
if(callbackFunctions == null)
|
||||||
{
|
{
|
||||||
callbackFunctions = new CallbackFunctions(getGlobalMemorySession(), eventListener, streamListener,
|
callbackFunctions = new CallbackFunctions(getArena(), eventListener, streamListener,
|
||||||
device.getStreamCallbackListener());
|
device.getStreamCallbackListener());
|
||||||
mDeviceCallbackFunctionsMap.put(deviceHandle, callbackFunctions);
|
mDeviceCallbackFunctionsMap.put(deviceHandle, callbackFunctions);
|
||||||
}
|
}
|
||||||
@@ -433,14 +432,14 @@ public class SDRplay
|
|||||||
* @param streamListener to receive samples for stream B
|
* @param streamListener to receive samples for stream B
|
||||||
* @throws SDRPlayException if the device is not selected of if unable to init the device
|
* @throws SDRPlayException if the device is not selected of if unable to init the device
|
||||||
*/
|
*/
|
||||||
public void initB(Device device, MemoryAddress deviceHandle, IDeviceEventListener eventListener,
|
public void initB(Device device, MemorySegment deviceHandle, IDeviceEventListener eventListener,
|
||||||
IStreamListener streamListener) throws SDRPlayException
|
IStreamListener streamListener) throws SDRPlayException
|
||||||
{
|
{
|
||||||
CallbackFunctions callbackFunctions = mDeviceCallbackFunctionsMap.get(deviceHandle);
|
CallbackFunctions callbackFunctions = mDeviceCallbackFunctionsMap.get(deviceHandle);
|
||||||
|
|
||||||
if(callbackFunctions == null)
|
if(callbackFunctions == null)
|
||||||
{
|
{
|
||||||
callbackFunctions = new CallbackFunctions(getGlobalMemorySession(), eventListener, streamListener, streamListener,
|
callbackFunctions = new CallbackFunctions(getArena(), eventListener, streamListener, streamListener,
|
||||||
device.getStreamCallbackListener());
|
device.getStreamCallbackListener());
|
||||||
mDeviceCallbackFunctionsMap.put(deviceHandle, callbackFunctions);
|
mDeviceCallbackFunctionsMap.put(deviceHandle, callbackFunctions);
|
||||||
}
|
}
|
||||||
@@ -459,7 +458,7 @@ public class SDRplay
|
|||||||
* @param deviceHandle to the device
|
* @param deviceHandle to the device
|
||||||
* @throws SDRPlayException if error during uninit or if device is not selected
|
* @throws SDRPlayException if error during uninit or if device is not selected
|
||||||
*/
|
*/
|
||||||
public void uninit(MemoryAddress deviceHandle) throws SDRPlayException
|
public void uninit(MemorySegment deviceHandle) throws SDRPlayException
|
||||||
{
|
{
|
||||||
Status status = Status.fromValue(sdrplay_api_h.sdrplay_api_Uninit(deviceHandle));
|
Status status = Status.fromValue(sdrplay_api_h.sdrplay_api_Uninit(deviceHandle));
|
||||||
|
|
||||||
@@ -482,7 +481,7 @@ public class SDRplay
|
|||||||
* @param updateReasons identifying what was updated
|
* @param updateReasons identifying what was updated
|
||||||
* @throws SDRPlayException if the device is not selected, or if unable to update the device parameters
|
* @throws SDRPlayException if the device is not selected, or if unable to update the device parameters
|
||||||
*/
|
*/
|
||||||
public synchronized void update(Device device, MemoryAddress deviceHandle, TunerSelect tunerSelect,
|
public synchronized void update(Device device, MemorySegment deviceHandle, TunerSelect tunerSelect,
|
||||||
UpdateReason... updateReasons) throws SDRPlayException
|
UpdateReason... updateReasons) throws SDRPlayException
|
||||||
{
|
{
|
||||||
int reasons = UpdateReason.getReasons(updateReasons);
|
int reasons = UpdateReason.getReasons(updateReasons);
|
||||||
@@ -505,8 +504,8 @@ public class SDRplay
|
|||||||
*/
|
*/
|
||||||
private ErrorInformation getLastError(MemorySegment deviceSegment)
|
private ErrorInformation getLastError(MemorySegment deviceSegment)
|
||||||
{
|
{
|
||||||
MemoryAddress errorAddress = sdrplay_api_h.sdrplay_api_GetLastError(deviceSegment);
|
MemorySegment errorAddress = sdrplay_api_h.sdrplay_api_GetLastError(deviceSegment);
|
||||||
MemorySegment errorSegment = sdrplay_api_ErrorInfoT.ofAddress(errorAddress, mGlobalMemorySession);
|
MemorySegment errorSegment = sdrplay_api_ErrorInfoT.ofAddress(errorAddress, getArena().scope());
|
||||||
return new ErrorInformation(errorSegment);
|
return new ErrorInformation(errorSegment);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -517,7 +516,7 @@ public class SDRplay
|
|||||||
* @param debugLevel to set
|
* @param debugLevel to set
|
||||||
* @throws SDRPlayException if the device is not selected or if unable to set/change the debug level.
|
* @throws SDRPlayException if the device is not selected or if unable to set/change the debug level.
|
||||||
*/
|
*/
|
||||||
public void setDebugLevel(MemoryAddress deviceHandle, DebugLevel debugLevel) throws SDRPlayException
|
public void setDebugLevel(MemorySegment deviceHandle, DebugLevel debugLevel) throws SDRPlayException
|
||||||
{
|
{
|
||||||
Status status = Status.UNKNOWN;
|
Status status = Status.UNKNOWN;
|
||||||
|
|
||||||
@@ -603,7 +602,7 @@ public class SDRplay
|
|||||||
{
|
{
|
||||||
if(mSdrplayLibraryLoaded)
|
if(mSdrplayLibraryLoaded)
|
||||||
{
|
{
|
||||||
MemorySegment apiVersion = getGlobalMemorySession().allocate(ValueLayout.JAVA_FLOAT, 0);
|
MemorySegment apiVersion = getArena().allocate(ValueLayout.JAVA_FLOAT, 0);
|
||||||
Status status = Status.fromValue(sdrplay_api_h.sdrplay_api_ApiVersion(apiVersion));
|
Status status = Status.fromValue(sdrplay_api_h.sdrplay_api_ApiVersion(apiVersion));
|
||||||
if(status.success())
|
if(status.success())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ package io.github.dsheirer.source.tuner.sdrplay.api.callback;
|
|||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_CallbackFnsT;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_CallbackFnsT;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_EventCallback_t;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_EventCallback_t;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_StreamCallback_t;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_StreamCallback_t;
|
||||||
|
import java.lang.foreign.Arena;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback functions (sdrplay_api_CallbackFnsT) factory
|
* Callback functions (sdrplay_api_CallbackFnsT) factory
|
||||||
@@ -37,57 +37,57 @@ public class CallbackFunctions
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a callback functions for single-tuner use.
|
* Constructs a callback functions for single-tuner use.
|
||||||
* @param memorySession for native memory allocation
|
* @param arena for native memory allocation
|
||||||
* @param deviceEventListener for device events
|
* @param deviceEventListener for device events
|
||||||
* @param streamListener for streaming samples
|
* @param streamListener for streaming samples
|
||||||
* @param streamCallbackListener for streaming events
|
* @param streamCallbackListener for streaming events
|
||||||
*/
|
*/
|
||||||
public CallbackFunctions(MemorySession memorySession, IDeviceEventListener deviceEventListener,
|
public CallbackFunctions(Arena arena, IDeviceEventListener deviceEventListener,
|
||||||
IStreamListener streamListener, IStreamCallbackListener streamCallbackListener)
|
IStreamListener streamListener, IStreamCallbackListener streamCallbackListener)
|
||||||
{
|
{
|
||||||
//Create the event callback function
|
//Create the event callback function
|
||||||
mDeviceEventAdapter = new DeviceEventAdapter(memorySession, deviceEventListener);
|
mDeviceEventAdapter = new DeviceEventAdapter(arena, deviceEventListener);
|
||||||
MemorySegment eventFunction = sdrplay_api_EventCallback_t.allocate(mDeviceEventAdapter, memorySession);
|
MemorySegment eventFunction = sdrplay_api_EventCallback_t.allocate(mDeviceEventAdapter, arena.scope());
|
||||||
|
|
||||||
//Create the stream A callback function
|
//Create the stream A callback function
|
||||||
mStreamACallbackAdapter = new StreamCallbackAdapter(memorySession, streamListener, streamCallbackListener);
|
mStreamACallbackAdapter = new StreamCallbackAdapter(arena, streamListener, streamCallbackListener);
|
||||||
MemorySegment streamAFunction = sdrplay_api_StreamCallback_t.allocate(mStreamACallbackAdapter, memorySession);
|
MemorySegment streamAFunction = sdrplay_api_StreamCallback_t.allocate(mStreamACallbackAdapter, arena.scope());
|
||||||
|
|
||||||
//Create the callback functions union and populate the callback functions
|
//Create the callback functions union and populate the callback functions
|
||||||
mCallbackFunctionsMemorySegment = sdrplay_api_CallbackFnsT.allocate(memorySession);
|
mCallbackFunctionsMemorySegment = sdrplay_api_CallbackFnsT.allocate(arena);
|
||||||
sdrplay_api_CallbackFnsT.EventCbFn$set(mCallbackFunctionsMemorySegment, eventFunction.address());
|
sdrplay_api_CallbackFnsT.EventCbFn$set(mCallbackFunctionsMemorySegment, eventFunction);
|
||||||
sdrplay_api_CallbackFnsT.StreamACbFn$set(mCallbackFunctionsMemorySegment, streamAFunction.address());
|
sdrplay_api_CallbackFnsT.StreamACbFn$set(mCallbackFunctionsMemorySegment, streamAFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a callback functions for dual-tuner use.
|
* Constructs a callback functions for dual-tuner use.
|
||||||
* @param memorySession for native memory allocation
|
* @param arena for native memory allocation
|
||||||
* @param deviceEventListener for device events
|
* @param deviceEventListener for device events
|
||||||
* @param streamAListener for streaming samples from the master tuner
|
* @param streamAListener for streaming samples from the master tuner
|
||||||
* @param streamBListener for streaming samples from the slave tuner
|
* @param streamBListener for streaming samples from the slave tuner
|
||||||
* @param streamCallbackListener for streaming events
|
* @param streamCallbackListener for streaming events
|
||||||
*/
|
*/
|
||||||
public CallbackFunctions(MemorySession memorySession, IDeviceEventListener deviceEventListener,
|
public CallbackFunctions(Arena arena, IDeviceEventListener deviceEventListener,
|
||||||
IStreamListener streamAListener, IStreamListener streamBListener,
|
IStreamListener streamAListener, IStreamListener streamBListener,
|
||||||
IStreamCallbackListener streamCallbackListener)
|
IStreamCallbackListener streamCallbackListener)
|
||||||
{
|
{
|
||||||
//Create the event callback function
|
//Create the event callback function
|
||||||
mDeviceEventAdapter = new DeviceEventAdapter(memorySession, deviceEventListener);
|
mDeviceEventAdapter = new DeviceEventAdapter(arena, deviceEventListener);
|
||||||
MemorySegment eventFunction = sdrplay_api_EventCallback_t.allocate(mDeviceEventAdapter, memorySession);
|
MemorySegment eventFunction = sdrplay_api_EventCallback_t.allocate(mDeviceEventAdapter, arena.scope());
|
||||||
|
|
||||||
//Create the stream A callback function
|
//Create the stream A callback function
|
||||||
mStreamACallbackAdapter = new StreamCallbackAdapter(memorySession, streamAListener, streamCallbackListener);
|
mStreamACallbackAdapter = new StreamCallbackAdapter(arena, streamAListener, streamCallbackListener);
|
||||||
MemorySegment streamAFunction = sdrplay_api_StreamCallback_t.allocate(mStreamACallbackAdapter, memorySession);
|
MemorySegment streamAFunction = sdrplay_api_StreamCallback_t.allocate(mStreamACallbackAdapter, arena.scope());
|
||||||
|
|
||||||
//Create the stream B callback function
|
//Create the stream B callback function
|
||||||
mStreamBCallbackAdapter = new StreamCallbackAdapter(memorySession, streamBListener, streamCallbackListener);
|
mStreamBCallbackAdapter = new StreamCallbackAdapter(arena, streamBListener, streamCallbackListener);
|
||||||
MemorySegment streamBFunction = sdrplay_api_StreamCallback_t.allocate(mStreamBCallbackAdapter, memorySession);
|
MemorySegment streamBFunction = sdrplay_api_StreamCallback_t.allocate(mStreamBCallbackAdapter, arena.scope());
|
||||||
|
|
||||||
//Create the callback functions union and populate the callback functions
|
//Create the callback functions union and populate the callback functions
|
||||||
mCallbackFunctionsMemorySegment = sdrplay_api_CallbackFnsT.allocate(memorySession);
|
mCallbackFunctionsMemorySegment = sdrplay_api_CallbackFnsT.allocate(arena);
|
||||||
sdrplay_api_CallbackFnsT.EventCbFn$set(mCallbackFunctionsMemorySegment, eventFunction.address());
|
sdrplay_api_CallbackFnsT.EventCbFn$set(mCallbackFunctionsMemorySegment, eventFunction);
|
||||||
sdrplay_api_CallbackFnsT.StreamACbFn$set(mCallbackFunctionsMemorySegment, streamAFunction.address());
|
sdrplay_api_CallbackFnsT.StreamACbFn$set(mCallbackFunctionsMemorySegment, streamAFunction);
|
||||||
sdrplay_api_CallbackFnsT.StreamBCbFn$set(mCallbackFunctionsMemorySegment, streamBFunction.address());
|
sdrplay_api_CallbackFnsT.StreamBCbFn$set(mCallbackFunctionsMemorySegment, streamBFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -24,9 +24,8 @@ import io.github.dsheirer.source.tuner.sdrplay.api.parameter.event.EventParamete
|
|||||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.event.EventType;
|
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.event.EventType;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_EventCallback_t;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_EventCallback_t;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_EventParamsT;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_EventParamsT;
|
||||||
import java.lang.foreign.MemoryAddress;
|
import java.lang.foreign.Arena;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -38,22 +37,22 @@ public class DeviceEventAdapter implements sdrplay_api_EventCallback_t
|
|||||||
{
|
{
|
||||||
private static final Logger mLog = LoggerFactory.getLogger(DeviceEventAdapter.class);
|
private static final Logger mLog = LoggerFactory.getLogger(DeviceEventAdapter.class);
|
||||||
|
|
||||||
private MemorySession mMemorySession;
|
private Arena mArena;
|
||||||
private IDeviceEventListener mDeviceEventListener;
|
private IDeviceEventListener mDeviceEventListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an instance.
|
* Constructs an instance.
|
||||||
* @param memorySession to use in creating foreign memory segments to access foreign structures.
|
* @param arena to use in creating foreign memory segments to access foreign structures.
|
||||||
* @param listener to receive translated device events.
|
* @param listener to receive translated device events.
|
||||||
*/
|
*/
|
||||||
public DeviceEventAdapter(MemorySession memorySession, IDeviceEventListener listener)
|
public DeviceEventAdapter(Arena arena, IDeviceEventListener listener)
|
||||||
{
|
{
|
||||||
if(memorySession == null)
|
if(arena == null)
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException("Resource scope must be non-null");
|
throw new IllegalArgumentException("Resource scope must be non-null");
|
||||||
}
|
}
|
||||||
|
|
||||||
mMemorySession = memorySession;
|
mArena = arena;
|
||||||
|
|
||||||
setListener(listener);
|
setListener(listener);
|
||||||
}
|
}
|
||||||
@@ -73,10 +72,10 @@ public class DeviceEventAdapter implements sdrplay_api_EventCallback_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply(int eventTypeId, int tunerSelectId, MemoryAddress eventParametersPointer,
|
public void apply(int eventTypeId, int tunerSelectId, MemorySegment eventParametersPointer,
|
||||||
MemoryAddress callbackContext)
|
MemorySegment callbackContext)
|
||||||
{
|
{
|
||||||
MemorySegment memorySegment = sdrplay_api_EventParamsT.ofAddress(eventParametersPointer, mMemorySession);
|
MemorySegment memorySegment = sdrplay_api_EventParamsT.ofAddress(eventParametersPointer, mArena.scope());
|
||||||
EventType eventType = EventType.fromValue(eventTypeId);
|
EventType eventType = EventType.fromValue(eventTypeId);
|
||||||
TunerSelect tunerSelect = TunerSelect.fromValue(tunerSelectId);
|
TunerSelect tunerSelect = TunerSelect.fromValue(tunerSelectId);
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,8 @@ package io.github.dsheirer.source.tuner.sdrplay.api.callback;
|
|||||||
import io.github.dsheirer.source.tuner.sdrplay.api.util.Flag;
|
import io.github.dsheirer.source.tuner.sdrplay.api.util.Flag;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_StreamCallback_t;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_StreamCallback_t;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_StreamCbParamsT;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_StreamCbParamsT;
|
||||||
import java.lang.foreign.MemoryAddress;
|
import java.lang.foreign.Arena;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.ValueLayout;
|
import java.lang.foreign.ValueLayout;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -36,25 +35,24 @@ import org.slf4j.LoggerFactory;
|
|||||||
public class StreamCallbackAdapter implements sdrplay_api_StreamCallback_t
|
public class StreamCallbackAdapter implements sdrplay_api_StreamCallback_t
|
||||||
{
|
{
|
||||||
private static final Logger mLog = LoggerFactory.getLogger(StreamCallbackAdapter.class);
|
private static final Logger mLog = LoggerFactory.getLogger(StreamCallbackAdapter.class);
|
||||||
private MemorySession mMemorySession;
|
private Arena mArena;
|
||||||
private IStreamListener mStreamListener;
|
private IStreamListener mStreamListener;
|
||||||
private IStreamCallbackListener mStreamCallbackListener;
|
private IStreamCallbackListener mStreamCallbackListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an instance of the callback implementation
|
* Constructs an instance of the callback implementation
|
||||||
* @param memorySession for defining new foreign memory segments
|
* @param arena for defining new foreign memory segments
|
||||||
* @param streamListener to receive transferred I/Q samples and event details
|
* @param streamListener to receive transferred I/Q samples and event details
|
||||||
* @param listener to receive callback parameters
|
* @param listener to receive callback parameters
|
||||||
*/
|
*/
|
||||||
public StreamCallbackAdapter(MemorySession memorySession, IStreamListener streamListener,
|
public StreamCallbackAdapter(Arena arena, IStreamListener streamListener, IStreamCallbackListener listener)
|
||||||
IStreamCallbackListener listener)
|
|
||||||
{
|
{
|
||||||
if(memorySession == null)
|
if(arena == null)
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException("Resource scope must be non-null");
|
throw new IllegalArgumentException("Arena must be non-null");
|
||||||
}
|
}
|
||||||
|
|
||||||
mMemorySession = memorySession;
|
mArena = arena;
|
||||||
mStreamCallbackListener = listener;
|
mStreamCallbackListener = listener;
|
||||||
setListener(streamListener);
|
setListener(streamListener);
|
||||||
}
|
}
|
||||||
@@ -78,14 +76,14 @@ public class StreamCallbackAdapter implements sdrplay_api_StreamCallback_t
|
|||||||
* @param deviceContext of the device that sourced the samples
|
* @param deviceContext of the device that sourced the samples
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void apply(MemoryAddress iSamplesPointer, MemoryAddress qSamplesPointer, MemoryAddress parametersPointer,
|
public void apply(MemorySegment iSamplesPointer, MemorySegment qSamplesPointer, MemorySegment parametersPointer,
|
||||||
int sampleCount, int reset, MemoryAddress deviceContext)
|
int sampleCount, int reset, MemorySegment deviceContext)
|
||||||
{
|
{
|
||||||
if(mStreamListener != null || mStreamCallbackListener != null)
|
if(mStreamListener != null || mStreamCallbackListener != null)
|
||||||
{
|
{
|
||||||
//Translate the callback parameters pointer to a memory segment and re-construct the parameters as a Java object
|
//Translate the callback parameters pointer to a memory segment and re-construct the parameters as a Java object
|
||||||
StreamCallbackParameters parameters = new StreamCallbackParameters(sdrplay_api_StreamCbParamsT
|
StreamCallbackParameters parameters = new StreamCallbackParameters(sdrplay_api_StreamCbParamsT
|
||||||
.ofAddress(parametersPointer, mMemorySession));
|
.ofAddress(parametersPointer, mArena.scope()));
|
||||||
|
|
||||||
if(mStreamCallbackListener != null)
|
if(mStreamCallbackListener != null)
|
||||||
{
|
{
|
||||||
@@ -96,8 +94,8 @@ public class StreamCallbackAdapter implements sdrplay_api_StreamCallback_t
|
|||||||
{
|
{
|
||||||
//Allocate memory segments from I/Q pointers, transfer from native to JVM array, and send to listener
|
//Allocate memory segments from I/Q pointers, transfer from native to JVM array, and send to listener
|
||||||
long arrayByteSize = ValueLayout.JAVA_SHORT.byteSize() * sampleCount;
|
long arrayByteSize = ValueLayout.JAVA_SHORT.byteSize() * sampleCount;
|
||||||
MemorySegment iSamples = MemorySegment.ofAddress(iSamplesPointer, arrayByteSize, mMemorySession);
|
MemorySegment iSamples = MemorySegment.ofAddress(iSamplesPointer.address(), arrayByteSize, mArena.scope());
|
||||||
MemorySegment qSamples = MemorySegment.ofAddress(qSamplesPointer, arrayByteSize, mMemorySession);
|
MemorySegment qSamples = MemorySegment.ofAddress(qSamplesPointer.address(), arrayByteSize, mArena.scope());
|
||||||
short[] i = iSamples.toArray(ValueLayout.JAVA_SHORT);
|
short[] i = iSamples.toArray(ValueLayout.JAVA_SHORT);
|
||||||
short[] q = qSamples.toArray(ValueLayout.JAVA_SHORT);
|
short[] q = qSamples.toArray(ValueLayout.JAVA_SHORT);
|
||||||
mStreamListener.processStream(i, q, parameters, Flag.evaluate(reset));
|
mStreamListener.processStream(i, q, parameters, Flag.evaluate(reset));
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ import io.github.dsheirer.source.tuner.sdrplay.api.error.DebugLevel;
|
|||||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite.CompositeParameters;
|
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite.CompositeParameters;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.IfMode;
|
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.LoMode;
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||||
@@ -377,7 +376,7 @@ public abstract class Device<T extends CompositeParameters<?,?>, R extends RspTu
|
|||||||
*
|
*
|
||||||
* @throws SDRPlayException if this method is accessed before the device has been successfully selected
|
* @throws SDRPlayException if this method is accessed before the device has been successfully selected
|
||||||
*/
|
*/
|
||||||
MemoryAddress getDeviceHandle() throws SDRPlayException
|
MemorySegment getDeviceHandle() throws SDRPlayException
|
||||||
{
|
{
|
||||||
if(!selected())
|
if(!selected())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
package io.github.dsheirer.source.tuner.sdrplay.api.device;
|
package io.github.dsheirer.source.tuner.sdrplay.api.device;
|
||||||
|
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_DeviceT;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_DeviceT;
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -92,7 +91,7 @@ public class DeviceStruct_v3_07 implements IDeviceStruct
|
|||||||
sdrplay_api_DeviceT.rspDuoSampleFreq$set(getDeviceMemorySegment(), frequency);
|
sdrplay_api_DeviceT.rspDuoSampleFreq$set(getDeviceMemorySegment(), frequency);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public MemoryAddress getDeviceHandle()
|
@Override public MemorySegment getDeviceHandle()
|
||||||
{
|
{
|
||||||
return sdrplay_api_DeviceT.dev$get(getDeviceMemorySegment());
|
return sdrplay_api_DeviceT.dev$get(getDeviceMemorySegment());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
package io.github.dsheirer.source.tuner.sdrplay.api.device;
|
package io.github.dsheirer.source.tuner.sdrplay.api.device;
|
||||||
|
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_08.sdrplay_api_DeviceT;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_08.sdrplay_api_DeviceT;
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -92,7 +91,7 @@ public class DeviceStruct_v3_08 implements IDeviceStruct
|
|||||||
sdrplay_api_DeviceT.rspDuoSampleFreq$set(getDeviceMemorySegment(), frequency);
|
sdrplay_api_DeviceT.rspDuoSampleFreq$set(getDeviceMemorySegment(), frequency);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public MemoryAddress getDeviceHandle()
|
@Override public MemorySegment getDeviceHandle()
|
||||||
{
|
{
|
||||||
return sdrplay_api_DeviceT.dev$get(getDeviceMemorySegment());
|
return sdrplay_api_DeviceT.dev$get(getDeviceMemorySegment());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.device;
|
package io.github.dsheirer.source.tuner.sdrplay.api.device;
|
||||||
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,5 +76,5 @@ public interface IDeviceStruct
|
|||||||
/**
|
/**
|
||||||
* Device handle. Note this is only available if the device has been selected.
|
* Device handle. Note this is only available if the device has been selected.
|
||||||
*/
|
*/
|
||||||
MemoryAddress getDeviceHandle();
|
MemorySegment getDeviceHandle();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,9 +28,8 @@ import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.TunerParamete
|
|||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_DevParamsT;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_DevParamsT;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_DeviceParamsT;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_DeviceParamsT;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_RxChannelParamsT;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_RxChannelParamsT;
|
||||||
import java.lang.foreign.MemoryAddress;
|
import java.lang.foreign.Arena;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Composite Device Parameters structure (sdrplay_api_DeviceParamsT) providing access to the device parameters and
|
* Composite Device Parameters structure (sdrplay_api_DeviceParamsT) providing access to the device parameters and
|
||||||
@@ -50,16 +49,16 @@ public class CompositeParameters<D extends DeviceParameters, T extends TunerPara
|
|||||||
*
|
*
|
||||||
* @param deviceType to create
|
* @param deviceType to create
|
||||||
* @param memorySegment for the composite structure in foreign memory
|
* @param memorySegment for the composite structure in foreign memory
|
||||||
* @param memorySession for allocating additional memory segments for the sub-structures.
|
* @param arena for allocating additional memory segments for the sub-structures.
|
||||||
*/
|
*/
|
||||||
public CompositeParameters(DeviceType deviceType, MemorySegment memorySegment, MemorySession memorySession)
|
public CompositeParameters(DeviceType deviceType, MemorySegment memorySegment, Arena arena)
|
||||||
{
|
{
|
||||||
MemoryAddress parametersMemoryAddress = sdrplay_api_DeviceParamsT.devParams$get(memorySegment);
|
MemorySegment parametersMemoryAddress = sdrplay_api_DeviceParamsT.devParams$get(memorySegment);
|
||||||
MemorySegment parametersMemorySegment = sdrplay_api_DevParamsT.ofAddress(parametersMemoryAddress, memorySession);
|
MemorySegment parametersMemorySegment = sdrplay_api_DevParamsT.ofAddress(parametersMemoryAddress, arena.scope());
|
||||||
mDeviceParameters = (D) DeviceParametersFactory.create(deviceType, parametersMemorySegment);
|
mDeviceParameters = (D) DeviceParametersFactory.create(deviceType, parametersMemorySegment);
|
||||||
|
|
||||||
MemoryAddress memoryAddressRxA = sdrplay_api_DeviceParamsT.rxChannelA$get(memorySegment);
|
MemorySegment memoryAddressRxA = sdrplay_api_DeviceParamsT.rxChannelA$get(memorySegment);
|
||||||
MemorySegment memorySegmentRxA = sdrplay_api_RxChannelParamsT.ofAddress(memoryAddressRxA, memorySession);
|
MemorySegment memorySegmentRxA = sdrplay_api_RxChannelParamsT.ofAddress(memoryAddressRxA, arena.scope());
|
||||||
mTunerAParameters = (T) TunerParametersFactory.create(deviceType, memorySegmentRxA);
|
mTunerAParameters = (T) TunerParametersFactory.create(deviceType, memorySegmentRxA);
|
||||||
|
|
||||||
MemorySegment tunerAControlParametersMemorySegment = sdrplay_api_RxChannelParamsT.ctrlParams$slice(memorySegmentRxA);
|
MemorySegment tunerAControlParametersMemorySegment = sdrplay_api_RxChannelParamsT.ctrlParams$slice(memorySegmentRxA);
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite;
|
package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite;
|
||||||
|
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
||||||
|
import java.lang.foreign.Arena;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a composite parameters instance for a device type
|
* Creates a composite parameters instance for a device type
|
||||||
@@ -32,27 +32,27 @@ public class CompositeParametersFactory
|
|||||||
* Creates a composite parameters instance for the specified device type
|
* Creates a composite parameters instance for the specified device type
|
||||||
* @param deviceType to create
|
* @param deviceType to create
|
||||||
* @param memorySegment of foreign memory structure for the composite parameters
|
* @param memorySegment of foreign memory structure for the composite parameters
|
||||||
* @param memorySession to allocate additional memory structures
|
* @param arena to allocate additional memory structures
|
||||||
* @return instance
|
* @return instance
|
||||||
*/
|
*/
|
||||||
public static CompositeParameters create(DeviceType deviceType, MemorySegment memorySegment, MemorySession memorySession)
|
public static CompositeParameters create(DeviceType deviceType, MemorySegment memorySegment, Arena arena)
|
||||||
{
|
{
|
||||||
switch(deviceType)
|
switch(deviceType)
|
||||||
{
|
{
|
||||||
case RSP1 -> {
|
case RSP1 -> {
|
||||||
return new Rsp1CompositeParameters(memorySegment, memorySession);
|
return new Rsp1CompositeParameters(memorySegment, arena);
|
||||||
}
|
}
|
||||||
case RSP1A -> {
|
case RSP1A -> {
|
||||||
return new Rsp1aCompositeParameters(memorySegment, memorySession);
|
return new Rsp1aCompositeParameters(memorySegment, arena);
|
||||||
}
|
}
|
||||||
case RSP2 -> {
|
case RSP2 -> {
|
||||||
return new Rsp2CompositeParameters(memorySegment, memorySession);
|
return new Rsp2CompositeParameters(memorySegment, arena);
|
||||||
}
|
}
|
||||||
case RSPduo -> {
|
case RSPduo -> {
|
||||||
return new RspDuoCompositeParameters(memorySegment, memorySession);
|
return new RspDuoCompositeParameters(memorySegment, arena);
|
||||||
}
|
}
|
||||||
case RSPdx -> {
|
case RSPdx -> {
|
||||||
return new RspDxCompositeParameters(memorySegment, memorySession);
|
return new RspDxCompositeParameters(memorySegment, arena);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite;
|
|||||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
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.device.Rsp1DeviceParameters;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp1TunerParameters;
|
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp1TunerParameters;
|
||||||
|
import java.lang.foreign.Arena;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RSP1 Composite parameters (device and tuner)
|
* RSP1 Composite parameters (device and tuner)
|
||||||
@@ -34,10 +34,10 @@ public class Rsp1CompositeParameters extends CompositeParameters<Rsp1DeviceParam
|
|||||||
* Constructs an instance from the foreign memory segment
|
* Constructs an instance from the foreign memory segment
|
||||||
*
|
*
|
||||||
* @param memorySegment for the composite structure in foreign memory
|
* @param memorySegment for the composite structure in foreign memory
|
||||||
* @param memorySession for allocating additional memory segments for the sub-structures.
|
* @param arena for allocating additional memory segments for the sub-structures.
|
||||||
*/
|
*/
|
||||||
public Rsp1CompositeParameters(MemorySegment memorySegment, MemorySession memorySession)
|
public Rsp1CompositeParameters(MemorySegment memorySegment, Arena arena)
|
||||||
{
|
{
|
||||||
super(DeviceType.RSP1, memorySegment, memorySession);
|
super(DeviceType.RSP1, memorySegment, arena);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite;
|
|||||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
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.device.Rsp1aDeviceParameters;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp1aTunerParameters;
|
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp1aTunerParameters;
|
||||||
|
import java.lang.foreign.Arena;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RSP1A Composite parameters (device and tuner)
|
* RSP1A Composite parameters (device and tuner)
|
||||||
@@ -34,10 +34,10 @@ public class Rsp1aCompositeParameters extends CompositeParameters<Rsp1aDevicePar
|
|||||||
* Constructs an instance from the foreign memory segment
|
* Constructs an instance from the foreign memory segment
|
||||||
*
|
*
|
||||||
* @param memorySegment for the composite structure in foreign memory
|
* @param memorySegment for the composite structure in foreign memory
|
||||||
* @param memorySession for allocating additional memory segments for the sub-structures.
|
* @param arena for allocating additional memory segments for the sub-structures.
|
||||||
*/
|
*/
|
||||||
public Rsp1aCompositeParameters(MemorySegment memorySegment, MemorySession memorySession)
|
public Rsp1aCompositeParameters(MemorySegment memorySegment, Arena arena)
|
||||||
{
|
{
|
||||||
super(DeviceType.RSP1A, memorySegment, memorySession);
|
super(DeviceType.RSP1A, memorySegment, arena);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite;
|
|||||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
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.device.Rsp2DeviceParameters;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp2TunerParameters;
|
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp2TunerParameters;
|
||||||
|
import java.lang.foreign.Arena;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RSP2 Composite parameters (device and tuner)
|
* RSP2 Composite parameters (device and tuner)
|
||||||
@@ -34,10 +34,10 @@ public class Rsp2CompositeParameters extends CompositeParameters<Rsp2DeviceParam
|
|||||||
* Constructs an instance from the foreign memory segment
|
* Constructs an instance from the foreign memory segment
|
||||||
*
|
*
|
||||||
* @param memorySegment for the composite structure in foreign memory
|
* @param memorySegment for the composite structure in foreign memory
|
||||||
* @param memorySession for allocating additional memory segments for the sub-structures.
|
* @param arena for allocating additional memory segments for the sub-structures.
|
||||||
*/
|
*/
|
||||||
public Rsp2CompositeParameters(MemorySegment memorySegment, MemorySession memorySession)
|
public Rsp2CompositeParameters(MemorySegment memorySegment, Arena arena)
|
||||||
{
|
{
|
||||||
super(DeviceType.RSP2, memorySegment, memorySession);
|
super(DeviceType.RSP2, memorySegment, arena);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,9 +26,8 @@ import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.RspDuoTunerPa
|
|||||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.TunerParametersFactory;
|
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.TunerParametersFactory;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_DeviceParamsT;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_DeviceParamsT;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_RxChannelParamsT;
|
import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_RxChannelParamsT;
|
||||||
import java.lang.foreign.MemoryAddress;
|
import java.lang.foreign.Arena;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RSPduo Composite parameters (device and two tuners)
|
* RSPduo Composite parameters (device and two tuners)
|
||||||
@@ -42,14 +41,14 @@ public class RspDuoCompositeParameters extends CompositeParameters<RspDuoDeviceP
|
|||||||
* Constructs an instance from the foreign memory segment
|
* Constructs an instance from the foreign memory segment
|
||||||
*
|
*
|
||||||
* @param memorySegment for the composite structure in foreign memory
|
* @param memorySegment for the composite structure in foreign memory
|
||||||
* @param memorySession for allocating additional memory segments for the sub-structures.
|
* @param arena for allocating additional memory segments for the sub-structures.
|
||||||
*/
|
*/
|
||||||
public RspDuoCompositeParameters(MemorySegment memorySegment, MemorySession memorySession)
|
public RspDuoCompositeParameters(MemorySegment memorySegment, Arena arena)
|
||||||
{
|
{
|
||||||
super(DeviceType.RSPduo, memorySegment, memorySession);
|
super(DeviceType.RSPduo, memorySegment, arena);
|
||||||
|
|
||||||
MemoryAddress memoryAddressRxB = sdrplay_api_DeviceParamsT.rxChannelB$get(memorySegment);
|
MemorySegment memoryAddressRxB = sdrplay_api_DeviceParamsT.rxChannelB$get(memorySegment);
|
||||||
MemorySegment memorySegmentRxB = sdrplay_api_RxChannelParamsT.ofAddress(memoryAddressRxB, memorySession);
|
MemorySegment memorySegmentRxB = sdrplay_api_RxChannelParamsT.ofAddress(memoryAddressRxB, arena.scope());
|
||||||
mTunerBParameters = (RspDuoTunerParameters) TunerParametersFactory.create(DeviceType.RSPduo, memorySegmentRxB);
|
mTunerBParameters = (RspDuoTunerParameters) TunerParametersFactory.create(DeviceType.RSPduo, memorySegmentRxB);
|
||||||
|
|
||||||
MemorySegment tunerBControlParametersMemorySegment = sdrplay_api_RxChannelParamsT.ctrlParams$slice(memorySegmentRxB);
|
MemorySegment tunerBControlParametersMemorySegment = sdrplay_api_RxChannelParamsT.ctrlParams$slice(memorySegmentRxB);
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite;
|
|||||||
import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType;
|
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.device.RspDxDeviceParameters;
|
||||||
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.RspDxTunerParameters;
|
import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.RspDxTunerParameters;
|
||||||
|
import java.lang.foreign.Arena;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RSPdx Composite parameters (device and receiver)
|
* RSPdx Composite parameters (device and receiver)
|
||||||
@@ -34,10 +34,10 @@ public class RspDxCompositeParameters extends CompositeParameters<RspDxDevicePar
|
|||||||
* Constructs an instance from the foreign memory segment
|
* Constructs an instance from the foreign memory segment
|
||||||
*
|
*
|
||||||
* @param memorySegment for the composite structure in foreign memory
|
* @param memorySegment for the composite structure in foreign memory
|
||||||
* @param memorySession for allocating additional memory segments for the sub-structures.
|
* @param arena for allocating additional memory segments for the sub-structures.
|
||||||
*/
|
*/
|
||||||
public RspDxCompositeParameters(MemorySegment memorySegment, MemorySession memorySession)
|
public RspDxCompositeParameters(MemorySegment memorySegment, Arena arena)
|
||||||
{
|
{
|
||||||
super(DeviceType.RSPdx, memorySegment, memorySession);
|
super(DeviceType.RSPdx, memorySegment, arena);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,17 +37,19 @@ import static java.lang.foreign.ValueLayout.OfFloat;
|
|||||||
import static java.lang.foreign.ValueLayout.OfInt;
|
import static java.lang.foreign.ValueLayout.OfInt;
|
||||||
import static java.lang.foreign.ValueLayout.OfLong;
|
import static java.lang.foreign.ValueLayout.OfLong;
|
||||||
import static java.lang.foreign.ValueLayout.OfShort;
|
import static java.lang.foreign.ValueLayout.OfShort;
|
||||||
public class Constants$root {
|
final class Constants$root {
|
||||||
|
|
||||||
static final OfBoolean C_BOOL$LAYOUT = JAVA_BOOLEAN;
|
// Suppresses default constructor, ensuring non-instantiability.
|
||||||
static final OfByte C_CHAR$LAYOUT = JAVA_BYTE;
|
private Constants$root() {}
|
||||||
static final OfShort C_SHORT$LAYOUT = JAVA_SHORT.withBitAlignment(16);
|
static final OfBoolean C_BOOL$LAYOUT = JAVA_BOOLEAN;
|
||||||
static final OfInt C_INT$LAYOUT = JAVA_INT.withBitAlignment(32);
|
static final OfByte C_CHAR$LAYOUT = JAVA_BYTE;
|
||||||
static final OfInt C_LONG$LAYOUT = JAVA_INT.withBitAlignment(32);
|
static final OfShort C_SHORT$LAYOUT = JAVA_SHORT;
|
||||||
static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG.withBitAlignment(64);
|
static final OfInt C_INT$LAYOUT = JAVA_INT;
|
||||||
static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT.withBitAlignment(32);
|
static final OfLong C_LONG$LAYOUT = JAVA_LONG;
|
||||||
static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE.withBitAlignment(64);
|
static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG;
|
||||||
static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64);
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,15 +20,13 @@
|
|||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
// Generated by jextract
|
// Generated by jextract
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
|
||||||
import java.lang.foreign.FunctionDescriptor;
|
import java.lang.foreign.FunctionDescriptor;
|
||||||
import java.lang.foreign.GroupLayout;
|
import java.lang.foreign.GroupLayout;
|
||||||
import java.lang.foreign.Linker;
|
import java.lang.foreign.Linker;
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
import java.lang.foreign.SymbolLookup;
|
import java.lang.foreign.SymbolLookup;
|
||||||
import java.lang.foreign.ValueLayout;
|
import java.lang.foreign.ValueLayout;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
@@ -41,21 +39,24 @@ import static java.lang.foreign.ValueLayout.JAVA_LONG;
|
|||||||
|
|
||||||
final class RuntimeHelper {
|
final class RuntimeHelper {
|
||||||
|
|
||||||
private RuntimeHelper() {}
|
private static final Linker LINKER = Linker.nativeLinker();
|
||||||
private final static Linker LINKER = Linker.nativeLinker();
|
private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader();
|
||||||
private final static ClassLoader LOADER = RuntimeHelper.class.getClassLoader();
|
private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup();
|
||||||
private final static MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup();
|
private static final SymbolLookup SYMBOL_LOOKUP;
|
||||||
private final static SymbolLookup SYMBOL_LOOKUP;
|
private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); };
|
||||||
|
|
||||||
final static SegmentAllocator CONSTANT_ALLOCATOR =
|
final static SegmentAllocator CONSTANT_ALLOCATOR =
|
||||||
(size, align) -> MemorySegment.allocateNative(size, align, MemorySession.openImplicit());
|
(size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto());
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// System.loadLibrary("libsdrplay_api");
|
// System.loadLibrary("libsdrplay_api");
|
||||||
SymbolLookup loaderLookup = SymbolLookup.loaderLookup();
|
SymbolLookup loaderLookup = SymbolLookup.loaderLookup();
|
||||||
SYMBOL_LOOKUP = name -> loaderLookup.lookup(name).or(() -> LINKER.defaultLookup().lookup(name));
|
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) {
|
static <T> T requireNonNull(T obj, String symbolName) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName);
|
throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName);
|
||||||
@@ -63,45 +64,50 @@ final class RuntimeHelper {
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final static SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); };
|
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 final MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) {
|
|
||||||
return SYMBOL_LOOKUP.lookup(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), MemorySession.openShared())).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static final MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) {
|
static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) {
|
||||||
return SYMBOL_LOOKUP.lookup(name).
|
return SYMBOL_LOOKUP.find(name).
|
||||||
map(addr -> LINKER.downcallHandle(addr, fdesc)).
|
map(addr -> LINKER.downcallHandle(addr, fdesc)).
|
||||||
orElse(null);
|
orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
static final MethodHandle downcallHandle(FunctionDescriptor fdesc) {
|
static MethodHandle downcallHandle(FunctionDescriptor fdesc) {
|
||||||
return LINKER.downcallHandle(fdesc);
|
return LINKER.downcallHandle(fdesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static final MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) {
|
static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) {
|
||||||
return SYMBOL_LOOKUP.lookup(name).
|
return SYMBOL_LOOKUP.find(name).
|
||||||
map(addr -> VarargsInvoker.make(addr, fdesc)).
|
map(addr -> VarargsInvoker.make(addr, fdesc)).
|
||||||
orElse(null);
|
orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
static final <Z> MemorySegment upcallStub(Class<Z> fi, Z z, FunctionDescriptor fdesc, MemorySession session) {
|
static MethodHandle upcallHandle(Class<?> fi, String name, FunctionDescriptor fdesc) {
|
||||||
try {
|
try {
|
||||||
MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", Linker.upcallType(fdesc));
|
return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType());
|
||||||
handle = handle.bindTo(z);
|
|
||||||
return LINKER.upcallStub(handle, fdesc, session);
|
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
throw new AssertionError(ex);
|
throw new AssertionError(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static MemorySegment asArray(MemoryAddress addr, MemoryLayout layout, int numElements, MemorySession session) {
|
static <Z> MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, SegmentScope scope) {
|
||||||
return MemorySegment.ofAddress(addr, numElements * layout.byteSize(), session);
|
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
|
// Internals only below this point
|
||||||
|
|
||||||
private static class VarargsInvoker {
|
private static final class VarargsInvoker {
|
||||||
private static final MethodHandle INVOKE_MH;
|
private static final MethodHandle INVOKE_MH;
|
||||||
private final MemorySegment symbol;
|
private final MemorySegment symbol;
|
||||||
private final FunctionDescriptor function;
|
private final FunctionDescriptor function;
|
||||||
@@ -127,7 +133,9 @@ final class RuntimeHelper {
|
|||||||
mtype = mtype.appendParameterTypes(carrier(layout, false));
|
mtype = mtype.appendParameterTypes(carrier(layout, false));
|
||||||
}
|
}
|
||||||
mtype = mtype.appendParameterTypes(Object[].class);
|
mtype = mtype.appendParameterTypes(Object[].class);
|
||||||
if (mtype.returnType().equals(MemorySegment.class)) {
|
boolean needsAllocator = function.returnLayout().isPresent() &&
|
||||||
|
function.returnLayout().get() instanceof GroupLayout;
|
||||||
|
if (needsAllocator) {
|
||||||
mtype = mtype.insertParameterTypes(0, SegmentAllocator.class);
|
mtype = mtype.insertParameterTypes(0, SegmentAllocator.class);
|
||||||
} else {
|
} else {
|
||||||
handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR);
|
handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR);
|
||||||
@@ -137,8 +145,7 @@ final class RuntimeHelper {
|
|||||||
|
|
||||||
static Class<?> carrier(MemoryLayout layout, boolean ret) {
|
static Class<?> carrier(MemoryLayout layout, boolean ret) {
|
||||||
if (layout instanceof ValueLayout valueLayout) {
|
if (layout instanceof ValueLayout valueLayout) {
|
||||||
return (ret || valueLayout.carrier() != MemoryAddress.class) ?
|
return valueLayout.carrier();
|
||||||
valueLayout.carrier() : Addressable.class;
|
|
||||||
} else if (layout instanceof GroupLayout) {
|
} else if (layout instanceof GroupLayout) {
|
||||||
return MemorySegment.class;
|
return MemorySegment.class;
|
||||||
} else {
|
} else {
|
||||||
@@ -173,7 +180,9 @@ final class RuntimeHelper {
|
|||||||
FunctionDescriptor.ofVoid(argLayouts) :
|
FunctionDescriptor.ofVoid(argLayouts) :
|
||||||
FunctionDescriptor.of(function.returnLayout().get(), argLayouts);
|
FunctionDescriptor.of(function.returnLayout().get(), argLayouts);
|
||||||
MethodHandle mh = LINKER.downcallHandle(symbol, f);
|
MethodHandle mh = LINKER.downcallHandle(symbol, f);
|
||||||
if (mh.type().returnType() == MemorySegment.class) {
|
boolean needsAllocator = function.returnLayout().isPresent() &&
|
||||||
|
function.returnLayout().get() instanceof GroupLayout;
|
||||||
|
if (needsAllocator) {
|
||||||
mh = mh.bindTo(allocator);
|
mh = mh.bindTo(allocator);
|
||||||
}
|
}
|
||||||
// flatten argument list so that it can be passed to an asSpreader MH
|
// flatten argument list so that it can be passed to an asSpreader MH
|
||||||
@@ -223,10 +232,7 @@ final class RuntimeHelper {
|
|||||||
if (c.isPrimitive()) {
|
if (c.isPrimitive()) {
|
||||||
return promote(c);
|
return promote(c);
|
||||||
}
|
}
|
||||||
if (MemoryAddress.class.isAssignableFrom(c)) {
|
if (c == MemorySegment.class) {
|
||||||
return MemoryAddress.class;
|
|
||||||
}
|
|
||||||
if (MemorySegment.class.isAssignableFrom(c)) {
|
|
||||||
return MemorySegment.class;
|
return MemorySegment.class;
|
||||||
}
|
}
|
||||||
throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName());
|
throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName());
|
||||||
@@ -237,7 +243,7 @@ final class RuntimeHelper {
|
|||||||
return JAVA_LONG;
|
return JAVA_LONG;
|
||||||
} else if (c == double.class) {
|
} else if (c == double.class) {
|
||||||
return JAVA_DOUBLE;
|
return JAVA_DOUBLE;
|
||||||
} else if (MemoryAddress.class.isAssignableFrom(c)) {
|
} else if (c == MemorySegment.class) {
|
||||||
return ADDRESS;
|
return ADDRESS;
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Unhandled variadic argument class: " + c);
|
throw new IllegalArgumentException("Unhandled variadic argument class: " + c);
|
||||||
|
|||||||
@@ -23,31 +23,67 @@ package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
|||||||
|
|
||||||
import java.lang.foreign.FunctionDescriptor;
|
import java.lang.foreign.FunctionDescriptor;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
class constants$0 {
|
|
||||||
|
|
||||||
|
final class constants$0 {
|
||||||
|
|
||||||
|
// Suppresses default constructor, ensuring non-instantiability.
|
||||||
|
private constants$0() {}
|
||||||
static final FunctionDescriptor sdrplay_api_StreamCallback_t$FUNC = FunctionDescriptor.ofVoid(
|
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_POINTER$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_StreamCallback_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_StreamCallback_t_UP$FUNC = FunctionDescriptor.ofVoid(
|
||||||
constants$0.sdrplay_api_StreamCallback_t$FUNC
|
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(
|
static final FunctionDescriptor sdrplay_api_EventCallback_t$FUNC = FunctionDescriptor.ofVoid(
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_EventCallback_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_EventCallback_t_UP$FUNC = FunctionDescriptor.ofVoid(
|
||||||
constants$0.sdrplay_api_EventCallback_t$FUNC
|
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_Open_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$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 MethodHandle sdrplay_api_Open_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_EventCallback_t_DOWN$FUNC = FunctionDescriptor.ofVoid(
|
||||||
constants$0.sdrplay_api_Open_t$FUNC
|
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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,21 +23,37 @@ package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
|||||||
|
|
||||||
import java.lang.foreign.FunctionDescriptor;
|
import java.lang.foreign.FunctionDescriptor;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
class constants$1 {
|
|
||||||
|
|
||||||
static final FunctionDescriptor sdrplay_api_Close_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT);
|
final class constants$1 {
|
||||||
static final MethodHandle sdrplay_api_Close_t$MH = RuntimeHelper.downcallHandle(
|
|
||||||
constants$1.sdrplay_api_Close_t$FUNC
|
// 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_LONG$LAYOUT,
|
static final FunctionDescriptor sdrplay_api_ApiVersion_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_ApiVersion_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_ApiVersion_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
constants$1.sdrplay_api_ApiVersion_t$FUNC
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_LockDeviceApi_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$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 MethodHandle sdrplay_api_LockDeviceApi_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_ApiVersion_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
constants$1.sdrplay_api_LockDeviceApi_t$FUNC
|
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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,17 +23,20 @@ package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
|||||||
|
|
||||||
import java.lang.foreign.FunctionDescriptor;
|
import java.lang.foreign.FunctionDescriptor;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
class constants$10 {
|
|
||||||
|
|
||||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoMode$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
final class constants$10 {
|
||||||
|
|
||||||
|
// Suppresses default constructor, ensuring non-instantiability.
|
||||||
|
private constants$10() {}
|
||||||
|
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_POINTER$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_DOUBLE$LAYOUT,
|
Constants$root.C_DOUBLE$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT
|
Constants$root.C_INT$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_SwapRspDuoMode$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_SwapRspDuoMode$MH = RuntimeHelper.downcallHandle(
|
||||||
"sdrplay_api_SwapRspDuoMode",
|
"sdrplay_api_SwapRspDuoMode",
|
||||||
|
|||||||
@@ -23,25 +23,49 @@ package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
|||||||
|
|
||||||
import java.lang.foreign.FunctionDescriptor;
|
import java.lang.foreign.FunctionDescriptor;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
class constants$2 {
|
|
||||||
|
|
||||||
static final FunctionDescriptor sdrplay_api_UnlockDeviceApi_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT);
|
final class constants$2 {
|
||||||
static final MethodHandle sdrplay_api_UnlockDeviceApi_t$MH = RuntimeHelper.downcallHandle(
|
|
||||||
constants$2.sdrplay_api_UnlockDeviceApi_t$FUNC
|
// 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_LONG$LAYOUT,
|
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_POINTER$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT
|
Constants$root.C_INT$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_GetDevices_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_GetDevices_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
constants$2.sdrplay_api_GetDevices_t$FUNC
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
|
Constants$root.C_INT$LAYOUT
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_SelectDevice_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$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
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_SelectDevice_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_SelectDevice_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
constants$2.sdrplay_api_SelectDevice_t$FUNC
|
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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,25 +23,49 @@ package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
|||||||
|
|
||||||
import java.lang.foreign.FunctionDescriptor;
|
import java.lang.foreign.FunctionDescriptor;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
class constants$3 {
|
|
||||||
|
|
||||||
static final FunctionDescriptor sdrplay_api_ReleaseDevice_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
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
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_ReleaseDevice_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_ReleaseDevice_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
constants$3.sdrplay_api_ReleaseDevice_t$FUNC
|
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,
|
static final FunctionDescriptor sdrplay_api_GetErrorString_t$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT
|
Constants$root.C_INT$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_GetErrorString_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_GetErrorString_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||||
constants$3.sdrplay_api_GetErrorString_t$FUNC
|
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,
|
static final FunctionDescriptor sdrplay_api_GetLastError_t$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_GetLastError_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_GetLastError_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||||
constants$3.sdrplay_api_GetLastError_t$FUNC
|
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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,25 +23,49 @@ package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
|||||||
|
|
||||||
import java.lang.foreign.FunctionDescriptor;
|
import java.lang.foreign.FunctionDescriptor;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
class constants$4 {
|
|
||||||
|
|
||||||
static final FunctionDescriptor sdrplay_api_DisableHeartbeat_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT);
|
final class constants$4 {
|
||||||
static final MethodHandle sdrplay_api_DisableHeartbeat_t$MH = RuntimeHelper.downcallHandle(
|
|
||||||
constants$4.sdrplay_api_DisableHeartbeat_t$FUNC
|
// Suppresses default constructor, ensuring non-instantiability.
|
||||||
|
private constants$4() {}
|
||||||
|
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_LONG$LAYOUT,
|
static final FunctionDescriptor sdrplay_api_DebugEnable_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT
|
Constants$root.C_INT$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_DebugEnable_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_DebugEnable_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
constants$4.sdrplay_api_DebugEnable_t$FUNC
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
|
Constants$root.C_INT$LAYOUT
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_GetDeviceParams_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$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
|
||||||
|
);
|
||||||
|
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,
|
||||||
Constants$root.C_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_GetDeviceParams_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_GetDeviceParams_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
constants$4.sdrplay_api_GetDeviceParams_t$FUNC
|
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$4.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$4.sdrplay_api_GetDeviceParams_t_DOWN$FUNC
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,30 +23,64 @@ package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
|||||||
|
|
||||||
import java.lang.foreign.FunctionDescriptor;
|
import java.lang.foreign.FunctionDescriptor;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
class constants$5 {
|
|
||||||
|
|
||||||
static final FunctionDescriptor sdrplay_api_Init_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
final class constants$5 {
|
||||||
|
|
||||||
|
// Suppresses default constructor, ensuring non-instantiability.
|
||||||
|
private constants$5() {}
|
||||||
|
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,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_Init_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_Init_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
constants$5.sdrplay_api_Init_t$FUNC
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
);
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
static final FunctionDescriptor sdrplay_api_Uninit_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
|
||||||
Constants$root.C_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_Uninit_t$MH = RuntimeHelper.downcallHandle(
|
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);
|
||||||
constants$5.sdrplay_api_Uninit_t$FUNC
|
static final FunctionDescriptor sdrplay_api_Init_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
);
|
|
||||||
static final FunctionDescriptor sdrplay_api_Update_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
|
||||||
Constants$root.C_POINTER$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT
|
||||||
Constants$root.C_LONG$LAYOUT
|
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_Update_t$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_Init_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||||
constants$5.sdrplay_api_Update_t$FUNC
|
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
|
||||||
|
);
|
||||||
|
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$5.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$5.sdrplay_api_Update_t_DOWN$FUNC
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,34 +23,76 @@ package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
|||||||
|
|
||||||
import java.lang.foreign.FunctionDescriptor;
|
import java.lang.foreign.FunctionDescriptor;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
class constants$6 {
|
|
||||||
|
|
||||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoActiveTuner_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
final class constants$6 {
|
||||||
|
|
||||||
|
// Suppresses default constructor, ensuring non-instantiability.
|
||||||
|
private constants$6() {}
|
||||||
|
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_POINTER$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT
|
Constants$root.C_INT$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_SwapRspDuoActiveTuner_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_SwapRspDuoActiveTuner_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
constants$6.sdrplay_api_SwapRspDuoActiveTuner_t$FUNC
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
|
Constants$root.C_INT$LAYOUT
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$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_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
constants$6.sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t$FUNC
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoMode_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$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
|
||||||
|
);
|
||||||
|
static final MethodHandle sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_DOWN$MH = RuntimeHelper.downcallHandle(
|
||||||
|
constants$6.sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_DOWN$FUNC
|
||||||
|
);
|
||||||
|
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_POINTER$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_DOUBLE$LAYOUT,
|
Constants$root.C_DOUBLE$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT
|
Constants$root.C_INT$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_SwapRspDuoMode_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_SwapRspDuoMode_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
constants$6.sdrplay_api_SwapRspDuoMode_t$FUNC
|
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$6.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$6.sdrplay_api_SwapRspDuoMode_t_DOWN$FUNC
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,39 +23,42 @@ package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
|||||||
|
|
||||||
import java.lang.foreign.FunctionDescriptor;
|
import java.lang.foreign.FunctionDescriptor;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
class constants$7 {
|
|
||||||
|
|
||||||
static final FunctionDescriptor sdrplay_api_Open$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT);
|
final class constants$7 {
|
||||||
|
|
||||||
|
// Suppresses default constructor, ensuring non-instantiability.
|
||||||
|
private constants$7() {}
|
||||||
|
static final FunctionDescriptor sdrplay_api_Open$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||||
static final MethodHandle sdrplay_api_Open$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_Open$MH = RuntimeHelper.downcallHandle(
|
||||||
"sdrplay_api_Open",
|
"sdrplay_api_Open",
|
||||||
constants$7.sdrplay_api_Open$FUNC
|
constants$7.sdrplay_api_Open$FUNC
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_Close$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT);
|
static final FunctionDescriptor sdrplay_api_Close$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||||
static final MethodHandle sdrplay_api_Close$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_Close$MH = RuntimeHelper.downcallHandle(
|
||||||
"sdrplay_api_Close",
|
"sdrplay_api_Close",
|
||||||
constants$7.sdrplay_api_Close$FUNC
|
constants$7.sdrplay_api_Close$FUNC
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_ApiVersion$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
static final FunctionDescriptor sdrplay_api_ApiVersion$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_ApiVersion$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_ApiVersion$MH = RuntimeHelper.downcallHandle(
|
||||||
"sdrplay_api_ApiVersion",
|
"sdrplay_api_ApiVersion",
|
||||||
constants$7.sdrplay_api_ApiVersion$FUNC
|
constants$7.sdrplay_api_ApiVersion$FUNC
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_LockDeviceApi$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT);
|
static final FunctionDescriptor sdrplay_api_LockDeviceApi$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||||
static final MethodHandle sdrplay_api_LockDeviceApi$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_LockDeviceApi$MH = RuntimeHelper.downcallHandle(
|
||||||
"sdrplay_api_LockDeviceApi",
|
"sdrplay_api_LockDeviceApi",
|
||||||
constants$7.sdrplay_api_LockDeviceApi$FUNC
|
constants$7.sdrplay_api_LockDeviceApi$FUNC
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_UnlockDeviceApi$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT);
|
static final FunctionDescriptor sdrplay_api_UnlockDeviceApi$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||||
static final MethodHandle sdrplay_api_UnlockDeviceApi$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_UnlockDeviceApi$MH = RuntimeHelper.downcallHandle(
|
||||||
"sdrplay_api_UnlockDeviceApi",
|
"sdrplay_api_UnlockDeviceApi",
|
||||||
constants$7.sdrplay_api_UnlockDeviceApi$FUNC
|
constants$7.sdrplay_api_UnlockDeviceApi$FUNC
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_GetDevices$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
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_POINTER$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT
|
Constants$root.C_INT$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_GetDevices$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_GetDevices$MH = RuntimeHelper.downcallHandle(
|
||||||
"sdrplay_api_GetDevices",
|
"sdrplay_api_GetDevices",
|
||||||
|
|||||||
@@ -23,16 +23,19 @@ package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
|||||||
|
|
||||||
import java.lang.foreign.FunctionDescriptor;
|
import java.lang.foreign.FunctionDescriptor;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
class constants$8 {
|
|
||||||
|
|
||||||
static final FunctionDescriptor sdrplay_api_SelectDevice$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
final class constants$8 {
|
||||||
|
|
||||||
|
// Suppresses default constructor, ensuring non-instantiability.
|
||||||
|
private constants$8() {}
|
||||||
|
static final FunctionDescriptor sdrplay_api_SelectDevice$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_SelectDevice$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_SelectDevice$MH = RuntimeHelper.downcallHandle(
|
||||||
"sdrplay_api_SelectDevice",
|
"sdrplay_api_SelectDevice",
|
||||||
constants$8.sdrplay_api_SelectDevice$FUNC
|
constants$8.sdrplay_api_SelectDevice$FUNC
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_ReleaseDevice$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
static final FunctionDescriptor sdrplay_api_ReleaseDevice$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_ReleaseDevice$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_ReleaseDevice$MH = RuntimeHelper.downcallHandle(
|
||||||
@@ -40,7 +43,7 @@ class constants$8 {
|
|||||||
constants$8.sdrplay_api_ReleaseDevice$FUNC
|
constants$8.sdrplay_api_ReleaseDevice$FUNC
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_GetErrorString$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
static final FunctionDescriptor sdrplay_api_GetErrorString$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT
|
Constants$root.C_INT$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_GetErrorString$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_GetErrorString$MH = RuntimeHelper.downcallHandle(
|
||||||
"sdrplay_api_GetErrorString",
|
"sdrplay_api_GetErrorString",
|
||||||
@@ -53,14 +56,14 @@ class constants$8 {
|
|||||||
"sdrplay_api_GetLastError",
|
"sdrplay_api_GetLastError",
|
||||||
constants$8.sdrplay_api_GetLastError$FUNC
|
constants$8.sdrplay_api_GetLastError$FUNC
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_DisableHeartbeat$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT);
|
static final FunctionDescriptor sdrplay_api_DisableHeartbeat$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT);
|
||||||
static final MethodHandle sdrplay_api_DisableHeartbeat$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_DisableHeartbeat$MH = RuntimeHelper.downcallHandle(
|
||||||
"sdrplay_api_DisableHeartbeat",
|
"sdrplay_api_DisableHeartbeat",
|
||||||
constants$8.sdrplay_api_DisableHeartbeat$FUNC
|
constants$8.sdrplay_api_DisableHeartbeat$FUNC
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_DebugEnable$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
static final FunctionDescriptor sdrplay_api_DebugEnable$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT
|
Constants$root.C_INT$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_DebugEnable$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_DebugEnable$MH = RuntimeHelper.downcallHandle(
|
||||||
"sdrplay_api_DebugEnable",
|
"sdrplay_api_DebugEnable",
|
||||||
|
|||||||
@@ -23,9 +23,12 @@ package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
|||||||
|
|
||||||
import java.lang.foreign.FunctionDescriptor;
|
import java.lang.foreign.FunctionDescriptor;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
class constants$9 {
|
|
||||||
|
|
||||||
static final FunctionDescriptor sdrplay_api_GetDeviceParams$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
final class constants$9 {
|
||||||
|
|
||||||
|
// Suppresses default constructor, ensuring non-instantiability.
|
||||||
|
private constants$9() {}
|
||||||
|
static final FunctionDescriptor sdrplay_api_GetDeviceParams$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
@@ -33,7 +36,7 @@ class constants$9 {
|
|||||||
"sdrplay_api_GetDeviceParams",
|
"sdrplay_api_GetDeviceParams",
|
||||||
constants$9.sdrplay_api_GetDeviceParams$FUNC
|
constants$9.sdrplay_api_GetDeviceParams$FUNC
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_Init$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
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,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
@@ -42,33 +45,33 @@ class constants$9 {
|
|||||||
"sdrplay_api_Init",
|
"sdrplay_api_Init",
|
||||||
constants$9.sdrplay_api_Init$FUNC
|
constants$9.sdrplay_api_Init$FUNC
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_Uninit$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
static final FunctionDescriptor sdrplay_api_Uninit$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_Uninit$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_Uninit$MH = RuntimeHelper.downcallHandle(
|
||||||
"sdrplay_api_Uninit",
|
"sdrplay_api_Uninit",
|
||||||
constants$9.sdrplay_api_Uninit$FUNC
|
constants$9.sdrplay_api_Uninit$FUNC
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_Update$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
static final FunctionDescriptor sdrplay_api_Update$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT
|
Constants$root.C_INT$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_Update$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_Update$MH = RuntimeHelper.downcallHandle(
|
||||||
"sdrplay_api_Update",
|
"sdrplay_api_Update",
|
||||||
constants$9.sdrplay_api_Update$FUNC
|
constants$9.sdrplay_api_Update$FUNC
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoActiveTuner$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
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_POINTER$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT
|
Constants$root.C_INT$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_SwapRspDuoActiveTuner$MH = RuntimeHelper.downcallHandle(
|
static final MethodHandle sdrplay_api_SwapRspDuoActiveTuner$MH = RuntimeHelper.downcallHandle(
|
||||||
"sdrplay_api_SwapRspDuoActiveTuner",
|
"sdrplay_api_SwapRspDuoActiveTuner",
|
||||||
constants$9.sdrplay_api_SwapRspDuoActiveTuner$FUNC
|
constants$9.sdrplay_api_SwapRspDuoActiveTuner$FUNC
|
||||||
);
|
);
|
||||||
static final FunctionDescriptor sdrplay_api_SwapRspDuoDualTunerModeSampleRate$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT,
|
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_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -21,23 +21,36 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
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 {
|
public class sdrplay_api_AgcT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("enable"),
|
Constants$root.C_INT$LAYOUT.withName("enable"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("setPoint_dBfs"),
|
Constants$root.C_INT$LAYOUT.withName("setPoint_dBfs"),
|
||||||
Constants$root.C_SHORT$LAYOUT.withName("attack_ms"),
|
Constants$root.C_SHORT$LAYOUT.withName("attack_ms"),
|
||||||
Constants$root.C_SHORT$LAYOUT.withName("decay_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_delay_ms"),
|
||||||
Constants$root.C_SHORT$LAYOUT.withName("decay_threshold_dB"),
|
Constants$root.C_SHORT$LAYOUT.withName("decay_threshold_dB"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("syncUpdate")
|
Constants$root.C_INT$LAYOUT.withName("syncUpdate")
|
||||||
);
|
);
|
||||||
public static MemoryLayout $LAYOUT() {
|
public static MemoryLayout $LAYOUT() {
|
||||||
return sdrplay_api_AgcT.$struct$LAYOUT;
|
return sdrplay_api_AgcT.$struct$LAYOUT;
|
||||||
@@ -46,10 +59,22 @@ public class sdrplay_api_AgcT {
|
|||||||
public static VarHandle enable$VH() {
|
public static VarHandle enable$VH() {
|
||||||
return sdrplay_api_AgcT.enable$VH;
|
return sdrplay_api_AgcT.enable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_AgcControlT enable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int enable$get(MemorySegment seg) {
|
public static int enable$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_AgcT.enable$VH.get(seg);
|
return (int)sdrplay_api_AgcT.enable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void enable$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_AgcT.enable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int enable$get(MemorySegment seg, long index) {
|
public static int enable$get(MemorySegment seg, long index) {
|
||||||
@@ -62,10 +87,22 @@ public class sdrplay_api_AgcT {
|
|||||||
public static VarHandle setPoint_dBfs$VH() {
|
public static VarHandle setPoint_dBfs$VH() {
|
||||||
return sdrplay_api_AgcT.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) {
|
public static int setPoint_dBfs$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_AgcT.setPoint_dBfs$VH.get(seg);
|
return (int)sdrplay_api_AgcT.setPoint_dBfs$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void setPoint_dBfs$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_AgcT.setPoint_dBfs$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int setPoint_dBfs$get(MemorySegment seg, long index) {
|
public static int setPoint_dBfs$get(MemorySegment seg, long index) {
|
||||||
@@ -78,10 +115,22 @@ public class sdrplay_api_AgcT {
|
|||||||
public static VarHandle attack_ms$VH() {
|
public static VarHandle attack_ms$VH() {
|
||||||
return sdrplay_api_AgcT.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) {
|
public static short attack_ms$get(MemorySegment seg) {
|
||||||
return (short)sdrplay_api_AgcT.attack_ms$VH.get(seg);
|
return (short)sdrplay_api_AgcT.attack_ms$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void attack_ms$set( MemorySegment seg, short x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_AgcT.attack_ms$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static short attack_ms$get(MemorySegment seg, long index) {
|
public static short attack_ms$get(MemorySegment seg, long index) {
|
||||||
@@ -94,10 +143,22 @@ public class sdrplay_api_AgcT {
|
|||||||
public static VarHandle decay_ms$VH() {
|
public static VarHandle decay_ms$VH() {
|
||||||
return sdrplay_api_AgcT.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) {
|
public static short decay_ms$get(MemorySegment seg) {
|
||||||
return (short)sdrplay_api_AgcT.decay_ms$VH.get(seg);
|
return (short)sdrplay_api_AgcT.decay_ms$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void decay_ms$set( MemorySegment seg, short x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_AgcT.decay_ms$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static short decay_ms$get(MemorySegment seg, long index) {
|
public static short decay_ms$get(MemorySegment seg, long index) {
|
||||||
@@ -110,10 +171,22 @@ public class sdrplay_api_AgcT {
|
|||||||
public static VarHandle decay_delay_ms$VH() {
|
public static VarHandle decay_delay_ms$VH() {
|
||||||
return sdrplay_api_AgcT.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) {
|
public static short decay_delay_ms$get(MemorySegment seg) {
|
||||||
return (short)sdrplay_api_AgcT.decay_delay_ms$VH.get(seg);
|
return (short)sdrplay_api_AgcT.decay_delay_ms$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void decay_delay_ms$set( MemorySegment seg, short x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_AgcT.decay_delay_ms$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static short decay_delay_ms$get(MemorySegment seg, long index) {
|
public static short decay_delay_ms$get(MemorySegment seg, long index) {
|
||||||
@@ -126,10 +199,22 @@ public class sdrplay_api_AgcT {
|
|||||||
public static VarHandle decay_threshold_dB$VH() {
|
public static VarHandle decay_threshold_dB$VH() {
|
||||||
return sdrplay_api_AgcT.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) {
|
public static short decay_threshold_dB$get(MemorySegment seg) {
|
||||||
return (short)sdrplay_api_AgcT.decay_threshold_dB$VH.get(seg);
|
return (short)sdrplay_api_AgcT.decay_threshold_dB$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void decay_threshold_dB$set( MemorySegment seg, short x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_AgcT.decay_threshold_dB$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static short decay_threshold_dB$get(MemorySegment seg, long index) {
|
public static short decay_threshold_dB$get(MemorySegment seg, long index) {
|
||||||
@@ -142,10 +227,22 @@ public class sdrplay_api_AgcT {
|
|||||||
public static VarHandle syncUpdate$VH() {
|
public static VarHandle syncUpdate$VH() {
|
||||||
return sdrplay_api_AgcT.syncUpdate$VH;
|
return sdrplay_api_AgcT.syncUpdate$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int syncUpdate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int syncUpdate$get(MemorySegment seg) {
|
public static int syncUpdate$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_AgcT.syncUpdate$VH.get(seg);
|
return (int)sdrplay_api_AgcT.syncUpdate$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void syncUpdate$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int syncUpdate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void syncUpdate$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_AgcT.syncUpdate$VH.set(seg, x);
|
sdrplay_api_AgcT.syncUpdate$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int syncUpdate$get(MemorySegment seg, long index) {
|
public static int syncUpdate$get(MemorySegment seg, long index) {
|
||||||
@@ -156,10 +253,10 @@ public class sdrplay_api_AgcT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,21 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
import java.lang.foreign.SegmentScope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* enum (*sdrplay_api_ApiVersion_t)(float* apiVer);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_ApiVersion_t {
|
public interface sdrplay_api_ApiVersion_t {
|
||||||
|
|
||||||
int apply(java.lang.foreign.MemoryAddress apiVer);
|
int apply(java.lang.foreign.MemorySegment currentSampleRate);
|
||||||
static MemorySegment allocate(sdrplay_api_ApiVersion_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_ApiVersion_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_ApiVersion_t.class, fi, constants$1.sdrplay_api_ApiVersion_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_ApiVersion_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (java.lang.foreign.MemoryAddress _apiVer) -> {
|
return (java.lang.foreign.MemorySegment _currentSampleRate) -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$1.sdrplay_api_ApiVersion_t$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)_apiVer);
|
return (int)constants$1.sdrplay_api_ApiVersion_t_DOWN$MH.invokeExact(symbol, _currentSampleRate);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,16 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
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 {
|
public class sdrplay_api_CallbackFnsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_POINTER$LAYOUT.withName("StreamACbFn"),
|
Constants$root.C_POINTER$LAYOUT.withName("StreamACbFn"),
|
||||||
Constants$root.C_POINTER$LAYOUT.withName("StreamBCbFn"),
|
Constants$root.C_POINTER$LAYOUT.withName("StreamBCbFn"),
|
||||||
Constants$root.C_POINTER$LAYOUT.withName("EventCbFn")
|
Constants$root.C_POINTER$LAYOUT.withName("EventCbFn")
|
||||||
@@ -42,65 +51,101 @@ public class sdrplay_api_CallbackFnsT {
|
|||||||
public static VarHandle StreamACbFn$VH() {
|
public static VarHandle StreamACbFn$VH() {
|
||||||
return sdrplay_api_CallbackFnsT.StreamACbFn$VH;
|
return sdrplay_api_CallbackFnsT.StreamACbFn$VH;
|
||||||
}
|
}
|
||||||
public static MemoryAddress StreamACbFn$get(MemorySegment seg) {
|
/**
|
||||||
return (java.lang.foreign.MemoryAddress)sdrplay_api_CallbackFnsT.StreamACbFn$VH.get(seg);
|
* 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);
|
||||||
}
|
}
|
||||||
public static void StreamACbFn$set( MemorySegment seg, MemoryAddress x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_CallbackFnsT.StreamACbFn$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static MemoryAddress StreamACbFn$get(MemorySegment seg, long index) {
|
public static MemorySegment StreamACbFn$get(MemorySegment seg, long index) {
|
||||||
return (java.lang.foreign.MemoryAddress)sdrplay_api_CallbackFnsT.StreamACbFn$VH.get(seg.asSlice(index*sizeof()));
|
return (java.lang.foreign.MemorySegment)sdrplay_api_CallbackFnsT.StreamACbFn$VH.get(seg.asSlice(index*sizeof()));
|
||||||
}
|
}
|
||||||
public static void StreamACbFn$set(MemorySegment seg, long index, MemoryAddress x) {
|
public static void StreamACbFn$set(MemorySegment seg, long index, MemorySegment x) {
|
||||||
sdrplay_api_CallbackFnsT.StreamACbFn$VH.set(seg.asSlice(index*sizeof()), x);
|
sdrplay_api_CallbackFnsT.StreamACbFn$VH.set(seg.asSlice(index*sizeof()), x);
|
||||||
}
|
}
|
||||||
public static sdrplay_api_StreamCallback_t StreamACbFn (MemorySegment segment, MemorySession session) {
|
public static sdrplay_api_StreamCallback_t StreamACbFn(MemorySegment segment, SegmentScope scope) {
|
||||||
return sdrplay_api_StreamCallback_t.ofAddress(StreamACbFn$get(segment), session);
|
return sdrplay_api_StreamCallback_t.ofAddress(StreamACbFn$get(segment), scope);
|
||||||
}
|
}
|
||||||
static final VarHandle StreamBCbFn$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("StreamBCbFn"));
|
static final VarHandle StreamBCbFn$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("StreamBCbFn"));
|
||||||
public static VarHandle StreamBCbFn$VH() {
|
public static VarHandle StreamBCbFn$VH() {
|
||||||
return sdrplay_api_CallbackFnsT.StreamBCbFn$VH;
|
return sdrplay_api_CallbackFnsT.StreamBCbFn$VH;
|
||||||
}
|
}
|
||||||
public static MemoryAddress StreamBCbFn$get(MemorySegment seg) {
|
/**
|
||||||
return (java.lang.foreign.MemoryAddress)sdrplay_api_CallbackFnsT.StreamBCbFn$VH.get(seg);
|
* 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);
|
||||||
}
|
}
|
||||||
public static void StreamBCbFn$set( MemorySegment seg, MemoryAddress x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_CallbackFnsT.StreamBCbFn$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static MemoryAddress StreamBCbFn$get(MemorySegment seg, long index) {
|
public static MemorySegment StreamBCbFn$get(MemorySegment seg, long index) {
|
||||||
return (java.lang.foreign.MemoryAddress)sdrplay_api_CallbackFnsT.StreamBCbFn$VH.get(seg.asSlice(index*sizeof()));
|
return (java.lang.foreign.MemorySegment)sdrplay_api_CallbackFnsT.StreamBCbFn$VH.get(seg.asSlice(index*sizeof()));
|
||||||
}
|
}
|
||||||
public static void StreamBCbFn$set(MemorySegment seg, long index, MemoryAddress x) {
|
public static void StreamBCbFn$set(MemorySegment seg, long index, MemorySegment x) {
|
||||||
sdrplay_api_CallbackFnsT.StreamBCbFn$VH.set(seg.asSlice(index*sizeof()), x);
|
sdrplay_api_CallbackFnsT.StreamBCbFn$VH.set(seg.asSlice(index*sizeof()), x);
|
||||||
}
|
}
|
||||||
public static sdrplay_api_StreamCallback_t StreamBCbFn (MemorySegment segment, MemorySession session) {
|
public static sdrplay_api_StreamCallback_t StreamBCbFn(MemorySegment segment, SegmentScope scope) {
|
||||||
return sdrplay_api_StreamCallback_t.ofAddress(StreamBCbFn$get(segment), session);
|
return sdrplay_api_StreamCallback_t.ofAddress(StreamBCbFn$get(segment), scope);
|
||||||
}
|
}
|
||||||
static final VarHandle EventCbFn$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("EventCbFn"));
|
static final VarHandle EventCbFn$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("EventCbFn"));
|
||||||
public static VarHandle EventCbFn$VH() {
|
public static VarHandle EventCbFn$VH() {
|
||||||
return sdrplay_api_CallbackFnsT.EventCbFn$VH;
|
return sdrplay_api_CallbackFnsT.EventCbFn$VH;
|
||||||
}
|
}
|
||||||
public static MemoryAddress EventCbFn$get(MemorySegment seg) {
|
/**
|
||||||
return (java.lang.foreign.MemoryAddress)sdrplay_api_CallbackFnsT.EventCbFn$VH.get(seg);
|
* 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);
|
||||||
}
|
}
|
||||||
public static void EventCbFn$set( MemorySegment seg, MemoryAddress x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_CallbackFnsT.EventCbFn$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static MemoryAddress EventCbFn$get(MemorySegment seg, long index) {
|
public static MemorySegment EventCbFn$get(MemorySegment seg, long index) {
|
||||||
return (java.lang.foreign.MemoryAddress)sdrplay_api_CallbackFnsT.EventCbFn$VH.get(seg.asSlice(index*sizeof()));
|
return (java.lang.foreign.MemorySegment)sdrplay_api_CallbackFnsT.EventCbFn$VH.get(seg.asSlice(index*sizeof()));
|
||||||
}
|
}
|
||||||
public static void EventCbFn$set(MemorySegment seg, long index, MemoryAddress x) {
|
public static void EventCbFn$set(MemorySegment seg, long index, MemorySegment x) {
|
||||||
sdrplay_api_CallbackFnsT.EventCbFn$VH.set(seg.asSlice(index*sizeof()), x);
|
sdrplay_api_CallbackFnsT.EventCbFn$VH.set(seg.asSlice(index*sizeof()), x);
|
||||||
}
|
}
|
||||||
public static sdrplay_api_EventCallback_t EventCbFn (MemorySegment segment, MemorySession session) {
|
public static sdrplay_api_EventCallback_t EventCbFn(MemorySegment segment, SegmentScope scope) {
|
||||||
return sdrplay_api_EventCallback_t.ofAddress(EventCbFn$get(segment), session);
|
return sdrplay_api_EventCallback_t.ofAddress(EventCbFn$get(segment), scope);
|
||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,21 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
import java.lang.foreign.SegmentScope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* enum (*sdrplay_api_Close_t)();
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_Close_t {
|
public interface sdrplay_api_Close_t {
|
||||||
|
|
||||||
int apply();
|
int apply();
|
||||||
static MemorySegment allocate(sdrplay_api_Close_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_Close_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_Close_t.class, fi, constants$1.sdrplay_api_Close_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_Close_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return () -> {
|
return () -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$1.sdrplay_api_Close_t$MH.invokeExact((Addressable)symbol);
|
return (int)constants$1.sdrplay_api_Close_t_DOWN$MH.invokeExact(symbol);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,16 +21,26 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
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 {
|
public class sdrplay_api_ControlParamsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("DCenable"),
|
Constants$root.C_CHAR$LAYOUT.withName("DCenable"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("IQenable")
|
Constants$root.C_CHAR$LAYOUT.withName("IQenable")
|
||||||
@@ -42,15 +52,15 @@ public class sdrplay_api_ControlParamsT {
|
|||||||
).withName("decimation"),
|
).withName("decimation"),
|
||||||
MemoryLayout.paddingLayout(24),
|
MemoryLayout.paddingLayout(24),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("enable"),
|
Constants$root.C_INT$LAYOUT.withName("enable"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("setPoint_dBfs"),
|
Constants$root.C_INT$LAYOUT.withName("setPoint_dBfs"),
|
||||||
Constants$root.C_SHORT$LAYOUT.withName("attack_ms"),
|
Constants$root.C_SHORT$LAYOUT.withName("attack_ms"),
|
||||||
Constants$root.C_SHORT$LAYOUT.withName("decay_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_delay_ms"),
|
||||||
Constants$root.C_SHORT$LAYOUT.withName("decay_threshold_dB"),
|
Constants$root.C_SHORT$LAYOUT.withName("decay_threshold_dB"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("syncUpdate")
|
Constants$root.C_INT$LAYOUT.withName("syncUpdate")
|
||||||
).withName("agc"),
|
).withName("agc"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("adsbMode")
|
Constants$root.C_INT$LAYOUT.withName("adsbMode")
|
||||||
);
|
);
|
||||||
public static MemoryLayout $LAYOUT() {
|
public static MemoryLayout $LAYOUT() {
|
||||||
return sdrplay_api_ControlParamsT.$struct$LAYOUT;
|
return sdrplay_api_ControlParamsT.$struct$LAYOUT;
|
||||||
@@ -68,10 +78,22 @@ public class sdrplay_api_ControlParamsT {
|
|||||||
public static VarHandle adsbMode$VH() {
|
public static VarHandle adsbMode$VH() {
|
||||||
return sdrplay_api_ControlParamsT.adsbMode$VH;
|
return sdrplay_api_ControlParamsT.adsbMode$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_AdsbModeT adsbMode;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int adsbMode$get(MemorySegment seg) {
|
public static int adsbMode$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_ControlParamsT.adsbMode$VH.get(seg);
|
return (int)sdrplay_api_ControlParamsT.adsbMode$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void adsbMode$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_ControlParamsT.adsbMode$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int adsbMode$get(MemorySegment seg, long index) {
|
public static int adsbMode$get(MemorySegment seg, long index) {
|
||||||
@@ -82,10 +104,10 @@ public class sdrplay_api_ControlParamsT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,16 +21,24 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* unsigned char DCenable;
|
||||||
|
* unsigned char IQenable;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_DcOffsetT {
|
public class sdrplay_api_DcOffsetT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("DCenable"),
|
Constants$root.C_CHAR$LAYOUT.withName("DCenable"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("IQenable")
|
Constants$root.C_CHAR$LAYOUT.withName("IQenable")
|
||||||
);
|
);
|
||||||
@@ -41,10 +49,22 @@ public class sdrplay_api_DcOffsetT {
|
|||||||
public static VarHandle DCenable$VH() {
|
public static VarHandle DCenable$VH() {
|
||||||
return sdrplay_api_DcOffsetT.DCenable$VH;
|
return sdrplay_api_DcOffsetT.DCenable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char DCenable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte DCenable$get(MemorySegment seg) {
|
public static byte DCenable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_DcOffsetT.DCenable$VH.get(seg);
|
return (byte)sdrplay_api_DcOffsetT.DCenable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void DCenable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char DCenable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void DCenable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_DcOffsetT.DCenable$VH.set(seg, x);
|
sdrplay_api_DcOffsetT.DCenable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte DCenable$get(MemorySegment seg, long index) {
|
public static byte DCenable$get(MemorySegment seg, long index) {
|
||||||
@@ -57,10 +77,22 @@ public class sdrplay_api_DcOffsetT {
|
|||||||
public static VarHandle IQenable$VH() {
|
public static VarHandle IQenable$VH() {
|
||||||
return sdrplay_api_DcOffsetT.IQenable$VH;
|
return sdrplay_api_DcOffsetT.IQenable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char IQenable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte IQenable$get(MemorySegment seg) {
|
public static byte IQenable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_DcOffsetT.IQenable$VH.get(seg);
|
return (byte)sdrplay_api_DcOffsetT.IQenable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void IQenable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char IQenable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void IQenable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_DcOffsetT.IQenable$VH.set(seg, x);
|
sdrplay_api_DcOffsetT.IQenable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte IQenable$get(MemorySegment seg, long index) {
|
public static byte IQenable$get(MemorySegment seg, long index) {
|
||||||
@@ -71,10 +103,10 @@ public class sdrplay_api_DcOffsetT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,21 +21,31 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* unsigned char dcCal;
|
||||||
|
* unsigned char speedUp;
|
||||||
|
* int trackTime;
|
||||||
|
* int refreshRateTime;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_DcOffsetTunerT {
|
public class sdrplay_api_DcOffsetTunerT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("dcCal"),
|
Constants$root.C_CHAR$LAYOUT.withName("dcCal"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("speedUp"),
|
Constants$root.C_CHAR$LAYOUT.withName("speedUp"),
|
||||||
MemoryLayout.paddingLayout(16),
|
MemoryLayout.paddingLayout(16),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("trackTime"),
|
Constants$root.C_INT$LAYOUT.withName("trackTime"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("refreshRateTime")
|
Constants$root.C_INT$LAYOUT.withName("refreshRateTime")
|
||||||
);
|
);
|
||||||
public static MemoryLayout $LAYOUT() {
|
public static MemoryLayout $LAYOUT() {
|
||||||
return sdrplay_api_DcOffsetTunerT.$struct$LAYOUT;
|
return sdrplay_api_DcOffsetTunerT.$struct$LAYOUT;
|
||||||
@@ -44,10 +54,22 @@ public class sdrplay_api_DcOffsetTunerT {
|
|||||||
public static VarHandle dcCal$VH() {
|
public static VarHandle dcCal$VH() {
|
||||||
return sdrplay_api_DcOffsetTunerT.dcCal$VH;
|
return sdrplay_api_DcOffsetTunerT.dcCal$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char dcCal;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte dcCal$get(MemorySegment seg) {
|
public static byte dcCal$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_DcOffsetTunerT.dcCal$VH.get(seg);
|
return (byte)sdrplay_api_DcOffsetTunerT.dcCal$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void dcCal$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char dcCal;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void dcCal$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_DcOffsetTunerT.dcCal$VH.set(seg, x);
|
sdrplay_api_DcOffsetTunerT.dcCal$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte dcCal$get(MemorySegment seg, long index) {
|
public static byte dcCal$get(MemorySegment seg, long index) {
|
||||||
@@ -60,10 +82,22 @@ public class sdrplay_api_DcOffsetTunerT {
|
|||||||
public static VarHandle speedUp$VH() {
|
public static VarHandle speedUp$VH() {
|
||||||
return sdrplay_api_DcOffsetTunerT.speedUp$VH;
|
return sdrplay_api_DcOffsetTunerT.speedUp$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char speedUp;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte speedUp$get(MemorySegment seg) {
|
public static byte speedUp$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_DcOffsetTunerT.speedUp$VH.get(seg);
|
return (byte)sdrplay_api_DcOffsetTunerT.speedUp$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void speedUp$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char speedUp;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void speedUp$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_DcOffsetTunerT.speedUp$VH.set(seg, x);
|
sdrplay_api_DcOffsetTunerT.speedUp$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte speedUp$get(MemorySegment seg, long index) {
|
public static byte speedUp$get(MemorySegment seg, long index) {
|
||||||
@@ -76,10 +110,22 @@ public class sdrplay_api_DcOffsetTunerT {
|
|||||||
public static VarHandle trackTime$VH() {
|
public static VarHandle trackTime$VH() {
|
||||||
return sdrplay_api_DcOffsetTunerT.trackTime$VH;
|
return sdrplay_api_DcOffsetTunerT.trackTime$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int trackTime;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int trackTime$get(MemorySegment seg) {
|
public static int trackTime$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_DcOffsetTunerT.trackTime$VH.get(seg);
|
return (int)sdrplay_api_DcOffsetTunerT.trackTime$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void trackTime$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int trackTime;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void trackTime$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_DcOffsetTunerT.trackTime$VH.set(seg, x);
|
sdrplay_api_DcOffsetTunerT.trackTime$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int trackTime$get(MemorySegment seg, long index) {
|
public static int trackTime$get(MemorySegment seg, long index) {
|
||||||
@@ -92,10 +138,22 @@ public class sdrplay_api_DcOffsetTunerT {
|
|||||||
public static VarHandle refreshRateTime$VH() {
|
public static VarHandle refreshRateTime$VH() {
|
||||||
return sdrplay_api_DcOffsetTunerT.refreshRateTime$VH;
|
return sdrplay_api_DcOffsetTunerT.refreshRateTime$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int refreshRateTime;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int refreshRateTime$get(MemorySegment seg) {
|
public static int refreshRateTime$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_DcOffsetTunerT.refreshRateTime$VH.get(seg);
|
return (int)sdrplay_api_DcOffsetTunerT.refreshRateTime$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void refreshRateTime$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int refreshRateTime;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void refreshRateTime$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_DcOffsetTunerT.refreshRateTime$VH.set(seg, x);
|
sdrplay_api_DcOffsetTunerT.refreshRateTime$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int refreshRateTime$get(MemorySegment seg, long index) {
|
public static int refreshRateTime$get(MemorySegment seg, long index) {
|
||||||
@@ -106,10 +164,10 @@ public class sdrplay_api_DcOffsetTunerT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,21 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
import java.lang.foreign.SegmentScope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* enum (*sdrplay_api_DebugEnable_t)(void* dev,enum dbgLvl);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_DebugEnable_t {
|
public interface sdrplay_api_DebugEnable_t {
|
||||||
|
|
||||||
int apply(java.lang.foreign.MemoryAddress dev, int dbgLvl);
|
int apply(java.lang.foreign.MemorySegment dev, int dbgLvl);
|
||||||
static MemorySegment allocate(sdrplay_api_DebugEnable_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_DebugEnable_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_DebugEnable_t.class, fi, constants$4.sdrplay_api_DebugEnable_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_DebugEnable_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (java.lang.foreign.MemoryAddress _dev, int _dbgLvl) -> {
|
return (java.lang.foreign.MemorySegment _dev, int _dbgLvl) -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$4.sdrplay_api_DebugEnable_t$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)_dev, _dbgLvl);
|
return (int)constants$4.sdrplay_api_DebugEnable_t_DOWN$MH.invokeExact(symbol, _dev, _dbgLvl);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,16 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* unsigned char enable;
|
||||||
|
* unsigned char decimationFactor;
|
||||||
|
* unsigned char wideBandSignal;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_DecimationT {
|
public class sdrplay_api_DecimationT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("enable"),
|
Constants$root.C_CHAR$LAYOUT.withName("enable"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("decimationFactor"),
|
Constants$root.C_CHAR$LAYOUT.withName("decimationFactor"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("wideBandSignal")
|
Constants$root.C_CHAR$LAYOUT.withName("wideBandSignal")
|
||||||
@@ -42,10 +51,22 @@ public class sdrplay_api_DecimationT {
|
|||||||
public static VarHandle enable$VH() {
|
public static VarHandle enable$VH() {
|
||||||
return sdrplay_api_DecimationT.enable$VH;
|
return sdrplay_api_DecimationT.enable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char enable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte enable$get(MemorySegment seg) {
|
public static byte enable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_DecimationT.enable$VH.get(seg);
|
return (byte)sdrplay_api_DecimationT.enable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void enable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char enable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void enable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_DecimationT.enable$VH.set(seg, x);
|
sdrplay_api_DecimationT.enable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte enable$get(MemorySegment seg, long index) {
|
public static byte enable$get(MemorySegment seg, long index) {
|
||||||
@@ -58,10 +79,22 @@ public class sdrplay_api_DecimationT {
|
|||||||
public static VarHandle decimationFactor$VH() {
|
public static VarHandle decimationFactor$VH() {
|
||||||
return sdrplay_api_DecimationT.decimationFactor$VH;
|
return sdrplay_api_DecimationT.decimationFactor$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char decimationFactor;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte decimationFactor$get(MemorySegment seg) {
|
public static byte decimationFactor$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_DecimationT.decimationFactor$VH.get(seg);
|
return (byte)sdrplay_api_DecimationT.decimationFactor$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void decimationFactor$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char decimationFactor;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void decimationFactor$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_DecimationT.decimationFactor$VH.set(seg, x);
|
sdrplay_api_DecimationT.decimationFactor$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte decimationFactor$get(MemorySegment seg, long index) {
|
public static byte decimationFactor$get(MemorySegment seg, long index) {
|
||||||
@@ -74,10 +107,22 @@ public class sdrplay_api_DecimationT {
|
|||||||
public static VarHandle wideBandSignal$VH() {
|
public static VarHandle wideBandSignal$VH() {
|
||||||
return sdrplay_api_DecimationT.wideBandSignal$VH;
|
return sdrplay_api_DecimationT.wideBandSignal$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char wideBandSignal;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte wideBandSignal$get(MemorySegment seg) {
|
public static byte wideBandSignal$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_DecimationT.wideBandSignal$VH.get(seg);
|
return (byte)sdrplay_api_DecimationT.wideBandSignal$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void wideBandSignal$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char wideBandSignal;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void wideBandSignal$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_DecimationT.wideBandSignal$VH.set(seg, x);
|
sdrplay_api_DecimationT.wideBandSignal$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte wideBandSignal$get(MemorySegment seg, long index) {
|
public static byte wideBandSignal$get(MemorySegment seg, long index) {
|
||||||
@@ -88,10 +133,10 @@ public class sdrplay_api_DecimationT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,16 +21,32 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
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 {
|
public class sdrplay_api_DevParamsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_DOUBLE$LAYOUT.withName("ppm"),
|
Constants$root.C_DOUBLE$LAYOUT.withName("ppm"),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_DOUBLE$LAYOUT.withName("fsHz"),
|
Constants$root.C_DOUBLE$LAYOUT.withName("fsHz"),
|
||||||
@@ -39,8 +55,8 @@ public class sdrplay_api_DevParamsT {
|
|||||||
MemoryLayout.paddingLayout(48)
|
MemoryLayout.paddingLayout(48)
|
||||||
).withName("fsFreq"),
|
).withName("fsFreq"),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("sampleNum"),
|
Constants$root.C_INT$LAYOUT.withName("sampleNum"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("period")
|
Constants$root.C_INT$LAYOUT.withName("period")
|
||||||
).withName("syncUpdate"),
|
).withName("syncUpdate"),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("resetGainUpdate"),
|
Constants$root.C_CHAR$LAYOUT.withName("resetGainUpdate"),
|
||||||
@@ -48,8 +64,8 @@ public class sdrplay_api_DevParamsT {
|
|||||||
Constants$root.C_CHAR$LAYOUT.withName("resetFsUpdate")
|
Constants$root.C_CHAR$LAYOUT.withName("resetFsUpdate")
|
||||||
).withName("resetFlags"),
|
).withName("resetFlags"),
|
||||||
MemoryLayout.paddingLayout(8),
|
MemoryLayout.paddingLayout(8),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("mode"),
|
Constants$root.C_INT$LAYOUT.withName("mode"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("samplesPerPkt"),
|
Constants$root.C_INT$LAYOUT.withName("samplesPerPkt"),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable")
|
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable")
|
||||||
@@ -59,13 +75,13 @@ public class sdrplay_api_DevParamsT {
|
|||||||
).withName("rsp2Params"),
|
).withName("rsp2Params"),
|
||||||
MemoryLayout.paddingLayout(8),
|
MemoryLayout.paddingLayout(8),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("extRefOutputEn")
|
Constants$root.C_INT$LAYOUT.withName("extRefOutputEn")
|
||||||
).withName("rspDuoParams"),
|
).withName("rspDuoParams"),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("hdrEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("hdrEnable"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
||||||
MemoryLayout.paddingLayout(16),
|
MemoryLayout.paddingLayout(16),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("antennaSel"),
|
Constants$root.C_INT$LAYOUT.withName("antennaSel"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"),
|
||||||
MemoryLayout.paddingLayout(16)
|
MemoryLayout.paddingLayout(16)
|
||||||
@@ -78,10 +94,22 @@ public class sdrplay_api_DevParamsT {
|
|||||||
public static VarHandle ppm$VH() {
|
public static VarHandle ppm$VH() {
|
||||||
return sdrplay_api_DevParamsT.ppm$VH;
|
return sdrplay_api_DevParamsT.ppm$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* double ppm;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static double ppm$get(MemorySegment seg) {
|
public static double ppm$get(MemorySegment seg) {
|
||||||
return (double)sdrplay_api_DevParamsT.ppm$VH.get(seg);
|
return (double)sdrplay_api_DevParamsT.ppm$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void ppm$set( MemorySegment seg, double x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* double ppm;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void ppm$set(MemorySegment seg, double x) {
|
||||||
sdrplay_api_DevParamsT.ppm$VH.set(seg, x);
|
sdrplay_api_DevParamsT.ppm$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static double ppm$get(MemorySegment seg, long index) {
|
public static double ppm$get(MemorySegment seg, long index) {
|
||||||
@@ -103,10 +131,22 @@ public class sdrplay_api_DevParamsT {
|
|||||||
public static VarHandle mode$VH() {
|
public static VarHandle mode$VH() {
|
||||||
return sdrplay_api_DevParamsT.mode$VH;
|
return sdrplay_api_DevParamsT.mode$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_TransferModeT mode;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int mode$get(MemorySegment seg) {
|
public static int mode$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_DevParamsT.mode$VH.get(seg);
|
return (int)sdrplay_api_DevParamsT.mode$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void mode$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_DevParamsT.mode$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int mode$get(MemorySegment seg, long index) {
|
public static int mode$get(MemorySegment seg, long index) {
|
||||||
@@ -119,10 +159,22 @@ public class sdrplay_api_DevParamsT {
|
|||||||
public static VarHandle samplesPerPkt$VH() {
|
public static VarHandle samplesPerPkt$VH() {
|
||||||
return sdrplay_api_DevParamsT.samplesPerPkt$VH;
|
return sdrplay_api_DevParamsT.samplesPerPkt$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned int samplesPerPkt;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int samplesPerPkt$get(MemorySegment seg) {
|
public static int samplesPerPkt$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_DevParamsT.samplesPerPkt$VH.get(seg);
|
return (int)sdrplay_api_DevParamsT.samplesPerPkt$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void samplesPerPkt$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned int samplesPerPkt;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void samplesPerPkt$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_DevParamsT.samplesPerPkt$VH.set(seg, x);
|
sdrplay_api_DevParamsT.samplesPerPkt$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int samplesPerPkt$get(MemorySegment seg, long index) {
|
public static int samplesPerPkt$get(MemorySegment seg, long index) {
|
||||||
@@ -145,10 +197,10 @@ public class sdrplay_api_DevParamsT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,16 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* sdrplay_api_DevParamsT* devParams;
|
||||||
|
* sdrplay_api_RxChannelParamsT* rxChannelA;
|
||||||
|
* sdrplay_api_RxChannelParamsT* rxChannelB;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_DeviceParamsT {
|
public class sdrplay_api_DeviceParamsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_POINTER$LAYOUT.withName("devParams"),
|
Constants$root.C_POINTER$LAYOUT.withName("devParams"),
|
||||||
Constants$root.C_POINTER$LAYOUT.withName("rxChannelA"),
|
Constants$root.C_POINTER$LAYOUT.withName("rxChannelA"),
|
||||||
Constants$root.C_POINTER$LAYOUT.withName("rxChannelB")
|
Constants$root.C_POINTER$LAYOUT.withName("rxChannelB")
|
||||||
@@ -42,56 +51,92 @@ public class sdrplay_api_DeviceParamsT {
|
|||||||
public static VarHandle devParams$VH() {
|
public static VarHandle devParams$VH() {
|
||||||
return sdrplay_api_DeviceParamsT.devParams$VH;
|
return sdrplay_api_DeviceParamsT.devParams$VH;
|
||||||
}
|
}
|
||||||
public static MemoryAddress devParams$get(MemorySegment seg) {
|
/**
|
||||||
return (java.lang.foreign.MemoryAddress)sdrplay_api_DeviceParamsT.devParams$VH.get(seg);
|
* 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);
|
||||||
}
|
}
|
||||||
public static void devParams$set( MemorySegment seg, MemoryAddress x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_DeviceParamsT.devParams$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static MemoryAddress devParams$get(MemorySegment seg, long index) {
|
public static MemorySegment devParams$get(MemorySegment seg, long index) {
|
||||||
return (java.lang.foreign.MemoryAddress)sdrplay_api_DeviceParamsT.devParams$VH.get(seg.asSlice(index*sizeof()));
|
return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceParamsT.devParams$VH.get(seg.asSlice(index*sizeof()));
|
||||||
}
|
}
|
||||||
public static void devParams$set(MemorySegment seg, long index, MemoryAddress x) {
|
public static void devParams$set(MemorySegment seg, long index, MemorySegment x) {
|
||||||
sdrplay_api_DeviceParamsT.devParams$VH.set(seg.asSlice(index*sizeof()), x);
|
sdrplay_api_DeviceParamsT.devParams$VH.set(seg.asSlice(index*sizeof()), x);
|
||||||
}
|
}
|
||||||
static final VarHandle rxChannelA$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rxChannelA"));
|
static final VarHandle rxChannelA$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rxChannelA"));
|
||||||
public static VarHandle rxChannelA$VH() {
|
public static VarHandle rxChannelA$VH() {
|
||||||
return sdrplay_api_DeviceParamsT.rxChannelA$VH;
|
return sdrplay_api_DeviceParamsT.rxChannelA$VH;
|
||||||
}
|
}
|
||||||
public static MemoryAddress rxChannelA$get(MemorySegment seg) {
|
/**
|
||||||
return (java.lang.foreign.MemoryAddress)sdrplay_api_DeviceParamsT.rxChannelA$VH.get(seg);
|
* 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);
|
||||||
}
|
}
|
||||||
public static void rxChannelA$set( MemorySegment seg, MemoryAddress x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_DeviceParamsT.rxChannelA$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static MemoryAddress rxChannelA$get(MemorySegment seg, long index) {
|
public static MemorySegment rxChannelA$get(MemorySegment seg, long index) {
|
||||||
return (java.lang.foreign.MemoryAddress)sdrplay_api_DeviceParamsT.rxChannelA$VH.get(seg.asSlice(index*sizeof()));
|
return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceParamsT.rxChannelA$VH.get(seg.asSlice(index*sizeof()));
|
||||||
}
|
}
|
||||||
public static void rxChannelA$set(MemorySegment seg, long index, MemoryAddress x) {
|
public static void rxChannelA$set(MemorySegment seg, long index, MemorySegment x) {
|
||||||
sdrplay_api_DeviceParamsT.rxChannelA$VH.set(seg.asSlice(index*sizeof()), x);
|
sdrplay_api_DeviceParamsT.rxChannelA$VH.set(seg.asSlice(index*sizeof()), x);
|
||||||
}
|
}
|
||||||
static final VarHandle rxChannelB$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rxChannelB"));
|
static final VarHandle rxChannelB$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rxChannelB"));
|
||||||
public static VarHandle rxChannelB$VH() {
|
public static VarHandle rxChannelB$VH() {
|
||||||
return sdrplay_api_DeviceParamsT.rxChannelB$VH;
|
return sdrplay_api_DeviceParamsT.rxChannelB$VH;
|
||||||
}
|
}
|
||||||
public static MemoryAddress rxChannelB$get(MemorySegment seg) {
|
/**
|
||||||
return (java.lang.foreign.MemoryAddress)sdrplay_api_DeviceParamsT.rxChannelB$VH.get(seg);
|
* 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);
|
||||||
}
|
}
|
||||||
public static void rxChannelB$set( MemorySegment seg, MemoryAddress x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_DeviceParamsT.rxChannelB$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static MemoryAddress rxChannelB$get(MemorySegment seg, long index) {
|
public static MemorySegment rxChannelB$get(MemorySegment seg, long index) {
|
||||||
return (java.lang.foreign.MemoryAddress)sdrplay_api_DeviceParamsT.rxChannelB$VH.get(seg.asSlice(index*sizeof()));
|
return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceParamsT.rxChannelB$VH.get(seg.asSlice(index*sizeof()));
|
||||||
}
|
}
|
||||||
public static void rxChannelB$set(MemorySegment seg, long index, MemoryAddress x) {
|
public static void rxChannelB$set(MemorySegment seg, long index, MemorySegment x) {
|
||||||
sdrplay_api_DeviceParamsT.rxChannelB$VH.set(seg.asSlice(index*sizeof()), x);
|
sdrplay_api_DeviceParamsT.rxChannelB$VH.set(seg.asSlice(index*sizeof()), x);
|
||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,21 +21,33 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* char SerNo[64];
|
||||||
|
* unsigned char hwVer;
|
||||||
|
* sdrplay_api_TunerSelectT tuner;
|
||||||
|
* sdrplay_api_RspDuoModeT rspDuoMode;
|
||||||
|
* double rspDuoSampleFreq;
|
||||||
|
* HANDLE dev;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_DeviceT {
|
public class sdrplay_api_DeviceT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
MemoryLayout.sequenceLayout(64, Constants$root.C_CHAR$LAYOUT).withName("SerNo"),
|
MemoryLayout.sequenceLayout(64, Constants$root.C_CHAR$LAYOUT).withName("SerNo"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("hwVer"),
|
Constants$root.C_CHAR$LAYOUT.withName("hwVer"),
|
||||||
MemoryLayout.paddingLayout(24),
|
MemoryLayout.paddingLayout(24),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("tuner"),
|
Constants$root.C_INT$LAYOUT.withName("tuner"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("rspDuoMode"),
|
Constants$root.C_INT$LAYOUT.withName("rspDuoMode"),
|
||||||
MemoryLayout.paddingLayout(32),
|
MemoryLayout.paddingLayout(32),
|
||||||
Constants$root.C_DOUBLE$LAYOUT.withName("rspDuoSampleFreq"),
|
Constants$root.C_DOUBLE$LAYOUT.withName("rspDuoSampleFreq"),
|
||||||
Constants$root.C_POINTER$LAYOUT.withName("dev")
|
Constants$root.C_POINTER$LAYOUT.withName("dev")
|
||||||
@@ -50,10 +62,22 @@ public class sdrplay_api_DeviceT {
|
|||||||
public static VarHandle hwVer$VH() {
|
public static VarHandle hwVer$VH() {
|
||||||
return sdrplay_api_DeviceT.hwVer$VH;
|
return sdrplay_api_DeviceT.hwVer$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char hwVer;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte hwVer$get(MemorySegment seg) {
|
public static byte hwVer$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_DeviceT.hwVer$VH.get(seg);
|
return (byte)sdrplay_api_DeviceT.hwVer$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void hwVer$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char hwVer;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void hwVer$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_DeviceT.hwVer$VH.set(seg, x);
|
sdrplay_api_DeviceT.hwVer$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte hwVer$get(MemorySegment seg, long index) {
|
public static byte hwVer$get(MemorySegment seg, long index) {
|
||||||
@@ -66,10 +90,22 @@ public class sdrplay_api_DeviceT {
|
|||||||
public static VarHandle tuner$VH() {
|
public static VarHandle tuner$VH() {
|
||||||
return sdrplay_api_DeviceT.tuner$VH;
|
return sdrplay_api_DeviceT.tuner$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_TunerSelectT tuner;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int tuner$get(MemorySegment seg) {
|
public static int tuner$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_DeviceT.tuner$VH.get(seg);
|
return (int)sdrplay_api_DeviceT.tuner$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void tuner$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_DeviceT.tuner$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int tuner$get(MemorySegment seg, long index) {
|
public static int tuner$get(MemorySegment seg, long index) {
|
||||||
@@ -82,10 +118,22 @@ public class sdrplay_api_DeviceT {
|
|||||||
public static VarHandle rspDuoMode$VH() {
|
public static VarHandle rspDuoMode$VH() {
|
||||||
return sdrplay_api_DeviceT.rspDuoMode$VH;
|
return sdrplay_api_DeviceT.rspDuoMode$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_RspDuoModeT rspDuoMode;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int rspDuoMode$get(MemorySegment seg) {
|
public static int rspDuoMode$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_DeviceT.rspDuoMode$VH.get(seg);
|
return (int)sdrplay_api_DeviceT.rspDuoMode$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void rspDuoMode$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_DeviceT.rspDuoMode$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int rspDuoMode$get(MemorySegment seg, long index) {
|
public static int rspDuoMode$get(MemorySegment seg, long index) {
|
||||||
@@ -98,10 +146,22 @@ public class sdrplay_api_DeviceT {
|
|||||||
public static VarHandle rspDuoSampleFreq$VH() {
|
public static VarHandle rspDuoSampleFreq$VH() {
|
||||||
return sdrplay_api_DeviceT.rspDuoSampleFreq$VH;
|
return sdrplay_api_DeviceT.rspDuoSampleFreq$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* double rspDuoSampleFreq;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static double rspDuoSampleFreq$get(MemorySegment seg) {
|
public static double rspDuoSampleFreq$get(MemorySegment seg) {
|
||||||
return (double)sdrplay_api_DeviceT.rspDuoSampleFreq$VH.get(seg);
|
return (double)sdrplay_api_DeviceT.rspDuoSampleFreq$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void rspDuoSampleFreq$set( MemorySegment seg, double x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* double rspDuoSampleFreq;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void rspDuoSampleFreq$set(MemorySegment seg, double x) {
|
||||||
sdrplay_api_DeviceT.rspDuoSampleFreq$VH.set(seg, x);
|
sdrplay_api_DeviceT.rspDuoSampleFreq$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static double rspDuoSampleFreq$get(MemorySegment seg, long index) {
|
public static double rspDuoSampleFreq$get(MemorySegment seg, long index) {
|
||||||
@@ -114,24 +174,36 @@ public class sdrplay_api_DeviceT {
|
|||||||
public static VarHandle dev$VH() {
|
public static VarHandle dev$VH() {
|
||||||
return sdrplay_api_DeviceT.dev$VH;
|
return sdrplay_api_DeviceT.dev$VH;
|
||||||
}
|
}
|
||||||
public static MemoryAddress dev$get(MemorySegment seg) {
|
/**
|
||||||
return (java.lang.foreign.MemoryAddress)sdrplay_api_DeviceT.dev$VH.get(seg);
|
* 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);
|
||||||
}
|
}
|
||||||
public static void dev$set( MemorySegment seg, MemoryAddress x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* HANDLE dev;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void dev$set(MemorySegment seg, MemorySegment x) {
|
||||||
sdrplay_api_DeviceT.dev$VH.set(seg, x);
|
sdrplay_api_DeviceT.dev$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static MemoryAddress dev$get(MemorySegment seg, long index) {
|
public static MemorySegment dev$get(MemorySegment seg, long index) {
|
||||||
return (java.lang.foreign.MemoryAddress)sdrplay_api_DeviceT.dev$VH.get(seg.asSlice(index*sizeof()));
|
return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceT.dev$VH.get(seg.asSlice(index*sizeof()));
|
||||||
}
|
}
|
||||||
public static void dev$set(MemorySegment seg, long index, MemoryAddress x) {
|
public static void dev$set(MemorySegment seg, long index, MemorySegment x) {
|
||||||
sdrplay_api_DeviceT.dev$VH.set(seg.asSlice(index*sizeof()), x);
|
sdrplay_api_DeviceT.dev$VH.set(seg.asSlice(index*sizeof()), x);
|
||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,21 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
import java.lang.foreign.SegmentScope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* enum (*sdrplay_api_DisableHeartbeat_t)();
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_DisableHeartbeat_t {
|
public interface sdrplay_api_DisableHeartbeat_t {
|
||||||
|
|
||||||
int apply();
|
int apply();
|
||||||
static MemorySegment allocate(sdrplay_api_DisableHeartbeat_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_DisableHeartbeat_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_DisableHeartbeat_t.class, fi, constants$4.sdrplay_api_DisableHeartbeat_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_DisableHeartbeat_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return () -> {
|
return () -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$4.sdrplay_api_DisableHeartbeat_t$MH.invokeExact((Addressable)symbol);
|
return (int)constants$4.sdrplay_api_DisableHeartbeat_t_DOWN$MH.invokeExact(symbol);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,19 +21,29 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* char file[256];
|
||||||
|
* char function[256];
|
||||||
|
* int line;
|
||||||
|
* char message[1024];
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_ErrorInfoT {
|
public class sdrplay_api_ErrorInfoT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
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("file"),
|
||||||
MemoryLayout.sequenceLayout(256, Constants$root.C_CHAR$LAYOUT).withName("function"),
|
MemoryLayout.sequenceLayout(256, Constants$root.C_CHAR$LAYOUT).withName("function"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("line"),
|
Constants$root.C_INT$LAYOUT.withName("line"),
|
||||||
MemoryLayout.sequenceLayout(1024, Constants$root.C_CHAR$LAYOUT).withName("message")
|
MemoryLayout.sequenceLayout(1024, Constants$root.C_CHAR$LAYOUT).withName("message")
|
||||||
);
|
);
|
||||||
public static MemoryLayout $LAYOUT() {
|
public static MemoryLayout $LAYOUT() {
|
||||||
@@ -49,10 +59,22 @@ public class sdrplay_api_ErrorInfoT {
|
|||||||
public static VarHandle line$VH() {
|
public static VarHandle line$VH() {
|
||||||
return sdrplay_api_ErrorInfoT.line$VH;
|
return sdrplay_api_ErrorInfoT.line$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int line;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int line$get(MemorySegment seg) {
|
public static int line$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_ErrorInfoT.line$VH.get(seg);
|
return (int)sdrplay_api_ErrorInfoT.line$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void line$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int line;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void line$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_ErrorInfoT.line$VH.set(seg, x);
|
sdrplay_api_ErrorInfoT.line$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int line$get(MemorySegment seg, long index) {
|
public static int line$get(MemorySegment seg, long index) {
|
||||||
@@ -66,10 +88,10 @@ public class sdrplay_api_ErrorInfoT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,21 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
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 {
|
public interface sdrplay_api_EventCallback_t {
|
||||||
|
|
||||||
void apply(int eventId, int tuner, java.lang.foreign.MemoryAddress params, java.lang.foreign.MemoryAddress cbContext);
|
void apply(int eventId, int tuner, java.lang.foreign.MemorySegment params, java.lang.foreign.MemorySegment cbContext);
|
||||||
static MemorySegment allocate(sdrplay_api_EventCallback_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_EventCallback_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_EventCallback_t.class, fi, constants$0.sdrplay_api_EventCallback_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_EventCallback_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (int _eventId, int _tuner, java.lang.foreign.MemoryAddress _params, java.lang.foreign.MemoryAddress _cbContext) -> {
|
return (int _eventId, int _tuner, java.lang.foreign.MemorySegment _params, java.lang.foreign.MemorySegment _cbContext) -> {
|
||||||
try {
|
try {
|
||||||
constants$0.sdrplay_api_EventCallback_t$MH.invokeExact((Addressable)symbol, _eventId, _tuner, (java.lang.foreign.Addressable)_params, (java.lang.foreign.Addressable)_cbContext);
|
constants$0.sdrplay_api_EventCallback_t_DOWN$MH.invokeExact(symbol, _eventId, _tuner, _params, _cbContext);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,25 +21,34 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
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 {
|
public class sdrplay_api_EventParamsT {
|
||||||
|
|
||||||
static final GroupLayout $union$LAYOUT = MemoryLayout.unionLayout(
|
static final UnionLayout $union$LAYOUT = MemoryLayout.unionLayout(
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("gRdB"),
|
Constants$root.C_INT$LAYOUT.withName("gRdB"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("lnaGRdB"),
|
Constants$root.C_INT$LAYOUT.withName("lnaGRdB"),
|
||||||
Constants$root.C_DOUBLE$LAYOUT.withName("currGain")
|
Constants$root.C_DOUBLE$LAYOUT.withName("currGain")
|
||||||
).withName("gainParams"),
|
).withName("gainParams"),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("powerOverloadChangeType")
|
Constants$root.C_INT$LAYOUT.withName("powerOverloadChangeType")
|
||||||
).withName("powerOverloadParams"),
|
).withName("powerOverloadParams"),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("modeChangeType")
|
Constants$root.C_INT$LAYOUT.withName("modeChangeType")
|
||||||
).withName("rspDuoModeParams")
|
).withName("rspDuoModeParams")
|
||||||
);
|
);
|
||||||
public static MemoryLayout $LAYOUT() {
|
public static MemoryLayout $LAYOUT() {
|
||||||
@@ -56,10 +65,10 @@ public class sdrplay_api_EventParamsT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,16 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* double fsHz;
|
||||||
|
* unsigned char syncUpdate;
|
||||||
|
* unsigned char reCal;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_FsFreqT {
|
public class sdrplay_api_FsFreqT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_DOUBLE$LAYOUT.withName("fsHz"),
|
Constants$root.C_DOUBLE$LAYOUT.withName("fsHz"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("reCal"),
|
Constants$root.C_CHAR$LAYOUT.withName("reCal"),
|
||||||
@@ -43,10 +52,22 @@ public class sdrplay_api_FsFreqT {
|
|||||||
public static VarHandle fsHz$VH() {
|
public static VarHandle fsHz$VH() {
|
||||||
return sdrplay_api_FsFreqT.fsHz$VH;
|
return sdrplay_api_FsFreqT.fsHz$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* double fsHz;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static double fsHz$get(MemorySegment seg) {
|
public static double fsHz$get(MemorySegment seg) {
|
||||||
return (double)sdrplay_api_FsFreqT.fsHz$VH.get(seg);
|
return (double)sdrplay_api_FsFreqT.fsHz$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void fsHz$set( MemorySegment seg, double x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* double fsHz;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void fsHz$set(MemorySegment seg, double x) {
|
||||||
sdrplay_api_FsFreqT.fsHz$VH.set(seg, x);
|
sdrplay_api_FsFreqT.fsHz$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static double fsHz$get(MemorySegment seg, long index) {
|
public static double fsHz$get(MemorySegment seg, long index) {
|
||||||
@@ -59,10 +80,22 @@ public class sdrplay_api_FsFreqT {
|
|||||||
public static VarHandle syncUpdate$VH() {
|
public static VarHandle syncUpdate$VH() {
|
||||||
return sdrplay_api_FsFreqT.syncUpdate$VH;
|
return sdrplay_api_FsFreqT.syncUpdate$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char syncUpdate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte syncUpdate$get(MemorySegment seg) {
|
public static byte syncUpdate$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_FsFreqT.syncUpdate$VH.get(seg);
|
return (byte)sdrplay_api_FsFreqT.syncUpdate$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void syncUpdate$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char syncUpdate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void syncUpdate$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_FsFreqT.syncUpdate$VH.set(seg, x);
|
sdrplay_api_FsFreqT.syncUpdate$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte syncUpdate$get(MemorySegment seg, long index) {
|
public static byte syncUpdate$get(MemorySegment seg, long index) {
|
||||||
@@ -75,10 +108,22 @@ public class sdrplay_api_FsFreqT {
|
|||||||
public static VarHandle reCal$VH() {
|
public static VarHandle reCal$VH() {
|
||||||
return sdrplay_api_FsFreqT.reCal$VH;
|
return sdrplay_api_FsFreqT.reCal$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char reCal;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte reCal$get(MemorySegment seg) {
|
public static byte reCal$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_FsFreqT.reCal$VH.get(seg);
|
return (byte)sdrplay_api_FsFreqT.reCal$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void reCal$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char reCal;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void reCal$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_FsFreqT.reCal$VH.set(seg, x);
|
sdrplay_api_FsFreqT.reCal$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte reCal$get(MemorySegment seg, long index) {
|
public static byte reCal$get(MemorySegment seg, long index) {
|
||||||
@@ -89,10 +134,10 @@ public class sdrplay_api_FsFreqT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,18 +21,27 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* unsigned int gRdB;
|
||||||
|
* unsigned int lnaGRdB;
|
||||||
|
* double currGain;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_GainCbParamT {
|
public class sdrplay_api_GainCbParamT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("gRdB"),
|
Constants$root.C_INT$LAYOUT.withName("gRdB"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("lnaGRdB"),
|
Constants$root.C_INT$LAYOUT.withName("lnaGRdB"),
|
||||||
Constants$root.C_DOUBLE$LAYOUT.withName("currGain")
|
Constants$root.C_DOUBLE$LAYOUT.withName("currGain")
|
||||||
);
|
);
|
||||||
public static MemoryLayout $LAYOUT() {
|
public static MemoryLayout $LAYOUT() {
|
||||||
@@ -42,10 +51,22 @@ public class sdrplay_api_GainCbParamT {
|
|||||||
public static VarHandle gRdB$VH() {
|
public static VarHandle gRdB$VH() {
|
||||||
return sdrplay_api_GainCbParamT.gRdB$VH;
|
return sdrplay_api_GainCbParamT.gRdB$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned int gRdB;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int gRdB$get(MemorySegment seg) {
|
public static int gRdB$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_GainCbParamT.gRdB$VH.get(seg);
|
return (int)sdrplay_api_GainCbParamT.gRdB$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void gRdB$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned int gRdB;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void gRdB$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_GainCbParamT.gRdB$VH.set(seg, x);
|
sdrplay_api_GainCbParamT.gRdB$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int gRdB$get(MemorySegment seg, long index) {
|
public static int gRdB$get(MemorySegment seg, long index) {
|
||||||
@@ -58,10 +79,22 @@ public class sdrplay_api_GainCbParamT {
|
|||||||
public static VarHandle lnaGRdB$VH() {
|
public static VarHandle lnaGRdB$VH() {
|
||||||
return sdrplay_api_GainCbParamT.lnaGRdB$VH;
|
return sdrplay_api_GainCbParamT.lnaGRdB$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned int lnaGRdB;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int lnaGRdB$get(MemorySegment seg) {
|
public static int lnaGRdB$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_GainCbParamT.lnaGRdB$VH.get(seg);
|
return (int)sdrplay_api_GainCbParamT.lnaGRdB$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void lnaGRdB$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned int lnaGRdB;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void lnaGRdB$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_GainCbParamT.lnaGRdB$VH.set(seg, x);
|
sdrplay_api_GainCbParamT.lnaGRdB$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int lnaGRdB$get(MemorySegment seg, long index) {
|
public static int lnaGRdB$get(MemorySegment seg, long index) {
|
||||||
@@ -74,10 +107,22 @@ public class sdrplay_api_GainCbParamT {
|
|||||||
public static VarHandle currGain$VH() {
|
public static VarHandle currGain$VH() {
|
||||||
return sdrplay_api_GainCbParamT.currGain$VH;
|
return sdrplay_api_GainCbParamT.currGain$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* double currGain;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static double currGain$get(MemorySegment seg) {
|
public static double currGain$get(MemorySegment seg) {
|
||||||
return (double)sdrplay_api_GainCbParamT.currGain$VH.get(seg);
|
return (double)sdrplay_api_GainCbParamT.currGain$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void currGain$set( MemorySegment seg, double x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* double currGain;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void currGain$set(MemorySegment seg, double x) {
|
||||||
sdrplay_api_GainCbParamT.currGain$VH.set(seg, x);
|
sdrplay_api_GainCbParamT.currGain$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static double currGain$get(MemorySegment seg, long index) {
|
public static double currGain$get(MemorySegment seg, long index) {
|
||||||
@@ -88,10 +133,10 @@ public class sdrplay_api_GainCbParamT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,21 +21,32 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
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 {
|
public class sdrplay_api_GainT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("gRdB"),
|
Constants$root.C_INT$LAYOUT.withName("gRdB"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("LNAstate"),
|
Constants$root.C_CHAR$LAYOUT.withName("LNAstate"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
||||||
MemoryLayout.paddingLayout(16),
|
MemoryLayout.paddingLayout(16),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("minGr"),
|
Constants$root.C_INT$LAYOUT.withName("minGr"),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_FLOAT$LAYOUT.withName("curr"),
|
Constants$root.C_FLOAT$LAYOUT.withName("curr"),
|
||||||
Constants$root.C_FLOAT$LAYOUT.withName("max"),
|
Constants$root.C_FLOAT$LAYOUT.withName("max"),
|
||||||
@@ -49,10 +60,22 @@ public class sdrplay_api_GainT {
|
|||||||
public static VarHandle gRdB$VH() {
|
public static VarHandle gRdB$VH() {
|
||||||
return sdrplay_api_GainT.gRdB$VH;
|
return sdrplay_api_GainT.gRdB$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int gRdB;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int gRdB$get(MemorySegment seg) {
|
public static int gRdB$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_GainT.gRdB$VH.get(seg);
|
return (int)sdrplay_api_GainT.gRdB$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void gRdB$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int gRdB;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void gRdB$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_GainT.gRdB$VH.set(seg, x);
|
sdrplay_api_GainT.gRdB$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int gRdB$get(MemorySegment seg, long index) {
|
public static int gRdB$get(MemorySegment seg, long index) {
|
||||||
@@ -65,10 +88,22 @@ public class sdrplay_api_GainT {
|
|||||||
public static VarHandle LNAstate$VH() {
|
public static VarHandle LNAstate$VH() {
|
||||||
return sdrplay_api_GainT.LNAstate$VH;
|
return sdrplay_api_GainT.LNAstate$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char LNAstate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte LNAstate$get(MemorySegment seg) {
|
public static byte LNAstate$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_GainT.LNAstate$VH.get(seg);
|
return (byte)sdrplay_api_GainT.LNAstate$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void LNAstate$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char LNAstate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void LNAstate$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_GainT.LNAstate$VH.set(seg, x);
|
sdrplay_api_GainT.LNAstate$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte LNAstate$get(MemorySegment seg, long index) {
|
public static byte LNAstate$get(MemorySegment seg, long index) {
|
||||||
@@ -81,10 +116,22 @@ public class sdrplay_api_GainT {
|
|||||||
public static VarHandle syncUpdate$VH() {
|
public static VarHandle syncUpdate$VH() {
|
||||||
return sdrplay_api_GainT.syncUpdate$VH;
|
return sdrplay_api_GainT.syncUpdate$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char syncUpdate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte syncUpdate$get(MemorySegment seg) {
|
public static byte syncUpdate$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_GainT.syncUpdate$VH.get(seg);
|
return (byte)sdrplay_api_GainT.syncUpdate$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void syncUpdate$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char syncUpdate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void syncUpdate$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_GainT.syncUpdate$VH.set(seg, x);
|
sdrplay_api_GainT.syncUpdate$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte syncUpdate$get(MemorySegment seg, long index) {
|
public static byte syncUpdate$get(MemorySegment seg, long index) {
|
||||||
@@ -97,10 +144,22 @@ public class sdrplay_api_GainT {
|
|||||||
public static VarHandle minGr$VH() {
|
public static VarHandle minGr$VH() {
|
||||||
return sdrplay_api_GainT.minGr$VH;
|
return sdrplay_api_GainT.minGr$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_MinGainReductionT minGr;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int minGr$get(MemorySegment seg) {
|
public static int minGr$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_GainT.minGr$VH.get(seg);
|
return (int)sdrplay_api_GainT.minGr$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void minGr$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_GainT.minGr$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int minGr$get(MemorySegment seg, long index) {
|
public static int minGr$get(MemorySegment seg, long index) {
|
||||||
@@ -114,10 +173,10 @@ public class sdrplay_api_GainT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,16 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* float curr;
|
||||||
|
* float max;
|
||||||
|
* float min;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_GainValuesT {
|
public class sdrplay_api_GainValuesT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_FLOAT$LAYOUT.withName("curr"),
|
Constants$root.C_FLOAT$LAYOUT.withName("curr"),
|
||||||
Constants$root.C_FLOAT$LAYOUT.withName("max"),
|
Constants$root.C_FLOAT$LAYOUT.withName("max"),
|
||||||
Constants$root.C_FLOAT$LAYOUT.withName("min")
|
Constants$root.C_FLOAT$LAYOUT.withName("min")
|
||||||
@@ -42,10 +51,22 @@ public class sdrplay_api_GainValuesT {
|
|||||||
public static VarHandle curr$VH() {
|
public static VarHandle curr$VH() {
|
||||||
return sdrplay_api_GainValuesT.curr$VH;
|
return sdrplay_api_GainValuesT.curr$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* float curr;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static float curr$get(MemorySegment seg) {
|
public static float curr$get(MemorySegment seg) {
|
||||||
return (float)sdrplay_api_GainValuesT.curr$VH.get(seg);
|
return (float)sdrplay_api_GainValuesT.curr$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void curr$set( MemorySegment seg, float x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* float curr;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void curr$set(MemorySegment seg, float x) {
|
||||||
sdrplay_api_GainValuesT.curr$VH.set(seg, x);
|
sdrplay_api_GainValuesT.curr$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static float curr$get(MemorySegment seg, long index) {
|
public static float curr$get(MemorySegment seg, long index) {
|
||||||
@@ -58,10 +79,22 @@ public class sdrplay_api_GainValuesT {
|
|||||||
public static VarHandle max$VH() {
|
public static VarHandle max$VH() {
|
||||||
return sdrplay_api_GainValuesT.max$VH;
|
return sdrplay_api_GainValuesT.max$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* float max;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static float max$get(MemorySegment seg) {
|
public static float max$get(MemorySegment seg) {
|
||||||
return (float)sdrplay_api_GainValuesT.max$VH.get(seg);
|
return (float)sdrplay_api_GainValuesT.max$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void max$set( MemorySegment seg, float x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* float max;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void max$set(MemorySegment seg, float x) {
|
||||||
sdrplay_api_GainValuesT.max$VH.set(seg, x);
|
sdrplay_api_GainValuesT.max$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static float max$get(MemorySegment seg, long index) {
|
public static float max$get(MemorySegment seg, long index) {
|
||||||
@@ -74,10 +107,22 @@ public class sdrplay_api_GainValuesT {
|
|||||||
public static VarHandle min$VH() {
|
public static VarHandle min$VH() {
|
||||||
return sdrplay_api_GainValuesT.min$VH;
|
return sdrplay_api_GainValuesT.min$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* float min;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static float min$get(MemorySegment seg) {
|
public static float min$get(MemorySegment seg) {
|
||||||
return (float)sdrplay_api_GainValuesT.min$VH.get(seg);
|
return (float)sdrplay_api_GainValuesT.min$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void min$set( MemorySegment seg, float x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* float min;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void min$set(MemorySegment seg, float x) {
|
||||||
sdrplay_api_GainValuesT.min$VH.set(seg, x);
|
sdrplay_api_GainValuesT.min$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static float min$get(MemorySegment seg, long index) {
|
public static float min$get(MemorySegment seg, long index) {
|
||||||
@@ -88,10 +133,10 @@ public class sdrplay_api_GainValuesT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,21 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
import java.lang.foreign.SegmentScope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* enum (*sdrplay_api_GetDeviceParams_t)(void* dev,struct ** deviceParams);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_GetDeviceParams_t {
|
public interface sdrplay_api_GetDeviceParams_t {
|
||||||
|
|
||||||
int apply(java.lang.foreign.MemoryAddress dev, java.lang.foreign.MemoryAddress deviceParams);
|
int apply(java.lang.foreign.MemorySegment dev, java.lang.foreign.MemorySegment deviceParams);
|
||||||
static MemorySegment allocate(sdrplay_api_GetDeviceParams_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_GetDeviceParams_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_GetDeviceParams_t.class, fi, constants$4.sdrplay_api_GetDeviceParams_t$FUNC, session);
|
return RuntimeHelper.upcallStub(constants$4.sdrplay_api_GetDeviceParams_t_UP$MH, fi, constants$4.sdrplay_api_GetDeviceParams_t$FUNC, scope);
|
||||||
}
|
}
|
||||||
static sdrplay_api_GetDeviceParams_t ofAddress(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_GetDeviceParams_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (java.lang.foreign.MemoryAddress _dev, java.lang.foreign.MemoryAddress _deviceParams) -> {
|
return (java.lang.foreign.MemorySegment _dev, java.lang.foreign.MemorySegment _deviceParams) -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$4.sdrplay_api_GetDeviceParams_t$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)_dev, (java.lang.foreign.Addressable)_deviceParams);
|
return (int)constants$4.sdrplay_api_GetDeviceParams_t_DOWN$MH.invokeExact(symbol, _dev, _deviceParams);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,21 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
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 {
|
public interface sdrplay_api_GetDevices_t {
|
||||||
|
|
||||||
int apply(java.lang.foreign.MemoryAddress devices, java.lang.foreign.MemoryAddress numDevs, int maxDevs);
|
int apply(java.lang.foreign.MemorySegment devices, java.lang.foreign.MemorySegment numDevs, int maxDevs);
|
||||||
static MemorySegment allocate(sdrplay_api_GetDevices_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_GetDevices_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_GetDevices_t.class, fi, constants$2.sdrplay_api_GetDevices_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_GetDevices_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (java.lang.foreign.MemoryAddress _devices, java.lang.foreign.MemoryAddress _numDevs, int _maxDevs) -> {
|
return (java.lang.foreign.MemorySegment _devices, java.lang.foreign.MemorySegment _numDevs, int _maxDevs) -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$2.sdrplay_api_GetDevices_t$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)_devices, (java.lang.foreign.Addressable)_numDevs, _maxDevs);
|
return (int)constants$2.sdrplay_api_GetDevices_t_DOWN$MH.invokeExact(symbol, _devices, _numDevs, _maxDevs);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,21 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
import java.lang.foreign.SegmentScope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* char* (*sdrplay_api_GetErrorString_t)(enum err);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_GetErrorString_t {
|
public interface sdrplay_api_GetErrorString_t {
|
||||||
|
|
||||||
java.lang.foreign.Addressable apply(int err);
|
java.lang.foreign.MemorySegment apply(int err);
|
||||||
static MemorySegment allocate(sdrplay_api_GetErrorString_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_GetErrorString_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_GetErrorString_t.class, fi, constants$3.sdrplay_api_GetErrorString_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_GetErrorString_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (int _err) -> {
|
return (int _err) -> {
|
||||||
try {
|
try {
|
||||||
return (java.lang.foreign.Addressable)(java.lang.foreign.MemoryAddress)constants$3.sdrplay_api_GetErrorString_t$MH.invokeExact((Addressable)symbol, _err);
|
return (java.lang.foreign.MemorySegment)constants$3.sdrplay_api_GetErrorString_t_DOWN$MH.invokeExact(symbol, _err);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,21 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
import java.lang.foreign.SegmentScope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct * (*sdrplay_api_GetLastError_t)(struct * device);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_GetLastError_t {
|
public interface sdrplay_api_GetLastError_t {
|
||||||
|
|
||||||
java.lang.foreign.Addressable apply(java.lang.foreign.MemoryAddress device);
|
java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment device);
|
||||||
static MemorySegment allocate(sdrplay_api_GetLastError_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_GetLastError_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_GetLastError_t.class, fi, constants$3.sdrplay_api_GetLastError_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_GetLastError_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (java.lang.foreign.MemoryAddress _device) -> {
|
return (java.lang.foreign.MemorySegment _device) -> {
|
||||||
try {
|
try {
|
||||||
return (java.lang.foreign.Addressable)(java.lang.foreign.MemoryAddress)constants$3.sdrplay_api_GetLastError_t$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)_device);
|
return (java.lang.foreign.MemorySegment)constants$3.sdrplay_api_GetLastError_t_DOWN$MH.invokeExact(symbol, _device);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,21 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
import java.lang.foreign.SegmentScope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* enum (*sdrplay_api_Init_t)(void* dev,struct * callbackFns,void* cbContext);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_Init_t {
|
public interface sdrplay_api_Init_t {
|
||||||
|
|
||||||
int apply(java.lang.foreign.MemoryAddress dev, java.lang.foreign.MemoryAddress callbackFns, java.lang.foreign.MemoryAddress cbContext);
|
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, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_Init_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_Init_t.class, fi, constants$5.sdrplay_api_Init_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_Init_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (java.lang.foreign.MemoryAddress _dev, java.lang.foreign.MemoryAddress _callbackFns, java.lang.foreign.MemoryAddress _cbContext) -> {
|
return (java.lang.foreign.MemorySegment _dev, java.lang.foreign.MemorySegment _callbackFns, java.lang.foreign.MemorySegment _cbContext) -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$5.sdrplay_api_Init_t$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)_dev, (java.lang.foreign.Addressable)_callbackFns, (java.lang.foreign.Addressable)_cbContext);
|
return (int)constants$5.sdrplay_api_Init_t_DOWN$MH.invokeExact(symbol, _dev, _callbackFns, _cbContext);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,21 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
import java.lang.foreign.SegmentScope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* enum (*sdrplay_api_LockDeviceApi_t)();
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_LockDeviceApi_t {
|
public interface sdrplay_api_LockDeviceApi_t {
|
||||||
|
|
||||||
int apply();
|
int apply();
|
||||||
static MemorySegment allocate(sdrplay_api_LockDeviceApi_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_LockDeviceApi_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_LockDeviceApi_t.class, fi, constants$1.sdrplay_api_LockDeviceApi_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_LockDeviceApi_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return () -> {
|
return () -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$1.sdrplay_api_LockDeviceApi_t$MH.invokeExact((Addressable)symbol);
|
return (int)constants$1.sdrplay_api_LockDeviceApi_t_DOWN$MH.invokeExact(symbol);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,21 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
import java.lang.foreign.SegmentScope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* enum (*sdrplay_api_Open_t)();
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_Open_t {
|
public interface sdrplay_api_Open_t {
|
||||||
|
|
||||||
int apply();
|
int apply();
|
||||||
static MemorySegment allocate(sdrplay_api_Open_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_Open_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_Open_t.class, fi, constants$0.sdrplay_api_Open_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_Open_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return () -> {
|
return () -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$0.sdrplay_api_Open_t$MH.invokeExact((Addressable)symbol);
|
return (int)constants$0.sdrplay_api_Open_t_DOWN$MH.invokeExact(symbol);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,17 +21,24 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* sdrplay_api_PowerOverloadCbEventIdT powerOverloadChangeType;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_PowerOverloadCbParamT {
|
public class sdrplay_api_PowerOverloadCbParamT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("powerOverloadChangeType")
|
Constants$root.C_INT$LAYOUT.withName("powerOverloadChangeType")
|
||||||
);
|
);
|
||||||
public static MemoryLayout $LAYOUT() {
|
public static MemoryLayout $LAYOUT() {
|
||||||
return sdrplay_api_PowerOverloadCbParamT.$struct$LAYOUT;
|
return sdrplay_api_PowerOverloadCbParamT.$struct$LAYOUT;
|
||||||
@@ -40,10 +47,22 @@ public class sdrplay_api_PowerOverloadCbParamT {
|
|||||||
public static VarHandle powerOverloadChangeType$VH() {
|
public static VarHandle powerOverloadChangeType$VH() {
|
||||||
return sdrplay_api_PowerOverloadCbParamT.powerOverloadChangeType$VH;
|
return sdrplay_api_PowerOverloadCbParamT.powerOverloadChangeType$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_PowerOverloadCbEventIdT powerOverloadChangeType;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int powerOverloadChangeType$get(MemorySegment seg) {
|
public static int powerOverloadChangeType$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_PowerOverloadCbParamT.powerOverloadChangeType$VH.get(seg);
|
return (int)sdrplay_api_PowerOverloadCbParamT.powerOverloadChangeType$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void powerOverloadChangeType$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_PowerOverloadCbParamT.powerOverloadChangeType$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int powerOverloadChangeType$get(MemorySegment seg, long index) {
|
public static int powerOverloadChangeType$get(MemorySegment seg, long index) {
|
||||||
@@ -54,10 +73,10 @@ public class sdrplay_api_PowerOverloadCbParamT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,21 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
import java.lang.foreign.SegmentScope;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* enum (*sdrplay_api_ReleaseDevice_t)(struct * device);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_ReleaseDevice_t {
|
public interface sdrplay_api_ReleaseDevice_t {
|
||||||
|
|
||||||
int apply(java.lang.foreign.MemoryAddress device);
|
int apply(java.lang.foreign.MemorySegment currentSampleRate);
|
||||||
static MemorySegment allocate(sdrplay_api_ReleaseDevice_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_ReleaseDevice_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_ReleaseDevice_t.class, fi, constants$3.sdrplay_api_ReleaseDevice_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_ReleaseDevice_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (java.lang.foreign.MemoryAddress _device) -> {
|
return (java.lang.foreign.MemorySegment _currentSampleRate) -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$3.sdrplay_api_ReleaseDevice_t$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)_device);
|
return (int)constants$3.sdrplay_api_ReleaseDevice_t_DOWN$MH.invokeExact(symbol, _currentSampleRate);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,16 +21,25 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* unsigned char resetGainUpdate;
|
||||||
|
* unsigned char resetRfUpdate;
|
||||||
|
* unsigned char resetFsUpdate;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_ResetFlagsT {
|
public class sdrplay_api_ResetFlagsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("resetGainUpdate"),
|
Constants$root.C_CHAR$LAYOUT.withName("resetGainUpdate"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("resetRfUpdate"),
|
Constants$root.C_CHAR$LAYOUT.withName("resetRfUpdate"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("resetFsUpdate")
|
Constants$root.C_CHAR$LAYOUT.withName("resetFsUpdate")
|
||||||
@@ -42,10 +51,22 @@ public class sdrplay_api_ResetFlagsT {
|
|||||||
public static VarHandle resetGainUpdate$VH() {
|
public static VarHandle resetGainUpdate$VH() {
|
||||||
return sdrplay_api_ResetFlagsT.resetGainUpdate$VH;
|
return sdrplay_api_ResetFlagsT.resetGainUpdate$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char resetGainUpdate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte resetGainUpdate$get(MemorySegment seg) {
|
public static byte resetGainUpdate$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_ResetFlagsT.resetGainUpdate$VH.get(seg);
|
return (byte)sdrplay_api_ResetFlagsT.resetGainUpdate$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void resetGainUpdate$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char resetGainUpdate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void resetGainUpdate$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_ResetFlagsT.resetGainUpdate$VH.set(seg, x);
|
sdrplay_api_ResetFlagsT.resetGainUpdate$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte resetGainUpdate$get(MemorySegment seg, long index) {
|
public static byte resetGainUpdate$get(MemorySegment seg, long index) {
|
||||||
@@ -58,10 +79,22 @@ public class sdrplay_api_ResetFlagsT {
|
|||||||
public static VarHandle resetRfUpdate$VH() {
|
public static VarHandle resetRfUpdate$VH() {
|
||||||
return sdrplay_api_ResetFlagsT.resetRfUpdate$VH;
|
return sdrplay_api_ResetFlagsT.resetRfUpdate$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char resetRfUpdate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte resetRfUpdate$get(MemorySegment seg) {
|
public static byte resetRfUpdate$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_ResetFlagsT.resetRfUpdate$VH.get(seg);
|
return (byte)sdrplay_api_ResetFlagsT.resetRfUpdate$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void resetRfUpdate$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char resetRfUpdate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void resetRfUpdate$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_ResetFlagsT.resetRfUpdate$VH.set(seg, x);
|
sdrplay_api_ResetFlagsT.resetRfUpdate$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte resetRfUpdate$get(MemorySegment seg, long index) {
|
public static byte resetRfUpdate$get(MemorySegment seg, long index) {
|
||||||
@@ -74,10 +107,22 @@ public class sdrplay_api_ResetFlagsT {
|
|||||||
public static VarHandle resetFsUpdate$VH() {
|
public static VarHandle resetFsUpdate$VH() {
|
||||||
return sdrplay_api_ResetFlagsT.resetFsUpdate$VH;
|
return sdrplay_api_ResetFlagsT.resetFsUpdate$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char resetFsUpdate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte resetFsUpdate$get(MemorySegment seg) {
|
public static byte resetFsUpdate$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_ResetFlagsT.resetFsUpdate$VH.get(seg);
|
return (byte)sdrplay_api_ResetFlagsT.resetFsUpdate$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void resetFsUpdate$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char resetFsUpdate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void resetFsUpdate$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_ResetFlagsT.resetFsUpdate$VH.set(seg, x);
|
sdrplay_api_ResetFlagsT.resetFsUpdate$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte resetFsUpdate$get(MemorySegment seg, long index) {
|
public static byte resetFsUpdate$get(MemorySegment seg, long index) {
|
||||||
@@ -88,10 +133,10 @@ public class sdrplay_api_ResetFlagsT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,16 +21,24 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* double rfHz;
|
||||||
|
* unsigned char syncUpdate;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_RfFreqT {
|
public class sdrplay_api_RfFreqT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_DOUBLE$LAYOUT.withName("rfHz"),
|
Constants$root.C_DOUBLE$LAYOUT.withName("rfHz"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
||||||
MemoryLayout.paddingLayout(56)
|
MemoryLayout.paddingLayout(56)
|
||||||
@@ -42,10 +50,22 @@ public class sdrplay_api_RfFreqT {
|
|||||||
public static VarHandle rfHz$VH() {
|
public static VarHandle rfHz$VH() {
|
||||||
return sdrplay_api_RfFreqT.rfHz$VH;
|
return sdrplay_api_RfFreqT.rfHz$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* double rfHz;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static double rfHz$get(MemorySegment seg) {
|
public static double rfHz$get(MemorySegment seg) {
|
||||||
return (double)sdrplay_api_RfFreqT.rfHz$VH.get(seg);
|
return (double)sdrplay_api_RfFreqT.rfHz$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void rfHz$set( MemorySegment seg, double x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* double rfHz;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void rfHz$set(MemorySegment seg, double x) {
|
||||||
sdrplay_api_RfFreqT.rfHz$VH.set(seg, x);
|
sdrplay_api_RfFreqT.rfHz$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static double rfHz$get(MemorySegment seg, long index) {
|
public static double rfHz$get(MemorySegment seg, long index) {
|
||||||
@@ -58,10 +78,22 @@ public class sdrplay_api_RfFreqT {
|
|||||||
public static VarHandle syncUpdate$VH() {
|
public static VarHandle syncUpdate$VH() {
|
||||||
return sdrplay_api_RfFreqT.syncUpdate$VH;
|
return sdrplay_api_RfFreqT.syncUpdate$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char syncUpdate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte syncUpdate$get(MemorySegment seg) {
|
public static byte syncUpdate$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_RfFreqT.syncUpdate$VH.get(seg);
|
return (byte)sdrplay_api_RfFreqT.syncUpdate$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void syncUpdate$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char syncUpdate;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void syncUpdate$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_RfFreqT.syncUpdate$VH.set(seg, x);
|
sdrplay_api_RfFreqT.syncUpdate$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte syncUpdate$get(MemorySegment seg, long index) {
|
public static byte syncUpdate$get(MemorySegment seg, long index) {
|
||||||
@@ -72,10 +104,10 @@ public class sdrplay_api_RfFreqT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,16 +21,24 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* unsigned char rfNotchEnable;
|
||||||
|
* unsigned char rfDabNotchEnable;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_Rsp1aParamsT {
|
public class sdrplay_api_Rsp1aParamsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable")
|
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable")
|
||||||
);
|
);
|
||||||
@@ -41,10 +49,22 @@ public class sdrplay_api_Rsp1aParamsT {
|
|||||||
public static VarHandle rfNotchEnable$VH() {
|
public static VarHandle rfNotchEnable$VH() {
|
||||||
return sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH;
|
return sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char rfNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte rfNotchEnable$get(MemorySegment seg) {
|
public static byte rfNotchEnable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH.get(seg);
|
return (byte)sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void rfNotchEnable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char rfNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void rfNotchEnable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH.set(seg, x);
|
sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte rfNotchEnable$get(MemorySegment seg, long index) {
|
public static byte rfNotchEnable$get(MemorySegment seg, long index) {
|
||||||
@@ -57,10 +77,22 @@ public class sdrplay_api_Rsp1aParamsT {
|
|||||||
public static VarHandle rfDabNotchEnable$VH() {
|
public static VarHandle rfDabNotchEnable$VH() {
|
||||||
return sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH;
|
return sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char rfDabNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte rfDabNotchEnable$get(MemorySegment seg) {
|
public static byte rfDabNotchEnable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH.get(seg);
|
return (byte)sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void rfDabNotchEnable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char rfDabNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void rfDabNotchEnable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH.set(seg, x);
|
sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte rfDabNotchEnable$get(MemorySegment seg, long index) {
|
public static byte rfDabNotchEnable$get(MemorySegment seg, long index) {
|
||||||
@@ -71,10 +103,10 @@ public class sdrplay_api_Rsp1aParamsT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,16 +21,23 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* unsigned char biasTEnable;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_Rsp1aTunerParamsT {
|
public class sdrplay_api_Rsp1aTunerParamsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable")
|
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable")
|
||||||
);
|
);
|
||||||
public static MemoryLayout $LAYOUT() {
|
public static MemoryLayout $LAYOUT() {
|
||||||
@@ -40,10 +47,22 @@ public class sdrplay_api_Rsp1aTunerParamsT {
|
|||||||
public static VarHandle biasTEnable$VH() {
|
public static VarHandle biasTEnable$VH() {
|
||||||
return sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH;
|
return sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char biasTEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte biasTEnable$get(MemorySegment seg) {
|
public static byte biasTEnable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH.get(seg);
|
return (byte)sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void biasTEnable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char biasTEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void biasTEnable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH.set(seg, x);
|
sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte biasTEnable$get(MemorySegment seg, long index) {
|
public static byte biasTEnable$get(MemorySegment seg, long index) {
|
||||||
@@ -54,10 +73,10 @@ public class sdrplay_api_Rsp1aTunerParamsT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,16 +21,23 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* unsigned char extRefOutputEn;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_Rsp2ParamsT {
|
public class sdrplay_api_Rsp2ParamsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("extRefOutputEn")
|
Constants$root.C_CHAR$LAYOUT.withName("extRefOutputEn")
|
||||||
);
|
);
|
||||||
public static MemoryLayout $LAYOUT() {
|
public static MemoryLayout $LAYOUT() {
|
||||||
@@ -40,10 +47,22 @@ public class sdrplay_api_Rsp2ParamsT {
|
|||||||
public static VarHandle extRefOutputEn$VH() {
|
public static VarHandle extRefOutputEn$VH() {
|
||||||
return sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH;
|
return sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char extRefOutputEn;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte extRefOutputEn$get(MemorySegment seg) {
|
public static byte extRefOutputEn$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH.get(seg);
|
return (byte)sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void extRefOutputEn$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char extRefOutputEn;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void extRefOutputEn$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH.set(seg, x);
|
sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte extRefOutputEn$get(MemorySegment seg, long index) {
|
public static byte extRefOutputEn$get(MemorySegment seg, long index) {
|
||||||
@@ -54,10 +73,10 @@ public class sdrplay_api_Rsp2ParamsT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,20 +21,30 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
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 {
|
public class sdrplay_api_Rsp2TunerParamsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
||||||
MemoryLayout.paddingLayout(24),
|
MemoryLayout.paddingLayout(24),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("amPortSel"),
|
Constants$root.C_INT$LAYOUT.withName("amPortSel"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("antennaSel"),
|
Constants$root.C_INT$LAYOUT.withName("antennaSel"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||||
MemoryLayout.paddingLayout(24)
|
MemoryLayout.paddingLayout(24)
|
||||||
);
|
);
|
||||||
@@ -45,10 +55,22 @@ public class sdrplay_api_Rsp2TunerParamsT {
|
|||||||
public static VarHandle biasTEnable$VH() {
|
public static VarHandle biasTEnable$VH() {
|
||||||
return sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH;
|
return sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char biasTEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte biasTEnable$get(MemorySegment seg) {
|
public static byte biasTEnable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH.get(seg);
|
return (byte)sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void biasTEnable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char biasTEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void biasTEnable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH.set(seg, x);
|
sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte biasTEnable$get(MemorySegment seg, long index) {
|
public static byte biasTEnable$get(MemorySegment seg, long index) {
|
||||||
@@ -61,10 +83,22 @@ public class sdrplay_api_Rsp2TunerParamsT {
|
|||||||
public static VarHandle amPortSel$VH() {
|
public static VarHandle amPortSel$VH() {
|
||||||
return sdrplay_api_Rsp2TunerParamsT.amPortSel$VH;
|
return sdrplay_api_Rsp2TunerParamsT.amPortSel$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_Rsp2_AmPortSelectT amPortSel;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int amPortSel$get(MemorySegment seg) {
|
public static int amPortSel$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_Rsp2TunerParamsT.amPortSel$VH.get(seg);
|
return (int)sdrplay_api_Rsp2TunerParamsT.amPortSel$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void amPortSel$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_Rsp2TunerParamsT.amPortSel$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int amPortSel$get(MemorySegment seg, long index) {
|
public static int amPortSel$get(MemorySegment seg, long index) {
|
||||||
@@ -77,10 +111,22 @@ public class sdrplay_api_Rsp2TunerParamsT {
|
|||||||
public static VarHandle antennaSel$VH() {
|
public static VarHandle antennaSel$VH() {
|
||||||
return sdrplay_api_Rsp2TunerParamsT.antennaSel$VH;
|
return sdrplay_api_Rsp2TunerParamsT.antennaSel$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_Rsp2_AntennaSelectT antennaSel;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int antennaSel$get(MemorySegment seg) {
|
public static int antennaSel$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_Rsp2TunerParamsT.antennaSel$VH.get(seg);
|
return (int)sdrplay_api_Rsp2TunerParamsT.antennaSel$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void antennaSel$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_Rsp2TunerParamsT.antennaSel$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int antennaSel$get(MemorySegment seg, long index) {
|
public static int antennaSel$get(MemorySegment seg, long index) {
|
||||||
@@ -93,10 +139,22 @@ public class sdrplay_api_Rsp2TunerParamsT {
|
|||||||
public static VarHandle rfNotchEnable$VH() {
|
public static VarHandle rfNotchEnable$VH() {
|
||||||
return sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH;
|
return sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char rfNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte rfNotchEnable$get(MemorySegment seg) {
|
public static byte rfNotchEnable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH.get(seg);
|
return (byte)sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void rfNotchEnable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char rfNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void rfNotchEnable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH.set(seg, x);
|
sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte rfNotchEnable$get(MemorySegment seg, long index) {
|
public static byte rfNotchEnable$get(MemorySegment seg, long index) {
|
||||||
@@ -107,10 +165,10 @@ public class sdrplay_api_Rsp2TunerParamsT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,17 +21,24 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* sdrplay_api_RspDuoModeCbEventIdT modeChangeType;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_RspDuoModeCbParamT {
|
public class sdrplay_api_RspDuoModeCbParamT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("modeChangeType")
|
Constants$root.C_INT$LAYOUT.withName("modeChangeType")
|
||||||
);
|
);
|
||||||
public static MemoryLayout $LAYOUT() {
|
public static MemoryLayout $LAYOUT() {
|
||||||
return sdrplay_api_RspDuoModeCbParamT.$struct$LAYOUT;
|
return sdrplay_api_RspDuoModeCbParamT.$struct$LAYOUT;
|
||||||
@@ -40,10 +47,22 @@ public class sdrplay_api_RspDuoModeCbParamT {
|
|||||||
public static VarHandle modeChangeType$VH() {
|
public static VarHandle modeChangeType$VH() {
|
||||||
return sdrplay_api_RspDuoModeCbParamT.modeChangeType$VH;
|
return sdrplay_api_RspDuoModeCbParamT.modeChangeType$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_RspDuoModeCbEventIdT modeChangeType;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int modeChangeType$get(MemorySegment seg) {
|
public static int modeChangeType$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_RspDuoModeCbParamT.modeChangeType$VH.get(seg);
|
return (int)sdrplay_api_RspDuoModeCbParamT.modeChangeType$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void modeChangeType$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_RspDuoModeCbParamT.modeChangeType$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int modeChangeType$get(MemorySegment seg, long index) {
|
public static int modeChangeType$get(MemorySegment seg, long index) {
|
||||||
@@ -54,10 +73,10 @@ public class sdrplay_api_RspDuoModeCbParamT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,17 +21,24 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* int extRefOutputEn;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_RspDuoParamsT {
|
public class sdrplay_api_RspDuoParamsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("extRefOutputEn")
|
Constants$root.C_INT$LAYOUT.withName("extRefOutputEn")
|
||||||
);
|
);
|
||||||
public static MemoryLayout $LAYOUT() {
|
public static MemoryLayout $LAYOUT() {
|
||||||
return sdrplay_api_RspDuoParamsT.$struct$LAYOUT;
|
return sdrplay_api_RspDuoParamsT.$struct$LAYOUT;
|
||||||
@@ -40,10 +47,22 @@ public class sdrplay_api_RspDuoParamsT {
|
|||||||
public static VarHandle extRefOutputEn$VH() {
|
public static VarHandle extRefOutputEn$VH() {
|
||||||
return sdrplay_api_RspDuoParamsT.extRefOutputEn$VH;
|
return sdrplay_api_RspDuoParamsT.extRefOutputEn$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int extRefOutputEn;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int extRefOutputEn$get(MemorySegment seg) {
|
public static int extRefOutputEn$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_RspDuoParamsT.extRefOutputEn$VH.get(seg);
|
return (int)sdrplay_api_RspDuoParamsT.extRefOutputEn$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void extRefOutputEn$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int extRefOutputEn;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void extRefOutputEn$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_RspDuoParamsT.extRefOutputEn$VH.set(seg, x);
|
sdrplay_api_RspDuoParamsT.extRefOutputEn$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int extRefOutputEn$get(MemorySegment seg, long index) {
|
public static int extRefOutputEn$get(MemorySegment seg, long index) {
|
||||||
@@ -54,10 +73,10 @@ public class sdrplay_api_RspDuoParamsT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,19 +21,30 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* unsigned char biasTEnable;
|
||||||
|
* sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel;
|
||||||
|
* unsigned char tuner1AmNotchEnable;
|
||||||
|
* unsigned char rfNotchEnable;
|
||||||
|
* unsigned char rfDabNotchEnable;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_RspDuoTunerParamsT {
|
public class sdrplay_api_RspDuoTunerParamsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
||||||
MemoryLayout.paddingLayout(24),
|
MemoryLayout.paddingLayout(24),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("tuner1AmPortSel"),
|
Constants$root.C_INT$LAYOUT.withName("tuner1AmPortSel"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("tuner1AmNotchEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("tuner1AmNotchEnable"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"),
|
||||||
@@ -46,10 +57,22 @@ public class sdrplay_api_RspDuoTunerParamsT {
|
|||||||
public static VarHandle biasTEnable$VH() {
|
public static VarHandle biasTEnable$VH() {
|
||||||
return sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH;
|
return sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char biasTEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte biasTEnable$get(MemorySegment seg) {
|
public static byte biasTEnable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH.get(seg);
|
return (byte)sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void biasTEnable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char biasTEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void biasTEnable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH.set(seg, x);
|
sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte biasTEnable$get(MemorySegment seg, long index) {
|
public static byte biasTEnable$get(MemorySegment seg, long index) {
|
||||||
@@ -62,10 +85,22 @@ public class sdrplay_api_RspDuoTunerParamsT {
|
|||||||
public static VarHandle tuner1AmPortSel$VH() {
|
public static VarHandle tuner1AmPortSel$VH() {
|
||||||
return sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$VH;
|
return sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int tuner1AmPortSel$get(MemorySegment seg) {
|
public static int tuner1AmPortSel$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$VH.get(seg);
|
return (int)sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void tuner1AmPortSel$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int tuner1AmPortSel$get(MemorySegment seg, long index) {
|
public static int tuner1AmPortSel$get(MemorySegment seg, long index) {
|
||||||
@@ -78,10 +113,22 @@ public class sdrplay_api_RspDuoTunerParamsT {
|
|||||||
public static VarHandle tuner1AmNotchEnable$VH() {
|
public static VarHandle tuner1AmNotchEnable$VH() {
|
||||||
return sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH;
|
return sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char tuner1AmNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte tuner1AmNotchEnable$get(MemorySegment seg) {
|
public static byte tuner1AmNotchEnable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH.get(seg);
|
return (byte)sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void tuner1AmNotchEnable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char tuner1AmNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void tuner1AmNotchEnable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH.set(seg, x);
|
sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte tuner1AmNotchEnable$get(MemorySegment seg, long index) {
|
public static byte tuner1AmNotchEnable$get(MemorySegment seg, long index) {
|
||||||
@@ -94,10 +141,22 @@ public class sdrplay_api_RspDuoTunerParamsT {
|
|||||||
public static VarHandle rfNotchEnable$VH() {
|
public static VarHandle rfNotchEnable$VH() {
|
||||||
return sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH;
|
return sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char rfNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte rfNotchEnable$get(MemorySegment seg) {
|
public static byte rfNotchEnable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH.get(seg);
|
return (byte)sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void rfNotchEnable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char rfNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void rfNotchEnable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH.set(seg, x);
|
sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte rfNotchEnable$get(MemorySegment seg, long index) {
|
public static byte rfNotchEnable$get(MemorySegment seg, long index) {
|
||||||
@@ -110,10 +169,22 @@ public class sdrplay_api_RspDuoTunerParamsT {
|
|||||||
public static VarHandle rfDabNotchEnable$VH() {
|
public static VarHandle rfDabNotchEnable$VH() {
|
||||||
return sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH;
|
return sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char rfDabNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte rfDabNotchEnable$get(MemorySegment seg) {
|
public static byte rfDabNotchEnable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH.get(seg);
|
return (byte)sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void rfDabNotchEnable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char rfDabNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void rfDabNotchEnable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH.set(seg, x);
|
sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte rfDabNotchEnable$get(MemorySegment seg, long index) {
|
public static byte rfDabNotchEnable$get(MemorySegment seg, long index) {
|
||||||
@@ -124,10 +195,10 @@ public class sdrplay_api_RspDuoTunerParamsT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,20 +21,31 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
|
import java.lang.foreign.StructLayout;
|
||||||
import java.lang.invoke.VarHandle;
|
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 {
|
public class sdrplay_api_RspDxParamsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("hdrEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("hdrEnable"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
||||||
MemoryLayout.paddingLayout(16),
|
MemoryLayout.paddingLayout(16),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("antennaSel"),
|
Constants$root.C_INT$LAYOUT.withName("antennaSel"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"),
|
||||||
MemoryLayout.paddingLayout(16)
|
MemoryLayout.paddingLayout(16)
|
||||||
@@ -46,10 +57,22 @@ public class sdrplay_api_RspDxParamsT {
|
|||||||
public static VarHandle hdrEnable$VH() {
|
public static VarHandle hdrEnable$VH() {
|
||||||
return sdrplay_api_RspDxParamsT.hdrEnable$VH;
|
return sdrplay_api_RspDxParamsT.hdrEnable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char hdrEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte hdrEnable$get(MemorySegment seg) {
|
public static byte hdrEnable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_RspDxParamsT.hdrEnable$VH.get(seg);
|
return (byte)sdrplay_api_RspDxParamsT.hdrEnable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void hdrEnable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char hdrEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void hdrEnable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_RspDxParamsT.hdrEnable$VH.set(seg, x);
|
sdrplay_api_RspDxParamsT.hdrEnable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte hdrEnable$get(MemorySegment seg, long index) {
|
public static byte hdrEnable$get(MemorySegment seg, long index) {
|
||||||
@@ -62,10 +85,22 @@ public class sdrplay_api_RspDxParamsT {
|
|||||||
public static VarHandle biasTEnable$VH() {
|
public static VarHandle biasTEnable$VH() {
|
||||||
return sdrplay_api_RspDxParamsT.biasTEnable$VH;
|
return sdrplay_api_RspDxParamsT.biasTEnable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char biasTEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte biasTEnable$get(MemorySegment seg) {
|
public static byte biasTEnable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_RspDxParamsT.biasTEnable$VH.get(seg);
|
return (byte)sdrplay_api_RspDxParamsT.biasTEnable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void biasTEnable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char biasTEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void biasTEnable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_RspDxParamsT.biasTEnable$VH.set(seg, x);
|
sdrplay_api_RspDxParamsT.biasTEnable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte biasTEnable$get(MemorySegment seg, long index) {
|
public static byte biasTEnable$get(MemorySegment seg, long index) {
|
||||||
@@ -78,10 +113,22 @@ public class sdrplay_api_RspDxParamsT {
|
|||||||
public static VarHandle antennaSel$VH() {
|
public static VarHandle antennaSel$VH() {
|
||||||
return sdrplay_api_RspDxParamsT.antennaSel$VH;
|
return sdrplay_api_RspDxParamsT.antennaSel$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_RspDx_AntennaSelectT antennaSel;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int antennaSel$get(MemorySegment seg) {
|
public static int antennaSel$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_RspDxParamsT.antennaSel$VH.get(seg);
|
return (int)sdrplay_api_RspDxParamsT.antennaSel$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void antennaSel$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_RspDxParamsT.antennaSel$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int antennaSel$get(MemorySegment seg, long index) {
|
public static int antennaSel$get(MemorySegment seg, long index) {
|
||||||
@@ -94,10 +141,22 @@ public class sdrplay_api_RspDxParamsT {
|
|||||||
public static VarHandle rfNotchEnable$VH() {
|
public static VarHandle rfNotchEnable$VH() {
|
||||||
return sdrplay_api_RspDxParamsT.rfNotchEnable$VH;
|
return sdrplay_api_RspDxParamsT.rfNotchEnable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char rfNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte rfNotchEnable$get(MemorySegment seg) {
|
public static byte rfNotchEnable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_RspDxParamsT.rfNotchEnable$VH.get(seg);
|
return (byte)sdrplay_api_RspDxParamsT.rfNotchEnable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void rfNotchEnable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char rfNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void rfNotchEnable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_RspDxParamsT.rfNotchEnable$VH.set(seg, x);
|
sdrplay_api_RspDxParamsT.rfNotchEnable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte rfNotchEnable$get(MemorySegment seg, long index) {
|
public static byte rfNotchEnable$get(MemorySegment seg, long index) {
|
||||||
@@ -110,10 +169,22 @@ public class sdrplay_api_RspDxParamsT {
|
|||||||
public static VarHandle rfDabNotchEnable$VH() {
|
public static VarHandle rfDabNotchEnable$VH() {
|
||||||
return sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH;
|
return sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char rfDabNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static byte rfDabNotchEnable$get(MemorySegment seg) {
|
public static byte rfDabNotchEnable$get(MemorySegment seg) {
|
||||||
return (byte)sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH.get(seg);
|
return (byte)sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void rfDabNotchEnable$set( MemorySegment seg, byte x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned char rfDabNotchEnable;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void rfDabNotchEnable$set(MemorySegment seg, byte x) {
|
||||||
sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH.set(seg, x);
|
sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static byte rfDabNotchEnable$get(MemorySegment seg, long index) {
|
public static byte rfDabNotchEnable$get(MemorySegment seg, long index) {
|
||||||
@@ -124,10 +195,10 @@ public class sdrplay_api_RspDxParamsT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,17 +21,20 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
import java.lang.foreign.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* sdrplay_api_RspDx_HdrModeBwT hdrBw;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_RspDxTunerParamsT {
|
public class sdrplay_api_RspDxTunerParamsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("hdrBw")
|
Constants$root.C_INT$LAYOUT.withName("hdrBw")
|
||||||
);
|
);
|
||||||
public static MemoryLayout $LAYOUT() {
|
public static MemoryLayout $LAYOUT() {
|
||||||
return sdrplay_api_RspDxTunerParamsT.$struct$LAYOUT;
|
return sdrplay_api_RspDxTunerParamsT.$struct$LAYOUT;
|
||||||
@@ -40,10 +43,22 @@ public class sdrplay_api_RspDxTunerParamsT {
|
|||||||
public static VarHandle hdrBw$VH() {
|
public static VarHandle hdrBw$VH() {
|
||||||
return sdrplay_api_RspDxTunerParamsT.hdrBw$VH;
|
return sdrplay_api_RspDxTunerParamsT.hdrBw$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_RspDx_HdrModeBwT hdrBw;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int hdrBw$get(MemorySegment seg) {
|
public static int hdrBw$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_RspDxTunerParamsT.hdrBw$VH.get(seg);
|
return (int)sdrplay_api_RspDxTunerParamsT.hdrBw$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void hdrBw$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_RspDxTunerParamsT.hdrBw$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int hdrBw$get(MemorySegment seg, long index) {
|
public static int hdrBw$get(MemorySegment seg, long index) {
|
||||||
@@ -54,10 +69,10 @@ public class sdrplay_api_RspDxTunerParamsT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,25 +21,33 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
import java.lang.foreign.*;
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
/**
|
||||||
import java.lang.foreign.MemorySegment;
|
* {@snippet :
|
||||||
import java.lang.foreign.MemorySession;
|
* struct {
|
||||||
import java.lang.foreign.SegmentAllocator;
|
* 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 {
|
public class sdrplay_api_RxChannelParamsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("bwType"),
|
Constants$root.C_INT$LAYOUT.withName("bwType"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("ifType"),
|
Constants$root.C_INT$LAYOUT.withName("ifType"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("loMode"),
|
Constants$root.C_INT$LAYOUT.withName("loMode"),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("gRdB"),
|
Constants$root.C_INT$LAYOUT.withName("gRdB"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("LNAstate"),
|
Constants$root.C_CHAR$LAYOUT.withName("LNAstate"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
||||||
MemoryLayout.paddingLayout(16),
|
MemoryLayout.paddingLayout(16),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("minGr"),
|
Constants$root.C_INT$LAYOUT.withName("minGr"),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_FLOAT$LAYOUT.withName("curr"),
|
Constants$root.C_FLOAT$LAYOUT.withName("curr"),
|
||||||
Constants$root.C_FLOAT$LAYOUT.withName("max"),
|
Constants$root.C_FLOAT$LAYOUT.withName("max"),
|
||||||
@@ -56,8 +64,8 @@ public class sdrplay_api_RxChannelParamsT {
|
|||||||
Constants$root.C_CHAR$LAYOUT.withName("dcCal"),
|
Constants$root.C_CHAR$LAYOUT.withName("dcCal"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("speedUp"),
|
Constants$root.C_CHAR$LAYOUT.withName("speedUp"),
|
||||||
MemoryLayout.paddingLayout(16),
|
MemoryLayout.paddingLayout(16),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("trackTime"),
|
Constants$root.C_INT$LAYOUT.withName("trackTime"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("refreshRateTime")
|
Constants$root.C_INT$LAYOUT.withName("refreshRateTime")
|
||||||
).withName("dcOffsetTuner"),
|
).withName("dcOffsetTuner"),
|
||||||
MemoryLayout.paddingLayout(32)
|
MemoryLayout.paddingLayout(32)
|
||||||
).withName("tunerParams"),
|
).withName("tunerParams"),
|
||||||
@@ -73,15 +81,15 @@ public class sdrplay_api_RxChannelParamsT {
|
|||||||
).withName("decimation"),
|
).withName("decimation"),
|
||||||
MemoryLayout.paddingLayout(24),
|
MemoryLayout.paddingLayout(24),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("enable"),
|
Constants$root.C_INT$LAYOUT.withName("enable"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("setPoint_dBfs"),
|
Constants$root.C_INT$LAYOUT.withName("setPoint_dBfs"),
|
||||||
Constants$root.C_SHORT$LAYOUT.withName("attack_ms"),
|
Constants$root.C_SHORT$LAYOUT.withName("attack_ms"),
|
||||||
Constants$root.C_SHORT$LAYOUT.withName("decay_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_delay_ms"),
|
||||||
Constants$root.C_SHORT$LAYOUT.withName("decay_threshold_dB"),
|
Constants$root.C_SHORT$LAYOUT.withName("decay_threshold_dB"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("syncUpdate")
|
Constants$root.C_INT$LAYOUT.withName("syncUpdate")
|
||||||
).withName("agc"),
|
).withName("agc"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("adsbMode")
|
Constants$root.C_INT$LAYOUT.withName("adsbMode")
|
||||||
).withName("ctrlParams"),
|
).withName("ctrlParams"),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable")
|
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable")
|
||||||
@@ -90,22 +98,22 @@ public class sdrplay_api_RxChannelParamsT {
|
|||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
||||||
MemoryLayout.paddingLayout(24),
|
MemoryLayout.paddingLayout(24),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("amPortSel"),
|
Constants$root.C_INT$LAYOUT.withName("amPortSel"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("antennaSel"),
|
Constants$root.C_INT$LAYOUT.withName("antennaSel"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||||
MemoryLayout.paddingLayout(24)
|
MemoryLayout.paddingLayout(24)
|
||||||
).withName("rsp2TunerParams"),
|
).withName("rsp2TunerParams"),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"),
|
||||||
MemoryLayout.paddingLayout(24),
|
MemoryLayout.paddingLayout(24),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("tuner1AmPortSel"),
|
Constants$root.C_INT$LAYOUT.withName("tuner1AmPortSel"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("tuner1AmNotchEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("tuner1AmNotchEnable"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"),
|
Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"),
|
||||||
MemoryLayout.paddingLayout(8)
|
MemoryLayout.paddingLayout(8)
|
||||||
).withName("rspDuoTunerParams"),
|
).withName("rspDuoTunerParams"),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("hdrBw")
|
Constants$root.C_INT$LAYOUT.withName("hdrBw")
|
||||||
).withName("rspDxTunerParams"),
|
).withName("rspDxTunerParams"),
|
||||||
MemoryLayout.paddingLayout(32)
|
MemoryLayout.paddingLayout(32)
|
||||||
);
|
);
|
||||||
@@ -132,10 +140,10 @@ public class sdrplay_api_RxChannelParamsT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,21 +21,24 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
import java.lang.foreign.*;
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
/**
|
||||||
import java.lang.foreign.MemorySession;
|
* {@snippet :
|
||||||
|
* enum (*sdrplay_api_SelectDevice_t)(struct * device);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_SelectDevice_t {
|
public interface sdrplay_api_SelectDevice_t {
|
||||||
|
|
||||||
int apply(java.lang.foreign.MemoryAddress device);
|
int apply(java.lang.foreign.MemorySegment currentSampleRate);
|
||||||
static MemorySegment allocate(sdrplay_api_SelectDevice_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_SelectDevice_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_SelectDevice_t.class, fi, constants$2.sdrplay_api_SelectDevice_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_SelectDevice_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (java.lang.foreign.MemoryAddress _device) -> {
|
return (java.lang.foreign.MemorySegment _currentSampleRate) -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$2.sdrplay_api_SelectDevice_t$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)_device);
|
return (int)constants$2.sdrplay_api_SelectDevice_t_DOWN$MH.invokeExact(symbol, _currentSampleRate);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,21 +21,24 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
import java.lang.foreign.*;
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
/**
|
||||||
import java.lang.foreign.MemorySession;
|
* {@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 {
|
public interface sdrplay_api_StreamCallback_t {
|
||||||
|
|
||||||
void apply(java.lang.foreign.MemoryAddress xi, java.lang.foreign.MemoryAddress xq, java.lang.foreign.MemoryAddress params, int numSamples, int reset, java.lang.foreign.MemoryAddress cbContext);
|
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, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_StreamCallback_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_StreamCallback_t.class, fi, constants$0.sdrplay_api_StreamCallback_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_StreamCallback_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (java.lang.foreign.MemoryAddress _xi, java.lang.foreign.MemoryAddress _xq, java.lang.foreign.MemoryAddress _params, int _numSamples, int _reset, java.lang.foreign.MemoryAddress _cbContext) -> {
|
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 {
|
try {
|
||||||
constants$0.sdrplay_api_StreamCallback_t$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)_xi, (java.lang.foreign.Addressable)_xq, (java.lang.foreign.Addressable)_params, _numSamples, _reset, (java.lang.foreign.Addressable)_cbContext);
|
constants$0.sdrplay_api_StreamCallback_t_DOWN$MH.invokeExact(symbol, _xi, _xq, _params, _numSamples, _reset, _cbContext);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,21 +21,28 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
import java.lang.foreign.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* unsigned int firstSampleNum;
|
||||||
|
* int grChanged;
|
||||||
|
* int rfChanged;
|
||||||
|
* int fsChanged;
|
||||||
|
* unsigned int numSamples;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_StreamCbParamsT {
|
public class sdrplay_api_StreamCbParamsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("firstSampleNum"),
|
Constants$root.C_INT$LAYOUT.withName("firstSampleNum"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("grChanged"),
|
Constants$root.C_INT$LAYOUT.withName("grChanged"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("rfChanged"),
|
Constants$root.C_INT$LAYOUT.withName("rfChanged"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("fsChanged"),
|
Constants$root.C_INT$LAYOUT.withName("fsChanged"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("numSamples")
|
Constants$root.C_INT$LAYOUT.withName("numSamples")
|
||||||
);
|
);
|
||||||
public static MemoryLayout $LAYOUT() {
|
public static MemoryLayout $LAYOUT() {
|
||||||
return sdrplay_api_StreamCbParamsT.$struct$LAYOUT;
|
return sdrplay_api_StreamCbParamsT.$struct$LAYOUT;
|
||||||
@@ -44,10 +51,22 @@ public class sdrplay_api_StreamCbParamsT {
|
|||||||
public static VarHandle firstSampleNum$VH() {
|
public static VarHandle firstSampleNum$VH() {
|
||||||
return sdrplay_api_StreamCbParamsT.firstSampleNum$VH;
|
return sdrplay_api_StreamCbParamsT.firstSampleNum$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned int firstSampleNum;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int firstSampleNum$get(MemorySegment seg) {
|
public static int firstSampleNum$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_StreamCbParamsT.firstSampleNum$VH.get(seg);
|
return (int)sdrplay_api_StreamCbParamsT.firstSampleNum$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void firstSampleNum$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned int firstSampleNum;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void firstSampleNum$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_StreamCbParamsT.firstSampleNum$VH.set(seg, x);
|
sdrplay_api_StreamCbParamsT.firstSampleNum$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int firstSampleNum$get(MemorySegment seg, long index) {
|
public static int firstSampleNum$get(MemorySegment seg, long index) {
|
||||||
@@ -60,10 +79,22 @@ public class sdrplay_api_StreamCbParamsT {
|
|||||||
public static VarHandle grChanged$VH() {
|
public static VarHandle grChanged$VH() {
|
||||||
return sdrplay_api_StreamCbParamsT.grChanged$VH;
|
return sdrplay_api_StreamCbParamsT.grChanged$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int grChanged;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int grChanged$get(MemorySegment seg) {
|
public static int grChanged$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_StreamCbParamsT.grChanged$VH.get(seg);
|
return (int)sdrplay_api_StreamCbParamsT.grChanged$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void grChanged$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int grChanged;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void grChanged$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_StreamCbParamsT.grChanged$VH.set(seg, x);
|
sdrplay_api_StreamCbParamsT.grChanged$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int grChanged$get(MemorySegment seg, long index) {
|
public static int grChanged$get(MemorySegment seg, long index) {
|
||||||
@@ -76,10 +107,22 @@ public class sdrplay_api_StreamCbParamsT {
|
|||||||
public static VarHandle rfChanged$VH() {
|
public static VarHandle rfChanged$VH() {
|
||||||
return sdrplay_api_StreamCbParamsT.rfChanged$VH;
|
return sdrplay_api_StreamCbParamsT.rfChanged$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int rfChanged;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int rfChanged$get(MemorySegment seg) {
|
public static int rfChanged$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_StreamCbParamsT.rfChanged$VH.get(seg);
|
return (int)sdrplay_api_StreamCbParamsT.rfChanged$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void rfChanged$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int rfChanged;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void rfChanged$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_StreamCbParamsT.rfChanged$VH.set(seg, x);
|
sdrplay_api_StreamCbParamsT.rfChanged$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int rfChanged$get(MemorySegment seg, long index) {
|
public static int rfChanged$get(MemorySegment seg, long index) {
|
||||||
@@ -92,10 +135,22 @@ public class sdrplay_api_StreamCbParamsT {
|
|||||||
public static VarHandle fsChanged$VH() {
|
public static VarHandle fsChanged$VH() {
|
||||||
return sdrplay_api_StreamCbParamsT.fsChanged$VH;
|
return sdrplay_api_StreamCbParamsT.fsChanged$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int fsChanged;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int fsChanged$get(MemorySegment seg) {
|
public static int fsChanged$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_StreamCbParamsT.fsChanged$VH.get(seg);
|
return (int)sdrplay_api_StreamCbParamsT.fsChanged$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void fsChanged$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* int fsChanged;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void fsChanged$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_StreamCbParamsT.fsChanged$VH.set(seg, x);
|
sdrplay_api_StreamCbParamsT.fsChanged$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int fsChanged$get(MemorySegment seg, long index) {
|
public static int fsChanged$get(MemorySegment seg, long index) {
|
||||||
@@ -108,10 +163,22 @@ public class sdrplay_api_StreamCbParamsT {
|
|||||||
public static VarHandle numSamples$VH() {
|
public static VarHandle numSamples$VH() {
|
||||||
return sdrplay_api_StreamCbParamsT.numSamples$VH;
|
return sdrplay_api_StreamCbParamsT.numSamples$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned int numSamples;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int numSamples$get(MemorySegment seg) {
|
public static int numSamples$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_StreamCbParamsT.numSamples$VH.get(seg);
|
return (int)sdrplay_api_StreamCbParamsT.numSamples$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void numSamples$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned int numSamples;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void numSamples$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_StreamCbParamsT.numSamples$VH.set(seg, x);
|
sdrplay_api_StreamCbParamsT.numSamples$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int numSamples$get(MemorySegment seg, long index) {
|
public static int numSamples$get(MemorySegment seg, long index) {
|
||||||
@@ -122,10 +189,10 @@ public class sdrplay_api_StreamCbParamsT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,21 +21,24 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
import java.lang.foreign.*;
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
/**
|
||||||
import java.lang.foreign.MemorySession;
|
* {@snippet :
|
||||||
|
* enum (*sdrplay_api_SwapRspDuoActiveTuner_t)(void* dev,enum * tuner,enum tuner1AmPortSel);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_SwapRspDuoActiveTuner_t {
|
public interface sdrplay_api_SwapRspDuoActiveTuner_t {
|
||||||
|
|
||||||
int apply(java.lang.foreign.MemoryAddress dev, java.lang.foreign.MemoryAddress tuner, int tuner1AmPortSel);
|
int apply(java.lang.foreign.MemorySegment dev, java.lang.foreign.MemorySegment tuner, int tuner1AmPortSel);
|
||||||
static MemorySegment allocate(sdrplay_api_SwapRspDuoActiveTuner_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_SwapRspDuoActiveTuner_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_SwapRspDuoActiveTuner_t.class, fi, constants$6.sdrplay_api_SwapRspDuoActiveTuner_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_SwapRspDuoActiveTuner_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (java.lang.foreign.MemoryAddress _dev, java.lang.foreign.MemoryAddress _tuner, int _tuner1AmPortSel) -> {
|
return (java.lang.foreign.MemorySegment _dev, java.lang.foreign.MemorySegment _tuner, int _tuner1AmPortSel) -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$6.sdrplay_api_SwapRspDuoActiveTuner_t$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)_dev, (java.lang.foreign.Addressable)_tuner, _tuner1AmPortSel);
|
return (int)constants$6.sdrplay_api_SwapRspDuoActiveTuner_t_DOWN$MH.invokeExact(symbol, _dev, _tuner, _tuner1AmPortSel);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,21 +21,24 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
import java.lang.foreign.*;
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
/**
|
||||||
import java.lang.foreign.MemorySession;
|
* {@snippet :
|
||||||
|
* enum (*sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t)(double* currentSampleRate);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t {
|
public interface sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t {
|
||||||
|
|
||||||
int apply(java.lang.foreign.MemoryAddress currentSampleRate);
|
int apply(java.lang.foreign.MemorySegment currentSampleRate);
|
||||||
static MemorySegment allocate(sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t.class, fi, constants$6.sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (java.lang.foreign.MemoryAddress _currentSampleRate) -> {
|
return (java.lang.foreign.MemorySegment _currentSampleRate) -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$6.sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)_currentSampleRate);
|
return (int)constants$6.sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_DOWN$MH.invokeExact(symbol, _currentSampleRate);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,21 +21,24 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
import java.lang.foreign.*;
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
/**
|
||||||
import java.lang.foreign.MemorySession;
|
* {@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 {
|
public interface sdrplay_api_SwapRspDuoMode_t {
|
||||||
|
|
||||||
int apply(java.lang.foreign.MemoryAddress currDevice, java.lang.foreign.MemoryAddress deviceParams, int rspDuoMode, double sampleRate, int tuner, int bwType, int ifType, int tuner1AmPortSel);
|
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, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_SwapRspDuoMode_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_SwapRspDuoMode_t.class, fi, constants$6.sdrplay_api_SwapRspDuoMode_t$FUNC, session);
|
return RuntimeHelper.upcallStub(constants$6.sdrplay_api_SwapRspDuoMode_t_UP$MH, fi, constants$6.sdrplay_api_SwapRspDuoMode_t$FUNC, scope);
|
||||||
}
|
}
|
||||||
static sdrplay_api_SwapRspDuoMode_t ofAddress(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_SwapRspDuoMode_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (java.lang.foreign.MemoryAddress _currDevice, java.lang.foreign.MemoryAddress _deviceParams, int _rspDuoMode, double _sampleRate, int _tuner, int _bwType, int _ifType, int _tuner1AmPortSel) -> {
|
return (java.lang.foreign.MemorySegment _currDevice, java.lang.foreign.MemorySegment _deviceParams, int _rspDuoMode, double _sampleRate, int _tuner, int _bwType, int _ifType, int _tuner1AmPortSel) -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$6.sdrplay_api_SwapRspDuoMode_t$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)_currDevice, (java.lang.foreign.Addressable)_deviceParams, _rspDuoMode, _sampleRate, _tuner, _bwType, _ifType, _tuner1AmPortSel);
|
return (int)constants$6.sdrplay_api_SwapRspDuoMode_t_DOWN$MH.invokeExact(symbol, _currDevice, _deviceParams, _rspDuoMode, _sampleRate, _tuner, _bwType, _ifType, _tuner1AmPortSel);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,18 +21,22 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
import java.lang.foreign.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@snippet :
|
||||||
|
* struct {
|
||||||
|
* unsigned int sampleNum;
|
||||||
|
* unsigned int period;
|
||||||
|
* };
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public class sdrplay_api_SyncUpdateT {
|
public class sdrplay_api_SyncUpdateT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("sampleNum"),
|
Constants$root.C_INT$LAYOUT.withName("sampleNum"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("period")
|
Constants$root.C_INT$LAYOUT.withName("period")
|
||||||
);
|
);
|
||||||
public static MemoryLayout $LAYOUT() {
|
public static MemoryLayout $LAYOUT() {
|
||||||
return sdrplay_api_SyncUpdateT.$struct$LAYOUT;
|
return sdrplay_api_SyncUpdateT.$struct$LAYOUT;
|
||||||
@@ -41,10 +45,22 @@ public class sdrplay_api_SyncUpdateT {
|
|||||||
public static VarHandle sampleNum$VH() {
|
public static VarHandle sampleNum$VH() {
|
||||||
return sdrplay_api_SyncUpdateT.sampleNum$VH;
|
return sdrplay_api_SyncUpdateT.sampleNum$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned int sampleNum;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int sampleNum$get(MemorySegment seg) {
|
public static int sampleNum$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_SyncUpdateT.sampleNum$VH.get(seg);
|
return (int)sdrplay_api_SyncUpdateT.sampleNum$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void sampleNum$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned int sampleNum;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void sampleNum$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_SyncUpdateT.sampleNum$VH.set(seg, x);
|
sdrplay_api_SyncUpdateT.sampleNum$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int sampleNum$get(MemorySegment seg, long index) {
|
public static int sampleNum$get(MemorySegment seg, long index) {
|
||||||
@@ -57,10 +73,22 @@ public class sdrplay_api_SyncUpdateT {
|
|||||||
public static VarHandle period$VH() {
|
public static VarHandle period$VH() {
|
||||||
return sdrplay_api_SyncUpdateT.period$VH;
|
return sdrplay_api_SyncUpdateT.period$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned int period;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int period$get(MemorySegment seg) {
|
public static int period$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_SyncUpdateT.period$VH.get(seg);
|
return (int)sdrplay_api_SyncUpdateT.period$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void period$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* Setter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* unsigned int period;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
public static void period$set(MemorySegment seg, int x) {
|
||||||
sdrplay_api_SyncUpdateT.period$VH.set(seg, x);
|
sdrplay_api_SyncUpdateT.period$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int period$get(MemorySegment seg, long index) {
|
public static int period$get(MemorySegment seg, long index) {
|
||||||
@@ -71,10 +99,10 @@ public class sdrplay_api_SyncUpdateT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,25 +21,33 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.GroupLayout;
|
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
|
||||||
import java.lang.invoke.VarHandle;
|
import java.lang.invoke.VarHandle;
|
||||||
|
import java.lang.foreign.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@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 {
|
public class sdrplay_api_TunerParamsT {
|
||||||
|
|
||||||
static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("bwType"),
|
Constants$root.C_INT$LAYOUT.withName("bwType"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("ifType"),
|
Constants$root.C_INT$LAYOUT.withName("ifType"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("loMode"),
|
Constants$root.C_INT$LAYOUT.withName("loMode"),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_LONG$LAYOUT.withName("gRdB"),
|
Constants$root.C_INT$LAYOUT.withName("gRdB"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("LNAstate"),
|
Constants$root.C_CHAR$LAYOUT.withName("LNAstate"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"),
|
||||||
MemoryLayout.paddingLayout(16),
|
MemoryLayout.paddingLayout(16),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("minGr"),
|
Constants$root.C_INT$LAYOUT.withName("minGr"),
|
||||||
MemoryLayout.structLayout(
|
MemoryLayout.structLayout(
|
||||||
Constants$root.C_FLOAT$LAYOUT.withName("curr"),
|
Constants$root.C_FLOAT$LAYOUT.withName("curr"),
|
||||||
Constants$root.C_FLOAT$LAYOUT.withName("max"),
|
Constants$root.C_FLOAT$LAYOUT.withName("max"),
|
||||||
@@ -56,8 +64,8 @@ public class sdrplay_api_TunerParamsT {
|
|||||||
Constants$root.C_CHAR$LAYOUT.withName("dcCal"),
|
Constants$root.C_CHAR$LAYOUT.withName("dcCal"),
|
||||||
Constants$root.C_CHAR$LAYOUT.withName("speedUp"),
|
Constants$root.C_CHAR$LAYOUT.withName("speedUp"),
|
||||||
MemoryLayout.paddingLayout(16),
|
MemoryLayout.paddingLayout(16),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("trackTime"),
|
Constants$root.C_INT$LAYOUT.withName("trackTime"),
|
||||||
Constants$root.C_LONG$LAYOUT.withName("refreshRateTime")
|
Constants$root.C_INT$LAYOUT.withName("refreshRateTime")
|
||||||
).withName("dcOffsetTuner"),
|
).withName("dcOffsetTuner"),
|
||||||
MemoryLayout.paddingLayout(32)
|
MemoryLayout.paddingLayout(32)
|
||||||
);
|
);
|
||||||
@@ -68,10 +76,22 @@ public class sdrplay_api_TunerParamsT {
|
|||||||
public static VarHandle bwType$VH() {
|
public static VarHandle bwType$VH() {
|
||||||
return sdrplay_api_TunerParamsT.bwType$VH;
|
return sdrplay_api_TunerParamsT.bwType$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_Bw_MHzT bwType;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int bwType$get(MemorySegment seg) {
|
public static int bwType$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_TunerParamsT.bwType$VH.get(seg);
|
return (int)sdrplay_api_TunerParamsT.bwType$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void bwType$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_TunerParamsT.bwType$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int bwType$get(MemorySegment seg, long index) {
|
public static int bwType$get(MemorySegment seg, long index) {
|
||||||
@@ -84,10 +104,22 @@ public class sdrplay_api_TunerParamsT {
|
|||||||
public static VarHandle ifType$VH() {
|
public static VarHandle ifType$VH() {
|
||||||
return sdrplay_api_TunerParamsT.ifType$VH;
|
return sdrplay_api_TunerParamsT.ifType$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_If_kHzT ifType;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int ifType$get(MemorySegment seg) {
|
public static int ifType$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_TunerParamsT.ifType$VH.get(seg);
|
return (int)sdrplay_api_TunerParamsT.ifType$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void ifType$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_TunerParamsT.ifType$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int ifType$get(MemorySegment seg, long index) {
|
public static int ifType$get(MemorySegment seg, long index) {
|
||||||
@@ -100,10 +132,22 @@ public class sdrplay_api_TunerParamsT {
|
|||||||
public static VarHandle loMode$VH() {
|
public static VarHandle loMode$VH() {
|
||||||
return sdrplay_api_TunerParamsT.loMode$VH;
|
return sdrplay_api_TunerParamsT.loMode$VH;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Getter for field:
|
||||||
|
* {@snippet :
|
||||||
|
* sdrplay_api_LoModeT loMode;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public static int loMode$get(MemorySegment seg) {
|
public static int loMode$get(MemorySegment seg) {
|
||||||
return (int)sdrplay_api_TunerParamsT.loMode$VH.get(seg);
|
return (int)sdrplay_api_TunerParamsT.loMode$VH.get(seg);
|
||||||
}
|
}
|
||||||
public static void loMode$set( MemorySegment seg, int x) {
|
/**
|
||||||
|
* 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);
|
sdrplay_api_TunerParamsT.loMode$VH.set(seg, x);
|
||||||
}
|
}
|
||||||
public static int loMode$get(MemorySegment seg, long index) {
|
public static int loMode$get(MemorySegment seg, long index) {
|
||||||
@@ -123,10 +167,10 @@ public class sdrplay_api_TunerParamsT {
|
|||||||
}
|
}
|
||||||
public static long sizeof() { return $LAYOUT().byteSize(); }
|
public static long sizeof() { return $LAYOUT().byteSize(); }
|
||||||
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
|
||||||
public static MemorySegment allocateArray(int len, SegmentAllocator allocator) {
|
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
|
||||||
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
|
||||||
}
|
}
|
||||||
public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); }
|
public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,21 +21,24 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
import java.lang.foreign.*;
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
/**
|
||||||
import java.lang.foreign.MemorySession;
|
* {@snippet :
|
||||||
|
* enum (*sdrplay_api_Uninit_t)(void* dev);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_Uninit_t {
|
public interface sdrplay_api_Uninit_t {
|
||||||
|
|
||||||
int apply(java.lang.foreign.MemoryAddress dev);
|
int apply(java.lang.foreign.MemorySegment currentSampleRate);
|
||||||
static MemorySegment allocate(sdrplay_api_Uninit_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_Uninit_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_Uninit_t.class, fi, constants$5.sdrplay_api_Uninit_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_Uninit_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (java.lang.foreign.MemoryAddress _dev) -> {
|
return (java.lang.foreign.MemorySegment _currentSampleRate) -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$5.sdrplay_api_Uninit_t$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)_dev);
|
return (int)constants$5.sdrplay_api_Uninit_t_DOWN$MH.invokeExact(symbol, _currentSampleRate);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,21 +21,24 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
import java.lang.foreign.*;
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
/**
|
||||||
import java.lang.foreign.MemorySession;
|
* {@snippet :
|
||||||
|
* enum (*sdrplay_api_UnlockDeviceApi_t)();
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_UnlockDeviceApi_t {
|
public interface sdrplay_api_UnlockDeviceApi_t {
|
||||||
|
|
||||||
int apply();
|
int apply();
|
||||||
static MemorySegment allocate(sdrplay_api_UnlockDeviceApi_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_UnlockDeviceApi_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_UnlockDeviceApi_t.class, fi, constants$2.sdrplay_api_UnlockDeviceApi_t$FUNC, session);
|
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(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_UnlockDeviceApi_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return () -> {
|
return () -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$2.sdrplay_api_UnlockDeviceApi_t$MH.invokeExact((Addressable)symbol);
|
return (int)constants$2.sdrplay_api_UnlockDeviceApi_t_DOWN$MH.invokeExact(symbol);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,21 +21,24 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_07;
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
import java.lang.foreign.*;
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemorySegment;
|
/**
|
||||||
import java.lang.foreign.MemorySession;
|
* {@snippet :
|
||||||
|
* enum (*sdrplay_api_Update_t)(void* dev,enum tuner,enum reasonForUpdate,enum reasonForUpdateExt1);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
public interface sdrplay_api_Update_t {
|
public interface sdrplay_api_Update_t {
|
||||||
|
|
||||||
int apply(java.lang.foreign.MemoryAddress dev, int tuner, int reasonForUpdate, int reasonForUpdateExt1);
|
int apply(java.lang.foreign.MemorySegment dev, int tuner, int reasonForUpdate, int reasonForUpdateExt1);
|
||||||
static MemorySegment allocate(sdrplay_api_Update_t fi, MemorySession session) {
|
static MemorySegment allocate(sdrplay_api_Update_t fi, SegmentScope scope) {
|
||||||
return RuntimeHelper.upcallStub(sdrplay_api_Update_t.class, fi, constants$5.sdrplay_api_Update_t$FUNC, session);
|
return RuntimeHelper.upcallStub(constants$5.sdrplay_api_Update_t_UP$MH, fi, constants$5.sdrplay_api_Update_t$FUNC, scope);
|
||||||
}
|
}
|
||||||
static sdrplay_api_Update_t ofAddress(MemoryAddress addr, MemorySession session) {
|
static sdrplay_api_Update_t ofAddress(MemorySegment addr, SegmentScope scope) {
|
||||||
MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session);
|
MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope);
|
||||||
return (java.lang.foreign.MemoryAddress _dev, int _tuner, int _reasonForUpdate, int _reasonForUpdateExt1) -> {
|
return (java.lang.foreign.MemorySegment _dev, int _tuner, int _reasonForUpdate, int _reasonForUpdateExt1) -> {
|
||||||
try {
|
try {
|
||||||
return (int)constants$5.sdrplay_api_Update_t$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)_dev, _tuner, _reasonForUpdate, _reasonForUpdateExt1);
|
return (int)constants$5.sdrplay_api_Update_t_DOWN$MH.invokeExact(symbol, _dev, _tuner, _reasonForUpdate, _reasonForUpdateExt1);
|
||||||
} catch (Throwable ex$) {
|
} catch (Throwable ex$) {
|
||||||
throw new AssertionError("should not reach here", ex$);
|
throw new AssertionError("should not reach here", ex$);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -37,17 +37,19 @@ import static java.lang.foreign.ValueLayout.OfFloat;
|
|||||||
import static java.lang.foreign.ValueLayout.OfInt;
|
import static java.lang.foreign.ValueLayout.OfInt;
|
||||||
import static java.lang.foreign.ValueLayout.OfLong;
|
import static java.lang.foreign.ValueLayout.OfLong;
|
||||||
import static java.lang.foreign.ValueLayout.OfShort;
|
import static java.lang.foreign.ValueLayout.OfShort;
|
||||||
public class Constants$root {
|
final class Constants$root {
|
||||||
|
|
||||||
static final OfBoolean C_BOOL$LAYOUT = JAVA_BOOLEAN;
|
// Suppresses default constructor, ensuring non-instantiability.
|
||||||
static final OfByte C_CHAR$LAYOUT = JAVA_BYTE;
|
private Constants$root() {}
|
||||||
static final OfShort C_SHORT$LAYOUT = JAVA_SHORT.withBitAlignment(16);
|
static final OfBoolean C_BOOL$LAYOUT = JAVA_BOOLEAN;
|
||||||
static final OfInt C_INT$LAYOUT = JAVA_INT.withBitAlignment(32);
|
static final OfByte C_CHAR$LAYOUT = JAVA_BYTE;
|
||||||
static final OfInt C_LONG$LAYOUT = JAVA_INT.withBitAlignment(32);
|
static final OfShort C_SHORT$LAYOUT = JAVA_SHORT;
|
||||||
static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG.withBitAlignment(64);
|
static final OfInt C_INT$LAYOUT = JAVA_INT;
|
||||||
static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT.withBitAlignment(32);
|
static final OfLong C_LONG$LAYOUT = JAVA_LONG;
|
||||||
static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE.withBitAlignment(64);
|
static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG;
|
||||||
static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64);
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,15 +20,13 @@
|
|||||||
package io.github.dsheirer.source.tuner.sdrplay.api.v3_08;
|
package io.github.dsheirer.source.tuner.sdrplay.api.v3_08;
|
||||||
// Generated by jextract
|
// Generated by jextract
|
||||||
|
|
||||||
import java.lang.foreign.Addressable;
|
|
||||||
import java.lang.foreign.FunctionDescriptor;
|
import java.lang.foreign.FunctionDescriptor;
|
||||||
import java.lang.foreign.GroupLayout;
|
import java.lang.foreign.GroupLayout;
|
||||||
import java.lang.foreign.Linker;
|
import java.lang.foreign.Linker;
|
||||||
import java.lang.foreign.MemoryAddress;
|
|
||||||
import java.lang.foreign.MemoryLayout;
|
import java.lang.foreign.MemoryLayout;
|
||||||
import java.lang.foreign.MemorySegment;
|
import java.lang.foreign.MemorySegment;
|
||||||
import java.lang.foreign.MemorySession;
|
|
||||||
import java.lang.foreign.SegmentAllocator;
|
import java.lang.foreign.SegmentAllocator;
|
||||||
|
import java.lang.foreign.SegmentScope;
|
||||||
import java.lang.foreign.SymbolLookup;
|
import java.lang.foreign.SymbolLookup;
|
||||||
import java.lang.foreign.ValueLayout;
|
import java.lang.foreign.ValueLayout;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
@@ -41,21 +39,24 @@ import static java.lang.foreign.ValueLayout.JAVA_LONG;
|
|||||||
|
|
||||||
final class RuntimeHelper {
|
final class RuntimeHelper {
|
||||||
|
|
||||||
private RuntimeHelper() {}
|
private static final Linker LINKER = Linker.nativeLinker();
|
||||||
private final static Linker LINKER = Linker.nativeLinker();
|
private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader();
|
||||||
private final static ClassLoader LOADER = RuntimeHelper.class.getClassLoader();
|
private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup();
|
||||||
private final static MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup();
|
private static final SymbolLookup SYMBOL_LOOKUP;
|
||||||
private final static SymbolLookup SYMBOL_LOOKUP;
|
private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); };
|
||||||
|
|
||||||
final static SegmentAllocator CONSTANT_ALLOCATOR =
|
final static SegmentAllocator CONSTANT_ALLOCATOR =
|
||||||
(size, align) -> MemorySegment.allocateNative(size, align, MemorySession.openImplicit());
|
(size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto());
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// System.loadLibrary("libsdrplay_api");
|
// System.loadLibrary("libsdrplay_api");
|
||||||
SymbolLookup loaderLookup = SymbolLookup.loaderLookup();
|
SymbolLookup loaderLookup = SymbolLookup.loaderLookup();
|
||||||
SYMBOL_LOOKUP = name -> loaderLookup.lookup(name).or(() -> LINKER.defaultLookup().lookup(name));
|
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) {
|
static <T> T requireNonNull(T obj, String symbolName) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName);
|
throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName);
|
||||||
@@ -63,45 +64,50 @@ final class RuntimeHelper {
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final static SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); };
|
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 final MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) {
|
|
||||||
return SYMBOL_LOOKUP.lookup(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), MemorySession.openShared())).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static final MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) {
|
static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) {
|
||||||
return SYMBOL_LOOKUP.lookup(name).
|
return SYMBOL_LOOKUP.find(name).
|
||||||
map(addr -> LINKER.downcallHandle(addr, fdesc)).
|
map(addr -> LINKER.downcallHandle(addr, fdesc)).
|
||||||
orElse(null);
|
orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
static final MethodHandle downcallHandle(FunctionDescriptor fdesc) {
|
static MethodHandle downcallHandle(FunctionDescriptor fdesc) {
|
||||||
return LINKER.downcallHandle(fdesc);
|
return LINKER.downcallHandle(fdesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static final MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) {
|
static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) {
|
||||||
return SYMBOL_LOOKUP.lookup(name).
|
return SYMBOL_LOOKUP.find(name).
|
||||||
map(addr -> VarargsInvoker.make(addr, fdesc)).
|
map(addr -> VarargsInvoker.make(addr, fdesc)).
|
||||||
orElse(null);
|
orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
static final <Z> MemorySegment upcallStub(Class<Z> fi, Z z, FunctionDescriptor fdesc, MemorySession session) {
|
static MethodHandle upcallHandle(Class<?> fi, String name, FunctionDescriptor fdesc) {
|
||||||
try {
|
try {
|
||||||
MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", Linker.upcallType(fdesc));
|
return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType());
|
||||||
handle = handle.bindTo(z);
|
|
||||||
return LINKER.upcallStub(handle, fdesc, session);
|
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
throw new AssertionError(ex);
|
throw new AssertionError(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static MemorySegment asArray(MemoryAddress addr, MemoryLayout layout, int numElements, MemorySession session) {
|
static <Z> MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, SegmentScope scope) {
|
||||||
return MemorySegment.ofAddress(addr, numElements * layout.byteSize(), session);
|
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
|
// Internals only below this point
|
||||||
|
|
||||||
private static class VarargsInvoker {
|
private static final class VarargsInvoker {
|
||||||
private static final MethodHandle INVOKE_MH;
|
private static final MethodHandle INVOKE_MH;
|
||||||
private final MemorySegment symbol;
|
private final MemorySegment symbol;
|
||||||
private final FunctionDescriptor function;
|
private final FunctionDescriptor function;
|
||||||
@@ -127,7 +133,9 @@ final class RuntimeHelper {
|
|||||||
mtype = mtype.appendParameterTypes(carrier(layout, false));
|
mtype = mtype.appendParameterTypes(carrier(layout, false));
|
||||||
}
|
}
|
||||||
mtype = mtype.appendParameterTypes(Object[].class);
|
mtype = mtype.appendParameterTypes(Object[].class);
|
||||||
if (mtype.returnType().equals(MemorySegment.class)) {
|
boolean needsAllocator = function.returnLayout().isPresent() &&
|
||||||
|
function.returnLayout().get() instanceof GroupLayout;
|
||||||
|
if (needsAllocator) {
|
||||||
mtype = mtype.insertParameterTypes(0, SegmentAllocator.class);
|
mtype = mtype.insertParameterTypes(0, SegmentAllocator.class);
|
||||||
} else {
|
} else {
|
||||||
handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR);
|
handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR);
|
||||||
@@ -137,8 +145,7 @@ final class RuntimeHelper {
|
|||||||
|
|
||||||
static Class<?> carrier(MemoryLayout layout, boolean ret) {
|
static Class<?> carrier(MemoryLayout layout, boolean ret) {
|
||||||
if (layout instanceof ValueLayout valueLayout) {
|
if (layout instanceof ValueLayout valueLayout) {
|
||||||
return (ret || valueLayout.carrier() != MemoryAddress.class) ?
|
return valueLayout.carrier();
|
||||||
valueLayout.carrier() : Addressable.class;
|
|
||||||
} else if (layout instanceof GroupLayout) {
|
} else if (layout instanceof GroupLayout) {
|
||||||
return MemorySegment.class;
|
return MemorySegment.class;
|
||||||
} else {
|
} else {
|
||||||
@@ -173,7 +180,9 @@ final class RuntimeHelper {
|
|||||||
FunctionDescriptor.ofVoid(argLayouts) :
|
FunctionDescriptor.ofVoid(argLayouts) :
|
||||||
FunctionDescriptor.of(function.returnLayout().get(), argLayouts);
|
FunctionDescriptor.of(function.returnLayout().get(), argLayouts);
|
||||||
MethodHandle mh = LINKER.downcallHandle(symbol, f);
|
MethodHandle mh = LINKER.downcallHandle(symbol, f);
|
||||||
if (mh.type().returnType() == MemorySegment.class) {
|
boolean needsAllocator = function.returnLayout().isPresent() &&
|
||||||
|
function.returnLayout().get() instanceof GroupLayout;
|
||||||
|
if (needsAllocator) {
|
||||||
mh = mh.bindTo(allocator);
|
mh = mh.bindTo(allocator);
|
||||||
}
|
}
|
||||||
// flatten argument list so that it can be passed to an asSpreader MH
|
// flatten argument list so that it can be passed to an asSpreader MH
|
||||||
@@ -223,10 +232,7 @@ final class RuntimeHelper {
|
|||||||
if (c.isPrimitive()) {
|
if (c.isPrimitive()) {
|
||||||
return promote(c);
|
return promote(c);
|
||||||
}
|
}
|
||||||
if (MemoryAddress.class.isAssignableFrom(c)) {
|
if (c == MemorySegment.class) {
|
||||||
return MemoryAddress.class;
|
|
||||||
}
|
|
||||||
if (MemorySegment.class.isAssignableFrom(c)) {
|
|
||||||
return MemorySegment.class;
|
return MemorySegment.class;
|
||||||
}
|
}
|
||||||
throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName());
|
throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName());
|
||||||
@@ -237,7 +243,7 @@ final class RuntimeHelper {
|
|||||||
return JAVA_LONG;
|
return JAVA_LONG;
|
||||||
} else if (c == double.class) {
|
} else if (c == double.class) {
|
||||||
return JAVA_DOUBLE;
|
return JAVA_DOUBLE;
|
||||||
} else if (MemoryAddress.class.isAssignableFrom(c)) {
|
} else if (c == MemorySegment.class) {
|
||||||
return ADDRESS;
|
return ADDRESS;
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Unhandled variadic argument class: " + c);
|
throw new IllegalArgumentException("Unhandled variadic argument class: " + c);
|
||||||
|
|||||||
@@ -23,31 +23,67 @@ package io.github.dsheirer.source.tuner.sdrplay.api.v3_08;
|
|||||||
|
|
||||||
import java.lang.foreign.FunctionDescriptor;
|
import java.lang.foreign.FunctionDescriptor;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
class constants$0 {
|
|
||||||
|
|
||||||
|
final class constants$0 {
|
||||||
|
|
||||||
|
// Suppresses default constructor, ensuring non-instantiability.
|
||||||
|
private constants$0() {}
|
||||||
static final FunctionDescriptor sdrplay_api_StreamCallback_t$FUNC = FunctionDescriptor.ofVoid(
|
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_POINTER$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_StreamCallback_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_StreamCallback_t_UP$FUNC = FunctionDescriptor.ofVoid(
|
||||||
constants$0.sdrplay_api_StreamCallback_t$FUNC
|
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(
|
static final FunctionDescriptor sdrplay_api_EventCallback_t$FUNC = FunctionDescriptor.ofVoid(
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_LONG$LAYOUT,
|
Constants$root.C_INT$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT,
|
Constants$root.C_POINTER$LAYOUT,
|
||||||
Constants$root.C_POINTER$LAYOUT
|
Constants$root.C_POINTER$LAYOUT
|
||||||
);
|
);
|
||||||
static final MethodHandle sdrplay_api_EventCallback_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_EventCallback_t_UP$FUNC = FunctionDescriptor.ofVoid(
|
||||||
constants$0.sdrplay_api_EventCallback_t$FUNC
|
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_Open_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$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 MethodHandle sdrplay_api_Open_t$MH = RuntimeHelper.downcallHandle(
|
static final FunctionDescriptor sdrplay_api_EventCallback_t_DOWN$FUNC = FunctionDescriptor.ofVoid(
|
||||||
constants$0.sdrplay_api_Open_t$FUNC
|
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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user