From 614bf72f01ce84ef57d5807c19810f9896056742 Mon Sep 17 00:00:00 2001 From: Denny Sheirer Date: Sat, 3 Feb 2024 10:18:05 -0500 Subject: [PATCH] SDRPlay API version 3.14 & RSP1B (#1817) * #1812 sdrplay adds support for RSP1B and changes gain to expose LNA and Baseband gain settings for all tuners. * Updates build to 0.6.1 beta 1. --------- Co-authored-by: Dennis Sheirer --- artifacts/sdrplay-api-headers/README.txt | 8 +- .../sdrplay-api-headers/v3_14/sdrplay_api.h | 234 +++ .../v3_14/sdrplay_api_callback.h | 79 + .../v3_14/sdrplay_api_control.h | 55 + .../v3_14/sdrplay_api_dev.h | 51 + .../v3_14/sdrplay_api_rsp1a.h | 22 + .../v3_14/sdrplay_api_rsp2.h | 35 + .../v3_14/sdrplay_api_rspDuo.h | 47 + .../v3_14/sdrplay_api_rspDx.h | 46 + .../v3_14/sdrplay_api_rx_channel.h | 21 + .../v3_14/sdrplay_api_tuner.h | 93 + gradle.properties | 2 +- .../dsheirer/source/tuner/TunerFactory.java | 5 +- .../dsheirer/source/tuner/TunerType.java | 3 +- .../source/tuner/sdrplay/ControlRsp.java | 72 +- .../source/tuner/sdrplay/IControlRsp.java | 36 +- ...istener.java => ITunerStatusListener.java} | 13 +- .../tuner/sdrplay/RspTunerConfiguration.java | 48 +- .../tuner/sdrplay/RspTunerController.java | 8 +- .../source/tuner/sdrplay/RspTunerEditor.java | 243 ++- .../source/tuner/sdrplay/api/SDRplay.java | 6 +- .../tuner/sdrplay/api/UpdateReason.java | 3 +- .../source/tuner/sdrplay/api/Version.java | 6 +- .../sdrplay/api/device/DeviceFactory.java | 5 +- .../tuner/sdrplay/api/device/DeviceType.java | 3 +- .../tuner/sdrplay/api/device/Rsp1bDevice.java | 61 + .../tuner/sdrplay/api/device/Rsp1bTuner.java | 107 + .../tuner/sdrplay/api/device/RspTuner.java | 54 +- .../composite/CompositeParameters.java | 8 +- .../composite/CompositeParametersFactory.java | 20 +- .../composite/Rsp1CompositeParameters.java | 8 +- .../composite/Rsp1aCompositeParameters.java | 8 +- .../composite/Rsp1bCompositeParameters.java | 47 + .../composite/Rsp2CompositeParameters.java | 8 +- .../composite/RspDuoCompositeParameters.java | 10 +- .../composite/RspDxCompositeParameters.java | 8 +- .../device/DeviceParametersFactory.java | 5 +- .../api/parameter/event/EventType.java | 8 +- .../api/parameter/tuner/FrequencyBand.java | 104 - .../sdrplay/api/parameter/tuner/Gain.java | 13 +- .../api/parameter/tuner/GainReduction.java | 354 ---- .../tuner/RspDuoTunerParameters.java | 60 +- .../tuner/RspDuoTunerParametersV3_07.java | 120 ++ .../tuner/RspDuoTunerParametersV3_14.java | 123 ++ .../tuner/TunerParametersFactory.java | 24 +- .../sdrplay/api/v3_14/Constants$root.java | 55 + .../sdrplay/api/v3_14/RuntimeHelper.java | 253 +++ .../tuner/sdrplay/api/v3_14/constants$0.java | 89 + .../tuner/sdrplay/api/v3_14/constants$1.java | 59 + .../tuner/sdrplay/api/v3_14/constants$10.java | 74 + .../tuner/sdrplay/api/v3_14/constants$2.java | 71 + .../tuner/sdrplay/api/v3_14/constants$3.java | 71 + .../tuner/sdrplay/api/v3_14/constants$4.java | 74 + .../tuner/sdrplay/api/v3_14/constants$5.java | 80 + .../tuner/sdrplay/api/v3_14/constants$6.java | 89 + .../tuner/sdrplay/api/v3_14/constants$7.java | 88 + .../tuner/sdrplay/api/v3_14/constants$8.java | 74 + .../tuner/sdrplay/api/v3_14/constants$9.java | 78 + .../sdrplay/api/v3_14/sdrplay_api_AgcT.java | 261 +++ .../api/v3_14/sdrplay_api_ApiVersion_t.java | 49 + .../api/v3_14/sdrplay_api_CallbackFnsT.java | 150 ++ .../api/v3_14/sdrplay_api_Close_t.java | 49 + .../api/v3_14/sdrplay_api_ControlParamsT.java | 112 ++ .../api/v3_14/sdrplay_api_DcOffsetT.java | 111 ++ .../api/v3_14/sdrplay_api_DcOffsetTunerT.java | 172 ++ .../api/v3_14/sdrplay_api_DebugEnable_t.java | 49 + .../api/v3_14/sdrplay_api_DecimationT.java | 141 ++ .../api/v3_14/sdrplay_api_DevParamsT.java | 205 ++ .../api/v3_14/sdrplay_api_DeviceParamsT.java | 141 ++ .../api/v3_14/sdrplay_api_DeviceT.java | 238 +++ .../v3_14/sdrplay_api_DisableHeartbeat_t.java | 49 + .../api/v3_14/sdrplay_api_ErrorInfoT.java | 96 + .../v3_14/sdrplay_api_EventCallback_t.java | 49 + .../api/v3_14/sdrplay_api_EventParamsT.java | 73 + .../api/v3_14/sdrplay_api_FsFreqT.java | 142 ++ .../api/v3_14/sdrplay_api_GainCbParamT.java | 141 ++ .../sdrplay/api/v3_14/sdrplay_api_GainT.java | 181 ++ .../api/v3_14/sdrplay_api_GainValuesT.java | 141 ++ .../v3_14/sdrplay_api_GetDeviceParams_t.java | 49 + .../api/v3_14/sdrplay_api_GetDevices_t.java | 49 + .../v3_14/sdrplay_api_GetErrorString_t.java | 49 + .../sdrplay_api_GetLastErrorByType_t.java | 49 + .../api/v3_14/sdrplay_api_GetLastError_t.java | 49 + .../sdrplay/api/v3_14/sdrplay_api_Init_t.java | 49 + .../v3_14/sdrplay_api_LockDeviceApi_t.java | 49 + .../sdrplay/api/v3_14/sdrplay_api_Open_t.java | 49 + .../sdrplay_api_PowerOverloadCbParamT.java | 81 + .../v3_14/sdrplay_api_ReleaseDevice_t.java | 49 + .../api/v3_14/sdrplay_api_ResetFlagsT.java | 141 ++ .../api/v3_14/sdrplay_api_RfFreqT.java | 112 ++ .../api/v3_14/sdrplay_api_Rsp1aParamsT.java | 111 ++ .../v3_14/sdrplay_api_Rsp1aTunerParamsT.java | 81 + .../api/v3_14/sdrplay_api_Rsp2ParamsT.java | 81 + .../v3_14/sdrplay_api_Rsp2TunerParamsT.java | 173 ++ .../v3_14/sdrplay_api_RspDuoModeCbParamT.java | 81 + .../api/v3_14/sdrplay_api_RspDuoParamsT.java | 81 + .../v3_14/sdrplay_api_RspDuoTunerParamsT.java | 211 ++ .../sdrplay_api_RspDuo_ResetSlaveFlagsT.java | 111 ++ .../api/v3_14/sdrplay_api_RspDxParamsT.java | 203 ++ .../v3_14/sdrplay_api_RspDxTunerParamsT.java | 81 + .../v3_14/sdrplay_api_RxChannelParamsT.java | 155 ++ .../api/v3_14/sdrplay_api_SelectDevice_t.java | 49 + .../v3_14/sdrplay_api_StreamCallback_t.java | 49 + .../v3_14/sdrplay_api_StreamCbParamsT.java | 201 ++ .../sdrplay_api_SwapRspDuoActiveTuner_t.java | 49 + ...i_SwapRspDuoDualTunerModeSampleRate_t.java | 49 + .../v3_14/sdrplay_api_SwapRspDuoMode_t.java | 49 + .../api/v3_14/sdrplay_api_SyncUpdateT.java | 111 ++ .../api/v3_14/sdrplay_api_TunerParamsT.java | 179 ++ .../api/v3_14/sdrplay_api_Uninit_t.java | 49 + .../v3_14/sdrplay_api_UnlockDeviceApi_t.java | 49 + .../api/v3_14/sdrplay_api_Update_t.java | 49 + .../sdrplay/api/v3_14/sdrplay_api_h.java | 1724 +++++++++++++++++ .../tuner/sdrplay/rsp1/ControlRsp1.java | 36 +- .../tuner/sdrplay/rsp1/Rsp1TunerEditor.java | 31 +- .../tuner/sdrplay/rsp1a/ControlRsp1a.java | 35 +- .../tuner/sdrplay/rsp1a/Rsp1aTunerEditor.java | 34 +- .../tuner/sdrplay/rsp1b/ControlRsp1b.java | 154 ++ .../sdrplay/rsp1b/DiscoveredRsp1bTuner.java | 40 + .../tuner/sdrplay/rsp1b/IControlRsp1b.java | 71 + .../rsp1b/Rsp1bTunerConfiguration.java | 109 ++ .../sdrplay/rsp1b/Rsp1bTunerController.java | 103 + .../tuner/sdrplay/rsp1b/Rsp1bTunerEditor.java | 348 ++++ .../tuner/sdrplay/rsp2/ControlRsp2.java | 37 +- .../tuner/sdrplay/rsp2/Rsp2TunerEditor.java | 31 +- .../tuner/sdrplay/rspDuo/ControlRspDuo.java | 22 +- .../sdrplay/rspDuo/ControlRspDuoTuner1.java | 41 +- .../rspDuo/ControlRspDuoTuner1Master.java | 2 +- .../sdrplay/rspDuo/ControlRspDuoTuner2.java | 35 +- .../sdrplay/rspDuo/RspDuoTuner1Editor.java | 28 +- .../sdrplay/rspDuo/RspDuoTuner2Editor.java | 28 +- .../tuner/sdrplay/rspDx/ControlRspDx.java | 50 +- .../tuner/sdrplay/rspDx/RspDxTunerEditor.java | 31 +- 133 files changed, 11207 insertions(+), 809 deletions(-) create mode 100644 artifacts/sdrplay-api-headers/v3_14/sdrplay_api.h create mode 100644 artifacts/sdrplay-api-headers/v3_14/sdrplay_api_callback.h create mode 100644 artifacts/sdrplay-api-headers/v3_14/sdrplay_api_control.h create mode 100644 artifacts/sdrplay-api-headers/v3_14/sdrplay_api_dev.h create mode 100644 artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rsp1a.h create mode 100644 artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rsp2.h create mode 100644 artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rspDuo.h create mode 100644 artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rspDx.h create mode 100644 artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rx_channel.h create mode 100644 artifacts/sdrplay-api-headers/v3_14/sdrplay_api_tuner.h rename src/main/java/io/github/dsheirer/source/tuner/sdrplay/{IGainOverloadListener.java => ITunerStatusListener.java} (77%) create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/Rsp1bDevice.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/Rsp1bTuner.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/composite/Rsp1bCompositeParameters.java delete mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/FrequencyBand.java delete mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/GainReduction.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/RspDuoTunerParametersV3_07.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/RspDuoTunerParametersV3_14.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/Constants$root.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/RuntimeHelper.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$0.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$1.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$10.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$2.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$3.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$4.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$5.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$6.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$7.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$8.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$9.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_AgcT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ApiVersion_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_CallbackFnsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Close_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ControlParamsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DcOffsetT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DcOffsetTunerT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DebugEnable_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DecimationT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DevParamsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DeviceParamsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DeviceT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DisableHeartbeat_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ErrorInfoT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_EventCallback_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_EventParamsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_FsFreqT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GainCbParamT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GainT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GainValuesT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetDeviceParams_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetDevices_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetErrorString_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetLastErrorByType_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetLastError_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Init_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_LockDeviceApi_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Open_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_PowerOverloadCbParamT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ReleaseDevice_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ResetFlagsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RfFreqT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp1aParamsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp1aTunerParamsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp2ParamsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp2TunerParamsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuoModeCbParamT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuoParamsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuoTunerParamsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuo_ResetSlaveFlagsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDxParamsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDxTunerParamsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RxChannelParamsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SelectDevice_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_StreamCallback_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_StreamCbParamsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SwapRspDuoActiveTuner_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SwapRspDuoMode_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SyncUpdateT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_TunerParamsT.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Uninit_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_UnlockDeviceApi_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Update_t.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_h.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/ControlRsp1b.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/DiscoveredRsp1bTuner.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/IControlRsp1b.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/Rsp1bTunerConfiguration.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/Rsp1bTunerController.java create mode 100644 src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/Rsp1bTunerEditor.java diff --git a/artifacts/sdrplay-api-headers/README.txt b/artifacts/sdrplay-api-headers/README.txt index ff2036b1b..cdd9f44e7 100644 --- a/artifacts/sdrplay-api-headers/README.txt +++ b/artifacts/sdrplay-api-headers/README.txt @@ -30,7 +30,11 @@ typedef void *HANDLE; ..\SDRtrunk\sdrplay-api\src\main\java 4. Generate the code: -c:\Users\Denny\Downloads\jdk-19-ea2-panama\bin\jextract "C:\Users\Denny\git\sdrtrunk\sdrplay-api\api\v3_11\sdrplay_api.h" -l libsdrplay_api --source +Windows: +c:\Users\Denny\Downloads\jdk-19-ea2-panama\bin\jextract "C:\Users\Denny\git\sdrtrunk\sdrplay-api\api\v3_11\sdrplay_api.h" -l libsdrplay_api --source -t io.github.dsheirer.source.tuner.sdrplay.api.v3_14 -5. Do this for all versions of the API. +Linux: +~/Downloads/jextract-20/bin/jextract ~/IdeaProjects/sdrtrunk/artifacts/sdrplay-api-headers/v3_14/sdrplay_api.h -l libsdrplay_api --source -t io.github.dsheirer.source.tuner.sdrplay.api.v3_14 +5. Compare the 3.07 header files to the newest version header files. Delete any auto-generated files that have not +changed and then update the factory class to construct variation classes where there are differences. diff --git a/artifacts/sdrplay-api-headers/v3_14/sdrplay_api.h b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api.h new file mode 100644 index 000000000..e9e9fa45f --- /dev/null +++ b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api.h @@ -0,0 +1,234 @@ +#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) || defined(_M_ARM64) +#include "windows.h" +#elif defined (__GNUC__) +typedef void *HANDLE; +#endif + +#ifndef _SDRPLAY_DLL_QUALIFIER +#if !defined(STATIC_LIB) && (defined(_M_X64) || defined(_M_IX86) || defined(_M_ARM64)) +#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.14) + +// 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) +#define SDRPLAY_RSP1B_ID (6) + +// 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, + sdrplay_api_Update_RspDuo_ResetSlaveFlags = 0x00000040, + + // 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_ErrorInfoT* (*sdrplay_api_GetLastErrorByType_t)(sdrplay_api_DeviceT *device, int type, unsigned long long *time); +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_ErrorInfoT* sdrplay_api_GetLastErrorByType(sdrplay_api_DeviceT *device, int type, unsigned long long *time); + _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 diff --git a/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_callback.h b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_callback.h new file mode 100644 index 000000000..0da80502a --- /dev/null +++ b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_callback.h @@ -0,0 +1,79 @@ +#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_DeviceFailure = 4, +} 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 diff --git a/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_control.h b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_control.h new file mode 100644 index 000000000..5a52a1046 --- /dev/null +++ b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_control.h @@ -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 diff --git a/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_dev.h b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_dev.h new file mode 100644 index 000000000..5ac99ae25 --- /dev/null +++ b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_dev.h @@ -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 diff --git a/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rsp1a.h b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rsp1a.h new file mode 100644 index 000000000..3affbcc3e --- /dev/null +++ b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rsp1a.h @@ -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 diff --git a/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rsp2.h b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rsp2.h new file mode 100644 index 000000000..930d3e956 --- /dev/null +++ b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rsp2.h @@ -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 diff --git a/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rspDuo.h b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rspDuo.h new file mode 100644 index 000000000..609cf7c6c --- /dev/null +++ b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rspDuo.h @@ -0,0 +1,47 @@ +#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 resetGainUpdate; // default: 0 + unsigned char resetRfUpdate; // default: 0 +} sdrplay_api_RspDuo_ResetSlaveFlagsT; + +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_RspDuo_ResetSlaveFlagsT resetSlaveFlags; +} sdrplay_api_RspDuoTunerParamsT; + +#endif //SDRPLAY_API_RSPduo_H diff --git a/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rspDx.h b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rspDx.h new file mode 100644 index 000000000..0528de96c --- /dev/null +++ b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rspDx.h @@ -0,0 +1,46 @@ +#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_50 20 // Number of LNA states when using AM Port 2 between 12 and 50MHz +#define RSPDX_NUM_LNA_STATES_AMPORT2_50_60 25 // Number of LNA states when using AM Port 2 between 50 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 22 // 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 diff --git a/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rx_channel.h b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rx_channel.h new file mode 100644 index 000000000..010080402 --- /dev/null +++ b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_rx_channel.h @@ -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 diff --git a/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_tuner.h b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_tuner.h new file mode 100644 index 000000000..a5c446d61 --- /dev/null +++ b/artifacts/sdrplay-api-headers/v3_14/sdrplay_api_tuner.h @@ -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 diff --git a/gradle.properties b/gradle.properties index 9abb0de64..1a69b9227 100644 --- a/gradle.properties +++ b/gradle.properties @@ -28,4 +28,4 @@ # tag name, specifically the dashes inserted before and after the alpha/beta labels. # See: https://github.com/DSheirer/sdrtrunk/issues/1651 -projectVersion=0.7.0-alpha-1 \ No newline at end of file +projectVersion=0.6.1-beta-1 \ No newline at end of file diff --git a/src/main/java/io/github/dsheirer/source/tuner/TunerFactory.java b/src/main/java/io/github/dsheirer/source/tuner/TunerFactory.java index 5ddf648c4..b8f41605d 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/TunerFactory.java +++ b/src/main/java/io/github/dsheirer/source/tuner/TunerFactory.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -87,6 +87,7 @@ import io.github.dsheirer.source.tuner.sdrplay.rsp1a.Rsp1aTunerConfiguration; import io.github.dsheirer.source.tuner.sdrplay.rsp1a.Rsp1aTunerController; import io.github.dsheirer.source.tuner.sdrplay.rsp1a.Rsp1aTunerEditor; +import io.github.dsheirer.source.tuner.sdrplay.rsp1b.Rsp1bTunerEditor; import io.github.dsheirer.source.tuner.sdrplay.rsp2.ControlRsp2; import io.github.dsheirer.source.tuner.sdrplay.rsp2.DiscoveredRsp2Tuner; import io.github.dsheirer.source.tuner.sdrplay.rsp2.IControlRsp2; @@ -451,6 +452,8 @@ public static TunerEditor getEditor(UserPreferences userPreferences, DiscoveredT return new Rsp1TunerEditor(userPreferences, tunerManager, discoveredRspTuner); case RSP1A: return new Rsp1aTunerEditor(userPreferences, tunerManager, discoveredRspTuner); + case RSP1B: + return new Rsp1bTunerEditor(userPreferences, tunerManager, discoveredRspTuner); case RSP2: return new Rsp2TunerEditor(userPreferences, tunerManager, discoveredRspTuner); case RSPdx: diff --git a/src/main/java/io/github/dsheirer/source/tuner/TunerType.java b/src/main/java/io/github/dsheirer/source/tuner/TunerType.java index 7a0ab54b2..59f2df7be 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/TunerType.java +++ b/src/main/java/io/github/dsheirer/source/tuner/TunerType.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,6 +40,7 @@ public enum TunerType RAFAELMICRO_R828D("R828D"), RSP_1("RSP1"), RSP_1A("RSP1A"), + RSP_1B("RSP1B"), RSP_2("RSP2"), RSP_DUO_1("RSPduo Tuner 1"), RSP_DUO_2("RSPduo Tuner 2"), diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/ControlRsp.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/ControlRsp.java index bd65b20f4..f7a5b3a96 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/ControlRsp.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/ControlRsp.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,6 @@ import io.github.dsheirer.source.tuner.sdrplay.api.device.Device; import io.github.dsheirer.source.tuner.sdrplay.api.device.TunerSelect; import io.github.dsheirer.source.tuner.sdrplay.api.parameter.control.AgcMode; -import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.GainReduction; import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.IfMode; import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.LoMode; import io.github.dsheirer.util.ThreadPool; @@ -45,10 +44,11 @@ public abstract class ControlRsp implements IControlRsp private static final Logger mLog = LoggerFactory.getLogger(ControlRsp.class); private T mDevice; protected RspSampleRate mSampleRate = RspSampleRate.RATE_8_000; - protected int mGain; + protected int mLNA; + protected int mBasebandGainReduction; private IDeviceEventListener mDeviceEventListener; private IStreamListener mStreamListener; - protected WeakReference mGainOverloadReference; + protected WeakReference mGainOverloadReference; //Streaming control lock and boolean status indicator. Access to the boolean indicator is protected by the lock. protected ReentrantLock mStreamingLock = new ReentrantLock(); @@ -242,21 +242,28 @@ public void setSampleRate(RspSampleRate sampleRate) throws SDRPlayException } } - /** - * Sets the gain index - * @param gain index value (0 - 28) - * @throws SDRPlayException - */ @Override - public void setGain(int gain) throws SDRPlayException + public void setGain(int lna, int gr) throws SDRPlayException { - validateGain(gain); + int lnaLimited = Math.max(lna, 0); + lnaLimited = Math.min(lnaLimited, getMaximumLNASetting()); - if(gain != mGain) + int grLimited = Math.max(gr, 20); + grLimited = Math.min(grLimited, 59); + + if(lna != lnaLimited || gr != grLimited) { - mGain = gain; - getDevice().getTuner().setGain(mGain); + mLog.warn("Setting gain - adjusted LNA from [" + lna + "] to [" + lnaLimited + "] and GR from [" + gr + "] to [" + grLimited + "]"); } + getDevice().getTuner().setGain(lnaLimited, grLimited); + mLNA = lnaLimited; + mBasebandGainReduction = grLimited; + } + + @Override + public float getCurrentGain() throws SDRPlayException + { + return getDevice().getTuner().getGain().getGainValues().getCurrent(); } /** @@ -264,7 +271,7 @@ public void setGain(int gain) throws SDRPlayException * @param listener to register */ @Override - public void setGainOverloadListener(IGainOverloadListener listener) + public void setGainOverloadListener(ITunerStatusListener listener) { if(mGainOverloadReference != null && mGainOverloadReference.get() != null) { @@ -289,7 +296,7 @@ public void acknowledgePowerOverload(TunerSelect tunerSelect) throws SDRPlayExce //Notify an optional weakly referenced, registered listener that gain overload has been acknowledged. if(mGainOverloadReference != null) { - IGainOverloadListener listener = mGainOverloadReference.get(); + ITunerStatusListener listener = mGainOverloadReference.get(); if(listener != null) { @@ -317,6 +324,17 @@ public void setTunedFrequency(long frequency) throws SDRPlayException if(hasDevice()) { getDevice().getTuner().setFrequency(frequency); + + //Notify an optional weakly referenced, registered listener that gain overload has been acknowledged. + if(mGainOverloadReference != null) + { + ITunerStatusListener listener = mGainOverloadReference.get(); + + if(listener != null) + { + ThreadPool.CACHED.submit(() -> listener.frequencyUpdated()); + } + } } else { @@ -343,27 +361,23 @@ public double getCurrentSampleRate() } /** - * Current gain index - * @return gain index + * Current LNA gain setting + * @return LNA gain */ @Override - public int getGain() + public int getLNA() { - return mGain; + return mLNA; } /** - * Verifies that the requested gain index setting is within the range of valid gain values. - * @param gain to validate - * @throws SDRPlayException if the gain index value is outside the range of valid values. + * Current Baseband gain reduction setting + * @return baseband gain reduction */ - protected void validateGain(int gain) throws SDRPlayException + @Override + public int getBasebandGainReduction() { - if(gain < GainReduction.MIN_GAIN_INDEX || gain > GainReduction.MAX_GAIN_INDEX) - { - throw new SDRPlayException("Invalid gain index value [" + gain + "]. Valid range is " + - GainReduction.MIN_GAIN_INDEX + " - " + GainReduction.MAX_GAIN_INDEX); - } + return mBasebandGainReduction; } /** diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/IControlRsp.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/IControlRsp.java index 3484a044c..44bf43c5f 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/IControlRsp.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/IControlRsp.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -116,16 +116,36 @@ public interface IControlRsp double getCurrentSampleRate(); /** - * Sets the gain index value. - * @param gain index value (0 - 28) + * Set the lna state and gain reduction dB values separately. + * @param lna state (varies by tuner and frequency range) + * @param basebandGainReduction setting (20-59) + * @throws SDRPlayException */ - void setGain(int gain) throws SDRPlayException; + void setGain(int lna, int basebandGainReduction) throws SDRPlayException; /** - * Current gain index value - * @return gain index value (0 - 28) + * Current gain setting as reported by the device. + * @return gain value in decibels */ - int getGain(); + float getCurrentGain() throws SDRPlayException; + + /** + * Current LNA gain index value + * @return LNA gain value. + */ + int getLNA(); + + /** + * Maximum LNA setting index value. + * @return max LNA that varies by tuner type. + */ + int getMaximumLNASetting(); + + /** + * Current gain reduction value. + * @return gain reduction value. + */ + int getBasebandGainReduction(); /** * Current IF AGC mode setting. @@ -143,5 +163,5 @@ public interface IControlRsp * Registers a listener to receive notifications of gain overload. * @param listener to register */ - void setGainOverloadListener(IGainOverloadListener listener); + void setGainOverloadListener(ITunerStatusListener listener); } diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/IGainOverloadListener.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/ITunerStatusListener.java similarity index 77% rename from src/main/java/io/github/dsheirer/source/tuner/sdrplay/IGainOverloadListener.java rename to src/main/java/io/github/dsheirer/source/tuner/sdrplay/ITunerStatusListener.java index 18c243722..9b1730357 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/IGainOverloadListener.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/ITunerStatusListener.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,7 +24,16 @@ /** * Listener interface to receive notifications of gain overload in the RSP device. */ -public interface IGainOverloadListener +public interface ITunerStatusListener { + /** + * Notify that there is a gain overload event in the specified tuner + * @param tunerSelect to id the tuner + */ void notifyGainOverload(TunerSelect tunerSelect); + + /** + * Notify that the tuner's frequency has changed. + */ + void frequencyUpdated(); } diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/RspTunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/RspTunerConfiguration.java index 9d3380dcf..eb5e4070a 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/RspTunerConfiguration.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/RspTunerConfiguration.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,9 +24,9 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; import io.github.dsheirer.source.tuner.sdrplay.api.parameter.control.AgcMode; -import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.GainReduction; import io.github.dsheirer.source.tuner.sdrplay.rsp1.Rsp1TunerConfiguration; import io.github.dsheirer.source.tuner.sdrplay.rsp1a.Rsp1aTunerConfiguration; +import io.github.dsheirer.source.tuner.sdrplay.rsp1b.Rsp1bTunerConfiguration; import io.github.dsheirer.source.tuner.sdrplay.rsp2.Rsp2TunerConfiguration; import io.github.dsheirer.source.tuner.sdrplay.rspDuo.RspDuoTuner1Configuration; import io.github.dsheirer.source.tuner.sdrplay.rspDuo.RspDuoTuner2Configuration; @@ -39,6 +39,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Rsp1TunerConfiguration.class, name = "rsp1TunerConfiguration"), @JsonSubTypes.Type(value = Rsp1aTunerConfiguration.class, name = "rsp1aTunerConfiguration"), + @JsonSubTypes.Type(value = Rsp1bTunerConfiguration.class, name = "rsp1bTunerConfiguration"), @JsonSubTypes.Type(value = Rsp2TunerConfiguration.class, name = "rsp2TunerConfiguration"), @JsonSubTypes.Type(value = RspDuoTuner1Configuration.class, name = "rspDuoTuner1Configuration"), @JsonSubTypes.Type(value = RspDuoTuner2Configuration.class, name = "rspDuoTuner2Configuration"), @@ -50,7 +51,8 @@ public abstract class RspTunerConfiguration extends TunerConfiguration public static final RspSampleRate DEFAULT_DUAL_TUNER_SAMPLE_RATE = RspSampleRate.DUO_RATE_2_000; private RspSampleRate mRspSampleRate = DEFAULT_SINGLE_TUNER_SAMPLE_RATE; - private int mGain = 24; + private int mLNA = 0; + private int mBasebandGainReduction = 50; private AgcMode mAgcMode = AgcMode.ENABLE; /** @@ -87,25 +89,41 @@ public void setSampleRate(RspSampleRate rspSampleRate) } /** - * Gain index to use - * @return gain index, 0 - 28 + * LNA setting + * @return LNA setting */ - @JacksonXmlProperty(isAttribute = true, localName = "gain") - public int getGain() + @JacksonXmlProperty(isAttribute = true, localName = "lna") + public int getLNA() { - return mGain; + return mLNA; } /** - * Sets the gain index - * @param gain index, 0 - 28 + * Sets the LNA state + * @param LNA state, 0 - xx, varies by tuner and frequency range. */ - public void setGain(int gain) + public void setLNA(int lna) { - if(GainReduction.MIN_GAIN_INDEX <= gain && gain <= GainReduction.MAX_GAIN_INDEX) - { - mGain = gain; - } + mLNA = lna; + } + + /** + * Baseband gain reduction + * @return gain reduction in range 20-59 dB + */ + @JacksonXmlProperty(isAttribute = true, localName = "gr") + public int getBasebandGainReduction() + { + return mBasebandGainReduction; + } + + /** + * Sets the baseband gain reduction value. + * @param basebandGainReduction value + */ + public void setBasebandGainReduction(int basebandGainReduction) + { + mBasebandGainReduction = basebandGainReduction; } /** diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/RspTunerController.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/RspTunerController.java index 581d46648..79e5ec9eb 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/RspTunerController.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/RspTunerController.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -91,11 +91,13 @@ public void apply(TunerConfiguration config) throws SourceException try { - getControlRsp().setGain(rtc.getGain()); + int lna = rtc.getLNA(); + int gr = rtc.getBasebandGainReduction(); + getControlRsp().setGain(lna, gr); } catch(SDRPlayException se) { - mLog.error("Error setting RSP gain index to " + rtc.getGain()); + mLog.error("Error setting RSP LNA [" + rtc.getLNA() + "] and baseband [" + rtc.getBasebandGainReduction() + "]"); } } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/RspTunerEditor.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/RspTunerEditor.java index eb3f61405..2fe1763ac 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/RspTunerEditor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/RspTunerEditor.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,32 +24,37 @@ import io.github.dsheirer.source.tuner.sdrplay.api.SDRPlayException; import io.github.dsheirer.source.tuner.sdrplay.api.device.TunerSelect; import io.github.dsheirer.source.tuner.sdrplay.api.parameter.control.AgcMode; -import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.GainReduction; import io.github.dsheirer.source.tuner.ui.TunerEditor; import io.github.dsheirer.util.ThreadPool; import java.awt.Color; import java.awt.EventQueue; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; +import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JOptionPane; +import javax.swing.JPanel; import javax.swing.JSlider; import javax.swing.JToggleButton; /** * Abstract RSP tuner editor */ -public abstract class RspTunerEditor extends TunerEditor implements IGainOverloadListener +public abstract class RspTunerEditor extends TunerEditor implements ITunerStatusListener { private Logger mLog = LoggerFactory.getLogger(RspTunerEditor.class); - private JSlider mGainSlider; - private JLabel mGainValueLabel; + protected static final String MANUAL = "Manual"; + protected static final String AUTOMATIC = "Automatic"; private JToggleButton mAgcButton; + private JLabel mGainValueLabel; + private LnaSlider mLNASlider; + private GainReductionSlider mBasebandSlider; private JButton mGainOverloadButton; + private JPanel mGainPanel; private AtomicBoolean mGainOverloadAlert = new AtomicBoolean(); /** @@ -69,40 +74,23 @@ private RspTunerController getTunerController() } /** - * Gain reduction slider control + * Gain controls panel + * @return gain panel */ - protected JSlider getGainSlider() + protected JPanel getGainPanel() { - if(mGainSlider == null) + if(mGainPanel == null) { - mGainSlider = new JSlider(JSlider.HORIZONTAL, GainReduction.MIN_GAIN_INDEX, - GainReduction.MAX_GAIN_INDEX, GainReduction.MIN_GAIN_INDEX); - mGainSlider.setEnabled(false); - mGainSlider.setMajorTickSpacing(1); - mGainSlider.setPaintTicks(true); - mGainSlider.addChangeListener(event -> - { - int gain = mGainSlider.getValue(); - - if(hasTuner() && !isLoading()) - { - try - { - getTunerController().getControlRsp().setGain(gain); - save(); - } - catch(Exception e) - { - mLog.error("Couldn't set RSP gain to:" + gain, e); - JOptionPane.showMessageDialog(mGainSlider, "Couldn't set RSP gain value to " + gain); - } - } - - getGainValueLabel().setText(String.valueOf(gain)); - }); + mGainPanel = new JPanel(); + mGainPanel.setLayout(new MigLayout("insets 0","[][][grow,fill][][]","")); + mGainPanel.add(getGainValueLabel()); + mGainPanel.add(getGainOverloadButton()); + mGainPanel.add(new JLabel()); //empty label to grow to fill space + mGainPanel.add(new JLabel("IF Gain Mode:")); + mGainPanel.add(getAgcButton()); } - return mGainSlider; + return mGainPanel; } /** @@ -126,7 +114,7 @@ protected JToggleButton getAgcButton() { if(mAgcButton == null) { - mAgcButton = new JToggleButton("IF AGC"); + mAgcButton = new JToggleButton(MANUAL); mAgcButton.setEnabled(false); mAgcButton.addActionListener(e -> { if(hasTuner() && !isLoading()) @@ -134,6 +122,7 @@ protected JToggleButton getAgcButton() try { getTunerController().getControlRsp().setAgcMode(mAgcButton.isSelected() ? AgcMode.ENABLE : AgcMode.DISABLE); + updateGainLabel(); } catch(SDRPlayException se) { @@ -141,6 +130,15 @@ protected JToggleButton getAgcButton() } save(); } + + if(mAgcButton.isSelected()) + { + getAgcButton().setText(AUTOMATIC); + } + else + { + getAgcButton().setText(MANUAL); + } }); } @@ -175,6 +173,12 @@ public void notifyGainOverload(TunerSelect tunerSelect) } } + @Override + public void frequencyUpdated() + { + updateLnaSlider(); + } + /** * Toggles the alert styling of the disabled gain overload button to indicate an alert condition or a normal * operating condition. @@ -199,4 +203,173 @@ else if(!alert && mGainOverloadAlert.compareAndSet(true, false)) mLog.info("Ignoring duplicate gain alerting - alert[" + alert + "] atomic [" + mGainOverloadAlert.get() + "]"); } } + + protected void updateLnaSlider() + { + if(hasTuner()) + { + int max = getTunerController().getControlRsp().getMaximumLNASetting(); + if(max != getLNASlider().getMaximum()) + { + EventQueue.invokeLater(() -> { + setLoading(true); + //Adjust the value if it's less than max + getLNASlider().setValue(Math.min(getLNASlider().getValue(), max)); + getLNASlider().setMaximum(max); + setLoading(false); + }); + } + } + } + + /** + * LNA Gain Slider + */ + protected LnaSlider getLNASlider() + { + if(mLNASlider == null) + { + mLNASlider = new LnaSlider(); + mLNASlider.setEnabled(true); + mLNASlider.setMajorTickSpacing(1); + mLNASlider.setPaintTicks(true); + mLNASlider.addChangeListener(event -> + { + JSlider source = (JSlider)event.getSource(); + + if(!source.getValueIsAdjusting()) + { + updateGain(); + } + }); + } + + return mLNASlider; + } + + /** + * Updates the gain settings when the LNA or Baseband gain value is changed by the user. + */ + private void updateGain() + { + int lna = getLNASlider().getLNA(); + int gr = getBasebandSlider().getGR(); + + if(hasTuner() && !isLoading()) + { + try + { + getTunerController().getControlRsp().setGain(lna, gr); + save(); + updateGainLabel(); + } + catch(Exception e) + { + mLog.error("Couldn't set RSP gain to LNA:" + lna + " Gain Reduction:" + gr, e); + JOptionPane.showMessageDialog(mBasebandSlider, "Couldn't set RSP gain value to LNA:" + lna + " Gain Reduction:" + gr); + } + } + } + + protected void updateGainLabel() + { + try + { + float currentGain = getTunerController().getControlRsp().getCurrentGain(); + getGainValueLabel().setText((int)currentGain + " dB"); + } + catch(SDRPlayException se) + { + mLog.error("Error accessing current gain value from RSP tuner", se); + } + } + + /** + * Baseband Gain Reduction Slider + */ + protected GainReductionSlider getBasebandSlider() + { + if(mBasebandSlider == null) + { + mBasebandSlider = new GainReductionSlider(); + mBasebandSlider.setEnabled(true); + mBasebandSlider.setMajorTickSpacing(1); + mBasebandSlider.setPaintTicks(true); + mBasebandSlider.addChangeListener(event -> + { + JSlider source = (JSlider)event.getSource(); + + if(!source.getValueIsAdjusting()) + { + updateGain(); + } + }); + } + + return mBasebandSlider; + } + + /** + * JSlider implementation that inverts the scale to support LNA values. + */ + public class LnaSlider extends JSlider + { + /** + * Constructs an instance + */ + public LnaSlider() + { + super(JSlider.HORIZONTAL, 0,9,9); + } + + /** + * Slider value converted to the LNA scale. + * @return lna value. + */ + public int getLNA() + { + return getMaximum() - getValue(); + } + + /** + * Sets the slider with the value converted from the provided LNA value. + * @param lna value to apply + */ + public void setLNA(int lna) + { + setValue(getMaximum() - lna); + } + } + + /** + * JSlider implementation that inverts the scale to support Gain Reduction values. + */ + public class GainReductionSlider extends JSlider + { + /** + * Constructs an instance + */ + public GainReductionSlider() + { + super(JSlider.HORIZONTAL, 0, 39, 30); + } + + /** + * Slider value converted to the gain reduction scale. + * @return gain reduction value. + */ + public int getGR() + { + return getBasebandSlider().getMaximum() - getBasebandSlider().getValue() + 20; + } + + /** + * Sets the slider with the value converted from the provided gain reduction value. + * @param gainReduction value to apply + */ + public void setGR(int gainReduction) + { + setValue(getMaximum() - (gainReduction - 20)); + } + } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/SDRplay.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/SDRplay.java index 26788aa85..e0f1654aa 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/SDRplay.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/SDRplay.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -352,7 +352,7 @@ public void release(MemorySegment memorySegment) throws SDRPlayException * * @param deviceType to load parameters * @param deviceHandle to device - * @return constructed device composite paramaters + * @return constructed device composite parameters */ public CompositeParameters getCompositeParameters(DeviceType deviceType, MemorySegment deviceHandle) throws SDRPlayException { @@ -367,7 +367,7 @@ public CompositeParameters getCompositeParameters(DeviceType deviceType, MemoryS //The structure's memory is already allocated ... wrap a memory segment around it MemorySegment memorySegment = sdrplay_api_DeviceT.ofAddress(memoryAddress, getArena().scope()); - return CompositeParametersFactory.create(deviceType, memorySegment, getArena()); + return CompositeParametersFactory.create(getVersion(), deviceType, memorySegment, getArena()); } else { diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/UpdateReason.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/UpdateReason.java index f244ee89c..1e55df884 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/UpdateReason.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/UpdateReason.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -78,6 +78,7 @@ public enum UpdateReason EXTENSION_RSP_DX_RF_NOTCH_CONTROL(sdrplay_api_h.sdrplay_api_Update_RspDx_RfNotchControl(), "RSPdx RF Notch Control"), EXTENSION_RSP_DX_RF_DAB_NOTCH_CONTROL(sdrplay_api_h.sdrplay_api_Update_RspDx_RfDabNotchControl(), "RSPdx RF DAB Notch Control"), EXTENSION_RSP_DX_HDR_BANDWIDTH(sdrplay_api_h.sdrplay_api_Update_RspDx_HdrBw(), "RSPdx HDR Bandwidth"), + EXTENSION_RSP_DUO_RESET_SLAVE_FLAGS(io.github.dsheirer.source.tuner.sdrplay.api.v3_14.sdrplay_api_h.sdrplay_api_Update_RspDuo_ResetSlaveFlags(), "RSPDuo Reset Slave Flags"), EXTENSION_NONE(sdrplay_api_h.sdrplay_api_Update_Ext1_None(), "NONE"), diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/Version.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/Version.java index 4199a7faf..6a361064b 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/Version.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/Version.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,7 +33,9 @@ public enum Version V3_09(3.09f, true), V3_10(3.10f, true), V3_11(3.11f, true), - V3_12(3.12f, true); + V3_12(3.12f, true), + V3_13(3.13f, true), //No changes - OSX build only. + V3_14(3.14f, true); private float mValue; private boolean mSupported; diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/DeviceFactory.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/DeviceFactory.java index f4047992f..3e358c4d0 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/DeviceFactory.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/DeviceFactory.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -125,6 +125,9 @@ public static Device createDevice(SDRplay sdrPlay, IDeviceStruct deviceStruct) case RSP1A -> { return new Rsp1aDevice(sdrPlay, deviceStruct); } + case RSP1B -> { + return new Rsp1bDevice(sdrPlay, deviceStruct); + } case RSP2 -> { return new Rsp2Device(sdrPlay, deviceStruct); } diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/DeviceType.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/DeviceType.java index 9fcd65ae4..42313ec5b 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/DeviceType.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/DeviceType.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ public enum DeviceType { RSP1(sdrplay_api_h.SDRPLAY_RSP1_ID(), "RSP1"), RSP1A(sdrplay_api_h.SDRPLAY_RSP1A_ID(), "RSP1A"), + RSP1B(io.github.dsheirer.source.tuner.sdrplay.api.v3_14.sdrplay_api_h.SDRPLAY_RSP1B_ID(), "RSP1B"), RSP2(sdrplay_api_h.SDRPLAY_RSP2_ID(), "RSP2"), RSPduo(sdrplay_api_h.SDRPLAY_RSPduo_ID(), "RSPduo"), RSPdx(sdrplay_api_h.SDRPLAY_RSPdx_ID(), "RSPdx"), diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/Rsp1bDevice.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/Rsp1bDevice.java new file mode 100644 index 000000000..935b62aaa --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/Rsp1bDevice.java @@ -0,0 +1,61 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +package io.github.dsheirer.source.tuner.sdrplay.api.device; + +import io.github.dsheirer.source.tuner.sdrplay.api.SDRPlayException; +import io.github.dsheirer.source.tuner.sdrplay.api.SDRplay; +import io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite.Rsp1bCompositeParameters; + +/** + * RSP1B Device + */ +public class Rsp1bDevice extends Device +{ + private Rsp1bTuner mTuner1; + + /** + * Constructs an SDRPlay RSP1B device from the foreign memory segment + * + * @param sdrPlay api instance that created this device + * @param deviceStruct parser + */ + Rsp1bDevice(SDRplay sdrPlay, IDeviceStruct deviceStruct) + { + super(sdrPlay, deviceStruct); + } + + @Override + public Rsp1bTuner getTuner() throws SDRPlayException + { + if(!isSelected()) + { + throw new SDRPlayException("Device must be selected before accessing the tuner"); + } + + if(mTuner1 == null) + { + mTuner1 = new Rsp1bTuner(Rsp1bDevice.this, getAPI(), getTunerSelect(), + getCompositeParameters().getDeviceParameters(), getCompositeParameters().getTunerAParameters(), + getCompositeParameters().getControlAParameters()); + } + + return mTuner1; + } +} diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/Rsp1bTuner.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/Rsp1bTuner.java new file mode 100644 index 000000000..912b511a1 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/Rsp1bTuner.java @@ -0,0 +1,107 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +package io.github.dsheirer.source.tuner.sdrplay.api.device; + +import io.github.dsheirer.source.tuner.sdrplay.api.SDRPlayException; +import io.github.dsheirer.source.tuner.sdrplay.api.SDRplay; +import io.github.dsheirer.source.tuner.sdrplay.api.UpdateReason; +import io.github.dsheirer.source.tuner.sdrplay.api.parameter.control.ControlParameters; +import io.github.dsheirer.source.tuner.sdrplay.api.parameter.device.Rsp1aDeviceParameters; +import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp1aTunerParameters; + +/** + * RSP1B Tuner + * + * Note: the RSP1B uses the same device and tuner parameters structures as the RSP1A + */ +public class Rsp1bTuner extends RspTuner +{ + /** + * Constructs an instance + * @param device parent for this tuner + * @param sdrplay api + * @param tunerSelect to specify which tuner + * @param deviceParameters for this device + * @param tunerParameters for this tuner + * @param controlParameters for this device + */ + public Rsp1bTuner(Device device, SDRplay sdrplay, TunerSelect tunerSelect, Rsp1aDeviceParameters deviceParameters, + Rsp1aTunerParameters tunerParameters, ControlParameters controlParameters) + { + super(device, sdrplay, tunerSelect, deviceParameters, tunerParameters, controlParameters); + } + + /** + * Indicates if the RF notch is enabled + */ + public boolean isRfNotch() + { + return getDeviceParameters().isRFNotch(); + } + + /** + * Enables or disables the RF notch + * @param enable setting + * @throws SDRPlayException if there is an error + */ + public void setRfNotch(boolean enable) throws SDRPlayException + { + getDeviceParameters().setRFNotch(enable); + update(UpdateReason.RSP1A_RF_NOTCH_CONTROL); + } + + /** + * Indicates if the RF DAB notch is enabled + */ + public boolean isRfDabNotch() + { + return getDeviceParameters().isRfDabNotch(); + } + + /** + * Enables or disables the RF DAB notch + * @param enable value + * @throws SDRPlayException if there is an error + */ + public void setRfDabNotch(boolean enable) throws SDRPlayException + { + getDeviceParameters().setRfDabNotch(enable); + update(UpdateReason.RSP1A_RF_DAB_NOTCH_CONTROL); + } + + /** + * Indicates if the Bias-T is enabled + */ + public boolean isBiasT() + { + return getTunerParameters().isBiasT(); + } + + /** + * Enables or disables the Bias-T + * @param enable value + * @throws SDRPlayException if there is an error + */ + public void setBiasT(boolean enable) throws SDRPlayException + { + getTunerParameters().setBiasT(enable); + update(UpdateReason.RSP1A_BIAS_T_CONTROL); + } +} diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/RspTuner.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/RspTuner.java index ada8fc08b..d12f20da6 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/RspTuner.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/device/RspTuner.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,6 @@ import io.github.dsheirer.source.tuner.sdrplay.api.parameter.device.DeviceParameters; import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Bandwidth; import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Gain; -import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.GainReduction; import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.IfMode; import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.LoMode; import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.TunerParameters; @@ -49,8 +48,6 @@ public abstract class RspTuner { - return new Rsp1CompositeParameters(memorySegment, arena); + return new Rsp1CompositeParameters(version, memorySegment, arena); } case RSP1A -> { - return new Rsp1aCompositeParameters(memorySegment, arena); + return new Rsp1aCompositeParameters(version, memorySegment, arena); + } + case RSP1B -> { + return new Rsp1bCompositeParameters(version, memorySegment, arena); } case RSP2 -> { - return new Rsp2CompositeParameters(memorySegment, arena); + return new Rsp2CompositeParameters(version, memorySegment, arena); } case RSPduo -> { - return new RspDuoCompositeParameters(memorySegment, arena); + return new RspDuoCompositeParameters(version, memorySegment, arena); } case RSPdx -> { - return new RspDxCompositeParameters(memorySegment, arena); + return new RspDxCompositeParameters(version, memorySegment, arena); } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/composite/Rsp1CompositeParameters.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/composite/Rsp1CompositeParameters.java index aaf1eefff..a3fb0a84a 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/composite/Rsp1CompositeParameters.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/composite/Rsp1CompositeParameters.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,7 @@ package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite; +import io.github.dsheirer.source.tuner.sdrplay.api.Version; import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType; import io.github.dsheirer.source.tuner.sdrplay.api.parameter.device.Rsp1DeviceParameters; import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp1TunerParameters; @@ -33,11 +34,12 @@ public class Rsp1CompositeParameters extends CompositeParameters + * **************************************************************************** + */ + +package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite; + +import io.github.dsheirer.source.tuner.sdrplay.api.Version; +import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType; +import io.github.dsheirer.source.tuner.sdrplay.api.parameter.device.Rsp1aDeviceParameters; +import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp1aTunerParameters; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; + +/** + * RSP1B Composite parameters (device and tuner) + * + * Note: RSP1B uses RSP1A device and tuner parameters structures. + */ +public class Rsp1bCompositeParameters extends CompositeParameters +{ + /** + * Constructs an instance from the foreign memory segment + * + * @param version of the API + * @param memorySegment for the composite structure in foreign memory + * @param arena for allocating additional memory segments for the sub-structures. + */ + public Rsp1bCompositeParameters(Version version, MemorySegment memorySegment, Arena arena) + { + super(version, DeviceType.RSP1B, memorySegment, arena); + } +} diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/composite/Rsp2CompositeParameters.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/composite/Rsp2CompositeParameters.java index 56d558267..f0e3aedee 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/composite/Rsp2CompositeParameters.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/composite/Rsp2CompositeParameters.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,7 @@ package io.github.dsheirer.source.tuner.sdrplay.api.parameter.composite; +import io.github.dsheirer.source.tuner.sdrplay.api.Version; import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType; import io.github.dsheirer.source.tuner.sdrplay.api.parameter.device.Rsp2DeviceParameters; import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp2TunerParameters; @@ -33,11 +34,12 @@ public class Rsp2CompositeParameters extends CompositeParameters { return new Rsp1DeviceParameters(memorySegment); } - case RSP1A -> { + //RSP1A and RSP1B share the same device parameters structures + case RSP1A, RSP1B -> { return new Rsp1aDeviceParameters(memorySegment); } case RSP2 -> { diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/event/EventType.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/event/EventType.java index 9d31ece9e..1532c5d8c 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/event/EventType.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/event/EventType.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,11 +30,17 @@ public enum EventType POWER_OVERLOAD_CHANGE(sdrplay_api_h.sdrplay_api_PowerOverloadChange(), "POWER OVERLOAD CHANGE"), DEVICE_REMOVED(sdrplay_api_h.sdrplay_api_DeviceRemoved(), "DEVICE REMOVED"), RSP_DUO_MODE_CHANGE(sdrplay_api_h.sdrplay_api_RspDuoModeChange(), "RSP-DUO MODE CHANGE"), + DEVICE_FAILURE(io.github.dsheirer.source.tuner.sdrplay.api.v3_14.sdrplay_api_h.sdrplay_api_DeviceFailure(), "DEVICE FAILURE"), UNKNOWN(-1, "UNKNOWN"); private int mValue; private String mDescription; + /** + * Constructs an instance + * @param value of the entry + * @param description for the entry + */ EventType(int value, String description) { mValue = value; diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/FrequencyBand.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/FrequencyBand.java deleted file mode 100644 index 261bdcbec..000000000 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/FrequencyBand.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - * **************************************************************************** - */ - -package io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner; - -import java.util.EnumSet; - -/** - * RSP Frequency Bands - */ -public enum FrequencyBand -{ - BAND_0_12(1_000, 12_000_000, "0.001-12 MHz"), - BAND_12_60(12_000_000, 60_000_000, "12-60 MHz"), - BAND_60_250(60_000_000, 250_000_000, "60-250 MHz"), - BAND_250_420(250_000_000, 420_000_000, "250-420 MHz"), - BAND_420_1000(420_000_000, 1_000_000_000, "420-1000 MHz"), - BAND_1000_2000(1_000_000_000, 2_000_000_000, "1000-2000 MHz"), - UNKNOWN(-1, 0,"UNKNOWN"); - - private long mMinimum; - private long mMaximum; - private String mDescription; - - FrequencyBand(long min, long max, String description) - { - mMinimum = min; - mMaximum = max; - mDescription = description; - } - - /** - * Valid frequency bands - */ - public static EnumSet VALID_FREQUENCY_BANDS = EnumSet.range(BAND_0_12, BAND_1000_2000); - - /** - * Minimum frequency - * @return frequency in Hertz - */ - public long getMinimum() - { - return mMinimum; - } - - /** - * Maximum frequency - * @return frequency in Hertz - */ - public long getMaximum() - { - return mMaximum; - } - - /** - * Lookup the entry from a return code - * @param frequency to lookup - * @return entry or UNKNOWN if the code is not recognized - */ - public static FrequencyBand fromValue(long frequency) - { - for(FrequencyBand band: FrequencyBand.values()) - { - if(band.contains(frequency)) - { - return band; - } - } - - return UNKNOWN; - } - - /** - * Indicates if this frequency band entry contains the specified frequency - * @param frequency to check - * @return true if this entry contains the frequency - */ - public boolean contains(long frequency) - { - return getMinimum() <= frequency && frequency < getMaximum(); - } - - @Override - public String toString() - { - return mDescription; - } -} diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/Gain.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/Gain.java index dc90a58f7..876b1f50a 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/Gain.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/Gain.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -52,17 +52,6 @@ private MemorySegment getMemorySegment() return mMemorySegment; } - /** - * Sets the LNA state and gain reduction from the set of gain reduction values using the specified index - * @param gainReduction for the current frequency band - * @param index into the gain values to use for LNA state and gain reduction - */ - public void setGain(GainReduction gainReduction, int index) - { - setLNA(gainReduction.getLnaState(index)); - setGainReductionDb(gainReduction.getGainReduction(index)); - } - /** * Current gain reduction * @return gain dB diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/GainReduction.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/GainReduction.java deleted file mode 100644 index f18996ada..000000000 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/GainReduction.java +++ /dev/null @@ -1,354 +0,0 @@ -/* - * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - * **************************************************************************** - */ - -package io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner; - -import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType; -import java.util.EnumSet; - -/** - * RSP Gain Reduction values and LNA states for each RSP model. - * - * Use lookup() as convenience method to find a gain reduction entry for a device type and frequency band. - * - * Reference: SDRplay API Specification, Gain Reduction Tables - * and https://github.com/SDRplay/RSPTCPServer/blob/master/rsp_tcp.c - */ -public enum GainReduction -{ - RSP1_BAND_0_12(FrequencyBand.BAND_0_12, - new int[]{ 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,56,53,50,47,44,41,58,55,52,49,46,43,45,42,58,55,52,49,46,43,41,38,35,32,29,26,23,20 }), - RSP1_BAND_12_60(FrequencyBand.BAND_12_60, - new int[]{ 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,56,53,50,47,44,41,58,55,52,49,46,43,45,42,58,55,52,49,46,43,41,38,35,32,29,26,23,20 }), - RSP1_BAND_60_250(FrequencyBand.BAND_60_250, - new int[]{ 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,56,53,50,47,44,41,58,55,52,49,46,43,45,42,58,55,52,49,46,43,41,38,35,32,29,26,23,20 }), - RSP1_BAND_250_420(FrequencyBand.BAND_250_420, - new int[]{ 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,56,53,50,47,44,41,58,55,52,49,46,43,45,42,58,55,52,49,46,43,41,38,35,32,29,26,23,20 }), - RSP1_BAND_420_1000(FrequencyBand.BAND_420_1000, - new int[]{ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0 }, - new int[]{ 59,57,54,52,50,47,45,43,40,38,36,33,31,29,27,24,22,27,24,22,32,29,27,25,22,27,25,22,20 }), - RSP1_BAND_1000_2000(FrequencyBand.BAND_1000_2000, - new int[]{ 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,57,55,52,50,48,46,43,41,44,42,53,51,49,47,44,42,45,43,40,38,36,34,31,29,27,25,22,20 }), - - RSP1A_BAND_0_12(FrequencyBand.BAND_0_12, - new int[]{ 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 4, 4, 3, 3, 3, 3, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,45,41,57,53,49,46,42,44,40,56,52,48,45,41,44,40,43,45,41,38,34,31,27,24,20 }), - RSP1A_BAND_12_60(FrequencyBand.BAND_12_60, - new int[]{ 9, 9, 9, 9, 9, 9, 8, 7, 7, 7, 7, 7, 6, 6, 5, 5, 4, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,45,41,42,58,54,51,47,43,46,42,44,41,43,42,44,40,43,45,42,38,34,31,27,24,20 }), - RSP1A_BAND_60_250(FrequencyBand.BAND_60_250, - new int[]{ 9, 9, 9, 9, 9, 9, 8, 7, 7, 7, 7, 7, 6, 6, 5, 5, 4, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,45,41,42,58,54,51,47,43,46,42,44,41,43,42,44,40,43,45,42,38,34,31,27,24,20 }), - RSP1A_BAND_250_420(FrequencyBand.BAND_250_420, - new int[]{ 9, 9, 9, 9, 9, 9, 8, 7, 7, 7, 7, 7, 6, 6, 5, 5, 4, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,45,41,42,58,54,51,47,43,46,42,44,41,43,42,44,40,43,45,42,38,34,31,27,24,20 }), - RSP1A_BAND_420_1000(FrequencyBand.BAND_420_1000, - new int[]{ 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 7, 6, 6, 5, 5, 4, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,44,41,56,52,49,45,41,44,46,42,45,41,44,40,44,40,42,46,42,38,35,31,27,24,20 }), - RSP1A_BAND_1000_2000(FrequencyBand.BAND_1000_2000, - new int[]{ 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 5, 5, 4, 4, 3, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,45,41,56,53,49,46,42,43,46,42,44,41,43,48,44,40,43,45,42,38,34,31,27,24,20 }), - - RSP2_BAND_0_12(FrequencyBand.BAND_0_12, - new int[]{ 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 5, 5, 4, 4, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,44,41,56,52,49,45,41,44,45,41,48,44,40,45,42,43,49,46,42,38,35,31,27,24,20 }), - RSP2_BAND_12_60(FrequencyBand.BAND_12_60, - new int[]{ 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 5, 5, 4, 4, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,44,41,56,52,49,45,41,44,45,41,48,44,40,45,42,43,49,46,42,38,35,31,27,24,20 }), - RSP2_BAND_60_250(FrequencyBand.BAND_60_250, - new int[]{ 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 5, 5, 4, 4, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,44,41,56,52,49,45,41,44,45,41,48,44,40,45,42,43,49,46,42,38,35,31,27,24,20 }), - RSP2_BAND_250_420(FrequencyBand.BAND_250_420, - new int[]{ 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 5, 5, 4, 4, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,44,41,56,52,49,45,41,44,45,41,48,44,40,45,42,43,49,46,42,38,35,31,27,24,20 }), - RSP2_BAND_420_1000(FrequencyBand.BAND_420_1000, - new int[]{ 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 3, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,56,53,50,48,45,42,58,55,52,49,47,44,41,43,40,44,41,42,46,43,40,37,34,31,29,26,23,20 }), - RSP2_BAND_1000_2000(FrequencyBand.BAND_1000_2000, - new int[]{ 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,56,54,51,48,45,43,40,56,54,51,48,45,43,40,43,41,44,41,44,42,39,36,34,31,28,25,23,20 }), - - RSP_DUO_BAND_0_12(FrequencyBand.BAND_0_12, - new int[]{ 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 4, 4, 3, 3, 3, 3, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,45,41,57,53,49,46,42,44,40,56,52,48,45,41,44,40,43,45,41,38,34,31,27,24,20 }), - RSP_DUO_BAND_12_60(FrequencyBand.BAND_12_60, - new int[]{ 9, 9, 9, 9, 9, 9, 8, 7, 7, 7, 7, 7, 6, 6, 5, 5, 4, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,45,41,42,58,54,51,47,43,46,42,44,41,43,42,44,40,43,45,42,38,34,31,27,24,20 }), - RSP_DUO_BAND_60_250(FrequencyBand.BAND_60_250, - new int[]{ 9, 9, 9, 9, 9, 9, 8, 7, 7, 7, 7, 7, 6, 6, 5, 5, 4, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,45,41,42,58,54,51,47,43,46,42,44,41,43,42,44,40,43,45,42,38,34,31,27,24,20 }), - RSP_DUO_BAND_250_420(FrequencyBand.BAND_250_420, - new int[]{ 9, 9, 9, 9, 9, 9, 8, 7, 7, 7, 7, 7, 6, 6, 5, 5, 4, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,45,41,42,58,54,51,47,43,46,42,44,41,43,42,44,40,43,45,42,38,34,31,27,24,20 }), - RSP_DUO_BAND_420_1000(FrequencyBand.BAND_420_1000, - new int[]{ 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 7, 6, 6, 5, 5, 4, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,44,41,56,52,49,45,41,44,46,42,45,41,44,40,44,40,42,46,42,38,35,31,27,24,20 }), - RSP_DUO_BAND_1000_2000(FrequencyBand.BAND_1000_2000, - new int[]{ 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 5, 5, 4, 4, 3, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,45,41,56,53,49,46,42,43,46,42,44,41,43,48,44,40,43,45,42,38,34,31,27,24,20 }), - - RSP_DX_BAND_0_12(FrequencyBand.BAND_0_12, - new int[]{ 18,18,18,18,18,18,17,16,14,13,12,11,10, 9, 7, 6, 5, 5, 5, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,45,41,41,40,43,42,42,41,41,40,42,42,47,44,40,43,42,42,41,38,34,31,27,24,20 }), - RSP_DX_BAND_12_60(FrequencyBand.BAND_12_60, - new int[]{ 26,26,26,26,26,25,23,22,20,19,17,16,14,13,11,10, 8, 7, 5, 5, 5, 3, 2, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,50,46,41,40,42,40,42,40,42,41,42,41,43,41,43,41,49,45,40,42,40,42,38,33,29,24,20 }), - RSP_DX_BAND_60_250(FrequencyBand.BAND_60_250, - new int[]{ 26,26,26,26,26,25,23,22,20,19,17,16,14,13,11,10, 8, 7, 5, 5, 5, 3, 2, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,50,46,41,40,42,40,42,40,42,41,42,41,43,41,43,41,49,45,40,42,40,42,38,33,29,24,20 }), - RSP_DX_BAND_250_420(FrequencyBand.BAND_250_420, - new int[]{ 27,27,27,27,27,26,24,23,21,20,18,17,15,14,12,11, 9, 8, 6, 6, 5, 3, 2, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,50,46,41,40,42,40,42,40,42,41,42,41,43,41,43,41,46,42,40,42,40,42,38,33,29,24,20 }), - RSP_DX_BAND_420_1000(FrequencyBand.BAND_420_1000, - new int[]{ 20,20,20,20,20,20,18,17,16,14,13,12,11, 9, 8, 7, 7, 5, 4, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,51,48,44,40,42,42,41,43,42,41,41,43,42,44,40,43,42,41,40,46,43,39,35,31,28,24,20 }), - RSP_DX_BAND_1000_2000(FrequencyBand.BAND_1000_2000, - new int[]{ 18,18,18,18,18,18,16,15,14,13,11,10, 9, 8, 7, 6, 6, 6, 5, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,44,40,43,42,41,41,43,42,41,41,40,48,45,41,40,42,42,41,42,39,35,31,27,24,20 }), - - //HiZ Port - RSP2 and RSPduo - RSP_2_AND_DUO_HIZ_BAND_0_12(FrequencyBand.BAND_0_12, - new int[]{ 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,56,54,51,48,45,43,40,56,54,51,48,45,43,40,43,41,44,41,44,42,39,36,34,31,28,25,23,20 }), - RSP_2_AND_DUO_HIZ_BAND_12_60(FrequencyBand.BAND_12_60, - new int[]{ 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,56,54,51,48,45,43,40,56,54,51,48,45,43,40,43,41,44,41,44,42,39,36,34,31,28,25,23,20 }), - - //RSPdx HDR Mode - RSP_DX_HDR_BAND_0_2(FrequencyBand.BAND_0_12, - new int[]{ 18,18,18,18,18,18,17,16,14,13,12,11,10, 9, 7, 6, 5, 5, 5, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0 }, - new int[]{ 59,55,52,48,45,41,41,40,43,42,42,41,41,40,42,42,47,44,40,43,42,42,41,38,34,31,27,24,20 }), - - UNKNOWN(FrequencyBand.UNKNOWN, new int[]{}, new int[]{}); - - private FrequencyBand mFrequencyBand; - private int[] mLnaStates; - private int[] mGainReductions; - - GainReduction(FrequencyBand frequencyBand, int[] lnaStates, int[] gainReductions) - { - mFrequencyBand = frequencyBand; - mLnaStates = lnaStates; - mGainReductions = gainReductions; - } - - /** - * Identifies the index of the gain reduction value from the array of possible gain reduction values. - * @param gainReductionValue to lookup index - * @return matching index or -1 if a matching index is not found. - */ - public int getGainIndex(int gainReductionValue) - { - for(int x = 0; x < mGainReductions.length; x++) - { - if(mGainReductions[x] == gainReductionValue) - { - return x; - } - } - - return -1; - } - - /** - * Minimum index for gain values - */ - public static int MIN_GAIN_INDEX = 0; - - /** - * Maximum index for gain values - */ - public static int MAX_GAIN_INDEX = 28; - - /** - * Number of discrete gain steps available for each entry - */ - public static int GAIN_STEPS_AVAILABLE = 29; - - /** - * RSP1 Gain Reduction Tables - */ - public static EnumSet RSP_1_GAINS = EnumSet.range(RSP1_BAND_0_12, RSP1_BAND_1000_2000); - - /** - * RSP1A Gain Reduction Tables - */ - public static EnumSet RSP_1A_GAINS = EnumSet.range(RSP1A_BAND_0_12, RSP1A_BAND_1000_2000); - - /** - * RSP2 Gain Reduction Tables - */ - public static EnumSet RSP_2_GAINS = EnumSet.range(RSP2_BAND_0_12, RSP2_BAND_1000_2000); - - /** - * RSPduo Gain Reduction Tables - */ - public static EnumSet RSP_DUO_GAINS = EnumSet.range(RSP_DUO_BAND_0_12, RSP_DUO_BAND_1000_2000); - - /** - * RSPdx Gain Reduction Tables - */ - public static EnumSet RSP_DX_GAINS = EnumSet.range(RSP_DX_BAND_0_12, RSP_DX_BAND_1000_2000); - - /** - * RSPdx HDR Mode Gain Reduction Tables - */ - public static EnumSet RSP_DX_HDR_GAINS = EnumSet.of(RSP_DX_HDR_BAND_0_2); - - /** - * RSP2 and RSPduo HiZ Port Gain Reduction Tables - */ - public static EnumSet RSP_HIZ_GAINS = EnumSet.range(RSP_2_AND_DUO_HIZ_BAND_0_12, RSP_2_AND_DUO_HIZ_BAND_12_60); - - /** - * Lookup the gain reduction entry for a device that matches the frequency band. - * - * Note: directly use the RSP_DX_HDR_GAINS and RSP_HIZ_GAINS enumeration sets to match for HDR or HIZ modes. - * - * @param deviceType to lookup - * @param frequencyBand to match - * @return entry or UNKNOWN - */ - public static GainReduction lookup(DeviceType deviceType, FrequencyBand frequencyBand) - { - switch(deviceType) - { - case RSP1 -> { - return fromBand(frequencyBand, RSP_1_GAINS); - } - case RSP1A -> { - return fromBand(frequencyBand, RSP_1A_GAINS); - } - case RSP2 -> { - return fromBand(frequencyBand, RSP_2_GAINS); - } - case RSPduo -> { - return fromBand(frequencyBand, RSP_DUO_GAINS); - } - case RSPdx -> { - return fromBand(frequencyBand, RSP_DX_GAINS); - } - } - - return UNKNOWN; - } - - /** - * Lookup the gain reduction entry for a device that matches the specified frequency - * @param deviceType to lookup - * @param frequency to map to a frequency band - * @return gain reduction entry or UNKNOWN - */ - public static GainReduction lookup(DeviceType deviceType, long frequency) - { - FrequencyBand band = FrequencyBand.fromValue(frequency); - return lookup(deviceType, band); - } - - /** - * Look up the gain reduction value that matches the frequency band from the set of gain reduction values. - * @param frequencyBand to lookup - * @param values to choose from - * @return matching entry or UNKNOWN - */ - private static GainReduction fromBand(FrequencyBand frequencyBand, EnumSet values) - { - for(GainReduction gainReduction: values) - { - if(gainReduction.getFrequencyBand() == frequencyBand) - { - return gainReduction; - } - } - - return UNKNOWN; - } - - /** - * Frequency band for the range of LNA state and gain reduction values. - */ - public FrequencyBand getFrequencyBand() - { - return mFrequencyBand; - } - - /** - * Array of LNA states - */ - private int[] getLnaStates() - { - return mLnaStates; - } - - /** - * Array of gain reduction values - */ - private int[] getGainReductions() - { - return mGainReductions; - } - - /** - * LNA state value for the specified gain index - * @param index for the gain (0 - 29) - * @return lna state - */ - public int getLnaState(int index) - { - if(MIN_GAIN_INDEX <= index && index <= MAX_GAIN_INDEX) - { - return getLnaStates()[index]; - } - - throw new IllegalArgumentException("Unrecognized gain index [" + index + "] - valid range: " + - MIN_GAIN_INDEX + " <> " + MAX_GAIN_INDEX); - } - - /** - * Gain reduction value for the specified gain index - * @param index for the gain (0 - 29) - * @return gain reduction value (dB) - */ - public int getGainReduction(int index) - { - if(MIN_GAIN_INDEX <= index && index <= MAX_GAIN_INDEX) - { - return getGainReductions()[index]; - } - - throw new IllegalArgumentException("Unrecognized gain index [" + index + "] - valid range: " + - MIN_GAIN_INDEX + " <> " + MAX_GAIN_INDEX); - } - - /** - * Indicates if this gain reduction entry is valid for the specified frequency by checking the frequency band - * of this entry and testing for containment. - * @param frequency to check - * @return true if the frequency is contained in the frequency band for this entry. - */ - public boolean isValidFor(long frequency) - { - return getFrequencyBand().contains(frequency); - } -} diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/RspDuoTunerParameters.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/RspDuoTunerParameters.java index b25878aae..b52ebdebc 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/RspDuoTunerParameters.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/RspDuoTunerParameters.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,14 +19,12 @@ package io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner; -import io.github.dsheirer.source.tuner.sdrplay.api.util.Flag; -import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_RspDuoTunerParamsT; import java.lang.foreign.MemorySegment; /** - * RSPduo Tuner Parameters structure + * RSPduo abstract Tuner Parameters structure */ -public class RspDuoTunerParameters extends TunerParameters +public abstract class RspDuoTunerParameters extends TunerParameters { private MemorySegment mRspDuoMemorySegment; @@ -44,7 +42,7 @@ public class RspDuoTunerParameters extends TunerParameters /** * Foreign memory segment for this structure */ - private MemorySegment getRspDuoMemorySegment() + MemorySegment getRspDuoMemorySegment() { return mRspDuoMemorySegment; } @@ -52,80 +50,50 @@ private MemorySegment getRspDuoMemorySegment() /** * Indicates if the Bias-T is enabled */ - public boolean isBiasT() - { - return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.biasTEnable$get(getRspDuoMemorySegment())); - } + public abstract boolean isBiasT(); /** * Enables or disables the Bias-T */ - public void setBiasT(boolean enable) - { - sdrplay_api_RspDuoTunerParamsT.biasTEnable$set(getRspDuoMemorySegment(), Flag.of(enable)); - } + public abstract void setBiasT(boolean enable); /** * Tuner 1 AM port setting */ - public RspDuoAmPort getTuner1AmPort() - { - return RspDuoAmPort.fromValue(sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$get(getRspDuoMemorySegment())); - } + public abstract RspDuoAmPort getTuner1AmPort(); /** * Set Tuner 1 AM port setting */ - public void setTuner1AmPort(RspDuoAmPort amPort) - { - sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$set(getRspDuoMemorySegment(), amPort.getValue()); - } + public abstract void setTuner1AmPort(RspDuoAmPort amPort); /** * Indicates if Tuner 1 AM notch is enabled */ - public boolean isTuner1AmNotch() - { - return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$get(getRspDuoMemorySegment())); - } + public abstract boolean isTuner1AmNotch(); /** * Enables or disables the Tuner 1 AM notch */ - public void setTuner1AmNotch(boolean enable) - { - sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable)); - } + public abstract void setTuner1AmNotch(boolean enable); /** * Indicates if the RF notch is enabled */ - public boolean isRfNotch() - { - return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$get(getRspDuoMemorySegment())); - } + public abstract boolean isRfNotch(); /** * Enables or disables the RF notch */ - public void setRfNotch(boolean enable) - { - sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable)); - } + public abstract void setRfNotch(boolean enable); /** * Indicates if the RF DAB notch is enabled */ - public boolean isRfDabNotch() - { - return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$get(getRspDuoMemorySegment())); - } + public abstract boolean isRfDabNotch(); /** * Enables or disables the RF DAB notch */ - public void setRfDabNotch(boolean enable) - { - sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable)); - } + public abstract void setRfDabNotch(boolean enable); } diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/RspDuoTunerParametersV3_07.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/RspDuoTunerParametersV3_07.java new file mode 100644 index 000000000..eac78878f --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/RspDuoTunerParametersV3_07.java @@ -0,0 +1,120 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +package io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner; + +import io.github.dsheirer.source.tuner.sdrplay.api.util.Flag; +import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_RspDuoTunerParamsT; +import java.lang.foreign.MemorySegment; + +/** + * RSPduo Tuner Parameters structure for API Versions 3.07 - 3.12. + */ +public class RspDuoTunerParametersV3_07 extends RspDuoTunerParameters +{ + /** + * Constructs an instance from the foreign memory segment + * @param tunerParametersMemorySegment of foreign memory structure + * @param rspDuoMemorySegment of foreign memory structure + */ + RspDuoTunerParametersV3_07(MemorySegment tunerParametersMemorySegment, MemorySegment rspDuoMemorySegment) + { + super(tunerParametersMemorySegment, rspDuoMemorySegment); + } + + /** + * Indicates if the Bias-T is enabled + */ + public boolean isBiasT() + { + return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.biasTEnable$get(getRspDuoMemorySegment())); + } + + /** + * Enables or disables the Bias-T + */ + public void setBiasT(boolean enable) + { + sdrplay_api_RspDuoTunerParamsT.biasTEnable$set(getRspDuoMemorySegment(), Flag.of(enable)); + } + + /** + * Tuner 1 AM port setting + */ + public RspDuoAmPort getTuner1AmPort() + { + return RspDuoAmPort.fromValue(sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$get(getRspDuoMemorySegment())); + } + + /** + * Set Tuner 1 AM port setting + */ + public void setTuner1AmPort(RspDuoAmPort amPort) + { + sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$set(getRspDuoMemorySegment(), amPort.getValue()); + } + + /** + * Indicates if Tuner 1 AM notch is enabled + */ + public boolean isTuner1AmNotch() + { + return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$get(getRspDuoMemorySegment())); + } + + /** + * Enables or disables the Tuner 1 AM notch + */ + public void setTuner1AmNotch(boolean enable) + { + sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable)); + } + + /** + * Indicates if the RF notch is enabled + */ + public boolean isRfNotch() + { + return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$get(getRspDuoMemorySegment())); + } + + /** + * Enables or disables the RF notch + */ + public void setRfNotch(boolean enable) + { + sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable)); + } + + /** + * Indicates if the RF DAB notch is enabled + */ + public boolean isRfDabNotch() + { + return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$get(getRspDuoMemorySegment())); + } + + /** + * Enables or disables the RF DAB notch + */ + public void setRfDabNotch(boolean enable) + { + sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable)); + } +} diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/RspDuoTunerParametersV3_14.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/RspDuoTunerParametersV3_14.java new file mode 100644 index 000000000..513b7c85c --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/RspDuoTunerParametersV3_14.java @@ -0,0 +1,123 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +package io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner; + +import io.github.dsheirer.source.tuner.sdrplay.api.util.Flag; +import io.github.dsheirer.source.tuner.sdrplay.api.v3_14.sdrplay_api_RspDuoTunerParamsT; +import java.lang.foreign.MemorySegment; + +/** + * RSPduo Tuner Parameters structure for API Versions 3.14+. + * + * Note: version 3.14 is different from version 3.07-3.12 because it adds the RspDuo_ResetSlaveFlagsT structure and + * methods, however these are not used/implemented in this class or in the parent abstract class. + */ +public class RspDuoTunerParametersV3_14 extends RspDuoTunerParameters +{ + /** + * Constructs an instance from the foreign memory segment + * @param tunerParametersMemorySegment of foreign memory structure + * @param rspDuoMemorySegment of foreign memory structure + */ + RspDuoTunerParametersV3_14(MemorySegment tunerParametersMemorySegment, MemorySegment rspDuoMemorySegment) + { + super(tunerParametersMemorySegment, rspDuoMemorySegment); + } + + /** + * Indicates if the Bias-T is enabled + */ + public boolean isBiasT() + { + return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.biasTEnable$get(getRspDuoMemorySegment())); + } + + /** + * Enables or disables the Bias-T + */ + public void setBiasT(boolean enable) + { + sdrplay_api_RspDuoTunerParamsT.biasTEnable$set(getRspDuoMemorySegment(), Flag.of(enable)); + } + + /** + * Tuner 1 AM port setting + */ + public RspDuoAmPort getTuner1AmPort() + { + return RspDuoAmPort.fromValue(sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$get(getRspDuoMemorySegment())); + } + + /** + * Set Tuner 1 AM port setting + */ + public void setTuner1AmPort(RspDuoAmPort amPort) + { + sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$set(getRspDuoMemorySegment(), amPort.getValue()); + } + + /** + * Indicates if Tuner 1 AM notch is enabled + */ + public boolean isTuner1AmNotch() + { + return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$get(getRspDuoMemorySegment())); + } + + /** + * Enables or disables the Tuner 1 AM notch + */ + public void setTuner1AmNotch(boolean enable) + { + sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable)); + } + + /** + * Indicates if the RF notch is enabled + */ + public boolean isRfNotch() + { + return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$get(getRspDuoMemorySegment())); + } + + /** + * Enables or disables the RF notch + */ + public void setRfNotch(boolean enable) + { + sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable)); + } + + /** + * Indicates if the RF DAB notch is enabled + */ + public boolean isRfDabNotch() + { + return Flag.evaluate(sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$get(getRspDuoMemorySegment())); + } + + /** + * Enables or disables the RF DAB notch + */ + public void setRfDabNotch(boolean enable) + { + sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$set(getRspDuoMemorySegment(), Flag.of(enable)); + } +} diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/TunerParametersFactory.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/TunerParametersFactory.java index c7479ab7c..42489da5e 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/TunerParametersFactory.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/parameter/tuner/TunerParametersFactory.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,7 @@ package io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner; +import io.github.dsheirer.source.tuner.sdrplay.api.Version; import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceType; import io.github.dsheirer.source.tuner.sdrplay.api.v3_07.sdrplay_api_RxChannelParamsT; import java.lang.foreign.MemorySegment; @@ -34,7 +35,7 @@ public class TunerParametersFactory * @param memorySegment for the sdrplay_api_RxChannelParamsT structure * @return tuner parameters */ - public static TunerParameters create(DeviceType deviceType, MemorySegment memorySegment) + public static TunerParameters create(Version version, DeviceType deviceType, MemorySegment memorySegment) { MemorySegment tunerParametersMemorySegment = sdrplay_api_RxChannelParamsT.tunerParams$slice(memorySegment); @@ -43,7 +44,8 @@ public static TunerParameters create(DeviceType deviceType, MemorySegment memory case RSP1 -> { return new Rsp1TunerParameters(tunerParametersMemorySegment); } - case RSP1A -> { + //RSP1A and RSP1B share the same tuner parameters structures + case RSP1A, RSP1B -> { MemorySegment rsp1AMemorySegment = sdrplay_api_RxChannelParamsT.rsp1aTunerParams$slice(memorySegment); return new Rsp1aTunerParameters(memorySegment, rsp1AMemorySegment); } @@ -52,8 +54,20 @@ public static TunerParameters create(DeviceType deviceType, MemorySegment memory return new Rsp2TunerParameters(memorySegment, rsp2MemorySegment); } case RSPduo -> { - MemorySegment rspDuoMemorySegment = sdrplay_api_RxChannelParamsT.rspDuoTunerParams$slice(memorySegment); - return new RspDuoTunerParameters(memorySegment, rspDuoMemorySegment); + if(version.gte(Version.V3_14)) + { + MemorySegment rspDuoMemorySegment = io.github.dsheirer.source.tuner.sdrplay.api.v3_14.sdrplay_api_RxChannelParamsT.rspDuoTunerParams$slice(memorySegment); + return new RspDuoTunerParametersV3_14(memorySegment, rspDuoMemorySegment); + } + else if(version.gte(Version.V3_07)) + { + MemorySegment rspDuoMemorySegment = sdrplay_api_RxChannelParamsT.rspDuoTunerParams$slice(memorySegment); + return new RspDuoTunerParametersV3_07(memorySegment, rspDuoMemorySegment); + } + else + { + throw new IllegalArgumentException("Unrecognized API version: " + version); + } } case RSPdx -> { MemorySegment rspDxMemorySegment = sdrplay_api_RxChannelParamsT.rspDxTunerParams$slice(memorySegment); diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/Constants$root.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/Constants$root.java new file mode 100644 index 000000000..951fd2794 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/Constants$root.java @@ -0,0 +1,55 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import static java.lang.foreign.ValueLayout.ADDRESS; +import static java.lang.foreign.ValueLayout.JAVA_BOOLEAN; +import static java.lang.foreign.ValueLayout.JAVA_BYTE; +import static java.lang.foreign.ValueLayout.JAVA_DOUBLE; +import static java.lang.foreign.ValueLayout.JAVA_FLOAT; +import static java.lang.foreign.ValueLayout.JAVA_INT; +import static java.lang.foreign.ValueLayout.JAVA_LONG; +import static java.lang.foreign.ValueLayout.JAVA_SHORT; +import static java.lang.foreign.ValueLayout.OfAddress; +import static java.lang.foreign.ValueLayout.OfBoolean; +import static java.lang.foreign.ValueLayout.OfByte; +import static java.lang.foreign.ValueLayout.OfDouble; +import static java.lang.foreign.ValueLayout.OfFloat; +import static java.lang.foreign.ValueLayout.OfInt; +import static java.lang.foreign.ValueLayout.OfLong; +import static java.lang.foreign.ValueLayout.OfShort; +final class Constants$root { + + // Suppresses default constructor, ensuring non-instantiability. + private Constants$root() {} + static final OfBoolean C_BOOL$LAYOUT = JAVA_BOOLEAN; + static final OfByte C_CHAR$LAYOUT = JAVA_BYTE; + static final OfShort C_SHORT$LAYOUT = JAVA_SHORT; + static final OfInt C_INT$LAYOUT = JAVA_INT; + static final OfLong C_LONG$LAYOUT = JAVA_LONG; + static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG; + static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT; + static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE; + static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64).asUnbounded(); +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/RuntimeHelper.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/RuntimeHelper.java new file mode 100644 index 000000000..372469d8b --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/RuntimeHelper.java @@ -0,0 +1,253 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; +// Generated by jextract + +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.Linker; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; + +import static java.lang.foreign.ValueLayout.ADDRESS; +import static java.lang.foreign.ValueLayout.JAVA_DOUBLE; +import static java.lang.foreign.ValueLayout.JAVA_LONG; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto()); + + static { + System.loadLibrary("libsdrplay_api"); + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), symbol.scope())).orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, SegmentScope scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, SegmentScope scope) { + return MemorySegment.ofAddress(addr.address(), numElements * layout.byteSize(), scope); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$0.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$0.java new file mode 100644 index 000000000..ec7c744c4 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$0.java @@ -0,0 +1,89 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.invoke.MethodHandle; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} + static final FunctionDescriptor sdrplay_api_StreamCallback_t$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_StreamCallback_t_UP$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_StreamCallback_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_StreamCallback_t.class, "apply", constants$0.sdrplay_api_StreamCallback_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_StreamCallback_t_DOWN$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_StreamCallback_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$0.sdrplay_api_StreamCallback_t_DOWN$FUNC + ); + static final FunctionDescriptor sdrplay_api_EventCallback_t$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_EventCallback_t_UP$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_EventCallback_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_EventCallback_t.class, "apply", constants$0.sdrplay_api_EventCallback_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_EventCallback_t_DOWN$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_EventCallback_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$0.sdrplay_api_EventCallback_t_DOWN$FUNC + ); + static final FunctionDescriptor sdrplay_api_Open_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final FunctionDescriptor sdrplay_api_Open_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle sdrplay_api_Open_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_Open_t.class, "apply", constants$0.sdrplay_api_Open_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_Open_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle sdrplay_api_Open_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$0.sdrplay_api_Open_t_DOWN$FUNC + ); +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$1.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$1.java new file mode 100644 index 000000000..28a64774e --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$1.java @@ -0,0 +1,59 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.invoke.MethodHandle; +final class constants$1 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$1() {} + static final FunctionDescriptor sdrplay_api_Close_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final FunctionDescriptor sdrplay_api_Close_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle sdrplay_api_Close_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_Close_t.class, "apply", constants$1.sdrplay_api_Close_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_Close_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle sdrplay_api_Close_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$1.sdrplay_api_Close_t_DOWN$FUNC + ); + static final FunctionDescriptor sdrplay_api_ApiVersion_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_ApiVersion_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_ApiVersion_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_ApiVersion_t.class, "apply", constants$1.sdrplay_api_ApiVersion_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_ApiVersion_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_ApiVersion_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$1.sdrplay_api_ApiVersion_t_DOWN$FUNC + ); + static final FunctionDescriptor sdrplay_api_LockDeviceApi_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final FunctionDescriptor sdrplay_api_LockDeviceApi_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle sdrplay_api_LockDeviceApi_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_LockDeviceApi_t.class, "apply", constants$1.sdrplay_api_LockDeviceApi_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_LockDeviceApi_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle sdrplay_api_LockDeviceApi_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$1.sdrplay_api_LockDeviceApi_t_DOWN$FUNC + ); +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$10.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$10.java new file mode 100644 index 000000000..38dd2f993 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$10.java @@ -0,0 +1,74 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.invoke.MethodHandle; +final class constants$10 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$10() {} + static final FunctionDescriptor sdrplay_api_Update$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_Update$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_Update", + constants$10.sdrplay_api_Update$FUNC + ); + static final FunctionDescriptor sdrplay_api_SwapRspDuoActiveTuner$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_SwapRspDuoActiveTuner$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_SwapRspDuoActiveTuner", + constants$10.sdrplay_api_SwapRspDuoActiveTuner$FUNC + ); + static final FunctionDescriptor sdrplay_api_SwapRspDuoDualTunerModeSampleRate$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_DOUBLE$LAYOUT + ); + static final MethodHandle sdrplay_api_SwapRspDuoDualTunerModeSampleRate$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_SwapRspDuoDualTunerModeSampleRate", + constants$10.sdrplay_api_SwapRspDuoDualTunerModeSampleRate$FUNC + ); + static final FunctionDescriptor sdrplay_api_SwapRspDuoMode$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_DOUBLE$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_SwapRspDuoMode$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_SwapRspDuoMode", + constants$10.sdrplay_api_SwapRspDuoMode$FUNC + ); +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$2.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$2.java new file mode 100644 index 000000000..1d176f828 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$2.java @@ -0,0 +1,71 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.invoke.MethodHandle; +final class constants$2 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$2() {} + static final FunctionDescriptor sdrplay_api_UnlockDeviceApi_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final FunctionDescriptor sdrplay_api_UnlockDeviceApi_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle sdrplay_api_UnlockDeviceApi_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_UnlockDeviceApi_t.class, "apply", constants$2.sdrplay_api_UnlockDeviceApi_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_UnlockDeviceApi_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle sdrplay_api_UnlockDeviceApi_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$2.sdrplay_api_UnlockDeviceApi_t_DOWN$FUNC + ); + static final FunctionDescriptor sdrplay_api_GetDevices_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_GetDevices_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_GetDevices_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_GetDevices_t.class, "apply", constants$2.sdrplay_api_GetDevices_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_GetDevices_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_GetDevices_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$2.sdrplay_api_GetDevices_t_DOWN$FUNC + ); + static final FunctionDescriptor sdrplay_api_SelectDevice_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_SelectDevice_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_SelectDevice_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_SelectDevice_t.class, "apply", constants$2.sdrplay_api_SelectDevice_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_SelectDevice_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_SelectDevice_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$2.sdrplay_api_SelectDevice_t_DOWN$FUNC + ); +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$3.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$3.java new file mode 100644 index 000000000..027b0e547 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$3.java @@ -0,0 +1,71 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.invoke.MethodHandle; +final class constants$3 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$3() {} + static final FunctionDescriptor sdrplay_api_ReleaseDevice_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_ReleaseDevice_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_ReleaseDevice_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_ReleaseDevice_t.class, "apply", constants$3.sdrplay_api_ReleaseDevice_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_ReleaseDevice_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_ReleaseDevice_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$3.sdrplay_api_ReleaseDevice_t_DOWN$FUNC + ); + static final FunctionDescriptor sdrplay_api_GetErrorString_t$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_GetErrorString_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_GetErrorString_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_GetErrorString_t.class, "apply", constants$3.sdrplay_api_GetErrorString_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_GetErrorString_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_GetErrorString_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$3.sdrplay_api_GetErrorString_t_DOWN$FUNC + ); + static final FunctionDescriptor sdrplay_api_GetLastError_t$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_GetLastError_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_GetLastError_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_GetLastError_t.class, "apply", constants$3.sdrplay_api_GetLastError_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_GetLastError_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_GetLastError_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$3.sdrplay_api_GetLastError_t_DOWN$FUNC + ); +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$4.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$4.java new file mode 100644 index 000000000..6dcc14577 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$4.java @@ -0,0 +1,74 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.invoke.MethodHandle; +final class constants$4 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$4() {} + static final FunctionDescriptor sdrplay_api_GetLastErrorByType_t$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_GetLastErrorByType_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_GetLastErrorByType_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_GetLastErrorByType_t.class, "apply", constants$4.sdrplay_api_GetLastErrorByType_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_GetLastErrorByType_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_GetLastErrorByType_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$4.sdrplay_api_GetLastErrorByType_t_DOWN$FUNC + ); + static final FunctionDescriptor sdrplay_api_DisableHeartbeat_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final FunctionDescriptor sdrplay_api_DisableHeartbeat_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle sdrplay_api_DisableHeartbeat_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_DisableHeartbeat_t.class, "apply", constants$4.sdrplay_api_DisableHeartbeat_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_DisableHeartbeat_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle sdrplay_api_DisableHeartbeat_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$4.sdrplay_api_DisableHeartbeat_t_DOWN$FUNC + ); + static final FunctionDescriptor sdrplay_api_DebugEnable_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_DebugEnable_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_DebugEnable_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_DebugEnable_t.class, "apply", constants$4.sdrplay_api_DebugEnable_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_DebugEnable_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_DebugEnable_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$4.sdrplay_api_DebugEnable_t_DOWN$FUNC + ); +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$5.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$5.java new file mode 100644 index 000000000..864b83ee7 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$5.java @@ -0,0 +1,80 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.invoke.MethodHandle; +final class constants$5 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$5() {} + static final FunctionDescriptor sdrplay_api_GetDeviceParams_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_GetDeviceParams_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_GetDeviceParams_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_GetDeviceParams_t.class, "apply", constants$5.sdrplay_api_GetDeviceParams_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_GetDeviceParams_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_GetDeviceParams_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$5.sdrplay_api_GetDeviceParams_t_DOWN$FUNC + ); + static final FunctionDescriptor sdrplay_api_Init_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_Init_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_Init_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_Init_t.class, "apply", constants$5.sdrplay_api_Init_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_Init_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_Init_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$5.sdrplay_api_Init_t_DOWN$FUNC + ); + static final FunctionDescriptor sdrplay_api_Uninit_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_Uninit_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_Uninit_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_Uninit_t.class, "apply", constants$5.sdrplay_api_Uninit_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_Uninit_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_Uninit_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$5.sdrplay_api_Uninit_t_DOWN$FUNC + ); +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$6.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$6.java new file mode 100644 index 000000000..c6284396c --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$6.java @@ -0,0 +1,89 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.invoke.MethodHandle; +final class constants$6 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$6() {} + static final FunctionDescriptor sdrplay_api_Update_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_Update_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_Update_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_Update_t.class, "apply", constants$6.sdrplay_api_Update_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_Update_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_Update_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$6.sdrplay_api_Update_t_DOWN$FUNC + ); + static final FunctionDescriptor sdrplay_api_SwapRspDuoActiveTuner_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_SwapRspDuoActiveTuner_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_SwapRspDuoActiveTuner_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_SwapRspDuoActiveTuner_t.class, "apply", constants$6.sdrplay_api_SwapRspDuoActiveTuner_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_SwapRspDuoActiveTuner_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_SwapRspDuoActiveTuner_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$6.sdrplay_api_SwapRspDuoActiveTuner_t_DOWN$FUNC + ); + static final FunctionDescriptor sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_DOUBLE$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_DOUBLE$LAYOUT + ); + static final MethodHandle sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t.class, "apply", constants$6.sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_DOUBLE$LAYOUT + ); + static final MethodHandle sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$6.sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_DOWN$FUNC + ); +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$7.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$7.java new file mode 100644 index 000000000..a417b443d --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$7.java @@ -0,0 +1,88 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.invoke.MethodHandle; +final class constants$7 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$7() {} + static final FunctionDescriptor sdrplay_api_SwapRspDuoMode_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_DOUBLE$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final FunctionDescriptor sdrplay_api_SwapRspDuoMode_t_UP$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_DOUBLE$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_SwapRspDuoMode_t_UP$MH = RuntimeHelper.upcallHandle(sdrplay_api_SwapRspDuoMode_t.class, "apply", constants$7.sdrplay_api_SwapRspDuoMode_t_UP$FUNC); + static final FunctionDescriptor sdrplay_api_SwapRspDuoMode_t_DOWN$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_DOUBLE$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_SwapRspDuoMode_t_DOWN$MH = RuntimeHelper.downcallHandle( + constants$7.sdrplay_api_SwapRspDuoMode_t_DOWN$FUNC + ); + static final FunctionDescriptor sdrplay_api_Open$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle sdrplay_api_Open$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_Open", + constants$7.sdrplay_api_Open$FUNC + ); + static final FunctionDescriptor sdrplay_api_Close$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle sdrplay_api_Close$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_Close", + constants$7.sdrplay_api_Close$FUNC + ); + static final FunctionDescriptor sdrplay_api_ApiVersion$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_ApiVersion$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_ApiVersion", + constants$7.sdrplay_api_ApiVersion$FUNC + ); + static final FunctionDescriptor sdrplay_api_LockDeviceApi$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle sdrplay_api_LockDeviceApi$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_LockDeviceApi", + constants$7.sdrplay_api_LockDeviceApi$FUNC + ); +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$8.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$8.java new file mode 100644 index 000000000..f8276865c --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$8.java @@ -0,0 +1,74 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.invoke.MethodHandle; +final class constants$8 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$8() {} + static final FunctionDescriptor sdrplay_api_UnlockDeviceApi$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle sdrplay_api_UnlockDeviceApi$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_UnlockDeviceApi", + constants$8.sdrplay_api_UnlockDeviceApi$FUNC + ); + static final FunctionDescriptor sdrplay_api_GetDevices$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_GetDevices$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_GetDevices", + constants$8.sdrplay_api_GetDevices$FUNC + ); + static final FunctionDescriptor sdrplay_api_SelectDevice$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_SelectDevice$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_SelectDevice", + constants$8.sdrplay_api_SelectDevice$FUNC + ); + static final FunctionDescriptor sdrplay_api_ReleaseDevice$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_ReleaseDevice$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_ReleaseDevice", + constants$8.sdrplay_api_ReleaseDevice$FUNC + ); + static final FunctionDescriptor sdrplay_api_GetErrorString$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_GetErrorString$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_GetErrorString", + constants$8.sdrplay_api_GetErrorString$FUNC + ); + static final FunctionDescriptor sdrplay_api_GetLastError$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_GetLastError$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_GetLastError", + constants$8.sdrplay_api_GetLastError$FUNC + ); +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$9.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$9.java new file mode 100644 index 000000000..0e06ee168 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/constants$9.java @@ -0,0 +1,78 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.invoke.MethodHandle; +final class constants$9 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$9() {} + static final FunctionDescriptor sdrplay_api_GetLastErrorByType$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_GetLastErrorByType$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_GetLastErrorByType", + constants$9.sdrplay_api_GetLastErrorByType$FUNC + ); + static final FunctionDescriptor sdrplay_api_DisableHeartbeat$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle sdrplay_api_DisableHeartbeat$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_DisableHeartbeat", + constants$9.sdrplay_api_DisableHeartbeat$FUNC + ); + static final FunctionDescriptor sdrplay_api_DebugEnable$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle sdrplay_api_DebugEnable$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_DebugEnable", + constants$9.sdrplay_api_DebugEnable$FUNC + ); + static final FunctionDescriptor sdrplay_api_GetDeviceParams$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_GetDeviceParams$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_GetDeviceParams", + constants$9.sdrplay_api_GetDeviceParams$FUNC + ); + static final FunctionDescriptor sdrplay_api_Init$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_Init$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_Init", + constants$9.sdrplay_api_Init$FUNC + ); + static final FunctionDescriptor sdrplay_api_Uninit$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sdrplay_api_Uninit$MH = RuntimeHelper.downcallHandle( + "sdrplay_api_Uninit", + constants$9.sdrplay_api_Uninit$FUNC + ); +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_AgcT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_AgcT.java new file mode 100644 index 000000000..578c022b1 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_AgcT.java @@ -0,0 +1,261 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * sdrplay_api_AgcControlT enable; + * int setPoint_dBfs; + * unsigned short attack_ms; + * unsigned short decay_ms; + * unsigned short decay_delay_ms; + * unsigned short decay_threshold_dB; + * int syncUpdate; + * }; + * } + */ +public class sdrplay_api_AgcT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("enable"), + Constants$root.C_INT$LAYOUT.withName("setPoint_dBfs"), + Constants$root.C_SHORT$LAYOUT.withName("attack_ms"), + Constants$root.C_SHORT$LAYOUT.withName("decay_ms"), + Constants$root.C_SHORT$LAYOUT.withName("decay_delay_ms"), + Constants$root.C_SHORT$LAYOUT.withName("decay_threshold_dB"), + Constants$root.C_INT$LAYOUT.withName("syncUpdate") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_AgcT.$struct$LAYOUT; + } + static final VarHandle enable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("enable")); + public static VarHandle enable$VH() { + return sdrplay_api_AgcT.enable$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_AgcControlT enable; + * } + */ + public static int enable$get(MemorySegment seg) { + return (int)sdrplay_api_AgcT.enable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_AgcControlT enable; + * } + */ + public static void enable$set(MemorySegment seg, int x) { + sdrplay_api_AgcT.enable$VH.set(seg, x); + } + public static int enable$get(MemorySegment seg, long index) { + return (int)sdrplay_api_AgcT.enable$VH.get(seg.asSlice(index*sizeof())); + } + public static void enable$set(MemorySegment seg, long index, int x) { + sdrplay_api_AgcT.enable$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle setPoint_dBfs$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("setPoint_dBfs")); + public static VarHandle setPoint_dBfs$VH() { + return sdrplay_api_AgcT.setPoint_dBfs$VH; + } + /** + * Getter for field: + * {@snippet : + * int setPoint_dBfs; + * } + */ + public static int setPoint_dBfs$get(MemorySegment seg) { + return (int)sdrplay_api_AgcT.setPoint_dBfs$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int setPoint_dBfs; + * } + */ + public static void setPoint_dBfs$set(MemorySegment seg, int x) { + sdrplay_api_AgcT.setPoint_dBfs$VH.set(seg, x); + } + public static int setPoint_dBfs$get(MemorySegment seg, long index) { + return (int)sdrplay_api_AgcT.setPoint_dBfs$VH.get(seg.asSlice(index*sizeof())); + } + public static void setPoint_dBfs$set(MemorySegment seg, long index, int x) { + sdrplay_api_AgcT.setPoint_dBfs$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle attack_ms$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("attack_ms")); + public static VarHandle attack_ms$VH() { + return sdrplay_api_AgcT.attack_ms$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned short attack_ms; + * } + */ + public static short attack_ms$get(MemorySegment seg) { + return (short)sdrplay_api_AgcT.attack_ms$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned short attack_ms; + * } + */ + public static void attack_ms$set(MemorySegment seg, short x) { + sdrplay_api_AgcT.attack_ms$VH.set(seg, x); + } + public static short attack_ms$get(MemorySegment seg, long index) { + return (short)sdrplay_api_AgcT.attack_ms$VH.get(seg.asSlice(index*sizeof())); + } + public static void attack_ms$set(MemorySegment seg, long index, short x) { + sdrplay_api_AgcT.attack_ms$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle decay_ms$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("decay_ms")); + public static VarHandle decay_ms$VH() { + return sdrplay_api_AgcT.decay_ms$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned short decay_ms; + * } + */ + public static short decay_ms$get(MemorySegment seg) { + return (short)sdrplay_api_AgcT.decay_ms$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned short decay_ms; + * } + */ + public static void decay_ms$set(MemorySegment seg, short x) { + sdrplay_api_AgcT.decay_ms$VH.set(seg, x); + } + public static short decay_ms$get(MemorySegment seg, long index) { + return (short)sdrplay_api_AgcT.decay_ms$VH.get(seg.asSlice(index*sizeof())); + } + public static void decay_ms$set(MemorySegment seg, long index, short x) { + sdrplay_api_AgcT.decay_ms$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle decay_delay_ms$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("decay_delay_ms")); + public static VarHandle decay_delay_ms$VH() { + return sdrplay_api_AgcT.decay_delay_ms$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned short decay_delay_ms; + * } + */ + public static short decay_delay_ms$get(MemorySegment seg) { + return (short)sdrplay_api_AgcT.decay_delay_ms$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned short decay_delay_ms; + * } + */ + public static void decay_delay_ms$set(MemorySegment seg, short x) { + sdrplay_api_AgcT.decay_delay_ms$VH.set(seg, x); + } + public static short decay_delay_ms$get(MemorySegment seg, long index) { + return (short)sdrplay_api_AgcT.decay_delay_ms$VH.get(seg.asSlice(index*sizeof())); + } + public static void decay_delay_ms$set(MemorySegment seg, long index, short x) { + sdrplay_api_AgcT.decay_delay_ms$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle decay_threshold_dB$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("decay_threshold_dB")); + public static VarHandle decay_threshold_dB$VH() { + return sdrplay_api_AgcT.decay_threshold_dB$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned short decay_threshold_dB; + * } + */ + public static short decay_threshold_dB$get(MemorySegment seg) { + return (short)sdrplay_api_AgcT.decay_threshold_dB$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned short decay_threshold_dB; + * } + */ + public static void decay_threshold_dB$set(MemorySegment seg, short x) { + sdrplay_api_AgcT.decay_threshold_dB$VH.set(seg, x); + } + public static short decay_threshold_dB$get(MemorySegment seg, long index) { + return (short)sdrplay_api_AgcT.decay_threshold_dB$VH.get(seg.asSlice(index*sizeof())); + } + public static void decay_threshold_dB$set(MemorySegment seg, long index, short x) { + sdrplay_api_AgcT.decay_threshold_dB$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle syncUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("syncUpdate")); + public static VarHandle syncUpdate$VH() { + return sdrplay_api_AgcT.syncUpdate$VH; + } + /** + * Getter for field: + * {@snippet : + * int syncUpdate; + * } + */ + public static int syncUpdate$get(MemorySegment seg) { + return (int)sdrplay_api_AgcT.syncUpdate$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int syncUpdate; + * } + */ + public static void syncUpdate$set(MemorySegment seg, int x) { + sdrplay_api_AgcT.syncUpdate$VH.set(seg, x); + } + public static int syncUpdate$get(MemorySegment seg, long index) { + return (int)sdrplay_api_AgcT.syncUpdate$VH.get(seg.asSlice(index*sizeof())); + } + public static void syncUpdate$set(MemorySegment seg, long index, int x) { + sdrplay_api_AgcT.syncUpdate$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ApiVersion_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ApiVersion_t.java new file mode 100644 index 000000000..d6826d9f8 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ApiVersion_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_ApiVersion_t)(float* apiVer); + * } + */ +public interface sdrplay_api_ApiVersion_t { + + int apply(java.lang.foreign.MemorySegment dev); + static MemorySegment allocate(sdrplay_api_ApiVersion_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$1.sdrplay_api_ApiVersion_t_UP$MH, fi, constants$1.sdrplay_api_ApiVersion_t$FUNC, scope); + } + static sdrplay_api_ApiVersion_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (java.lang.foreign.MemorySegment _dev) -> { + try { + return (int)constants$1.sdrplay_api_ApiVersion_t_DOWN$MH.invokeExact(symbol, _dev); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_CallbackFnsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_CallbackFnsT.java new file mode 100644 index 000000000..0fe598804 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_CallbackFnsT.java @@ -0,0 +1,150 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * sdrplay_api_StreamCallback_t StreamACbFn; + * sdrplay_api_StreamCallback_t StreamBCbFn; + * sdrplay_api_EventCallback_t EventCbFn; + * }; + * } + */ +public class sdrplay_api_CallbackFnsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("StreamACbFn"), + Constants$root.C_POINTER$LAYOUT.withName("StreamBCbFn"), + Constants$root.C_POINTER$LAYOUT.withName("EventCbFn") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_CallbackFnsT.$struct$LAYOUT; + } + static final VarHandle StreamACbFn$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("StreamACbFn")); + public static VarHandle StreamACbFn$VH() { + return sdrplay_api_CallbackFnsT.StreamACbFn$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_StreamCallback_t StreamACbFn; + * } + */ + public static MemorySegment StreamACbFn$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)sdrplay_api_CallbackFnsT.StreamACbFn$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_StreamCallback_t StreamACbFn; + * } + */ + public static void StreamACbFn$set(MemorySegment seg, MemorySegment x) { + sdrplay_api_CallbackFnsT.StreamACbFn$VH.set(seg, x); + } + public static MemorySegment StreamACbFn$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)sdrplay_api_CallbackFnsT.StreamACbFn$VH.get(seg.asSlice(index*sizeof())); + } + public static void StreamACbFn$set(MemorySegment seg, long index, MemorySegment x) { + sdrplay_api_CallbackFnsT.StreamACbFn$VH.set(seg.asSlice(index*sizeof()), x); + } + public static sdrplay_api_StreamCallback_t StreamACbFn(MemorySegment segment, SegmentScope scope) { + return sdrplay_api_StreamCallback_t.ofAddress(StreamACbFn$get(segment), scope); + } + static final VarHandle StreamBCbFn$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("StreamBCbFn")); + public static VarHandle StreamBCbFn$VH() { + return sdrplay_api_CallbackFnsT.StreamBCbFn$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_StreamCallback_t StreamBCbFn; + * } + */ + public static MemorySegment StreamBCbFn$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)sdrplay_api_CallbackFnsT.StreamBCbFn$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_StreamCallback_t StreamBCbFn; + * } + */ + public static void StreamBCbFn$set(MemorySegment seg, MemorySegment x) { + sdrplay_api_CallbackFnsT.StreamBCbFn$VH.set(seg, x); + } + public static MemorySegment StreamBCbFn$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)sdrplay_api_CallbackFnsT.StreamBCbFn$VH.get(seg.asSlice(index*sizeof())); + } + public static void StreamBCbFn$set(MemorySegment seg, long index, MemorySegment x) { + sdrplay_api_CallbackFnsT.StreamBCbFn$VH.set(seg.asSlice(index*sizeof()), x); + } + public static sdrplay_api_StreamCallback_t StreamBCbFn(MemorySegment segment, SegmentScope scope) { + return sdrplay_api_StreamCallback_t.ofAddress(StreamBCbFn$get(segment), scope); + } + static final VarHandle EventCbFn$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("EventCbFn")); + public static VarHandle EventCbFn$VH() { + return sdrplay_api_CallbackFnsT.EventCbFn$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_EventCallback_t EventCbFn; + * } + */ + public static MemorySegment EventCbFn$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)sdrplay_api_CallbackFnsT.EventCbFn$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_EventCallback_t EventCbFn; + * } + */ + public static void EventCbFn$set(MemorySegment seg, MemorySegment x) { + sdrplay_api_CallbackFnsT.EventCbFn$VH.set(seg, x); + } + public static MemorySegment EventCbFn$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)sdrplay_api_CallbackFnsT.EventCbFn$VH.get(seg.asSlice(index*sizeof())); + } + public static void EventCbFn$set(MemorySegment seg, long index, MemorySegment x) { + sdrplay_api_CallbackFnsT.EventCbFn$VH.set(seg.asSlice(index*sizeof()), x); + } + public static sdrplay_api_EventCallback_t EventCbFn(MemorySegment segment, SegmentScope scope) { + return sdrplay_api_EventCallback_t.ofAddress(EventCbFn$get(segment), scope); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Close_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Close_t.java new file mode 100644 index 000000000..bfbd9325e --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Close_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_Close_t)(); + * } + */ +public interface sdrplay_api_Close_t { + + int apply(); + static MemorySegment allocate(sdrplay_api_Close_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$1.sdrplay_api_Close_t_UP$MH, fi, constants$1.sdrplay_api_Close_t$FUNC, scope); + } + static sdrplay_api_Close_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return () -> { + try { + return (int)constants$1.sdrplay_api_Close_t_DOWN$MH.invokeExact(symbol); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ControlParamsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ControlParamsT.java new file mode 100644 index 000000000..65270d917 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ControlParamsT.java @@ -0,0 +1,112 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * sdrplay_api_DcOffsetT dcOffset; + * sdrplay_api_DecimationT decimation; + * sdrplay_api_AgcT agc; + * sdrplay_api_AdsbModeT adsbMode; + * }; + * } + */ +public class sdrplay_api_ControlParamsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("DCenable"), + Constants$root.C_CHAR$LAYOUT.withName("IQenable") + ).withName("dcOffset"), + MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("enable"), + Constants$root.C_CHAR$LAYOUT.withName("decimationFactor"), + Constants$root.C_CHAR$LAYOUT.withName("wideBandSignal") + ).withName("decimation"), + MemoryLayout.paddingLayout(24), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("enable"), + Constants$root.C_INT$LAYOUT.withName("setPoint_dBfs"), + Constants$root.C_SHORT$LAYOUT.withName("attack_ms"), + Constants$root.C_SHORT$LAYOUT.withName("decay_ms"), + Constants$root.C_SHORT$LAYOUT.withName("decay_delay_ms"), + Constants$root.C_SHORT$LAYOUT.withName("decay_threshold_dB"), + Constants$root.C_INT$LAYOUT.withName("syncUpdate") + ).withName("agc"), + Constants$root.C_INT$LAYOUT.withName("adsbMode") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_ControlParamsT.$struct$LAYOUT; + } + public static MemorySegment dcOffset$slice(MemorySegment seg) { + return seg.asSlice(0, 2); + } + public static MemorySegment decimation$slice(MemorySegment seg) { + return seg.asSlice(2, 3); + } + public static MemorySegment agc$slice(MemorySegment seg) { + return seg.asSlice(8, 20); + } + static final VarHandle adsbMode$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("adsbMode")); + public static VarHandle adsbMode$VH() { + return sdrplay_api_ControlParamsT.adsbMode$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_AdsbModeT adsbMode; + * } + */ + public static int adsbMode$get(MemorySegment seg) { + return (int)sdrplay_api_ControlParamsT.adsbMode$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_AdsbModeT adsbMode; + * } + */ + public static void adsbMode$set(MemorySegment seg, int x) { + sdrplay_api_ControlParamsT.adsbMode$VH.set(seg, x); + } + public static int adsbMode$get(MemorySegment seg, long index) { + return (int)sdrplay_api_ControlParamsT.adsbMode$VH.get(seg.asSlice(index*sizeof())); + } + public static void adsbMode$set(MemorySegment seg, long index, int x) { + sdrplay_api_ControlParamsT.adsbMode$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DcOffsetT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DcOffsetT.java new file mode 100644 index 000000000..e13586807 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DcOffsetT.java @@ -0,0 +1,111 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * unsigned char DCenable; + * unsigned char IQenable; + * }; + * } + */ +public class sdrplay_api_DcOffsetT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("DCenable"), + Constants$root.C_CHAR$LAYOUT.withName("IQenable") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_DcOffsetT.$struct$LAYOUT; + } + static final VarHandle DCenable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("DCenable")); + public static VarHandle DCenable$VH() { + return sdrplay_api_DcOffsetT.DCenable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char DCenable; + * } + */ + public static byte DCenable$get(MemorySegment seg) { + return (byte)sdrplay_api_DcOffsetT.DCenable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char DCenable; + * } + */ + public static void DCenable$set(MemorySegment seg, byte x) { + sdrplay_api_DcOffsetT.DCenable$VH.set(seg, x); + } + public static byte DCenable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_DcOffsetT.DCenable$VH.get(seg.asSlice(index*sizeof())); + } + public static void DCenable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_DcOffsetT.DCenable$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle IQenable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("IQenable")); + public static VarHandle IQenable$VH() { + return sdrplay_api_DcOffsetT.IQenable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char IQenable; + * } + */ + public static byte IQenable$get(MemorySegment seg) { + return (byte)sdrplay_api_DcOffsetT.IQenable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char IQenable; + * } + */ + public static void IQenable$set(MemorySegment seg, byte x) { + sdrplay_api_DcOffsetT.IQenable$VH.set(seg, x); + } + public static byte IQenable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_DcOffsetT.IQenable$VH.get(seg.asSlice(index*sizeof())); + } + public static void IQenable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_DcOffsetT.IQenable$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DcOffsetTunerT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DcOffsetTunerT.java new file mode 100644 index 000000000..8cdcdbfbc --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DcOffsetTunerT.java @@ -0,0 +1,172 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * unsigned char dcCal; + * unsigned char speedUp; + * int trackTime; + * int refreshRateTime; + * }; + * } + */ +public class sdrplay_api_DcOffsetTunerT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("dcCal"), + Constants$root.C_CHAR$LAYOUT.withName("speedUp"), + MemoryLayout.paddingLayout(16), + Constants$root.C_INT$LAYOUT.withName("trackTime"), + Constants$root.C_INT$LAYOUT.withName("refreshRateTime") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_DcOffsetTunerT.$struct$LAYOUT; + } + static final VarHandle dcCal$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("dcCal")); + public static VarHandle dcCal$VH() { + return sdrplay_api_DcOffsetTunerT.dcCal$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char dcCal; + * } + */ + public static byte dcCal$get(MemorySegment seg) { + return (byte)sdrplay_api_DcOffsetTunerT.dcCal$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char dcCal; + * } + */ + public static void dcCal$set(MemorySegment seg, byte x) { + sdrplay_api_DcOffsetTunerT.dcCal$VH.set(seg, x); + } + public static byte dcCal$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_DcOffsetTunerT.dcCal$VH.get(seg.asSlice(index*sizeof())); + } + public static void dcCal$set(MemorySegment seg, long index, byte x) { + sdrplay_api_DcOffsetTunerT.dcCal$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle speedUp$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("speedUp")); + public static VarHandle speedUp$VH() { + return sdrplay_api_DcOffsetTunerT.speedUp$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char speedUp; + * } + */ + public static byte speedUp$get(MemorySegment seg) { + return (byte)sdrplay_api_DcOffsetTunerT.speedUp$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char speedUp; + * } + */ + public static void speedUp$set(MemorySegment seg, byte x) { + sdrplay_api_DcOffsetTunerT.speedUp$VH.set(seg, x); + } + public static byte speedUp$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_DcOffsetTunerT.speedUp$VH.get(seg.asSlice(index*sizeof())); + } + public static void speedUp$set(MemorySegment seg, long index, byte x) { + sdrplay_api_DcOffsetTunerT.speedUp$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle trackTime$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("trackTime")); + public static VarHandle trackTime$VH() { + return sdrplay_api_DcOffsetTunerT.trackTime$VH; + } + /** + * Getter for field: + * {@snippet : + * int trackTime; + * } + */ + public static int trackTime$get(MemorySegment seg) { + return (int)sdrplay_api_DcOffsetTunerT.trackTime$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int trackTime; + * } + */ + public static void trackTime$set(MemorySegment seg, int x) { + sdrplay_api_DcOffsetTunerT.trackTime$VH.set(seg, x); + } + public static int trackTime$get(MemorySegment seg, long index) { + return (int)sdrplay_api_DcOffsetTunerT.trackTime$VH.get(seg.asSlice(index*sizeof())); + } + public static void trackTime$set(MemorySegment seg, long index, int x) { + sdrplay_api_DcOffsetTunerT.trackTime$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle refreshRateTime$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("refreshRateTime")); + public static VarHandle refreshRateTime$VH() { + return sdrplay_api_DcOffsetTunerT.refreshRateTime$VH; + } + /** + * Getter for field: + * {@snippet : + * int refreshRateTime; + * } + */ + public static int refreshRateTime$get(MemorySegment seg) { + return (int)sdrplay_api_DcOffsetTunerT.refreshRateTime$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int refreshRateTime; + * } + */ + public static void refreshRateTime$set(MemorySegment seg, int x) { + sdrplay_api_DcOffsetTunerT.refreshRateTime$VH.set(seg, x); + } + public static int refreshRateTime$get(MemorySegment seg, long index) { + return (int)sdrplay_api_DcOffsetTunerT.refreshRateTime$VH.get(seg.asSlice(index*sizeof())); + } + public static void refreshRateTime$set(MemorySegment seg, long index, int x) { + sdrplay_api_DcOffsetTunerT.refreshRateTime$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DebugEnable_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DebugEnable_t.java new file mode 100644 index 000000000..6109874ee --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DebugEnable_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_DebugEnable_t)(void* dev,enum dbgLvl); + * } + */ +public interface sdrplay_api_DebugEnable_t { + + int apply(java.lang.foreign.MemorySegment dev, int dbgLvl); + static MemorySegment allocate(sdrplay_api_DebugEnable_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$4.sdrplay_api_DebugEnable_t_UP$MH, fi, constants$4.sdrplay_api_DebugEnable_t$FUNC, scope); + } + static sdrplay_api_DebugEnable_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (java.lang.foreign.MemorySegment _dev, int _dbgLvl) -> { + try { + return (int)constants$4.sdrplay_api_DebugEnable_t_DOWN$MH.invokeExact(symbol, _dev, _dbgLvl); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DecimationT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DecimationT.java new file mode 100644 index 000000000..77bba6525 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DecimationT.java @@ -0,0 +1,141 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * unsigned char enable; + * unsigned char decimationFactor; + * unsigned char wideBandSignal; + * }; + * } + */ +public class sdrplay_api_DecimationT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("enable"), + Constants$root.C_CHAR$LAYOUT.withName("decimationFactor"), + Constants$root.C_CHAR$LAYOUT.withName("wideBandSignal") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_DecimationT.$struct$LAYOUT; + } + static final VarHandle enable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("enable")); + public static VarHandle enable$VH() { + return sdrplay_api_DecimationT.enable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char enable; + * } + */ + public static byte enable$get(MemorySegment seg) { + return (byte)sdrplay_api_DecimationT.enable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char enable; + * } + */ + public static void enable$set(MemorySegment seg, byte x) { + sdrplay_api_DecimationT.enable$VH.set(seg, x); + } + public static byte enable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_DecimationT.enable$VH.get(seg.asSlice(index*sizeof())); + } + public static void enable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_DecimationT.enable$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle decimationFactor$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("decimationFactor")); + public static VarHandle decimationFactor$VH() { + return sdrplay_api_DecimationT.decimationFactor$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char decimationFactor; + * } + */ + public static byte decimationFactor$get(MemorySegment seg) { + return (byte)sdrplay_api_DecimationT.decimationFactor$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char decimationFactor; + * } + */ + public static void decimationFactor$set(MemorySegment seg, byte x) { + sdrplay_api_DecimationT.decimationFactor$VH.set(seg, x); + } + public static byte decimationFactor$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_DecimationT.decimationFactor$VH.get(seg.asSlice(index*sizeof())); + } + public static void decimationFactor$set(MemorySegment seg, long index, byte x) { + sdrplay_api_DecimationT.decimationFactor$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle wideBandSignal$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("wideBandSignal")); + public static VarHandle wideBandSignal$VH() { + return sdrplay_api_DecimationT.wideBandSignal$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char wideBandSignal; + * } + */ + public static byte wideBandSignal$get(MemorySegment seg) { + return (byte)sdrplay_api_DecimationT.wideBandSignal$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char wideBandSignal; + * } + */ + public static void wideBandSignal$set(MemorySegment seg, byte x) { + sdrplay_api_DecimationT.wideBandSignal$VH.set(seg, x); + } + public static byte wideBandSignal$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_DecimationT.wideBandSignal$VH.get(seg.asSlice(index*sizeof())); + } + public static void wideBandSignal$set(MemorySegment seg, long index, byte x) { + sdrplay_api_DecimationT.wideBandSignal$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DevParamsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DevParamsT.java new file mode 100644 index 000000000..c8daa8a75 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DevParamsT.java @@ -0,0 +1,205 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * double ppm; + * sdrplay_api_FsFreqT fsFreq; + * sdrplay_api_SyncUpdateT syncUpdate; + * sdrplay_api_ResetFlagsT resetFlags; + * sdrplay_api_TransferModeT mode; + * unsigned int samplesPerPkt; + * sdrplay_api_Rsp1aParamsT rsp1aParams; + * sdrplay_api_Rsp2ParamsT rsp2Params; + * sdrplay_api_RspDuoParamsT rspDuoParams; + * sdrplay_api_RspDxParamsT rspDxParams; + * }; + * } + */ +public class sdrplay_api_DevParamsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_DOUBLE$LAYOUT.withName("ppm"), + MemoryLayout.structLayout( + Constants$root.C_DOUBLE$LAYOUT.withName("fsHz"), + Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"), + Constants$root.C_CHAR$LAYOUT.withName("reCal"), + MemoryLayout.paddingLayout(48) + ).withName("fsFreq"), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("sampleNum"), + Constants$root.C_INT$LAYOUT.withName("period") + ).withName("syncUpdate"), + MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("resetGainUpdate"), + Constants$root.C_CHAR$LAYOUT.withName("resetRfUpdate"), + Constants$root.C_CHAR$LAYOUT.withName("resetFsUpdate") + ).withName("resetFlags"), + MemoryLayout.paddingLayout(8), + Constants$root.C_INT$LAYOUT.withName("mode"), + Constants$root.C_INT$LAYOUT.withName("samplesPerPkt"), + MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"), + Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable") + ).withName("rsp1aParams"), + MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("extRefOutputEn") + ).withName("rsp2Params"), + MemoryLayout.paddingLayout(8), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("extRefOutputEn") + ).withName("rspDuoParams"), + MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("hdrEnable"), + Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"), + MemoryLayout.paddingLayout(16), + Constants$root.C_INT$LAYOUT.withName("antennaSel"), + Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"), + Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"), + MemoryLayout.paddingLayout(16) + ).withName("rspDxParams") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_DevParamsT.$struct$LAYOUT; + } + static final VarHandle ppm$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ppm")); + public static VarHandle ppm$VH() { + return sdrplay_api_DevParamsT.ppm$VH; + } + /** + * Getter for field: + * {@snippet : + * double ppm; + * } + */ + public static double ppm$get(MemorySegment seg) { + return (double)sdrplay_api_DevParamsT.ppm$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * double ppm; + * } + */ + public static void ppm$set(MemorySegment seg, double x) { + sdrplay_api_DevParamsT.ppm$VH.set(seg, x); + } + public static double ppm$get(MemorySegment seg, long index) { + return (double)sdrplay_api_DevParamsT.ppm$VH.get(seg.asSlice(index*sizeof())); + } + public static void ppm$set(MemorySegment seg, long index, double x) { + sdrplay_api_DevParamsT.ppm$VH.set(seg.asSlice(index*sizeof()), x); + } + public static MemorySegment fsFreq$slice(MemorySegment seg) { + return seg.asSlice(8, 16); + } + public static MemorySegment syncUpdate$slice(MemorySegment seg) { + return seg.asSlice(24, 8); + } + public static MemorySegment resetFlags$slice(MemorySegment seg) { + return seg.asSlice(32, 3); + } + static final VarHandle mode$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("mode")); + public static VarHandle mode$VH() { + return sdrplay_api_DevParamsT.mode$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_TransferModeT mode; + * } + */ + public static int mode$get(MemorySegment seg) { + return (int)sdrplay_api_DevParamsT.mode$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_TransferModeT mode; + * } + */ + public static void mode$set(MemorySegment seg, int x) { + sdrplay_api_DevParamsT.mode$VH.set(seg, x); + } + public static int mode$get(MemorySegment seg, long index) { + return (int)sdrplay_api_DevParamsT.mode$VH.get(seg.asSlice(index*sizeof())); + } + public static void mode$set(MemorySegment seg, long index, int x) { + sdrplay_api_DevParamsT.mode$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle samplesPerPkt$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("samplesPerPkt")); + public static VarHandle samplesPerPkt$VH() { + return sdrplay_api_DevParamsT.samplesPerPkt$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned int samplesPerPkt; + * } + */ + public static int samplesPerPkt$get(MemorySegment seg) { + return (int)sdrplay_api_DevParamsT.samplesPerPkt$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned int samplesPerPkt; + * } + */ + public static void samplesPerPkt$set(MemorySegment seg, int x) { + sdrplay_api_DevParamsT.samplesPerPkt$VH.set(seg, x); + } + public static int samplesPerPkt$get(MemorySegment seg, long index) { + return (int)sdrplay_api_DevParamsT.samplesPerPkt$VH.get(seg.asSlice(index*sizeof())); + } + public static void samplesPerPkt$set(MemorySegment seg, long index, int x) { + sdrplay_api_DevParamsT.samplesPerPkt$VH.set(seg.asSlice(index*sizeof()), x); + } + public static MemorySegment rsp1aParams$slice(MemorySegment seg) { + return seg.asSlice(44, 2); + } + public static MemorySegment rsp2Params$slice(MemorySegment seg) { + return seg.asSlice(46, 1); + } + public static MemorySegment rspDuoParams$slice(MemorySegment seg) { + return seg.asSlice(48, 4); + } + public static MemorySegment rspDxParams$slice(MemorySegment seg) { + return seg.asSlice(52, 12); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DeviceParamsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DeviceParamsT.java new file mode 100644 index 000000000..c94eab93e --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DeviceParamsT.java @@ -0,0 +1,141 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * sdrplay_api_DevParamsT* devParams; + * sdrplay_api_RxChannelParamsT* rxChannelA; + * sdrplay_api_RxChannelParamsT* rxChannelB; + * }; + * } + */ +public class sdrplay_api_DeviceParamsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("devParams"), + Constants$root.C_POINTER$LAYOUT.withName("rxChannelA"), + Constants$root.C_POINTER$LAYOUT.withName("rxChannelB") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_DeviceParamsT.$struct$LAYOUT; + } + static final VarHandle devParams$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("devParams")); + public static VarHandle devParams$VH() { + return sdrplay_api_DeviceParamsT.devParams$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_DevParamsT* devParams; + * } + */ + public static MemorySegment devParams$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceParamsT.devParams$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_DevParamsT* devParams; + * } + */ + public static void devParams$set(MemorySegment seg, MemorySegment x) { + sdrplay_api_DeviceParamsT.devParams$VH.set(seg, x); + } + public static MemorySegment devParams$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceParamsT.devParams$VH.get(seg.asSlice(index*sizeof())); + } + public static void devParams$set(MemorySegment seg, long index, MemorySegment x) { + sdrplay_api_DeviceParamsT.devParams$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle rxChannelA$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rxChannelA")); + public static VarHandle rxChannelA$VH() { + return sdrplay_api_DeviceParamsT.rxChannelA$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_RxChannelParamsT* rxChannelA; + * } + */ + public static MemorySegment rxChannelA$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceParamsT.rxChannelA$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_RxChannelParamsT* rxChannelA; + * } + */ + public static void rxChannelA$set(MemorySegment seg, MemorySegment x) { + sdrplay_api_DeviceParamsT.rxChannelA$VH.set(seg, x); + } + public static MemorySegment rxChannelA$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceParamsT.rxChannelA$VH.get(seg.asSlice(index*sizeof())); + } + public static void rxChannelA$set(MemorySegment seg, long index, MemorySegment x) { + sdrplay_api_DeviceParamsT.rxChannelA$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle rxChannelB$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rxChannelB")); + public static VarHandle rxChannelB$VH() { + return sdrplay_api_DeviceParamsT.rxChannelB$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_RxChannelParamsT* rxChannelB; + * } + */ + public static MemorySegment rxChannelB$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceParamsT.rxChannelB$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_RxChannelParamsT* rxChannelB; + * } + */ + public static void rxChannelB$set(MemorySegment seg, MemorySegment x) { + sdrplay_api_DeviceParamsT.rxChannelB$VH.set(seg, x); + } + public static MemorySegment rxChannelB$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceParamsT.rxChannelB$VH.get(seg.asSlice(index*sizeof())); + } + public static void rxChannelB$set(MemorySegment seg, long index, MemorySegment x) { + sdrplay_api_DeviceParamsT.rxChannelB$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DeviceT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DeviceT.java new file mode 100644 index 000000000..3edbb9a02 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DeviceT.java @@ -0,0 +1,238 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * char SerNo[64]; + * unsigned char hwVer; + * sdrplay_api_TunerSelectT tuner; + * sdrplay_api_RspDuoModeT rspDuoMode; + * unsigned char valid; + * double rspDuoSampleFreq; + * HANDLE dev; + * }; + * } + */ +public class sdrplay_api_DeviceT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(64, Constants$root.C_CHAR$LAYOUT).withName("SerNo"), + Constants$root.C_CHAR$LAYOUT.withName("hwVer"), + MemoryLayout.paddingLayout(24), + Constants$root.C_INT$LAYOUT.withName("tuner"), + Constants$root.C_INT$LAYOUT.withName("rspDuoMode"), + Constants$root.C_CHAR$LAYOUT.withName("valid"), + MemoryLayout.paddingLayout(24), + Constants$root.C_DOUBLE$LAYOUT.withName("rspDuoSampleFreq"), + Constants$root.C_POINTER$LAYOUT.withName("dev") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_DeviceT.$struct$LAYOUT; + } + public static MemorySegment SerNo$slice(MemorySegment seg) { + return seg.asSlice(0, 64); + } + static final VarHandle hwVer$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("hwVer")); + public static VarHandle hwVer$VH() { + return sdrplay_api_DeviceT.hwVer$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char hwVer; + * } + */ + public static byte hwVer$get(MemorySegment seg) { + return (byte)sdrplay_api_DeviceT.hwVer$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char hwVer; + * } + */ + public static void hwVer$set(MemorySegment seg, byte x) { + sdrplay_api_DeviceT.hwVer$VH.set(seg, x); + } + public static byte hwVer$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_DeviceT.hwVer$VH.get(seg.asSlice(index*sizeof())); + } + public static void hwVer$set(MemorySegment seg, long index, byte x) { + sdrplay_api_DeviceT.hwVer$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle tuner$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("tuner")); + public static VarHandle tuner$VH() { + return sdrplay_api_DeviceT.tuner$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_TunerSelectT tuner; + * } + */ + public static int tuner$get(MemorySegment seg) { + return (int)sdrplay_api_DeviceT.tuner$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_TunerSelectT tuner; + * } + */ + public static void tuner$set(MemorySegment seg, int x) { + sdrplay_api_DeviceT.tuner$VH.set(seg, x); + } + public static int tuner$get(MemorySegment seg, long index) { + return (int)sdrplay_api_DeviceT.tuner$VH.get(seg.asSlice(index*sizeof())); + } + public static void tuner$set(MemorySegment seg, long index, int x) { + sdrplay_api_DeviceT.tuner$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle rspDuoMode$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rspDuoMode")); + public static VarHandle rspDuoMode$VH() { + return sdrplay_api_DeviceT.rspDuoMode$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_RspDuoModeT rspDuoMode; + * } + */ + public static int rspDuoMode$get(MemorySegment seg) { + return (int)sdrplay_api_DeviceT.rspDuoMode$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_RspDuoModeT rspDuoMode; + * } + */ + public static void rspDuoMode$set(MemorySegment seg, int x) { + sdrplay_api_DeviceT.rspDuoMode$VH.set(seg, x); + } + public static int rspDuoMode$get(MemorySegment seg, long index) { + return (int)sdrplay_api_DeviceT.rspDuoMode$VH.get(seg.asSlice(index*sizeof())); + } + public static void rspDuoMode$set(MemorySegment seg, long index, int x) { + sdrplay_api_DeviceT.rspDuoMode$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle valid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("valid")); + public static VarHandle valid$VH() { + return sdrplay_api_DeviceT.valid$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char valid; + * } + */ + public static byte valid$get(MemorySegment seg) { + return (byte)sdrplay_api_DeviceT.valid$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char valid; + * } + */ + public static void valid$set(MemorySegment seg, byte x) { + sdrplay_api_DeviceT.valid$VH.set(seg, x); + } + public static byte valid$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_DeviceT.valid$VH.get(seg.asSlice(index*sizeof())); + } + public static void valid$set(MemorySegment seg, long index, byte x) { + sdrplay_api_DeviceT.valid$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle rspDuoSampleFreq$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rspDuoSampleFreq")); + public static VarHandle rspDuoSampleFreq$VH() { + return sdrplay_api_DeviceT.rspDuoSampleFreq$VH; + } + /** + * Getter for field: + * {@snippet : + * double rspDuoSampleFreq; + * } + */ + public static double rspDuoSampleFreq$get(MemorySegment seg) { + return (double)sdrplay_api_DeviceT.rspDuoSampleFreq$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * double rspDuoSampleFreq; + * } + */ + public static void rspDuoSampleFreq$set(MemorySegment seg, double x) { + sdrplay_api_DeviceT.rspDuoSampleFreq$VH.set(seg, x); + } + public static double rspDuoSampleFreq$get(MemorySegment seg, long index) { + return (double)sdrplay_api_DeviceT.rspDuoSampleFreq$VH.get(seg.asSlice(index*sizeof())); + } + public static void rspDuoSampleFreq$set(MemorySegment seg, long index, double x) { + sdrplay_api_DeviceT.rspDuoSampleFreq$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle dev$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("dev")); + public static VarHandle dev$VH() { + return sdrplay_api_DeviceT.dev$VH; + } + /** + * Getter for field: + * {@snippet : + * HANDLE dev; + * } + */ + public static MemorySegment dev$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceT.dev$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * HANDLE dev; + * } + */ + public static void dev$set(MemorySegment seg, MemorySegment x) { + sdrplay_api_DeviceT.dev$VH.set(seg, x); + } + public static MemorySegment dev$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)sdrplay_api_DeviceT.dev$VH.get(seg.asSlice(index*sizeof())); + } + public static void dev$set(MemorySegment seg, long index, MemorySegment x) { + sdrplay_api_DeviceT.dev$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DisableHeartbeat_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DisableHeartbeat_t.java new file mode 100644 index 000000000..5e8d760bf --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_DisableHeartbeat_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_DisableHeartbeat_t)(); + * } + */ +public interface sdrplay_api_DisableHeartbeat_t { + + int apply(); + static MemorySegment allocate(sdrplay_api_DisableHeartbeat_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$4.sdrplay_api_DisableHeartbeat_t_UP$MH, fi, constants$4.sdrplay_api_DisableHeartbeat_t$FUNC, scope); + } + static sdrplay_api_DisableHeartbeat_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return () -> { + try { + return (int)constants$4.sdrplay_api_DisableHeartbeat_t_DOWN$MH.invokeExact(symbol); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ErrorInfoT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ErrorInfoT.java new file mode 100644 index 000000000..39945b39d --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ErrorInfoT.java @@ -0,0 +1,96 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * char file[256]; + * char function[256]; + * int line; + * char message[1024]; + * }; + * } + */ +public class sdrplay_api_ErrorInfoT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(256, Constants$root.C_CHAR$LAYOUT).withName("file"), + MemoryLayout.sequenceLayout(256, Constants$root.C_CHAR$LAYOUT).withName("function"), + Constants$root.C_INT$LAYOUT.withName("line"), + MemoryLayout.sequenceLayout(1024, Constants$root.C_CHAR$LAYOUT).withName("message") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_ErrorInfoT.$struct$LAYOUT; + } + public static MemorySegment file$slice(MemorySegment seg) { + return seg.asSlice(0, 256); + } + public static MemorySegment function$slice(MemorySegment seg) { + return seg.asSlice(256, 256); + } + static final VarHandle line$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("line")); + public static VarHandle line$VH() { + return sdrplay_api_ErrorInfoT.line$VH; + } + /** + * Getter for field: + * {@snippet : + * int line; + * } + */ + public static int line$get(MemorySegment seg) { + return (int)sdrplay_api_ErrorInfoT.line$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int line; + * } + */ + public static void line$set(MemorySegment seg, int x) { + sdrplay_api_ErrorInfoT.line$VH.set(seg, x); + } + public static int line$get(MemorySegment seg, long index) { + return (int)sdrplay_api_ErrorInfoT.line$VH.get(seg.asSlice(index*sizeof())); + } + public static void line$set(MemorySegment seg, long index, int x) { + sdrplay_api_ErrorInfoT.line$VH.set(seg.asSlice(index*sizeof()), x); + } + public static MemorySegment message$slice(MemorySegment seg) { + return seg.asSlice(516, 1024); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_EventCallback_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_EventCallback_t.java new file mode 100644 index 000000000..48d93f7df --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_EventCallback_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * void (*sdrplay_api_EventCallback_t)(enum eventId,enum tuner,union * params,void* cbContext); + * } + */ +public interface sdrplay_api_EventCallback_t { + + void apply(int eventId, int tuner, java.lang.foreign.MemorySegment params, java.lang.foreign.MemorySegment cbContext); + static MemorySegment allocate(sdrplay_api_EventCallback_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$0.sdrplay_api_EventCallback_t_UP$MH, fi, constants$0.sdrplay_api_EventCallback_t$FUNC, scope); + } + static sdrplay_api_EventCallback_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (int _eventId, int _tuner, java.lang.foreign.MemorySegment _params, java.lang.foreign.MemorySegment _cbContext) -> { + try { + constants$0.sdrplay_api_EventCallback_t_DOWN$MH.invokeExact(symbol, _eventId, _tuner, _params, _cbContext); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_EventParamsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_EventParamsT.java new file mode 100644 index 000000000..81a7d3207 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_EventParamsT.java @@ -0,0 +1,73 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.UnionLayout; +/** + * {@snippet : + * union { + * sdrplay_api_GainCbParamT gainParams; + * sdrplay_api_PowerOverloadCbParamT powerOverloadParams; + * sdrplay_api_RspDuoModeCbParamT rspDuoModeParams; + * }; + * } + */ +public class sdrplay_api_EventParamsT { + + static final UnionLayout $union$LAYOUT = MemoryLayout.unionLayout( + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("gRdB"), + Constants$root.C_INT$LAYOUT.withName("lnaGRdB"), + Constants$root.C_DOUBLE$LAYOUT.withName("currGain") + ).withName("gainParams"), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("powerOverloadChangeType") + ).withName("powerOverloadParams"), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("modeChangeType") + ).withName("rspDuoModeParams") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_EventParamsT.$union$LAYOUT; + } + public static MemorySegment gainParams$slice(MemorySegment seg) { + return seg.asSlice(0, 16); + } + public static MemorySegment powerOverloadParams$slice(MemorySegment seg) { + return seg.asSlice(0, 4); + } + public static MemorySegment rspDuoModeParams$slice(MemorySegment seg) { + return seg.asSlice(0, 4); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_FsFreqT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_FsFreqT.java new file mode 100644 index 000000000..4f880204e --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_FsFreqT.java @@ -0,0 +1,142 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * double fsHz; + * unsigned char syncUpdate; + * unsigned char reCal; + * }; + * } + */ +public class sdrplay_api_FsFreqT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_DOUBLE$LAYOUT.withName("fsHz"), + Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"), + Constants$root.C_CHAR$LAYOUT.withName("reCal"), + MemoryLayout.paddingLayout(48) + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_FsFreqT.$struct$LAYOUT; + } + static final VarHandle fsHz$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fsHz")); + public static VarHandle fsHz$VH() { + return sdrplay_api_FsFreqT.fsHz$VH; + } + /** + * Getter for field: + * {@snippet : + * double fsHz; + * } + */ + public static double fsHz$get(MemorySegment seg) { + return (double)sdrplay_api_FsFreqT.fsHz$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * double fsHz; + * } + */ + public static void fsHz$set(MemorySegment seg, double x) { + sdrplay_api_FsFreqT.fsHz$VH.set(seg, x); + } + public static double fsHz$get(MemorySegment seg, long index) { + return (double)sdrplay_api_FsFreqT.fsHz$VH.get(seg.asSlice(index*sizeof())); + } + public static void fsHz$set(MemorySegment seg, long index, double x) { + sdrplay_api_FsFreqT.fsHz$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle syncUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("syncUpdate")); + public static VarHandle syncUpdate$VH() { + return sdrplay_api_FsFreqT.syncUpdate$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char syncUpdate; + * } + */ + public static byte syncUpdate$get(MemorySegment seg) { + return (byte)sdrplay_api_FsFreqT.syncUpdate$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char syncUpdate; + * } + */ + public static void syncUpdate$set(MemorySegment seg, byte x) { + sdrplay_api_FsFreqT.syncUpdate$VH.set(seg, x); + } + public static byte syncUpdate$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_FsFreqT.syncUpdate$VH.get(seg.asSlice(index*sizeof())); + } + public static void syncUpdate$set(MemorySegment seg, long index, byte x) { + sdrplay_api_FsFreqT.syncUpdate$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle reCal$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("reCal")); + public static VarHandle reCal$VH() { + return sdrplay_api_FsFreqT.reCal$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char reCal; + * } + */ + public static byte reCal$get(MemorySegment seg) { + return (byte)sdrplay_api_FsFreqT.reCal$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char reCal; + * } + */ + public static void reCal$set(MemorySegment seg, byte x) { + sdrplay_api_FsFreqT.reCal$VH.set(seg, x); + } + public static byte reCal$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_FsFreqT.reCal$VH.get(seg.asSlice(index*sizeof())); + } + public static void reCal$set(MemorySegment seg, long index, byte x) { + sdrplay_api_FsFreqT.reCal$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GainCbParamT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GainCbParamT.java new file mode 100644 index 000000000..e87f9c7e0 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GainCbParamT.java @@ -0,0 +1,141 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * unsigned int gRdB; + * unsigned int lnaGRdB; + * double currGain; + * }; + * } + */ +public class sdrplay_api_GainCbParamT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("gRdB"), + Constants$root.C_INT$LAYOUT.withName("lnaGRdB"), + Constants$root.C_DOUBLE$LAYOUT.withName("currGain") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_GainCbParamT.$struct$LAYOUT; + } + static final VarHandle gRdB$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("gRdB")); + public static VarHandle gRdB$VH() { + return sdrplay_api_GainCbParamT.gRdB$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned int gRdB; + * } + */ + public static int gRdB$get(MemorySegment seg) { + return (int)sdrplay_api_GainCbParamT.gRdB$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned int gRdB; + * } + */ + public static void gRdB$set(MemorySegment seg, int x) { + sdrplay_api_GainCbParamT.gRdB$VH.set(seg, x); + } + public static int gRdB$get(MemorySegment seg, long index) { + return (int)sdrplay_api_GainCbParamT.gRdB$VH.get(seg.asSlice(index*sizeof())); + } + public static void gRdB$set(MemorySegment seg, long index, int x) { + sdrplay_api_GainCbParamT.gRdB$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle lnaGRdB$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("lnaGRdB")); + public static VarHandle lnaGRdB$VH() { + return sdrplay_api_GainCbParamT.lnaGRdB$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned int lnaGRdB; + * } + */ + public static int lnaGRdB$get(MemorySegment seg) { + return (int)sdrplay_api_GainCbParamT.lnaGRdB$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned int lnaGRdB; + * } + */ + public static void lnaGRdB$set(MemorySegment seg, int x) { + sdrplay_api_GainCbParamT.lnaGRdB$VH.set(seg, x); + } + public static int lnaGRdB$get(MemorySegment seg, long index) { + return (int)sdrplay_api_GainCbParamT.lnaGRdB$VH.get(seg.asSlice(index*sizeof())); + } + public static void lnaGRdB$set(MemorySegment seg, long index, int x) { + sdrplay_api_GainCbParamT.lnaGRdB$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle currGain$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("currGain")); + public static VarHandle currGain$VH() { + return sdrplay_api_GainCbParamT.currGain$VH; + } + /** + * Getter for field: + * {@snippet : + * double currGain; + * } + */ + public static double currGain$get(MemorySegment seg) { + return (double)sdrplay_api_GainCbParamT.currGain$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * double currGain; + * } + */ + public static void currGain$set(MemorySegment seg, double x) { + sdrplay_api_GainCbParamT.currGain$VH.set(seg, x); + } + public static double currGain$get(MemorySegment seg, long index) { + return (double)sdrplay_api_GainCbParamT.currGain$VH.get(seg.asSlice(index*sizeof())); + } + public static void currGain$set(MemorySegment seg, long index, double x) { + sdrplay_api_GainCbParamT.currGain$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GainT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GainT.java new file mode 100644 index 000000000..29319857b --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GainT.java @@ -0,0 +1,181 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * int gRdB; + * unsigned char LNAstate; + * unsigned char syncUpdate; + * sdrplay_api_MinGainReductionT minGr; + * sdrplay_api_GainValuesT gainVals; + * }; + * } + */ +public class sdrplay_api_GainT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("gRdB"), + Constants$root.C_CHAR$LAYOUT.withName("LNAstate"), + Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"), + MemoryLayout.paddingLayout(16), + Constants$root.C_INT$LAYOUT.withName("minGr"), + MemoryLayout.structLayout( + Constants$root.C_FLOAT$LAYOUT.withName("curr"), + Constants$root.C_FLOAT$LAYOUT.withName("max"), + Constants$root.C_FLOAT$LAYOUT.withName("min") + ).withName("gainVals") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_GainT.$struct$LAYOUT; + } + static final VarHandle gRdB$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("gRdB")); + public static VarHandle gRdB$VH() { + return sdrplay_api_GainT.gRdB$VH; + } + /** + * Getter for field: + * {@snippet : + * int gRdB; + * } + */ + public static int gRdB$get(MemorySegment seg) { + return (int)sdrplay_api_GainT.gRdB$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int gRdB; + * } + */ + public static void gRdB$set(MemorySegment seg, int x) { + sdrplay_api_GainT.gRdB$VH.set(seg, x); + } + public static int gRdB$get(MemorySegment seg, long index) { + return (int)sdrplay_api_GainT.gRdB$VH.get(seg.asSlice(index*sizeof())); + } + public static void gRdB$set(MemorySegment seg, long index, int x) { + sdrplay_api_GainT.gRdB$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle LNAstate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("LNAstate")); + public static VarHandle LNAstate$VH() { + return sdrplay_api_GainT.LNAstate$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char LNAstate; + * } + */ + public static byte LNAstate$get(MemorySegment seg) { + return (byte)sdrplay_api_GainT.LNAstate$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char LNAstate; + * } + */ + public static void LNAstate$set(MemorySegment seg, byte x) { + sdrplay_api_GainT.LNAstate$VH.set(seg, x); + } + public static byte LNAstate$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_GainT.LNAstate$VH.get(seg.asSlice(index*sizeof())); + } + public static void LNAstate$set(MemorySegment seg, long index, byte x) { + sdrplay_api_GainT.LNAstate$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle syncUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("syncUpdate")); + public static VarHandle syncUpdate$VH() { + return sdrplay_api_GainT.syncUpdate$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char syncUpdate; + * } + */ + public static byte syncUpdate$get(MemorySegment seg) { + return (byte)sdrplay_api_GainT.syncUpdate$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char syncUpdate; + * } + */ + public static void syncUpdate$set(MemorySegment seg, byte x) { + sdrplay_api_GainT.syncUpdate$VH.set(seg, x); + } + public static byte syncUpdate$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_GainT.syncUpdate$VH.get(seg.asSlice(index*sizeof())); + } + public static void syncUpdate$set(MemorySegment seg, long index, byte x) { + sdrplay_api_GainT.syncUpdate$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle minGr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("minGr")); + public static VarHandle minGr$VH() { + return sdrplay_api_GainT.minGr$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_MinGainReductionT minGr; + * } + */ + public static int minGr$get(MemorySegment seg) { + return (int)sdrplay_api_GainT.minGr$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_MinGainReductionT minGr; + * } + */ + public static void minGr$set(MemorySegment seg, int x) { + sdrplay_api_GainT.minGr$VH.set(seg, x); + } + public static int minGr$get(MemorySegment seg, long index) { + return (int)sdrplay_api_GainT.minGr$VH.get(seg.asSlice(index*sizeof())); + } + public static void minGr$set(MemorySegment seg, long index, int x) { + sdrplay_api_GainT.minGr$VH.set(seg.asSlice(index*sizeof()), x); + } + public static MemorySegment gainVals$slice(MemorySegment seg) { + return seg.asSlice(12, 12); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GainValuesT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GainValuesT.java new file mode 100644 index 000000000..f0dad2034 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GainValuesT.java @@ -0,0 +1,141 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * float curr; + * float max; + * float min; + * }; + * } + */ +public class sdrplay_api_GainValuesT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_FLOAT$LAYOUT.withName("curr"), + Constants$root.C_FLOAT$LAYOUT.withName("max"), + Constants$root.C_FLOAT$LAYOUT.withName("min") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_GainValuesT.$struct$LAYOUT; + } + static final VarHandle curr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("curr")); + public static VarHandle curr$VH() { + return sdrplay_api_GainValuesT.curr$VH; + } + /** + * Getter for field: + * {@snippet : + * float curr; + * } + */ + public static float curr$get(MemorySegment seg) { + return (float)sdrplay_api_GainValuesT.curr$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * float curr; + * } + */ + public static void curr$set(MemorySegment seg, float x) { + sdrplay_api_GainValuesT.curr$VH.set(seg, x); + } + public static float curr$get(MemorySegment seg, long index) { + return (float)sdrplay_api_GainValuesT.curr$VH.get(seg.asSlice(index*sizeof())); + } + public static void curr$set(MemorySegment seg, long index, float x) { + sdrplay_api_GainValuesT.curr$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle max$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max")); + public static VarHandle max$VH() { + return sdrplay_api_GainValuesT.max$VH; + } + /** + * Getter for field: + * {@snippet : + * float max; + * } + */ + public static float max$get(MemorySegment seg) { + return (float)sdrplay_api_GainValuesT.max$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * float max; + * } + */ + public static void max$set(MemorySegment seg, float x) { + sdrplay_api_GainValuesT.max$VH.set(seg, x); + } + public static float max$get(MemorySegment seg, long index) { + return (float)sdrplay_api_GainValuesT.max$VH.get(seg.asSlice(index*sizeof())); + } + public static void max$set(MemorySegment seg, long index, float x) { + sdrplay_api_GainValuesT.max$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle min$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("min")); + public static VarHandle min$VH() { + return sdrplay_api_GainValuesT.min$VH; + } + /** + * Getter for field: + * {@snippet : + * float min; + * } + */ + public static float min$get(MemorySegment seg) { + return (float)sdrplay_api_GainValuesT.min$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * float min; + * } + */ + public static void min$set(MemorySegment seg, float x) { + sdrplay_api_GainValuesT.min$VH.set(seg, x); + } + public static float min$get(MemorySegment seg, long index) { + return (float)sdrplay_api_GainValuesT.min$VH.get(seg.asSlice(index*sizeof())); + } + public static void min$set(MemorySegment seg, long index, float x) { + sdrplay_api_GainValuesT.min$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetDeviceParams_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetDeviceParams_t.java new file mode 100644 index 000000000..ab106c626 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetDeviceParams_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_GetDeviceParams_t)(void* dev,struct ** deviceParams); + * } + */ +public interface sdrplay_api_GetDeviceParams_t { + + int apply(java.lang.foreign.MemorySegment dev, java.lang.foreign.MemorySegment deviceParams); + static MemorySegment allocate(sdrplay_api_GetDeviceParams_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$5.sdrplay_api_GetDeviceParams_t_UP$MH, fi, constants$5.sdrplay_api_GetDeviceParams_t$FUNC, scope); + } + static sdrplay_api_GetDeviceParams_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (java.lang.foreign.MemorySegment _dev, java.lang.foreign.MemorySegment _deviceParams) -> { + try { + return (int)constants$5.sdrplay_api_GetDeviceParams_t_DOWN$MH.invokeExact(symbol, _dev, _deviceParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetDevices_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetDevices_t.java new file mode 100644 index 000000000..61749a33a --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetDevices_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_GetDevices_t)(struct * devices,unsigned int* numDevs,unsigned int maxDevs); + * } + */ +public interface sdrplay_api_GetDevices_t { + + int apply(java.lang.foreign.MemorySegment devices, java.lang.foreign.MemorySegment numDevs, int maxDevs); + static MemorySegment allocate(sdrplay_api_GetDevices_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$2.sdrplay_api_GetDevices_t_UP$MH, fi, constants$2.sdrplay_api_GetDevices_t$FUNC, scope); + } + static sdrplay_api_GetDevices_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (java.lang.foreign.MemorySegment _devices, java.lang.foreign.MemorySegment _numDevs, int _maxDevs) -> { + try { + return (int)constants$2.sdrplay_api_GetDevices_t_DOWN$MH.invokeExact(symbol, _devices, _numDevs, _maxDevs); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetErrorString_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetErrorString_t.java new file mode 100644 index 000000000..dbfb8e7b4 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetErrorString_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * char* (*sdrplay_api_GetErrorString_t)(enum err); + * } + */ +public interface sdrplay_api_GetErrorString_t { + + java.lang.foreign.MemorySegment apply(int err); + static MemorySegment allocate(sdrplay_api_GetErrorString_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$3.sdrplay_api_GetErrorString_t_UP$MH, fi, constants$3.sdrplay_api_GetErrorString_t$FUNC, scope); + } + static sdrplay_api_GetErrorString_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (int _err) -> { + try { + return (java.lang.foreign.MemorySegment)constants$3.sdrplay_api_GetErrorString_t_DOWN$MH.invokeExact(symbol, _err); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetLastErrorByType_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetLastErrorByType_t.java new file mode 100644 index 000000000..a4dfc82c1 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetLastErrorByType_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * struct * (*sdrplay_api_GetLastErrorByType_t)(struct * device,int type,unsigned long long* time); + * } + */ +public interface sdrplay_api_GetLastErrorByType_t { + + java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment device, int type, java.lang.foreign.MemorySegment time); + static MemorySegment allocate(sdrplay_api_GetLastErrorByType_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$4.sdrplay_api_GetLastErrorByType_t_UP$MH, fi, constants$4.sdrplay_api_GetLastErrorByType_t$FUNC, scope); + } + static sdrplay_api_GetLastErrorByType_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (java.lang.foreign.MemorySegment _device, int _type, java.lang.foreign.MemorySegment _time) -> { + try { + return (java.lang.foreign.MemorySegment)constants$4.sdrplay_api_GetLastErrorByType_t_DOWN$MH.invokeExact(symbol, _device, _type, _time); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetLastError_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetLastError_t.java new file mode 100644 index 000000000..f20d55394 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_GetLastError_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * struct * (*sdrplay_api_GetLastError_t)(struct * device); + * } + */ +public interface sdrplay_api_GetLastError_t { + + java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment device); + static MemorySegment allocate(sdrplay_api_GetLastError_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$3.sdrplay_api_GetLastError_t_UP$MH, fi, constants$3.sdrplay_api_GetLastError_t$FUNC, scope); + } + static sdrplay_api_GetLastError_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (java.lang.foreign.MemorySegment _device) -> { + try { + return (java.lang.foreign.MemorySegment)constants$3.sdrplay_api_GetLastError_t_DOWN$MH.invokeExact(symbol, _device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Init_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Init_t.java new file mode 100644 index 000000000..aa981ea32 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Init_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_Init_t)(void* dev,struct * callbackFns,void* cbContext); + * } + */ +public interface sdrplay_api_Init_t { + + int apply(java.lang.foreign.MemorySegment dev, java.lang.foreign.MemorySegment callbackFns, java.lang.foreign.MemorySegment cbContext); + static MemorySegment allocate(sdrplay_api_Init_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$5.sdrplay_api_Init_t_UP$MH, fi, constants$5.sdrplay_api_Init_t$FUNC, scope); + } + static sdrplay_api_Init_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (java.lang.foreign.MemorySegment _dev, java.lang.foreign.MemorySegment _callbackFns, java.lang.foreign.MemorySegment _cbContext) -> { + try { + return (int)constants$5.sdrplay_api_Init_t_DOWN$MH.invokeExact(symbol, _dev, _callbackFns, _cbContext); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_LockDeviceApi_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_LockDeviceApi_t.java new file mode 100644 index 000000000..3c555969d --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_LockDeviceApi_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_LockDeviceApi_t)(); + * } + */ +public interface sdrplay_api_LockDeviceApi_t { + + int apply(); + static MemorySegment allocate(sdrplay_api_LockDeviceApi_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$1.sdrplay_api_LockDeviceApi_t_UP$MH, fi, constants$1.sdrplay_api_LockDeviceApi_t$FUNC, scope); + } + static sdrplay_api_LockDeviceApi_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return () -> { + try { + return (int)constants$1.sdrplay_api_LockDeviceApi_t_DOWN$MH.invokeExact(symbol); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Open_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Open_t.java new file mode 100644 index 000000000..87e4ab360 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Open_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_Open_t)(); + * } + */ +public interface sdrplay_api_Open_t { + + int apply(); + static MemorySegment allocate(sdrplay_api_Open_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$0.sdrplay_api_Open_t_UP$MH, fi, constants$0.sdrplay_api_Open_t$FUNC, scope); + } + static sdrplay_api_Open_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return () -> { + try { + return (int)constants$0.sdrplay_api_Open_t_DOWN$MH.invokeExact(symbol); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_PowerOverloadCbParamT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_PowerOverloadCbParamT.java new file mode 100644 index 000000000..d79592637 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_PowerOverloadCbParamT.java @@ -0,0 +1,81 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * sdrplay_api_PowerOverloadCbEventIdT powerOverloadChangeType; + * }; + * } + */ +public class sdrplay_api_PowerOverloadCbParamT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("powerOverloadChangeType") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_PowerOverloadCbParamT.$struct$LAYOUT; + } + static final VarHandle powerOverloadChangeType$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("powerOverloadChangeType")); + public static VarHandle powerOverloadChangeType$VH() { + return sdrplay_api_PowerOverloadCbParamT.powerOverloadChangeType$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_PowerOverloadCbEventIdT powerOverloadChangeType; + * } + */ + public static int powerOverloadChangeType$get(MemorySegment seg) { + return (int)sdrplay_api_PowerOverloadCbParamT.powerOverloadChangeType$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_PowerOverloadCbEventIdT powerOverloadChangeType; + * } + */ + public static void powerOverloadChangeType$set(MemorySegment seg, int x) { + sdrplay_api_PowerOverloadCbParamT.powerOverloadChangeType$VH.set(seg, x); + } + public static int powerOverloadChangeType$get(MemorySegment seg, long index) { + return (int)sdrplay_api_PowerOverloadCbParamT.powerOverloadChangeType$VH.get(seg.asSlice(index*sizeof())); + } + public static void powerOverloadChangeType$set(MemorySegment seg, long index, int x) { + sdrplay_api_PowerOverloadCbParamT.powerOverloadChangeType$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ReleaseDevice_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ReleaseDevice_t.java new file mode 100644 index 000000000..ad32fa3ac --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ReleaseDevice_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_ReleaseDevice_t)(struct * device); + * } + */ +public interface sdrplay_api_ReleaseDevice_t { + + int apply(java.lang.foreign.MemorySegment dev); + static MemorySegment allocate(sdrplay_api_ReleaseDevice_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$3.sdrplay_api_ReleaseDevice_t_UP$MH, fi, constants$3.sdrplay_api_ReleaseDevice_t$FUNC, scope); + } + static sdrplay_api_ReleaseDevice_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (java.lang.foreign.MemorySegment _dev) -> { + try { + return (int)constants$3.sdrplay_api_ReleaseDevice_t_DOWN$MH.invokeExact(symbol, _dev); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ResetFlagsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ResetFlagsT.java new file mode 100644 index 000000000..339823ba9 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_ResetFlagsT.java @@ -0,0 +1,141 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * unsigned char resetGainUpdate; + * unsigned char resetRfUpdate; + * unsigned char resetFsUpdate; + * }; + * } + */ +public class sdrplay_api_ResetFlagsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("resetGainUpdate"), + Constants$root.C_CHAR$LAYOUT.withName("resetRfUpdate"), + Constants$root.C_CHAR$LAYOUT.withName("resetFsUpdate") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_ResetFlagsT.$struct$LAYOUT; + } + static final VarHandle resetGainUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("resetGainUpdate")); + public static VarHandle resetGainUpdate$VH() { + return sdrplay_api_ResetFlagsT.resetGainUpdate$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char resetGainUpdate; + * } + */ + public static byte resetGainUpdate$get(MemorySegment seg) { + return (byte)sdrplay_api_ResetFlagsT.resetGainUpdate$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char resetGainUpdate; + * } + */ + public static void resetGainUpdate$set(MemorySegment seg, byte x) { + sdrplay_api_ResetFlagsT.resetGainUpdate$VH.set(seg, x); + } + public static byte resetGainUpdate$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_ResetFlagsT.resetGainUpdate$VH.get(seg.asSlice(index*sizeof())); + } + public static void resetGainUpdate$set(MemorySegment seg, long index, byte x) { + sdrplay_api_ResetFlagsT.resetGainUpdate$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle resetRfUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("resetRfUpdate")); + public static VarHandle resetRfUpdate$VH() { + return sdrplay_api_ResetFlagsT.resetRfUpdate$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char resetRfUpdate; + * } + */ + public static byte resetRfUpdate$get(MemorySegment seg) { + return (byte)sdrplay_api_ResetFlagsT.resetRfUpdate$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char resetRfUpdate; + * } + */ + public static void resetRfUpdate$set(MemorySegment seg, byte x) { + sdrplay_api_ResetFlagsT.resetRfUpdate$VH.set(seg, x); + } + public static byte resetRfUpdate$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_ResetFlagsT.resetRfUpdate$VH.get(seg.asSlice(index*sizeof())); + } + public static void resetRfUpdate$set(MemorySegment seg, long index, byte x) { + sdrplay_api_ResetFlagsT.resetRfUpdate$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle resetFsUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("resetFsUpdate")); + public static VarHandle resetFsUpdate$VH() { + return sdrplay_api_ResetFlagsT.resetFsUpdate$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char resetFsUpdate; + * } + */ + public static byte resetFsUpdate$get(MemorySegment seg) { + return (byte)sdrplay_api_ResetFlagsT.resetFsUpdate$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char resetFsUpdate; + * } + */ + public static void resetFsUpdate$set(MemorySegment seg, byte x) { + sdrplay_api_ResetFlagsT.resetFsUpdate$VH.set(seg, x); + } + public static byte resetFsUpdate$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_ResetFlagsT.resetFsUpdate$VH.get(seg.asSlice(index*sizeof())); + } + public static void resetFsUpdate$set(MemorySegment seg, long index, byte x) { + sdrplay_api_ResetFlagsT.resetFsUpdate$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RfFreqT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RfFreqT.java new file mode 100644 index 000000000..fb83fb160 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RfFreqT.java @@ -0,0 +1,112 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * double rfHz; + * unsigned char syncUpdate; + * }; + * } + */ +public class sdrplay_api_RfFreqT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_DOUBLE$LAYOUT.withName("rfHz"), + Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"), + MemoryLayout.paddingLayout(56) + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_RfFreqT.$struct$LAYOUT; + } + static final VarHandle rfHz$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfHz")); + public static VarHandle rfHz$VH() { + return sdrplay_api_RfFreqT.rfHz$VH; + } + /** + * Getter for field: + * {@snippet : + * double rfHz; + * } + */ + public static double rfHz$get(MemorySegment seg) { + return (double)sdrplay_api_RfFreqT.rfHz$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * double rfHz; + * } + */ + public static void rfHz$set(MemorySegment seg, double x) { + sdrplay_api_RfFreqT.rfHz$VH.set(seg, x); + } + public static double rfHz$get(MemorySegment seg, long index) { + return (double)sdrplay_api_RfFreqT.rfHz$VH.get(seg.asSlice(index*sizeof())); + } + public static void rfHz$set(MemorySegment seg, long index, double x) { + sdrplay_api_RfFreqT.rfHz$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle syncUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("syncUpdate")); + public static VarHandle syncUpdate$VH() { + return sdrplay_api_RfFreqT.syncUpdate$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char syncUpdate; + * } + */ + public static byte syncUpdate$get(MemorySegment seg) { + return (byte)sdrplay_api_RfFreqT.syncUpdate$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char syncUpdate; + * } + */ + public static void syncUpdate$set(MemorySegment seg, byte x) { + sdrplay_api_RfFreqT.syncUpdate$VH.set(seg, x); + } + public static byte syncUpdate$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_RfFreqT.syncUpdate$VH.get(seg.asSlice(index*sizeof())); + } + public static void syncUpdate$set(MemorySegment seg, long index, byte x) { + sdrplay_api_RfFreqT.syncUpdate$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp1aParamsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp1aParamsT.java new file mode 100644 index 000000000..14ef1acdf --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp1aParamsT.java @@ -0,0 +1,111 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * unsigned char rfNotchEnable; + * unsigned char rfDabNotchEnable; + * }; + * } + */ +public class sdrplay_api_Rsp1aParamsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"), + Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_Rsp1aParamsT.$struct$LAYOUT; + } + static final VarHandle rfNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfNotchEnable")); + public static VarHandle rfNotchEnable$VH() { + return sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char rfNotchEnable; + * } + */ + public static byte rfNotchEnable$get(MemorySegment seg) { + return (byte)sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char rfNotchEnable; + * } + */ + public static void rfNotchEnable$set(MemorySegment seg, byte x) { + sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH.set(seg, x); + } + public static byte rfNotchEnable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH.get(seg.asSlice(index*sizeof())); + } + public static void rfNotchEnable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_Rsp1aParamsT.rfNotchEnable$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle rfDabNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfDabNotchEnable")); + public static VarHandle rfDabNotchEnable$VH() { + return sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char rfDabNotchEnable; + * } + */ + public static byte rfDabNotchEnable$get(MemorySegment seg) { + return (byte)sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char rfDabNotchEnable; + * } + */ + public static void rfDabNotchEnable$set(MemorySegment seg, byte x) { + sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH.set(seg, x); + } + public static byte rfDabNotchEnable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH.get(seg.asSlice(index*sizeof())); + } + public static void rfDabNotchEnable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_Rsp1aParamsT.rfDabNotchEnable$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp1aTunerParamsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp1aTunerParamsT.java new file mode 100644 index 000000000..5e853e96d --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp1aTunerParamsT.java @@ -0,0 +1,81 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * unsigned char biasTEnable; + * }; + * } + */ +public class sdrplay_api_Rsp1aTunerParamsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("biasTEnable") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_Rsp1aTunerParamsT.$struct$LAYOUT; + } + static final VarHandle biasTEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("biasTEnable")); + public static VarHandle biasTEnable$VH() { + return sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char biasTEnable; + * } + */ + public static byte biasTEnable$get(MemorySegment seg) { + return (byte)sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char biasTEnable; + * } + */ + public static void biasTEnable$set(MemorySegment seg, byte x) { + sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH.set(seg, x); + } + public static byte biasTEnable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH.get(seg.asSlice(index*sizeof())); + } + public static void biasTEnable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_Rsp1aTunerParamsT.biasTEnable$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp2ParamsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp2ParamsT.java new file mode 100644 index 000000000..bc8a29a3c --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp2ParamsT.java @@ -0,0 +1,81 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * unsigned char extRefOutputEn; + * }; + * } + */ +public class sdrplay_api_Rsp2ParamsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("extRefOutputEn") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_Rsp2ParamsT.$struct$LAYOUT; + } + static final VarHandle extRefOutputEn$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("extRefOutputEn")); + public static VarHandle extRefOutputEn$VH() { + return sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char extRefOutputEn; + * } + */ + public static byte extRefOutputEn$get(MemorySegment seg) { + return (byte)sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char extRefOutputEn; + * } + */ + public static void extRefOutputEn$set(MemorySegment seg, byte x) { + sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH.set(seg, x); + } + public static byte extRefOutputEn$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH.get(seg.asSlice(index*sizeof())); + } + public static void extRefOutputEn$set(MemorySegment seg, long index, byte x) { + sdrplay_api_Rsp2ParamsT.extRefOutputEn$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp2TunerParamsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp2TunerParamsT.java new file mode 100644 index 000000000..ce26c4227 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Rsp2TunerParamsT.java @@ -0,0 +1,173 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * unsigned char biasTEnable; + * sdrplay_api_Rsp2_AmPortSelectT amPortSel; + * sdrplay_api_Rsp2_AntennaSelectT antennaSel; + * unsigned char rfNotchEnable; + * }; + * } + */ +public class sdrplay_api_Rsp2TunerParamsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"), + MemoryLayout.paddingLayout(24), + Constants$root.C_INT$LAYOUT.withName("amPortSel"), + Constants$root.C_INT$LAYOUT.withName("antennaSel"), + Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"), + MemoryLayout.paddingLayout(24) + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_Rsp2TunerParamsT.$struct$LAYOUT; + } + static final VarHandle biasTEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("biasTEnable")); + public static VarHandle biasTEnable$VH() { + return sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char biasTEnable; + * } + */ + public static byte biasTEnable$get(MemorySegment seg) { + return (byte)sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char biasTEnable; + * } + */ + public static void biasTEnable$set(MemorySegment seg, byte x) { + sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH.set(seg, x); + } + public static byte biasTEnable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH.get(seg.asSlice(index*sizeof())); + } + public static void biasTEnable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_Rsp2TunerParamsT.biasTEnable$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle amPortSel$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("amPortSel")); + public static VarHandle amPortSel$VH() { + return sdrplay_api_Rsp2TunerParamsT.amPortSel$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_Rsp2_AmPortSelectT amPortSel; + * } + */ + public static int amPortSel$get(MemorySegment seg) { + return (int)sdrplay_api_Rsp2TunerParamsT.amPortSel$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_Rsp2_AmPortSelectT amPortSel; + * } + */ + public static void amPortSel$set(MemorySegment seg, int x) { + sdrplay_api_Rsp2TunerParamsT.amPortSel$VH.set(seg, x); + } + public static int amPortSel$get(MemorySegment seg, long index) { + return (int)sdrplay_api_Rsp2TunerParamsT.amPortSel$VH.get(seg.asSlice(index*sizeof())); + } + public static void amPortSel$set(MemorySegment seg, long index, int x) { + sdrplay_api_Rsp2TunerParamsT.amPortSel$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle antennaSel$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("antennaSel")); + public static VarHandle antennaSel$VH() { + return sdrplay_api_Rsp2TunerParamsT.antennaSel$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_Rsp2_AntennaSelectT antennaSel; + * } + */ + public static int antennaSel$get(MemorySegment seg) { + return (int)sdrplay_api_Rsp2TunerParamsT.antennaSel$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_Rsp2_AntennaSelectT antennaSel; + * } + */ + public static void antennaSel$set(MemorySegment seg, int x) { + sdrplay_api_Rsp2TunerParamsT.antennaSel$VH.set(seg, x); + } + public static int antennaSel$get(MemorySegment seg, long index) { + return (int)sdrplay_api_Rsp2TunerParamsT.antennaSel$VH.get(seg.asSlice(index*sizeof())); + } + public static void antennaSel$set(MemorySegment seg, long index, int x) { + sdrplay_api_Rsp2TunerParamsT.antennaSel$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle rfNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfNotchEnable")); + public static VarHandle rfNotchEnable$VH() { + return sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char rfNotchEnable; + * } + */ + public static byte rfNotchEnable$get(MemorySegment seg) { + return (byte)sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char rfNotchEnable; + * } + */ + public static void rfNotchEnable$set(MemorySegment seg, byte x) { + sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH.set(seg, x); + } + public static byte rfNotchEnable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH.get(seg.asSlice(index*sizeof())); + } + public static void rfNotchEnable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_Rsp2TunerParamsT.rfNotchEnable$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuoModeCbParamT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuoModeCbParamT.java new file mode 100644 index 000000000..59e0a8e78 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuoModeCbParamT.java @@ -0,0 +1,81 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * sdrplay_api_RspDuoModeCbEventIdT modeChangeType; + * }; + * } + */ +public class sdrplay_api_RspDuoModeCbParamT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("modeChangeType") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_RspDuoModeCbParamT.$struct$LAYOUT; + } + static final VarHandle modeChangeType$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("modeChangeType")); + public static VarHandle modeChangeType$VH() { + return sdrplay_api_RspDuoModeCbParamT.modeChangeType$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_RspDuoModeCbEventIdT modeChangeType; + * } + */ + public static int modeChangeType$get(MemorySegment seg) { + return (int)sdrplay_api_RspDuoModeCbParamT.modeChangeType$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_RspDuoModeCbEventIdT modeChangeType; + * } + */ + public static void modeChangeType$set(MemorySegment seg, int x) { + sdrplay_api_RspDuoModeCbParamT.modeChangeType$VH.set(seg, x); + } + public static int modeChangeType$get(MemorySegment seg, long index) { + return (int)sdrplay_api_RspDuoModeCbParamT.modeChangeType$VH.get(seg.asSlice(index*sizeof())); + } + public static void modeChangeType$set(MemorySegment seg, long index, int x) { + sdrplay_api_RspDuoModeCbParamT.modeChangeType$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuoParamsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuoParamsT.java new file mode 100644 index 000000000..06a949941 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuoParamsT.java @@ -0,0 +1,81 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * int extRefOutputEn; + * }; + * } + */ +public class sdrplay_api_RspDuoParamsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("extRefOutputEn") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_RspDuoParamsT.$struct$LAYOUT; + } + static final VarHandle extRefOutputEn$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("extRefOutputEn")); + public static VarHandle extRefOutputEn$VH() { + return sdrplay_api_RspDuoParamsT.extRefOutputEn$VH; + } + /** + * Getter for field: + * {@snippet : + * int extRefOutputEn; + * } + */ + public static int extRefOutputEn$get(MemorySegment seg) { + return (int)sdrplay_api_RspDuoParamsT.extRefOutputEn$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int extRefOutputEn; + * } + */ + public static void extRefOutputEn$set(MemorySegment seg, int x) { + sdrplay_api_RspDuoParamsT.extRefOutputEn$VH.set(seg, x); + } + public static int extRefOutputEn$get(MemorySegment seg, long index) { + return (int)sdrplay_api_RspDuoParamsT.extRefOutputEn$VH.get(seg.asSlice(index*sizeof())); + } + public static void extRefOutputEn$set(MemorySegment seg, long index, int x) { + sdrplay_api_RspDuoParamsT.extRefOutputEn$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuoTunerParamsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuoTunerParamsT.java new file mode 100644 index 000000000..d4bb24886 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuoTunerParamsT.java @@ -0,0 +1,211 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * unsigned char biasTEnable; + * sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel; + * unsigned char tuner1AmNotchEnable; + * unsigned char rfNotchEnable; + * unsigned char rfDabNotchEnable; + * sdrplay_api_RspDuo_ResetSlaveFlagsT resetSlaveFlags; + * }; + * } + */ +public class sdrplay_api_RspDuoTunerParamsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"), + MemoryLayout.paddingLayout(24), + Constants$root.C_INT$LAYOUT.withName("tuner1AmPortSel"), + Constants$root.C_CHAR$LAYOUT.withName("tuner1AmNotchEnable"), + Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"), + Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"), + MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("resetGainUpdate"), + Constants$root.C_CHAR$LAYOUT.withName("resetRfUpdate") + ).withName("resetSlaveFlags"), + MemoryLayout.paddingLayout(24) + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_RspDuoTunerParamsT.$struct$LAYOUT; + } + static final VarHandle biasTEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("biasTEnable")); + public static VarHandle biasTEnable$VH() { + return sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char biasTEnable; + * } + */ + public static byte biasTEnable$get(MemorySegment seg) { + return (byte)sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char biasTEnable; + * } + */ + public static void biasTEnable$set(MemorySegment seg, byte x) { + sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH.set(seg, x); + } + public static byte biasTEnable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH.get(seg.asSlice(index*sizeof())); + } + public static void biasTEnable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_RspDuoTunerParamsT.biasTEnable$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle tuner1AmPortSel$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("tuner1AmPortSel")); + public static VarHandle tuner1AmPortSel$VH() { + return sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel; + * } + */ + public static int tuner1AmPortSel$get(MemorySegment seg) { + return (int)sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel; + * } + */ + public static void tuner1AmPortSel$set(MemorySegment seg, int x) { + sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$VH.set(seg, x); + } + public static int tuner1AmPortSel$get(MemorySegment seg, long index) { + return (int)sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$VH.get(seg.asSlice(index*sizeof())); + } + public static void tuner1AmPortSel$set(MemorySegment seg, long index, int x) { + sdrplay_api_RspDuoTunerParamsT.tuner1AmPortSel$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle tuner1AmNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("tuner1AmNotchEnable")); + public static VarHandle tuner1AmNotchEnable$VH() { + return sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char tuner1AmNotchEnable; + * } + */ + public static byte tuner1AmNotchEnable$get(MemorySegment seg) { + return (byte)sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char tuner1AmNotchEnable; + * } + */ + public static void tuner1AmNotchEnable$set(MemorySegment seg, byte x) { + sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH.set(seg, x); + } + public static byte tuner1AmNotchEnable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH.get(seg.asSlice(index*sizeof())); + } + public static void tuner1AmNotchEnable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_RspDuoTunerParamsT.tuner1AmNotchEnable$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle rfNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfNotchEnable")); + public static VarHandle rfNotchEnable$VH() { + return sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char rfNotchEnable; + * } + */ + public static byte rfNotchEnable$get(MemorySegment seg) { + return (byte)sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char rfNotchEnable; + * } + */ + public static void rfNotchEnable$set(MemorySegment seg, byte x) { + sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH.set(seg, x); + } + public static byte rfNotchEnable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH.get(seg.asSlice(index*sizeof())); + } + public static void rfNotchEnable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_RspDuoTunerParamsT.rfNotchEnable$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle rfDabNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfDabNotchEnable")); + public static VarHandle rfDabNotchEnable$VH() { + return sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char rfDabNotchEnable; + * } + */ + public static byte rfDabNotchEnable$get(MemorySegment seg) { + return (byte)sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char rfDabNotchEnable; + * } + */ + public static void rfDabNotchEnable$set(MemorySegment seg, byte x) { + sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH.set(seg, x); + } + public static byte rfDabNotchEnable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH.get(seg.asSlice(index*sizeof())); + } + public static void rfDabNotchEnable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_RspDuoTunerParamsT.rfDabNotchEnable$VH.set(seg.asSlice(index*sizeof()), x); + } + public static MemorySegment resetSlaveFlags$slice(MemorySegment seg) { + return seg.asSlice(11, 2); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuo_ResetSlaveFlagsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuo_ResetSlaveFlagsT.java new file mode 100644 index 000000000..a103cd713 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDuo_ResetSlaveFlagsT.java @@ -0,0 +1,111 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * unsigned char resetGainUpdate; + * unsigned char resetRfUpdate; + * }; + * } + */ +public class sdrplay_api_RspDuo_ResetSlaveFlagsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("resetGainUpdate"), + Constants$root.C_CHAR$LAYOUT.withName("resetRfUpdate") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_RspDuo_ResetSlaveFlagsT.$struct$LAYOUT; + } + static final VarHandle resetGainUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("resetGainUpdate")); + public static VarHandle resetGainUpdate$VH() { + return sdrplay_api_RspDuo_ResetSlaveFlagsT.resetGainUpdate$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char resetGainUpdate; + * } + */ + public static byte resetGainUpdate$get(MemorySegment seg) { + return (byte)sdrplay_api_RspDuo_ResetSlaveFlagsT.resetGainUpdate$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char resetGainUpdate; + * } + */ + public static void resetGainUpdate$set(MemorySegment seg, byte x) { + sdrplay_api_RspDuo_ResetSlaveFlagsT.resetGainUpdate$VH.set(seg, x); + } + public static byte resetGainUpdate$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_RspDuo_ResetSlaveFlagsT.resetGainUpdate$VH.get(seg.asSlice(index*sizeof())); + } + public static void resetGainUpdate$set(MemorySegment seg, long index, byte x) { + sdrplay_api_RspDuo_ResetSlaveFlagsT.resetGainUpdate$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle resetRfUpdate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("resetRfUpdate")); + public static VarHandle resetRfUpdate$VH() { + return sdrplay_api_RspDuo_ResetSlaveFlagsT.resetRfUpdate$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char resetRfUpdate; + * } + */ + public static byte resetRfUpdate$get(MemorySegment seg) { + return (byte)sdrplay_api_RspDuo_ResetSlaveFlagsT.resetRfUpdate$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char resetRfUpdate; + * } + */ + public static void resetRfUpdate$set(MemorySegment seg, byte x) { + sdrplay_api_RspDuo_ResetSlaveFlagsT.resetRfUpdate$VH.set(seg, x); + } + public static byte resetRfUpdate$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_RspDuo_ResetSlaveFlagsT.resetRfUpdate$VH.get(seg.asSlice(index*sizeof())); + } + public static void resetRfUpdate$set(MemorySegment seg, long index, byte x) { + sdrplay_api_RspDuo_ResetSlaveFlagsT.resetRfUpdate$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDxParamsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDxParamsT.java new file mode 100644 index 000000000..7deb4fabb --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDxParamsT.java @@ -0,0 +1,203 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * unsigned char hdrEnable; + * unsigned char biasTEnable; + * sdrplay_api_RspDx_AntennaSelectT antennaSel; + * unsigned char rfNotchEnable; + * unsigned char rfDabNotchEnable; + * }; + * } + */ +public class sdrplay_api_RspDxParamsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("hdrEnable"), + Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"), + MemoryLayout.paddingLayout(16), + Constants$root.C_INT$LAYOUT.withName("antennaSel"), + Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"), + Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"), + MemoryLayout.paddingLayout(16) + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_RspDxParamsT.$struct$LAYOUT; + } + static final VarHandle hdrEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("hdrEnable")); + public static VarHandle hdrEnable$VH() { + return sdrplay_api_RspDxParamsT.hdrEnable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char hdrEnable; + * } + */ + public static byte hdrEnable$get(MemorySegment seg) { + return (byte)sdrplay_api_RspDxParamsT.hdrEnable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char hdrEnable; + * } + */ + public static void hdrEnable$set(MemorySegment seg, byte x) { + sdrplay_api_RspDxParamsT.hdrEnable$VH.set(seg, x); + } + public static byte hdrEnable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_RspDxParamsT.hdrEnable$VH.get(seg.asSlice(index*sizeof())); + } + public static void hdrEnable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_RspDxParamsT.hdrEnable$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle biasTEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("biasTEnable")); + public static VarHandle biasTEnable$VH() { + return sdrplay_api_RspDxParamsT.biasTEnable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char biasTEnable; + * } + */ + public static byte biasTEnable$get(MemorySegment seg) { + return (byte)sdrplay_api_RspDxParamsT.biasTEnable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char biasTEnable; + * } + */ + public static void biasTEnable$set(MemorySegment seg, byte x) { + sdrplay_api_RspDxParamsT.biasTEnable$VH.set(seg, x); + } + public static byte biasTEnable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_RspDxParamsT.biasTEnable$VH.get(seg.asSlice(index*sizeof())); + } + public static void biasTEnable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_RspDxParamsT.biasTEnable$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle antennaSel$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("antennaSel")); + public static VarHandle antennaSel$VH() { + return sdrplay_api_RspDxParamsT.antennaSel$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_RspDx_AntennaSelectT antennaSel; + * } + */ + public static int antennaSel$get(MemorySegment seg) { + return (int)sdrplay_api_RspDxParamsT.antennaSel$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_RspDx_AntennaSelectT antennaSel; + * } + */ + public static void antennaSel$set(MemorySegment seg, int x) { + sdrplay_api_RspDxParamsT.antennaSel$VH.set(seg, x); + } + public static int antennaSel$get(MemorySegment seg, long index) { + return (int)sdrplay_api_RspDxParamsT.antennaSel$VH.get(seg.asSlice(index*sizeof())); + } + public static void antennaSel$set(MemorySegment seg, long index, int x) { + sdrplay_api_RspDxParamsT.antennaSel$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle rfNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfNotchEnable")); + public static VarHandle rfNotchEnable$VH() { + return sdrplay_api_RspDxParamsT.rfNotchEnable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char rfNotchEnable; + * } + */ + public static byte rfNotchEnable$get(MemorySegment seg) { + return (byte)sdrplay_api_RspDxParamsT.rfNotchEnable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char rfNotchEnable; + * } + */ + public static void rfNotchEnable$set(MemorySegment seg, byte x) { + sdrplay_api_RspDxParamsT.rfNotchEnable$VH.set(seg, x); + } + public static byte rfNotchEnable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_RspDxParamsT.rfNotchEnable$VH.get(seg.asSlice(index*sizeof())); + } + public static void rfNotchEnable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_RspDxParamsT.rfNotchEnable$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle rfDabNotchEnable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfDabNotchEnable")); + public static VarHandle rfDabNotchEnable$VH() { + return sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned char rfDabNotchEnable; + * } + */ + public static byte rfDabNotchEnable$get(MemorySegment seg) { + return (byte)sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned char rfDabNotchEnable; + * } + */ + public static void rfDabNotchEnable$set(MemorySegment seg, byte x) { + sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH.set(seg, x); + } + public static byte rfDabNotchEnable$get(MemorySegment seg, long index) { + return (byte)sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH.get(seg.asSlice(index*sizeof())); + } + public static void rfDabNotchEnable$set(MemorySegment seg, long index, byte x) { + sdrplay_api_RspDxParamsT.rfDabNotchEnable$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDxTunerParamsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDxTunerParamsT.java new file mode 100644 index 000000000..290438d43 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RspDxTunerParamsT.java @@ -0,0 +1,81 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * sdrplay_api_RspDx_HdrModeBwT hdrBw; + * }; + * } + */ +public class sdrplay_api_RspDxTunerParamsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("hdrBw") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_RspDxTunerParamsT.$struct$LAYOUT; + } + static final VarHandle hdrBw$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("hdrBw")); + public static VarHandle hdrBw$VH() { + return sdrplay_api_RspDxTunerParamsT.hdrBw$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_RspDx_HdrModeBwT hdrBw; + * } + */ + public static int hdrBw$get(MemorySegment seg) { + return (int)sdrplay_api_RspDxTunerParamsT.hdrBw$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_RspDx_HdrModeBwT hdrBw; + * } + */ + public static void hdrBw$set(MemorySegment seg, int x) { + sdrplay_api_RspDxTunerParamsT.hdrBw$VH.set(seg, x); + } + public static int hdrBw$get(MemorySegment seg, long index) { + return (int)sdrplay_api_RspDxTunerParamsT.hdrBw$VH.get(seg.asSlice(index*sizeof())); + } + public static void hdrBw$set(MemorySegment seg, long index, int x) { + sdrplay_api_RspDxTunerParamsT.hdrBw$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RxChannelParamsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RxChannelParamsT.java new file mode 100644 index 000000000..bd8ec9c8e --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_RxChannelParamsT.java @@ -0,0 +1,155 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +/** + * {@snippet : + * struct { + * sdrplay_api_TunerParamsT tunerParams; + * sdrplay_api_ControlParamsT ctrlParams; + * sdrplay_api_Rsp1aTunerParamsT rsp1aTunerParams; + * sdrplay_api_Rsp2TunerParamsT rsp2TunerParams; + * sdrplay_api_RspDuoTunerParamsT rspDuoTunerParams; + * sdrplay_api_RspDxTunerParamsT rspDxTunerParams; + * }; + * } + */ +public class sdrplay_api_RxChannelParamsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("bwType"), + Constants$root.C_INT$LAYOUT.withName("ifType"), + Constants$root.C_INT$LAYOUT.withName("loMode"), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("gRdB"), + Constants$root.C_CHAR$LAYOUT.withName("LNAstate"), + Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"), + MemoryLayout.paddingLayout(16), + Constants$root.C_INT$LAYOUT.withName("minGr"), + MemoryLayout.structLayout( + Constants$root.C_FLOAT$LAYOUT.withName("curr"), + Constants$root.C_FLOAT$LAYOUT.withName("max"), + Constants$root.C_FLOAT$LAYOUT.withName("min") + ).withName("gainVals") + ).withName("gain"), + MemoryLayout.paddingLayout(32), + MemoryLayout.structLayout( + Constants$root.C_DOUBLE$LAYOUT.withName("rfHz"), + Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"), + MemoryLayout.paddingLayout(56) + ).withName("rfFreq"), + MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("dcCal"), + Constants$root.C_CHAR$LAYOUT.withName("speedUp"), + MemoryLayout.paddingLayout(16), + Constants$root.C_INT$LAYOUT.withName("trackTime"), + Constants$root.C_INT$LAYOUT.withName("refreshRateTime") + ).withName("dcOffsetTuner"), + MemoryLayout.paddingLayout(32) + ).withName("tunerParams"), + MemoryLayout.structLayout( + MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("DCenable"), + Constants$root.C_CHAR$LAYOUT.withName("IQenable") + ).withName("dcOffset"), + MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("enable"), + Constants$root.C_CHAR$LAYOUT.withName("decimationFactor"), + Constants$root.C_CHAR$LAYOUT.withName("wideBandSignal") + ).withName("decimation"), + MemoryLayout.paddingLayout(24), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("enable"), + Constants$root.C_INT$LAYOUT.withName("setPoint_dBfs"), + Constants$root.C_SHORT$LAYOUT.withName("attack_ms"), + Constants$root.C_SHORT$LAYOUT.withName("decay_ms"), + Constants$root.C_SHORT$LAYOUT.withName("decay_delay_ms"), + Constants$root.C_SHORT$LAYOUT.withName("decay_threshold_dB"), + Constants$root.C_INT$LAYOUT.withName("syncUpdate") + ).withName("agc"), + Constants$root.C_INT$LAYOUT.withName("adsbMode") + ).withName("ctrlParams"), + MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("biasTEnable") + ).withName("rsp1aTunerParams"), + MemoryLayout.paddingLayout(24), + MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"), + MemoryLayout.paddingLayout(24), + Constants$root.C_INT$LAYOUT.withName("amPortSel"), + Constants$root.C_INT$LAYOUT.withName("antennaSel"), + Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"), + MemoryLayout.paddingLayout(24) + ).withName("rsp2TunerParams"), + MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("biasTEnable"), + MemoryLayout.paddingLayout(24), + Constants$root.C_INT$LAYOUT.withName("tuner1AmPortSel"), + Constants$root.C_CHAR$LAYOUT.withName("tuner1AmNotchEnable"), + Constants$root.C_CHAR$LAYOUT.withName("rfNotchEnable"), + Constants$root.C_CHAR$LAYOUT.withName("rfDabNotchEnable"), + MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("resetGainUpdate"), + Constants$root.C_CHAR$LAYOUT.withName("resetRfUpdate") + ).withName("resetSlaveFlags"), + MemoryLayout.paddingLayout(24) + ).withName("rspDuoTunerParams"), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("hdrBw") + ).withName("rspDxTunerParams") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_RxChannelParamsT.$struct$LAYOUT; + } + public static MemorySegment tunerParams$slice(MemorySegment seg) { + return seg.asSlice(0, 72); + } + public static MemorySegment ctrlParams$slice(MemorySegment seg) { + return seg.asSlice(72, 32); + } + public static MemorySegment rsp1aTunerParams$slice(MemorySegment seg) { + return seg.asSlice(104, 1); + } + public static MemorySegment rsp2TunerParams$slice(MemorySegment seg) { + return seg.asSlice(108, 16); + } + public static MemorySegment rspDuoTunerParams$slice(MemorySegment seg) { + return seg.asSlice(124, 16); + } + public static MemorySegment rspDxTunerParams$slice(MemorySegment seg) { + return seg.asSlice(140, 4); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SelectDevice_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SelectDevice_t.java new file mode 100644 index 000000000..701420565 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SelectDevice_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_SelectDevice_t)(struct * device); + * } + */ +public interface sdrplay_api_SelectDevice_t { + + int apply(java.lang.foreign.MemorySegment dev); + static MemorySegment allocate(sdrplay_api_SelectDevice_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$2.sdrplay_api_SelectDevice_t_UP$MH, fi, constants$2.sdrplay_api_SelectDevice_t$FUNC, scope); + } + static sdrplay_api_SelectDevice_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (java.lang.foreign.MemorySegment _dev) -> { + try { + return (int)constants$2.sdrplay_api_SelectDevice_t_DOWN$MH.invokeExact(symbol, _dev); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_StreamCallback_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_StreamCallback_t.java new file mode 100644 index 000000000..aa3832c41 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_StreamCallback_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * void (*sdrplay_api_StreamCallback_t)(short* xi,short* xq,struct * params,unsigned int numSamples,unsigned int reset,void* cbContext); + * } + */ +public interface sdrplay_api_StreamCallback_t { + + void apply(java.lang.foreign.MemorySegment xi, java.lang.foreign.MemorySegment xq, java.lang.foreign.MemorySegment params, int numSamples, int reset, java.lang.foreign.MemorySegment cbContext); + static MemorySegment allocate(sdrplay_api_StreamCallback_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$0.sdrplay_api_StreamCallback_t_UP$MH, fi, constants$0.sdrplay_api_StreamCallback_t$FUNC, scope); + } + static sdrplay_api_StreamCallback_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (java.lang.foreign.MemorySegment _xi, java.lang.foreign.MemorySegment _xq, java.lang.foreign.MemorySegment _params, int _numSamples, int _reset, java.lang.foreign.MemorySegment _cbContext) -> { + try { + constants$0.sdrplay_api_StreamCallback_t_DOWN$MH.invokeExact(symbol, _xi, _xq, _params, _numSamples, _reset, _cbContext); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_StreamCbParamsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_StreamCbParamsT.java new file mode 100644 index 000000000..913df31cd --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_StreamCbParamsT.java @@ -0,0 +1,201 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * unsigned int firstSampleNum; + * int grChanged; + * int rfChanged; + * int fsChanged; + * unsigned int numSamples; + * }; + * } + */ +public class sdrplay_api_StreamCbParamsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("firstSampleNum"), + Constants$root.C_INT$LAYOUT.withName("grChanged"), + Constants$root.C_INT$LAYOUT.withName("rfChanged"), + Constants$root.C_INT$LAYOUT.withName("fsChanged"), + Constants$root.C_INT$LAYOUT.withName("numSamples") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_StreamCbParamsT.$struct$LAYOUT; + } + static final VarHandle firstSampleNum$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("firstSampleNum")); + public static VarHandle firstSampleNum$VH() { + return sdrplay_api_StreamCbParamsT.firstSampleNum$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned int firstSampleNum; + * } + */ + public static int firstSampleNum$get(MemorySegment seg) { + return (int)sdrplay_api_StreamCbParamsT.firstSampleNum$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned int firstSampleNum; + * } + */ + public static void firstSampleNum$set(MemorySegment seg, int x) { + sdrplay_api_StreamCbParamsT.firstSampleNum$VH.set(seg, x); + } + public static int firstSampleNum$get(MemorySegment seg, long index) { + return (int)sdrplay_api_StreamCbParamsT.firstSampleNum$VH.get(seg.asSlice(index*sizeof())); + } + public static void firstSampleNum$set(MemorySegment seg, long index, int x) { + sdrplay_api_StreamCbParamsT.firstSampleNum$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle grChanged$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("grChanged")); + public static VarHandle grChanged$VH() { + return sdrplay_api_StreamCbParamsT.grChanged$VH; + } + /** + * Getter for field: + * {@snippet : + * int grChanged; + * } + */ + public static int grChanged$get(MemorySegment seg) { + return (int)sdrplay_api_StreamCbParamsT.grChanged$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int grChanged; + * } + */ + public static void grChanged$set(MemorySegment seg, int x) { + sdrplay_api_StreamCbParamsT.grChanged$VH.set(seg, x); + } + public static int grChanged$get(MemorySegment seg, long index) { + return (int)sdrplay_api_StreamCbParamsT.grChanged$VH.get(seg.asSlice(index*sizeof())); + } + public static void grChanged$set(MemorySegment seg, long index, int x) { + sdrplay_api_StreamCbParamsT.grChanged$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle rfChanged$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rfChanged")); + public static VarHandle rfChanged$VH() { + return sdrplay_api_StreamCbParamsT.rfChanged$VH; + } + /** + * Getter for field: + * {@snippet : + * int rfChanged; + * } + */ + public static int rfChanged$get(MemorySegment seg) { + return (int)sdrplay_api_StreamCbParamsT.rfChanged$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int rfChanged; + * } + */ + public static void rfChanged$set(MemorySegment seg, int x) { + sdrplay_api_StreamCbParamsT.rfChanged$VH.set(seg, x); + } + public static int rfChanged$get(MemorySegment seg, long index) { + return (int)sdrplay_api_StreamCbParamsT.rfChanged$VH.get(seg.asSlice(index*sizeof())); + } + public static void rfChanged$set(MemorySegment seg, long index, int x) { + sdrplay_api_StreamCbParamsT.rfChanged$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle fsChanged$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fsChanged")); + public static VarHandle fsChanged$VH() { + return sdrplay_api_StreamCbParamsT.fsChanged$VH; + } + /** + * Getter for field: + * {@snippet : + * int fsChanged; + * } + */ + public static int fsChanged$get(MemorySegment seg) { + return (int)sdrplay_api_StreamCbParamsT.fsChanged$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int fsChanged; + * } + */ + public static void fsChanged$set(MemorySegment seg, int x) { + sdrplay_api_StreamCbParamsT.fsChanged$VH.set(seg, x); + } + public static int fsChanged$get(MemorySegment seg, long index) { + return (int)sdrplay_api_StreamCbParamsT.fsChanged$VH.get(seg.asSlice(index*sizeof())); + } + public static void fsChanged$set(MemorySegment seg, long index, int x) { + sdrplay_api_StreamCbParamsT.fsChanged$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle numSamples$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("numSamples")); + public static VarHandle numSamples$VH() { + return sdrplay_api_StreamCbParamsT.numSamples$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned int numSamples; + * } + */ + public static int numSamples$get(MemorySegment seg) { + return (int)sdrplay_api_StreamCbParamsT.numSamples$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned int numSamples; + * } + */ + public static void numSamples$set(MemorySegment seg, int x) { + sdrplay_api_StreamCbParamsT.numSamples$VH.set(seg, x); + } + public static int numSamples$get(MemorySegment seg, long index) { + return (int)sdrplay_api_StreamCbParamsT.numSamples$VH.get(seg.asSlice(index*sizeof())); + } + public static void numSamples$set(MemorySegment seg, long index, int x) { + sdrplay_api_StreamCbParamsT.numSamples$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SwapRspDuoActiveTuner_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SwapRspDuoActiveTuner_t.java new file mode 100644 index 000000000..5e38a6f6a --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SwapRspDuoActiveTuner_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_SwapRspDuoActiveTuner_t)(void* dev,enum * tuner,enum tuner1AmPortSel); + * } + */ +public interface sdrplay_api_SwapRspDuoActiveTuner_t { + + int apply(java.lang.foreign.MemorySegment dev, java.lang.foreign.MemorySegment tuner, int tuner1AmPortSel); + static MemorySegment allocate(sdrplay_api_SwapRspDuoActiveTuner_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$6.sdrplay_api_SwapRspDuoActiveTuner_t_UP$MH, fi, constants$6.sdrplay_api_SwapRspDuoActiveTuner_t$FUNC, scope); + } + static sdrplay_api_SwapRspDuoActiveTuner_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (java.lang.foreign.MemorySegment _dev, java.lang.foreign.MemorySegment _tuner, int _tuner1AmPortSel) -> { + try { + return (int)constants$6.sdrplay_api_SwapRspDuoActiveTuner_t_DOWN$MH.invokeExact(symbol, _dev, _tuner, _tuner1AmPortSel); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t.java new file mode 100644 index 000000000..4b4883a96 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t)(double* currentSampleRate,double newSampleRate); + * } + */ +public interface sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t { + + int apply(java.lang.foreign.MemorySegment currentSampleRate, double newSampleRate); + static MemorySegment allocate(sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$6.sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_UP$MH, fi, constants$6.sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t$FUNC, scope); + } + static sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (java.lang.foreign.MemorySegment _currentSampleRate, double _newSampleRate) -> { + try { + return (int)constants$6.sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t_DOWN$MH.invokeExact(symbol, _currentSampleRate, _newSampleRate); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SwapRspDuoMode_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SwapRspDuoMode_t.java new file mode 100644 index 000000000..8b317c314 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SwapRspDuoMode_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_SwapRspDuoMode_t)(struct * currDevice,struct ** deviceParams,enum rspDuoMode,double sampleRate,enum tuner,enum bwType,enum ifType,enum tuner1AmPortSel); + * } + */ +public interface sdrplay_api_SwapRspDuoMode_t { + + int apply(java.lang.foreign.MemorySegment currDevice, java.lang.foreign.MemorySegment deviceParams, int rspDuoMode, double sampleRate, int tuner, int bwType, int ifType, int tuner1AmPortSel); + static MemorySegment allocate(sdrplay_api_SwapRspDuoMode_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$7.sdrplay_api_SwapRspDuoMode_t_UP$MH, fi, constants$7.sdrplay_api_SwapRspDuoMode_t$FUNC, scope); + } + static sdrplay_api_SwapRspDuoMode_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (java.lang.foreign.MemorySegment _currDevice, java.lang.foreign.MemorySegment _deviceParams, int _rspDuoMode, double _sampleRate, int _tuner, int _bwType, int _ifType, int _tuner1AmPortSel) -> { + try { + return (int)constants$7.sdrplay_api_SwapRspDuoMode_t_DOWN$MH.invokeExact(symbol, _currDevice, _deviceParams, _rspDuoMode, _sampleRate, _tuner, _bwType, _ifType, _tuner1AmPortSel); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SyncUpdateT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SyncUpdateT.java new file mode 100644 index 000000000..bcdf90998 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_SyncUpdateT.java @@ -0,0 +1,111 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * unsigned int sampleNum; + * unsigned int period; + * }; + * } + */ +public class sdrplay_api_SyncUpdateT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("sampleNum"), + Constants$root.C_INT$LAYOUT.withName("period") + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_SyncUpdateT.$struct$LAYOUT; + } + static final VarHandle sampleNum$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("sampleNum")); + public static VarHandle sampleNum$VH() { + return sdrplay_api_SyncUpdateT.sampleNum$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned int sampleNum; + * } + */ + public static int sampleNum$get(MemorySegment seg) { + return (int)sdrplay_api_SyncUpdateT.sampleNum$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned int sampleNum; + * } + */ + public static void sampleNum$set(MemorySegment seg, int x) { + sdrplay_api_SyncUpdateT.sampleNum$VH.set(seg, x); + } + public static int sampleNum$get(MemorySegment seg, long index) { + return (int)sdrplay_api_SyncUpdateT.sampleNum$VH.get(seg.asSlice(index*sizeof())); + } + public static void sampleNum$set(MemorySegment seg, long index, int x) { + sdrplay_api_SyncUpdateT.sampleNum$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle period$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("period")); + public static VarHandle period$VH() { + return sdrplay_api_SyncUpdateT.period$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned int period; + * } + */ + public static int period$get(MemorySegment seg) { + return (int)sdrplay_api_SyncUpdateT.period$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned int period; + * } + */ + public static void period$set(MemorySegment seg, int x) { + sdrplay_api_SyncUpdateT.period$VH.set(seg, x); + } + public static int period$get(MemorySegment seg, long index) { + return (int)sdrplay_api_SyncUpdateT.period$VH.get(seg.asSlice(index*sizeof())); + } + public static void period$set(MemorySegment seg, long index, int x) { + sdrplay_api_SyncUpdateT.period$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_TunerParamsT.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_TunerParamsT.java new file mode 100644 index 000000000..0531ac7e3 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_TunerParamsT.java @@ -0,0 +1,179 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; +import java.lang.invoke.VarHandle; +/** + * {@snippet : + * struct { + * sdrplay_api_Bw_MHzT bwType; + * sdrplay_api_If_kHzT ifType; + * sdrplay_api_LoModeT loMode; + * sdrplay_api_GainT gain; + * sdrplay_api_RfFreqT rfFreq; + * sdrplay_api_DcOffsetTunerT dcOffsetTuner; + * }; + * } + */ +public class sdrplay_api_TunerParamsT { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("bwType"), + Constants$root.C_INT$LAYOUT.withName("ifType"), + Constants$root.C_INT$LAYOUT.withName("loMode"), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("gRdB"), + Constants$root.C_CHAR$LAYOUT.withName("LNAstate"), + Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"), + MemoryLayout.paddingLayout(16), + Constants$root.C_INT$LAYOUT.withName("minGr"), + MemoryLayout.structLayout( + Constants$root.C_FLOAT$LAYOUT.withName("curr"), + Constants$root.C_FLOAT$LAYOUT.withName("max"), + Constants$root.C_FLOAT$LAYOUT.withName("min") + ).withName("gainVals") + ).withName("gain"), + MemoryLayout.paddingLayout(32), + MemoryLayout.structLayout( + Constants$root.C_DOUBLE$LAYOUT.withName("rfHz"), + Constants$root.C_CHAR$LAYOUT.withName("syncUpdate"), + MemoryLayout.paddingLayout(56) + ).withName("rfFreq"), + MemoryLayout.structLayout( + Constants$root.C_CHAR$LAYOUT.withName("dcCal"), + Constants$root.C_CHAR$LAYOUT.withName("speedUp"), + MemoryLayout.paddingLayout(16), + Constants$root.C_INT$LAYOUT.withName("trackTime"), + Constants$root.C_INT$LAYOUT.withName("refreshRateTime") + ).withName("dcOffsetTuner"), + MemoryLayout.paddingLayout(32) + ); + public static MemoryLayout $LAYOUT() { + return sdrplay_api_TunerParamsT.$struct$LAYOUT; + } + static final VarHandle bwType$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("bwType")); + public static VarHandle bwType$VH() { + return sdrplay_api_TunerParamsT.bwType$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_Bw_MHzT bwType; + * } + */ + public static int bwType$get(MemorySegment seg) { + return (int)sdrplay_api_TunerParamsT.bwType$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_Bw_MHzT bwType; + * } + */ + public static void bwType$set(MemorySegment seg, int x) { + sdrplay_api_TunerParamsT.bwType$VH.set(seg, x); + } + public static int bwType$get(MemorySegment seg, long index) { + return (int)sdrplay_api_TunerParamsT.bwType$VH.get(seg.asSlice(index*sizeof())); + } + public static void bwType$set(MemorySegment seg, long index, int x) { + sdrplay_api_TunerParamsT.bwType$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle ifType$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ifType")); + public static VarHandle ifType$VH() { + return sdrplay_api_TunerParamsT.ifType$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_If_kHzT ifType; + * } + */ + public static int ifType$get(MemorySegment seg) { + return (int)sdrplay_api_TunerParamsT.ifType$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_If_kHzT ifType; + * } + */ + public static void ifType$set(MemorySegment seg, int x) { + sdrplay_api_TunerParamsT.ifType$VH.set(seg, x); + } + public static int ifType$get(MemorySegment seg, long index) { + return (int)sdrplay_api_TunerParamsT.ifType$VH.get(seg.asSlice(index*sizeof())); + } + public static void ifType$set(MemorySegment seg, long index, int x) { + sdrplay_api_TunerParamsT.ifType$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle loMode$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("loMode")); + public static VarHandle loMode$VH() { + return sdrplay_api_TunerParamsT.loMode$VH; + } + /** + * Getter for field: + * {@snippet : + * sdrplay_api_LoModeT loMode; + * } + */ + public static int loMode$get(MemorySegment seg) { + return (int)sdrplay_api_TunerParamsT.loMode$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * sdrplay_api_LoModeT loMode; + * } + */ + public static void loMode$set(MemorySegment seg, int x) { + sdrplay_api_TunerParamsT.loMode$VH.set(seg, x); + } + public static int loMode$get(MemorySegment seg, long index) { + return (int)sdrplay_api_TunerParamsT.loMode$VH.get(seg.asSlice(index*sizeof())); + } + public static void loMode$set(MemorySegment seg, long index, int x) { + sdrplay_api_TunerParamsT.loMode$VH.set(seg.asSlice(index*sizeof()), x); + } + public static MemorySegment gain$slice(MemorySegment seg) { + return seg.asSlice(12, 24); + } + public static MemorySegment rfFreq$slice(MemorySegment seg) { + return seg.asSlice(40, 16); + } + public static MemorySegment dcOffsetTuner$slice(MemorySegment seg) { + return seg.asSlice(56, 12); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Uninit_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Uninit_t.java new file mode 100644 index 000000000..2342fde1b --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Uninit_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_Uninit_t)(void* dev); + * } + */ +public interface sdrplay_api_Uninit_t { + + int apply(java.lang.foreign.MemorySegment dev); + static MemorySegment allocate(sdrplay_api_Uninit_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$5.sdrplay_api_Uninit_t_UP$MH, fi, constants$5.sdrplay_api_Uninit_t$FUNC, scope); + } + static sdrplay_api_Uninit_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (java.lang.foreign.MemorySegment _dev) -> { + try { + return (int)constants$5.sdrplay_api_Uninit_t_DOWN$MH.invokeExact(symbol, _dev); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_UnlockDeviceApi_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_UnlockDeviceApi_t.java new file mode 100644 index 000000000..ae67c29ae --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_UnlockDeviceApi_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_UnlockDeviceApi_t)(); + * } + */ +public interface sdrplay_api_UnlockDeviceApi_t { + + int apply(); + static MemorySegment allocate(sdrplay_api_UnlockDeviceApi_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$2.sdrplay_api_UnlockDeviceApi_t_UP$MH, fi, constants$2.sdrplay_api_UnlockDeviceApi_t$FUNC, scope); + } + static sdrplay_api_UnlockDeviceApi_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return () -> { + try { + return (int)constants$2.sdrplay_api_UnlockDeviceApi_t_DOWN$MH.invokeExact(symbol); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Update_t.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Update_t.java new file mode 100644 index 000000000..f5b976c0f --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_Update_t.java @@ -0,0 +1,49 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; +/** + * {@snippet : + * enum (*sdrplay_api_Update_t)(void* dev,enum tuner,enum reasonForUpdate,enum reasonForUpdateExt1); + * } + */ +public interface sdrplay_api_Update_t { + + int apply(java.lang.foreign.MemorySegment dev, int tuner, int reasonForUpdate, int reasonForUpdateExt1); + static MemorySegment allocate(sdrplay_api_Update_t fi, SegmentScope scope) { + return RuntimeHelper.upcallStub(constants$6.sdrplay_api_Update_t_UP$MH, fi, constants$6.sdrplay_api_Update_t$FUNC, scope); + } + static sdrplay_api_Update_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + return (java.lang.foreign.MemorySegment _dev, int _tuner, int _reasonForUpdate, int _reasonForUpdateExt1) -> { + try { + return (int)constants$6.sdrplay_api_Update_t_DOWN$MH.invokeExact(symbol, _dev, _tuner, _reasonForUpdate, _reasonForUpdateExt1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_h.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_h.java new file mode 100644 index 000000000..f126b2e46 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/api/v3_14/sdrplay_api_h.java @@ -0,0 +1,1724 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +// Generated by jextract + +package io.github.dsheirer.source.tuner.sdrplay.api.v3_14; + +import java.lang.foreign.MemorySegment; +import java.lang.invoke.MethodHandle; + +import static java.lang.foreign.ValueLayout.OfAddress; +import static java.lang.foreign.ValueLayout.OfByte; +import static java.lang.foreign.ValueLayout.OfDouble; +import static java.lang.foreign.ValueLayout.OfFloat; +import static java.lang.foreign.ValueLayout.OfInt; +import static java.lang.foreign.ValueLayout.OfLong; +import static java.lang.foreign.ValueLayout.OfShort; +public class sdrplay_api_h { + + public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; + public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; + public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; + public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; + public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; + public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; + public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; + public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + /** + * {@snippet : + * #define RSPIA_NUM_LNA_STATES 10 + * } + */ + public static int RSPIA_NUM_LNA_STATES() { + return (int)10L; + } + /** + * {@snippet : + * #define RSPIA_NUM_LNA_STATES_AM 7 + * } + */ + public static int RSPIA_NUM_LNA_STATES_AM() { + return (int)7L; + } + /** + * {@snippet : + * #define RSPIA_NUM_LNA_STATES_LBAND 9 + * } + */ + public static int RSPIA_NUM_LNA_STATES_LBAND() { + return (int)9L; + } + /** + * {@snippet : + * #define RSPII_NUM_LNA_STATES 9 + * } + */ + public static int RSPII_NUM_LNA_STATES() { + return (int)9L; + } + /** + * {@snippet : + * #define RSPII_NUM_LNA_STATES_AMPORT 5 + * } + */ + public static int RSPII_NUM_LNA_STATES_AMPORT() { + return (int)5L; + } + /** + * {@snippet : + * #define RSPII_NUM_LNA_STATES_420MHZ 6 + * } + */ + public static int RSPII_NUM_LNA_STATES_420MHZ() { + return (int)6L; + } + /** + * {@snippet : + * #define RSPDUO_NUM_LNA_STATES 10 + * } + */ + public static int RSPDUO_NUM_LNA_STATES() { + return (int)10L; + } + /** + * {@snippet : + * #define RSPDUO_NUM_LNA_STATES_AMPORT 5 + * } + */ + public static int RSPDUO_NUM_LNA_STATES_AMPORT() { + return (int)5L; + } + /** + * {@snippet : + * #define RSPDUO_NUM_LNA_STATES_AM 7 + * } + */ + public static int RSPDUO_NUM_LNA_STATES_AM() { + return (int)7L; + } + /** + * {@snippet : + * #define RSPDUO_NUM_LNA_STATES_LBAND 9 + * } + */ + public static int RSPDUO_NUM_LNA_STATES_LBAND() { + return (int)9L; + } + /** + * {@snippet : + * #define RSPDX_NUM_LNA_STATES 28 + * } + */ + public static int RSPDX_NUM_LNA_STATES() { + return (int)28L; + } + /** + * {@snippet : + * #define RSPDX_NUM_LNA_STATES_AMPORT2_0_12 19 + * } + */ + public static int RSPDX_NUM_LNA_STATES_AMPORT2_0_12() { + return (int)19L; + } + /** + * {@snippet : + * #define RSPDX_NUM_LNA_STATES_AMPORT2_12_50 20 + * } + */ + public static int RSPDX_NUM_LNA_STATES_AMPORT2_12_50() { + return (int)20L; + } + /** + * {@snippet : + * #define RSPDX_NUM_LNA_STATES_AMPORT2_50_60 25 + * } + */ + public static int RSPDX_NUM_LNA_STATES_AMPORT2_50_60() { + return (int)25L; + } + /** + * {@snippet : + * #define RSPDX_NUM_LNA_STATES_VHF_BAND3 27 + * } + */ + public static int RSPDX_NUM_LNA_STATES_VHF_BAND3() { + return (int)27L; + } + /** + * {@snippet : + * #define RSPDX_NUM_LNA_STATES_420MHZ 21 + * } + */ + public static int RSPDX_NUM_LNA_STATES_420MHZ() { + return (int)21L; + } + /** + * {@snippet : + * #define RSPDX_NUM_LNA_STATES_LBAND 19 + * } + */ + public static int RSPDX_NUM_LNA_STATES_LBAND() { + return (int)19L; + } + /** + * {@snippet : + * #define RSPDX_NUM_LNA_STATES_DX 22 + * } + */ + public static int RSPDX_NUM_LNA_STATES_DX() { + return (int)22L; + } + /** + * {@snippet : + * enum .sdrplay_api_Rsp2_ANTENNA_A = 5; + * } + */ + public static int sdrplay_api_Rsp2_ANTENNA_A() { + return (int)5L; + } + /** + * {@snippet : + * enum .sdrplay_api_Rsp2_ANTENNA_B = 6; + * } + */ + public static int sdrplay_api_Rsp2_ANTENNA_B() { + return (int)6L; + } + /** + * {@snippet : + * enum .sdrplay_api_Rsp2_AMPORT_1 = 1; + * } + */ + public static int sdrplay_api_Rsp2_AMPORT_1() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_Rsp2_AMPORT_2 = 0; + * } + */ + public static int sdrplay_api_Rsp2_AMPORT_2() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_RspDuoMode_Unknown = 0; + * } + */ + public static int sdrplay_api_RspDuoMode_Unknown() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_RspDuoMode_Single_Tuner = 1; + * } + */ + public static int sdrplay_api_RspDuoMode_Single_Tuner() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_RspDuoMode_Dual_Tuner = 2; + * } + */ + public static int sdrplay_api_RspDuoMode_Dual_Tuner() { + return (int)2L; + } + /** + * {@snippet : + * enum .sdrplay_api_RspDuoMode_Master = 4; + * } + */ + public static int sdrplay_api_RspDuoMode_Master() { + return (int)4L; + } + /** + * {@snippet : + * enum .sdrplay_api_RspDuoMode_Slave = 8; + * } + */ + public static int sdrplay_api_RspDuoMode_Slave() { + return (int)8L; + } + /** + * {@snippet : + * enum .sdrplay_api_RspDuo_AMPORT_1 = 1; + * } + */ + public static int sdrplay_api_RspDuo_AMPORT_1() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_RspDuo_AMPORT_2 = 0; + * } + */ + public static int sdrplay_api_RspDuo_AMPORT_2() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_BW_Undefined = 0; + * } + */ + public static int sdrplay_api_BW_Undefined() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_BW_0_200 = 200; + * } + */ + public static int sdrplay_api_BW_0_200() { + return (int)200L; + } + /** + * {@snippet : + * enum .sdrplay_api_BW_0_300 = 300; + * } + */ + public static int sdrplay_api_BW_0_300() { + return (int)300L; + } + /** + * {@snippet : + * enum .sdrplay_api_BW_0_600 = 600; + * } + */ + public static int sdrplay_api_BW_0_600() { + return (int)600L; + } + /** + * {@snippet : + * enum .sdrplay_api_BW_1_536 = 1536; + * } + */ + public static int sdrplay_api_BW_1_536() { + return (int)1536L; + } + /** + * {@snippet : + * enum .sdrplay_api_BW_5_000 = 5000; + * } + */ + public static int sdrplay_api_BW_5_000() { + return (int)5000L; + } + /** + * {@snippet : + * enum .sdrplay_api_BW_6_000 = 6000; + * } + */ + public static int sdrplay_api_BW_6_000() { + return (int)6000L; + } + /** + * {@snippet : + * enum .sdrplay_api_BW_7_000 = 7000; + * } + */ + public static int sdrplay_api_BW_7_000() { + return (int)7000L; + } + /** + * {@snippet : + * enum .sdrplay_api_BW_8_000 = 8000; + * } + */ + public static int sdrplay_api_BW_8_000() { + return (int)8000L; + } + /** + * {@snippet : + * enum .sdrplay_api_IF_Undefined = -1; + * } + */ + public static int sdrplay_api_IF_Undefined() { + return (int)-1L; + } + /** + * {@snippet : + * enum .sdrplay_api_IF_Zero = 0; + * } + */ + public static int sdrplay_api_IF_Zero() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_IF_0_450 = 450; + * } + */ + public static int sdrplay_api_IF_0_450() { + return (int)450L; + } + /** + * {@snippet : + * enum .sdrplay_api_IF_1_620 = 1620; + * } + */ + public static int sdrplay_api_IF_1_620() { + return (int)1620L; + } + /** + * {@snippet : + * enum .sdrplay_api_IF_2_048 = 2048; + * } + */ + public static int sdrplay_api_IF_2_048() { + return (int)2048L; + } + /** + * {@snippet : + * enum .sdrplay_api_LO_Undefined = 0; + * } + */ + public static int sdrplay_api_LO_Undefined() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_LO_Auto = 1; + * } + */ + public static int sdrplay_api_LO_Auto() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_LO_120MHz = 2; + * } + */ + public static int sdrplay_api_LO_120MHz() { + return (int)2L; + } + /** + * {@snippet : + * enum .sdrplay_api_LO_144MHz = 3; + * } + */ + public static int sdrplay_api_LO_144MHz() { + return (int)3L; + } + /** + * {@snippet : + * enum .sdrplay_api_LO_168MHz = 4; + * } + */ + public static int sdrplay_api_LO_168MHz() { + return (int)4L; + } + /** + * {@snippet : + * enum .sdrplay_api_EXTENDED_MIN_GR = 0; + * } + */ + public static int sdrplay_api_EXTENDED_MIN_GR() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_NORMAL_MIN_GR = 20; + * } + */ + public static int sdrplay_api_NORMAL_MIN_GR() { + return (int)20L; + } + /** + * {@snippet : + * enum .sdrplay_api_Tuner_Neither = 0; + * } + */ + public static int sdrplay_api_Tuner_Neither() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_Tuner_A = 1; + * } + */ + public static int sdrplay_api_Tuner_A() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_Tuner_B = 2; + * } + */ + public static int sdrplay_api_Tuner_B() { + return (int)2L; + } + /** + * {@snippet : + * enum .sdrplay_api_Tuner_Both = 3; + * } + */ + public static int sdrplay_api_Tuner_Both() { + return (int)3L; + } + /** + * {@snippet : + * enum .sdrplay_api_RspDx_ANTENNA_A = 0; + * } + */ + public static int sdrplay_api_RspDx_ANTENNA_A() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_RspDx_ANTENNA_B = 1; + * } + */ + public static int sdrplay_api_RspDx_ANTENNA_B() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_RspDx_ANTENNA_C = 2; + * } + */ + public static int sdrplay_api_RspDx_ANTENNA_C() { + return (int)2L; + } + /** + * {@snippet : + * enum .sdrplay_api_RspDx_HDRMODE_BW_0_200 = 0; + * } + */ + public static int sdrplay_api_RspDx_HDRMODE_BW_0_200() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_RspDx_HDRMODE_BW_0_500 = 1; + * } + */ + public static int sdrplay_api_RspDx_HDRMODE_BW_0_500() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_RspDx_HDRMODE_BW_1_200 = 2; + * } + */ + public static int sdrplay_api_RspDx_HDRMODE_BW_1_200() { + return (int)2L; + } + /** + * {@snippet : + * enum .sdrplay_api_RspDx_HDRMODE_BW_1_700 = 3; + * } + */ + public static int sdrplay_api_RspDx_HDRMODE_BW_1_700() { + return (int)3L; + } + /** + * {@snippet : + * enum .sdrplay_api_ISOCH = 0; + * } + */ + public static int sdrplay_api_ISOCH() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_BULK = 1; + * } + */ + public static int sdrplay_api_BULK() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_AGC_DISABLE = 0; + * } + */ + public static int sdrplay_api_AGC_DISABLE() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_AGC_100HZ = 1; + * } + */ + public static int sdrplay_api_AGC_100HZ() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_AGC_50HZ = 2; + * } + */ + public static int sdrplay_api_AGC_50HZ() { + return (int)2L; + } + /** + * {@snippet : + * enum .sdrplay_api_AGC_5HZ = 3; + * } + */ + public static int sdrplay_api_AGC_5HZ() { + return (int)3L; + } + /** + * {@snippet : + * enum .sdrplay_api_AGC_CTRL_EN = 4; + * } + */ + public static int sdrplay_api_AGC_CTRL_EN() { + return (int)4L; + } + /** + * {@snippet : + * enum .sdrplay_api_ADSB_DECIMATION = 0; + * } + */ + public static int sdrplay_api_ADSB_DECIMATION() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_ADSB_NO_DECIMATION_LOWPASS = 1; + * } + */ + public static int sdrplay_api_ADSB_NO_DECIMATION_LOWPASS() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_ADSB_NO_DECIMATION_BANDPASS_2MHZ = 2; + * } + */ + public static int sdrplay_api_ADSB_NO_DECIMATION_BANDPASS_2MHZ() { + return (int)2L; + } + /** + * {@snippet : + * enum .sdrplay_api_ADSB_NO_DECIMATION_BANDPASS_3MHZ = 3; + * } + */ + public static int sdrplay_api_ADSB_NO_DECIMATION_BANDPASS_3MHZ() { + return (int)3L; + } + /** + * {@snippet : + * enum .sdrplay_api_Overload_Detected = 0; + * } + */ + public static int sdrplay_api_Overload_Detected() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_Overload_Corrected = 1; + * } + */ + public static int sdrplay_api_Overload_Corrected() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_MasterInitialised = 0; + * } + */ + public static int sdrplay_api_MasterInitialised() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_SlaveAttached = 1; + * } + */ + public static int sdrplay_api_SlaveAttached() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_SlaveDetached = 2; + * } + */ + public static int sdrplay_api_SlaveDetached() { + return (int)2L; + } + /** + * {@snippet : + * enum .sdrplay_api_SlaveInitialised = 3; + * } + */ + public static int sdrplay_api_SlaveInitialised() { + return (int)3L; + } + /** + * {@snippet : + * enum .sdrplay_api_SlaveUninitialised = 4; + * } + */ + public static int sdrplay_api_SlaveUninitialised() { + return (int)4L; + } + /** + * {@snippet : + * enum .sdrplay_api_MasterDllDisappeared = 5; + * } + */ + public static int sdrplay_api_MasterDllDisappeared() { + return (int)5L; + } + /** + * {@snippet : + * enum .sdrplay_api_SlaveDllDisappeared = 6; + * } + */ + public static int sdrplay_api_SlaveDllDisappeared() { + return (int)6L; + } + /** + * {@snippet : + * enum .sdrplay_api_GainChange = 0; + * } + */ + public static int sdrplay_api_GainChange() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_PowerOverloadChange = 1; + * } + */ + public static int sdrplay_api_PowerOverloadChange() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_DeviceRemoved = 2; + * } + */ + public static int sdrplay_api_DeviceRemoved() { + return (int)2L; + } + /** + * {@snippet : + * enum .sdrplay_api_RspDuoModeChange = 3; + * } + */ + public static int sdrplay_api_RspDuoModeChange() { + return (int)3L; + } + /** + * {@snippet : + * enum .sdrplay_api_DeviceFailure = 4; + * } + */ + public static int sdrplay_api_DeviceFailure() { + return (int)4L; + } + /** + * {@snippet : + * typedef void* HANDLE; + * } + */ + public static final OfAddress HANDLE = Constants$root.C_POINTER$LAYOUT; + /** + * {@snippet : + * enum .sdrplay_api_Success = 0; + * } + */ + public static int sdrplay_api_Success() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_Fail = 1; + * } + */ + public static int sdrplay_api_Fail() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_InvalidParam = 2; + * } + */ + public static int sdrplay_api_InvalidParam() { + return (int)2L; + } + /** + * {@snippet : + * enum .sdrplay_api_OutOfRange = 3; + * } + */ + public static int sdrplay_api_OutOfRange() { + return (int)3L; + } + /** + * {@snippet : + * enum .sdrplay_api_GainUpdateError = 4; + * } + */ + public static int sdrplay_api_GainUpdateError() { + return (int)4L; + } + /** + * {@snippet : + * enum .sdrplay_api_RfUpdateError = 5; + * } + */ + public static int sdrplay_api_RfUpdateError() { + return (int)5L; + } + /** + * {@snippet : + * enum .sdrplay_api_FsUpdateError = 6; + * } + */ + public static int sdrplay_api_FsUpdateError() { + return (int)6L; + } + /** + * {@snippet : + * enum .sdrplay_api_HwError = 7; + * } + */ + public static int sdrplay_api_HwError() { + return (int)7L; + } + /** + * {@snippet : + * enum .sdrplay_api_AliasingError = 8; + * } + */ + public static int sdrplay_api_AliasingError() { + return (int)8L; + } + /** + * {@snippet : + * enum .sdrplay_api_AlreadyInitialised = 9; + * } + */ + public static int sdrplay_api_AlreadyInitialised() { + return (int)9L; + } + /** + * {@snippet : + * enum .sdrplay_api_NotInitialised = 10; + * } + */ + public static int sdrplay_api_NotInitialised() { + return (int)10L; + } + /** + * {@snippet : + * enum .sdrplay_api_NotEnabled = 11; + * } + */ + public static int sdrplay_api_NotEnabled() { + return (int)11L; + } + /** + * {@snippet : + * enum .sdrplay_api_HwVerError = 12; + * } + */ + public static int sdrplay_api_HwVerError() { + return (int)12L; + } + /** + * {@snippet : + * enum .sdrplay_api_OutOfMemError = 13; + * } + */ + public static int sdrplay_api_OutOfMemError() { + return (int)13L; + } + /** + * {@snippet : + * enum .sdrplay_api_ServiceNotResponding = 14; + * } + */ + public static int sdrplay_api_ServiceNotResponding() { + return (int)14L; + } + /** + * {@snippet : + * enum .sdrplay_api_StartPending = 15; + * } + */ + public static int sdrplay_api_StartPending() { + return (int)15L; + } + /** + * {@snippet : + * enum .sdrplay_api_StopPending = 16; + * } + */ + public static int sdrplay_api_StopPending() { + return (int)16L; + } + /** + * {@snippet : + * enum .sdrplay_api_InvalidMode = 17; + * } + */ + public static int sdrplay_api_InvalidMode() { + return (int)17L; + } + /** + * {@snippet : + * enum .sdrplay_api_FailedVerification1 = 18; + * } + */ + public static int sdrplay_api_FailedVerification1() { + return (int)18L; + } + /** + * {@snippet : + * enum .sdrplay_api_FailedVerification2 = 19; + * } + */ + public static int sdrplay_api_FailedVerification2() { + return (int)19L; + } + /** + * {@snippet : + * enum .sdrplay_api_FailedVerification3 = 20; + * } + */ + public static int sdrplay_api_FailedVerification3() { + return (int)20L; + } + /** + * {@snippet : + * enum .sdrplay_api_FailedVerification4 = 21; + * } + */ + public static int sdrplay_api_FailedVerification4() { + return (int)21L; + } + /** + * {@snippet : + * enum .sdrplay_api_FailedVerification5 = 22; + * } + */ + public static int sdrplay_api_FailedVerification5() { + return (int)22L; + } + /** + * {@snippet : + * enum .sdrplay_api_FailedVerification6 = 23; + * } + */ + public static int sdrplay_api_FailedVerification6() { + return (int)23L; + } + /** + * {@snippet : + * enum .sdrplay_api_InvalidServiceVersion = 24; + * } + */ + public static int sdrplay_api_InvalidServiceVersion() { + return (int)24L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_None = 0; + * } + */ + public static int sdrplay_api_Update_None() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Dev_Fs = 1; + * } + */ + public static int sdrplay_api_Update_Dev_Fs() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Dev_Ppm = 2; + * } + */ + public static int sdrplay_api_Update_Dev_Ppm() { + return (int)2L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Dev_SyncUpdate = 4; + * } + */ + public static int sdrplay_api_Update_Dev_SyncUpdate() { + return (int)4L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Dev_ResetFlags = 8; + * } + */ + public static int sdrplay_api_Update_Dev_ResetFlags() { + return (int)8L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Rsp1a_BiasTControl = 16; + * } + */ + public static int sdrplay_api_Update_Rsp1a_BiasTControl() { + return (int)16L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Rsp1a_RfNotchControl = 32; + * } + */ + public static int sdrplay_api_Update_Rsp1a_RfNotchControl() { + return (int)32L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Rsp1a_RfDabNotchControl = 64; + * } + */ + public static int sdrplay_api_Update_Rsp1a_RfDabNotchControl() { + return (int)64L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Rsp2_BiasTControl = 128; + * } + */ + public static int sdrplay_api_Update_Rsp2_BiasTControl() { + return (int)128L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Rsp2_AmPortSelect = 256; + * } + */ + public static int sdrplay_api_Update_Rsp2_AmPortSelect() { + return (int)256L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Rsp2_AntennaControl = 512; + * } + */ + public static int sdrplay_api_Update_Rsp2_AntennaControl() { + return (int)512L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Rsp2_RfNotchControl = 1024; + * } + */ + public static int sdrplay_api_Update_Rsp2_RfNotchControl() { + return (int)1024L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Rsp2_ExtRefControl = 2048; + * } + */ + public static int sdrplay_api_Update_Rsp2_ExtRefControl() { + return (int)2048L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_RspDuo_ExtRefControl = 4096; + * } + */ + public static int sdrplay_api_Update_RspDuo_ExtRefControl() { + return (int)4096L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Master_Spare_1 = 8192; + * } + */ + public static int sdrplay_api_Update_Master_Spare_1() { + return (int)8192L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Master_Spare_2 = 16384; + * } + */ + public static int sdrplay_api_Update_Master_Spare_2() { + return (int)16384L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Tuner_Gr = 32768; + * } + */ + public static int sdrplay_api_Update_Tuner_Gr() { + return (int)32768L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Tuner_GrLimits = 65536; + * } + */ + public static int sdrplay_api_Update_Tuner_GrLimits() { + return (int)65536L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Tuner_Frf = 131072; + * } + */ + public static int sdrplay_api_Update_Tuner_Frf() { + return (int)131072L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Tuner_BwType = 262144; + * } + */ + public static int sdrplay_api_Update_Tuner_BwType() { + return (int)262144L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Tuner_IfType = 524288; + * } + */ + public static int sdrplay_api_Update_Tuner_IfType() { + return (int)524288L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Tuner_DcOffset = 1048576; + * } + */ + public static int sdrplay_api_Update_Tuner_DcOffset() { + return (int)1048576L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Tuner_LoMode = 2097152; + * } + */ + public static int sdrplay_api_Update_Tuner_LoMode() { + return (int)2097152L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Ctrl_DCoffsetIQimbalance = 4194304; + * } + */ + public static int sdrplay_api_Update_Ctrl_DCoffsetIQimbalance() { + return (int)4194304L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Ctrl_Decimation = 8388608; + * } + */ + public static int sdrplay_api_Update_Ctrl_Decimation() { + return (int)8388608L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Ctrl_Agc = 16777216; + * } + */ + public static int sdrplay_api_Update_Ctrl_Agc() { + return (int)16777216L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Ctrl_AdsbMode = 33554432; + * } + */ + public static int sdrplay_api_Update_Ctrl_AdsbMode() { + return (int)33554432L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Ctrl_OverloadMsgAck = 67108864; + * } + */ + public static int sdrplay_api_Update_Ctrl_OverloadMsgAck() { + return (int)67108864L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_RspDuo_BiasTControl = 134217728; + * } + */ + public static int sdrplay_api_Update_RspDuo_BiasTControl() { + return (int)134217728L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_RspDuo_AmPortSelect = 268435456; + * } + */ + public static int sdrplay_api_Update_RspDuo_AmPortSelect() { + return (int)268435456L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_RspDuo_Tuner1AmNotchControl = 536870912; + * } + */ + public static int sdrplay_api_Update_RspDuo_Tuner1AmNotchControl() { + return (int)536870912L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_RspDuo_RfNotchControl = 1073741824; + * } + */ + public static int sdrplay_api_Update_RspDuo_RfNotchControl() { + return (int)1073741824L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_RspDuo_RfDabNotchControl = -2147483648; + * } + */ + public static int sdrplay_api_Update_RspDuo_RfDabNotchControl() { + return (int)-2147483648L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_Ext1_None = 0; + * } + */ + public static int sdrplay_api_Update_Ext1_None() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_RspDx_HdrEnable = 1; + * } + */ + public static int sdrplay_api_Update_RspDx_HdrEnable() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_RspDx_BiasTControl = 2; + * } + */ + public static int sdrplay_api_Update_RspDx_BiasTControl() { + return (int)2L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_RspDx_AntennaControl = 4; + * } + */ + public static int sdrplay_api_Update_RspDx_AntennaControl() { + return (int)4L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_RspDx_RfNotchControl = 8; + * } + */ + public static int sdrplay_api_Update_RspDx_RfNotchControl() { + return (int)8L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_RspDx_RfDabNotchControl = 16; + * } + */ + public static int sdrplay_api_Update_RspDx_RfDabNotchControl() { + return (int)16L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_RspDx_HdrBw = 32; + * } + */ + public static int sdrplay_api_Update_RspDx_HdrBw() { + return (int)32L; + } + /** + * {@snippet : + * enum .sdrplay_api_Update_RspDuo_ResetSlaveFlags = 64; + * } + */ + public static int sdrplay_api_Update_RspDuo_ResetSlaveFlags() { + return (int)64L; + } + /** + * {@snippet : + * enum .sdrplay_api_DbgLvl_Disable = 0; + * } + */ + public static int sdrplay_api_DbgLvl_Disable() { + return (int)0L; + } + /** + * {@snippet : + * enum .sdrplay_api_DbgLvl_Verbose = 1; + * } + */ + public static int sdrplay_api_DbgLvl_Verbose() { + return (int)1L; + } + /** + * {@snippet : + * enum .sdrplay_api_DbgLvl_Warning = 2; + * } + */ + public static int sdrplay_api_DbgLvl_Warning() { + return (int)2L; + } + /** + * {@snippet : + * enum .sdrplay_api_DbgLvl_Error = 3; + * } + */ + public static int sdrplay_api_DbgLvl_Error() { + return (int)3L; + } + /** + * {@snippet : + * enum .sdrplay_api_DbgLvl_Message = 4; + * } + */ + public static int sdrplay_api_DbgLvl_Message() { + return (int)4L; + } + public static MethodHandle sdrplay_api_Open$MH() { + return RuntimeHelper.requireNonNull(constants$7.sdrplay_api_Open$MH,"sdrplay_api_Open"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_Open(); + * } + */ + public static int sdrplay_api_Open() { + var mh$ = sdrplay_api_Open$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_Close$MH() { + return RuntimeHelper.requireNonNull(constants$7.sdrplay_api_Close$MH,"sdrplay_api_Close"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_Close(); + * } + */ + public static int sdrplay_api_Close() { + var mh$ = sdrplay_api_Close$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_ApiVersion$MH() { + return RuntimeHelper.requireNonNull(constants$7.sdrplay_api_ApiVersion$MH,"sdrplay_api_ApiVersion"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_ApiVersion(float* apiVer); + * } + */ + public static int sdrplay_api_ApiVersion(MemorySegment apiVer) { + var mh$ = sdrplay_api_ApiVersion$MH(); + try { + return (int)mh$.invokeExact(apiVer); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_LockDeviceApi$MH() { + return RuntimeHelper.requireNonNull(constants$7.sdrplay_api_LockDeviceApi$MH,"sdrplay_api_LockDeviceApi"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_LockDeviceApi(); + * } + */ + public static int sdrplay_api_LockDeviceApi() { + var mh$ = sdrplay_api_LockDeviceApi$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_UnlockDeviceApi$MH() { + return RuntimeHelper.requireNonNull(constants$8.sdrplay_api_UnlockDeviceApi$MH,"sdrplay_api_UnlockDeviceApi"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_UnlockDeviceApi(); + * } + */ + public static int sdrplay_api_UnlockDeviceApi() { + var mh$ = sdrplay_api_UnlockDeviceApi$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_GetDevices$MH() { + return RuntimeHelper.requireNonNull(constants$8.sdrplay_api_GetDevices$MH,"sdrplay_api_GetDevices"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_GetDevices(sdrplay_api_DeviceT* devices, unsigned int* numDevs, unsigned int maxDevs); + * } + */ + public static int sdrplay_api_GetDevices(MemorySegment devices, MemorySegment numDevs, int maxDevs) { + var mh$ = sdrplay_api_GetDevices$MH(); + try { + return (int)mh$.invokeExact(devices, numDevs, maxDevs); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_SelectDevice$MH() { + return RuntimeHelper.requireNonNull(constants$8.sdrplay_api_SelectDevice$MH,"sdrplay_api_SelectDevice"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_SelectDevice(sdrplay_api_DeviceT* device); + * } + */ + public static int sdrplay_api_SelectDevice(MemorySegment device) { + var mh$ = sdrplay_api_SelectDevice$MH(); + try { + return (int)mh$.invokeExact(device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_ReleaseDevice$MH() { + return RuntimeHelper.requireNonNull(constants$8.sdrplay_api_ReleaseDevice$MH,"sdrplay_api_ReleaseDevice"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_ReleaseDevice(sdrplay_api_DeviceT* device); + * } + */ + public static int sdrplay_api_ReleaseDevice(MemorySegment device) { + var mh$ = sdrplay_api_ReleaseDevice$MH(); + try { + return (int)mh$.invokeExact(device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_GetErrorString$MH() { + return RuntimeHelper.requireNonNull(constants$8.sdrplay_api_GetErrorString$MH,"sdrplay_api_GetErrorString"); + } + /** + * {@snippet : + * char* sdrplay_api_GetErrorString(sdrplay_api_ErrT err); + * } + */ + public static MemorySegment sdrplay_api_GetErrorString(int err) { + var mh$ = sdrplay_api_GetErrorString$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(err); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_GetLastError$MH() { + return RuntimeHelper.requireNonNull(constants$8.sdrplay_api_GetLastError$MH,"sdrplay_api_GetLastError"); + } + /** + * {@snippet : + * sdrplay_api_ErrorInfoT* sdrplay_api_GetLastError(sdrplay_api_DeviceT* device); + * } + */ + public static MemorySegment sdrplay_api_GetLastError(MemorySegment device) { + var mh$ = sdrplay_api_GetLastError$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_GetLastErrorByType$MH() { + return RuntimeHelper.requireNonNull(constants$9.sdrplay_api_GetLastErrorByType$MH,"sdrplay_api_GetLastErrorByType"); + } + /** + * {@snippet : + * sdrplay_api_ErrorInfoT* sdrplay_api_GetLastErrorByType(sdrplay_api_DeviceT* device, int type, unsigned long long* time); + * } + */ + public static MemorySegment sdrplay_api_GetLastErrorByType(MemorySegment device, int type, MemorySegment time) { + var mh$ = sdrplay_api_GetLastErrorByType$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(device, type, time); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_DisableHeartbeat$MH() { + return RuntimeHelper.requireNonNull(constants$9.sdrplay_api_DisableHeartbeat$MH,"sdrplay_api_DisableHeartbeat"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_DisableHeartbeat(); + * } + */ + public static int sdrplay_api_DisableHeartbeat() { + var mh$ = sdrplay_api_DisableHeartbeat$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_DebugEnable$MH() { + return RuntimeHelper.requireNonNull(constants$9.sdrplay_api_DebugEnable$MH,"sdrplay_api_DebugEnable"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_DebugEnable(HANDLE dev, sdrplay_api_DbgLvl_t enable); + * } + */ + public static int sdrplay_api_DebugEnable(MemorySegment dev, int enable) { + var mh$ = sdrplay_api_DebugEnable$MH(); + try { + return (int)mh$.invokeExact(dev, enable); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_GetDeviceParams$MH() { + return RuntimeHelper.requireNonNull(constants$9.sdrplay_api_GetDeviceParams$MH,"sdrplay_api_GetDeviceParams"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_GetDeviceParams(HANDLE dev, sdrplay_api_DeviceParamsT** deviceParams); + * } + */ + public static int sdrplay_api_GetDeviceParams(MemorySegment dev, MemorySegment deviceParams) { + var mh$ = sdrplay_api_GetDeviceParams$MH(); + try { + return (int)mh$.invokeExact(dev, deviceParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_Init$MH() { + return RuntimeHelper.requireNonNull(constants$9.sdrplay_api_Init$MH,"sdrplay_api_Init"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_Init(HANDLE dev, sdrplay_api_CallbackFnsT* callbackFns, void* cbContext); + * } + */ + public static int sdrplay_api_Init(MemorySegment dev, MemorySegment callbackFns, MemorySegment cbContext) { + var mh$ = sdrplay_api_Init$MH(); + try { + return (int)mh$.invokeExact(dev, callbackFns, cbContext); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_Uninit$MH() { + return RuntimeHelper.requireNonNull(constants$9.sdrplay_api_Uninit$MH,"sdrplay_api_Uninit"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_Uninit(HANDLE dev); + * } + */ + public static int sdrplay_api_Uninit(MemorySegment dev) { + var mh$ = sdrplay_api_Uninit$MH(); + try { + return (int)mh$.invokeExact(dev); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_Update$MH() { + return RuntimeHelper.requireNonNull(constants$10.sdrplay_api_Update$MH,"sdrplay_api_Update"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_Update(HANDLE dev, sdrplay_api_TunerSelectT tuner, sdrplay_api_ReasonForUpdateT reasonForUpdate, sdrplay_api_ReasonForUpdateExtension1T reasonForUpdateExt1); + * } + */ + public static int sdrplay_api_Update(MemorySegment dev, int tuner, int reasonForUpdate, int reasonForUpdateExt1) { + var mh$ = sdrplay_api_Update$MH(); + try { + return (int)mh$.invokeExact(dev, tuner, reasonForUpdate, reasonForUpdateExt1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_SwapRspDuoActiveTuner$MH() { + return RuntimeHelper.requireNonNull(constants$10.sdrplay_api_SwapRspDuoActiveTuner$MH,"sdrplay_api_SwapRspDuoActiveTuner"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_SwapRspDuoActiveTuner(HANDLE dev, sdrplay_api_TunerSelectT* currentTuner, sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel); + * } + */ + public static int sdrplay_api_SwapRspDuoActiveTuner(MemorySegment dev, MemorySegment currentTuner, int tuner1AmPortSel) { + var mh$ = sdrplay_api_SwapRspDuoActiveTuner$MH(); + try { + return (int)mh$.invokeExact(dev, currentTuner, tuner1AmPortSel); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_SwapRspDuoDualTunerModeSampleRate$MH() { + return RuntimeHelper.requireNonNull(constants$10.sdrplay_api_SwapRspDuoDualTunerModeSampleRate$MH,"sdrplay_api_SwapRspDuoDualTunerModeSampleRate"); + } + /** + * {@snippet : + * sdrplay_api_ErrT sdrplay_api_SwapRspDuoDualTunerModeSampleRate(HANDLE dev, double* currentSampleRate, double newSampleRate); + * } + */ + public static int sdrplay_api_SwapRspDuoDualTunerModeSampleRate(MemorySegment dev, MemorySegment currentSampleRate, double newSampleRate) { + var mh$ = sdrplay_api_SwapRspDuoDualTunerModeSampleRate$MH(); + try { + return (int)mh$.invokeExact(dev, currentSampleRate, newSampleRate); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sdrplay_api_SwapRspDuoMode$MH() { + return RuntimeHelper.requireNonNull(constants$10.sdrplay_api_SwapRspDuoMode$MH,"sdrplay_api_SwapRspDuoMode"); + } + /** + * {@snippet : + * 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); + * } + */ + public static int sdrplay_api_SwapRspDuoMode(MemorySegment currDevice, MemorySegment deviceParams, int rspDuoMode, double sampleRate, int tuner, int bwType, int ifType, int tuner1AmPortSel) { + var mh$ = sdrplay_api_SwapRspDuoMode$MH(); + try { + return (int)mh$.invokeExact(currDevice, deviceParams, rspDuoMode, sampleRate, tuner, bwType, ifType, tuner1AmPortSel); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * #define MAX_BB_GR 59 + * } + */ + public static int MAX_BB_GR() { + return (int)59L; + } + /** + * {@snippet : + * #define SDRPLAY_API_VERSION 3.140000104904175 + * } + */ + public static float SDRPLAY_API_VERSION() { + return 3.140000104904175f; + } + /** + * {@snippet : + * #define SDRPLAY_MAX_DEVICES 16 + * } + */ + public static int SDRPLAY_MAX_DEVICES() { + return (int)16L; + } + /** + * {@snippet : + * #define SDRPLAY_MAX_TUNERS_PER_DEVICE 2 + * } + */ + public static int SDRPLAY_MAX_TUNERS_PER_DEVICE() { + return (int)2L; + } + /** + * {@snippet : + * #define SDRPLAY_MAX_SER_NO_LEN 64 + * } + */ + public static int SDRPLAY_MAX_SER_NO_LEN() { + return (int)64L; + } + /** + * {@snippet : + * #define SDRPLAY_MAX_ROOT_NM_LEN 32 + * } + */ + public static int SDRPLAY_MAX_ROOT_NM_LEN() { + return (int)32L; + } + /** + * {@snippet : + * #define SDRPLAY_RSP1_ID 1 + * } + */ + public static int SDRPLAY_RSP1_ID() { + return (int)1L; + } + /** + * {@snippet : + * #define SDRPLAY_RSP1A_ID 255 + * } + */ + public static int SDRPLAY_RSP1A_ID() { + return (int)255L; + } + /** + * {@snippet : + * #define SDRPLAY_RSP2_ID 2 + * } + */ + public static int SDRPLAY_RSP2_ID() { + return (int)2L; + } + /** + * {@snippet : + * #define SDRPLAY_RSPduo_ID 3 + * } + */ + public static int SDRPLAY_RSPduo_ID() { + return (int)3L; + } + /** + * {@snippet : + * #define SDRPLAY_RSPdx_ID 4 + * } + */ + public static int SDRPLAY_RSPdx_ID() { + return (int)4L; + } + /** + * {@snippet : + * #define SDRPLAY_RSP1B_ID 6 + * } + */ + public static int SDRPLAY_RSP1B_ID() { + return (int)6L; + } +} + + diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1/ControlRsp1.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1/ControlRsp1.java index 4577d79ed..0460d55ed 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1/ControlRsp1.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1/ControlRsp1.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,7 @@ package io.github.dsheirer.source.tuner.sdrplay.rsp1; import io.github.dsheirer.source.tuner.sdrplay.ControlRsp; +import io.github.dsheirer.source.tuner.sdrplay.api.SDRPlayException; import io.github.dsheirer.source.tuner.sdrplay.api.device.Rsp1Device; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,4 +40,37 @@ public ControlRsp1(Rsp1Device device) { super(device); } + + /** + * Maximum LNA index value as determined by frequency range using the API section 5. Gain Reduction Table values. + * @return maximum (valid) LNA index value. + */ + @Override + public int getMaximumLNASetting() + { + try + { + long frequency = getTunedFrequency(); + + if(frequency < 60_000_000) + { + return 6; + } + else if(frequency < 1_000_000_000) + { + return 9; + } + else + { + return 8; + } + + } + catch(SDRPlayException se) + { + mLog.error("Error getting tuned frequency while determining maximum LNA setting."); + } + + return 6; //Use the most restrictive setting as a default. + } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1/Rsp1TunerEditor.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1/Rsp1TunerEditor.java index b515e438f..2aedc1ed5 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1/Rsp1TunerEditor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1/Rsp1TunerEditor.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,7 +32,6 @@ import javax.swing.JComboBox; import javax.swing.JLabel; -import javax.swing.JPanel; import javax.swing.JSeparator; import javax.swing.SpinnerNumberModel; @@ -61,7 +60,7 @@ public Rsp1TunerEditor(UserPreferences userPreferences, TunerManager tunerManage private void init() { setLayout(new MigLayout("fill,wrap 3", "[right][grow,fill][fill]", - "[][][][][][][][][][][][][grow]")); + "[][][][][][][][][][][grow]")); add(new JLabel("Tuner:")); add(getTunerIdLabel(), "wrap"); @@ -79,16 +78,12 @@ private void init() add(new JLabel("Sample Rate:")); add(getSampleRateCombo(), "wrap"); - add(new JLabel("IF AGC Mode:")); - JPanel gainPanel = new JPanel(); - gainPanel.setLayout(new MigLayout("insets 0","[grow,fill][]","")); - gainPanel.add(getAgcButton()); - gainPanel.add(getGainOverloadButton()); - add(gainPanel, "wrap"); - add(new JLabel("Gain:")); - add(getGainSlider()); - add(getGainValueLabel()); + add(getGainPanel(), "wrap"); + add(new JLabel("LNA:")); + add(getLNASlider(), "wrap"); + add(new JLabel("Baseband:")); + add(getBasebandSlider(), "wrap"); add(new JSeparator(), "span,growx,push"); } @@ -139,13 +134,18 @@ protected void tunerStatusUpdated() { AgcMode current = getTunerController().getControlRsp().getAgcMode(); getAgcButton().setSelected(current == null || current.equals(AgcMode.ENABLE)); + getAgcButton().setText((current == null || current.equals(AgcMode.ENABLE)) ? AUTOMATIC : MANUAL); + getLNASlider().setLNA(getTunerController().getControlRsp().getLNA()); + getBasebandSlider().setGR(getTunerController().getControlRsp().getBasebandGainReduction()); + //Register to receive gain overload notifications getTunerController().getControlRsp().setGainOverloadListener(this); + updateGainLabel(); } - getGainSlider().setEnabled(hasTuner()); + getLNASlider().setEnabled(hasTuner()); + getBasebandSlider().setEnabled(hasTuner()); getGainValueLabel().setEnabled(hasTuner()); - getGainSlider().setValue(hasTuner() ? getTunerController().getControlRsp().getGain() : 0); setLoading(false); } @@ -160,7 +160,8 @@ public void save() getConfiguration().setFrequencyCorrection(value); getConfiguration().setAutoPPMCorrectionEnabled(getAutoPPMCheckBox().isSelected()); getConfiguration().setSampleRate((RspSampleRate)getSampleRateCombo().getSelectedItem()); - getConfiguration().setGain(getGainSlider().getValue()); + getConfiguration().setLNA(getLNASlider().getLNA()); + getConfiguration().setBasebandGainReduction(getBasebandSlider().getGR()); getConfiguration().setAgcMode(getAgcButton().isSelected() ? AgcMode.ENABLE : AgcMode.DISABLE); saveConfiguration(); diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1a/ControlRsp1a.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1a/ControlRsp1a.java index f87905e60..d42b0b2a3 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1a/ControlRsp1a.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1a/ControlRsp1a.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -118,4 +118,37 @@ public void setRfNotch(boolean enabled) throws SDRPlayException throw new SDRPlayException("Device is not initialized"); } } + + /** + * Maximum LNA index value as determined by frequency range using the API section 5. Gain Reduction Table values. + * @return maximum (valid) LNA index value. + */ + @Override + public int getMaximumLNASetting() + { + try + { + long frequency = getTunedFrequency(); + + if(frequency < 60_000_000) + { + return 6; + } + else if(frequency < 1_000_000_000) + { + return 9; + } + else + { + return 8; + } + + } + catch(SDRPlayException se) + { + mLog.error("Error getting tuned frequency while determining maximum LNA setting."); + } + + return 6; //Use the most restrictive setting as a default. + } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1a/Rsp1aTunerEditor.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1a/Rsp1aTunerEditor.java index 7bd559022..dc75cae9c 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1a/Rsp1aTunerEditor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1a/Rsp1aTunerEditor.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,7 +33,6 @@ import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JLabel; -import javax.swing.JPanel; import javax.swing.JSeparator; import javax.swing.SpinnerNumberModel; @@ -65,7 +64,7 @@ public Rsp1aTunerEditor(UserPreferences userPreferences, TunerManager tunerManag private void init() { setLayout(new MigLayout("fill,wrap 3", "[right][grow,fill][fill]", - "[][][][][][][][][][][][][grow]")); + "[][][][][][][][][][][][][][grow]")); add(new JLabel("Tuner:")); add(getTunerIdLabel(), "wrap"); @@ -83,16 +82,12 @@ private void init() add(new JLabel("Sample Rate:")); add(getSampleRateCombo(), "wrap"); - add(new JLabel("IF AGC Mode:")); - JPanel gainPanel = new JPanel(); - gainPanel.setLayout(new MigLayout("insets 0","[grow,fill][]","")); - gainPanel.add(getAgcButton()); - gainPanel.add(getGainOverloadButton()); - add(gainPanel, "wrap"); - add(new JLabel("Gain:")); - add(getGainSlider()); - add(getGainValueLabel()); + add(getGainPanel(), "wrap"); + add(new JLabel("LNA:")); + add(getLNASlider(), "wrap"); + add(new JLabel("Baseband:")); + add(getBasebandSlider(), "wrap"); add(new JSeparator(), "span,growx,push"); @@ -150,15 +145,20 @@ protected void tunerStatusUpdated() { AgcMode current = getTunerController().getControlRsp().getAgcMode(); getAgcButton().setSelected(current == null || current.equals(AgcMode.ENABLE)); + getAgcButton().setText((current == null || current.equals(AgcMode.ENABLE)) ? AUTOMATIC : MANUAL); + getLNASlider().setLNA(getTunerController().getControlRsp().getLNA()); + getBasebandSlider().setGR(getTunerController().getControlRsp().getBasebandGainReduction()); + //Register to receive gain overload notifications getTunerController().getControlRsp().setGainOverloadListener(this); + updateGainLabel(); } - getGainSlider().setEnabled(hasTuner()); + getLNASlider().setEnabled(hasTuner()); + getBasebandSlider().setEnabled(hasTuner()); getGainValueLabel().setEnabled(hasTuner()); - getGainSlider().setValue(hasTuner() ? getTunerController().getControlRsp().getGain() : 0); - getBiasTCheckBox().setEnabled(hasTuner()); + try { getBiasTCheckBox().setSelected(hasTuner() && getTunerController().getControlRsp().isBiasT()); @@ -204,7 +204,8 @@ public void save() getConfiguration().setBiasT(getBiasTCheckBox().isSelected()); getConfiguration().setRfNotch(getRfNotchCheckBox().isSelected()); getConfiguration().setRfDabNotch(getRfDabNotchCheckBox().isSelected()); - getConfiguration().setGain(getGainSlider().getValue()); + getConfiguration().setLNA(getLNASlider().getLNA()); + getConfiguration().setBasebandGainReduction(getBasebandSlider().getGR()); getConfiguration().setAgcMode(getAgcButton().isSelected() ? AgcMode.ENABLE : AgcMode.DISABLE); saveConfiguration(); @@ -345,4 +346,5 @@ else if(hasTuner()) } } + } diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/ControlRsp1b.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/ControlRsp1b.java new file mode 100644 index 000000000..c8a1e7dd5 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/ControlRsp1b.java @@ -0,0 +1,154 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +package io.github.dsheirer.source.tuner.sdrplay.rsp1b; + +import io.github.dsheirer.source.tuner.sdrplay.ControlRsp; +import io.github.dsheirer.source.tuner.sdrplay.api.SDRPlayException; +import io.github.dsheirer.source.tuner.sdrplay.api.device.Rsp1bDevice; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Control wrapper for an RSP1B Device + */ +public class ControlRsp1b extends ControlRsp implements IControlRsp1b +{ + private Logger mLog = LoggerFactory.getLogger(ControlRsp1b.class); + + /** + * Constructs an instance + * @param device for the device + */ + public ControlRsp1b(Rsp1bDevice device) + { + super(device); + } + + @Override + public boolean isBiasT() throws SDRPlayException + { + if(hasDevice()) + { + return getDevice().getTuner().isBiasT(); + } + else + { + throw new SDRPlayException("Device is not initialized"); + } + } + + @Override + public void setBiasT(boolean enabled) throws SDRPlayException + { + if(hasDevice()) + { + getDevice().getTuner().setBiasT(enabled); + } + else + { + throw new SDRPlayException("Device is not initialized"); + } + } + + @Override + public boolean isRfDabNotch() throws SDRPlayException + { + if(hasDevice()) + { + return getDevice().getTuner().isRfDabNotch(); + } + else + { + throw new SDRPlayException("Device is not initialized"); + } + } + + @Override + public void setRfDabNotch(boolean enabled) throws SDRPlayException + { + if(hasDevice()) + { + getDevice().getTuner().setRfDabNotch(enabled); + } + else + { + throw new SDRPlayException("Device is not initialized"); + } + } + + @Override + public boolean isRfNotch() throws SDRPlayException + { + if(hasDevice()) + { + return getDevice().getTuner().isRfNotch(); + } + else + { + throw new SDRPlayException("Device is not initialized"); + } + } + + @Override + public void setRfNotch(boolean enabled) throws SDRPlayException + { + if(hasDevice()) + { + getDevice().getTuner().setRfNotch(enabled); + } + else + { + throw new SDRPlayException("Device is not initialized"); + } + } + + /** + * Maximum LNA index value as determined by frequency range using the API section 5. Gain Reduction Table values. + * @return maximum (valid) LNA index value. + */ + @Override + public int getMaximumLNASetting() + { + try + { + long frequency = getTunedFrequency(); + + if(frequency < 50_000_000) + { + return 6; + } + else if(frequency < 1_000_000_000) + { + return 9; + } + else + { + return 8; + } + + } + catch(SDRPlayException se) + { + mLog.error("Error getting tuned frequency while determining maximum LNA setting."); + } + + return 6; //Use the most restrictive setting as a default. + } +} diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/DiscoveredRsp1bTuner.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/DiscoveredRsp1bTuner.java new file mode 100644 index 000000000..ba048ef88 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/DiscoveredRsp1bTuner.java @@ -0,0 +1,40 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +package io.github.dsheirer.source.tuner.sdrplay.rsp1b; + +import io.github.dsheirer.preference.source.ChannelizerType; +import io.github.dsheirer.source.tuner.sdrplay.DiscoveredRspTuner; +import io.github.dsheirer.source.tuner.sdrplay.api.device.DeviceInfo; + +/** + * RSP1B discovered tuner. + */ +public class DiscoveredRsp1bTuner extends DiscoveredRspTuner +{ + /** + * Constructs an instance + * @param deviceInfo for controlling the RSP1A after it's been started + * @param channelizerType to use for the tuner once started + */ + public DiscoveredRsp1bTuner(DeviceInfo deviceInfo, ChannelizerType channelizerType) + { + super(deviceInfo, channelizerType); + } +} diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/IControlRsp1b.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/IControlRsp1b.java new file mode 100644 index 000000000..23490edfa --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/IControlRsp1b.java @@ -0,0 +1,71 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +package io.github.dsheirer.source.tuner.sdrplay.rsp1b; + +import io.github.dsheirer.source.tuner.sdrplay.IControlRsp; +import io.github.dsheirer.source.tuner.sdrplay.api.SDRPlayException; + +/** + * Control interface for RSP1B device + */ +public interface IControlRsp1b extends IControlRsp +{ + /** + * Indicates if the Bias-T power is enabled. + * @return true if enabled. + * @throws exception if the device is no started/selected + */ + boolean isBiasT() throws SDRPlayException; + + /** + * Sets the enabled state of the Bias-T power. + * @param enabled true to power on the Bias-T + * @throws exception if the device is no started/selected + */ + void setBiasT(boolean enabled) throws SDRPlayException; + + /** + * Indicates if the RF DAB notch is enabled (DAB broadcast band filter). + * @return true if enabled. + * @throws exception if the device is no started/selected + */ + boolean isRfDabNotch() throws SDRPlayException; + + /** + * Sets the enabled state of the RF DAB notch. + * @param enabled true to filter the DAB broadcast band frequency range. + * @throws exception if the device is no started/selected + */ + void setRfDabNotch(boolean enabled) throws SDRPlayException; + + /** + * Indicates if the RF notch is enabled (FM broadcast band filter). + * @return true if enabled. + * @throws exception if the device is no started/selected + */ + boolean isRfNotch() throws SDRPlayException; + + /** + * Sets the enabled state of the RF notch + * @param enabled true to filter the FM broadcast band frequency range. + * @throws exception if the device is no started/selected + */ + void setRfNotch(boolean enabled) throws SDRPlayException; +} diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/Rsp1bTunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/Rsp1bTunerConfiguration.java new file mode 100644 index 000000000..b2c517705 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/Rsp1bTunerConfiguration.java @@ -0,0 +1,109 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +package io.github.dsheirer.source.tuner.sdrplay.rsp1b; + +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.sdrplay.RspTunerConfiguration; + +/** + * RSP1B tuner configuration + */ +public class Rsp1bTunerConfiguration extends RspTunerConfiguration +{ + private boolean mRfNotch; + private boolean mRfDabNotch; + private boolean mBiasT; + + /** + * Constructs an instance + * @param uniqueId for the tuner + */ + public Rsp1bTunerConfiguration(String uniqueId) + { + super(uniqueId); + } + + /** + * JAXB constructor + */ + public Rsp1bTunerConfiguration() + { + } + + @Override + public TunerType getTunerType() + { + return TunerType.RSP_1B; + } + + /** + * Indicates if the RF notch is enabled. + */ + @JacksonXmlProperty(isAttribute = true, localName = "rf_notch") + public boolean isRfNotch() + { + return mRfNotch; + } + + /** + * Sets the enabled state of the RF notch + * @param enabled + */ + public void setRfNotch(boolean enabled) + { + mRfNotch = enabled; + } + + /** + * Indicates if the RF Digital Audio Broadcast (DAB) notch is enabled. + */ + @JacksonXmlProperty(isAttribute = true, localName = "dab_notch") + public boolean isRfDabNotch() + { + return mRfDabNotch; + } + + /** + * Sets the enabled state of the RF DAB notch + * @param enabled + */ + public void setRfDabNotch(boolean enabled) + { + mRfDabNotch = enabled; + } + + /** + * Indicates if the Bias-T is enabled. + */ + @JacksonXmlProperty(isAttribute = true, localName = "bias_t") + public boolean isBiasT() + { + return mBiasT; + } + + /** + * Sets the enabled state of the Bias-T + */ + public void setBiasT(boolean enabled) + { + mBiasT = enabled; + } +} diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/Rsp1bTunerController.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/Rsp1bTunerController.java new file mode 100644 index 000000000..86346486c --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/Rsp1bTunerController.java @@ -0,0 +1,103 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +package io.github.dsheirer.source.tuner.sdrplay.rsp1b; + +import io.github.dsheirer.source.SourceException; +import io.github.dsheirer.source.tuner.ITunerErrorListener; +import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; +import io.github.dsheirer.source.tuner.sdrplay.RspTunerController; +import io.github.dsheirer.source.tuner.sdrplay.api.SDRPlayException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Tuner controller for RSP1b + */ +public class Rsp1bTunerController extends RspTunerController +{ + private Logger mLog = LoggerFactory.getLogger(Rsp1bTunerController.class); + + /** + * Constructs an instance + * + * @param control interface for the RSP1A tuner + * @param tunerErrorListener to monitor errors produced from this tuner controller + */ + public Rsp1bTunerController(IControlRsp1b control, ITunerErrorListener tunerErrorListener) + { + super(control, tunerErrorListener); + } + + @Override + public TunerType getTunerType() + { + return TunerType.RSP_1B; + } + + @Override + public void apply(TunerConfiguration config) throws SourceException + { + if(config instanceof Rsp1bTunerConfiguration rtc) + { + super.apply(config); + + try + { + getControlRsp().setAgcMode(rtc.getAgcMode()); + } + catch(SDRPlayException se) + { + mLog.error("Error setting RSP IF AGC Mode to " + rtc.getAgcMode()); + } + + try + { + getControlRsp().setBiasT(rtc.isBiasT()); + } + catch(SDRPlayException se) + { + mLog.error("Error setting RSP1B bias-T enabled to " + rtc.isBiasT()); + } + + try + { + getControlRsp().setRfNotch(rtc.isRfNotch()); + } + catch(SDRPlayException se) + { + mLog.error("Error setting RSP1B RF Notch enabled to " + rtc.isRfNotch()); + } + + try + { + getControlRsp().setRfDabNotch(rtc.isRfDabNotch()); + } + catch(SDRPlayException se) + { + mLog.error("Error setting RSP1B RF DAB Notch enabled to " + rtc.isRfDabNotch()); + } + } + else + { + mLog.error("Invalid RSP1B tuner configuration type: " + config.getClass()); + } + } +} diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/Rsp1bTunerEditor.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/Rsp1bTunerEditor.java new file mode 100644 index 000000000..978fe9d86 --- /dev/null +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp1b/Rsp1bTunerEditor.java @@ -0,0 +1,348 @@ +/* + * ***************************************************************************** + * Copyright (C) 2014-2024 Dennis Sheirer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * **************************************************************************** + */ + +package io.github.dsheirer.source.tuner.sdrplay.rsp1b; + +import io.github.dsheirer.preference.UserPreferences; +import io.github.dsheirer.source.tuner.manager.TunerManager; +import io.github.dsheirer.source.tuner.sdrplay.DiscoveredRspTuner; +import io.github.dsheirer.source.tuner.sdrplay.RspSampleRate; +import io.github.dsheirer.source.tuner.sdrplay.RspTunerEditor; +import io.github.dsheirer.source.tuner.sdrplay.api.SDRPlayException; +import io.github.dsheirer.source.tuner.sdrplay.api.parameter.control.AgcMode; +import net.miginfocom.swing.MigLayout; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JSeparator; +import javax.swing.SpinnerNumberModel; + +/** + * RSP1B Tuner Editor + */ +public class Rsp1bTunerEditor extends RspTunerEditor +{ + private static final Logger mLog = LoggerFactory.getLogger(Rsp1bTunerEditor.class); + + private JComboBox mSampleRateCombo; + private JCheckBox mBiasTCheckBox; + private JCheckBox mRfDabNotchCheckBox; + private JCheckBox mRfNotchCheckBox; + + /** + * Constructs an instance + * @param userPreferences for settings + * @param tunerManager for state updates + * @param discoveredTuner to edit or control. + */ + public Rsp1bTunerEditor(UserPreferences userPreferences, TunerManager tunerManager, DiscoveredRspTuner discoveredTuner) + { + super(userPreferences, tunerManager, discoveredTuner); + init(); + tunerStatusUpdated(); + } + + private void init() + { + setLayout(new MigLayout("fill,wrap 3", "[right][grow,fill][fill]", + "[][][][][][][][][][][][][][grow]")); + + add(new JLabel("Tuner:")); + add(getTunerIdLabel(), "wrap"); + + add(new JLabel("Status:")); + add(getTunerStatusLabel(), "wrap"); + + add(getButtonPanel(), "span,align left"); + + add(new JSeparator(), "span,growx,push"); + + add(new JLabel("Frequency (MHz):")); + add(getFrequencyPanel(), "wrap"); + + add(new JLabel("Sample Rate:")); + add(getSampleRateCombo(), "wrap"); + + add(new JLabel("Gain:")); + add(getGainPanel(), "wrap"); + add(new JLabel("LNA:")); + add(getLNASlider(), "wrap"); + add(new JLabel("Baseband:")); + add(getBasebandSlider(), "wrap"); + + add(new JSeparator(), "span,growx,push"); + + add(new JLabel()); + add(getBiasTCheckBox(), "wrap"); + add(new JLabel()); + add(getRfNotchCheckBox(), "wrap"); + add(new JLabel()); + add(getRfDabNotchCheckBox(), "wrap"); + } + + /** + * Access tuner controller + */ + private Rsp1bTunerController getTunerController() + { + if(hasTuner()) + { + return (Rsp1bTunerController)getTuner().getTunerController(); + } + + return null; + } + + @Override + public void setTunerLockState(boolean locked) + { + getFrequencyPanel().updateControls(); + getSampleRateCombo().setEnabled(!locked); + updateSampleRateToolTip(); + } + + @Override + protected void tunerStatusUpdated() + { + setLoading(true); + + getTunerIdLabel().setText(getDiscoveredTuner().getId()); + + String status = getDiscoveredTuner().getTunerStatus().toString(); + if(getDiscoveredTuner().hasErrorMessage()) + { + status += " - " + getDiscoveredTuner().getErrorMessage(); + } + getTunerStatusLabel().setText(status); + getButtonPanel().updateControls(); + getFrequencyPanel().updateControls(); + + getSampleRateCombo().setEnabled(hasTuner() && !getTuner().getTunerController().isLockedSampleRate()); + getSampleRateCombo().setSelectedItem(hasTuner() ? getTunerController().getControlRsp().getSampleRateEnumeration() : null); + updateSampleRateToolTip(); + + getAgcButton().setEnabled(hasTuner()); + if(hasTuner()) + { + AgcMode current = getTunerController().getControlRsp().getAgcMode(); + getAgcButton().setSelected(current == null || current.equals(AgcMode.ENABLE)); + getAgcButton().setText((current == null || current.equals(AgcMode.ENABLE)) ? AUTOMATIC : MANUAL); + getLNASlider().setLNA(getTunerController().getControlRsp().getLNA()); + getBasebandSlider().setGR(getTunerController().getControlRsp().getBasebandGainReduction()); + + //Register to receive gain overload notifications + getTunerController().getControlRsp().setGainOverloadListener(this); + updateGainLabel(); + } + + getLNASlider().setEnabled(hasTuner()); + getBasebandSlider().setEnabled(hasTuner()); + getGainValueLabel().setEnabled(hasTuner()); + getBiasTCheckBox().setEnabled(hasTuner()); + try + { + getBiasTCheckBox().setSelected(hasTuner() && getTunerController().getControlRsp().isBiasT()); + } + catch(SDRPlayException se) + { + mLog.error("Error setting Bias-T enabled state in editor"); + } + + getRfDabNotchCheckBox().setEnabled(hasTuner()); + try + { + getRfDabNotchCheckBox().setSelected(hasTuner() && getTunerController().getControlRsp().isRfDabNotch()); + } + catch(SDRPlayException se) + { + mLog.error("Error setting RF DAB Notch enabled state in editor"); + } + + getRfNotchCheckBox().setEnabled(hasTuner()); + try + { + getRfNotchCheckBox().setSelected(hasTuner() ? getTunerController().getControlRsp().isRfNotch() : false); + } + catch(SDRPlayException se) + { + mLog.error("Error setting RF Notch enabled state in editor"); + } + + setLoading(false); + } + + @Override + public void save() + { + if(hasConfiguration() && !isLoading()) + { + getConfiguration().setFrequency(getFrequencyControl().getFrequency()); + double value = ((SpinnerNumberModel) getFrequencyCorrectionSpinner().getModel()).getNumber().doubleValue(); + getConfiguration().setFrequencyCorrection(value); + getConfiguration().setAutoPPMCorrectionEnabled(getAutoPPMCheckBox().isSelected()); + getConfiguration().setSampleRate((RspSampleRate)getSampleRateCombo().getSelectedItem()); + getConfiguration().setBiasT(getBiasTCheckBox().isSelected()); + getConfiguration().setRfNotch(getRfNotchCheckBox().isSelected()); + getConfiguration().setRfDabNotch(getRfDabNotchCheckBox().isSelected()); + getConfiguration().setLNA(getLNASlider().getLNA()); + getConfiguration().setBasebandGainReduction(getBasebandSlider().getGR()); + getConfiguration().setAgcMode(getAgcButton().isSelected() ? AgcMode.ENABLE : AgcMode.DISABLE); + + saveConfiguration(); + } + } + + /** + * Sample rate selection combobox control + */ + private JComboBox getSampleRateCombo() + { + if(mSampleRateCombo == null) + { + RspSampleRate[] rspSampleRates = RspSampleRate.SINGLE_TUNER_SAMPLE_RATES.toArray(new RspSampleRate[RspSampleRate.SINGLE_TUNER_SAMPLE_RATES.size()]); + mSampleRateCombo = new JComboBox<>(rspSampleRates); + mSampleRateCombo.setEnabled(false); + mSampleRateCombo.addActionListener(e -> { + if(hasTuner() && !isLoading()) + { + RspSampleRate selected = (RspSampleRate)mSampleRateCombo.getSelectedItem(); + + try + { + getTunerController().setSampleRate(selected); + save(); + } + catch(SDRPlayException se) + { + mLog.error("Error setting sample rate for RSP1A tuner", se); + } + } + }); + } + + return mSampleRateCombo; + } + + /** + * Checkbox control for Bias-T + */ + private JCheckBox getBiasTCheckBox() + { + if(mBiasTCheckBox == null) + { + mBiasTCheckBox = new JCheckBox("Bias-T Power"); + mBiasTCheckBox.setEnabled(false); + mBiasTCheckBox.addActionListener(e -> { + if(hasTuner() && !isLoading()) + { + try + { + getTunerController().getControlRsp().setBiasT(mBiasTCheckBox.isSelected()); + save(); + } + catch(SDRPlayException se) + { + mLog.error("Unable to set RSP1B Bias-T enabled to " + mBiasTCheckBox.isSelected(), se); + } + } + }); + } + + return mBiasTCheckBox; + } + + /** + * Checkbox control for RF DAB notch + */ + private JCheckBox getRfDabNotchCheckBox() + { + if(mRfDabNotchCheckBox == null) + { + mRfDabNotchCheckBox = new JCheckBox("DAB Broadcast Band Filter (160-235 MHz)"); + mRfDabNotchCheckBox.setEnabled(false); + mRfDabNotchCheckBox.addActionListener(e -> { + if(hasTuner() && !isLoading()) + { + try + { + getTunerController().getControlRsp().setRfDabNotch(mRfDabNotchCheckBox.isSelected()); + save(); + } + catch(SDRPlayException se) + { + mLog.error("Unable to set RSP1B RF DAB notch enabled to " + mRfDabNotchCheckBox.isSelected(), se); + } + } + }); + } + + return mRfDabNotchCheckBox; + } + + /** + * Checkbox control for RF notch + */ + private JCheckBox getRfNotchCheckBox() + { + if(mRfNotchCheckBox == null) + { + mRfNotchCheckBox = new JCheckBox("FM Broadcast Band Filter (77-115 MHz)"); + mRfNotchCheckBox.setEnabled(false); + mRfNotchCheckBox.addActionListener(e -> { + if(hasTuner() && !isLoading()) + { + try + { + getTunerController().getControlRsp().setRfNotch(mRfNotchCheckBox.isSelected()); + save(); + } + catch(SDRPlayException se) + { + mLog.error("Unable to set RSP1B RF notch enabled to " + mRfNotchCheckBox.isSelected(), se); + } + } + }); + } + + return mRfNotchCheckBox; + } + + /** + * Updates the sample rate tooltip according to the tuner controller's lock state. + */ + private void updateSampleRateToolTip() + { + if(hasTuner() && getTuner().getTunerController().isLockedSampleRate()) + { + getSampleRateCombo().setToolTipText("Sample Rate is locked. Disable decoding channels to unlock."); + } + else if(hasTuner()) + { + getSampleRateCombo().setToolTipText("Select a sample rate for the tuner"); + } + else + { + getSampleRateCombo().setToolTipText("No tuner available"); + } + } + +} diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp2/ControlRsp2.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp2/ControlRsp2.java index 9aaee22ff..75df38467 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp2/ControlRsp2.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp2/ControlRsp2.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,6 +22,7 @@ import io.github.dsheirer.source.tuner.sdrplay.ControlRsp; import io.github.dsheirer.source.tuner.sdrplay.api.SDRPlayException; import io.github.dsheirer.source.tuner.sdrplay.api.device.Rsp2Device; +import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp2AmPort; import io.github.dsheirer.source.tuner.sdrplay.api.parameter.tuner.Rsp2AntennaSelection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -141,4 +142,38 @@ public void setAntennaSelection(Rsp2AntennaSelection selection) throws SDRPlayEx throw new SDRPlayException("Device is not initialized"); } } + + /** + * Maximum LNA index value as determined by frequency range using the API section 5. Gain Reduction Table values. + * @return maximum (valid) LNA index value. + */ + @Override + public int getMaximumLNASetting() + { + try + { + long frequency = getTunedFrequency(); + Rsp2AmPort port = getAntennaSelection().getAmPort(); + + if(port == Rsp2AmPort.PORT_1_HIGH_Z) + { + return 4; + } + + if(frequency < 420_000_000) + { + return 8; + } + else + { + return 5; + } + } + catch(SDRPlayException se) + { + mLog.error("Error getting tuned frequency while determining maximum LNA setting."); + } + + return 4; //Use the most restrictive setting as a default. + } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp2/Rsp2TunerEditor.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp2/Rsp2TunerEditor.java index fd31388df..4403d20d9 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp2/Rsp2TunerEditor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rsp2/Rsp2TunerEditor.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,7 +34,6 @@ import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JLabel; -import javax.swing.JPanel; import javax.swing.JSeparator; import javax.swing.SpinnerNumberModel; @@ -67,7 +66,7 @@ public Rsp2TunerEditor(UserPreferences userPreferences, TunerManager tunerManage private void init() { setLayout(new MigLayout("fill,wrap 3", "[right][grow,fill][fill]", - "[][][][][][][][][][][][][grow]")); + "[][][][][][][][][][][][][][][grow]")); add(new JLabel("Tuner:")); add(getTunerIdLabel(), "wrap"); @@ -85,16 +84,12 @@ private void init() add(new JLabel("Sample Rate:")); add(getSampleRateCombo(), "wrap"); - add(new JLabel("IF AGC Mode:")); - JPanel gainPanel = new JPanel(); - gainPanel.setLayout(new MigLayout("insets 0","[grow,fill][]","")); - gainPanel.add(getAgcButton()); - gainPanel.add(getGainOverloadButton()); - add(gainPanel, "wrap"); - add(new JLabel("Gain:")); - add(getGainSlider()); - add(getGainValueLabel()); + add(getGainPanel(), "wrap"); + add(new JLabel("LNA:")); + add(getLNASlider(), "wrap"); + add(new JLabel("Baseband:")); + add(getBasebandSlider(), "wrap"); add(new JSeparator(), "span,growx,push"); @@ -154,13 +149,18 @@ protected void tunerStatusUpdated() { AgcMode current = getTunerController().getControlRsp().getAgcMode(); getAgcButton().setSelected(current == null || current.equals(AgcMode.ENABLE)); + getAgcButton().setText((current == null || current.equals(AgcMode.ENABLE)) ? AUTOMATIC : MANUAL); + getLNASlider().setLNA(getTunerController().getControlRsp().getLNA()); + getBasebandSlider().setGR(getTunerController().getControlRsp().getBasebandGainReduction()); + //Register to receive gain overload notifications getTunerController().getControlRsp().setGainOverloadListener(this); + updateGainLabel(); } - getGainSlider().setEnabled(hasTuner()); + getLNASlider().setEnabled(hasTuner()); + getBasebandSlider().setEnabled(hasTuner()); getGainValueLabel().setEnabled(hasTuner()); - getGainSlider().setValue(hasTuner() ? getTunerController().getControlRsp().getGain() : 0); getBiasTCheckBox().setEnabled(hasTuner()); try @@ -218,7 +218,8 @@ public void save() getConfiguration().setBiasT(getBiasTCheckBox().isSelected()); getConfiguration().setRfNotch(getRfNotchCheckBox().isSelected()); getConfiguration().setAntennaSelection((Rsp2AntennaSelection)getAntennaSelectionCombo().getSelectedItem()); - getConfiguration().setGain(getGainSlider().getValue()); + getConfiguration().setLNA(getLNASlider().getLNA()); + getConfiguration().setBasebandGainReduction(getBasebandSlider().getGR()); getConfiguration().setAgcMode(getAgcButton().isSelected() ? AgcMode.ENABLE : AgcMode.DISABLE); saveConfiguration(); diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuo.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuo.java index 1e12ca597..14c8c9a3c 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuo.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuo.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ package io.github.dsheirer.source.tuner.sdrplay.rspDuo; import io.github.dsheirer.source.tuner.sdrplay.ControlRsp; -import io.github.dsheirer.source.tuner.sdrplay.IGainOverloadListener; +import io.github.dsheirer.source.tuner.sdrplay.ITunerStatusListener; import io.github.dsheirer.source.tuner.sdrplay.RspSampleRate; import io.github.dsheirer.source.tuner.sdrplay.api.DeviceSelectionMode; import io.github.dsheirer.source.tuner.sdrplay.api.SDRPlayException; @@ -211,20 +211,14 @@ public void setSampleRate(RspSampleRate sampleRate) throws SDRPlayException } } - /** - * Sets the gain index - * @param gain index value (0 - 28) - * @throws SDRPlayException for errors setting gain value. - */ @Override - public void setGain(int gain) throws SDRPlayException + public void setGain(int lna, int gr) throws SDRPlayException { - validateGain(gain); - - if(gain != mGain) + if(mLNA != lna && mBasebandGainReduction != gr) { - mGain = gain; - getTuner().setGain(mGain); + mLNA = lna; + mBasebandGainReduction = gr; + getTuner().setGain(lna, gr); } } @@ -243,7 +237,7 @@ public void acknowledgePowerOverload(TunerSelect tunerSelect) throws SDRPlayExce //Notify an optional weakly referenced, registered listener that gain overload has been acknowledged. if(mGainOverloadReference != null) { - IGainOverloadListener listener = mGainOverloadReference.get(); + ITunerStatusListener listener = mGainOverloadReference.get(); if(listener != null) { diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuoTuner1.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuoTuner1.java index c716f6bbd..ac175a7ee 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuoTuner1.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuoTuner1.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -130,4 +130,43 @@ public void setAmPort(RspDuoAmPort port) throws SDRPlayException throw new SDRPlayException("Device is not initialized"); } } + + /** + * Maximum LNA index value as determined by frequency range using the API section 5. Gain Reduction Table values. + * @return maximum (valid) LNA index value. + */ + @Override + public int getMaximumLNASetting() + { + try + { + long frequency = getTunedFrequency(); + RspDuoAmPort port = getAmPort(); + + if(port == RspDuoAmPort.PORT_1) //Hi-Z Port + { + return 4; + } + + if(frequency < 60_000_000) + { + return 6; + } + else if(frequency < 1_000_000_000) + { + return 9; + } + else + { + return 6; + } + + } + catch(SDRPlayException se) + { + mLog.error("Error getting tuned frequency while determining maximum LNA setting."); + } + + return 4; //Use the most restrictive setting as a default. + } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuoTuner1Master.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuoTuner1Master.java index 744af5dff..b5e484c19 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuoTuner1Master.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuoTuner1Master.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuoTuner2.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuoTuner2.java index 942e1c733..d34091fb5 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuoTuner2.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/ControlRspDuoTuner2.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -126,4 +126,37 @@ public void setAgcMode(AgcMode mode) throws SDRPlayException getDevice().getCompositeParameters().getControlBParameters().getAgc().setAgcMode(mode); getDevice().update(getTunerSelect(), UpdateReason.CONTROL_AGC); } + + /** + * Maximum LNA index value as determined by frequency range using the API section 5. Gain Reduction Table values. + * @return maximum (valid) LNA index value. + */ + @Override + public int getMaximumLNASetting() + { + try + { + long frequency = getTunedFrequency(); + + if(frequency < 60_000_000) + { + return 6; + } + else if(frequency < 1_000_000_000) + { + return 9; + } + else + { + return 6; + } + + } + catch(SDRPlayException se) + { + mLog.error("Error getting tuned frequency while determining maximum LNA setting."); + } + + return 4; //Use the most restrictive setting as a default. + } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/RspDuoTuner1Editor.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/RspDuoTuner1Editor.java index 2afe04767..607adc77f 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/RspDuoTuner1Editor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/RspDuoTuner1Editor.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -94,16 +94,12 @@ private void init() add(new JLabel("Sample Rate:")); add(getSampleRateCombo(), "wrap"); - add(new JLabel("IF AGC Mode:")); - JPanel gainPanel = new JPanel(); - gainPanel.setLayout(new MigLayout("insets 0","[grow,fill][]","")); - gainPanel.add(getAgcButton()); - gainPanel.add(getGainOverloadButton()); - add(gainPanel, "wrap"); - add(new JLabel("Gain:")); - add(getGainSlider()); - add(getGainValueLabel()); + add(getGainPanel(), "wrap"); + add(new JLabel("LNA:")); + add(getLNASlider(), "wrap"); + add(new JLabel("Baseband:")); + add(getBasebandSlider(), "wrap"); add(new JSeparator(), "span,growx,push"); @@ -170,13 +166,18 @@ protected void tunerStatusUpdated() { AgcMode current = getTunerController().getControlRsp().getAgcMode(); getAgcButton().setSelected(current == null || current.equals(AgcMode.ENABLE)); + getAgcButton().setText((current == null || current.equals(AgcMode.ENABLE)) ? AUTOMATIC : MANUAL); + getLNASlider().setLNA(getTunerController().getControlRsp().getLNA()); + getBasebandSlider().setGR(getTunerController().getControlRsp().getBasebandGainReduction()); + //Register to receive gain overload notifications getTunerController().getControlRsp().setGainOverloadListener(this); + updateGainLabel(); } - getGainSlider().setEnabled(hasTuner()); + getLNASlider().setEnabled(hasTuner()); + getBasebandSlider().setEnabled(hasTuner()); getGainValueLabel().setEnabled(hasTuner()); - getGainSlider().setValue(hasTuner() ? getTunerController().getControlRsp().getGain() : 0); getAmPortCombo().setEnabled(hasTuner() && !getTuner().getTunerController().isLockedSampleRate()); try @@ -247,7 +248,8 @@ public void save() getConfiguration().setExternalReferenceOutput(getExternalReferenceOutputCheckBox().isSelected()); getConfiguration().setRfDabNotch(getRfDabNotchCheckBox().isSelected()); getConfiguration().setRfNotch(getRfNotchCheckBox().isSelected()); - getConfiguration().setGain(getGainSlider().getValue()); + getConfiguration().setLNA(getLNASlider().getLNA()); + getConfiguration().setBasebandGainReduction(getBasebandSlider().getGR()); getConfiguration().setAgcMode(getAgcButton().isSelected() ? AgcMode.ENABLE : AgcMode.DISABLE); saveConfiguration(); diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/RspDuoTuner2Editor.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/RspDuoTuner2Editor.java index 274734aaa..7001df1ee 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/RspDuoTuner2Editor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDuo/RspDuoTuner2Editor.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -92,16 +92,12 @@ private void init() add(new JLabel("Sample Rate:")); add(getSampleRateCombo(), "wrap"); - add(new JLabel("IF AGC Mode:")); - JPanel gainPanel = new JPanel(); - gainPanel.setLayout(new MigLayout("insets 0","[grow,fill][]","")); - gainPanel.add(getAgcButton()); - gainPanel.add(getGainOverloadButton()); - add(gainPanel, "wrap"); - add(new JLabel("Gain:")); - add(getGainSlider()); - add(getGainValueLabel()); + add(getGainPanel(), "wrap"); + add(new JLabel("LNA:")); + add(getLNASlider(), "wrap"); + add(new JLabel("Baseband:")); + add(getBasebandSlider(), "wrap"); add(new JSeparator(), "span,growx,push"); @@ -187,13 +183,18 @@ protected void tunerStatusUpdated() { AgcMode current = getTunerController().getControlRsp().getAgcMode(); getAgcButton().setSelected(current == null || current.equals(AgcMode.ENABLE)); + getAgcButton().setText((current == null || current.equals(AgcMode.ENABLE)) ? AUTOMATIC : MANUAL); + getLNASlider().setLNA(getTunerController().getControlRsp().getLNA()); + getBasebandSlider().setGR(getTunerController().getControlRsp().getBasebandGainReduction()); + //Register to receive gain overload notifications getTunerController().getControlRsp().setGainOverloadListener(this); + updateGainLabel(); } - getGainSlider().setEnabled(hasTuner()); + getLNASlider().setEnabled(hasTuner()); + getBasebandSlider().setEnabled(hasTuner()); getGainValueLabel().setEnabled(hasTuner()); - getGainSlider().setValue(hasTuner() ? getTunerController().getControlRsp().getGain() : 0); getRfDabNotchCheckBox().setEnabled(hasTuner()); try @@ -259,7 +260,8 @@ public void save() } getConfiguration().setRfDabNotch(getRfDabNotchCheckBox().isSelected()); getConfiguration().setRfNotch(getRfNotchCheckBox().isSelected()); - getConfiguration().setGain(getGainSlider().getValue()); + getConfiguration().setLNA(getLNASlider().getLNA()); + getConfiguration().setBasebandGainReduction(getBasebandSlider().getGR()); getConfiguration().setAgcMode(getAgcButton().isSelected() ? AgcMode.ENABLE : AgcMode.DISABLE); saveConfiguration(); diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDx/ControlRspDx.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDx/ControlRspDx.java index faede4d2f..5de7c7920 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDx/ControlRspDx.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDx/ControlRspDx.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -198,4 +198,52 @@ public HdrModeBandwidth getHdrModeBandwidth() throws SDRPlayException throw new SDRPlayException("Device is not initialized"); } } + + /** + * Maximum LNA index value as determined by frequency range using the API section 5. Gain Reduction Table values. + * @return maximum (valid) LNA index value. + */ + @Override + public int getMaximumLNASetting() + { + try + { + long frequency = getTunedFrequency(); + + if(frequency < 12_000_000) + { + return 21; + } + else if(frequency < 50_000_000) + { + return 19; + } + else if(frequency < 60_000_000) + { + return 24; + } + else if(frequency < 250_000_000) + { + return 26; + } + else if(frequency < 420_000_000) + { + return 27; + } + else if(frequency < 1_000_000_000) + { + return 20; + } + else + { + return 18; + } + } + catch(SDRPlayException se) + { + mLog.error("Error getting tuned frequency while determining maximum LNA setting."); + } + + return 18; //Use the most restrictive setting as a default. + } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDx/RspDxTunerEditor.java b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDx/RspDxTunerEditor.java index 7ee122dde..87f078205 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDx/RspDxTunerEditor.java +++ b/src/main/java/io/github/dsheirer/source/tuner/sdrplay/rspDx/RspDxTunerEditor.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,7 +35,6 @@ import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JLabel; -import javax.swing.JPanel; import javax.swing.JSeparator; import javax.swing.SpinnerNumberModel; @@ -70,7 +69,7 @@ public RspDxTunerEditor(UserPreferences userPreferences, TunerManager tunerManag private void init() { setLayout(new MigLayout("fill,wrap 3", "[right][grow,fill][fill]", - "[][][][][][][][][][][][grow]")); + "[][][][][][][][][][][][][][][][][][grow]")); add(new JLabel("Tuner:")); add(getTunerIdLabel(), "wrap"); @@ -88,16 +87,12 @@ private void init() add(new JLabel("Sample Rate:")); add(getSampleRateCombo(), "wrap"); - add(new JLabel("IF AGC Mode:")); - JPanel gainPanel = new JPanel(); - gainPanel.setLayout(new MigLayout("insets 0","[grow,fill][]","")); - gainPanel.add(getAgcButton()); - gainPanel.add(getGainOverloadButton()); - add(gainPanel, "wrap"); - add(new JLabel("Gain:")); - add(getGainSlider()); - add(getGainValueLabel()); + add(getGainPanel(), "wrap"); + add(new JLabel("LNA:")); + add(getLNASlider(), "wrap"); + add(new JLabel("Baseband:")); + add(getBasebandSlider(), "wrap"); add(new JSeparator(), "span,growx,push"); @@ -163,13 +158,18 @@ protected void tunerStatusUpdated() { AgcMode current = getTunerController().getControlRsp().getAgcMode(); getAgcButton().setSelected(current == null || current.equals(AgcMode.ENABLE)); + getAgcButton().setText((current == null || current.equals(AgcMode.ENABLE)) ? AUTOMATIC : MANUAL); + getLNASlider().setLNA(getTunerController().getControlRsp().getLNA()); + getBasebandSlider().setGR(getTunerController().getControlRsp().getBasebandGainReduction()); + //Register to receive gain overload notifications getTunerController().getControlRsp().setGainOverloadListener(this); + updateGainLabel(); } - getGainSlider().setEnabled(hasTuner()); + getLNASlider().setEnabled(hasTuner()); + getBasebandSlider().setEnabled(hasTuner()); getGainValueLabel().setEnabled(hasTuner()); - getGainSlider().setValue(hasTuner() ? getTunerController().getControlRsp().getGain() : 0); getBiasTCheckBox().setEnabled(hasTuner()); try @@ -239,7 +239,8 @@ public void save() getConfiguration().setRfDabNotch(getRfNotchCheckBox().isSelected()); getConfiguration().setRfNotch(getRfNotchCheckBox().isSelected()); getConfiguration().setAntenna((RspDxAntenna) getAntennaCombo().getSelectedItem()); - getConfiguration().setGain(getGainSlider().getValue()); + getConfiguration().setLNA(getLNASlider().getLNA()); + getConfiguration().setBasebandGainReduction(getBasebandSlider().getGR()); getConfiguration().setAgcMode(getAgcButton().isSelected() ? AgcMode.ENABLE : AgcMode.DISABLE); saveConfiguration();