mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 17:17:29 -05:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59e74d70b4 | ||
|
|
8d6b7c3ac8 | ||
|
|
372d2ff870 | ||
|
|
32a8363b45 | ||
|
|
87f1f8986f | ||
|
|
b3c08053fb | ||
|
|
a5208dcf1e | ||
|
|
2782953518 | ||
|
|
366055145e | ||
|
|
39ebdb47b1 | ||
|
|
c788292db8 | ||
|
|
f0dc80437c | ||
|
|
2d6c5c2331 | ||
|
|
bc4e6cb5b0 | ||
|
|
d69ad46c10 | ||
|
|
ba7b616f88 | ||
|
|
8355b7e3b9 | ||
|
|
22ffb656be | ||
|
|
de80d2a6c1 | ||
|
|
a320b4a24f | ||
|
|
fc13777211 | ||
|
|
75347f9d0a |
38
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
38
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
name: Bug Report
|
||||||
|
about: Create a report to help us improve sdrtrunk
|
||||||
|
title: ''
|
||||||
|
labels: bug
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**sdrtrunk Version**
|
||||||
|
Indicate which sdrtrunk version you are using. Use 'master-branch' if you are running the latest code.
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Application Log**
|
||||||
|
If applicable, include either the full application log,or a snippet of the error logging.
|
||||||
|
|
||||||
|
**Desktop (optional - complete the following information):**
|
||||||
|
- OS: [e.g. iOS]
|
||||||
|
- CPU Cores: [e.g. 4 cores]
|
||||||
|
- RAM:[e.g. 16GB]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: feature
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
16
.github/ISSUE_TEMPLATE/how-to-question-or-does-the-software-support-xxx.md
vendored
Normal file
16
.github/ISSUE_TEMPLATE/how-to-question-or-does-the-software-support-xxx.md
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
name: How-To Question or Does The Software Support xxx
|
||||||
|
about: End user question or support discussion
|
||||||
|
title: STOP - Don't Use Issue Reporting to Post End-User Questions!!!
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
STOP !!!!
|
||||||
|
|
||||||
|
GitHub issues are for reporting software bugs or requesting enhancements.
|
||||||
|
|
||||||
|
If you have a question about how to use the software, or if you want to know if sdrtrunk supports a protocol, tuner, or other aspect, please post your question in one of the Support forums.
|
||||||
|
|
||||||
|
Visit: https://github.com/DSheirer/sdrtrunk/wiki
|
||||||
4
.github/workflows/gradle.yml
vendored
4
.github/workflows/gradle.yml
vendored
@@ -22,10 +22,10 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 19
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
java-version: '17'
|
java-version: '19'
|
||||||
distribution: 'liberica'
|
distribution: 'liberica'
|
||||||
java-package: 'jdk+fx'
|
java-package: 'jdk+fx'
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
|
|||||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
|||||||
<component name="FrameworkDetectionExcludesConfiguration">
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
<file type="web" url="file://$PROJECT_DIR$" />
|
<file type="web" url="file://$PROJECT_DIR$" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="liberica-19.0.1.fx" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_19_PREVIEW" project-jdk-name="liberica-19.0.1.fx" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
36
artifacts/sdrplay-api-headers/README.txt
Normal file
36
artifacts/sdrplay-api-headers/README.txt
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
Auto-generating Java code from SDRPlay API using jextract.
|
||||||
|
|
||||||
|
Note: the api headers in the 3.11 folder are equivalent to the 3.08 headers. The only
|
||||||
|
difference from the 3.07 headers is the addition of the boolean 'valid' flag to DeviceT structure.
|
||||||
|
|
||||||
|
1. Download JDK19 compatible build of jextract JDK: https://jdk.java.net/jextract/
|
||||||
|
2. If generating on windows platform, modify the sdrplay_api.h to remove the windows
|
||||||
|
pieces of the file. Specifically:
|
||||||
|
2a. Comment out these lines but leave the *HANDLE typedef:
|
||||||
|
|
||||||
|
//#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
|
||||||
|
|
||||||
|
2b. Remove the '_SDRPLAY_DLL_QUALIFIER' from in front of the method declarations
|
||||||
|
|
||||||
|
2c. Change the 3.11 version string to 3.08 either in the header file, or in the generated java class
|
||||||
|
|
||||||
|
3. Open command prompt to the root source code where the generated files should be placed:
|
||||||
|
..\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
|
||||||
|
|
||||||
|
5. Do this for all versions of the API.
|
||||||
|
|
||||||
229
artifacts/sdrplay-api-headers/v3_07/sdrplay_api.h
Normal file
229
artifacts/sdrplay-api-headers/v3_07/sdrplay_api.h
Normal file
@@ -0,0 +1,229 @@
|
|||||||
|
#ifndef SDRPLAY_API_H
|
||||||
|
#define SDRPLAY_API_H
|
||||||
|
|
||||||
|
#include "sdrplay_api_dev.h"
|
||||||
|
#include "sdrplay_api_rx_channel.h"
|
||||||
|
#include "sdrplay_api_callback.h"
|
||||||
|
|
||||||
|
//#if defined(_M_X64) || defined(_M_IX86)
|
||||||
|
//#include "windows.h"
|
||||||
|
//#elif defined (__GNUC__)
|
||||||
|
typedef void *HANDLE;
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
//#ifndef _SDRPLAY_DLL_QUALIFIER
|
||||||
|
//#if !defined(STATIC_LIB) && (defined(_M_X64) || defined(_M_IX86))
|
||||||
|
//#define _SDRPLAY_DLL_QUALIFIER __declspec(dllimport)
|
||||||
|
//#elif defined(STATIC_LIB) || defined(__GNUC__)
|
||||||
|
//#define _SDRPLAY_DLL_QUALIFIER
|
||||||
|
//#endif
|
||||||
|
//#endif // _SDRPLAY_DLL_QUALIFIER
|
||||||
|
|
||||||
|
// Application code should check that it is compiled against the same API version
|
||||||
|
// sdrplay_api_ApiVersion() returns the API version
|
||||||
|
#define SDRPLAY_API_VERSION (float)(3.07)
|
||||||
|
|
||||||
|
// API Constants
|
||||||
|
#define SDRPLAY_MAX_DEVICES (16)
|
||||||
|
#define SDRPLAY_MAX_TUNERS_PER_DEVICE (2)
|
||||||
|
|
||||||
|
#define SDRPLAY_MAX_SER_NO_LEN (64)
|
||||||
|
#define SDRPLAY_MAX_ROOT_NM_LEN (32)
|
||||||
|
|
||||||
|
#define SDRPLAY_RSP1_ID (1)
|
||||||
|
#define SDRPLAY_RSP1A_ID (255)
|
||||||
|
#define SDRPLAY_RSP2_ID (2)
|
||||||
|
#define SDRPLAY_RSPduo_ID (3)
|
||||||
|
#define SDRPLAY_RSPdx_ID (4)
|
||||||
|
|
||||||
|
// Enum types
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Success = 0,
|
||||||
|
sdrplay_api_Fail = 1,
|
||||||
|
sdrplay_api_InvalidParam = 2,
|
||||||
|
sdrplay_api_OutOfRange = 3,
|
||||||
|
sdrplay_api_GainUpdateError = 4,
|
||||||
|
sdrplay_api_RfUpdateError = 5,
|
||||||
|
sdrplay_api_FsUpdateError = 6,
|
||||||
|
sdrplay_api_HwError = 7,
|
||||||
|
sdrplay_api_AliasingError = 8,
|
||||||
|
sdrplay_api_AlreadyInitialised = 9,
|
||||||
|
sdrplay_api_NotInitialised = 10,
|
||||||
|
sdrplay_api_NotEnabled = 11,
|
||||||
|
sdrplay_api_HwVerError = 12,
|
||||||
|
sdrplay_api_OutOfMemError = 13,
|
||||||
|
sdrplay_api_ServiceNotResponding = 14,
|
||||||
|
sdrplay_api_StartPending = 15,
|
||||||
|
sdrplay_api_StopPending = 16,
|
||||||
|
sdrplay_api_InvalidMode = 17,
|
||||||
|
sdrplay_api_FailedVerification1 = 18,
|
||||||
|
sdrplay_api_FailedVerification2 = 19,
|
||||||
|
sdrplay_api_FailedVerification3 = 20,
|
||||||
|
sdrplay_api_FailedVerification4 = 21,
|
||||||
|
sdrplay_api_FailedVerification5 = 22,
|
||||||
|
sdrplay_api_FailedVerification6 = 23,
|
||||||
|
sdrplay_api_InvalidServiceVersion = 24
|
||||||
|
} sdrplay_api_ErrT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Update_None = 0x00000000,
|
||||||
|
|
||||||
|
// Reasons for master only mode
|
||||||
|
sdrplay_api_Update_Dev_Fs = 0x00000001,
|
||||||
|
sdrplay_api_Update_Dev_Ppm = 0x00000002,
|
||||||
|
sdrplay_api_Update_Dev_SyncUpdate = 0x00000004,
|
||||||
|
sdrplay_api_Update_Dev_ResetFlags = 0x00000008,
|
||||||
|
|
||||||
|
sdrplay_api_Update_Rsp1a_BiasTControl = 0x00000010,
|
||||||
|
sdrplay_api_Update_Rsp1a_RfNotchControl = 0x00000020,
|
||||||
|
sdrplay_api_Update_Rsp1a_RfDabNotchControl = 0x00000040,
|
||||||
|
|
||||||
|
sdrplay_api_Update_Rsp2_BiasTControl = 0x00000080,
|
||||||
|
sdrplay_api_Update_Rsp2_AmPortSelect = 0x00000100,
|
||||||
|
sdrplay_api_Update_Rsp2_AntennaControl = 0x00000200,
|
||||||
|
sdrplay_api_Update_Rsp2_RfNotchControl = 0x00000400,
|
||||||
|
sdrplay_api_Update_Rsp2_ExtRefControl = 0x00000800,
|
||||||
|
|
||||||
|
sdrplay_api_Update_RspDuo_ExtRefControl = 0x00001000,
|
||||||
|
|
||||||
|
sdrplay_api_Update_Master_Spare_1 = 0x00002000,
|
||||||
|
sdrplay_api_Update_Master_Spare_2 = 0x00004000,
|
||||||
|
|
||||||
|
// Reasons for master and slave mode
|
||||||
|
// Note: sdrplay_api_Update_Tuner_Gr MUST be the first value defined in this section!
|
||||||
|
sdrplay_api_Update_Tuner_Gr = 0x00008000,
|
||||||
|
sdrplay_api_Update_Tuner_GrLimits = 0x00010000,
|
||||||
|
sdrplay_api_Update_Tuner_Frf = 0x00020000,
|
||||||
|
sdrplay_api_Update_Tuner_BwType = 0x00040000,
|
||||||
|
sdrplay_api_Update_Tuner_IfType = 0x00080000,
|
||||||
|
sdrplay_api_Update_Tuner_DcOffset = 0x00100000,
|
||||||
|
sdrplay_api_Update_Tuner_LoMode = 0x00200000,
|
||||||
|
|
||||||
|
sdrplay_api_Update_Ctrl_DCoffsetIQimbalance = 0x00400000,
|
||||||
|
sdrplay_api_Update_Ctrl_Decimation = 0x00800000,
|
||||||
|
sdrplay_api_Update_Ctrl_Agc = 0x01000000,
|
||||||
|
sdrplay_api_Update_Ctrl_AdsbMode = 0x02000000,
|
||||||
|
sdrplay_api_Update_Ctrl_OverloadMsgAck = 0x04000000,
|
||||||
|
|
||||||
|
sdrplay_api_Update_RspDuo_BiasTControl = 0x08000000,
|
||||||
|
sdrplay_api_Update_RspDuo_AmPortSelect = 0x10000000,
|
||||||
|
sdrplay_api_Update_RspDuo_Tuner1AmNotchControl = 0x20000000,
|
||||||
|
sdrplay_api_Update_RspDuo_RfNotchControl = 0x40000000,
|
||||||
|
sdrplay_api_Update_RspDuo_RfDabNotchControl = 0x80000000,
|
||||||
|
} sdrplay_api_ReasonForUpdateT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Update_Ext1_None = 0x00000000,
|
||||||
|
|
||||||
|
// Reasons for master only mode
|
||||||
|
sdrplay_api_Update_RspDx_HdrEnable = 0x00000001,
|
||||||
|
sdrplay_api_Update_RspDx_BiasTControl = 0x00000002,
|
||||||
|
sdrplay_api_Update_RspDx_AntennaControl = 0x00000004,
|
||||||
|
sdrplay_api_Update_RspDx_RfNotchControl = 0x00000008,
|
||||||
|
sdrplay_api_Update_RspDx_RfDabNotchControl = 0x00000010,
|
||||||
|
sdrplay_api_Update_RspDx_HdrBw = 0x00000020,
|
||||||
|
|
||||||
|
// Reasons for master and slave mode
|
||||||
|
} sdrplay_api_ReasonForUpdateExtension1T;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_DbgLvl_Disable = 0,
|
||||||
|
sdrplay_api_DbgLvl_Verbose = 1,
|
||||||
|
sdrplay_api_DbgLvl_Warning = 2,
|
||||||
|
sdrplay_api_DbgLvl_Error = 3,
|
||||||
|
sdrplay_api_DbgLvl_Message = 4,
|
||||||
|
} sdrplay_api_DbgLvl_t;
|
||||||
|
|
||||||
|
// Device structure
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
char SerNo[SDRPLAY_MAX_SER_NO_LEN];
|
||||||
|
unsigned char hwVer;
|
||||||
|
sdrplay_api_TunerSelectT tuner;
|
||||||
|
sdrplay_api_RspDuoModeT rspDuoMode;
|
||||||
|
double rspDuoSampleFreq;
|
||||||
|
HANDLE dev;
|
||||||
|
} sdrplay_api_DeviceT;
|
||||||
|
|
||||||
|
// Device parameter structure
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_DevParamsT *devParams;
|
||||||
|
sdrplay_api_RxChannelParamsT *rxChannelA;
|
||||||
|
sdrplay_api_RxChannelParamsT *rxChannelB;
|
||||||
|
} sdrplay_api_DeviceParamsT;
|
||||||
|
|
||||||
|
// Extended error message structure
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
char file[256];
|
||||||
|
char function[256];
|
||||||
|
int line;
|
||||||
|
char message[1024];
|
||||||
|
} sdrplay_api_ErrorInfoT;
|
||||||
|
|
||||||
|
// Comman API function types
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_Open_t)(void);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_Close_t)(void);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_ApiVersion_t)(float *apiVer);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_LockDeviceApi_t)(void);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_UnlockDeviceApi_t)(void);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_GetDevices_t)(sdrplay_api_DeviceT *devices, unsigned int *numDevs, unsigned int maxDevs);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_SelectDevice_t)(sdrplay_api_DeviceT *device);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_ReleaseDevice_t)(sdrplay_api_DeviceT *device);
|
||||||
|
typedef const char* (*sdrplay_api_GetErrorString_t)(sdrplay_api_ErrT err);
|
||||||
|
typedef sdrplay_api_ErrorInfoT* (*sdrplay_api_GetLastError_t)(sdrplay_api_DeviceT *device);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_DisableHeartbeat_t)(void);
|
||||||
|
|
||||||
|
// Device API function types
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_DebugEnable_t)(HANDLE dev, sdrplay_api_DbgLvl_t dbgLvl);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_GetDeviceParams_t)(HANDLE dev, sdrplay_api_DeviceParamsT **deviceParams);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_Init_t)(HANDLE dev, sdrplay_api_CallbackFnsT *callbackFns, void *cbContext);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_Uninit_t)(HANDLE dev);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_Update_t)(HANDLE dev, sdrplay_api_TunerSelectT tuner, sdrplay_api_ReasonForUpdateT reasonForUpdate, sdrplay_api_ReasonForUpdateExtension1T reasonForUpdateExt1);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_SwapRspDuoActiveTuner_t)(HANDLE dev, sdrplay_api_TunerSelectT *tuner, sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t)(double *currentSampleRate);
|
||||||
|
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_api_ErrT sdrplay_api_Open(void);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_Close(void);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_ApiVersion(float *apiVer);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_LockDeviceApi(void);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_UnlockDeviceApi(void);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_GetDevices(sdrplay_api_DeviceT *devices, unsigned int *numDevs, unsigned int maxDevs);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_SelectDevice(sdrplay_api_DeviceT *device);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_ReleaseDevice(sdrplay_api_DeviceT *device);
|
||||||
|
const char* sdrplay_api_GetErrorString(sdrplay_api_ErrT err);
|
||||||
|
sdrplay_api_ErrorInfoT* sdrplay_api_GetLastError(sdrplay_api_DeviceT *device);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_DisableHeartbeat(void); // Must be called before sdrplay_api_SelectDevice()
|
||||||
|
|
||||||
|
// Device API function definitions
|
||||||
|
sdrplay_api_ErrT sdrplay_api_DebugEnable(HANDLE dev, sdrplay_api_DbgLvl_t enable);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_GetDeviceParams(HANDLE dev, sdrplay_api_DeviceParamsT **deviceParams);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_Init(HANDLE dev, sdrplay_api_CallbackFnsT *callbackFns, void *cbContext);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_Uninit(HANDLE dev);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_Update(HANDLE dev, sdrplay_api_TunerSelectT tuner, sdrplay_api_ReasonForUpdateT reasonForUpdate, sdrplay_api_ReasonForUpdateExtension1T reasonForUpdateExt1);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_SwapRspDuoActiveTuner(HANDLE dev, sdrplay_api_TunerSelectT *currentTuner, sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_SwapRspDuoDualTunerModeSampleRate(HANDLE dev, double *currentSampleRate);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_SwapRspDuoMode(sdrplay_api_DeviceT *currDevice, sdrplay_api_DeviceParamsT **deviceParams,
|
||||||
|
sdrplay_api_RspDuoModeT rspDuoMode, double sampleRate, sdrplay_api_TunerSelectT tuner,
|
||||||
|
sdrplay_api_Bw_MHzT bwType, sdrplay_api_If_kHzT ifType, sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_H
|
||||||
78
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_callback.h
Normal file
78
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_callback.h
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
#ifndef SDRPLAY_API_CALLBACK_H
|
||||||
|
#define SDRPLAY_API_CALLBACK_H
|
||||||
|
|
||||||
|
// Event callback enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Overload_Detected = 0,
|
||||||
|
sdrplay_api_Overload_Corrected = 1,
|
||||||
|
} sdrplay_api_PowerOverloadCbEventIdT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_MasterInitialised = 0,
|
||||||
|
sdrplay_api_SlaveAttached = 1,
|
||||||
|
sdrplay_api_SlaveDetached = 2,
|
||||||
|
sdrplay_api_SlaveInitialised = 3,
|
||||||
|
sdrplay_api_SlaveUninitialised = 4,
|
||||||
|
sdrplay_api_MasterDllDisappeared = 5,
|
||||||
|
sdrplay_api_SlaveDllDisappeared = 6,
|
||||||
|
} sdrplay_api_RspDuoModeCbEventIdT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_GainChange = 0,
|
||||||
|
sdrplay_api_PowerOverloadChange = 1,
|
||||||
|
sdrplay_api_DeviceRemoved = 2,
|
||||||
|
sdrplay_api_RspDuoModeChange = 3,
|
||||||
|
} sdrplay_api_EventT;
|
||||||
|
|
||||||
|
// Event callback parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned int gRdB;
|
||||||
|
unsigned int lnaGRdB;
|
||||||
|
double currGain;
|
||||||
|
} sdrplay_api_GainCbParamT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_PowerOverloadCbEventIdT powerOverloadChangeType;
|
||||||
|
} sdrplay_api_PowerOverloadCbParamT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_RspDuoModeCbEventIdT modeChangeType;
|
||||||
|
} sdrplay_api_RspDuoModeCbParamT;
|
||||||
|
|
||||||
|
// Event parameters overlay
|
||||||
|
typedef union
|
||||||
|
{
|
||||||
|
sdrplay_api_GainCbParamT gainParams;
|
||||||
|
sdrplay_api_PowerOverloadCbParamT powerOverloadParams;
|
||||||
|
sdrplay_api_RspDuoModeCbParamT rspDuoModeParams;
|
||||||
|
} sdrplay_api_EventParamsT;
|
||||||
|
|
||||||
|
// Stream callback parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned int firstSampleNum;
|
||||||
|
int grChanged;
|
||||||
|
int rfChanged;
|
||||||
|
int fsChanged;
|
||||||
|
unsigned int numSamples;
|
||||||
|
} sdrplay_api_StreamCbParamsT;
|
||||||
|
|
||||||
|
// Callback function prototypes
|
||||||
|
typedef void (*sdrplay_api_StreamCallback_t)(short *xi, short *xq, sdrplay_api_StreamCbParamsT *params, unsigned int numSamples, unsigned int reset, void *cbContext);
|
||||||
|
typedef void (*sdrplay_api_EventCallback_t)(sdrplay_api_EventT eventId, sdrplay_api_TunerSelectT tuner, sdrplay_api_EventParamsT *params, void *cbContext);
|
||||||
|
|
||||||
|
// Callback function struct
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_StreamCallback_t StreamACbFn;
|
||||||
|
sdrplay_api_StreamCallback_t StreamBCbFn;
|
||||||
|
sdrplay_api_EventCallback_t EventCbFn;
|
||||||
|
} sdrplay_api_CallbackFnsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_CALLBACK_H
|
||||||
55
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_control.h
Normal file
55
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_control.h
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
#ifndef SDRPLAY_API_CONTROL_H
|
||||||
|
#define SDRPLAY_API_CONTROL_H
|
||||||
|
|
||||||
|
// Control parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_AGC_DISABLE = 0,
|
||||||
|
sdrplay_api_AGC_100HZ = 1,
|
||||||
|
sdrplay_api_AGC_50HZ = 2,
|
||||||
|
sdrplay_api_AGC_5HZ = 3,
|
||||||
|
sdrplay_api_AGC_CTRL_EN = 4
|
||||||
|
} sdrplay_api_AgcControlT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_ADSB_DECIMATION = 0,
|
||||||
|
sdrplay_api_ADSB_NO_DECIMATION_LOWPASS = 1,
|
||||||
|
sdrplay_api_ADSB_NO_DECIMATION_BANDPASS_2MHZ = 2,
|
||||||
|
sdrplay_api_ADSB_NO_DECIMATION_BANDPASS_3MHZ = 3
|
||||||
|
} sdrplay_api_AdsbModeT;
|
||||||
|
|
||||||
|
// Control parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char DCenable; // default: 1
|
||||||
|
unsigned char IQenable; // default: 1
|
||||||
|
} sdrplay_api_DcOffsetT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char enable; // default: 0
|
||||||
|
unsigned char decimationFactor; // default: 1
|
||||||
|
unsigned char wideBandSignal; // default: 0
|
||||||
|
} sdrplay_api_DecimationT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_AgcControlT enable; // default: sdrplay_api_AGC_50HZ
|
||||||
|
int setPoint_dBfs; // default: -60
|
||||||
|
unsigned short attack_ms; // default: 0
|
||||||
|
unsigned short decay_ms; // default: 0
|
||||||
|
unsigned short decay_delay_ms; // default: 0
|
||||||
|
unsigned short decay_threshold_dB; // default: 0
|
||||||
|
int syncUpdate; // default: 0
|
||||||
|
} sdrplay_api_AgcT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_DcOffsetT dcOffset;
|
||||||
|
sdrplay_api_DecimationT decimation;
|
||||||
|
sdrplay_api_AgcT agc;
|
||||||
|
sdrplay_api_AdsbModeT adsbMode; //default: sdrplay_api_ADSB_DECIMATION
|
||||||
|
} sdrplay_api_ControlParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_CONTROL_H
|
||||||
51
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_dev.h
Normal file
51
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_dev.h
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
#ifndef SDRPLAY_API_DEV_H
|
||||||
|
#define SDRPLAY_API_DEV_H
|
||||||
|
|
||||||
|
#include "sdrplay_api_rsp1a.h"
|
||||||
|
#include "sdrplay_api_rsp2.h"
|
||||||
|
#include "sdrplay_api_rspDuo.h"
|
||||||
|
#include "sdrplay_api_rspDx.h"
|
||||||
|
|
||||||
|
// Dev parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_ISOCH = 0,
|
||||||
|
sdrplay_api_BULK = 1
|
||||||
|
} sdrplay_api_TransferModeT;
|
||||||
|
|
||||||
|
// Dev parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
double fsHz; // default: 2000000.0
|
||||||
|
unsigned char syncUpdate; // default: 0
|
||||||
|
unsigned char reCal; // default: 0
|
||||||
|
} sdrplay_api_FsFreqT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned int sampleNum; // default: 0
|
||||||
|
unsigned int period; // default: 0
|
||||||
|
} sdrplay_api_SyncUpdateT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char resetGainUpdate; // default: 0
|
||||||
|
unsigned char resetRfUpdate; // default: 0
|
||||||
|
unsigned char resetFsUpdate; // default: 0
|
||||||
|
} sdrplay_api_ResetFlagsT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
double ppm; // default: 0.0
|
||||||
|
sdrplay_api_FsFreqT fsFreq;
|
||||||
|
sdrplay_api_SyncUpdateT syncUpdate;
|
||||||
|
sdrplay_api_ResetFlagsT resetFlags;
|
||||||
|
sdrplay_api_TransferModeT mode; // default: sdrplay_api_ISOCH
|
||||||
|
unsigned int samplesPerPkt; // default: 0 (output param)
|
||||||
|
sdrplay_api_Rsp1aParamsT rsp1aParams;
|
||||||
|
sdrplay_api_Rsp2ParamsT rsp2Params;
|
||||||
|
sdrplay_api_RspDuoParamsT rspDuoParams;
|
||||||
|
sdrplay_api_RspDxParamsT rspDxParams;
|
||||||
|
} sdrplay_api_DevParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_DEV_H
|
||||||
22
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_rsp1a.h
Normal file
22
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_rsp1a.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef SDRPLAY_API_RSP1A_H
|
||||||
|
#define SDRPLAY_API_RSP1A_H
|
||||||
|
|
||||||
|
#define RSPIA_NUM_LNA_STATES 10
|
||||||
|
#define RSPIA_NUM_LNA_STATES_AM 7
|
||||||
|
#define RSPIA_NUM_LNA_STATES_LBAND 9
|
||||||
|
|
||||||
|
// RSP1A parameter enums
|
||||||
|
|
||||||
|
// RSP1A parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char rfNotchEnable; // default: 0
|
||||||
|
unsigned char rfDabNotchEnable; // default: 0
|
||||||
|
} sdrplay_api_Rsp1aParamsT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char biasTEnable; // default: 0
|
||||||
|
} sdrplay_api_Rsp1aTunerParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_RSP1A_H
|
||||||
35
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_rsp2.h
Normal file
35
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_rsp2.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#ifndef SDRPLAY_API_RSP2_H
|
||||||
|
#define SDRPLAY_API_RSP2_H
|
||||||
|
|
||||||
|
#define RSPII_NUM_LNA_STATES 9
|
||||||
|
#define RSPII_NUM_LNA_STATES_AMPORT 5
|
||||||
|
#define RSPII_NUM_LNA_STATES_420MHZ 6
|
||||||
|
|
||||||
|
// RSP2 parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Rsp2_ANTENNA_A = 5,
|
||||||
|
sdrplay_api_Rsp2_ANTENNA_B = 6,
|
||||||
|
} sdrplay_api_Rsp2_AntennaSelectT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Rsp2_AMPORT_1 = 1,
|
||||||
|
sdrplay_api_Rsp2_AMPORT_2 = 0,
|
||||||
|
} sdrplay_api_Rsp2_AmPortSelectT;
|
||||||
|
|
||||||
|
// RSP2 parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char extRefOutputEn; // default: 0
|
||||||
|
} sdrplay_api_Rsp2ParamsT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char biasTEnable; // default: 0
|
||||||
|
sdrplay_api_Rsp2_AmPortSelectT amPortSel; // default: sdrplay_api_Rsp2_AMPORT_2
|
||||||
|
sdrplay_api_Rsp2_AntennaSelectT antennaSel; // default: sdrplay_api_Rsp2_ANTENNA_A
|
||||||
|
unsigned char rfNotchEnable; // default: 0
|
||||||
|
} sdrplay_api_Rsp2TunerParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_RSP2_H
|
||||||
40
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_rspDuo.h
Normal file
40
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_rspDuo.h
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#ifndef SDRPLAY_API_RSPduo_H
|
||||||
|
#define SDRPLAY_API_RSPduo_H
|
||||||
|
|
||||||
|
#define RSPDUO_NUM_LNA_STATES 10
|
||||||
|
#define RSPDUO_NUM_LNA_STATES_AMPORT 5
|
||||||
|
#define RSPDUO_NUM_LNA_STATES_AM 7
|
||||||
|
#define RSPDUO_NUM_LNA_STATES_LBAND 9
|
||||||
|
|
||||||
|
// RSPduo parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_RspDuoMode_Unknown = 0,
|
||||||
|
sdrplay_api_RspDuoMode_Single_Tuner = 1,
|
||||||
|
sdrplay_api_RspDuoMode_Dual_Tuner = 2,
|
||||||
|
sdrplay_api_RspDuoMode_Master = 4,
|
||||||
|
sdrplay_api_RspDuoMode_Slave = 8,
|
||||||
|
} sdrplay_api_RspDuoModeT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_RspDuo_AMPORT_1 = 1,
|
||||||
|
sdrplay_api_RspDuo_AMPORT_2 = 0,
|
||||||
|
} sdrplay_api_RspDuo_AmPortSelectT;
|
||||||
|
|
||||||
|
// RSPduo parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int extRefOutputEn; // default: 0
|
||||||
|
} sdrplay_api_RspDuoParamsT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char biasTEnable; // default: 0
|
||||||
|
sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel; // default: sdrplay_api_RspDuo_AMPORT_2
|
||||||
|
unsigned char tuner1AmNotchEnable; // default: 0
|
||||||
|
unsigned char rfNotchEnable; // default: 0
|
||||||
|
unsigned char rfDabNotchEnable; // default: 0
|
||||||
|
} sdrplay_api_RspDuoTunerParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_RSPduo_H
|
||||||
45
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_rspDx.h
Normal file
45
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_rspDx.h
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
#ifndef SDRPLAY_API_RSPDX_H
|
||||||
|
#define SDRPLAY_API_RSPDX_H
|
||||||
|
|
||||||
|
#include "sdrplay_api_tuner.h"
|
||||||
|
|
||||||
|
#define RSPDX_NUM_LNA_STATES 28 // Number of LNA states in all bands (except where defined differently below)
|
||||||
|
#define RSPDX_NUM_LNA_STATES_AMPORT2_0_12 19 // Number of LNA states when using AM Port 2 between 0 and 12MHz
|
||||||
|
#define RSPDX_NUM_LNA_STATES_AMPORT2_12_60 20 // Number of LNA states when using AM Port 2 between 12 and 60MHz
|
||||||
|
#define RSPDX_NUM_LNA_STATES_VHF_BAND3 27 // Number of LNA states in VHF and Band3
|
||||||
|
#define RSPDX_NUM_LNA_STATES_420MHZ 21 // Number of LNA states in 420MHz band
|
||||||
|
#define RSPDX_NUM_LNA_STATES_LBAND 19 // Number of LNA states in L-band
|
||||||
|
#define RSPDX_NUM_LNA_STATES_DX 26 // Number of LNA states in DX path
|
||||||
|
|
||||||
|
// RSPdx parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_RspDx_ANTENNA_A = 0,
|
||||||
|
sdrplay_api_RspDx_ANTENNA_B = 1,
|
||||||
|
sdrplay_api_RspDx_ANTENNA_C = 2,
|
||||||
|
} sdrplay_api_RspDx_AntennaSelectT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_RspDx_HDRMODE_BW_0_200 = 0,
|
||||||
|
sdrplay_api_RspDx_HDRMODE_BW_0_500 = 1,
|
||||||
|
sdrplay_api_RspDx_HDRMODE_BW_1_200 = 2,
|
||||||
|
sdrplay_api_RspDx_HDRMODE_BW_1_700 = 3,
|
||||||
|
} sdrplay_api_RspDx_HdrModeBwT;
|
||||||
|
|
||||||
|
// RSPdx parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char hdrEnable; // default: 0
|
||||||
|
unsigned char biasTEnable; // default: 0
|
||||||
|
sdrplay_api_RspDx_AntennaSelectT antennaSel; // default: sdrplay_api_RspDx_ANTENNA_A
|
||||||
|
unsigned char rfNotchEnable; // default: 0
|
||||||
|
unsigned char rfDabNotchEnable; // default: 0
|
||||||
|
} sdrplay_api_RspDxParamsT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_RspDx_HdrModeBwT hdrBw; // default: sdrplay_api_RspDx_HDRMODE_BW_1_700
|
||||||
|
} sdrplay_api_RspDxTunerParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_RSPDX_H
|
||||||
21
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_rx_channel.h
Normal file
21
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_rx_channel.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#ifndef SDRPLAY_API_RX_CHANNEL_H
|
||||||
|
#define SDRPLAY_API_RX_CHANNEL_H
|
||||||
|
|
||||||
|
#include "sdrplay_api_tuner.h"
|
||||||
|
#include "sdrplay_api_control.h"
|
||||||
|
#include "sdrplay_api_rsp1a.h"
|
||||||
|
#include "sdrplay_api_rsp2.h"
|
||||||
|
#include "sdrplay_api_rspDuo.h"
|
||||||
|
#include "sdrplay_api_rspDx.h"
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_TunerParamsT tunerParams;
|
||||||
|
sdrplay_api_ControlParamsT ctrlParams;
|
||||||
|
sdrplay_api_Rsp1aTunerParamsT rsp1aTunerParams;
|
||||||
|
sdrplay_api_Rsp2TunerParamsT rsp2TunerParams;
|
||||||
|
sdrplay_api_RspDuoTunerParamsT rspDuoTunerParams;
|
||||||
|
sdrplay_api_RspDxTunerParamsT rspDxTunerParams;
|
||||||
|
} sdrplay_api_RxChannelParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_RX_CHANNEL_H
|
||||||
93
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_tuner.h
Normal file
93
artifacts/sdrplay-api-headers/v3_07/sdrplay_api_tuner.h
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
#ifndef SDRPLAY_API_TUNER_H
|
||||||
|
#define SDRPLAY_API_TUNER_H
|
||||||
|
|
||||||
|
#define MAX_BB_GR (59)
|
||||||
|
|
||||||
|
// Tuner parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_BW_Undefined = 0,
|
||||||
|
sdrplay_api_BW_0_200 = 200,
|
||||||
|
sdrplay_api_BW_0_300 = 300,
|
||||||
|
sdrplay_api_BW_0_600 = 600,
|
||||||
|
sdrplay_api_BW_1_536 = 1536,
|
||||||
|
sdrplay_api_BW_5_000 = 5000,
|
||||||
|
sdrplay_api_BW_6_000 = 6000,
|
||||||
|
sdrplay_api_BW_7_000 = 7000,
|
||||||
|
sdrplay_api_BW_8_000 = 8000
|
||||||
|
} sdrplay_api_Bw_MHzT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_IF_Undefined = -1,
|
||||||
|
sdrplay_api_IF_Zero = 0,
|
||||||
|
sdrplay_api_IF_0_450 = 450,
|
||||||
|
sdrplay_api_IF_1_620 = 1620,
|
||||||
|
sdrplay_api_IF_2_048 = 2048
|
||||||
|
} sdrplay_api_If_kHzT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_LO_Undefined = 0,
|
||||||
|
sdrplay_api_LO_Auto = 1,
|
||||||
|
sdrplay_api_LO_120MHz = 2,
|
||||||
|
sdrplay_api_LO_144MHz = 3,
|
||||||
|
sdrplay_api_LO_168MHz = 4
|
||||||
|
} sdrplay_api_LoModeT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_EXTENDED_MIN_GR = 0,
|
||||||
|
sdrplay_api_NORMAL_MIN_GR = 20
|
||||||
|
} sdrplay_api_MinGainReductionT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Tuner_Neither = 0,
|
||||||
|
sdrplay_api_Tuner_A = 1,
|
||||||
|
sdrplay_api_Tuner_B = 2,
|
||||||
|
sdrplay_api_Tuner_Both = 3,
|
||||||
|
} sdrplay_api_TunerSelectT;
|
||||||
|
|
||||||
|
// Tuner parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
float curr;
|
||||||
|
float max;
|
||||||
|
float min;
|
||||||
|
} sdrplay_api_GainValuesT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int gRdB; // default: 50
|
||||||
|
unsigned char LNAstate; // default: 0
|
||||||
|
unsigned char syncUpdate; // default: 0
|
||||||
|
sdrplay_api_MinGainReductionT minGr; // default: sdrplay_api_NORMAL_MIN_GR
|
||||||
|
sdrplay_api_GainValuesT gainVals; // output parameter
|
||||||
|
} sdrplay_api_GainT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
double rfHz; // default: 200000000.0
|
||||||
|
unsigned char syncUpdate; // default: 0
|
||||||
|
} sdrplay_api_RfFreqT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char dcCal; // default: 3 (Periodic mode)
|
||||||
|
unsigned char speedUp; // default: 0 (No speedup)
|
||||||
|
int trackTime; // default: 1 (=> time in uSec = (72 * 3 * trackTime) / 24e6 = 9uSec)
|
||||||
|
int refreshRateTime; // default: 2048 (=> time in uSec = (72 * 3 * refreshRateTime) / 24e6 = 18432uSec)
|
||||||
|
} sdrplay_api_DcOffsetTunerT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_Bw_MHzT bwType; // default: sdrplay_api_BW_0_200
|
||||||
|
sdrplay_api_If_kHzT ifType; // default: sdrplay_api_IF_Zero
|
||||||
|
sdrplay_api_LoModeT loMode; // default: sdrplay_api_LO_Auto
|
||||||
|
sdrplay_api_GainT gain;
|
||||||
|
sdrplay_api_RfFreqT rfFreq;
|
||||||
|
sdrplay_api_DcOffsetTunerT dcOffsetTuner;
|
||||||
|
} sdrplay_api_TunerParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_TUNER_H
|
||||||
230
artifacts/sdrplay-api-headers/v3_11/sdrplay_api.h
Normal file
230
artifacts/sdrplay-api-headers/v3_11/sdrplay_api.h
Normal file
@@ -0,0 +1,230 @@
|
|||||||
|
#ifndef SDRPLAY_API_H
|
||||||
|
#define SDRPLAY_API_H
|
||||||
|
|
||||||
|
#include "sdrplay_api_dev.h"
|
||||||
|
#include "sdrplay_api_rx_channel.h"
|
||||||
|
#include "sdrplay_api_callback.h"
|
||||||
|
|
||||||
|
//#if defined(_M_X64) || defined(_M_IX86) || 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.11)
|
||||||
|
|
||||||
|
// API Constants
|
||||||
|
#define SDRPLAY_MAX_DEVICES (16)
|
||||||
|
#define SDRPLAY_MAX_TUNERS_PER_DEVICE (2)
|
||||||
|
|
||||||
|
#define SDRPLAY_MAX_SER_NO_LEN (64)
|
||||||
|
#define SDRPLAY_MAX_ROOT_NM_LEN (32)
|
||||||
|
|
||||||
|
#define SDRPLAY_RSP1_ID (1)
|
||||||
|
#define SDRPLAY_RSP1A_ID (255)
|
||||||
|
#define SDRPLAY_RSP2_ID (2)
|
||||||
|
#define SDRPLAY_RSPduo_ID (3)
|
||||||
|
#define SDRPLAY_RSPdx_ID (4)
|
||||||
|
|
||||||
|
// Enum types
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Success = 0,
|
||||||
|
sdrplay_api_Fail = 1,
|
||||||
|
sdrplay_api_InvalidParam = 2,
|
||||||
|
sdrplay_api_OutOfRange = 3,
|
||||||
|
sdrplay_api_GainUpdateError = 4,
|
||||||
|
sdrplay_api_RfUpdateError = 5,
|
||||||
|
sdrplay_api_FsUpdateError = 6,
|
||||||
|
sdrplay_api_HwError = 7,
|
||||||
|
sdrplay_api_AliasingError = 8,
|
||||||
|
sdrplay_api_AlreadyInitialised = 9,
|
||||||
|
sdrplay_api_NotInitialised = 10,
|
||||||
|
sdrplay_api_NotEnabled = 11,
|
||||||
|
sdrplay_api_HwVerError = 12,
|
||||||
|
sdrplay_api_OutOfMemError = 13,
|
||||||
|
sdrplay_api_ServiceNotResponding = 14,
|
||||||
|
sdrplay_api_StartPending = 15,
|
||||||
|
sdrplay_api_StopPending = 16,
|
||||||
|
sdrplay_api_InvalidMode = 17,
|
||||||
|
sdrplay_api_FailedVerification1 = 18,
|
||||||
|
sdrplay_api_FailedVerification2 = 19,
|
||||||
|
sdrplay_api_FailedVerification3 = 20,
|
||||||
|
sdrplay_api_FailedVerification4 = 21,
|
||||||
|
sdrplay_api_FailedVerification5 = 22,
|
||||||
|
sdrplay_api_FailedVerification6 = 23,
|
||||||
|
sdrplay_api_InvalidServiceVersion = 24
|
||||||
|
} sdrplay_api_ErrT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Update_None = 0x00000000,
|
||||||
|
|
||||||
|
// Reasons for master only mode
|
||||||
|
sdrplay_api_Update_Dev_Fs = 0x00000001,
|
||||||
|
sdrplay_api_Update_Dev_Ppm = 0x00000002,
|
||||||
|
sdrplay_api_Update_Dev_SyncUpdate = 0x00000004,
|
||||||
|
sdrplay_api_Update_Dev_ResetFlags = 0x00000008,
|
||||||
|
|
||||||
|
sdrplay_api_Update_Rsp1a_BiasTControl = 0x00000010,
|
||||||
|
sdrplay_api_Update_Rsp1a_RfNotchControl = 0x00000020,
|
||||||
|
sdrplay_api_Update_Rsp1a_RfDabNotchControl = 0x00000040,
|
||||||
|
|
||||||
|
sdrplay_api_Update_Rsp2_BiasTControl = 0x00000080,
|
||||||
|
sdrplay_api_Update_Rsp2_AmPortSelect = 0x00000100,
|
||||||
|
sdrplay_api_Update_Rsp2_AntennaControl = 0x00000200,
|
||||||
|
sdrplay_api_Update_Rsp2_RfNotchControl = 0x00000400,
|
||||||
|
sdrplay_api_Update_Rsp2_ExtRefControl = 0x00000800,
|
||||||
|
|
||||||
|
sdrplay_api_Update_RspDuo_ExtRefControl = 0x00001000,
|
||||||
|
|
||||||
|
sdrplay_api_Update_Master_Spare_1 = 0x00002000,
|
||||||
|
sdrplay_api_Update_Master_Spare_2 = 0x00004000,
|
||||||
|
|
||||||
|
// Reasons for master and slave mode
|
||||||
|
// Note: sdrplay_api_Update_Tuner_Gr MUST be the first value defined in this section!
|
||||||
|
sdrplay_api_Update_Tuner_Gr = 0x00008000,
|
||||||
|
sdrplay_api_Update_Tuner_GrLimits = 0x00010000,
|
||||||
|
sdrplay_api_Update_Tuner_Frf = 0x00020000,
|
||||||
|
sdrplay_api_Update_Tuner_BwType = 0x00040000,
|
||||||
|
sdrplay_api_Update_Tuner_IfType = 0x00080000,
|
||||||
|
sdrplay_api_Update_Tuner_DcOffset = 0x00100000,
|
||||||
|
sdrplay_api_Update_Tuner_LoMode = 0x00200000,
|
||||||
|
|
||||||
|
sdrplay_api_Update_Ctrl_DCoffsetIQimbalance = 0x00400000,
|
||||||
|
sdrplay_api_Update_Ctrl_Decimation = 0x00800000,
|
||||||
|
sdrplay_api_Update_Ctrl_Agc = 0x01000000,
|
||||||
|
sdrplay_api_Update_Ctrl_AdsbMode = 0x02000000,
|
||||||
|
sdrplay_api_Update_Ctrl_OverloadMsgAck = 0x04000000,
|
||||||
|
|
||||||
|
sdrplay_api_Update_RspDuo_BiasTControl = 0x08000000,
|
||||||
|
sdrplay_api_Update_RspDuo_AmPortSelect = 0x10000000,
|
||||||
|
sdrplay_api_Update_RspDuo_Tuner1AmNotchControl = 0x20000000,
|
||||||
|
sdrplay_api_Update_RspDuo_RfNotchControl = 0x40000000,
|
||||||
|
sdrplay_api_Update_RspDuo_RfDabNotchControl = 0x80000000,
|
||||||
|
} sdrplay_api_ReasonForUpdateT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Update_Ext1_None = 0x00000000,
|
||||||
|
|
||||||
|
// Reasons for master only mode
|
||||||
|
sdrplay_api_Update_RspDx_HdrEnable = 0x00000001,
|
||||||
|
sdrplay_api_Update_RspDx_BiasTControl = 0x00000002,
|
||||||
|
sdrplay_api_Update_RspDx_AntennaControl = 0x00000004,
|
||||||
|
sdrplay_api_Update_RspDx_RfNotchControl = 0x00000008,
|
||||||
|
sdrplay_api_Update_RspDx_RfDabNotchControl = 0x00000010,
|
||||||
|
sdrplay_api_Update_RspDx_HdrBw = 0x00000020,
|
||||||
|
|
||||||
|
// Reasons for master and slave mode
|
||||||
|
} sdrplay_api_ReasonForUpdateExtension1T;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_DbgLvl_Disable = 0,
|
||||||
|
sdrplay_api_DbgLvl_Verbose = 1,
|
||||||
|
sdrplay_api_DbgLvl_Warning = 2,
|
||||||
|
sdrplay_api_DbgLvl_Error = 3,
|
||||||
|
sdrplay_api_DbgLvl_Message = 4,
|
||||||
|
} sdrplay_api_DbgLvl_t;
|
||||||
|
|
||||||
|
// Device structure
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
char SerNo[SDRPLAY_MAX_SER_NO_LEN];
|
||||||
|
unsigned char hwVer;
|
||||||
|
sdrplay_api_TunerSelectT tuner;
|
||||||
|
sdrplay_api_RspDuoModeT rspDuoMode;
|
||||||
|
unsigned char valid;
|
||||||
|
double rspDuoSampleFreq;
|
||||||
|
HANDLE dev;
|
||||||
|
} sdrplay_api_DeviceT;
|
||||||
|
|
||||||
|
// Device parameter structure
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_DevParamsT *devParams;
|
||||||
|
sdrplay_api_RxChannelParamsT *rxChannelA;
|
||||||
|
sdrplay_api_RxChannelParamsT *rxChannelB;
|
||||||
|
} sdrplay_api_DeviceParamsT;
|
||||||
|
|
||||||
|
// Extended error message structure
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
char file[256];
|
||||||
|
char function[256];
|
||||||
|
int line;
|
||||||
|
char message[1024];
|
||||||
|
} sdrplay_api_ErrorInfoT;
|
||||||
|
|
||||||
|
// Comman API function types
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_Open_t)(void);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_Close_t)(void);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_ApiVersion_t)(float *apiVer);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_LockDeviceApi_t)(void);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_UnlockDeviceApi_t)(void);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_GetDevices_t)(sdrplay_api_DeviceT *devices, unsigned int *numDevs, unsigned int maxDevs);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_SelectDevice_t)(sdrplay_api_DeviceT *device);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_ReleaseDevice_t)(sdrplay_api_DeviceT *device);
|
||||||
|
typedef const char* (*sdrplay_api_GetErrorString_t)(sdrplay_api_ErrT err);
|
||||||
|
typedef sdrplay_api_ErrorInfoT* (*sdrplay_api_GetLastError_t)(sdrplay_api_DeviceT *device);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_DisableHeartbeat_t)(void);
|
||||||
|
|
||||||
|
// Device API function types
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_DebugEnable_t)(HANDLE dev, sdrplay_api_DbgLvl_t dbgLvl);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_GetDeviceParams_t)(HANDLE dev, sdrplay_api_DeviceParamsT **deviceParams);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_Init_t)(HANDLE dev, sdrplay_api_CallbackFnsT *callbackFns, void *cbContext);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_Uninit_t)(HANDLE dev);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_Update_t)(HANDLE dev, sdrplay_api_TunerSelectT tuner, sdrplay_api_ReasonForUpdateT reasonForUpdate, sdrplay_api_ReasonForUpdateExtension1T reasonForUpdateExt1);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_SwapRspDuoActiveTuner_t)(HANDLE dev, sdrplay_api_TunerSelectT *tuner, sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_SwapRspDuoDualTunerModeSampleRate_t)(double *currentSampleRate, double newSampleRate);
|
||||||
|
typedef sdrplay_api_ErrT (*sdrplay_api_SwapRspDuoMode_t)(sdrplay_api_DeviceT *currDevice, sdrplay_api_DeviceParamsT **deviceParams,
|
||||||
|
sdrplay_api_RspDuoModeT rspDuoMode, double sampleRate, sdrplay_api_TunerSelectT tuner,
|
||||||
|
sdrplay_api_Bw_MHzT bwType, sdrplay_api_If_kHzT ifType, sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel);
|
||||||
|
|
||||||
|
// API function definitions
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Comman API function definitions
|
||||||
|
sdrplay_api_ErrT sdrplay_api_Open(void);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_Close(void);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_ApiVersion(float *apiVer);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_LockDeviceApi(void);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_UnlockDeviceApi(void);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_GetDevices(sdrplay_api_DeviceT *devices, unsigned int *numDevs, unsigned int maxDevs);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_SelectDevice(sdrplay_api_DeviceT *device);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_ReleaseDevice(sdrplay_api_DeviceT *device);
|
||||||
|
const char* sdrplay_api_GetErrorString(sdrplay_api_ErrT err);
|
||||||
|
sdrplay_api_ErrorInfoT* sdrplay_api_GetLastError(sdrplay_api_DeviceT *device);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_DisableHeartbeat(void); // Must be called before sdrplay_api_SelectDevice()
|
||||||
|
|
||||||
|
// Device API function definitions
|
||||||
|
sdrplay_api_ErrT sdrplay_api_DebugEnable(HANDLE dev, sdrplay_api_DbgLvl_t enable);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_GetDeviceParams(HANDLE dev, sdrplay_api_DeviceParamsT **deviceParams);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_Init(HANDLE dev, sdrplay_api_CallbackFnsT *callbackFns, void *cbContext);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_Uninit(HANDLE dev);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_Update(HANDLE dev, sdrplay_api_TunerSelectT tuner, sdrplay_api_ReasonForUpdateT reasonForUpdate, sdrplay_api_ReasonForUpdateExtension1T reasonForUpdateExt1);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_SwapRspDuoActiveTuner(HANDLE dev, sdrplay_api_TunerSelectT *currentTuner, sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel);
|
||||||
|
sdrplay_api_ErrT sdrplay_api_SwapRspDuoDualTunerModeSampleRate(HANDLE dev, double *currentSampleRate, double newSampleRate);
|
||||||
|
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
|
||||||
79
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_callback.h
Normal file
79
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_callback.h
Normal file
@@ -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
|
||||||
55
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_control.h
Normal file
55
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_control.h
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
#ifndef SDRPLAY_API_CONTROL_H
|
||||||
|
#define SDRPLAY_API_CONTROL_H
|
||||||
|
|
||||||
|
// Control parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_AGC_DISABLE = 0,
|
||||||
|
sdrplay_api_AGC_100HZ = 1,
|
||||||
|
sdrplay_api_AGC_50HZ = 2,
|
||||||
|
sdrplay_api_AGC_5HZ = 3,
|
||||||
|
sdrplay_api_AGC_CTRL_EN = 4
|
||||||
|
} sdrplay_api_AgcControlT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_ADSB_DECIMATION = 0,
|
||||||
|
sdrplay_api_ADSB_NO_DECIMATION_LOWPASS = 1,
|
||||||
|
sdrplay_api_ADSB_NO_DECIMATION_BANDPASS_2MHZ = 2,
|
||||||
|
sdrplay_api_ADSB_NO_DECIMATION_BANDPASS_3MHZ = 3
|
||||||
|
} sdrplay_api_AdsbModeT;
|
||||||
|
|
||||||
|
// Control parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char DCenable; // default: 1
|
||||||
|
unsigned char IQenable; // default: 1
|
||||||
|
} sdrplay_api_DcOffsetT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char enable; // default: 0
|
||||||
|
unsigned char decimationFactor; // default: 1
|
||||||
|
unsigned char wideBandSignal; // default: 0
|
||||||
|
} sdrplay_api_DecimationT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_AgcControlT enable; // default: sdrplay_api_AGC_50HZ
|
||||||
|
int setPoint_dBfs; // default: -60
|
||||||
|
unsigned short attack_ms; // default: 0
|
||||||
|
unsigned short decay_ms; // default: 0
|
||||||
|
unsigned short decay_delay_ms; // default: 0
|
||||||
|
unsigned short decay_threshold_dB; // default: 0
|
||||||
|
int syncUpdate; // default: 0
|
||||||
|
} sdrplay_api_AgcT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_DcOffsetT dcOffset;
|
||||||
|
sdrplay_api_DecimationT decimation;
|
||||||
|
sdrplay_api_AgcT agc;
|
||||||
|
sdrplay_api_AdsbModeT adsbMode; //default: sdrplay_api_ADSB_DECIMATION
|
||||||
|
} sdrplay_api_ControlParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_CONTROL_H
|
||||||
51
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_dev.h
Normal file
51
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_dev.h
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
#ifndef SDRPLAY_API_DEV_H
|
||||||
|
#define SDRPLAY_API_DEV_H
|
||||||
|
|
||||||
|
#include "sdrplay_api_rsp1a.h"
|
||||||
|
#include "sdrplay_api_rsp2.h"
|
||||||
|
#include "sdrplay_api_rspDuo.h"
|
||||||
|
#include "sdrplay_api_rspDx.h"
|
||||||
|
|
||||||
|
// Dev parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_ISOCH = 0,
|
||||||
|
sdrplay_api_BULK = 1
|
||||||
|
} sdrplay_api_TransferModeT;
|
||||||
|
|
||||||
|
// Dev parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
double fsHz; // default: 2000000.0
|
||||||
|
unsigned char syncUpdate; // default: 0
|
||||||
|
unsigned char reCal; // default: 0
|
||||||
|
} sdrplay_api_FsFreqT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned int sampleNum; // default: 0
|
||||||
|
unsigned int period; // default: 0
|
||||||
|
} sdrplay_api_SyncUpdateT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char resetGainUpdate; // default: 0
|
||||||
|
unsigned char resetRfUpdate; // default: 0
|
||||||
|
unsigned char resetFsUpdate; // default: 0
|
||||||
|
} sdrplay_api_ResetFlagsT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
double ppm; // default: 0.0
|
||||||
|
sdrplay_api_FsFreqT fsFreq;
|
||||||
|
sdrplay_api_SyncUpdateT syncUpdate;
|
||||||
|
sdrplay_api_ResetFlagsT resetFlags;
|
||||||
|
sdrplay_api_TransferModeT mode; // default: sdrplay_api_ISOCH
|
||||||
|
unsigned int samplesPerPkt; // default: 0 (output param)
|
||||||
|
sdrplay_api_Rsp1aParamsT rsp1aParams;
|
||||||
|
sdrplay_api_Rsp2ParamsT rsp2Params;
|
||||||
|
sdrplay_api_RspDuoParamsT rspDuoParams;
|
||||||
|
sdrplay_api_RspDxParamsT rspDxParams;
|
||||||
|
} sdrplay_api_DevParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_DEV_H
|
||||||
22
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_rsp1a.h
Normal file
22
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_rsp1a.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef SDRPLAY_API_RSP1A_H
|
||||||
|
#define SDRPLAY_API_RSP1A_H
|
||||||
|
|
||||||
|
#define RSPIA_NUM_LNA_STATES 10
|
||||||
|
#define RSPIA_NUM_LNA_STATES_AM 7
|
||||||
|
#define RSPIA_NUM_LNA_STATES_LBAND 9
|
||||||
|
|
||||||
|
// RSP1A parameter enums
|
||||||
|
|
||||||
|
// RSP1A parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char rfNotchEnable; // default: 0
|
||||||
|
unsigned char rfDabNotchEnable; // default: 0
|
||||||
|
} sdrplay_api_Rsp1aParamsT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char biasTEnable; // default: 0
|
||||||
|
} sdrplay_api_Rsp1aTunerParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_RSP1A_H
|
||||||
35
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_rsp2.h
Normal file
35
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_rsp2.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#ifndef SDRPLAY_API_RSP2_H
|
||||||
|
#define SDRPLAY_API_RSP2_H
|
||||||
|
|
||||||
|
#define RSPII_NUM_LNA_STATES 9
|
||||||
|
#define RSPII_NUM_LNA_STATES_AMPORT 5
|
||||||
|
#define RSPII_NUM_LNA_STATES_420MHZ 6
|
||||||
|
|
||||||
|
// RSP2 parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Rsp2_ANTENNA_A = 5,
|
||||||
|
sdrplay_api_Rsp2_ANTENNA_B = 6,
|
||||||
|
} sdrplay_api_Rsp2_AntennaSelectT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Rsp2_AMPORT_1 = 1,
|
||||||
|
sdrplay_api_Rsp2_AMPORT_2 = 0,
|
||||||
|
} sdrplay_api_Rsp2_AmPortSelectT;
|
||||||
|
|
||||||
|
// RSP2 parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char extRefOutputEn; // default: 0
|
||||||
|
} sdrplay_api_Rsp2ParamsT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char biasTEnable; // default: 0
|
||||||
|
sdrplay_api_Rsp2_AmPortSelectT amPortSel; // default: sdrplay_api_Rsp2_AMPORT_2
|
||||||
|
sdrplay_api_Rsp2_AntennaSelectT antennaSel; // default: sdrplay_api_Rsp2_ANTENNA_A
|
||||||
|
unsigned char rfNotchEnable; // default: 0
|
||||||
|
} sdrplay_api_Rsp2TunerParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_RSP2_H
|
||||||
40
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_rspDuo.h
Normal file
40
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_rspDuo.h
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#ifndef SDRPLAY_API_RSPduo_H
|
||||||
|
#define SDRPLAY_API_RSPduo_H
|
||||||
|
|
||||||
|
#define RSPDUO_NUM_LNA_STATES 10
|
||||||
|
#define RSPDUO_NUM_LNA_STATES_AMPORT 5
|
||||||
|
#define RSPDUO_NUM_LNA_STATES_AM 7
|
||||||
|
#define RSPDUO_NUM_LNA_STATES_LBAND 9
|
||||||
|
|
||||||
|
// RSPduo parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_RspDuoMode_Unknown = 0,
|
||||||
|
sdrplay_api_RspDuoMode_Single_Tuner = 1,
|
||||||
|
sdrplay_api_RspDuoMode_Dual_Tuner = 2,
|
||||||
|
sdrplay_api_RspDuoMode_Master = 4,
|
||||||
|
sdrplay_api_RspDuoMode_Slave = 8,
|
||||||
|
} sdrplay_api_RspDuoModeT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_RspDuo_AMPORT_1 = 1,
|
||||||
|
sdrplay_api_RspDuo_AMPORT_2 = 0,
|
||||||
|
} sdrplay_api_RspDuo_AmPortSelectT;
|
||||||
|
|
||||||
|
// RSPduo parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int extRefOutputEn; // default: 0
|
||||||
|
} sdrplay_api_RspDuoParamsT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char biasTEnable; // default: 0
|
||||||
|
sdrplay_api_RspDuo_AmPortSelectT tuner1AmPortSel; // default: sdrplay_api_RspDuo_AMPORT_2
|
||||||
|
unsigned char tuner1AmNotchEnable; // default: 0
|
||||||
|
unsigned char rfNotchEnable; // default: 0
|
||||||
|
unsigned char rfDabNotchEnable; // default: 0
|
||||||
|
} sdrplay_api_RspDuoTunerParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_RSPduo_H
|
||||||
46
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_rspDx.h
Normal file
46
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_rspDx.h
Normal file
@@ -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
|
||||||
21
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_rx_channel.h
Normal file
21
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_rx_channel.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#ifndef SDRPLAY_API_RX_CHANNEL_H
|
||||||
|
#define SDRPLAY_API_RX_CHANNEL_H
|
||||||
|
|
||||||
|
#include "sdrplay_api_tuner.h"
|
||||||
|
#include "sdrplay_api_control.h"
|
||||||
|
#include "sdrplay_api_rsp1a.h"
|
||||||
|
#include "sdrplay_api_rsp2.h"
|
||||||
|
#include "sdrplay_api_rspDuo.h"
|
||||||
|
#include "sdrplay_api_rspDx.h"
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_TunerParamsT tunerParams;
|
||||||
|
sdrplay_api_ControlParamsT ctrlParams;
|
||||||
|
sdrplay_api_Rsp1aTunerParamsT rsp1aTunerParams;
|
||||||
|
sdrplay_api_Rsp2TunerParamsT rsp2TunerParams;
|
||||||
|
sdrplay_api_RspDuoTunerParamsT rspDuoTunerParams;
|
||||||
|
sdrplay_api_RspDxTunerParamsT rspDxTunerParams;
|
||||||
|
} sdrplay_api_RxChannelParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_RX_CHANNEL_H
|
||||||
93
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_tuner.h
Normal file
93
artifacts/sdrplay-api-headers/v3_11/sdrplay_api_tuner.h
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
#ifndef SDRPLAY_API_TUNER_H
|
||||||
|
#define SDRPLAY_API_TUNER_H
|
||||||
|
|
||||||
|
#define MAX_BB_GR (59)
|
||||||
|
|
||||||
|
// Tuner parameter enums
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_BW_Undefined = 0,
|
||||||
|
sdrplay_api_BW_0_200 = 200,
|
||||||
|
sdrplay_api_BW_0_300 = 300,
|
||||||
|
sdrplay_api_BW_0_600 = 600,
|
||||||
|
sdrplay_api_BW_1_536 = 1536,
|
||||||
|
sdrplay_api_BW_5_000 = 5000,
|
||||||
|
sdrplay_api_BW_6_000 = 6000,
|
||||||
|
sdrplay_api_BW_7_000 = 7000,
|
||||||
|
sdrplay_api_BW_8_000 = 8000
|
||||||
|
} sdrplay_api_Bw_MHzT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_IF_Undefined = -1,
|
||||||
|
sdrplay_api_IF_Zero = 0,
|
||||||
|
sdrplay_api_IF_0_450 = 450,
|
||||||
|
sdrplay_api_IF_1_620 = 1620,
|
||||||
|
sdrplay_api_IF_2_048 = 2048
|
||||||
|
} sdrplay_api_If_kHzT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_LO_Undefined = 0,
|
||||||
|
sdrplay_api_LO_Auto = 1,
|
||||||
|
sdrplay_api_LO_120MHz = 2,
|
||||||
|
sdrplay_api_LO_144MHz = 3,
|
||||||
|
sdrplay_api_LO_168MHz = 4
|
||||||
|
} sdrplay_api_LoModeT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_EXTENDED_MIN_GR = 0,
|
||||||
|
sdrplay_api_NORMAL_MIN_GR = 20
|
||||||
|
} sdrplay_api_MinGainReductionT;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sdrplay_api_Tuner_Neither = 0,
|
||||||
|
sdrplay_api_Tuner_A = 1,
|
||||||
|
sdrplay_api_Tuner_B = 2,
|
||||||
|
sdrplay_api_Tuner_Both = 3,
|
||||||
|
} sdrplay_api_TunerSelectT;
|
||||||
|
|
||||||
|
// Tuner parameter structs
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
float curr;
|
||||||
|
float max;
|
||||||
|
float min;
|
||||||
|
} sdrplay_api_GainValuesT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int gRdB; // default: 50
|
||||||
|
unsigned char LNAstate; // default: 0
|
||||||
|
unsigned char syncUpdate; // default: 0
|
||||||
|
sdrplay_api_MinGainReductionT minGr; // default: sdrplay_api_NORMAL_MIN_GR
|
||||||
|
sdrplay_api_GainValuesT gainVals; // output parameter
|
||||||
|
} sdrplay_api_GainT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
double rfHz; // default: 200000000.0
|
||||||
|
unsigned char syncUpdate; // default: 0
|
||||||
|
} sdrplay_api_RfFreqT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned char dcCal; // default: 3 (Periodic mode)
|
||||||
|
unsigned char speedUp; // default: 0 (No speedup)
|
||||||
|
int trackTime; // default: 1 (=> time in uSec = (72 * 3 * trackTime) / 24e6 = 9uSec)
|
||||||
|
int refreshRateTime; // default: 2048 (=> time in uSec = (72 * 3 * refreshRateTime) / 24e6 = 18432uSec)
|
||||||
|
} sdrplay_api_DcOffsetTunerT;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
sdrplay_api_Bw_MHzT bwType; // default: sdrplay_api_BW_0_200
|
||||||
|
sdrplay_api_If_kHzT ifType; // default: sdrplay_api_IF_Zero
|
||||||
|
sdrplay_api_LoModeT loMode; // default: sdrplay_api_LO_Auto
|
||||||
|
sdrplay_api_GainT gain;
|
||||||
|
sdrplay_api_RfFreqT rfFreq;
|
||||||
|
sdrplay_api_DcOffsetTunerT dcOffsetTuner;
|
||||||
|
} sdrplay_api_TunerParamsT;
|
||||||
|
|
||||||
|
#endif //SDRPLAY_API_TUNER_H
|
||||||
280
build.gradle
280
build.gradle
@@ -1,6 +1,8 @@
|
|||||||
|
import java.text.SimpleDateFormat
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -16,6 +18,29 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
* ****************************************************************************
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instructions for building/compiling the sdrtrunk application.
|
||||||
|
*
|
||||||
|
* Prerequisites:
|
||||||
|
* Install and configure an OpenJDK version 19+ that includes the JavaFX modules (e.g. Bellsoft Liberica JDK)
|
||||||
|
* - Optional: install and configure Gradle 7.6+
|
||||||
|
*
|
||||||
|
* Scenario 1: run the application via gradle command line from the source code root directory:
|
||||||
|
* command: ./gradlew run
|
||||||
|
*
|
||||||
|
* Scenario 2: create an application release for the current operating system
|
||||||
|
* command: ./gradlew runtimeZipCurrent
|
||||||
|
* Note: release image is located in the /build/image/ directory
|
||||||
|
*
|
||||||
|
* Scenario 3: create releases for Linux and OSX operating systems using downloaded JDKs
|
||||||
|
* command: ./gradlew runtimeZipOthers
|
||||||
|
* Note: release images are located in the /build/image/ directory
|
||||||
|
*
|
||||||
|
* Scenario 4: create release for Windows operating system using downloaded JDK
|
||||||
|
* command: ./gradlew runtimeZipWindows
|
||||||
|
* Note: release image is located in the /build/image/ directory
|
||||||
|
*/
|
||||||
plugins {
|
plugins {
|
||||||
id 'application'
|
id 'application'
|
||||||
id 'java'
|
id 'java'
|
||||||
@@ -28,8 +53,14 @@ repositories {
|
|||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
}
|
}
|
||||||
|
|
||||||
version = '0.5.1'
|
version = '0.6.0-alpha5'
|
||||||
sourceCompatibility = '17'
|
|
||||||
|
//Java 19 is required for this version of the Project Panama preview/incubator feature
|
||||||
|
java {
|
||||||
|
toolchain {
|
||||||
|
languageVersion = JavaLanguageVersion.of(19)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main.java.srcDirs 'src/main'
|
main.java.srcDirs 'src/main'
|
||||||
@@ -90,19 +121,46 @@ dependencies {
|
|||||||
implementation 'pl.edu.icm:JLargeArrays:1.6'
|
implementation 'pl.edu.icm:JLargeArrays:1.6'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def os = org.gradle.nativeplatform.platform.internal.DefaultNativePlatform.currentOperatingSystem
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is needed for the JDK17 vector API ... until it moves out of incubation
|
* This is needed for the JDK19 panama and vector API ... until it moves out of incubation or preview
|
||||||
*/
|
*/
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs.add("--enable-preview") //Panama Foreign Function/Memory is preview in JDK 19
|
||||||
options.compilerArgs.add("--add-modules=jdk.incubator.vector") //Needed while Panama Vector API remains in incubator
|
options.compilerArgs.add("--add-modules=jdk.incubator.vector") //Needed while Panama Vector API remains in incubator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JVM Arguments for running the application on Windows.
|
||||||
|
*/
|
||||||
|
def jvmArgsWindows =
|
||||||
|
['--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED', //Needed for controls-fx.jar
|
||||||
|
'--add-exports=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED', //windows users for JIDE
|
||||||
|
'--add-modules=jdk.incubator.vector', //Needed while Project Panama API is still in incubator
|
||||||
|
'--enable-preview', //Project Panama Vector & Foreign Function APIs remain in incubator
|
||||||
|
'--enable-native-access=ALL-UNNAMED',
|
||||||
|
'-Djava.library.path=c:\\Program Files\\SDRplay\\API\\x64'] //Allows Project Panama Foreign Function access to system library
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JVM Arguments for running the application on Linux.
|
||||||
|
*/
|
||||||
|
def jvmArgsLinux =
|
||||||
|
['--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED', //Needed for controls-fx.jar
|
||||||
|
'--add-modules=jdk.incubator.vector', //Needed while Project Panama API is still in incubator
|
||||||
|
'--enable-preview', //Project Panama Vector & Foreign Function APIs remain in incubator
|
||||||
|
'--enable-native-access=ALL-UNNAMED',
|
||||||
|
'-Djava.library.path=/usr/local/lib'] //Allows Project Panama Foreign Function access to system library
|
||||||
|
|
||||||
application {
|
application {
|
||||||
mainClassName = "io.github.dsheirer.gui.SDRTrunk"
|
mainClassName = "io.github.dsheirer.gui.SDRTrunk"
|
||||||
applicationDefaultJvmArgs =
|
|
||||||
['--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED', //Needed for controls-fx.jar
|
if(os.isWindows()) {
|
||||||
'--add-modules=jdk.incubator.vector', //Needed while Panama Vector API remains in incubator
|
applicationDefaultJvmArgs = jvmArgsWindows
|
||||||
'--add-exports=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED'] //Windows Swing - jide-oss library
|
}
|
||||||
|
else {
|
||||||
|
applicationDefaultJvmArgs = jvmArgsLinux
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
@@ -111,7 +169,7 @@ jar {
|
|||||||
'Implementation-Title' : 'sdrtrunk project',
|
'Implementation-Title' : 'sdrtrunk project',
|
||||||
'Implementation-Version' : archiveVersion,
|
'Implementation-Version' : archiveVersion,
|
||||||
'Created-By' : "Gradle ${gradle.gradleVersion}",
|
'Created-By' : "Gradle ${gradle.gradleVersion}",
|
||||||
'Build-Timestamp' : new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
|
'Build-Timestamp' : new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
|
||||||
'Build-JDK' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']}",
|
'Build-JDK' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']}",
|
||||||
'Build-OS' : "${System.properties['os.name']} (${System.properties['os.arch']} ${System.properties['os.version']}"
|
'Build-OS' : "${System.properties['os.name']} (${System.properties['os.arch']} ${System.properties['os.version']}"
|
||||||
)
|
)
|
||||||
@@ -145,84 +203,152 @@ String jdk_osx_x86_64 = jdk_base + 'osx-x64/jdk-19.0.1-full.jdk'
|
|||||||
String jdk_osx_aarch64 = jdk_base + 'osx-arm64/jdk-19.0.1-full.jdk'
|
String jdk_osx_aarch64 = jdk_base + 'osx-arm64/jdk-19.0.1-full.jdk'
|
||||||
String jdk_windows_x86_64 = jdk_base + 'windows-x64/jdk-19.0.1-full'
|
String jdk_windows_x86_64 = jdk_base + 'windows-x64/jdk-19.0.1-full'
|
||||||
|
|
||||||
boolean hasTargetJdks = file(jdk_linux_x86_64).exists() || file(jdk_linux_aarch64).exists() ||
|
/**
|
||||||
file(jdk_osx_x86_64).exists() || file(jdk_osx_aarch64).exists() || file(jdk_windows_x86_64).exists()
|
* Download URLs to download the JDK as part of the gradle build packaging process
|
||||||
|
*/
|
||||||
|
def jdk_download_base = "https://download.bell-sw.com/java/19.0.1+11/bellsoft-jdk19.0.1+11-"
|
||||||
|
def jdk_download_suffix = "-full.tar.gz"
|
||||||
|
def jdk_download_linux_aarch64 = jdk_download_base + "linux-aarch64" + jdk_download_suffix
|
||||||
|
def jdk_download_linux_x86_64 = jdk_download_base + "linux-amd64" + jdk_download_suffix
|
||||||
|
def jdk_download_osx_x86_64 = jdk_download_base + "macos-aarch64" + jdk_download_suffix
|
||||||
|
def jdk_download_osx_aarch64 = jdk_download_base + "macos-amd64" + jdk_download_suffix
|
||||||
|
def jdk_download_windows_x86_64 = jdk_download_base + "windows-amd64-full.zip"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Auto-download target JDKs. Defaults to false, or the user can override via the gradle command line by
|
* Configures the runtime zip task with additional options/settings.
|
||||||
* including this option: '-PdownloadJdks=true'
|
* @param rt task to configure
|
||||||
|
* @param jvmArgs to use (windows or linux)
|
||||||
|
* @return configured task.
|
||||||
*/
|
*/
|
||||||
boolean downloadJdks = project.hasProperty('downloadJdks') ? project.getProperty('downloadJdks') : false
|
def configure(org.beryx.runtime.RuntimeZipTask rt, List<String> jvmArgs) {
|
||||||
|
//Use the correct set of JVM arguments
|
||||||
/**
|
rt.extension.launcherData.get().jvmArgs = jvmArgs
|
||||||
* Beryx Runtime plugin for creating OS and CPU targeted build(s) of the software.
|
|
||||||
*
|
|
||||||
* Option 1: Create a single target build using the locally installed JDK, or optionally create target builds for
|
|
||||||
* all OS and CPU targets when pre-downloaded target JDKs are available (see 'jdk_*' properties above).
|
|
||||||
*
|
|
||||||
* >: gradle runtimeZip
|
|
||||||
*
|
|
||||||
* Option 2: Create all OS and CPU target builds by automatically downloading all JDKs needed to build the target images
|
|
||||||
*
|
|
||||||
* >: gradle runtimeZip -PdownloadJdks=true
|
|
||||||
*/
|
|
||||||
runtime {
|
|
||||||
//Build by automatically downloading JDKs for the OS and CPU targets
|
|
||||||
if(downloadJdks) {
|
|
||||||
println("Building all runtime images")
|
|
||||||
println("The [ > jre: ] build phase downloads several target JDKs and this may take a while ... please wait")
|
|
||||||
targetPlatform(targetLinuxAarch64) {
|
|
||||||
jdkHome = jdkDownload("https://download.bell-sw.com/java/19.0.1+11/bellsoft-jdk19.0.1+11-linux-aarch64-full.tar.gz")
|
|
||||||
}
|
|
||||||
targetPlatform(targetLinuxX86_64) {
|
|
||||||
jdkHome = jdkDownload("https://download.bell-sw.com/java/19.0.1+11/bellsoft-jdk19.0.1+11-linux-amd64-full.tar.gz")
|
|
||||||
}
|
|
||||||
targetPlatform(targetOsxAarch64) {
|
|
||||||
jdkHome = jdkDownload("https://download.bell-sw.com/java/19.0.1+11/bellsoft-jdk19.0.1+11-macos-aarch64-full.tar.gz")
|
|
||||||
}
|
|
||||||
targetPlatform(targetOsxX86_64) {
|
|
||||||
jdkHome = jdkDownload("https://download.bell-sw.com/java/19.0.1+11/bellsoft-jdk19.0.1+11-macos-amd64-full.tar.gz")
|
|
||||||
}
|
|
||||||
targetPlatform(targetWindowsX86_64) {
|
|
||||||
jdkHome = jdkDownload("https://download.bell-sw.com/java/19.0.1+11/bellsoft-jdk19.0.1+11-windows-amd64-full.zip")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Build using pre-downloaded JDKs
|
|
||||||
else if(hasTargetJdks) {
|
|
||||||
println("Building all runtime images using pre-downloaded JDKs")
|
|
||||||
if(file(jdk_linux_aarch64).exists()) {
|
|
||||||
targetPlatform(targetLinuxAarch64, jdk_linux_aarch64)
|
|
||||||
}
|
|
||||||
if(file(jdk_linux_x86_64).exists()) {
|
|
||||||
targetPlatform(targetLinuxX86_64, jdk_linux_x86_64)
|
|
||||||
}
|
|
||||||
if(file(jdk_osx_aarch64).exists()) {
|
|
||||||
targetPlatform(targetOsxAarch64, jdk_osx_aarch64)
|
|
||||||
}
|
|
||||||
if(file(jdk_osx_x86_64).exists()) {
|
|
||||||
targetPlatform(targetOsxX86_64, jdk_osx_x86_64)
|
|
||||||
}
|
|
||||||
if(file(jdk_windows_x86_64).exists()) {
|
|
||||||
targetPlatform(targetWindowsX86_64, jdk_windows_x86_64)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//Build using locally installed JDK only
|
|
||||||
else {
|
|
||||||
println("Building a single runtime image using locally installed JDK")
|
|
||||||
}
|
|
||||||
|
|
||||||
//Additional modules to include with auto-detected modules.
|
//Additional modules to include with auto-detected modules.
|
||||||
//jdk.crypto.ec needed for HTTPS connections (broadcastify calls & map tile server)
|
//jdk.crypto.ec - needed for HTTPS connections (broadcastify calls & map tile server)
|
||||||
|
//jdk.incubator.vector - needed for Project Panama foreign function and vector apis
|
||||||
//jdk.accessibility is used with assistive technologies like screen readers
|
//jdk.accessibility is used with assistive technologies like screen readers
|
||||||
modules = ['jdk.crypto.ec','jdk.accessibility']
|
rt.extension.addModules('jdk.crypto.ec', 'jdk.incubator.vector', 'jdk.accessibility')
|
||||||
|
|
||||||
//Use auto-detected modules and 'add' any specified modules.
|
//Use auto-detected modules and 'add' any specified modules.
|
||||||
additive = true
|
rt.extension.additive.set(true)
|
||||||
|
|
||||||
//Recommended options for reducing/shrinking runtime target image size
|
//Recommended options for reducing/shrinking runtime target image size
|
||||||
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
|
rt.extension.addOptions('--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages')
|
||||||
|
|
||||||
//Runtime images have auto appended version in image zip name. Override to include version in single target image.
|
//Runtime images have auto appended version in image zip name. Override to include version in single target image.
|
||||||
imageZip = (hasTargetJdks | downloadJdks) ? file("$buildDir/image/sdr-trunk.zip") :
|
rt.extension.imageZip.set(file("$buildDir/image/sdr-trunk.zip"))
|
||||||
file("$buildDir/image/sdr-trunk-" + version + ".zip")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a release package for the current operating system.
|
||||||
|
*
|
||||||
|
* Note: you cannot create both Windows and Linux releases at the same time due to limitations of the Runtime plugin
|
||||||
|
*
|
||||||
|
* Usage: gradle runtimeZipCurrent
|
||||||
|
* Usage: gradlew runtimeZipCurrent (windows - using gradlew)
|
||||||
|
* Usage: ./gradlew runtimeZipCurrent (linux - using gradlew)
|
||||||
|
*/
|
||||||
|
tasks.register('runtimeZipCurrent', org.beryx.runtime.RuntimeZipTask) {rt ->
|
||||||
|
def arch = System.properties.getProperty("os.arch")
|
||||||
|
def javaHome = org.gradle.internal.jvm.Jvm.current().getJavaHome().toString()
|
||||||
|
|
||||||
|
if(os.isWindows()) {
|
||||||
|
rt.extension.targetPlatform(targetWindowsX86_64, javaHome)
|
||||||
|
configure(rt, jvmArgsWindows)
|
||||||
|
}
|
||||||
|
else if(os.isLinux())
|
||||||
|
{
|
||||||
|
if(arch.equals("amd64")) {
|
||||||
|
rt.extension.targetPlatform(targetLinuxX86_64, javaHome)
|
||||||
|
}
|
||||||
|
else if(arch.equals("aarch64")) {
|
||||||
|
rt.extension.targetPlatform(targetLinuxAarch64, javaHome)
|
||||||
|
}
|
||||||
|
configure(rt, jvmArgsLinux)
|
||||||
|
}
|
||||||
|
else if(os.isMacOsX())
|
||||||
|
{
|
||||||
|
if(arch.equals("amd64")) {
|
||||||
|
rt.extension.targetPlatform(targetOsxX86_64, javaHome)
|
||||||
|
}
|
||||||
|
else if(arch.equals("aarch64")) {
|
||||||
|
rt.extension.targetPlatform(targetOsxAarch64, javaHome)
|
||||||
|
}
|
||||||
|
configure(rt, jvmArgsLinux)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a Windows release package.
|
||||||
|
*
|
||||||
|
* Note: you cannot create both Windows and Linux releases at the same time due to limitations of the Runtime plugin
|
||||||
|
*
|
||||||
|
* Usage: gradle runtimeZipWindows
|
||||||
|
* Usage: gradlew runtimeZipWindows (windows - using gradlew)
|
||||||
|
* Usage: ./gradlew runtimeZipWindows (linux - using gradlew)
|
||||||
|
*/
|
||||||
|
tasks.register('runtimeZipWindows', org.beryx.runtime.RuntimeZipTask) {rt ->
|
||||||
|
if(file(jdk_windows_x86_64).exists()) {
|
||||||
|
rt.extension.targetPlatform(targetWindowsX86_64, jdk_windows_x86_64, [])
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
rt.extension.targetPlatform(targetWindowsX86_64) {
|
||||||
|
jdkHome = jdkDownload(jdk_download_windows_x86_64)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
configure(rt, jvmArgsWindows)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates Linux & OSX release packages.
|
||||||
|
*
|
||||||
|
* Note: you cannot create both Windows and Linux releases at the same time due to limitations of the Runtime plugin
|
||||||
|
*
|
||||||
|
* Usage: gradle runtimeZipOthers
|
||||||
|
* Usage: gradlew runtimeZipOthers (windows - using gradlew)
|
||||||
|
* Usage: ./gradlew runtimeZipOthers (linux - using gradlew)
|
||||||
|
*/
|
||||||
|
tasks.register('runtimeZipOthers', org.beryx.runtime.RuntimeZipTask) {rt ->
|
||||||
|
//Linux aarch64
|
||||||
|
if(file(jdk_linux_aarch64).exists()) {
|
||||||
|
rt.extension.targetPlatform(targetLinuxAarch64, jdk_linux_aarch64, [])
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
rt.extension.targetPlatform(targetLinuxAarch64) {
|
||||||
|
jdkHome = jdkDownload(jdk_download_linux_aarch64)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Linux x86-64
|
||||||
|
if(file(jdk_linux_x86_64).exists()) {
|
||||||
|
rt.extension.targetPlatform(targetLinuxX86_64, jdk_linux_x86_64, [])
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
rt.extension.targetPlatform(targetLinuxX86_64) {
|
||||||
|
jdkHome = jdkDownload(jdk_download_linux_x86_64)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//OSX aarch64
|
||||||
|
if(file(jdk_osx_aarch64).exists()) {
|
||||||
|
rt.extension.targetPlatform(targetOsxAarch64, jdk_osx_aarch64, [])
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
rt.extension.targetPlatform(targetOsxAarch64) {
|
||||||
|
jdkHome = jdkDownload(jdk_download_osx_aarch64)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Linux x86-64
|
||||||
|
if(file(jdk_osx_x86_64).exists()) {
|
||||||
|
rt.extension.targetPlatform(targetOsxX86_64, jdk_osx_x86_64, [])
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
rt.extension.targetPlatform(targetOsxX86_64) {
|
||||||
|
jdkHome = jdkDownload(jdk_download_osx_x86_64)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
configure(rt, jvmArgsLinux);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ******************************************************************************
|
* *****************************************************************************
|
||||||
* sdrtrunk
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
* *****************************************************************************
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.github.dsheirer.audio;
|
package io.github.dsheirer.audio;
|
||||||
@@ -106,7 +105,7 @@ public abstract class AbstractAudioModule extends Module implements IAudioSegmen
|
|||||||
* Gets the current audio segment, or creates a new audio segment as necessary and broadcasts it to any registered
|
* Gets the current audio segment, or creates a new audio segment as necessary and broadcasts it to any registered
|
||||||
* listener(s).
|
* listener(s).
|
||||||
*/
|
*/
|
||||||
protected AudioSegment getAudioSegment()
|
public AudioSegment getAudioSegment()
|
||||||
{
|
{
|
||||||
synchronized(this)
|
synchronized(this)
|
||||||
{
|
{
|
||||||
@@ -135,7 +134,7 @@ public abstract class AbstractAudioModule extends Module implements IAudioSegmen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addAudio(float[] audioBuffer)
|
public void addAudio(float[] audioBuffer)
|
||||||
{
|
{
|
||||||
AudioSegment audioSegment = getAudioSegment();
|
AudioSegment audioSegment = getAudioSegment();
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,21 @@
|
|||||||
/*******************************************************************************
|
/*
|
||||||
* sdr-trunk
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* 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
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
|
* it under the terms of the GNU General Public License as published by
|
||||||
* later version.
|
* 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
|
* This program is distributed in the hope that it will be useful,
|
||||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
* 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.
|
* You should have received a copy of the GNU General Public License
|
||||||
* If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
*
|
* ****************************************************************************
|
||||||
******************************************************************************/
|
*/
|
||||||
|
|
||||||
package io.github.dsheirer.audio;
|
package io.github.dsheirer.audio;
|
||||||
|
|
||||||
@@ -26,15 +29,6 @@ import io.github.dsheirer.identifier.IdentifierUpdateNotification;
|
|||||||
import io.github.dsheirer.identifier.MutableIdentifierCollection;
|
import io.github.dsheirer.identifier.MutableIdentifierCollection;
|
||||||
import io.github.dsheirer.sample.Broadcaster;
|
import io.github.dsheirer.sample.Broadcaster;
|
||||||
import io.github.dsheirer.sample.Listener;
|
import io.github.dsheirer.sample.Listener;
|
||||||
import javafx.beans.property.BooleanProperty;
|
|
||||||
import javafx.beans.property.IntegerProperty;
|
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
|
||||||
import javafx.beans.property.SimpleIntegerProperty;
|
|
||||||
import javafx.collections.FXCollections;
|
|
||||||
import javafx.collections.ObservableSet;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -43,6 +37,14 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
import javafx.beans.property.BooleanProperty;
|
||||||
|
import javafx.beans.property.IntegerProperty;
|
||||||
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
|
import javafx.beans.property.SimpleIntegerProperty;
|
||||||
|
import javafx.collections.FXCollections;
|
||||||
|
import javafx.collections.ObservableSet;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Audio segment containing all related metadata and a dynamic collection of audio packets. An audio segment can be
|
* Audio segment containing all related metadata and a dynamic collection of audio packets. An audio segment can be
|
||||||
@@ -138,6 +140,15 @@ public class AudioSegment implements Listener<IdentifierUpdateNotification>
|
|||||||
return mComplete;
|
return mComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if this audio segment is completed.
|
||||||
|
* @return true if completed.
|
||||||
|
*/
|
||||||
|
public boolean isComplete()
|
||||||
|
{
|
||||||
|
return mComplete.get();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Duplicate call audio property. This flag is set to true whenever a duplicate call detection function detects
|
* Duplicate call audio property. This flag is set to true whenever a duplicate call detection function detects
|
||||||
* an audio segment is a duplicate.
|
* an audio segment is a duplicate.
|
||||||
|
|||||||
@@ -1,23 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* * ******************************************************************************
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* * Copyright (C) 2014-2019 Dennis Sheirer
|
* it under the terms of the GNU General Public License as published by
|
||||||
* *
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* * This program is free software: you can redistribute it and/or modify
|
* (at your option) any later version.
|
||||||
* * it under the terms of the GNU General Public License as published by
|
|
||||||
* * the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* * (at your option) any later version.
|
|
||||||
* *
|
|
||||||
* * This program is distributed in the hope that it will be useful,
|
|
||||||
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* * GNU General Public License for more details.
|
|
||||||
* *
|
|
||||||
* * You should have received a copy of the GNU General Public License
|
|
||||||
* * along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
* * *****************************************************************************
|
|
||||||
*
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.github.dsheirer.audio.codec.mbe;
|
package io.github.dsheirer.audio.codec.mbe;
|
||||||
@@ -32,11 +29,6 @@ import io.github.dsheirer.message.IMessageListener;
|
|||||||
import io.github.dsheirer.preference.PreferenceType;
|
import io.github.dsheirer.preference.PreferenceType;
|
||||||
import io.github.dsheirer.preference.UserPreferences;
|
import io.github.dsheirer.preference.UserPreferences;
|
||||||
import io.github.dsheirer.sample.Listener;
|
import io.github.dsheirer.sample.Listener;
|
||||||
import jmbe.iface.IAudioCodec;
|
|
||||||
import jmbe.iface.IAudioCodecLibrary;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
@@ -44,15 +36,20 @@ import java.net.URLClassLoader;
|
|||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import jmbe.iface.IAudioCodec;
|
||||||
|
import jmbe.iface.IAudioCodecLibrary;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public abstract class JmbeAudioModule extends AbstractAudioModule implements Listener<IMessage>, IMessageListener,
|
public abstract class JmbeAudioModule extends AbstractAudioModule implements Listener<IMessage>, IMessageListener,
|
||||||
ISquelchStateListener
|
ISquelchStateListener
|
||||||
{
|
{
|
||||||
private static final Logger mLog = LoggerFactory.getLogger(JmbeAudioModule.class);
|
private static final Logger mLog = LoggerFactory.getLogger(JmbeAudioModule.class);
|
||||||
private static final String JMBE_AUDIO_LIBRARY = "JMBE";
|
private static final String JMBE_AUDIO_LIBRARY = "JMBE";
|
||||||
private static List<String> mLibraryLoadStatusLogged = new ArrayList<>();
|
private static final List<String> mLibraryLoadStatusLogged = new ArrayList<>();
|
||||||
private IAudioCodec mAudioCodec;
|
private IAudioCodec mAudioCodec;
|
||||||
private UserPreferences mUserPreferences;
|
private final UserPreferences mUserPreferences;
|
||||||
|
private static Class sLoadedJmbeAudioConverterClass;
|
||||||
|
|
||||||
public JmbeAudioModule(UserPreferences userPreferences, AliasList aliasList, int timeslot)
|
public JmbeAudioModule(UserPreferences userPreferences, AliasList aliasList, int timeslot)
|
||||||
{
|
{
|
||||||
@@ -70,7 +67,7 @@ public abstract class JmbeAudioModule extends AbstractAudioModule implements Lis
|
|||||||
mAudioCodec = null;
|
mAudioCodec = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IAudioCodec getAudioCodec()
|
public IAudioCodec getAudioCodec()
|
||||||
{
|
{
|
||||||
return mAudioCodec;
|
return mAudioCodec;
|
||||||
}
|
}
|
||||||
@@ -110,36 +107,65 @@ public abstract class JmbeAudioModule extends AbstractAudioModule implements Lis
|
|||||||
protected abstract String getCodecName();
|
protected abstract String getCodecName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads audio frame processing chain. Constructs an imbe targetdataline
|
* Loads JMBE audio converter library class and then instantiates new converter instances from the loaded class.
|
||||||
* to receive the raw imbe frames. Adds an IMBE to 8k PCM format conversion
|
|
||||||
* stream wrapper. Finally, adds an upsampling (8k to 48k) stream wrapper.
|
|
||||||
*/
|
*/
|
||||||
protected void loadConverter()
|
protected void loadConverter()
|
||||||
{
|
{
|
||||||
IAudioCodec audioConverter = null;
|
IAudioCodec audioConverter = null;
|
||||||
|
|
||||||
|
if(sLoadedJmbeAudioConverterClass == null)
|
||||||
|
{
|
||||||
Path path = mUserPreferences.getJmbeLibraryPreference().getPathJmbeLibrary();
|
Path path = mUserPreferences.getJmbeLibraryPreference().getPathJmbeLibrary();
|
||||||
|
|
||||||
if(path != null)
|
if(path != null)
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
if(!mLibraryLoadStatusLogged.contains(JMBE_AUDIO_LIBRARY))
|
if(!mLibraryLoadStatusLogged.contains(JMBE_AUDIO_LIBRARY))
|
||||||
{
|
{
|
||||||
mLog.info("Loading JMBE library from [" + path.toString() + "]");
|
mLog.info("Loading JMBE library from [" + path + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
URLClassLoader childClassLoader = new URLClassLoader(new URL[]{path.toUri().toURL()},
|
URLClassLoader childClassLoader = new URLClassLoader(new URL[]{path.toUri().toURL()},
|
||||||
this.getClass().getClassLoader());
|
this.getClass().getClassLoader());
|
||||||
|
|
||||||
Class classToLoad = Class.forName("jmbe.JMBEAudioLibrary", true, childClassLoader);
|
sLoadedJmbeAudioConverterClass = Class.forName("jmbe.JMBEAudioLibrary", true, childClassLoader);
|
||||||
|
}
|
||||||
Object instance = classToLoad.getDeclaredConstructor().newInstance();
|
catch(IllegalArgumentException iae)
|
||||||
|
|
||||||
if(instance instanceof IAudioCodecLibrary)
|
|
||||||
{
|
{
|
||||||
IAudioCodecLibrary library = (IAudioCodecLibrary)instance;
|
if(!mLibraryLoadStatusLogged.contains(JMBE_AUDIO_LIBRARY + getCodecName()))
|
||||||
|
{
|
||||||
|
mLog.error("Couldn't load JMBE audio conversion library - " + iae.getMessage());
|
||||||
|
mLibraryLoadStatusLogged.add(JMBE_AUDIO_LIBRARY + getCodecName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(MalformedURLException mue)
|
||||||
|
{
|
||||||
|
if(!mLibraryLoadStatusLogged.contains(JMBE_AUDIO_LIBRARY))
|
||||||
|
{
|
||||||
|
mLog.error("Couldn't load JMBE audio conversion library from path [" + path + "]");
|
||||||
|
mLibraryLoadStatusLogged.add(JMBE_AUDIO_LIBRARY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(ClassNotFoundException e1)
|
||||||
|
{
|
||||||
|
if(!mLibraryLoadStatusLogged.contains(JMBE_AUDIO_LIBRARY))
|
||||||
|
{
|
||||||
|
mLog.error("Couldn't load JMBE audio conversion library - class not found");
|
||||||
|
mLibraryLoadStatusLogged.add(JMBE_AUDIO_LIBRARY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(sLoadedJmbeAudioConverterClass != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Object instance = sLoadedJmbeAudioConverterClass.getDeclaredConstructor().newInstance();
|
||||||
|
|
||||||
|
if(instance instanceof IAudioCodecLibrary library)
|
||||||
|
{
|
||||||
if((library.getMajorVersion() == 1 && library.getMinorVersion() >= 0 &&
|
if((library.getMajorVersion() == 1 && library.getMinorVersion() >= 0 &&
|
||||||
library.getBuildVersion() >= 0) || library.getMajorVersion() >= 1)
|
library.getBuildVersion() >= 0) || library.getMajorVersion() >= 1)
|
||||||
{
|
{
|
||||||
@@ -169,38 +195,6 @@ public abstract class JmbeAudioModule extends AbstractAudioModule implements Lis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(IllegalArgumentException iae)
|
|
||||||
{
|
|
||||||
if(!mLibraryLoadStatusLogged.contains(JMBE_AUDIO_LIBRARY + getCodecName()))
|
|
||||||
{
|
|
||||||
mLog.error("Couldn't load JMBE audio conversion library - " + iae.getMessage());
|
|
||||||
mLibraryLoadStatusLogged.add(JMBE_AUDIO_LIBRARY + getCodecName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(NoSuchMethodException nsme)
|
|
||||||
{
|
|
||||||
if(!mLibraryLoadStatusLogged.contains(JMBE_AUDIO_LIBRARY))
|
|
||||||
{
|
|
||||||
mLog.error("Couldn't load JMBE audio conversion library - no such method exception");
|
|
||||||
mLibraryLoadStatusLogged.add(JMBE_AUDIO_LIBRARY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(MalformedURLException mue)
|
|
||||||
{
|
|
||||||
if(!mLibraryLoadStatusLogged.contains(JMBE_AUDIO_LIBRARY))
|
|
||||||
{
|
|
||||||
mLog.error("Couldn't load JMBE audio conversion library from path [" + path + "]");
|
|
||||||
mLibraryLoadStatusLogged.add(JMBE_AUDIO_LIBRARY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(ClassNotFoundException e1)
|
|
||||||
{
|
|
||||||
if(!mLibraryLoadStatusLogged.contains(JMBE_AUDIO_LIBRARY))
|
|
||||||
{
|
|
||||||
mLog.error("Couldn't load JMBE audio conversion library - class not found");
|
|
||||||
mLibraryLoadStatusLogged.add(JMBE_AUDIO_LIBRARY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(InvocationTargetException ite)
|
catch(InvocationTargetException ite)
|
||||||
{
|
{
|
||||||
if(!mLibraryLoadStatusLogged.contains(JMBE_AUDIO_LIBRARY))
|
if(!mLibraryLoadStatusLogged.contains(JMBE_AUDIO_LIBRARY))
|
||||||
@@ -225,6 +219,14 @@ public abstract class JmbeAudioModule extends AbstractAudioModule implements Lis
|
|||||||
mLibraryLoadStatusLogged.add(JMBE_AUDIO_LIBRARY);
|
mLibraryLoadStatusLogged.add(JMBE_AUDIO_LIBRARY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch(NoSuchMethodException nsme)
|
||||||
|
{
|
||||||
|
if(!mLibraryLoadStatusLogged.contains(JMBE_AUDIO_LIBRARY))
|
||||||
|
{
|
||||||
|
mLog.error("Couldn't load JMBE audio conversion library - no such method exception");
|
||||||
|
mLibraryLoadStatusLogged.add(JMBE_AUDIO_LIBRARY);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -235,13 +237,6 @@ public abstract class JmbeAudioModule extends AbstractAudioModule implements Lis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(audioConverter != null)
|
|
||||||
{
|
|
||||||
mAudioCodec = audioConverter;
|
mAudioCodec = audioConverter;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
mAudioCodec = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +1,46 @@
|
|||||||
/*
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* * ******************************************************************************
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* * Copyright (C) 2014-2019 Dennis Sheirer
|
* it under the terms of the GNU General Public License as published by
|
||||||
* *
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* * This program is free software: you can redistribute it and/or modify
|
* (at your option) any later version.
|
||||||
* * it under the terms of the GNU General Public License as published by
|
|
||||||
* * the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* * (at your option) any later version.
|
|
||||||
* *
|
|
||||||
* * This program is distributed in the hope that it will be useful,
|
|
||||||
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* * GNU General Public License for more details.
|
|
||||||
* *
|
|
||||||
* * You should have received a copy of the GNU General Public License
|
|
||||||
* * along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
* * *****************************************************************************
|
|
||||||
*
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.github.dsheirer.audio.codec.mbe;
|
package io.github.dsheirer.audio.codec.mbe;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import io.github.dsheirer.alias.AliasList;
|
||||||
|
import io.github.dsheirer.audio.AudioSegment;
|
||||||
|
import io.github.dsheirer.identifier.IdentifierUpdateNotification;
|
||||||
|
import io.github.dsheirer.module.decode.p25.audio.P25P1AudioModule;
|
||||||
|
import io.github.dsheirer.module.decode.p25.audio.P25P1CallSequenceRecorder;
|
||||||
|
import io.github.dsheirer.module.decode.p25.audio.VoiceFrame;
|
||||||
|
import io.github.dsheirer.module.decode.p25.identifier.radio.APCO25RadioIdentifier;
|
||||||
|
import io.github.dsheirer.module.decode.p25.identifier.talkgroup.APCO25Talkgroup;
|
||||||
|
import io.github.dsheirer.preference.UserPreferences;
|
||||||
|
import io.github.dsheirer.record.AudioSegmentRecorder;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.Collection;
|
||||||
|
import jmbe.iface.IAudioCodec;
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.apache.commons.io.filefilter.DirectoryFileFilter;
|
||||||
|
import org.apache.commons.io.filefilter.SuffixFileFilter;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -32,79 +51,130 @@ public class MBECallSequenceConverter
|
|||||||
{
|
{
|
||||||
private final static Logger mLog = LoggerFactory.getLogger(MBECallSequenceConverter.class);
|
private final static Logger mLog = LoggerFactory.getLogger(MBECallSequenceConverter.class);
|
||||||
|
|
||||||
// public static void convert(Path input, Path output) throws IOException
|
/**
|
||||||
// {
|
* Converts the input MBE file to PCM audio and writes to the output wave file.
|
||||||
// InputStream inputStream = Files.newInputStream(input);
|
* @param input path to the MBE file.
|
||||||
// ObjectMapper mapper = new ObjectMapper();
|
* @param output path to write the WAVE recording.
|
||||||
// MBECallSequence sequence = mapper.readValue(inputStream, MBECallSequence.class);
|
* @throws IOException if there is an error.
|
||||||
// convert(sequence, output);
|
*/
|
||||||
// }
|
public static void convert(Path input, Path output) throws IOException
|
||||||
//
|
{
|
||||||
// public static void convert(MBECallSequence callSequence, Path outputPath)
|
InputStream inputStream = Files.newInputStream(input);
|
||||||
// {
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
// if(callSequence == null || callSequence.isEncrypted())
|
MBECallSequence sequence = mapper.readValue(inputStream, MBECallSequence.class);
|
||||||
// {
|
convert(sequence, output);
|
||||||
// throw new IllegalArgumentException("Cannot decode null or encrypted call sequence");
|
}
|
||||||
// }
|
|
||||||
//
|
public static void convert(MBECallSequence callSequence, Path outputPath)
|
||||||
// if(callSequence != null && !callSequence.isEncrypted())
|
{
|
||||||
// {
|
if(callSequence == null || callSequence.isEncrypted())
|
||||||
// ThumbDv.AudioProtocol protocol = ThumbDv.AudioProtocol.P25_PHASE2;
|
{
|
||||||
//
|
throw new IllegalArgumentException("Cannot decode null or encrypted call sequence");
|
||||||
// AudioPacketWaveRecorder recorder = new AudioPacketWaveRecorder(outputPath);
|
}
|
||||||
// recorder.start();
|
|
||||||
//
|
if(callSequence != null)
|
||||||
// long delayMillis = 0;
|
{
|
||||||
//
|
if(callSequence.getProtocol().equals(P25P1CallSequenceRecorder.PROTOCOL))
|
||||||
// try(ThumbDv thumbDv = new ThumbDv(protocol, recorder))
|
{
|
||||||
// {
|
P25P1AudioModule audioModule = new P25P1AudioModule(new UserPreferences(), new AliasList("mbe generator"));
|
||||||
// thumbDv.start();
|
audioModule.setRecordAudio(true);
|
||||||
// for(VoiceFrame voiceFrame: callSequence.getVoiceFrames())
|
audioModule.start();
|
||||||
// {
|
|
||||||
// mLog.debug("Frame [" + voiceFrame.getFrame() + "] + Hex [" + AmbeResponse.toHex(voiceFrame.getFrameBytes()) + "]");
|
if(callSequence.getFromIdentifier() != null)
|
||||||
// thumbDv.decode(voiceFrame.getFrameBytes());
|
{
|
||||||
// delayMillis += 30;
|
int from = 0;
|
||||||
// }
|
|
||||||
//
|
try
|
||||||
// if(delayMillis > 0)
|
{
|
||||||
// {
|
from = Integer.parseInt(callSequence.getFromIdentifier());
|
||||||
// delayMillis += 1000;
|
audioModule.getIdentifierUpdateListener().receive(new IdentifierUpdateNotification(APCO25RadioIdentifier.createFrom(from),
|
||||||
// try
|
IdentifierUpdateNotification.Operation.ADD, 0));
|
||||||
// {
|
}
|
||||||
// Thread.sleep(delayMillis);
|
catch(Exception e)
|
||||||
// }
|
{
|
||||||
// catch(InterruptedException ie)
|
mLog.error("Error parsing from identifier from value [" + callSequence.getFromIdentifier());
|
||||||
// {
|
}
|
||||||
//
|
}
|
||||||
// }
|
|
||||||
// }
|
if(callSequence.getToIdentifier() != null)
|
||||||
// }
|
{
|
||||||
// catch(IOException ioe)
|
int to = 0;
|
||||||
// {
|
|
||||||
// mLog.error("Error", ioe);
|
try
|
||||||
// }
|
{
|
||||||
//
|
to = Integer.parseInt(callSequence.getToIdentifier());
|
||||||
// recorder.stop(Paths.get(outputPath.toString().replace(".tmp", ".wav")), new WaveMetadata());
|
audioModule.getIdentifierUpdateListener().receive(new IdentifierUpdateNotification(APCO25Talkgroup.create(to),
|
||||||
// }
|
IdentifierUpdateNotification.Operation.ADD, 0));
|
||||||
// }
|
}
|
||||||
//
|
catch(Exception e)
|
||||||
// public static void main(String[] args)
|
{
|
||||||
// {
|
mLog.error("Error parsing from identifier from value [" + callSequence.getFromIdentifier());
|
||||||
// String mbe = "/home/denny/SDRTrunk/recordings/20190331085324_154250000_3_TS0_65084_6591007.mbe";
|
}
|
||||||
// String mbe = "/home/denny/SDRTrunk/recordings/20190331085324_154250000_2_TS1_65035.mbe";
|
}
|
||||||
//
|
|
||||||
// Path input = Paths.get(mbe);
|
IAudioCodec codec = audioModule.getAudioCodec();
|
||||||
// Path output = Paths.get(mbe.replace(".mbe", ".tmp"));
|
|
||||||
//
|
for(VoiceFrame voiceFrame: callSequence.getVoiceFrames())
|
||||||
// mLog.info("Converting: " + mbe);
|
{
|
||||||
//
|
byte[] frameBytes = voiceFrame.getFrameBytes();
|
||||||
// try
|
float[] audio = codec.getAudio(frameBytes);
|
||||||
// {
|
audioModule.addAudio(audio);
|
||||||
// MBECallSequenceConverter.convert(input, output);
|
}
|
||||||
// }
|
|
||||||
// catch(IOException ioe)
|
AudioSegment audioSegment = audioModule.getAudioSegment();
|
||||||
// {
|
|
||||||
// mLog.error("Error", ioe);
|
try
|
||||||
// }
|
{
|
||||||
// }
|
AudioSegmentRecorder.recordWAVE(audioSegment, outputPath);
|
||||||
|
}
|
||||||
|
catch(IOException ioe)
|
||||||
|
{
|
||||||
|
mLog.error("Error writing audio segment, ioe");
|
||||||
|
}
|
||||||
|
|
||||||
|
audioModule.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args)
|
||||||
|
{
|
||||||
|
boolean all = true;
|
||||||
|
|
||||||
|
String path = "/home/denny/SDRTrunk/recordings";
|
||||||
|
Path input = Paths.get(path);
|
||||||
|
|
||||||
|
if(all)
|
||||||
|
{
|
||||||
|
Collection<File> mbeFiles = FileUtils.listFiles(input.toFile(), new SuffixFileFilter(".mbe"), DirectoryFileFilter.DIRECTORY);
|
||||||
|
|
||||||
|
for(File inputFile: mbeFiles)
|
||||||
|
{
|
||||||
|
Path output = Paths.get(inputFile.getAbsolutePath().replace(".mbe", ".wav"));
|
||||||
|
mLog.info("Converting: " + inputFile);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
MBECallSequenceConverter.convert(inputFile.toPath(), output);
|
||||||
|
}
|
||||||
|
catch(IOException ioe)
|
||||||
|
{
|
||||||
|
mLog.error("Error", ioe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Path output = Paths.get(path.replace(".mbe", ".wav"));
|
||||||
|
mLog.info("Converting: " + path);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
MBECallSequenceConverter.convert(input, output);
|
||||||
|
}
|
||||||
|
catch(IOException ioe)
|
||||||
|
{
|
||||||
|
mLog.error("Error", ioe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +1,27 @@
|
|||||||
/*
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* * ******************************************************************************
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* * Copyright (C) 2014-2020 Dennis Sheirer
|
* it under the terms of the GNU General Public License as published by
|
||||||
* *
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* * This program is free software: you can redistribute it and/or modify
|
* (at your option) any later version.
|
||||||
* * it under the terms of the GNU General Public License as published by
|
|
||||||
* * the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* * (at your option) any later version.
|
|
||||||
* *
|
|
||||||
* * This program is distributed in the hope that it will be useful,
|
|
||||||
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* * GNU General Public License for more details.
|
|
||||||
* *
|
|
||||||
* * You should have received a copy of the GNU General Public License
|
|
||||||
* * along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
* * *****************************************************************************
|
|
||||||
*
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
package io.github.dsheirer.audio.playback;
|
package io.github.dsheirer.audio.playback;
|
||||||
|
|
||||||
import com.google.common.eventbus.Subscribe;
|
import com.google.common.eventbus.Subscribe;
|
||||||
import io.github.dsheirer.alias.id.priority.Priority;
|
|
||||||
import io.github.dsheirer.audio.AudioEvent;
|
import io.github.dsheirer.audio.AudioEvent;
|
||||||
import io.github.dsheirer.audio.AudioSegment;
|
import io.github.dsheirer.audio.AudioSegment;
|
||||||
|
import io.github.dsheirer.controller.NamingThreadFactory;
|
||||||
import io.github.dsheirer.eventbus.MyEventBus;
|
import io.github.dsheirer.eventbus.MyEventBus;
|
||||||
import io.github.dsheirer.identifier.IdentifierCollection;
|
import io.github.dsheirer.identifier.IdentifierCollection;
|
||||||
import io.github.dsheirer.identifier.IdentifierUpdateNotification;
|
import io.github.dsheirer.identifier.IdentifierUpdateNotification;
|
||||||
@@ -33,11 +30,13 @@ import io.github.dsheirer.preference.UserPreferences;
|
|||||||
import io.github.dsheirer.sample.Broadcaster;
|
import io.github.dsheirer.sample.Broadcaster;
|
||||||
import io.github.dsheirer.sample.Listener;
|
import io.github.dsheirer.sample.Listener;
|
||||||
import io.github.dsheirer.source.mixer.MixerChannel;
|
import io.github.dsheirer.source.mixer.MixerChannel;
|
||||||
import io.github.dsheirer.util.ThreadPool;
|
import java.nio.ByteBuffer;
|
||||||
import javafx.beans.property.BooleanProperty;
|
import java.util.concurrent.Executors;
|
||||||
import javafx.beans.property.IntegerProperty;
|
import java.util.concurrent.LinkedTransferQueue;
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import javafx.beans.property.SimpleIntegerProperty;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -51,10 +50,6 @@ import javax.sound.sampled.LineListener;
|
|||||||
import javax.sound.sampled.LineUnavailableException;
|
import javax.sound.sampled.LineUnavailableException;
|
||||||
import javax.sound.sampled.Mixer;
|
import javax.sound.sampled.Mixer;
|
||||||
import javax.sound.sampled.SourceDataLine;
|
import javax.sound.sampled.SourceDataLine;
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.util.concurrent.ScheduledFuture;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Audio output/playback channel for a single audio mixer channel. Providers support for playback of audio segments
|
* Audio output/playback channel for a single audio mixer channel. Providers support for playback of audio segments
|
||||||
@@ -67,7 +62,6 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
|
|||||||
private int mBufferStopThreshold;
|
private int mBufferStopThreshold;
|
||||||
private Listener<IdentifierCollection> mIdentifierCollectionListener;
|
private Listener<IdentifierCollection> mIdentifierCollectionListener;
|
||||||
private Broadcaster<AudioEvent> mAudioEventBroadcaster = new Broadcaster<>();
|
private Broadcaster<AudioEvent> mAudioEventBroadcaster = new Broadcaster<>();
|
||||||
private ScheduledFuture<?> mProcessorFuture;
|
|
||||||
private SourceDataLine mOutput;
|
private SourceDataLine mOutput;
|
||||||
private Mixer mMixer;
|
private Mixer mMixer;
|
||||||
private MixerChannel mMixerChannel;
|
private MixerChannel mMixerChannel;
|
||||||
@@ -76,17 +70,17 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
|
|||||||
private AudioEvent mAudioStartEvent;
|
private AudioEvent mAudioStartEvent;
|
||||||
private AudioEvent mAudioStopEvent;
|
private AudioEvent mAudioStopEvent;
|
||||||
private boolean mCanProcessAudio = false;
|
private boolean mCanProcessAudio = false;
|
||||||
|
private LinkedTransferQueue<AudioSegment> mAudioSegmentQueue = new LinkedTransferQueue<>();
|
||||||
private AudioSegment mCurrentAudioSegment;
|
private AudioSegment mCurrentAudioSegment;
|
||||||
private AudioSegment mNextAudioSegment;
|
|
||||||
private ReentrantLock mLock = new ReentrantLock();
|
|
||||||
private int mCurrentBufferIndex = 0;
|
private int mCurrentBufferIndex = 0;
|
||||||
private UserPreferences mUserPreferences;
|
private UserPreferences mUserPreferences;
|
||||||
private BooleanProperty mEmptyProperty = new SimpleBooleanProperty(true);
|
|
||||||
private IntegerProperty mAudioPriority = new SimpleIntegerProperty(Priority.DEFAULT_PRIORITY);
|
|
||||||
private ByteBuffer mAudioSegmentStartTone;
|
private ByteBuffer mAudioSegmentStartTone;
|
||||||
private ByteBuffer mAudioSegmentPreemptTone;
|
|
||||||
private ByteBuffer mAudioSegmentDropTone;
|
private ByteBuffer mAudioSegmentDropTone;
|
||||||
private boolean mRunning = false;
|
private boolean mRunning = false;
|
||||||
|
private ScheduledExecutorService mScheduledExecutorService;
|
||||||
|
private ScheduledFuture<?> mProcessorFuture;
|
||||||
|
private long mOutputLastTimestamp = 0;
|
||||||
|
private static final long STALE_PLAYBACK_THRESHOLD_MS = 500;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Single audio channel playback with automatic starting and stopping of the
|
* Single audio channel playback with automatic starting and stopping of the
|
||||||
@@ -107,6 +101,8 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
|
|||||||
{
|
{
|
||||||
mMixer = mixer;
|
mMixer = mixer;
|
||||||
mMixerChannel = mixerChannel;
|
mMixerChannel = mixerChannel;
|
||||||
|
mScheduledExecutorService = Executors.newSingleThreadScheduledExecutor(new NamingThreadFactory(
|
||||||
|
"sdrtrunk audio output " + mixerChannel.name()));
|
||||||
mUserPreferences = userPreferences;
|
mUserPreferences = userPreferences;
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -150,7 +146,7 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Run the queue processor task every 100 milliseconds or 10 times a second
|
//Run the queue processor task every 100 milliseconds or 10 times a second
|
||||||
mProcessorFuture = ThreadPool.SCHEDULED.scheduleAtFixedRate(new AudioSegmentProcessor(),
|
mProcessorFuture = mScheduledExecutorService.scheduleAtFixedRate(new AudioSegmentProcessor(),
|
||||||
0, 100, TimeUnit.MILLISECONDS);
|
0, 100, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,26 +168,17 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Boolean property that indicates if this audio output has an audio segment queued or in process of playback.
|
* Indicates if this audio output doesn't currently have any audio segments queued for playback.
|
||||||
|
* @return true if empty
|
||||||
*/
|
*/
|
||||||
public BooleanProperty emptyProperty()
|
public boolean isEmpty()
|
||||||
{
|
{
|
||||||
return mEmptyProperty;
|
return mAudioSegmentQueue.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Audio playback priority of the current audio segment or default audio priority if nothing is currently loaded.
|
* Schedules the audio segment for playback. The audio segment user count should already be incremented by the
|
||||||
*/
|
* calling entity.
|
||||||
public IntegerProperty audioPriorityProperty()
|
|
||||||
{
|
|
||||||
return mAudioPriority;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Schedules the audio segment for playback.
|
|
||||||
*
|
|
||||||
* Note: if a segment is currently playing and another audio segment is already queued for playback, invoking
|
|
||||||
* this method will overwrite the queued segment with the argument.
|
|
||||||
*
|
*
|
||||||
* @param audioSegment to schedule for playback.
|
* @param audioSegment to schedule for playback.
|
||||||
*/
|
*/
|
||||||
@@ -199,23 +186,8 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
|
|||||||
{
|
{
|
||||||
if(audioSegment != null)
|
if(audioSegment != null)
|
||||||
{
|
{
|
||||||
mLock.lock();
|
//Audio segment use count has already been incremented by the external caller.
|
||||||
|
mAudioSegmentQueue.add(audioSegment);
|
||||||
if(mNextAudioSegment != null)
|
|
||||||
{
|
|
||||||
mNextAudioSegment.decrementConsumerCount();
|
|
||||||
mNextAudioSegment = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
mNextAudioSegment = audioSegment;
|
|
||||||
mEmptyProperty.set(false);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
mLock.unlock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,7 +234,6 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
|
|||||||
private void updateToneInsertionAudioClips()
|
private void updateToneInsertionAudioClips()
|
||||||
{
|
{
|
||||||
mAudioSegmentStartTone = null;
|
mAudioSegmentStartTone = null;
|
||||||
mAudioSegmentPreemptTone = null;
|
|
||||||
mAudioSegmentDropTone = null;
|
mAudioSegmentDropTone = null;
|
||||||
|
|
||||||
float[] start = mUserPreferences.getPlaybackPreference().getStartTone();
|
float[] start = mUserPreferences.getPlaybackPreference().getStartTone();
|
||||||
@@ -272,13 +243,6 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
|
|||||||
mAudioSegmentStartTone = convert(start);
|
mAudioSegmentStartTone = convert(start);
|
||||||
}
|
}
|
||||||
|
|
||||||
float[] preempt = mUserPreferences.getPlaybackPreference().getPreemptTone();
|
|
||||||
|
|
||||||
if(preempt != null)
|
|
||||||
{
|
|
||||||
mAudioSegmentPreemptTone = convert(preempt);
|
|
||||||
}
|
|
||||||
|
|
||||||
float[] drop = mUserPreferences.getPlaybackPreference().getDropTone();
|
float[] drop = mUserPreferences.getPlaybackPreference().getDropTone();
|
||||||
|
|
||||||
if(drop != null)
|
if(drop != null)
|
||||||
@@ -287,48 +251,6 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Disposes of a processed audio segment and notifies the originator that processing of the segment is complete
|
|
||||||
* by decrementing the consumer count.
|
|
||||||
* @param audioSegment to dispose
|
|
||||||
*/
|
|
||||||
private void dispose(AudioSegment audioSegment)
|
|
||||||
{
|
|
||||||
mAudioPriority.unbind();
|
|
||||||
|
|
||||||
if(audioSegment != null)
|
|
||||||
{
|
|
||||||
audioSegment.decrementConsumerCount();
|
|
||||||
audioSegment.removeIdentifierUpdateNotificationListener(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a tone indicating that a new audio segment is starting
|
|
||||||
*/
|
|
||||||
private ByteBuffer getAudioSegmentStartTone()
|
|
||||||
{
|
|
||||||
return mAudioSegmentStartTone;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a tone indicating that the current audio segment playback has been preempted for a higher priority
|
|
||||||
* audio segment that is now starting.
|
|
||||||
*/
|
|
||||||
private ByteBuffer getAudioSegmentPreemptionTone()
|
|
||||||
{
|
|
||||||
return mAudioSegmentPreemptTone;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a tone indicating that the current audio segment playback has been dropped because the audio segment
|
|
||||||
* has been flagged as Do Not Monitor after playback has started.
|
|
||||||
*/
|
|
||||||
private ByteBuffer getAudioSegmentDropTone()
|
|
||||||
{
|
|
||||||
return mAudioSegmentDropTone;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes the audio buffer data to the source data line. If the data line is not currently playing, write as
|
* Writes the audio buffer data to the source data line. If the data line is not currently playing, write as
|
||||||
* much of the buffer to the data line as will fit, start the dataline, and then finish writing the residual
|
* much of the buffer to the data line as will fit, start the dataline, and then finish writing the residual
|
||||||
@@ -355,6 +277,7 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
|
|||||||
|
|
||||||
//Top off the buffer and check if we can start it
|
//Top off the buffer and check if we can start it
|
||||||
wrote += mOutput.write(buffer.array(), 0, toWrite);
|
wrote += mOutput.write(buffer.array(), 0, toWrite);
|
||||||
|
mOutputLastTimestamp = System.currentTimeMillis();
|
||||||
|
|
||||||
checkStart();
|
checkStart();
|
||||||
}
|
}
|
||||||
@@ -363,147 +286,135 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
|
|||||||
{
|
{
|
||||||
//This will block until the buffer is fully written to the data line
|
//This will block until the buffer is fully written to the data line
|
||||||
mOutput.write(buffer.array(), wrote, buffer.array().length - wrote);
|
mOutput.write(buffer.array(), wrote, buffer.array().length - wrote);
|
||||||
|
mOutputLastTimestamp = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dispose of the currently assigned audio segment.
|
||||||
|
*/
|
||||||
|
private void disposeCurrentAudioSegment()
|
||||||
|
{
|
||||||
|
if(mCurrentAudioSegment != null)
|
||||||
|
{
|
||||||
|
mCurrentAudioSegment.decrementConsumerCount();
|
||||||
|
mCurrentAudioSegment.removeIdentifierUpdateNotificationListener(this);
|
||||||
|
mCurrentAudioSegment = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads the next audio segment from the queue.
|
||||||
|
*/
|
||||||
|
private void loadNextAudioSegment()
|
||||||
|
{
|
||||||
|
AudioSegment audioSegment = mAudioSegmentQueue.poll();
|
||||||
|
|
||||||
|
boolean verificationInProgress = (audioSegment != null);
|
||||||
|
|
||||||
|
while(verificationInProgress)
|
||||||
|
{
|
||||||
|
if(audioSegment != null)
|
||||||
|
{
|
||||||
|
//Throw away the audio segment if it has been flagged as do not monitor or is duplicate
|
||||||
|
if(isThrowaway(audioSegment))
|
||||||
|
{
|
||||||
|
audioSegment.decrementConsumerCount();
|
||||||
|
audioSegment = mAudioSegmentQueue.poll();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
verificationInProgress = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
verificationInProgress = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mCurrentAudioSegment = audioSegment;
|
||||||
|
|
||||||
|
if(audioSegment != null)
|
||||||
|
{
|
||||||
|
mCurrentAudioSegment.addIdentifierUpdateNotificationListener(this);
|
||||||
|
broadcast(mCurrentAudioSegment.getIdentifierCollection());
|
||||||
|
|
||||||
|
//If we played any amount of the previous audio segment then play the audio segment start. We check this
|
||||||
|
//to avoid repeatedly playing an audio segment start tone on the rare occasion that we have empty segments.
|
||||||
|
if(mCurrentBufferIndex > 0)
|
||||||
|
{
|
||||||
|
playAudio(mAudioSegmentStartTone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mCurrentBufferIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if the audio segment should be thrown away because it is marked as duplicate or do-not-monitor.
|
||||||
|
* @param audioSegment to evaluate
|
||||||
|
* @return true if the audio should be thrown away.
|
||||||
|
*/
|
||||||
|
private boolean isThrowaway(AudioSegment audioSegment)
|
||||||
|
{
|
||||||
|
return audioSegment != null &&
|
||||||
|
(audioSegment.isDoNotMonitor() ||
|
||||||
|
(audioSegment.isDuplicate() && mUserPreferences.getDuplicateCallDetectionPreference()
|
||||||
|
.isDuplicatePlaybackSuppressionEnabled()));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manage audio segment playback and process audio segment buffers. This method is designed to be called
|
* Manage audio segment playback and process audio segment buffers. This method is designed to be called
|
||||||
* by a threaded processor repeatedly to playback the current audio segment and check for and start a newly
|
* by a threaded processor repeatedly to playback the current audio segment and check for and start newly
|
||||||
* assigned audio segment. It also handles starting and stopping the playback source data line to avoid audio
|
* added audio segments. It also handles starting and stopping the playback source data line to avoid audio
|
||||||
* discontinuities due to buffer underruns.
|
* discontinuities due to buffer underruns.
|
||||||
*/
|
*/
|
||||||
private void processAudio()
|
private void processAudio()
|
||||||
{
|
{
|
||||||
if(mNextAudioSegment != null)
|
if(mCurrentAudioSegment == null)
|
||||||
{
|
{
|
||||||
mLock.lock();
|
loadNextAudioSegment();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Reevaluate current audio segment to see if the status has changed for duplicate or do-not-monitor.
|
||||||
|
if(isThrowaway(mCurrentAudioSegment))
|
||||||
|
{
|
||||||
|
if(mCurrentBufferIndex > 0)
|
||||||
|
{
|
||||||
|
playAudio(mAudioSegmentDropTone);
|
||||||
|
}
|
||||||
|
|
||||||
|
disposeCurrentAudioSegment();
|
||||||
|
loadNextAudioSegment();
|
||||||
|
}
|
||||||
|
|
||||||
|
while(mCurrentAudioSegment != null && mCurrentBufferIndex < mCurrentAudioSegment.getAudioBufferCount())
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
|
||||||
//Remove an assigned segment that's subsequently flagged as duplicate or do not monitor before playback
|
|
||||||
if(mNextAudioSegment.isDoNotMonitor() || (mNextAudioSegment.isDuplicate() &&
|
|
||||||
mUserPreferences.getDuplicateCallDetectionPreference().isDuplicatePlaybackSuppressionEnabled()))
|
|
||||||
{
|
|
||||||
mNextAudioSegment = null;
|
|
||||||
|
|
||||||
if(mCurrentAudioSegment == null)
|
|
||||||
{
|
|
||||||
mEmptyProperty.set(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//For linked audio segments, allow the linked segment to complete first before assigning the next
|
|
||||||
else if(mNextAudioSegment.isLinked())
|
|
||||||
{
|
|
||||||
if(mCurrentAudioSegment == null)
|
|
||||||
{
|
|
||||||
mCurrentAudioSegment = mNextAudioSegment;
|
|
||||||
mNextAudioSegment = null;
|
|
||||||
mCurrentBufferIndex = 0;
|
|
||||||
|
|
||||||
if(mCurrentAudioSegment != null)
|
|
||||||
{
|
|
||||||
mAudioPriority.bind(mCurrentAudioSegment.monitorPriorityProperty());
|
|
||||||
mCurrentAudioSegment.addIdentifierUpdateNotificationListener(this);
|
|
||||||
broadcast(mCurrentAudioSegment.getIdentifierCollection());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mAudioPriority.setValue(Priority.DEFAULT_PRIORITY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//Insert audio segment start or audio priority preemption bonk tone
|
|
||||||
if(mCurrentAudioSegment == null)
|
|
||||||
{
|
|
||||||
playAudio(getAudioSegmentStartTone());
|
|
||||||
}
|
|
||||||
else if(mCurrentBufferIndex > 0 &&
|
|
||||||
(!mCurrentAudioSegment.completeProperty().get() ||
|
|
||||||
mCurrentBufferIndex < mCurrentAudioSegment.getAudioBufferCount()))
|
|
||||||
{
|
|
||||||
playAudio(getAudioSegmentPreemptionTone());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
playAudio(getAudioSegmentStartTone());
|
|
||||||
}
|
|
||||||
|
|
||||||
//Close current audio segment
|
|
||||||
dispose(mCurrentAudioSegment);
|
|
||||||
mCurrentAudioSegment = mNextAudioSegment;
|
|
||||||
mNextAudioSegment = null;
|
|
||||||
mCurrentBufferIndex = 0;
|
|
||||||
|
|
||||||
if(mCurrentAudioSegment != null)
|
|
||||||
{
|
|
||||||
mAudioPriority.bind(mCurrentAudioSegment.monitorPriorityProperty());
|
|
||||||
mCurrentAudioSegment.addIdentifierUpdateNotificationListener(this);
|
|
||||||
broadcast(mCurrentAudioSegment.getIdentifierCollection());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mAudioPriority.setValue(Priority.DEFAULT_PRIORITY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
mLock.unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(mCurrentAudioSegment != null)
|
|
||||||
{
|
|
||||||
//Check for completed audio segment or a segment flagged as duplicate or Do Not Monitor
|
|
||||||
if(mCurrentAudioSegment.isDoNotMonitor() ||
|
|
||||||
(mCurrentAudioSegment.isDuplicate() &&
|
|
||||||
mUserPreferences.getDuplicateCallDetectionPreference().isDuplicatePlaybackSuppressionEnabled()) ||
|
|
||||||
(mCurrentAudioSegment.completeProperty().get() && mCurrentBufferIndex >= mCurrentAudioSegment.getAudioBufferCount()))
|
|
||||||
{
|
|
||||||
if(mCurrentAudioSegment.isDoNotMonitor())
|
|
||||||
{
|
|
||||||
playAudio(getAudioSegmentDropTone());
|
|
||||||
}
|
|
||||||
|
|
||||||
dispose(mCurrentAudioSegment);
|
|
||||||
mCurrentAudioSegment = null;
|
|
||||||
|
|
||||||
mLock.lock();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if(mNextAudioSegment == null)
|
|
||||||
{
|
|
||||||
mEmptyProperty.set(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
mLock.unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Process any new buffers that have been added to the audio segment. If a next audio segment gets assigned
|
|
||||||
//while processing, exit the loop so that we can evaluate the next for higher priority preempt. If the next
|
|
||||||
//segment is a linked segment, ignore it so that we can close out the current segment.
|
|
||||||
while(mCurrentAudioSegment != null && (mNextAudioSegment == null || mNextAudioSegment.isLinked()) &&
|
|
||||||
mCurrentBufferIndex < mCurrentAudioSegment.getAudioBufferCount() &&
|
|
||||||
!mCurrentAudioSegment.isDoNotMonitor() && !(mCurrentAudioSegment.isDuplicate() &&
|
|
||||||
mUserPreferences.getDuplicateCallDetectionPreference().isDuplicatePlaybackSuppressionEnabled()))
|
|
||||||
{
|
{
|
||||||
float[] audioBuffer = mCurrentAudioSegment.getAudioBuffers().get(mCurrentBufferIndex++);
|
float[] audioBuffer = mCurrentAudioSegment.getAudioBuffers().get(mCurrentBufferIndex++);
|
||||||
|
|
||||||
if(audioBuffer != null)
|
if(audioBuffer != null)
|
||||||
{
|
{
|
||||||
ByteBuffer audio = convert(audioBuffer);
|
ByteBuffer audio = convert(audioBuffer);
|
||||||
|
//This call blocks until all audio bytes are dumped into the data line.
|
||||||
playAudio(audio);
|
playAudio(audio);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
mLog.error("Error while processing audio for [" + mMixerChannel.name() + "]", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Check for completed and fully-played audio segment -- load next audio segment
|
||||||
|
if(mCurrentAudioSegment != null &&
|
||||||
|
mCurrentAudioSegment.isComplete() &&
|
||||||
|
(mCurrentBufferIndex >= mCurrentAudioSegment.getAudioBufferCount()))
|
||||||
|
{
|
||||||
|
disposeCurrentAudioSegment();
|
||||||
}
|
}
|
||||||
|
|
||||||
checkStop();
|
checkStop();
|
||||||
@@ -523,25 +434,7 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
|
|||||||
}
|
}
|
||||||
|
|
||||||
mProcessorFuture = null;
|
mProcessorFuture = null;
|
||||||
|
disposeCurrentAudioSegment();
|
||||||
mLock.lock();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if(mNextAudioSegment != null)
|
|
||||||
{
|
|
||||||
mNextAudioSegment.decrementConsumerCount();
|
|
||||||
mNextAudioSegment = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
mLock.unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
dispose(mCurrentAudioSegment);
|
|
||||||
mCurrentAudioSegment = null;
|
|
||||||
|
|
||||||
mAudioEventBroadcaster.clear();
|
mAudioEventBroadcaster.clear();
|
||||||
mIdentifierCollectionListener = null;
|
mIdentifierCollectionListener = null;
|
||||||
|
|
||||||
@@ -650,14 +543,28 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
|
|||||||
if(mRunning)
|
if(mRunning)
|
||||||
{
|
{
|
||||||
//If the output buffer falls below the threshold then drain the output and stop playback
|
//If the output buffer falls below the threshold then drain the output and stop playback
|
||||||
if(mOutput.isRunning() && mOutput.available() >= mBufferStopThreshold)
|
if(mOutput.isRunning())
|
||||||
|
{
|
||||||
|
if(mOutput.available() >= mBufferStopThreshold)
|
||||||
{
|
{
|
||||||
mOutput.drain();
|
mOutput.drain();
|
||||||
mOutput.stop();
|
mOutput.stop();
|
||||||
mRunning = false;
|
mRunning = false;
|
||||||
}
|
}
|
||||||
|
//Detect when we have a partially filled output that will neither start nor stop and the last write
|
||||||
|
//timestamp was more than the staleness threshold (500 ms) -- stop the output and discard stale contents
|
||||||
|
else if(mOutput.available() < mBufferStopThreshold &&
|
||||||
|
mOutput.available() > mBufferStartThreshold &&
|
||||||
|
(System.currentTimeMillis() - mOutputLastTimestamp >= STALE_PLAYBACK_THRESHOLD_MS))
|
||||||
|
{
|
||||||
|
mOutput.stop();
|
||||||
|
//Discard the stale buffer contents.
|
||||||
|
mOutput.flush();
|
||||||
|
mRunning = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
//If output playback stopped on its own because the buffer emptied, then cleanup
|
//If output playback stopped on its own because the buffer emptied, then cleanup
|
||||||
else if(!mOutput.isRunning())
|
else
|
||||||
{
|
{
|
||||||
mRunning = false;
|
mRunning = false;
|
||||||
}
|
}
|
||||||
@@ -735,17 +642,34 @@ public abstract class AudioOutput implements LineListener, Listener<IdentifierUp
|
|||||||
*/
|
*/
|
||||||
public class AudioSegmentProcessor implements Runnable
|
public class AudioSegmentProcessor implements Runnable
|
||||||
{
|
{
|
||||||
|
private AtomicBoolean mProcessing = new AtomicBoolean();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
|
{
|
||||||
|
if(mProcessing.compareAndSet(false, true))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
//TODO: Debug hooks - remove after testing
|
||||||
|
if(mMixerChannel.name().equals("LEFT"))
|
||||||
|
{
|
||||||
|
int a = 0;
|
||||||
|
}
|
||||||
|
else if(mMixerChannel.name().equals("RIGHT"))
|
||||||
|
{
|
||||||
|
int a = 0;
|
||||||
|
}
|
||||||
|
|
||||||
processAudio();
|
processAudio();
|
||||||
}
|
}
|
||||||
catch(Throwable t)
|
catch(Throwable t)
|
||||||
{
|
{
|
||||||
mLog.error("Error while processing audio buffers", t);
|
mLog.error("Error while processing audio buffers", t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mProcessing.set(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ******************************************************************************
|
* *****************************************************************************
|
||||||
* sdrtrunk
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
* *****************************************************************************
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
package io.github.dsheirer.audio.playback;
|
package io.github.dsheirer.audio.playback;
|
||||||
|
|
||||||
@@ -24,6 +23,7 @@ import io.github.dsheirer.audio.AudioEvent;
|
|||||||
import io.github.dsheirer.audio.AudioException;
|
import io.github.dsheirer.audio.AudioException;
|
||||||
import io.github.dsheirer.audio.AudioSegment;
|
import io.github.dsheirer.audio.AudioSegment;
|
||||||
import io.github.dsheirer.audio.IAudioController;
|
import io.github.dsheirer.audio.IAudioController;
|
||||||
|
import io.github.dsheirer.controller.NamingThreadFactory;
|
||||||
import io.github.dsheirer.eventbus.MyEventBus;
|
import io.github.dsheirer.eventbus.MyEventBus;
|
||||||
import io.github.dsheirer.preference.PreferenceType;
|
import io.github.dsheirer.preference.PreferenceType;
|
||||||
import io.github.dsheirer.preference.UserPreferences;
|
import io.github.dsheirer.preference.UserPreferences;
|
||||||
@@ -31,17 +31,18 @@ import io.github.dsheirer.sample.Broadcaster;
|
|||||||
import io.github.dsheirer.sample.Listener;
|
import io.github.dsheirer.sample.Listener;
|
||||||
import io.github.dsheirer.source.mixer.MixerChannel;
|
import io.github.dsheirer.source.mixer.MixerChannel;
|
||||||
import io.github.dsheirer.source.mixer.MixerChannelConfiguration;
|
import io.github.dsheirer.source.mixer.MixerChannelConfiguration;
|
||||||
import io.github.dsheirer.util.ThreadPool;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.LinkedTransferQueue;
|
import java.util.concurrent.LinkedTransferQueue;
|
||||||
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages scheduling and playback of audio segments to the local users audio system.
|
* Manages scheduling and playback of audio segments to the local users audio system.
|
||||||
@@ -50,8 +51,6 @@ public class AudioPlaybackManager implements Listener<AudioSegment>, IAudioContr
|
|||||||
{
|
{
|
||||||
private static final Logger mLog = LoggerFactory.getLogger(AudioPlaybackManager.class);
|
private static final Logger mLog = LoggerFactory.getLogger(AudioPlaybackManager.class);
|
||||||
|
|
||||||
public static final String AUDIO_CHANNELS_PROPERTY = "audio.manager.channels";
|
|
||||||
public static final String AUDIO_MIXER_PROPERTY = "audio.manager.mixer";
|
|
||||||
public static final AudioEvent CONFIGURATION_CHANGE_STARTED =
|
public static final AudioEvent CONFIGURATION_CHANGE_STARTED =
|
||||||
new AudioEvent(AudioEvent.Type.AUDIO_CONFIGURATION_CHANGE_STARTED, null);
|
new AudioEvent(AudioEvent.Type.AUDIO_CONFIGURATION_CHANGE_STARTED, null);
|
||||||
public static final AudioEvent CONFIGURATION_CHANGE_COMPLETE =
|
public static final AudioEvent CONFIGURATION_CHANGE_COMPLETE =
|
||||||
@@ -64,6 +63,8 @@ public class AudioPlaybackManager implements Listener<AudioSegment>, IAudioContr
|
|||||||
private List<AudioSegment> mAudioSegments = new ArrayList<>();
|
private List<AudioSegment> mAudioSegments = new ArrayList<>();
|
||||||
private List<AudioSegment> mPendingAudioSegments = new ArrayList<>();
|
private List<AudioSegment> mPendingAudioSegments = new ArrayList<>();
|
||||||
private LinkedTransferQueue<AudioSegment> mNewAudioSegmentQueue = new LinkedTransferQueue<>();
|
private LinkedTransferQueue<AudioSegment> mNewAudioSegmentQueue = new LinkedTransferQueue<>();
|
||||||
|
private ScheduledExecutorService mScheduledExecutorService =
|
||||||
|
Executors.newSingleThreadScheduledExecutor(new NamingThreadFactory("sdrtrunk audio manager"));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an instance.
|
* Constructs an instance.
|
||||||
@@ -202,29 +203,13 @@ public class AudioPlaybackManager implements Listener<AudioSegment>, IAudioContr
|
|||||||
//Sort audio segments by playback priority and assign to empty audio outputs
|
//Sort audio segments by playback priority and assign to empty audio outputs
|
||||||
if(!mAudioSegments.isEmpty())
|
if(!mAudioSegments.isEmpty())
|
||||||
{
|
{
|
||||||
|
//TODO: change this to take audio segment start time into account also
|
||||||
mAudioSegments.sort(Comparator.comparingInt(o -> o.monitorPriorityProperty().get()));
|
mAudioSegments.sort(Comparator.comparingInt(o -> o.monitorPriorityProperty().get()));
|
||||||
|
|
||||||
//Assign empty audio outputs first
|
//Assign empty audio outputs first
|
||||||
for(AudioOutput audioOutput: mAudioOutputs)
|
for(AudioOutput audioOutput: mAudioOutputs)
|
||||||
{
|
{
|
||||||
if(audioOutput.emptyProperty().get())
|
if(audioOutput.isEmpty())
|
||||||
{
|
|
||||||
audioOutput.play(mAudioSegments.remove(0));
|
|
||||||
|
|
||||||
if(mAudioSegments.isEmpty())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Preempt ongoing audio segment playback when higher priority audio segments are available
|
|
||||||
if(!mAudioSegments.isEmpty())
|
|
||||||
{
|
|
||||||
for(AudioOutput audioOutput: mAudioOutputs)
|
|
||||||
{
|
|
||||||
if(mAudioSegments.get(0).monitorPriorityProperty().get() < audioOutput.audioPriorityProperty().get())
|
|
||||||
{
|
{
|
||||||
audioOutput.play(mAudioSegments.remove(0));
|
audioOutput.play(mAudioSegments.remove(0));
|
||||||
|
|
||||||
@@ -284,7 +269,7 @@ public class AudioPlaybackManager implements Listener<AudioSegment>, IAudioContr
|
|||||||
}
|
}
|
||||||
catch(AudioException ae)
|
catch(AudioException ae)
|
||||||
{
|
{
|
||||||
mLog.error("Error changing audio output to [" + configuration.toString() + "]", ae);
|
mLog.error("Error changing audio output to [" + configuration + "]", ae);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -332,7 +317,7 @@ public class AudioPlaybackManager implements Listener<AudioSegment>, IAudioContr
|
|||||||
throw new AudioException("Unsupported mixer channel configuration: " + entry.getMixerChannel());
|
throw new AudioException("Unsupported mixer channel configuration: " + entry.getMixerChannel());
|
||||||
}
|
}
|
||||||
|
|
||||||
mProcessingTask = ThreadPool.SCHEDULED.scheduleAtFixedRate(new AudioSegmentProcessor(),
|
mProcessingTask = mScheduledExecutorService.scheduleAtFixedRate(new AudioSegmentProcessor(),
|
||||||
0, 100, TimeUnit.MILLISECONDS);
|
0, 100, TimeUnit.MILLISECONDS);
|
||||||
mControllerBroadcaster.broadcast(CONFIGURATION_CHANGE_COMPLETE);
|
mControllerBroadcaster.broadcast(CONFIGURATION_CHANGE_COMPLETE);
|
||||||
mMixerChannelConfiguration = entry;
|
mMixerChannelConfiguration = entry;
|
||||||
@@ -343,7 +328,7 @@ public class AudioPlaybackManager implements Listener<AudioSegment>, IAudioContr
|
|||||||
* Current audio playback mixer channel configuration setting.
|
* Current audio playback mixer channel configuration setting.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public MixerChannelConfiguration getMixerChannelConfiguration() throws AudioException
|
public MixerChannelConfiguration getMixerChannelConfiguration()
|
||||||
{
|
{
|
||||||
return mMixerChannelConfiguration;
|
return mMixerChannelConfiguration;
|
||||||
}
|
}
|
||||||
@@ -384,8 +369,12 @@ public class AudioPlaybackManager implements Listener<AudioSegment>, IAudioContr
|
|||||||
*/
|
*/
|
||||||
public class AudioSegmentProcessor implements Runnable
|
public class AudioSegmentProcessor implements Runnable
|
||||||
{
|
{
|
||||||
|
private AtomicBoolean mProcessing = new AtomicBoolean();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
|
{
|
||||||
|
if(mProcessing.compareAndSet(false, true))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -395,6 +384,9 @@ public class AudioPlaybackManager implements Listener<AudioSegment>, IAudioContr
|
|||||||
{
|
{
|
||||||
mLog.error("Encountered error while processing audio segments", t);
|
mLog.error("Encountered error while processing audio segments", t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mProcessing.set(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ public class BinaryMessage extends BitSet
|
|||||||
private static final int[] CHARACTER_7_BIT = new int[]{0, 1, 2, 3, 4, 5, 6};
|
private static final int[] CHARACTER_7_BIT = new int[]{0, 1, 2, 3, 4, 5, 6};
|
||||||
private static final int[] CHARACTER_8_BIT = new int[]{0, 1, 2, 3, 4, 5, 6, 7};
|
private static final int[] CHARACTER_8_BIT = new int[]{0, 1, 2, 3, 4, 5, 6, 7};
|
||||||
private static final String UTF_8 = "UTF-8";
|
private static final String UTF_8 = "UTF-8";
|
||||||
|
private static final String GB2312 = "GB2312";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logical (ie constructed) size of this bitset, despite the actual size of
|
* Logical (ie constructed) size of this bitset, despite the actual size of
|
||||||
@@ -1236,6 +1238,26 @@ public class BinaryMessage extends BitSet
|
|||||||
return new String(bytes, UTF_8);
|
return new String(bytes, UTF_8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse GB2312 Simplified Chinese Characters from the message starting at the offset.
|
||||||
|
* @param offset where to start parsing.
|
||||||
|
* @param characterCount number of characters to parse
|
||||||
|
* @return parsed message.
|
||||||
|
* @throws UnsupportedEncodingException if GB2312 encoding is not supported.
|
||||||
|
*/
|
||||||
|
public String parseGB2312(int offset, int characterCount) throws UnsupportedEncodingException
|
||||||
|
{
|
||||||
|
int length = characterCount * 2;
|
||||||
|
byte[] bytes = new byte[length];
|
||||||
|
|
||||||
|
for(int x = 0; x < length; x++)
|
||||||
|
{
|
||||||
|
bytes[x] = getByte(CHARACTER_8_BIT, x * 8 + offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new String(bytes, GB2312);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse 16-bit unicode characters from the message starting at the offset.
|
* Parse 16-bit unicode characters from the message starting at the offset.
|
||||||
* @param offset where to start parsing.
|
* @param offset where to start parsing.
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ******************************************************************************
|
* *****************************************************************************
|
||||||
* sdrtrunk
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,22 +14,13 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
* *****************************************************************************
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
package io.github.dsheirer.controller.channel;
|
package io.github.dsheirer.controller.channel;
|
||||||
|
|
||||||
|
import io.github.dsheirer.preference.UserPreferences;
|
||||||
import io.github.dsheirer.sample.Listener;
|
import io.github.dsheirer.sample.Listener;
|
||||||
import io.github.dsheirer.util.ThreadPool;
|
import io.github.dsheirer.util.ThreadPool;
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import javax.swing.JButton;
|
|
||||||
import javax.swing.JFrame;
|
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import javax.swing.JScrollPane;
|
|
||||||
import javax.swing.JTable;
|
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.EventQueue;
|
import java.awt.EventQueue;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
@@ -41,12 +31,21 @@ import java.util.List;
|
|||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
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.JFrame;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.JTable;
|
||||||
|
|
||||||
public class ChannelAutoStartFrame extends JFrame
|
public class ChannelAutoStartFrame extends JFrame
|
||||||
{
|
{
|
||||||
private final static Logger mLog = LoggerFactory.getLogger(ChannelAutoStartFrame.class);
|
private final static Logger mLog = LoggerFactory.getLogger(ChannelAutoStartFrame.class);
|
||||||
|
|
||||||
private static final int COUNTDOWN_SECONDS = 10;
|
|
||||||
private Listener<ChannelEvent> mChannelEventListener;
|
private Listener<ChannelEvent> mChannelEventListener;
|
||||||
private List<Channel> mChannels;
|
private List<Channel> mChannels;
|
||||||
|
|
||||||
@@ -55,7 +54,7 @@ public class ChannelAutoStartFrame extends JFrame
|
|||||||
private JButton mCancelButton;
|
private JButton mCancelButton;
|
||||||
private JTable mChannelTable;
|
private JTable mChannelTable;
|
||||||
private AtomicBoolean mChannelsStarted = new AtomicBoolean();
|
private AtomicBoolean mChannelsStarted = new AtomicBoolean();
|
||||||
|
private int mAutoStartTimeoutSeconds;
|
||||||
private ScheduledFuture<?> mTimerFuture;
|
private ScheduledFuture<?> mTimerFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -66,10 +65,12 @@ public class ChannelAutoStartFrame extends JFrame
|
|||||||
* @param listener to receive channel start/enable request(s)
|
* @param listener to receive channel start/enable request(s)
|
||||||
* @param channels to auto-start
|
* @param channels to auto-start
|
||||||
*/
|
*/
|
||||||
public ChannelAutoStartFrame(Listener<ChannelEvent> listener, List<Channel> channels)
|
public ChannelAutoStartFrame(Listener<ChannelEvent> listener, List<Channel> channels, UserPreferences userPreferences)
|
||||||
{
|
{
|
||||||
mChannelEventListener = listener;
|
mChannelEventListener = listener;
|
||||||
mChannels = channels;
|
mChannels = channels;
|
||||||
|
mAutoStartTimeoutSeconds = userPreferences.getApplicationPreference().getChannelAutoStartTimeout();
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
EventQueue.invokeLater(() -> {
|
EventQueue.invokeLater(() -> {
|
||||||
@@ -100,7 +101,7 @@ public class ChannelAutoStartFrame extends JFrame
|
|||||||
"[][][grow,fill][]"));
|
"[][][grow,fill][]"));
|
||||||
panel.add(new JLabel("The following channels will be automatically"), "span");
|
panel.add(new JLabel("The following channels will be automatically"), "span");
|
||||||
|
|
||||||
mCountdownLabel = new JLabel(getCountdownText(COUNTDOWN_SECONDS));
|
mCountdownLabel = new JLabel(getCountdownText(mAutoStartTimeoutSeconds));
|
||||||
panel.add(mCountdownLabel, "span");
|
panel.add(mCountdownLabel, "span");
|
||||||
|
|
||||||
panel.add(new JScrollPane(getChannelTable()), "span");
|
panel.add(new JScrollPane(getChannelTable()), "span");
|
||||||
@@ -220,7 +221,7 @@ public class ChannelAutoStartFrame extends JFrame
|
|||||||
*/
|
*/
|
||||||
public class CountdownTimer implements Runnable
|
public class CountdownTimer implements Runnable
|
||||||
{
|
{
|
||||||
private int mCount = COUNTDOWN_SECONDS;
|
private int mCount = mAutoStartTimeoutSeconds;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -623,8 +623,6 @@ public class ChannelProcessingManager implements Listener<ChannelEvent>
|
|||||||
Platform.runLater(() -> channel.setProcessing(false));
|
Platform.runLater(() -> channel.setProcessing(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Since the processing chain's source will block on stop(), throw it to the thread pool to run
|
|
||||||
ThreadPool.CACHED.submit(() -> {
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
processingChain.stop();
|
processingChain.stop();
|
||||||
@@ -646,7 +644,6 @@ public class ChannelProcessingManager implements Listener<ChannelEvent>
|
|||||||
{
|
{
|
||||||
mLog.error("Error during shutdown of processing chain for channel [" + channel.getName() + "}", e);
|
mLog.error("Error during shutdown of processing chain for channel [" + channel.getName() + "}", e);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -122,6 +122,11 @@ public abstract class AbstractComplexPolyphaseChannelizer implements Listener<In
|
|||||||
mChannels.add(polyphaseChannelSource);
|
mChannels.add(polyphaseChannelSource);
|
||||||
mSourceChangeBroadcaster.addListener(polyphaseChannelSource.getSourceEventListener());
|
mSourceChangeBroadcaster.addListener(polyphaseChannelSource.getSourceEventListener());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mLog.error("Error adding polyphase channel source - " + (polyphaseChannelSource == null ? "source is null" :
|
||||||
|
"channel source is already added to this channelizer"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -136,6 +141,11 @@ public abstract class AbstractComplexPolyphaseChannelizer implements Listener<In
|
|||||||
mChannels.remove(polyphaseChannelSource);
|
mChannels.remove(polyphaseChannelSource);
|
||||||
mSourceChangeBroadcaster.removeListener(polyphaseChannelSource.getSourceEventListener());
|
mSourceChangeBroadcaster.removeListener(polyphaseChannelSource.getSourceEventListener());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mLog.error("Error removing polyphase channel source - " + (polyphaseChannelSource == null ? "source is null" :
|
||||||
|
"channel source was not previously added to this channelizer"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -24,7 +24,6 @@ import io.github.dsheirer.sample.complex.InterleavedComplexSamples;
|
|||||||
import io.github.dsheirer.util.Dispatcher;
|
import io.github.dsheirer.util.Dispatcher;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.commons.math3.util.FastMath;
|
import org.apache.commons.math3.util.FastMath;
|
||||||
import org.jtransforms.fft.FloatFFT_1D;
|
import org.jtransforms.fft.FloatFFT_1D;
|
||||||
@@ -69,8 +68,8 @@ public class ComplexPolyphaseChannelizerM2 extends AbstractComplexPolyphaseChann
|
|||||||
*/
|
*/
|
||||||
private static final int PROCESSED_CHANNEL_RESULTS_THRESHOLD = 1024;
|
private static final int PROCESSED_CHANNEL_RESULTS_THRESHOLD = 1024;
|
||||||
|
|
||||||
//Sized at 152 buffers a second where max = 5 seconds
|
//Sized to process 1/20th batch of 152 buffers a second, at 40 times per second
|
||||||
private IFFTProcessorDispatcher mIFFTProcessorDispatcher = new IFFTProcessorDispatcher(5 * 152);
|
private IFFTProcessorDispatcher mIFFTProcessorDispatcher = new IFFTProcessorDispatcher(152 / 20, 25);
|
||||||
private FloatFFT_1D mFFT;
|
private FloatFFT_1D mFFT;
|
||||||
private float[] mInlineSamples;
|
private float[] mInlineSamples;
|
||||||
private float[] mInlineFilter;
|
private float[] mInlineFilter;
|
||||||
@@ -407,15 +406,17 @@ public class ComplexPolyphaseChannelizerM2 extends AbstractComplexPolyphaseChann
|
|||||||
*/
|
*/
|
||||||
public class IFFTProcessorDispatcher extends Dispatcher<List<float[]>>
|
public class IFFTProcessorDispatcher extends Dispatcher<List<float[]>>
|
||||||
{
|
{
|
||||||
public IFFTProcessorDispatcher(int maximumSize)
|
public IFFTProcessorDispatcher(int batchSize, long interval)
|
||||||
{
|
{
|
||||||
super(maximumSize, "sdrtrunk polyphase ifft processor", Collections.emptyList());
|
super("sdrtrunk polyphase ifft processor", batchSize, interval);
|
||||||
|
|
||||||
//We create a listener interface to receive the batched channel results arrays from the scheduled thread pool
|
//We create a listener interface to receive the batched channel results arrays from the scheduled thread pool
|
||||||
//dispatcher thread that is part of this continuous buffer processor. We perform an IFFT on each
|
//dispatcher thread that is part of this continuous buffer processor. We perform an IFFT on each
|
||||||
//channel results array contained in each results buffer and then dispatch the buffer
|
//channel results array contained in each results buffer and then dispatch the buffer
|
||||||
//so that it can be distributed to each channel listener.
|
//so that it can be distributed to each channel listener.
|
||||||
setListener(list -> {
|
setListener(list -> {
|
||||||
|
try
|
||||||
|
{
|
||||||
List<float[]> processedChannelResults = new ArrayList<>();
|
List<float[]> processedChannelResults = new ArrayList<>();
|
||||||
|
|
||||||
for(float[] channelResults: list)
|
for(float[] channelResults: list)
|
||||||
@@ -426,6 +427,11 @@ public class ComplexPolyphaseChannelizerM2 extends AbstractComplexPolyphaseChann
|
|||||||
}
|
}
|
||||||
|
|
||||||
dispatch(processedChannelResults);
|
dispatch(processedChannelResults);
|
||||||
|
}
|
||||||
|
catch(Throwable t)
|
||||||
|
{
|
||||||
|
mLog.error("Error during IFFT and dispatch of processed channel results", t);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package io.github.dsheirer.dsp.filter.channelizer;
|
|||||||
|
|
||||||
import io.github.dsheirer.buffer.INativeBuffer;
|
import io.github.dsheirer.buffer.INativeBuffer;
|
||||||
import io.github.dsheirer.buffer.INativeBufferProvider;
|
import io.github.dsheirer.buffer.INativeBufferProvider;
|
||||||
import io.github.dsheirer.buffer.NativeBufferPoisonPill;
|
|
||||||
import io.github.dsheirer.controller.channel.event.ChannelStopProcessingRequest;
|
import io.github.dsheirer.controller.channel.event.ChannelStopProcessingRequest;
|
||||||
import io.github.dsheirer.dsp.filter.design.FilterDesignException;
|
import io.github.dsheirer.dsp.filter.design.FilterDesignException;
|
||||||
import io.github.dsheirer.eventbus.MyEventBus;
|
import io.github.dsheirer.eventbus.MyEventBus;
|
||||||
@@ -28,7 +27,6 @@ import io.github.dsheirer.sample.Broadcaster;
|
|||||||
import io.github.dsheirer.sample.Listener;
|
import io.github.dsheirer.sample.Listener;
|
||||||
import io.github.dsheirer.sample.complex.InterleavedComplexSamples;
|
import io.github.dsheirer.sample.complex.InterleavedComplexSamples;
|
||||||
import io.github.dsheirer.source.ISourceEventProcessor;
|
import io.github.dsheirer.source.ISourceEventProcessor;
|
||||||
import io.github.dsheirer.source.Source;
|
|
||||||
import io.github.dsheirer.source.SourceEvent;
|
import io.github.dsheirer.source.SourceEvent;
|
||||||
import io.github.dsheirer.source.SourceException;
|
import io.github.dsheirer.source.SourceException;
|
||||||
import io.github.dsheirer.source.tuner.TunerController;
|
import io.github.dsheirer.source.tuner.TunerController;
|
||||||
@@ -44,7 +42,6 @@ import java.util.Map;
|
|||||||
import java.util.SortedSet;
|
import java.util.SortedSet;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
|
||||||
import org.apache.commons.math3.util.FastMath;
|
import org.apache.commons.math3.util.FastMath;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -111,8 +108,7 @@ public class PolyphaseChannelManager implements ISourceEventProcessor
|
|||||||
}
|
}
|
||||||
|
|
||||||
mChannelCalculator = new ChannelCalculator(sampleRate, channelCount, frequency, CHANNEL_OVERSAMPLING);
|
mChannelCalculator = new ChannelCalculator(sampleRate, channelCount, frequency, CHANNEL_OVERSAMPLING);
|
||||||
mBufferDispatcher = new Dispatcher(500, "sdrtrunk polyphase buffer processor",
|
mBufferDispatcher = new Dispatcher("sdrtrunk polyphase buffer processor", 50, 10);
|
||||||
new NativeBufferPoisonPill());
|
|
||||||
mBufferDispatcher.setListener(mNativeBufferReceiver);
|
mBufferDispatcher.setListener(mNativeBufferReceiver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,14 +174,6 @@ public class PolyphaseChannelManager implements ISourceEventProcessor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Current channel sample rate which is (2 * channel bandwidth).
|
|
||||||
*/
|
|
||||||
public double getChannelSampleRate()
|
|
||||||
{
|
|
||||||
return mChannelCalculator.getChannelSampleRate();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current channel bandwidth/spacing.
|
* Current channel bandwidth/spacing.
|
||||||
*/
|
*/
|
||||||
@@ -440,9 +428,10 @@ public class PolyphaseChannelManager implements ISourceEventProcessor
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case REQUEST_STOP_SAMPLE_STREAM:
|
case REQUEST_STOP_SAMPLE_STREAM:
|
||||||
if(sourceEvent.hasSource() && sourceEvent.getSource() instanceof PolyphaseChannelSource)
|
if(sourceEvent.hasSource() && sourceEvent.getSource() instanceof PolyphaseChannelSource channelSource)
|
||||||
{
|
{
|
||||||
stopChannelSource((PolyphaseChannelSource)sourceEvent.getSource());
|
stopChannelSource(channelSource);
|
||||||
|
channelSource.dispose();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -450,14 +439,6 @@ public class PolyphaseChannelManager implements ISourceEventProcessor
|
|||||||
(sourceEvent.hasSource() ? sourceEvent.getSource().getClass() : "null source"));
|
(sourceEvent.hasSource() ? sourceEvent.getSource().getClass() : "null source"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case REQUEST_SOURCE_DISPOSE:
|
|
||||||
Source source = sourceEvent.getSource();
|
|
||||||
|
|
||||||
if(source instanceof PolyphaseChannelSource)
|
|
||||||
{
|
|
||||||
source.dispose();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case NOTIFICATION_MEASURED_FREQUENCY_ERROR_SYNC_LOCKED:
|
case NOTIFICATION_MEASURED_FREQUENCY_ERROR_SYNC_LOCKED:
|
||||||
//Rebroadcast so that the tuner source can process this event
|
//Rebroadcast so that the tuner source can process this event
|
||||||
mSourceEventBroadcaster.broadcast(sourceEvent);
|
mSourceEventBroadcaster.broadcast(sourceEvent);
|
||||||
@@ -481,7 +462,6 @@ public class PolyphaseChannelManager implements ISourceEventProcessor
|
|||||||
public class NativeBufferReceiver implements Listener<INativeBuffer>
|
public class NativeBufferReceiver implements Listener<INativeBuffer>
|
||||||
{
|
{
|
||||||
private boolean mOutputProcessorUpdateRequired = false;
|
private boolean mOutputProcessorUpdateRequired = false;
|
||||||
private ReentrantLock mUpdateFlagLock = new ReentrantLock();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes tuner center frequency change source events to flag when output processors need updating.
|
* Processes tuner center frequency change source events to flag when output processors need updating.
|
||||||
@@ -492,20 +472,11 @@ public class PolyphaseChannelManager implements ISourceEventProcessor
|
|||||||
long frequency = event.getValue().longValue();
|
long frequency = event.getValue().longValue();
|
||||||
|
|
||||||
if(mChannelCalculator.getCenterFrequency() != frequency)
|
if(mChannelCalculator.getCenterFrequency() != frequency)
|
||||||
{
|
|
||||||
mUpdateFlagLock.lock();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
//Update the channel calculator frequency so that it's ready when the output processor update occurs
|
//Update the channel calculator frequency so that it's ready when the output processor update occurs
|
||||||
mChannelCalculator.setCenterFrequency(frequency);
|
mChannelCalculator.setCenterFrequency(frequency);
|
||||||
mOutputProcessorUpdateRequired = true;
|
mOutputProcessorUpdateRequired = true;
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
mUpdateFlagLock.unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -515,20 +486,18 @@ public class PolyphaseChannelManager implements ISourceEventProcessor
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void receive(INativeBuffer nativeBuffer)
|
public void receive(INativeBuffer nativeBuffer)
|
||||||
{
|
|
||||||
mUpdateFlagLock.lock();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
if(mOutputProcessorUpdateRequired)
|
if(mOutputProcessorUpdateRequired)
|
||||||
{
|
{
|
||||||
updateOutputProcessors();
|
try
|
||||||
mOutputProcessorUpdateRequired = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
{
|
||||||
mUpdateFlagLock.unlock();
|
updateOutputProcessors();
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
mLog.error("Error updating polyphase channel output processors");
|
||||||
|
}
|
||||||
|
mOutputProcessorUpdateRequired = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mPolyphaseChannelizer != null)
|
if(mPolyphaseChannelizer != null)
|
||||||
|
|||||||
@@ -25,12 +25,10 @@ import io.github.dsheirer.dsp.filter.design.FilterDesignException;
|
|||||||
import io.github.dsheirer.sample.Listener;
|
import io.github.dsheirer.sample.Listener;
|
||||||
import io.github.dsheirer.sample.complex.ComplexSamples;
|
import io.github.dsheirer.sample.complex.ComplexSamples;
|
||||||
import io.github.dsheirer.source.SourceEvent;
|
import io.github.dsheirer.source.SourceEvent;
|
||||||
import io.github.dsheirer.source.tuner.channel.StreamProcessorWithHeartbeat;
|
|
||||||
import io.github.dsheirer.source.tuner.channel.TunerChannel;
|
import io.github.dsheirer.source.tuner.channel.TunerChannel;
|
||||||
import io.github.dsheirer.source.tuner.channel.TunerChannelSource;
|
import io.github.dsheirer.source.tuner.channel.TunerChannelSource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -43,15 +41,13 @@ public class PolyphaseChannelSource extends TunerChannelSource implements Listen
|
|||||||
{
|
{
|
||||||
private Logger mLog = LoggerFactory.getLogger(PolyphaseChannelSource.class);
|
private Logger mLog = LoggerFactory.getLogger(PolyphaseChannelSource.class);
|
||||||
private IPolyphaseChannelOutputProcessor mPolyphaseChannelOutputProcessor;
|
private IPolyphaseChannelOutputProcessor mPolyphaseChannelOutputProcessor;
|
||||||
private StreamProcessorWithHeartbeat<ComplexSamples> mStreamHeartbeatProcessor;
|
private Listener<ComplexSamples> mSamplesListener;
|
||||||
private double mChannelSampleRate;
|
private double mChannelSampleRate;
|
||||||
private long mIndexCenterFrequency;
|
private long mIndexCenterFrequency;
|
||||||
private ReentrantLock mOutputProcessorLock = new ReentrantLock();
|
|
||||||
|
|
||||||
private List<Integer> mOutputProcessorIndexes = new ArrayList<>();
|
private List<Integer> mOutputProcessorIndexes = new ArrayList<>();
|
||||||
private double mTunerSampleRate;
|
private double mTunerSampleRate;
|
||||||
private double mTunerCenterFrequency;
|
private double mTunerCenterFrequency;
|
||||||
|
private PendingOutputProcessorUpdate mPendingOutputProcessorUpdate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an instance
|
* Constructs an instance
|
||||||
@@ -67,8 +63,7 @@ public class PolyphaseChannelSource extends TunerChannelSource implements Listen
|
|||||||
{
|
{
|
||||||
super(producerSourceEventListener, tunerChannel);
|
super(producerSourceEventListener, tunerChannel);
|
||||||
mChannelSampleRate = channelCalculator.getChannelSampleRate();
|
mChannelSampleRate = channelCalculator.getChannelSampleRate();
|
||||||
mStreamHeartbeatProcessor = new StreamProcessorWithHeartbeat<>(getHeartbeatManager(), HEARTBEAT_INTERVAL_MS);
|
doUpdateOutputProcessor(channelCalculator, filterManager);
|
||||||
updateOutputProcessor(channelCalculator, filterManager);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -111,8 +106,6 @@ public class PolyphaseChannelSource extends TunerChannelSource implements Listen
|
|||||||
{
|
{
|
||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
mStreamHeartbeatProcessor.start();
|
|
||||||
|
|
||||||
if(mPolyphaseChannelOutputProcessor != null)
|
if(mPolyphaseChannelOutputProcessor != null)
|
||||||
{
|
{
|
||||||
mPolyphaseChannelOutputProcessor.start();
|
mPolyphaseChannelOutputProcessor.start();
|
||||||
@@ -128,8 +121,6 @@ public class PolyphaseChannelSource extends TunerChannelSource implements Listen
|
|||||||
{
|
{
|
||||||
mPolyphaseChannelOutputProcessor.stop();
|
mPolyphaseChannelOutputProcessor.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
mStreamHeartbeatProcessor.stop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -138,29 +129,49 @@ public class PolyphaseChannelSource extends TunerChannelSource implements Listen
|
|||||||
@Override
|
@Override
|
||||||
public void setListener(final Listener<ComplexSamples> listener)
|
public void setListener(final Listener<ComplexSamples> listener)
|
||||||
{
|
{
|
||||||
mStreamHeartbeatProcessor.setListener(listener);
|
mSamplesListener = listener;
|
||||||
mPolyphaseChannelOutputProcessor.setListener(this);
|
mPolyphaseChannelOutputProcessor.setListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive(ComplexSamples complexSamples)
|
public void receive(ComplexSamples complexSamples)
|
||||||
{
|
{
|
||||||
mStreamHeartbeatProcessor.receive(complexSamples);
|
if(mSamplesListener != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
mSamplesListener.receive(complexSamples);
|
||||||
|
}
|
||||||
|
catch(Throwable t)
|
||||||
|
{
|
||||||
|
mLog.error("Error dispatching complex samples to listener [" + mSamplesListener.getClass() + "]", t);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the output processor whenever the source tuner's center frequency changes.
|
* Queues a request to update the output processor whenever the source tuner's center frequency changes.
|
||||||
* @param channelCalculator providing access to updated tuner center frequency, sample rate, etc.
|
* @param channelCalculator providing access to updated tuner center frequency, sample rate, etc.
|
||||||
* @param filterManager for designing and caching synthesis filters
|
* @param filterManager for designing and caching synthesis filters
|
||||||
*/
|
*/
|
||||||
public void updateOutputProcessor(ChannelCalculator channelCalculator, SynthesisFilterManager filterManager) throws IllegalArgumentException
|
public void updateOutputProcessor(ChannelCalculator channelCalculator, SynthesisFilterManager filterManager)
|
||||||
|
throws IllegalArgumentException
|
||||||
|
{
|
||||||
|
mPendingOutputProcessorUpdate = new PendingOutputProcessorUpdate(channelCalculator, filterManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs the output processor update. This method must be invoked on the channel results calling thread to
|
||||||
|
* ensure we don't have thread contention on the output processor.
|
||||||
|
* @param channelCalculator for updates
|
||||||
|
* @param filterManager for updates
|
||||||
|
* @throws IllegalArgumentException if there's an issue.
|
||||||
|
*/
|
||||||
|
public void doUpdateOutputProcessor(ChannelCalculator channelCalculator, SynthesisFilterManager filterManager)
|
||||||
|
throws IllegalArgumentException
|
||||||
{
|
{
|
||||||
String errorMessage = null;
|
String errorMessage = null;
|
||||||
|
|
||||||
mOutputProcessorLock.lock();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//If a change in sample rate or center frequency makes this channel no longer viable, then the channel
|
//If a change in sample rate or center frequency makes this channel no longer viable, then the channel
|
||||||
//calculator will throw an IllegalArgException ... handled below
|
//calculator will throw an IllegalArgException ... handled below
|
||||||
List<Integer> indexes = channelCalculator.getChannelIndexes(getTunerChannel());
|
List<Integer> indexes = channelCalculator.getChannelIndexes(getTunerChannel());
|
||||||
@@ -190,7 +201,8 @@ public class PolyphaseChannelSource extends TunerChannelSource implements Listen
|
|||||||
{
|
{
|
||||||
mLog.error("Error creating an updated synthesis filter for the channel output processor");
|
mLog.error("Error creating an updated synthesis filter for the channel output processor");
|
||||||
errorMessage ="Cannot update output processor - unable to design synthesis filter for [" +
|
errorMessage ="Cannot update output processor - unable to design synthesis filter for [" +
|
||||||
indexes.size() + "] channel indices";
|
indexes.size() + "] channel indices - channel sample rate [" + channelCalculator.getChannelSampleRate() +
|
||||||
|
"] channel bandwidth [" + channelCalculator.getChannelBandwidth() + "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,6 +213,7 @@ public class PolyphaseChannelSource extends TunerChannelSource implements Listen
|
|||||||
if(mPolyphaseChannelOutputProcessor != null)
|
if(mPolyphaseChannelOutputProcessor != null)
|
||||||
{
|
{
|
||||||
mPolyphaseChannelOutputProcessor.setListener(null);
|
mPolyphaseChannelOutputProcessor.setListener(null);
|
||||||
|
mPolyphaseChannelOutputProcessor.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
mPolyphaseChannelOutputProcessor = null;
|
mPolyphaseChannelOutputProcessor = null;
|
||||||
@@ -209,7 +222,7 @@ public class PolyphaseChannelSource extends TunerChannelSource implements Listen
|
|||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
mPolyphaseChannelOutputProcessor = new OneChannelOutputProcessor(channelCalculator.getChannelSampleRate(),
|
mPolyphaseChannelOutputProcessor = new OneChannelOutputProcessor(channelCalculator.getChannelSampleRate(),
|
||||||
indexes, channelCalculator.getChannelCount());
|
indexes, channelCalculator.getChannelCount(), getHeartbeatManager());
|
||||||
mPolyphaseChannelOutputProcessor.setListener(this);
|
mPolyphaseChannelOutputProcessor.setListener(this);
|
||||||
mPolyphaseChannelOutputProcessor.setFrequencyOffset(getFrequencyOffset());
|
mPolyphaseChannelOutputProcessor.setFrequencyOffset(getFrequencyOffset());
|
||||||
mPolyphaseChannelOutputProcessor.start();
|
mPolyphaseChannelOutputProcessor.start();
|
||||||
@@ -220,7 +233,7 @@ public class PolyphaseChannelSource extends TunerChannelSource implements Listen
|
|||||||
float[] filter = filterManager.getFilter(channelCalculator.getChannelSampleRate(),
|
float[] filter = filterManager.getFilter(channelCalculator.getChannelSampleRate(),
|
||||||
channelCalculator.getChannelBandwidth(), 2);
|
channelCalculator.getChannelBandwidth(), 2);
|
||||||
mPolyphaseChannelOutputProcessor = new TwoChannelOutputProcessor(channelCalculator.getChannelSampleRate(),
|
mPolyphaseChannelOutputProcessor = new TwoChannelOutputProcessor(channelCalculator.getChannelSampleRate(),
|
||||||
indexes, filter, channelCalculator.getChannelCount());
|
indexes, filter, channelCalculator.getChannelCount(), getHeartbeatManager());
|
||||||
mPolyphaseChannelOutputProcessor.setListener(this);
|
mPolyphaseChannelOutputProcessor.setListener(this);
|
||||||
mPolyphaseChannelOutputProcessor.setFrequencyOffset(getFrequencyOffset());
|
mPolyphaseChannelOutputProcessor.setFrequencyOffset(getFrequencyOffset());
|
||||||
mPolyphaseChannelOutputProcessor.start();
|
mPolyphaseChannelOutputProcessor.start();
|
||||||
@@ -239,11 +252,6 @@ public class PolyphaseChannelSource extends TunerChannelSource implements Listen
|
|||||||
indexes.size();
|
indexes.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
mOutputProcessorLock.unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
//Unlikely, but if we had an error designing a synthesis filter, throw an exception
|
//Unlikely, but if we had an error designing a synthesis filter, throw an exception
|
||||||
if(errorMessage != null)
|
if(errorMessage != null)
|
||||||
@@ -262,7 +270,13 @@ public class PolyphaseChannelSource extends TunerChannelSource implements Listen
|
|||||||
*/
|
*/
|
||||||
public void receiveChannelResults(List<float[]> channelResultsList, long currentSamplesTimestamp)
|
public void receiveChannelResults(List<float[]> channelResultsList, long currentSamplesTimestamp)
|
||||||
{
|
{
|
||||||
mOutputProcessorLock.lock();
|
if(mPendingOutputProcessorUpdate != null)
|
||||||
|
{
|
||||||
|
ChannelCalculator channelCalculator = mPendingOutputProcessorUpdate.getChannelCalculator();
|
||||||
|
SynthesisFilterManager filterManager = mPendingOutputProcessorUpdate.getSynthesisFilterManager();
|
||||||
|
mPendingOutputProcessorUpdate = null;
|
||||||
|
doUpdateOutputProcessor(channelCalculator, filterManager);
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -271,9 +285,9 @@ public class PolyphaseChannelSource extends TunerChannelSource implements Listen
|
|||||||
mPolyphaseChannelOutputProcessor.receiveChannelResults(channelResultsList, currentSamplesTimestamp);
|
mPolyphaseChannelOutputProcessor.receiveChannelResults(channelResultsList, currentSamplesTimestamp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
mOutputProcessorLock.unlock();
|
mLog.error("Error processing channel results", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,4 +356,40 @@ public class PolyphaseChannelSource extends TunerChannelSource implements Listen
|
|||||||
return "POLYPHASE [" + mPolyphaseChannelOutputProcessor.getInputChannelCount() + "] " +
|
return "POLYPHASE [" + mPolyphaseChannelOutputProcessor.getInputChannelCount() + "] " +
|
||||||
getTunerChannel().getFrequency();
|
getTunerChannel().getFrequency();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Support classes needed to update the output processor.
|
||||||
|
*/
|
||||||
|
public class PendingOutputProcessorUpdate
|
||||||
|
{
|
||||||
|
private final ChannelCalculator mChannelCalculator;
|
||||||
|
private final SynthesisFilterManager mSynthesisFilterManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an instance
|
||||||
|
* @param channelCalculator for support
|
||||||
|
* @param synthesisFilterManager for support
|
||||||
|
*/
|
||||||
|
public PendingOutputProcessorUpdate(ChannelCalculator channelCalculator, SynthesisFilterManager synthesisFilterManager)
|
||||||
|
{
|
||||||
|
mChannelCalculator = channelCalculator;
|
||||||
|
mSynthesisFilterManager = synthesisFilterManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Channel calculator
|
||||||
|
*/
|
||||||
|
public ChannelCalculator getChannelCalculator()
|
||||||
|
{
|
||||||
|
return mChannelCalculator;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Channel calculator
|
||||||
|
*/
|
||||||
|
public SynthesisFilterManager getSynthesisFilterManager()
|
||||||
|
{
|
||||||
|
return mSynthesisFilterManager;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,8 +20,8 @@ package io.github.dsheirer.dsp.filter.channelizer.output;
|
|||||||
|
|
||||||
import io.github.dsheirer.sample.Listener;
|
import io.github.dsheirer.sample.Listener;
|
||||||
import io.github.dsheirer.sample.complex.ComplexSamples;
|
import io.github.dsheirer.sample.complex.ComplexSamples;
|
||||||
|
import io.github.dsheirer.source.heartbeat.HeartbeatManager;
|
||||||
import io.github.dsheirer.util.Dispatcher;
|
import io.github.dsheirer.util.Dispatcher;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -31,6 +31,7 @@ public abstract class ChannelOutputProcessor implements IPolyphaseChannelOutputP
|
|||||||
private final static Logger mLog = LoggerFactory.getLogger(ChannelOutputProcessor.class);
|
private final static Logger mLog = LoggerFactory.getLogger(ChannelOutputProcessor.class);
|
||||||
|
|
||||||
private Dispatcher<List<float[]>> mChannelResultsDispatcher;
|
private Dispatcher<List<float[]>> mChannelResultsDispatcher;
|
||||||
|
private HeartbeatManager mHeartbeatManager;
|
||||||
protected Listener<ComplexSamples> mComplexSamplesListener;
|
protected Listener<ComplexSamples> mComplexSamplesListener;
|
||||||
private int mInputChannelCount;
|
private int mInputChannelCount;
|
||||||
private long mCurrentSampleTimestamp = System.currentTimeMillis();
|
private long mCurrentSampleTimestamp = System.currentTimeMillis();
|
||||||
@@ -42,12 +43,25 @@ public abstract class ChannelOutputProcessor implements IPolyphaseChannelOutputP
|
|||||||
* @param inputChannelCount is the number of input channels for this output processor
|
* @param inputChannelCount is the number of input channels for this output processor
|
||||||
* @param sampleRate of the output channel. This is used to match the oscillator's sample rate to the output
|
* @param sampleRate of the output channel. This is used to match the oscillator's sample rate to the output
|
||||||
* channel sample rate for frequency translation/correction.
|
* channel sample rate for frequency translation/correction.
|
||||||
|
* @param heartbeatManager to receive pings on the dispatcher thread
|
||||||
*/
|
*/
|
||||||
public ChannelOutputProcessor(int inputChannelCount, double sampleRate)
|
public ChannelOutputProcessor(int inputChannelCount, double sampleRate, HeartbeatManager heartbeatManager)
|
||||||
{
|
{
|
||||||
mInputChannelCount = inputChannelCount;
|
mInputChannelCount = inputChannelCount;
|
||||||
mChannelResultsDispatcher = new Dispatcher<>((int)sampleRate, "sdrtrunk polyphase channel", Collections.emptyList());
|
//Process 1/10th of the sample rate per second at a rate of 20 times a second (200% of anticipated rate)
|
||||||
mChannelResultsDispatcher.setListener(floats -> process(floats));
|
mHeartbeatManager = heartbeatManager;
|
||||||
|
mChannelResultsDispatcher = new Dispatcher("sdrtrunk polyphase channel", (int)(sampleRate / 10),
|
||||||
|
50, mHeartbeatManager);
|
||||||
|
mChannelResultsDispatcher.setListener(floats -> {
|
||||||
|
try
|
||||||
|
{
|
||||||
|
process(floats);
|
||||||
|
}
|
||||||
|
catch(Throwable t)
|
||||||
|
{
|
||||||
|
mLog.error("Error processing channel results", t);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
package io.github.dsheirer.dsp.filter.channelizer.output;
|
package io.github.dsheirer.dsp.filter.channelizer.output;
|
||||||
|
|
||||||
import io.github.dsheirer.sample.complex.ComplexSamples;
|
import io.github.dsheirer.sample.complex.ComplexSamples;
|
||||||
|
import io.github.dsheirer.source.heartbeat.HeartbeatManager;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -36,10 +37,12 @@ public class OneChannelOutputProcessor extends ChannelOutputProcessor
|
|||||||
* @param sampleRate of the output sample stream.
|
* @param sampleRate of the output sample stream.
|
||||||
* @param channelIndexes containing a single channel index.
|
* @param channelIndexes containing a single channel index.
|
||||||
* @param gain value to apply. This is typically the same as the channelizer's channel count.
|
* @param gain value to apply. This is typically the same as the channelizer's channel count.
|
||||||
|
* @param heartbeatManager to receive heartbeats on the dispatch thread
|
||||||
*/
|
*/
|
||||||
public OneChannelOutputProcessor(double sampleRate, List<Integer> channelIndexes, float gain)
|
public OneChannelOutputProcessor(double sampleRate, List<Integer> channelIndexes, float gain,
|
||||||
|
HeartbeatManager heartbeatManager)
|
||||||
{
|
{
|
||||||
super(1, sampleRate);
|
super(1, sampleRate, heartbeatManager);
|
||||||
setPolyphaseChannelIndices(channelIndexes);
|
setPolyphaseChannelIndices(channelIndexes);
|
||||||
mMixerAssembler = new OneChannelMixerAssembler(gain);
|
mMixerAssembler = new OneChannelMixerAssembler(gain);
|
||||||
mMixerAssembler.getMixer().setSampleRate(sampleRate);
|
mMixerAssembler.getMixer().setSampleRate(sampleRate);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
package io.github.dsheirer.dsp.filter.channelizer.output;
|
package io.github.dsheirer.dsp.filter.channelizer.output;
|
||||||
|
|
||||||
import io.github.dsheirer.sample.complex.ComplexSamples;
|
import io.github.dsheirer.sample.complex.ComplexSamples;
|
||||||
|
import io.github.dsheirer.source.heartbeat.HeartbeatManager;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -37,12 +38,14 @@ public class TwoChannelOutputProcessor extends ChannelOutputProcessor
|
|||||||
* @param sampleRate of the output sample stream.
|
* @param sampleRate of the output sample stream.
|
||||||
* @param channelIndexes containing two channel indices.
|
* @param channelIndexes containing two channel indices.
|
||||||
* @param gain to apply to output. Typically this is equal to the channelizer's channel count.
|
* @param gain to apply to output. Typically this is equal to the channelizer's channel count.
|
||||||
|
* @param heartbeatManager to be pinged on the dispatcher thread
|
||||||
*/
|
*/
|
||||||
public TwoChannelOutputProcessor(double sampleRate, List<Integer> channelIndexes, float[] filter, float gain)
|
public TwoChannelOutputProcessor(double sampleRate, List<Integer> channelIndexes, float[] filter, float gain,
|
||||||
|
HeartbeatManager heartbeatManager)
|
||||||
{
|
{
|
||||||
//Set the frequency correction oscillator to 2 x output sample rate since we'll be correcting the frequency
|
//Set the frequency correction oscillator to 2 x output sample rate since we'll be correcting the frequency
|
||||||
//after synthesizing both input channels
|
//after synthesizing both input channels
|
||||||
super(2, sampleRate);
|
super(2, sampleRate, heartbeatManager);
|
||||||
setPolyphaseChannelIndices(channelIndexes);
|
setPolyphaseChannelIndices(channelIndexes);
|
||||||
mMixerAssembler = new TwoChannelMixerAssembler(gain);
|
mMixerAssembler = new TwoChannelMixerAssembler(gain);
|
||||||
mMixerAssembler.getMixer().setSampleRate(sampleRate);
|
mMixerAssembler.getMixer().setSampleRate(sampleRate);
|
||||||
|
|||||||
@@ -248,7 +248,11 @@ public class SDRTrunk implements Listener<TunerEvent>
|
|||||||
{
|
{
|
||||||
mMainGui.setVisible(true);
|
mMainGui.setVisible(true);
|
||||||
Tuner tuner = tunerSpectralDisplayManager.showFirstTuner();
|
Tuner tuner = tunerSpectralDisplayManager.showFirstTuner();
|
||||||
updateTitle(tuner);
|
|
||||||
|
if(tuner != null)
|
||||||
|
{
|
||||||
|
updateTitle(tuner.getPreferredName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(calibrating && !GraphicsEnvironment.isHeadless())
|
if(calibrating && !GraphicsEnvironment.isHeadless())
|
||||||
@@ -309,7 +313,7 @@ public class SDRTrunk implements Listener<TunerEvent>
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
new ChannelAutoStartFrame(mPlaylistManager.getChannelProcessingManager(), channels);
|
new ChannelAutoStartFrame(mPlaylistManager.getChannelProcessingManager(), channels, mUserPreferences);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -630,21 +634,34 @@ public class SDRTrunk implements Listener<TunerEvent>
|
|||||||
@Override
|
@Override
|
||||||
public void receive(TunerEvent event)
|
public void receive(TunerEvent event)
|
||||||
{
|
{
|
||||||
if(event.getEvent() == TunerEvent.Event.REQUEST_MAIN_SPECTRAL_DISPLAY)
|
switch(event.getEvent())
|
||||||
{
|
{
|
||||||
updateTitle(event.getTuner());
|
case REQUEST_MAIN_SPECTRAL_DISPLAY:
|
||||||
|
updateTitle(event.getTuner().getPreferredName());
|
||||||
|
break;
|
||||||
|
case REQUEST_CLEAR_MAIN_SPECTRAL_DISPLAY:
|
||||||
|
updateTitle(null);
|
||||||
|
break;
|
||||||
|
case NOTIFICATION_SHUTTING_DOWN:
|
||||||
|
Tuner currentTuner = mSpectralPanel.getTuner();
|
||||||
|
|
||||||
|
if(event.hasTuner() && event.getTuner().equals(currentTuner) || currentTuner == null)
|
||||||
|
{
|
||||||
|
updateTitle(null);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the title bar with the tuner name
|
* Updates the title bar with the tuner name
|
||||||
* @param tuner optional
|
* @param tunerName optional
|
||||||
*/
|
*/
|
||||||
private void updateTitle(Tuner tuner)
|
private void updateTitle(String tunerName)
|
||||||
{
|
{
|
||||||
if(tuner != null)
|
if(tunerName != null)
|
||||||
{
|
{
|
||||||
mMainGui.setTitle(mTitle + " - " + tuner.getPreferredName());
|
mMainGui.setTitle(mTitle + " - " + tunerName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ import io.github.dsheirer.module.decode.dmr.DecodeConfigDMR;
|
|||||||
import io.github.dsheirer.record.binary.BinaryReader;
|
import io.github.dsheirer.record.binary.BinaryReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.TreeSet;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.prefs.Preferences;
|
import java.util.prefs.Preferences;
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
@@ -35,6 +37,7 @@ import javafx.beans.value.ObservableValue;
|
|||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.collections.transformation.FilteredList;
|
import javafx.collections.transformation.FilteredList;
|
||||||
|
import javafx.collections.transformation.SortedList;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
import javafx.geometry.Pos;
|
import javafx.geometry.Pos;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
@@ -42,9 +45,15 @@ import javafx.scene.control.Button;
|
|||||||
import javafx.scene.control.CheckBox;
|
import javafx.scene.control.CheckBox;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.TableColumn;
|
import javafx.scene.control.TableColumn;
|
||||||
|
import javafx.scene.control.TablePosition;
|
||||||
import javafx.scene.control.TableView;
|
import javafx.scene.control.TableView;
|
||||||
import javafx.scene.control.TextField;
|
import javafx.scene.control.TextField;
|
||||||
import javafx.scene.control.cell.PropertyValueFactory;
|
import javafx.scene.control.cell.PropertyValueFactory;
|
||||||
|
import javafx.scene.input.Clipboard;
|
||||||
|
import javafx.scene.input.ClipboardContent;
|
||||||
|
import javafx.scene.input.KeyCode;
|
||||||
|
import javafx.scene.input.KeyCodeCombination;
|
||||||
|
import javafx.scene.input.KeyCombination;
|
||||||
import javafx.scene.layout.HBox;
|
import javafx.scene.layout.HBox;
|
||||||
import javafx.scene.layout.Priority;
|
import javafx.scene.layout.Priority;
|
||||||
import javafx.scene.layout.VBox;
|
import javafx.scene.layout.VBox;
|
||||||
@@ -60,6 +69,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
public class DMRRecordingViewer extends VBox
|
public class DMRRecordingViewer extends VBox
|
||||||
{
|
{
|
||||||
private static final Logger mLog = LoggerFactory.getLogger(DMRRecordingViewer.class);
|
private static final Logger mLog = LoggerFactory.getLogger(DMRRecordingViewer.class);
|
||||||
|
private static final KeyCodeCombination KEY_CODE_COPY = new KeyCodeCombination(KeyCode.C, KeyCombination.CONTROL_ANY);
|
||||||
private static final String LAST_SELECTED_DIRECTORY = "last.selected.directory";
|
private static final String LAST_SELECTED_DIRECTORY = "last.selected.directory";
|
||||||
private Preferences mPreferences = Preferences.userNodeForPackage(DMRRecordingViewer.class);
|
private Preferences mPreferences = Preferences.userNodeForPackage(DMRRecordingViewer.class);
|
||||||
private Scene mScene;
|
private Scene mScene;
|
||||||
@@ -243,7 +253,56 @@ public class DMRRecordingViewer extends VBox
|
|||||||
{
|
{
|
||||||
if(mMessageTableView == null)
|
if(mMessageTableView == null)
|
||||||
{
|
{
|
||||||
mMessageTableView = new TableView<>(mFilteredMessages);
|
mMessageTableView = new TableView<>();
|
||||||
|
SortedList<IMessage> sortedList = new SortedList<>(mFilteredMessages);
|
||||||
|
sortedList.comparatorProperty().bind(mMessageTableView.comparatorProperty());
|
||||||
|
mMessageTableView.setItems(sortedList);
|
||||||
|
|
||||||
|
mMessageTableView.setOnKeyPressed(event ->
|
||||||
|
{
|
||||||
|
if(KEY_CODE_COPY.match(event))
|
||||||
|
{
|
||||||
|
final Set<Integer> rows = new TreeSet<>();
|
||||||
|
for (final TablePosition tablePosition : mMessageTableView.getSelectionModel().getSelectedCells())
|
||||||
|
{
|
||||||
|
rows.add(tablePosition.getRow());
|
||||||
|
}
|
||||||
|
|
||||||
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
boolean firstRow = true;
|
||||||
|
for (final Integer row : rows)
|
||||||
|
{
|
||||||
|
if(firstRow)
|
||||||
|
{
|
||||||
|
firstRow = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sb.append('\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean firstCol = true;
|
||||||
|
|
||||||
|
for (final TableColumn<?, ?> column : mMessageTableView.getColumns())
|
||||||
|
{
|
||||||
|
if(firstCol)
|
||||||
|
{
|
||||||
|
firstCol = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sb.append('\t');
|
||||||
|
}
|
||||||
|
|
||||||
|
final Object cellData = column.getCellData(row);
|
||||||
|
sb.append(cellData == null ? "" : cellData.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
final ClipboardContent clipboardContent = new ClipboardContent();
|
||||||
|
clipboardContent.putString(sb.toString());
|
||||||
|
Clipboard.getSystemClipboard().setContent(clipboardContent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
TableColumn timestampColumn = new TableColumn();
|
TableColumn timestampColumn = new TableColumn();
|
||||||
timestampColumn.setPrefWidth(110);
|
timestampColumn.setPrefWidth(110);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package io.github.dsheirer.gui.preference;
|
package io.github.dsheirer.gui.preference;
|
||||||
|
|
||||||
|
import io.github.dsheirer.gui.preference.application.ApplicationPreferenceEditor;
|
||||||
import io.github.dsheirer.gui.preference.calibration.VectorCalibrationPreferenceEditor;
|
import io.github.dsheirer.gui.preference.calibration.VectorCalibrationPreferenceEditor;
|
||||||
import io.github.dsheirer.gui.preference.decoder.JmbeLibraryPreferenceEditor;
|
import io.github.dsheirer.gui.preference.decoder.JmbeLibraryPreferenceEditor;
|
||||||
import io.github.dsheirer.gui.preference.directory.DirectoryPreferenceEditor;
|
import io.github.dsheirer.gui.preference.directory.DirectoryPreferenceEditor;
|
||||||
@@ -39,6 +40,8 @@ public class PreferenceEditorFactory
|
|||||||
{
|
{
|
||||||
switch(preferenceEditorType)
|
switch(preferenceEditorType)
|
||||||
{
|
{
|
||||||
|
case APPLICATION:
|
||||||
|
return new ApplicationPreferenceEditor(userPreferences);
|
||||||
case AUDIO_DUPLICATE_CALL_DETECTION:
|
case AUDIO_DUPLICATE_CALL_DETECTION:
|
||||||
return new DuplicateCallPreferenceEditor(userPreferences);
|
return new DuplicateCallPreferenceEditor(userPreferences);
|
||||||
case AUDIO_MP3:
|
case AUDIO_MP3:
|
||||||
@@ -53,7 +56,7 @@ public class PreferenceEditorFactory
|
|||||||
return new DirectoryPreferenceEditor(userPreferences);
|
return new DirectoryPreferenceEditor(userPreferences);
|
||||||
case JMBE_LIBRARY:
|
case JMBE_LIBRARY:
|
||||||
return new JmbeLibraryPreferenceEditor(userPreferences);
|
return new JmbeLibraryPreferenceEditor(userPreferences);
|
||||||
case SOURCE_TUNER_CHANNELIZER:
|
case SOURCE_TUNERS:
|
||||||
return new TunerPreferenceEditor(userPreferences);
|
return new TunerPreferenceEditor(userPreferences);
|
||||||
case TALKGROUP_FORMAT:
|
case TALKGROUP_FORMAT:
|
||||||
return new TalkgroupFormatPreferenceEditor(userPreferences);
|
return new TalkgroupFormatPreferenceEditor(userPreferences);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -24,6 +24,7 @@ package io.github.dsheirer.gui.preference;
|
|||||||
*/
|
*/
|
||||||
public enum PreferenceEditorType
|
public enum PreferenceEditorType
|
||||||
{
|
{
|
||||||
|
APPLICATION("Application"),
|
||||||
CHANNEL_EVENT("Channel Events"),
|
CHANNEL_EVENT("Channel Events"),
|
||||||
DIRECTORY("Directories"),
|
DIRECTORY("Directories"),
|
||||||
JMBE_LIBRARY("JMBE Audio Library"),
|
JMBE_LIBRARY("JMBE Audio Library"),
|
||||||
@@ -31,7 +32,7 @@ public enum PreferenceEditorType
|
|||||||
AUDIO_RECORD("Record"),
|
AUDIO_RECORD("Record"),
|
||||||
AUDIO_OUTPUT("Output/Tones"),
|
AUDIO_OUTPUT("Output/Tones"),
|
||||||
AUDIO_DUPLICATE_CALL_DETECTION("Duplicate Calls"),
|
AUDIO_DUPLICATE_CALL_DETECTION("Duplicate Calls"),
|
||||||
SOURCE_TUNER_CHANNELIZER("Tuner Channelizer"),
|
SOURCE_TUNERS("Tuners"),
|
||||||
TALKGROUP_FORMAT("Talkgroup & Radio ID"),
|
TALKGROUP_FORMAT("Talkgroup & Radio ID"),
|
||||||
VECTOR_CALIBRATION("Vector Calibration"),
|
VECTOR_CALIBRATION("Vector Calibration"),
|
||||||
DEFAULT("Default");
|
DEFAULT("Default");
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -22,6 +22,8 @@ package io.github.dsheirer.gui.preference;
|
|||||||
import io.github.dsheirer.eventbus.MyEventBus;
|
import io.github.dsheirer.eventbus.MyEventBus;
|
||||||
import io.github.dsheirer.gui.playlist.ViewPlaylistRequest;
|
import io.github.dsheirer.gui.playlist.ViewPlaylistRequest;
|
||||||
import io.github.dsheirer.preference.UserPreferences;
|
import io.github.dsheirer.preference.UserPreferences;
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.Map;
|
||||||
import javafx.beans.value.ChangeListener;
|
import javafx.beans.value.ChangeListener;
|
||||||
import javafx.beans.value.ObservableValue;
|
import javafx.beans.value.ObservableValue;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
@@ -44,9 +46,6 @@ import javafx.stage.Stage;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.EnumMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Preferences editor dialog
|
* Preferences editor dialog
|
||||||
*/
|
*/
|
||||||
@@ -166,6 +165,11 @@ public class UserPreferencesEditor extends BorderPane
|
|||||||
{
|
{
|
||||||
TreeItem<String> treeRoot = new TreeItem<>("Root node");
|
TreeItem<String> treeRoot = new TreeItem<>("Root node");
|
||||||
|
|
||||||
|
TreeItem<String> applicationItem = new TreeItem<>("Application");
|
||||||
|
applicationItem.getChildren().add(new TreeItem(PreferenceEditorType.APPLICATION));
|
||||||
|
treeRoot.getChildren().add(applicationItem);
|
||||||
|
applicationItem.setExpanded(true);
|
||||||
|
|
||||||
TreeItem<String> audioItem = new TreeItem<>("Audio");
|
TreeItem<String> audioItem = new TreeItem<>("Audio");
|
||||||
audioItem.getChildren().add(new TreeItem(PreferenceEditorType.AUDIO_DUPLICATE_CALL_DETECTION));
|
audioItem.getChildren().add(new TreeItem(PreferenceEditorType.AUDIO_DUPLICATE_CALL_DETECTION));
|
||||||
audioItem.getChildren().add(new TreeItem(PreferenceEditorType.AUDIO_MP3));
|
audioItem.getChildren().add(new TreeItem(PreferenceEditorType.AUDIO_MP3));
|
||||||
@@ -196,7 +200,7 @@ public class UserPreferencesEditor extends BorderPane
|
|||||||
storageItem.setExpanded(true);
|
storageItem.setExpanded(true);
|
||||||
|
|
||||||
TreeItem<String> sourceItem = new TreeItem<>("Source");
|
TreeItem<String> sourceItem = new TreeItem<>("Source");
|
||||||
sourceItem.getChildren().add(new TreeItem(PreferenceEditorType.SOURCE_TUNER_CHANNELIZER));
|
sourceItem.getChildren().add(new TreeItem(PreferenceEditorType.SOURCE_TUNERS));
|
||||||
treeRoot.getChildren().add(sourceItem);
|
treeRoot.getChildren().add(sourceItem);
|
||||||
sourceItem.setExpanded(true);
|
sourceItem.setExpanded(true);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.gui.preference.application;
|
||||||
|
|
||||||
|
import io.github.dsheirer.preference.UserPreferences;
|
||||||
|
import io.github.dsheirer.preference.application.ApplicationPreference;
|
||||||
|
import javafx.geometry.HPos;
|
||||||
|
import javafx.geometry.Insets;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
|
import javafx.scene.control.Spinner;
|
||||||
|
import javafx.scene.layout.GridPane;
|
||||||
|
import javafx.scene.layout.HBox;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Preference settings for application
|
||||||
|
*/
|
||||||
|
public class ApplicationPreferenceEditor extends HBox
|
||||||
|
{
|
||||||
|
private ApplicationPreference mApplicationPreference;
|
||||||
|
private GridPane mEditorPane;
|
||||||
|
private Label mAutoStartTimeoutLabel;
|
||||||
|
private Spinner<Integer> mTimeoutSpinner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an instance
|
||||||
|
* @param userPreferences for obtaining reference to preference.
|
||||||
|
*/
|
||||||
|
public ApplicationPreferenceEditor(UserPreferences userPreferences)
|
||||||
|
{
|
||||||
|
mApplicationPreference = userPreferences.getApplicationPreference();
|
||||||
|
getChildren().add(getEditorPane());
|
||||||
|
}
|
||||||
|
|
||||||
|
private GridPane getEditorPane()
|
||||||
|
{
|
||||||
|
if(mEditorPane == null)
|
||||||
|
{
|
||||||
|
int row = 0;
|
||||||
|
mEditorPane = new GridPane();
|
||||||
|
mEditorPane.setVgap(10);
|
||||||
|
mEditorPane.setHgap(10);
|
||||||
|
mEditorPane.setPadding(new Insets(10, 10, 10, 10));
|
||||||
|
GridPane.setHalignment(getAutoStartTimeoutLabel(), HPos.RIGHT);
|
||||||
|
mEditorPane.add(getAutoStartTimeoutLabel(), 0, row);
|
||||||
|
mEditorPane.add(getTimeoutSpinner(), 1, row);
|
||||||
|
mEditorPane.add(new Label("seconds"), 2, row);
|
||||||
|
}
|
||||||
|
|
||||||
|
return mEditorPane;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Label getAutoStartTimeoutLabel()
|
||||||
|
{
|
||||||
|
if(mAutoStartTimeoutLabel == null)
|
||||||
|
{
|
||||||
|
mAutoStartTimeoutLabel = new Label("Channel Auto-Start Timeout");
|
||||||
|
}
|
||||||
|
|
||||||
|
return mAutoStartTimeoutLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spinner to select channel auto-start timeout value in range 0-30 seconds.
|
||||||
|
* @return spinner
|
||||||
|
*/
|
||||||
|
private Spinner<Integer> getTimeoutSpinner()
|
||||||
|
{
|
||||||
|
if(mTimeoutSpinner == null)
|
||||||
|
{
|
||||||
|
mTimeoutSpinner = new Spinner<>(0, 30, mApplicationPreference.getChannelAutoStartTimeout(), 1);
|
||||||
|
mTimeoutSpinner.valueProperty().addListener((observable, oldValue, newValue) -> mApplicationPreference.setChannelAutoStartTimeout(newValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
return mTimeoutSpinner;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -24,10 +24,9 @@ import io.github.dsheirer.preference.UserPreferences;
|
|||||||
import io.github.dsheirer.preference.playback.PlaybackPreference;
|
import io.github.dsheirer.preference.playback.PlaybackPreference;
|
||||||
import io.github.dsheirer.source.mixer.MixerChannelConfiguration;
|
import io.github.dsheirer.source.mixer.MixerChannelConfiguration;
|
||||||
import io.github.dsheirer.source.mixer.MixerManager;
|
import io.github.dsheirer.source.mixer.MixerManager;
|
||||||
import javafx.beans.value.ChangeListener;
|
import java.nio.ByteBuffer;
|
||||||
import javafx.beans.value.ObservableValue;
|
import java.nio.ByteOrder;
|
||||||
import javafx.event.ActionEvent;
|
import java.nio.ShortBuffer;
|
||||||
import javafx.event.EventHandler;
|
|
||||||
import javafx.geometry.HPos;
|
import javafx.geometry.HPos;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
import javafx.geometry.Orientation;
|
import javafx.geometry.Orientation;
|
||||||
@@ -49,9 +48,6 @@ import org.slf4j.LoggerFactory;
|
|||||||
import javax.sound.sampled.AudioSystem;
|
import javax.sound.sampled.AudioSystem;
|
||||||
import javax.sound.sampled.Clip;
|
import javax.sound.sampled.Clip;
|
||||||
import javax.sound.sampled.DataLine;
|
import javax.sound.sampled.DataLine;
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.ByteOrder;
|
|
||||||
import java.nio.ShortBuffer;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -60,20 +56,16 @@ import java.nio.ShortBuffer;
|
|||||||
public class PlaybackPreferenceEditor extends HBox
|
public class PlaybackPreferenceEditor extends HBox
|
||||||
{
|
{
|
||||||
private final static Logger mLog = LoggerFactory.getLogger(PlaybackPreferenceEditor.class);
|
private final static Logger mLog = LoggerFactory.getLogger(PlaybackPreferenceEditor.class);
|
||||||
private PlaybackPreference mPlaybackPreference;
|
private final PlaybackPreference mPlaybackPreference;
|
||||||
private GridPane mEditorPane;
|
private GridPane mEditorPane;
|
||||||
private ComboBox<MixerChannelConfiguration> mMixerComboBox;
|
private ComboBox<MixerChannelConfiguration> mMixerComboBox;
|
||||||
private Button mMixerTestButton;
|
private Button mMixerTestButton;
|
||||||
private ToggleSwitch mUseAudioSegmentStartToneSwitch;
|
private ToggleSwitch mUseAudioSegmentStartToneSwitch;
|
||||||
private Button mTestStartToneButton;
|
private Button mTestStartToneButton;
|
||||||
private ToggleSwitch mUseAudioSegmentPreemptToneSwitch;
|
|
||||||
private Button mTestPreemptToneButton;
|
|
||||||
private ToggleSwitch mUseAudioSegmentDropToneSwitch;
|
private ToggleSwitch mUseAudioSegmentDropToneSwitch;
|
||||||
private Button mTestDropToneButton;
|
private Button mTestDropToneButton;
|
||||||
private ComboBox<ToneFrequency> mStartToneFrequencyComboBox;
|
private ComboBox<ToneFrequency> mStartToneFrequencyComboBox;
|
||||||
private ComboBox<ToneVolume> mStartToneVolumeComboBox;
|
private ComboBox<ToneVolume> mStartToneVolumeComboBox;
|
||||||
private ComboBox<ToneFrequency> mPreemptToneFrequencyComboBox;
|
|
||||||
private ComboBox<ToneVolume> mPreemptToneVolumeComboBox;
|
|
||||||
private ComboBox<ToneFrequency> mDropToneFrequencyComboBox;
|
private ComboBox<ToneFrequency> mDropToneFrequencyComboBox;
|
||||||
private ComboBox<ToneVolume> mDropToneVolumeComboBox;
|
private ComboBox<ToneVolume> mDropToneVolumeComboBox;
|
||||||
|
|
||||||
@@ -114,18 +106,6 @@ public class PlaybackPreferenceEditor extends HBox
|
|||||||
mEditorPane.add(getStartToneVolumeComboBox(), 4, row);
|
mEditorPane.add(getStartToneVolumeComboBox(), 4, row);
|
||||||
mEditorPane.add(getTestStartToneButton(), 5, row);
|
mEditorPane.add(getTestStartToneButton(), 5, row);
|
||||||
|
|
||||||
mEditorPane.add(getUseAudioSegmentPreemptToneSwitch(), 0, ++row);
|
|
||||||
mEditorPane.add(new Label("Priority Preempt Tone"), 1, row, 3, 1);
|
|
||||||
Label preemptFrequencyLabel = new Label("Frequency:");
|
|
||||||
GridPane.setHalignment(preemptFrequencyLabel, HPos.RIGHT);
|
|
||||||
mEditorPane.add(preemptFrequencyLabel, 1, ++row);
|
|
||||||
mEditorPane.add(getPreemptToneFrequencyComboBox(), 2, row);
|
|
||||||
Label preemptVolumeLabel = new Label("Volume:");
|
|
||||||
GridPane.setHalignment(preemptVolumeLabel, HPos.RIGHT);
|
|
||||||
mEditorPane.add(preemptVolumeLabel, 3, row);
|
|
||||||
mEditorPane.add(getPreemptToneVolumeComboBox(), 4, row);
|
|
||||||
mEditorPane.add(getTestPreemptToneButton(), 5, row);
|
|
||||||
|
|
||||||
mEditorPane.add(getUseAudioSegmentDropToneSwitch(), 0, ++row);
|
mEditorPane.add(getUseAudioSegmentDropToneSwitch(), 0, ++row);
|
||||||
mEditorPane.add(new Label("Drop Tone - Do Not Monitor"), 1, row, 3, 1);
|
mEditorPane.add(new Label("Drop Tone - Do Not Monitor"), 1, row, 3, 1);
|
||||||
Label dropFrequencyLabel = new Label("Frequency:");
|
Label dropFrequencyLabel = new Label("Frequency:");
|
||||||
@@ -177,52 +157,21 @@ public class PlaybackPreferenceEditor extends HBox
|
|||||||
mUseAudioSegmentStartToneSwitch = new ToggleSwitch();
|
mUseAudioSegmentStartToneSwitch = new ToggleSwitch();
|
||||||
mUseAudioSegmentStartToneSwitch.setAlignment(Pos.BASELINE_RIGHT);
|
mUseAudioSegmentStartToneSwitch.setAlignment(Pos.BASELINE_RIGHT);
|
||||||
mUseAudioSegmentStartToneSwitch.setSelected(mPlaybackPreference.getUseAudioSegmentStartTone());
|
mUseAudioSegmentStartToneSwitch.setSelected(mPlaybackPreference.getUseAudioSegmentStartTone());
|
||||||
mUseAudioSegmentStartToneSwitch.selectedProperty().addListener(new ChangeListener<Boolean>()
|
mUseAudioSegmentStartToneSwitch.selectedProperty().addListener((observable, oldValue, newValue) ->
|
||||||
{
|
mPlaybackPreference.setUseAudioSegmentStartTone(newValue));
|
||||||
@Override
|
|
||||||
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue)
|
|
||||||
{
|
|
||||||
mPlaybackPreference.setUseAudioSegmentStartTone(newValue);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return mUseAudioSegmentStartToneSwitch;
|
return mUseAudioSegmentStartToneSwitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ToggleSwitch getUseAudioSegmentPreemptToneSwitch()
|
|
||||||
{
|
|
||||||
if(mUseAudioSegmentPreemptToneSwitch == null)
|
|
||||||
{
|
|
||||||
mUseAudioSegmentPreemptToneSwitch = new ToggleSwitch();
|
|
||||||
mUseAudioSegmentPreemptToneSwitch.setSelected(mPlaybackPreference.getUseAudioSegmentPreemptTone());
|
|
||||||
mUseAudioSegmentPreemptToneSwitch.selectedProperty().addListener(new ChangeListener<Boolean>()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue)
|
|
||||||
{
|
|
||||||
mPlaybackPreference.setUseAudioSegmentPreemptTone(newValue);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return mUseAudioSegmentPreemptToneSwitch;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ToggleSwitch getUseAudioSegmentDropToneSwitch()
|
private ToggleSwitch getUseAudioSegmentDropToneSwitch()
|
||||||
{
|
{
|
||||||
if(mUseAudioSegmentDropToneSwitch == null)
|
if(mUseAudioSegmentDropToneSwitch == null)
|
||||||
{
|
{
|
||||||
mUseAudioSegmentDropToneSwitch = new ToggleSwitch();
|
mUseAudioSegmentDropToneSwitch = new ToggleSwitch();
|
||||||
mUseAudioSegmentDropToneSwitch.setSelected(mPlaybackPreference.getUseAudioSegmentDropTone());
|
mUseAudioSegmentDropToneSwitch.setSelected(mPlaybackPreference.getUseAudioSegmentDropTone());
|
||||||
mUseAudioSegmentDropToneSwitch.selectedProperty().addListener(new ChangeListener<Boolean>()
|
mUseAudioSegmentDropToneSwitch.selectedProperty().addListener((observable, oldValue, newValue) ->
|
||||||
{
|
mPlaybackPreference.setUseAudioSegmentDropTone(newValue));
|
||||||
@Override
|
|
||||||
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue)
|
|
||||||
{
|
|
||||||
mPlaybackPreference.setUseAudioSegmentDropTone(newValue);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return mUseAudioSegmentDropToneSwitch;
|
return mUseAudioSegmentDropToneSwitch;
|
||||||
@@ -236,14 +185,7 @@ public class PlaybackPreferenceEditor extends HBox
|
|||||||
IconNode iconNode = new IconNode(FontAwesome.PLAY);
|
IconNode iconNode = new IconNode(FontAwesome.PLAY);
|
||||||
iconNode.setFill(Color.CORNFLOWERBLUE);
|
iconNode.setFill(Color.CORNFLOWERBLUE);
|
||||||
mTestStartToneButton.setGraphic(iconNode);
|
mTestStartToneButton.setGraphic(iconNode);
|
||||||
mTestStartToneButton.setOnAction(new EventHandler<ActionEvent>()
|
mTestStartToneButton.setOnAction(event -> play(mPlaybackPreference.getStartTone()));
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void handle(ActionEvent event)
|
|
||||||
{
|
|
||||||
play(mPlaybackPreference.getStartTone());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mTestStartToneButton.disableProperty().bind(getUseAudioSegmentStartToneSwitch().selectedProperty().not());
|
mTestStartToneButton.disableProperty().bind(getUseAudioSegmentStartToneSwitch().selectedProperty().not());
|
||||||
}
|
}
|
||||||
@@ -251,29 +193,6 @@ public class PlaybackPreferenceEditor extends HBox
|
|||||||
return mTestStartToneButton;
|
return mTestStartToneButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Button getTestPreemptToneButton()
|
|
||||||
{
|
|
||||||
if(mTestPreemptToneButton == null)
|
|
||||||
{
|
|
||||||
mTestPreemptToneButton = new Button("Test");
|
|
||||||
IconNode iconNode = new IconNode(FontAwesome.PLAY);
|
|
||||||
iconNode.setFill(Color.CORNFLOWERBLUE);
|
|
||||||
mTestPreemptToneButton.setGraphic(iconNode);
|
|
||||||
mTestPreemptToneButton.setOnAction(new EventHandler<ActionEvent>()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void handle(ActionEvent event)
|
|
||||||
{
|
|
||||||
play(mPlaybackPreference.getPreemptTone());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mTestPreemptToneButton.disableProperty().bind(getUseAudioSegmentPreemptToneSwitch().selectedProperty().not());
|
|
||||||
}
|
|
||||||
|
|
||||||
return mTestPreemptToneButton;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Button getTestDropToneButton()
|
public Button getTestDropToneButton()
|
||||||
{
|
{
|
||||||
if(mTestDropToneButton == null)
|
if(mTestDropToneButton == null)
|
||||||
@@ -282,14 +201,7 @@ public class PlaybackPreferenceEditor extends HBox
|
|||||||
IconNode iconNode = new IconNode(FontAwesome.PLAY);
|
IconNode iconNode = new IconNode(FontAwesome.PLAY);
|
||||||
iconNode.setFill(Color.CORNFLOWERBLUE);
|
iconNode.setFill(Color.CORNFLOWERBLUE);
|
||||||
mTestDropToneButton.setGraphic(iconNode);
|
mTestDropToneButton.setGraphic(iconNode);
|
||||||
mTestDropToneButton.setOnAction(new EventHandler<ActionEvent>()
|
mTestDropToneButton.setOnAction(event -> play(mPlaybackPreference.getDropTone()));
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void handle(ActionEvent event)
|
|
||||||
{
|
|
||||||
play(mPlaybackPreference.getDropTone());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mTestDropToneButton.disableProperty().bind(getUseAudioSegmentDropToneSwitch().selectedProperty().not());
|
mTestDropToneButton.disableProperty().bind(getUseAudioSegmentDropToneSwitch().selectedProperty().not());
|
||||||
}
|
}
|
||||||
@@ -357,36 +269,6 @@ public class PlaybackPreferenceEditor extends HBox
|
|||||||
return mStartToneVolumeComboBox;
|
return mStartToneVolumeComboBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ComboBox<ToneFrequency> getPreemptToneFrequencyComboBox()
|
|
||||||
{
|
|
||||||
if(mPreemptToneFrequencyComboBox == null)
|
|
||||||
{
|
|
||||||
mPreemptToneFrequencyComboBox = new ComboBox<>();
|
|
||||||
mPreemptToneFrequencyComboBox.getItems().addAll(ToneFrequency.values());
|
|
||||||
mPreemptToneFrequencyComboBox.getSelectionModel().select(mPlaybackPreference.getPreemptToneFrequency());
|
|
||||||
mPreemptToneFrequencyComboBox.getSelectionModel().selectedItemProperty()
|
|
||||||
.addListener((observable, oldValue, newValue) -> mPlaybackPreference.setPreemptToneFrequency(newValue));
|
|
||||||
mPreemptToneFrequencyComboBox.disableProperty().bind(getUseAudioSegmentPreemptToneSwitch().selectedProperty().not());
|
|
||||||
}
|
|
||||||
|
|
||||||
return mPreemptToneFrequencyComboBox;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ComboBox<ToneVolume> getPreemptToneVolumeComboBox()
|
|
||||||
{
|
|
||||||
if(mPreemptToneVolumeComboBox == null)
|
|
||||||
{
|
|
||||||
mPreemptToneVolumeComboBox = new ComboBox<>();
|
|
||||||
mPreemptToneVolumeComboBox.getItems().addAll(ToneVolume.values());
|
|
||||||
mPreemptToneVolumeComboBox.getSelectionModel().select(mPlaybackPreference.getPreemptToneVolume());
|
|
||||||
mPreemptToneVolumeComboBox.getSelectionModel().selectedItemProperty()
|
|
||||||
.addListener((observable, oldValue, newValue) -> mPlaybackPreference.setPreemptToneVolume(newValue));
|
|
||||||
mPreemptToneVolumeComboBox.disableProperty().bind(getUseAudioSegmentPreemptToneSwitch().selectedProperty().not());
|
|
||||||
}
|
|
||||||
|
|
||||||
return mPreemptToneVolumeComboBox;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plays the audio buffer over the default mono playback device
|
* Plays the audio buffer over the default mono playback device
|
||||||
* @param audioSamples with 8 kHz mono PCM samples
|
* @param audioSamples with 8 kHz mono PCM samples
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.gui.preference.tuner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RSPduo tuner select mode preferences.
|
||||||
|
*/
|
||||||
|
public enum RspDuoSelectionMode
|
||||||
|
{
|
||||||
|
DUAL("Dual Tuner"),
|
||||||
|
SINGLE_1("Single Tuner 1"),
|
||||||
|
SINGLE_2("Single Tuner 2");
|
||||||
|
|
||||||
|
private String mLabel;
|
||||||
|
|
||||||
|
RspDuoSelectionMode(String label)
|
||||||
|
{
|
||||||
|
mLabel = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return mLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lookup the enum entry from the value.
|
||||||
|
* @param value to match
|
||||||
|
* @return matched value or (default) DUAL if the value couldn't be matched.
|
||||||
|
*/
|
||||||
|
public static RspDuoSelectionMode fromValue(String value)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return RspDuoSelectionMode.valueOf(value);
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
//Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
return DUAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,23 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2022 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* * ******************************************************************************
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* * Copyright (C) 2014-2020 Dennis Sheirer
|
* it under the terms of the GNU General Public License as published by
|
||||||
* *
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* * This program is free software: you can redistribute it and/or modify
|
* (at your option) any later version.
|
||||||
* * it under the terms of the GNU General Public License as published by
|
|
||||||
* * the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* * (at your option) any later version.
|
|
||||||
* *
|
|
||||||
* * This program is distributed in the hope that it will be useful,
|
|
||||||
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* * GNU General Public License for more details.
|
|
||||||
* *
|
|
||||||
* * You should have received a copy of the GNU General Public License
|
|
||||||
* * along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
* * *****************************************************************************
|
|
||||||
*
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.github.dsheirer.gui.preference.tuner;
|
package io.github.dsheirer.gui.preference.tuner;
|
||||||
@@ -55,6 +52,8 @@ public class TunerPreferenceEditor extends HBox
|
|||||||
private Label mHelpTextPolyphaseLabel;
|
private Label mHelpTextPolyphaseLabel;
|
||||||
private Label mHeterodyneLabel;
|
private Label mHeterodyneLabel;
|
||||||
private Label mHelpTextHeterodyneLabel;
|
private Label mHelpTextHeterodyneLabel;
|
||||||
|
private ChoiceBox<RspDuoSelectionMode> mRspDuoTunerModeChoiceBox;
|
||||||
|
private Label mRspDuoModeLabel;
|
||||||
|
|
||||||
public TunerPreferenceEditor(UserPreferences userPreferences)
|
public TunerPreferenceEditor(UserPreferences userPreferences)
|
||||||
{
|
{
|
||||||
@@ -66,19 +65,24 @@ public class TunerPreferenceEditor extends HBox
|
|||||||
{
|
{
|
||||||
if(mEditorPane == null)
|
if(mEditorPane == null)
|
||||||
{
|
{
|
||||||
|
int row = 0;
|
||||||
mEditorPane = new GridPane();
|
mEditorPane = new GridPane();
|
||||||
mEditorPane.setVgap(10);
|
mEditorPane.setVgap(10);
|
||||||
mEditorPane.setHgap(10);
|
mEditorPane.setHgap(10);
|
||||||
mEditorPane.setPadding(new Insets(10, 10, 10, 10));
|
mEditorPane.setPadding(new Insets(10, 10, 10, 10));
|
||||||
GridPane.setHalignment(getChannelizerLabel(), HPos.LEFT);
|
GridPane.setHalignment(getChannelizerLabel(), HPos.RIGHT);
|
||||||
mEditorPane.add(getChannelizerLabel(), 0, 0);
|
mEditorPane.add(getChannelizerLabel(), 0, row);
|
||||||
mEditorPane.add(getChannelizerTypeChoiceBox(), 1, 0);
|
mEditorPane.add(getChannelizerTypeChoiceBox(), 1, row);
|
||||||
mEditorPane.add(new Separator(Orientation.HORIZONTAL), 0, 1, 2, 1);
|
mEditorPane.add(getPolyphaseLabel(), 0, ++row, 2, 1);
|
||||||
mEditorPane.add(getPolyphaseLabel(), 0, 2, 2, 1);
|
mEditorPane.add(getHelpTextPolyphaseLabel(), 0, ++row, 2, 3);
|
||||||
mEditorPane.add(getHelpTextPolyphaseLabel(), 0, 3, 2, 3);
|
row += 3;
|
||||||
mEditorPane.add(new Label(" "), 0, 6);
|
mEditorPane.add(new Label(" "), 0, row);
|
||||||
mEditorPane.add(getHeterodyneLabel(), 0, 7, 2, 1);
|
mEditorPane.add(getHeterodyneLabel(), 0, ++row, 2, 1);
|
||||||
mEditorPane.add(getHelpTextHeterodyneLabel(), 0, 8, 2, 3);
|
mEditorPane.add(getHelpTextHeterodyneLabel(), 0, ++row, 2, 3);
|
||||||
|
row += 3;
|
||||||
|
mEditorPane.add(new Separator(Orientation.HORIZONTAL), 0, row, 2, 1);
|
||||||
|
mEditorPane.add(getRspDuoModeLabel(), 0, ++row);
|
||||||
|
mEditorPane.add(getRspDuoTunerModeChoiceBox(), 1, row);
|
||||||
}
|
}
|
||||||
|
|
||||||
return mEditorPane;
|
return mEditorPane;
|
||||||
@@ -161,4 +165,40 @@ public class TunerPreferenceEditor extends HBox
|
|||||||
|
|
||||||
return mHelpTextHeterodyneLabel;
|
return mHelpTextHeterodyneLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ChoiceBox<RspDuoSelectionMode> getRspDuoTunerModeChoiceBox()
|
||||||
|
{
|
||||||
|
if(mRspDuoTunerModeChoiceBox == null)
|
||||||
|
{
|
||||||
|
mRspDuoTunerModeChoiceBox = new ChoiceBox<>();
|
||||||
|
mRspDuoTunerModeChoiceBox.getItems().addAll(RspDuoSelectionMode.values());
|
||||||
|
|
||||||
|
RspDuoSelectionMode current = mTunerPreference.getRspDuoTunerMode();
|
||||||
|
mRspDuoTunerModeChoiceBox.getSelectionModel().select(current);
|
||||||
|
|
||||||
|
mRspDuoTunerModeChoiceBox.setOnAction(event -> {
|
||||||
|
RspDuoSelectionMode selected = mRspDuoTunerModeChoiceBox.getSelectionModel().getSelectedItem();
|
||||||
|
mTunerPreference.setRspDuoTunerMode(selected);
|
||||||
|
|
||||||
|
Label label = new Label("Please restart the application for this change to take effect");
|
||||||
|
label.setWrapText(true);
|
||||||
|
Alert alert = new Alert(Alert.AlertType.WARNING);
|
||||||
|
alert.getDialogPane().setContent(label);
|
||||||
|
alert.initOwner(((Node)getRspDuoTunerModeChoiceBox()).getScene().getWindow());
|
||||||
|
alert.show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return mRspDuoTunerModeChoiceBox;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Label getRspDuoModeLabel()
|
||||||
|
{
|
||||||
|
if(mRspDuoModeLabel == null)
|
||||||
|
{
|
||||||
|
mRspDuoModeLabel = new Label("SDRPlay RSPduo Selection Mode");
|
||||||
|
}
|
||||||
|
|
||||||
|
return mRspDuoModeLabel;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import io.github.dsheirer.channel.state.TimeslotDecoderState;
|
|||||||
import io.github.dsheirer.controller.channel.Channel;
|
import io.github.dsheirer.controller.channel.Channel;
|
||||||
import io.github.dsheirer.controller.channel.Channel.ChannelType;
|
import io.github.dsheirer.controller.channel.Channel.ChannelType;
|
||||||
import io.github.dsheirer.controller.channel.ChannelConfigurationChangeNotification;
|
import io.github.dsheirer.controller.channel.ChannelConfigurationChangeNotification;
|
||||||
|
import io.github.dsheirer.identifier.Form;
|
||||||
import io.github.dsheirer.identifier.Identifier;
|
import io.github.dsheirer.identifier.Identifier;
|
||||||
import io.github.dsheirer.identifier.IdentifierClass;
|
import io.github.dsheirer.identifier.IdentifierClass;
|
||||||
import io.github.dsheirer.identifier.IdentifierCollection;
|
import io.github.dsheirer.identifier.IdentifierCollection;
|
||||||
@@ -74,6 +75,8 @@ import io.github.dsheirer.module.decode.dmr.message.voice.VoiceMessage;
|
|||||||
import io.github.dsheirer.module.decode.event.DecodeEvent;
|
import io.github.dsheirer.module.decode.event.DecodeEvent;
|
||||||
import io.github.dsheirer.module.decode.event.DecodeEventType;
|
import io.github.dsheirer.module.decode.event.DecodeEventType;
|
||||||
import io.github.dsheirer.module.decode.event.PlottableDecodeEvent;
|
import io.github.dsheirer.module.decode.event.PlottableDecodeEvent;
|
||||||
|
import io.github.dsheirer.module.decode.ip.hytera.sds.HyteraUnknownPacket;
|
||||||
|
import io.github.dsheirer.module.decode.ip.hytera.sms.HyteraSmsPacket;
|
||||||
import io.github.dsheirer.protocol.Protocol;
|
import io.github.dsheirer.protocol.Protocol;
|
||||||
import io.github.dsheirer.source.tuner.channel.rotation.AddChannelRotationActiveStateRequest;
|
import io.github.dsheirer.source.tuner.channel.rotation.AddChannelRotationActiveStateRequest;
|
||||||
import io.github.dsheirer.util.PacketUtil;
|
import io.github.dsheirer.util.PacketUtil;
|
||||||
@@ -299,6 +302,38 @@ public class DMRDecoderState extends TimeslotDecoderState
|
|||||||
{
|
{
|
||||||
broadcast(new DecoderStateEvent(this, Event.START, State.DATA, getTimeslot()));
|
broadcast(new DecoderStateEvent(this, Event.START, State.DATA, getTimeslot()));
|
||||||
|
|
||||||
|
//Hytera SDS Long SMS message
|
||||||
|
if(packet.getPacket() instanceof HyteraSmsPacket hyteraSmsPacket)
|
||||||
|
{
|
||||||
|
MutableIdentifierCollection mic = new MutableIdentifierCollection(packet.getIdentifiers());
|
||||||
|
mic.remove(Form.RADIO);
|
||||||
|
mic.remove(Form.TALKGROUP);
|
||||||
|
mic.update(hyteraSmsPacket.getSource());
|
||||||
|
mic.update(hyteraSmsPacket.getDestination());
|
||||||
|
|
||||||
|
DecodeEvent smsEvent = DMRDecodeEvent.builder(packet.getTimestamp())
|
||||||
|
.eventDescription(DecodeEventType.SMS.name())
|
||||||
|
.identifiers(mic)
|
||||||
|
.timeslot(packet.getTimeslot())
|
||||||
|
.details("SMS:" + hyteraSmsPacket.getSMS())
|
||||||
|
.build();
|
||||||
|
broadcast(smsEvent);
|
||||||
|
}
|
||||||
|
//Unknown Hytera Long Data Service Token Message
|
||||||
|
else if(packet.getPacket() instanceof HyteraUnknownPacket hyteraUnknownPacket)
|
||||||
|
{
|
||||||
|
MutableIdentifierCollection mic = new MutableIdentifierCollection(packet.getIdentifiers());
|
||||||
|
|
||||||
|
DecodeEvent unknownTokenEvent = DMRDecodeEvent.builder(packet.getTimestamp())
|
||||||
|
.eventDescription(DecodeEventType.UNKNOWN_PACKET.name())
|
||||||
|
.identifiers(mic)
|
||||||
|
.timeslot(packet.getTimeslot())
|
||||||
|
.details("HYTERA UNK TOKEN MSG:" + hyteraUnknownPacket.getHeader().toString())
|
||||||
|
.build();
|
||||||
|
broadcast(unknownTokenEvent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
DecodeEvent packetEvent = DMRDecodeEvent.builder(packet.getTimestamp())
|
DecodeEvent packetEvent = DMRDecodeEvent.builder(packet.getTimestamp())
|
||||||
.eventDescription(DecodeEventType.DATA_PACKET.name())
|
.eventDescription(DecodeEventType.DATA_PACKET.name())
|
||||||
.identifiers(getMergedIdentifierCollection(packet.getIdentifiers()))
|
.identifiers(getMergedIdentifierCollection(packet.getIdentifiers()))
|
||||||
@@ -322,6 +357,7 @@ public class DMRDecoderState extends TimeslotDecoderState
|
|||||||
broadcast(plottableDecodeEvent);
|
broadcast(plottableDecodeEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes voice messages
|
* Processes voice messages
|
||||||
@@ -628,7 +664,7 @@ public class DMRDecoderState extends TimeslotDecoderState
|
|||||||
break;
|
break;
|
||||||
case HYTERA_08_ANNOUNCEMENT:
|
case HYTERA_08_ANNOUNCEMENT:
|
||||||
case HYTERA_68_ANNOUNCEMENT:
|
case HYTERA_68_ANNOUNCEMENT:
|
||||||
case HYTERA_XPT_SITE_STATE:
|
case HYTERA_68_XPT_SITE_STATE:
|
||||||
|
|
||||||
case MOTOROLA_CAPPLUS_NEIGHBOR_REPORT:
|
case MOTOROLA_CAPPLUS_NEIGHBOR_REPORT:
|
||||||
if(csbk instanceof CapacityPlusNeighbors)
|
if(csbk instanceof CapacityPlusNeighbors)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -30,17 +30,14 @@ import io.github.dsheirer.module.decode.dmr.message.DMRBurst;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.DMRMessage;
|
import io.github.dsheirer.module.decode.dmr.message.DMRMessage;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.DMRMessageFactory;
|
import io.github.dsheirer.module.decode.dmr.message.DMRMessageFactory;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.packet.DMRPacketMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.packet.DMRPacketMessage;
|
||||||
import io.github.dsheirer.module.decode.ip.lrrp.LRRPPacket;
|
import io.github.dsheirer.module.decode.ip.mototrbo.lrrp.LRRPPacket;
|
||||||
import io.github.dsheirer.module.decode.ip.lrrp.token.Identity;
|
import io.github.dsheirer.module.decode.ip.mototrbo.lrrp.token.Identity;
|
||||||
import io.github.dsheirer.module.decode.ip.lrrp.token.Token;
|
import io.github.dsheirer.module.decode.ip.mototrbo.lrrp.token.Token;
|
||||||
import io.github.dsheirer.preference.UserPreferences;
|
import io.github.dsheirer.preference.UserPreferences;
|
||||||
import io.github.dsheirer.protocol.Protocol;
|
import io.github.dsheirer.protocol.Protocol;
|
||||||
import io.github.dsheirer.record.binary.BinaryReader;
|
import io.github.dsheirer.record.binary.BinaryReader;
|
||||||
import io.github.dsheirer.sample.Broadcaster;
|
import io.github.dsheirer.sample.Broadcaster;
|
||||||
import io.github.dsheirer.sample.Listener;
|
import io.github.dsheirer.sample.Listener;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.file.DirectoryStream;
|
import java.nio.file.DirectoryStream;
|
||||||
@@ -53,6 +50,8 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DMR Sync Detector and Message Framer. Includes capability to detect PLL out-of-phase lock errors
|
* DMR Sync Detector and Message Framer. Includes capability to detect PLL out-of-phase lock errors
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.module.decode.dmr.identifier;
|
||||||
|
|
||||||
|
import io.github.dsheirer.identifier.Role;
|
||||||
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.message.type.Tier3Gateway;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DMR Tier-III (ie trunked) radio identifier with custom overrides to correctly label Gateways & Identities
|
||||||
|
*/
|
||||||
|
public class DmrTier3Radio extends DMRRadio
|
||||||
|
{
|
||||||
|
public DmrTier3Radio(Integer value, Role role)
|
||||||
|
{
|
||||||
|
super(value, role);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isGateway()
|
||||||
|
{
|
||||||
|
return Tier3Gateway.isGateway(getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
if(isGateway())
|
||||||
|
{
|
||||||
|
return Tier3Gateway.fromValue(getValue()).getLabel();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return super.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a DMR TO radio identifier
|
||||||
|
*/
|
||||||
|
public static RadioIdentifier createTo(int radioId)
|
||||||
|
{
|
||||||
|
return new DmrTier3Radio(radioId, Role.TO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a DMR FROM radio identifier
|
||||||
|
*/
|
||||||
|
public static RadioIdentifier createFrom(int radioId)
|
||||||
|
{
|
||||||
|
return new DmrTier3Radio(radioId, Role.FROM);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a DMR ANY radio identifier
|
||||||
|
*/
|
||||||
|
public static RadioIdentifier createAny(int radioId)
|
||||||
|
{
|
||||||
|
return new DmrTier3Radio(radioId, Role.ANY);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -25,7 +25,6 @@ import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.DataMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.DataMessage;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -34,6 +33,8 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public abstract class DataBlock extends DataMessage
|
public abstract class DataBlock extends DataMessage
|
||||||
{
|
{
|
||||||
|
private static final int[] DATA_BLOCK_SERIAL_NUMBER = new int[]{0, 1, 2, 3, 4, 5, 6};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an instance.
|
* Constructs an instance.
|
||||||
*
|
*
|
||||||
@@ -63,7 +64,11 @@ public abstract class DataBlock extends DataMessage
|
|||||||
/**
|
/**
|
||||||
* Serial number for a confirmed data block
|
* Serial number for a confirmed data block
|
||||||
*/
|
*/
|
||||||
public abstract int getDataBlockSerialNumber();
|
public int getDataBlockSerialNumber()
|
||||||
|
{
|
||||||
|
return getMessage().getInt(DATA_BLOCK_SERIAL_NUMBER);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -29,7 +29,6 @@ import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
|||||||
*/
|
*/
|
||||||
public class DataBlock1Rate extends DataBlock
|
public class DataBlock1Rate extends DataBlock
|
||||||
{
|
{
|
||||||
private static final int[] DATA_BLOCK_SERIAL_NUMBER = new int[]{0, 1, 2, 3, 4, 5, 6};
|
|
||||||
private static final int[] CRC = new int[]{7, 8, 9, 10, 11, 12, 13, 14, 15};
|
private static final int[] CRC = new int[]{7, 8, 9, 10, 11, 12, 13, 14, 15};
|
||||||
private static final int CONFIRMED_PAYLOAD_START = 16;
|
private static final int CONFIRMED_PAYLOAD_START = 16;
|
||||||
private static final int UNCONFIRMED_PAYLOAD_START = 0;
|
private static final int UNCONFIRMED_PAYLOAD_START = 0;
|
||||||
@@ -56,17 +55,16 @@ public class DataBlock1Rate extends DataBlock
|
|||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
|
if(!isValid())
|
||||||
|
{
|
||||||
|
sb.append(" [CRC ERROR]");
|
||||||
|
}
|
||||||
sb.append(" RATE 1/1 DATA CONFIRMED:").append(getConfirmedPayload().toHexString());
|
sb.append(" RATE 1/1 DATA CONFIRMED:").append(getConfirmedPayload().toHexString());
|
||||||
sb.append(" UNCONFIRMED:").append(getUnConfirmedPayload().toHexString());
|
sb.append(" UNCONFIRMED:").append(getUnConfirmedPayload().toHexString());
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getDataBlockSerialNumber()
|
|
||||||
{
|
|
||||||
return getMessage().getInt(DATA_BLOCK_SERIAL_NUMBER);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CorrectedBinaryMessage getConfirmedPayload()
|
public CorrectedBinaryMessage getConfirmedPayload()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -29,7 +29,6 @@ import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
|||||||
*/
|
*/
|
||||||
public class DataBlock1_2Rate extends DataBlock
|
public class DataBlock1_2Rate extends DataBlock
|
||||||
{
|
{
|
||||||
private static final int[] DATA_BLOCK_SERIAL_NUMBER = new int[]{0, 1, 2, 3, 4, 5, 6};
|
|
||||||
private static final int[] CRC = new int[]{7, 8, 9, 10, 11, 12, 13, 14, 15};
|
private static final int[] CRC = new int[]{7, 8, 9, 10, 11, 12, 13, 14, 15};
|
||||||
private static final int CONFIRMED_PAYLOAD_START = 16;
|
private static final int CONFIRMED_PAYLOAD_START = 16;
|
||||||
private static final int UNCONFIRMED_PAYLOAD_START = 0;
|
private static final int UNCONFIRMED_PAYLOAD_START = 0;
|
||||||
@@ -56,17 +55,16 @@ public class DataBlock1_2Rate extends DataBlock
|
|||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
|
if(!isValid())
|
||||||
|
{
|
||||||
|
sb.append(" [CRC ERROR]");
|
||||||
|
}
|
||||||
sb.append(" RATE 1/2 DATA CONFIRMED:").append(getConfirmedPayload().toHexString());
|
sb.append(" RATE 1/2 DATA CONFIRMED:").append(getConfirmedPayload().toHexString());
|
||||||
sb.append(" UNCONFIRMED:").append(getUnConfirmedPayload().toHexString());
|
sb.append(" UNCONFIRMED:").append(getUnConfirmedPayload().toHexString());
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getDataBlockSerialNumber()
|
|
||||||
{
|
|
||||||
return getMessage().getInt(DATA_BLOCK_SERIAL_NUMBER);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CorrectedBinaryMessage getConfirmedPayload()
|
public CorrectedBinaryMessage getConfirmedPayload()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -29,7 +29,6 @@ import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
|||||||
*/
|
*/
|
||||||
public class DataBlock3_4Rate extends DataBlock
|
public class DataBlock3_4Rate extends DataBlock
|
||||||
{
|
{
|
||||||
private static final int[] DATA_BLOCK_SERIAL_NUMBER = new int[]{0, 1, 2, 3, 4, 5, 6};
|
|
||||||
private static final int[] CRC = new int[]{7, 8, 9, 10, 11, 12, 13, 14, 15};
|
private static final int[] CRC = new int[]{7, 8, 9, 10, 11, 12, 13, 14, 15};
|
||||||
private static final int CONFIRMED_PAYLOAD_START = 16;
|
private static final int CONFIRMED_PAYLOAD_START = 16;
|
||||||
private static final int UNCONFIRMED_PAYLOAD_START = 0;
|
private static final int UNCONFIRMED_PAYLOAD_START = 0;
|
||||||
@@ -57,17 +56,16 @@ public class DataBlock3_4Rate extends DataBlock
|
|||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
|
if(!isValid())
|
||||||
|
{
|
||||||
|
sb.append(" [CRC ERROR]");
|
||||||
|
}
|
||||||
sb.append(" RATE 3/4 DATA CONFIRMED:").append(getConfirmedPayload().toHexString());
|
sb.append(" RATE 3/4 DATA CONFIRMED:").append(getConfirmedPayload().toHexString());
|
||||||
sb.append(" UNCONFIRMED:").append(getUnConfirmedPayload().toHexString());
|
sb.append(" UNCONFIRMED:").append(getUnConfirmedPayload().toHexString());
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getDataBlockSerialNumber()
|
|
||||||
{
|
|
||||||
return getMessage().getInt(DATA_BLOCK_SERIAL_NUMBER);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CorrectedBinaryMessage getConfirmedPayload()
|
public CorrectedBinaryMessage getConfirmedPayload()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,13 +23,14 @@ import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
|||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.Hytera08Acknowledge;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.Hytera68Acknowledge;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraAdjacentSiteInformation;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraAdjacentSiteInformation;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraAloha;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraAloha;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraAnnouncement;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraAnnouncement;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraCsbko32;
|
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraCsbko44;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraCsbko44;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraCsbko47;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraCsbko47;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraSmsWaitingNotification;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraSmsAvailableNotification;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraXPTPreamble;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraXPTPreamble;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraXPTSiteState;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraXPTSiteState;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityMaxAloha;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityMaxAloha;
|
||||||
@@ -221,7 +222,7 @@ public class CSBKMessageFactory
|
|||||||
csbk = new Preamble(pattern, message, cach, slotType, timestamp, timeslot);
|
csbk = new Preamble(pattern, message, cach, slotType, timestamp, timeslot);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HYTERA_ALOHA:
|
case HYTERA_68_ALOHA:
|
||||||
csbk = new HyteraAloha(pattern, message, cach, slotType, timestamp, timeslot);
|
csbk = new HyteraAloha(pattern, message, cach, slotType, timestamp, timeslot);
|
||||||
break;
|
break;
|
||||||
case HYTERA_08_ANNOUNCEMENT:
|
case HYTERA_08_ANNOUNCEMENT:
|
||||||
@@ -237,23 +238,26 @@ public class CSBKMessageFactory
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case HYTERA_XPT_PREAMBLE:
|
case HYTERA_68_XPT_PREAMBLE:
|
||||||
csbk = new HyteraXPTPreamble(pattern, message, cach, slotType, timestamp, timeslot);
|
csbk = new HyteraXPTPreamble(pattern, message, cach, slotType, timestamp, timeslot);
|
||||||
break;
|
break;
|
||||||
case HYTERA_XPT_SITE_STATE:
|
case HYTERA_68_XPT_SITE_STATE:
|
||||||
csbk = new HyteraXPTSiteState(pattern, message, cach, slotType, timestamp, timeslot);
|
csbk = new HyteraXPTSiteState(pattern, message, cach, slotType, timestamp, timeslot);
|
||||||
break;
|
break;
|
||||||
case HYTERA_CSBKO_32:
|
case HYTERA_08_ACKNOWLEDGE:
|
||||||
csbk = new HyteraCsbko32(pattern, message, cach, slotType, timestamp, timeslot);
|
csbk = new Hytera08Acknowledge(pattern, message, cach, slotType, timestamp, timeslot);
|
||||||
break;
|
break;
|
||||||
case HYTERA_CSBKO_44:
|
case HYTERA_08_CSBKO_44:
|
||||||
csbk = new HyteraCsbko44(pattern, message, cach, slotType, timestamp, timeslot);
|
csbk = new HyteraCsbko44(pattern, message, cach, slotType, timestamp, timeslot);
|
||||||
break;
|
break;
|
||||||
case HYTERA_CSBKO_47:
|
case HYTERA_08_CSBKO_47:
|
||||||
csbk = new HyteraCsbko47(pattern, message, cach, slotType, timestamp, timeslot);
|
csbk = new HyteraCsbko47(pattern, message, cach, slotType, timestamp, timeslot);
|
||||||
break;
|
break;
|
||||||
case HYTERA_CSBKO_62:
|
case HYTERA_68_ACKNOWLEDGE:
|
||||||
csbk = new HyteraSmsWaitingNotification(pattern, message, cach, slotType, timestamp, timeslot);
|
csbk = new Hytera68Acknowledge(pattern, message, cach, slotType, timestamp, timeslot);
|
||||||
|
break;
|
||||||
|
case HYTERA_68_CSBKO_62:
|
||||||
|
csbk = new HyteraSmsAvailableNotification(pattern, message, cach, slotType, timestamp, timeslot);
|
||||||
break;
|
break;
|
||||||
case MOTOROLA_CAPMAX_ALOHA:
|
case MOTOROLA_CAPMAX_ALOHA:
|
||||||
csbk = new CapacityMaxAloha(pattern, message, cach, slotType, timestamp, timeslot);
|
csbk = new CapacityMaxAloha(pattern, message, cach, slotType, timestamp, timeslot);
|
||||||
|
|||||||
@@ -89,16 +89,18 @@ public enum Opcode
|
|||||||
MOTOROLA_CAPPLUS_PREAMBLE(Vendor.MOTOROLA_CAPACITY_PLUS, 61, "PREAMBLE"),
|
MOTOROLA_CAPPLUS_PREAMBLE(Vendor.MOTOROLA_CAPACITY_PLUS, 61, "PREAMBLE"),
|
||||||
MOTOROLA_CAPPLUS_SYSTEM_STATUS(Vendor.MOTOROLA_CAPACITY_PLUS, 62, "SYSTEM STATUS"),
|
MOTOROLA_CAPPLUS_SYSTEM_STATUS(Vendor.MOTOROLA_CAPACITY_PLUS, 62, "SYSTEM STATUS"),
|
||||||
|
|
||||||
HYTERA_CSBKO_32(Vendor.HYTERA_8, 32, "T-III HYTERA 08 CSBKO 32"),
|
HYTERA_08_ACKNOWLEDGE(Vendor.HYTERA_8, 32, "HYTERA 08 ACKNOWLEDGE"),
|
||||||
HYTERA_08_ANNOUNCEMENT(Vendor.HYTERA_8, 40, "T-III 08 ANNOUNCEMENT"),
|
HYTERA_08_ANNOUNCEMENT(Vendor.HYTERA_8, 40, "HYTERA 08 ANNOUNCEMENT"),
|
||||||
HYTERA_CSBKO_44(Vendor.HYTERA_8, 44, "T-III HYTERA 08 CSBKO 44"),
|
HYTERA_08_CSBKO_44(Vendor.HYTERA_8, 44, "HYTERA 08 CSBKO 44"),
|
||||||
HYTERA_CSBKO_47(Vendor.HYTERA_8, 47, "T-III HYTERA 08 CSBKO 47"),
|
HYTERA_08_CSBKO_47(Vendor.HYTERA_8, 47, "HYTERA 08 CSBKO 47"),
|
||||||
|
|
||||||
HYTERA_XPT_SITE_STATE(Vendor.HYTERA_68, 10, "HYTERA XPT SITE STATE"),
|
HYTERA_68_XPT_SITE_STATE(Vendor.HYTERA_68, 10, "HYTERA 68 XPT SITE STATE"),
|
||||||
HYTERA_ALOHA(Vendor.HYTERA_68, 25, "HYTERA ALOHA"),
|
HYTERA_68_ALOHA(Vendor.HYTERA_68, 25, "HYTERA 68 ALOHA"),
|
||||||
HYTERA_68_ANNOUNCEMENT(Vendor.HYTERA_68, 40, "T-III 68 ANNOUNCEMENT"),
|
HYTERA_68_ACKNOWLEDGE(Vendor.HYTERA_68, 32, "HYTERA 68 ACKNOWLEDGE"),
|
||||||
HYTERA_XPT_PREAMBLE(Vendor.HYTERA_68, 61, "HYTERA XPT PREAMBLE"), //Opcode 54 and/or 55 - See patent on Hytera call forwarding
|
HYTERA_68_ANNOUNCEMENT(Vendor.HYTERA_68, 40, "HYTERA 68 ANNOUNCEMENT"),
|
||||||
HYTERA_CSBKO_62(Vendor.HYTERA_68, 62, "HYTERA CSBKO 62"),
|
//Opcode 54 and/or 55 - See patent on Hytera call forwarding
|
||||||
|
HYTERA_68_XPT_PREAMBLE(Vendor.HYTERA_68, 61, "HYTERA 68 XPT PREAMBLE"),
|
||||||
|
HYTERA_68_CSBKO_62(Vendor.HYTERA_68, 62, "HYTERA 68 CSBKO 62"),
|
||||||
|
|
||||||
|
|
||||||
UNKNOWN(Vendor.UNKNOWN, -1, "UNKNOWN");
|
UNKNOWN(Vendor.UNKNOWN, -1, "UNKNOWN");
|
||||||
|
|||||||
@@ -0,0 +1,196 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera;
|
||||||
|
|
||||||
|
import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
||||||
|
import io.github.dsheirer.identifier.Identifier;
|
||||||
|
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
|
||||||
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.message.type.AcknowledgeType;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.message.type.Reason;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hytera DMR Tier III - CSBKO 32 - Possibly Acknowledge Response
|
||||||
|
*
|
||||||
|
* Analysis: ... this was transmitted on the traffic channel while the mobile was at the end of a call, in the terminator
|
||||||
|
* sequence. Since this comes from the SMS gateway 16776906, I wonder if this is a traffic channel message waiting notification?
|
||||||
|
*/
|
||||||
|
public class Hytera08Acknowledge extends CSBKMessage
|
||||||
|
{
|
||||||
|
private static final int TARGET_GROUP_INDIVIDUAL_FLAG = 16;
|
||||||
|
protected static final int[] RESPONSE_INFO = new int[]{16, 17, 18, 19, 20, 21, 22};
|
||||||
|
private static final int[] ACKNOWLEDGE_TYPE = new int[]{23, 24};
|
||||||
|
//Note: acknowledge type is the first 2 bits of the reason code - intentional overlap
|
||||||
|
private static final int[] REASON_CODE = new int[]{23, 24, 25, 26, 27, 28, 29, 30};
|
||||||
|
private static final int RESERVED = 31;
|
||||||
|
private static final int[] TARGET_ADDRESS = new int[]{32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
|
||||||
|
47, 48, 49, 50, 51, 52, 53, 54, 55};
|
||||||
|
private static final int[] ADDITIONAL_INFO_SOURCE_ADDRESS = new int[]{56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
|
||||||
|
67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79};
|
||||||
|
|
||||||
|
protected List<Identifier> mIdentifiers;
|
||||||
|
private IntegerIdentifier mTargetAddress;
|
||||||
|
private RadioIdentifier mSourceRadio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an instance
|
||||||
|
*
|
||||||
|
* @param syncPattern for the CSBK
|
||||||
|
* @param message bits
|
||||||
|
* @param cach for the DMR burst
|
||||||
|
* @param slotType for this message
|
||||||
|
* @param timestamp
|
||||||
|
* @param timeslot
|
||||||
|
*/
|
||||||
|
public Hytera08Acknowledge(DMRSyncPattern syncPattern, CorrectedBinaryMessage message, CACH cach, SlotType slotType, long timestamp, int timeslot)
|
||||||
|
{
|
||||||
|
super(syncPattern, message, cach, slotType, timestamp, timeslot);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
if(!isValid())
|
||||||
|
{
|
||||||
|
sb.append("[CRC-ERROR] ");
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
|
sb.append(" HYTERA 08 ").append(getAcknowledgeType());
|
||||||
|
sb.append(" REASON:");
|
||||||
|
|
||||||
|
if(getReason() == Reason.UNKNOWN)
|
||||||
|
{
|
||||||
|
sb.append("UNKNOWN REASON CODE:").append(getMessage().getInt(REASON_CODE));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sb.append(getReason());
|
||||||
|
}
|
||||||
|
sb.append(" FM:").append(getSourceRadio());
|
||||||
|
sb.append(" TO:").append(getTargetAddress());
|
||||||
|
sb.append(" MSG:").append(getMessage().toHexString());
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if the target address is a talkgroup (true) or radio/gateway (false).
|
||||||
|
*/
|
||||||
|
public boolean isTargetAddressTalkgroup()
|
||||||
|
{
|
||||||
|
return getMessage().get(TARGET_GROUP_INDIVIDUAL_FLAG);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Acknowledgement message type
|
||||||
|
*/
|
||||||
|
public AcknowledgeType getAcknowledgeType()
|
||||||
|
{
|
||||||
|
return AcknowledgeType.fromValue(getMessage().getInt(ACKNOWLEDGE_TYPE));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reason code.
|
||||||
|
*
|
||||||
|
* Note: the reason entries are coupled with the acknowledgement type and can optionally indicate when the
|
||||||
|
* additional information field contains amplifying information.
|
||||||
|
*/
|
||||||
|
public Reason getReason()
|
||||||
|
{
|
||||||
|
return getReason(getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Utility method to determine the reason code for the specified message
|
||||||
|
* @param message containing a reason code field
|
||||||
|
* @return reason
|
||||||
|
*/
|
||||||
|
public static Reason getReason(CorrectedBinaryMessage message)
|
||||||
|
{
|
||||||
|
return Reason.fromValue(message.getInt(REASON_CODE));
|
||||||
|
}
|
||||||
|
|
||||||
|
public IntegerIdentifier getTargetAddress()
|
||||||
|
{
|
||||||
|
if(mTargetAddress == null)
|
||||||
|
{
|
||||||
|
if(isTargetAddressTalkgroup())
|
||||||
|
{
|
||||||
|
mTargetAddress = DMRTalkgroup.create(getMessage().getInt(TARGET_ADDRESS));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mTargetAddress = DmrTier3Radio.createTo(getMessage().getInt(TARGET_ADDRESS));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return mTargetAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasSourceRadio()
|
||||||
|
{
|
||||||
|
return true; //TODO: delineate valid reason codes here
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Source radio identifier
|
||||||
|
*
|
||||||
|
* Note: the source radio field is dual-purpose and contains either a source radio address or
|
||||||
|
* additional information, depending on the reason code and/or acknowledgement type. Use the
|
||||||
|
* hasSourceRadio() method to first check if this message carries a source radio identifier.
|
||||||
|
*/
|
||||||
|
public RadioIdentifier getSourceRadio()
|
||||||
|
{
|
||||||
|
if(mSourceRadio == null)
|
||||||
|
{
|
||||||
|
mSourceRadio = DmrTier3Radio.createFrom(getMessage().getInt(ADDITIONAL_INFO_SOURCE_ADDRESS));
|
||||||
|
}
|
||||||
|
|
||||||
|
return mSourceRadio;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Identifier> getIdentifiers()
|
||||||
|
{
|
||||||
|
if(mIdentifiers == null)
|
||||||
|
{
|
||||||
|
mIdentifiers = new ArrayList<>();
|
||||||
|
mIdentifiers.add(getTargetAddress());
|
||||||
|
|
||||||
|
if(hasSourceRadio())
|
||||||
|
{
|
||||||
|
mIdentifiers.add(getSourceRadio());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return mIdentifiers;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
/*
|
||||||
|
* *****************************************************************************
|
||||||
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
* ****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera;
|
||||||
|
|
||||||
|
import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
||||||
|
import io.github.dsheirer.identifier.Identifier;
|
||||||
|
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
|
||||||
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.message.type.AcknowledgeType;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.message.type.Reason;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hytera FID68 - CSBKO 32 - Probable Acknowledge
|
||||||
|
*
|
||||||
|
* Analysis: ... this was transmitted on the Tier III control channel
|
||||||
|
*/
|
||||||
|
public class Hytera68Acknowledge extends CSBKMessage
|
||||||
|
{
|
||||||
|
private static final int TARGET_GROUP_INDIVIDUAL_FLAG = 16;
|
||||||
|
protected static final int[] RESPONSE_INFO = new int[]{16, 17, 18, 19, 20, 21, 22};
|
||||||
|
private static final int[] ACKNOWLEDGE_TYPE = new int[]{23, 24};
|
||||||
|
//Note: acknowledge type is the first 2 bits of the reason code - intentional overlap
|
||||||
|
private static final int[] REASON_CODE = new int[]{23, 24, 25, 26, 27, 28, 29, 30};
|
||||||
|
private static final int RESERVED = 31;
|
||||||
|
private static final int[] TARGET_ADDRESS = new int[]{32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
|
||||||
|
47, 48, 49, 50, 51, 52, 53, 54, 55};
|
||||||
|
private static final int[] ADDITIONAL_INFO_SOURCE_ADDRESS = new int[]{56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
|
||||||
|
67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79};
|
||||||
|
|
||||||
|
protected List<Identifier> mIdentifiers;
|
||||||
|
private IntegerIdentifier mTargetAddress;
|
||||||
|
private RadioIdentifier mSourceRadio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an instance
|
||||||
|
*
|
||||||
|
* @param syncPattern for the CSBK
|
||||||
|
* @param message bits
|
||||||
|
* @param cach for the DMR burst
|
||||||
|
* @param slotType for this message
|
||||||
|
* @param timestamp
|
||||||
|
* @param timeslot
|
||||||
|
*/
|
||||||
|
public Hytera68Acknowledge(DMRSyncPattern syncPattern, CorrectedBinaryMessage message, CACH cach, SlotType slotType, long timestamp, int timeslot)
|
||||||
|
{
|
||||||
|
super(syncPattern, message, cach, slotType, timestamp, timeslot);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
if(!isValid())
|
||||||
|
{
|
||||||
|
sb.append("[CRC-ERROR] ");
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
|
sb.append(" HYTERA 68 ").append(getAcknowledgeType());
|
||||||
|
sb.append(" REASON:");
|
||||||
|
|
||||||
|
if(getReason() == Reason.UNKNOWN)
|
||||||
|
{
|
||||||
|
sb.append("UNKNOWN REASON CODE:").append(getMessage().getInt(REASON_CODE));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sb.append(getReason());
|
||||||
|
}
|
||||||
|
sb.append(" FM:").append(getSourceRadio());
|
||||||
|
sb.append(" TO:").append(getTargetAddress());
|
||||||
|
sb.append(" MSG:").append(getMessage().toHexString());
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if the target address is a talkgroup (true) or radio/gateway (false).
|
||||||
|
*/
|
||||||
|
public boolean isTargetAddressTalkgroup()
|
||||||
|
{
|
||||||
|
return getMessage().get(TARGET_GROUP_INDIVIDUAL_FLAG);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Acknowledgement message type
|
||||||
|
*/
|
||||||
|
public AcknowledgeType getAcknowledgeType()
|
||||||
|
{
|
||||||
|
return AcknowledgeType.fromValue(getMessage().getInt(ACKNOWLEDGE_TYPE));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reason code.
|
||||||
|
*
|
||||||
|
* Note: the reason entries are coupled with the acknowledgement type and can optionally indicate when the
|
||||||
|
* additional information field contains amplifying information.
|
||||||
|
*/
|
||||||
|
public Reason getReason()
|
||||||
|
{
|
||||||
|
return getReason(getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Utility method to determine the reason code for the specified message
|
||||||
|
* @param message containing a reason code field
|
||||||
|
* @return reason
|
||||||
|
*/
|
||||||
|
public static Reason getReason(CorrectedBinaryMessage message)
|
||||||
|
{
|
||||||
|
return Reason.fromValue(message.getInt(REASON_CODE));
|
||||||
|
}
|
||||||
|
|
||||||
|
public IntegerIdentifier getTargetAddress()
|
||||||
|
{
|
||||||
|
if(mTargetAddress == null)
|
||||||
|
{
|
||||||
|
if(isTargetAddressTalkgroup())
|
||||||
|
{
|
||||||
|
mTargetAddress = DMRTalkgroup.create(getMessage().getInt(TARGET_ADDRESS));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mTargetAddress = DmrTier3Radio.createTo(getMessage().getInt(TARGET_ADDRESS));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return mTargetAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasSourceRadio()
|
||||||
|
{
|
||||||
|
return true; //TODO: delineate valid reason codes here
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Source radio identifier
|
||||||
|
*
|
||||||
|
* Note: the source radio field is dual-purpose and contains either a source radio address or
|
||||||
|
* additional information, depending on the reason code and/or acknowledgement type. Use the
|
||||||
|
* hasSourceRadio() method to first check if this message carries a source radio identifier.
|
||||||
|
*/
|
||||||
|
public RadioIdentifier getSourceRadio()
|
||||||
|
{
|
||||||
|
if(mSourceRadio == null)
|
||||||
|
{
|
||||||
|
mSourceRadio = DmrTier3Radio.createFrom(getMessage().getInt(ADDITIONAL_INFO_SOURCE_ADDRESS));
|
||||||
|
}
|
||||||
|
|
||||||
|
return mSourceRadio;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Identifier> getIdentifiers()
|
||||||
|
{
|
||||||
|
if(mIdentifiers == null)
|
||||||
|
{
|
||||||
|
mIdentifiers = new ArrayList<>();
|
||||||
|
mIdentifiers.add(getTargetAddress());
|
||||||
|
|
||||||
|
if(hasSourceRadio())
|
||||||
|
{
|
||||||
|
mIdentifiers.add(getSourceRadio());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return mIdentifiers;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,7 +23,7 @@ import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
|||||||
import io.github.dsheirer.identifier.Identifier;
|
import io.github.dsheirer.identifier.Identifier;
|
||||||
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
@@ -155,7 +155,7 @@ public class HyteraAloha extends CSBKMessage
|
|||||||
{
|
{
|
||||||
if(mRadioIdentifier == null)
|
if(mRadioIdentifier == null)
|
||||||
{
|
{
|
||||||
mRadioIdentifier = DMRRadio.createTo(getMessage().getInt(RADIO));
|
mRadioIdentifier = DmrTier3Radio.createTo(getMessage().getInt(RADIO));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mRadioIdentifier;
|
return mRadioIdentifier;
|
||||||
|
|||||||
@@ -1,137 +0,0 @@
|
|||||||
/*
|
|
||||||
* *****************************************************************************
|
|
||||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
* ****************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
package io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera;
|
|
||||||
|
|
||||||
import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
|
||||||
import io.github.dsheirer.identifier.Identifier;
|
|
||||||
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hytera DMR Tier III - CSBKO 32 - Possibly Acknowledge Response
|
|
||||||
*
|
|
||||||
* Analysis: ... this was transmitted on the traffic channel while the mobile was at the end of a call, in the terminator
|
|
||||||
* sequence. Since this comes from the SMS gateway 16776906, I wonder if this is a traffic channel message waiting notification?
|
|
||||||
*/
|
|
||||||
public class HyteraCsbko32 extends CSBKMessage
|
|
||||||
{
|
|
||||||
private static final int[] UNKNOWN_1 = new int[]{16, 17, 18, 19, 20, 21, 22, 23};
|
|
||||||
private static final int[] UNKNOWN_2 = new int[]{24, 25, 26, 27, 28, 29, 30, 31};
|
|
||||||
private static final int[] DESTINATION_RADIO = new int[]{32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
|
|
||||||
49, 50, 51, 52, 53, 54, 55};
|
|
||||||
private static final int[] SOURCE_RADIO = new int[]{56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
|
|
||||||
73, 74, 75, 76, 77, 78, 79};
|
|
||||||
|
|
||||||
private List<Identifier> mIdentifiers;
|
|
||||||
private RadioIdentifier mDestinationRadio;
|
|
||||||
private RadioIdentifier mSourceRadio;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs an instance
|
|
||||||
*
|
|
||||||
* @param syncPattern for the CSBK
|
|
||||||
* @param message bits
|
|
||||||
* @param cach for the DMR burst
|
|
||||||
* @param slotType for this message
|
|
||||||
* @param timestamp
|
|
||||||
* @param timeslot
|
|
||||||
*/
|
|
||||||
public HyteraCsbko32(DMRSyncPattern syncPattern, CorrectedBinaryMessage message, CACH cach, SlotType slotType, long timestamp, int timeslot)
|
|
||||||
{
|
|
||||||
super(syncPattern, message, cach, slotType, timestamp, timeslot);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
|
|
||||||
if(!isValid())
|
|
||||||
{
|
|
||||||
sb.append("[CRC-ERROR] ");
|
|
||||||
}
|
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
|
||||||
sb.append(" HYTERA CSBKO=32 PROBABLE ACKNOWLEDGE RESPONSE");
|
|
||||||
sb.append(" FM:").append(getSourceRadio());
|
|
||||||
sb.append(" TO:").append(getDestinationRadio());
|
|
||||||
sb.append(" UNK1:").append(getUnknown1());
|
|
||||||
sb.append(" UNK2:").append(getUnknown2());
|
|
||||||
sb.append(" MSG:").append(getMessage().toHexString());
|
|
||||||
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Addressed (ie TO) radio identifier
|
|
||||||
* @return radio identifier
|
|
||||||
*/
|
|
||||||
public RadioIdentifier getDestinationRadio()
|
|
||||||
{
|
|
||||||
if(mDestinationRadio == null)
|
|
||||||
{
|
|
||||||
mDestinationRadio = DMRRadio.createTo(getMessage().getInt(DESTINATION_RADIO));
|
|
||||||
}
|
|
||||||
|
|
||||||
return mDestinationRadio;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUnknown1()
|
|
||||||
{
|
|
||||||
return getMessage().getHex(UNKNOWN_1, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUnknown2()
|
|
||||||
{
|
|
||||||
return getMessage().getHex(UNKNOWN_2, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Source radio. Should be 16,777,906 the Hytera SMS gateway.
|
|
||||||
*/
|
|
||||||
public RadioIdentifier getSourceRadio()
|
|
||||||
{
|
|
||||||
if(mSourceRadio == null)
|
|
||||||
{
|
|
||||||
mSourceRadio = DMRRadio.createFrom(getMessage().getInt(SOURCE_RADIO));
|
|
||||||
}
|
|
||||||
|
|
||||||
return mSourceRadio;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Identifier> getIdentifiers()
|
|
||||||
{
|
|
||||||
if(mIdentifiers == null)
|
|
||||||
{
|
|
||||||
mIdentifiers = new ArrayList<>();
|
|
||||||
mIdentifiers.add(getDestinationRadio());
|
|
||||||
mIdentifiers.add(getSourceRadio());
|
|
||||||
}
|
|
||||||
|
|
||||||
return mIdentifiers;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -23,7 +23,7 @@ import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
|||||||
import io.github.dsheirer.identifier.Identifier;
|
import io.github.dsheirer.identifier.Identifier;
|
||||||
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
@@ -94,7 +94,7 @@ public class HyteraCsbko47 extends CSBKMessage
|
|||||||
{
|
{
|
||||||
if(mDestinationRadio == null)
|
if(mDestinationRadio == null)
|
||||||
{
|
{
|
||||||
mDestinationRadio = DMRRadio.createTo(getMessage().getInt(DESTINATION_RADIO));
|
mDestinationRadio = DmrTier3Radio.createTo(getMessage().getInt(DESTINATION_RADIO));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mDestinationRadio;
|
return mDestinationRadio;
|
||||||
@@ -117,7 +117,7 @@ public class HyteraCsbko47 extends CSBKMessage
|
|||||||
{
|
{
|
||||||
if(mSourceRadio == null)
|
if(mSourceRadio == null)
|
||||||
{
|
{
|
||||||
mSourceRadio = DMRRadio.createFrom(getMessage().getInt(SOURCE_RADIO));
|
mSourceRadio = DmrTier3Radio.createFrom(getMessage().getInt(SOURCE_RADIO));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mSourceRadio;
|
return mSourceRadio;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
|||||||
import io.github.dsheirer.identifier.Identifier;
|
import io.github.dsheirer.identifier.Identifier;
|
||||||
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
@@ -33,18 +33,16 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* Hytera DMR Tier III - CSBKO 62 -
|
* Hytera DMR Tier III - CSBKO 62 -
|
||||||
*
|
*
|
||||||
* Analysis: this message gets sent on timeslot 2 (not the Tier III control timeslot 1) from the SMS gateway (16776906)
|
* Analysis: this message was observed sent on timeslot 2 (not the Tier III control timeslot 1) from the SMS gateway (16776906)
|
||||||
* and gets sent to each of the radios involved in the SMS transfer (sender/receiver). I suspect that the network tells
|
* and gets sent to each of the radios involved in the SMS transfer (sender/receiver).
|
||||||
* each of the radios to join the control channel and prepare for the SMS message.
|
|
||||||
*/
|
*/
|
||||||
public class HyteraSmsWaitingNotification extends CSBKMessage
|
public class HyteraSmsAvailableNotification extends CSBKMessage
|
||||||
{
|
{
|
||||||
private static final int[] UNKNOWN_1 = new int[]{16, 17, 18, 19, 20, 21, 22, 23};
|
private static final int[] UNKNOWN = new int[]{16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
|
||||||
private static final int[] UNKNOWN_2 = new int[]{24, 25, 26, 27, 28, 29, 30, 31};
|
private static final int[] DESTINATION_RADIO = new int[]{32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
|
||||||
private static final int[] DESTINATION_RADIO = new int[]{32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
|
47, 48, 49, 50, 51, 52, 53, 54, 55};
|
||||||
49, 50, 51, 52, 53, 54, 55};
|
private static final int[] SOURCE_RADIO = new int[]{56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
|
||||||
private static final int[] SOURCE_RADIO = new int[]{56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
|
72, 73, 74, 75, 76, 77, 78, 79};
|
||||||
73, 74, 75, 76, 77, 78, 79};
|
|
||||||
|
|
||||||
private List<Identifier> mIdentifiers;
|
private List<Identifier> mIdentifiers;
|
||||||
private RadioIdentifier mDestinationRadio;
|
private RadioIdentifier mDestinationRadio;
|
||||||
@@ -57,10 +55,11 @@ public class HyteraSmsWaitingNotification extends CSBKMessage
|
|||||||
* @param message bits
|
* @param message bits
|
||||||
* @param cach for the DMR burst
|
* @param cach for the DMR burst
|
||||||
* @param slotType for this message
|
* @param slotType for this message
|
||||||
* @param timestamp
|
* @param timestamp of the message
|
||||||
* @param timeslot
|
* @param timeslot of the message
|
||||||
*/
|
*/
|
||||||
public HyteraSmsWaitingNotification(DMRSyncPattern syncPattern, CorrectedBinaryMessage message, CACH cach, SlotType slotType, long timestamp, int timeslot)
|
public HyteraSmsAvailableNotification(DMRSyncPattern syncPattern, CorrectedBinaryMessage message, CACH cach,
|
||||||
|
SlotType slotType, long timestamp, int timeslot)
|
||||||
{
|
{
|
||||||
super(syncPattern, message, cach, slotType, timestamp, timeslot);
|
super(syncPattern, message, cach, slotType, timestamp, timeslot);
|
||||||
}
|
}
|
||||||
@@ -76,11 +75,9 @@ public class HyteraSmsWaitingNotification extends CSBKMessage
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" HYTERA PREPARE FOR SMS MESSAGE FOR:").append(getDestinationRadio());
|
sb.append(" HYTERA SMS MESSAGE AVAILABLE FOR:").append(getDestinationRadio());
|
||||||
sb.append(" FM:").append(getSourceRadio());
|
sb.append(" FM:").append(getSourceRadio());
|
||||||
sb.append(" UNK1:").append(getUnknown1());
|
sb.append(" UNK:").append(getUnknown());
|
||||||
sb.append(" UNK2:").append(getUnknown2());
|
|
||||||
|
|
||||||
sb.append(" MSG:").append(getMessage().toHexString());
|
sb.append(" MSG:").append(getMessage().toHexString());
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
@@ -94,20 +91,19 @@ public class HyteraSmsWaitingNotification extends CSBKMessage
|
|||||||
{
|
{
|
||||||
if(mDestinationRadio == null)
|
if(mDestinationRadio == null)
|
||||||
{
|
{
|
||||||
mDestinationRadio = DMRRadio.createTo(getMessage().getInt(DESTINATION_RADIO));
|
mDestinationRadio = DmrTier3Radio.createTo(getMessage().getInt(DESTINATION_RADIO));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mDestinationRadio;
|
return mDestinationRadio;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUnknown1()
|
/**
|
||||||
|
* Unknown octets.
|
||||||
|
* @return two unknown octets as hex string
|
||||||
|
*/
|
||||||
|
public String getUnknown()
|
||||||
{
|
{
|
||||||
return getMessage().getHex(UNKNOWN_1, 2);
|
return getMessage().getHex(UNKNOWN, 4);
|
||||||
}
|
|
||||||
|
|
||||||
public String getUnknown2()
|
|
||||||
{
|
|
||||||
return getMessage().getHex(UNKNOWN_2, 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -117,7 +113,7 @@ public class HyteraSmsWaitingNotification extends CSBKMessage
|
|||||||
{
|
{
|
||||||
if(mSourceRadio == null)
|
if(mSourceRadio == null)
|
||||||
{
|
{
|
||||||
mSourceRadio = DMRRadio.createFrom(getMessage().getInt(SOURCE_RADIO));
|
mSourceRadio = DmrTier3Radio.createFrom(getMessage().getInt(SOURCE_RADIO));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mSourceRadio;
|
return mSourceRadio;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -24,12 +24,11 @@ import io.github.dsheirer.identifier.Identifier;
|
|||||||
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
|
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
|
||||||
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.standard.Preamble;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.standard.Preamble;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -153,7 +152,7 @@ public class HyteraXPTPreamble extends Preamble
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mTargetAddress = DMRRadio.createTo(getMessage().getInt(TARGET_ADDRESS));
|
mTargetAddress = DmrTier3Radio.createTo(getMessage().getInt(TARGET_ADDRESS));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +166,7 @@ public class HyteraXPTPreamble extends Preamble
|
|||||||
{
|
{
|
||||||
if(mSourceAddress == null)
|
if(mSourceAddress == null)
|
||||||
{
|
{
|
||||||
mSourceAddress = DMRRadio.createFrom(getMessage().getInt(SOURCE_ADDRESS));
|
mSourceAddress = DmrTier3Radio.createFrom(getMessage().getInt(SOURCE_ADDRESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mSourceAddress;
|
return mSourceAddress;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,14 +23,13 @@ import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
|||||||
import io.github.dsheirer.identifier.Identifier;
|
import io.github.dsheirer.identifier.Identifier;
|
||||||
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.ServiceFunction;
|
import io.github.dsheirer.module.decode.dmr.message.type.ServiceFunction;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.SystemIdentityCode;
|
import io.github.dsheirer.module.decode.dmr.message.type.SystemIdentityCode;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.Version;
|
import io.github.dsheirer.module.decode.dmr.message.type.Version;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -83,7 +82,7 @@ public class CapacityMaxAloha extends CSBKMessage
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" CAPACITY-MAX ALOHA");
|
sb.append(" CSBK CAPACITY-MAX ALOHA");
|
||||||
|
|
||||||
if(hasRadioIdentifier())
|
if(hasRadioIdentifier())
|
||||||
{
|
{
|
||||||
@@ -153,7 +152,7 @@ public class CapacityMaxAloha extends CSBKMessage
|
|||||||
{
|
{
|
||||||
if(mRadioIdentifier == null)
|
if(mRadioIdentifier == null)
|
||||||
{
|
{
|
||||||
mRadioIdentifier = DMRRadio.createTo(getMessage().getInt(RADIO));
|
mRadioIdentifier = DmrTier3Radio.createTo(getMessage().getInt(RADIO));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mRadioIdentifier;
|
return mRadioIdentifier;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -25,7 +25,6 @@ import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -60,7 +59,7 @@ public class CapacityPlusCSBKO_60 extends CSBKMessage
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" CAP+ *UNKNOWN* CSBK:60");
|
sb.append(" CSBK CAP+ *UNKNOWN* CSBK:60");
|
||||||
sb.append(" MSG:").append(getMessage().toHexString());
|
sb.append(" MSG:").append(getMessage().toHexString());
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,7 +27,6 @@ import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -89,7 +88,7 @@ public class CapacityPlusDataRevertWindowAnnouncement extends CSBKMessage
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" MOTOROLA CAP+ ENHANCED DATA REVERT ANNOUNCEMENT");
|
sb.append(" CSBK CAP+ ENHANCED DATA REVERT ANNOUNCEMENT");
|
||||||
sb.append(" WINDOW:").append(getSuperFrame()).append(".").append(getWindow());
|
sb.append(" WINDOW:").append(getSuperFrame()).append(".").append(getWindow());
|
||||||
|
|
||||||
if(hasTargetRadio())
|
if(hasTargetRadio())
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,7 +27,6 @@ import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -72,7 +71,7 @@ public class CapacityPlusDataRevertWindowGrant extends CSBKMessage
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" MOTOROLA CAP+ ENHANCED DATA REVERT GRANT TO:").append(getTargetAddress());
|
sb.append(" CSBK CAP+ ENHANCED DATA REVERT GRANT TO:").append(getTargetAddress());
|
||||||
sb.append(" TRANSMIT IN WINDOW:").append(getSuperFrame()).append(".").append(getWindow());
|
sb.append(" TRANSMIT IN WINDOW:").append(getSuperFrame()).append(".").append(getWindow());
|
||||||
sb.append(" MSG:").append(getMessage().toHexString());
|
sb.append(" MSG:").append(getMessage().toHexString());
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -30,7 +30,6 @@ import io.github.dsheirer.module.decode.dmr.message.CACH;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.LCSS;
|
import io.github.dsheirer.module.decode.dmr.message.type.LCSS;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -90,7 +89,7 @@ public class CapacityPlusNeighbors extends CSBKMessage implements ITimeslotFrequ
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" MOTOROLA CAP+ SITE:").append(getSite());
|
sb.append(" CSBK CAP+ SITE:").append(getSite());
|
||||||
sb.append(" REST ").append(getRestChannel());
|
sb.append(" REST ").append(getRestChannel());
|
||||||
sb.append(" FL:").append(getLCSS());
|
sb.append(" FL:").append(getLCSS());
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -29,7 +29,6 @@ import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.standard.Preamble;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.standard.Preamble;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -76,7 +75,7 @@ public class CapacityPlusPreamble extends Preamble
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" MOTOROLA CAP+").append(isCSBKPreamble() ? " CSBK" : " DATA");
|
sb.append(" CSBK CAP+").append(isCSBKPreamble() ? " CSBK" : " DATA");
|
||||||
sb.append(" PREAMBLE FM:").append(getSourceAddress());
|
sb.append(" PREAMBLE FM:").append(getSourceAddress());
|
||||||
sb.append(" TO:").append(getTargetAddress());
|
sb.append(" TO:").append(getTargetAddress());
|
||||||
sb.append(" BLOCKS TO FOLLOW:").append(getBlocksToFollow());
|
sb.append(" BLOCKS TO FOLLOW:").append(getBlocksToFollow());
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -29,7 +29,6 @@ import io.github.dsheirer.module.decode.dmr.message.CACH;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.LCSS;
|
import io.github.dsheirer.module.decode.dmr.message.type.LCSS;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -72,7 +71,7 @@ public class CapacityPlusSystemStatus extends CSBKMessage implements ITimeslotFr
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" MOTOROLA CAP+ SYSTEM STATUS ").append(getFragmentIndicator());
|
sb.append(" CSBK CAP+ SYSTEM STATUS ").append(getFragmentIndicator());
|
||||||
sb.append(" REST ").append(getRestChannel());
|
sb.append(" REST ").append(getRestChannel());
|
||||||
sb.append(" MSG:").append(getMessage().toHexString());
|
sb.append(" MSG:").append(getMessage().toHexString());
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,7 +27,6 @@ import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -72,7 +71,7 @@ public class ConnectPlusCSBKO_16 extends CSBKMessage
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" CON+ CSBKO:16 FM:").append(getSourceRadio());
|
sb.append(" CSBK CON+ CSBKO:16 FM:").append(getSourceRadio());
|
||||||
sb.append(" TO:").append(getTargetRadio());
|
sb.append(" TO:").append(getTargetRadio());
|
||||||
sb.append(" UNK:").append(getUnknown());
|
sb.append(" UNK:").append(getUnknown());
|
||||||
sb.append(" MSG:").append(getMessage().toHexString());
|
sb.append(" MSG:").append(getMessage().toHexString());
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,7 +27,6 @@ import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -71,7 +70,7 @@ public class ConnectPlusDataRevertWindowAnnouncement extends CSBKMessage
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" CON+ ENHANCED DATA REVERT CHANNEL ANNOUNCE WINDOW:");
|
sb.append(" CSBK CON+ ENHANCED DATA REVERT CHANNEL ANNOUNCE WINDOW:");
|
||||||
sb.append(getSuperFrame()).append(".").append(getWindow());
|
sb.append(getSuperFrame()).append(".").append(getWindow());
|
||||||
if(hasTargetRadio())
|
if(hasTargetRadio())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,7 +27,6 @@ import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -72,7 +71,7 @@ public class ConnectPlusDataRevertWindowGrant extends CSBKMessage
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" CON+ ENHANCED DATA REVERT GRANT TO:").append(getTargetRadio());
|
sb.append(" CSBK CON+ ENHANCED DATA REVERT GRANT TO:").append(getTargetRadio());
|
||||||
sb.append(" TRANSMIT IN WINDOW:").append(getSuperFrame()).append(".").append(getWindow());
|
sb.append(" TRANSMIT IN WINDOW:").append(getSuperFrame()).append(".").append(getWindow());
|
||||||
sb.append(" MSG:").append(getMessage().toHexString());
|
sb.append(" MSG:").append(getMessage().toHexString());
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -28,7 +28,6 @@ import io.github.dsheirer.module.decode.dmr.identifier.DMRSite;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -70,7 +69,7 @@ public class ConnectPlusNeighborReport extends CSBKMessage
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" CON+ NEIGHBORS:");
|
sb.append(" CSBK CON+ NEIGHBORS:");
|
||||||
List<SiteIdentifier> neighbors = getNeighbors();
|
List<SiteIdentifier> neighbors = getNeighbors();
|
||||||
|
|
||||||
if(neighbors.isEmpty())
|
if(neighbors.isEmpty())
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -28,8 +28,7 @@ import io.github.dsheirer.module.decode.dmr.channel.TimeslotFrequency;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
import io.github.dsheirer.module.decode.ip.xcmp.XCMPMessageType;
|
import io.github.dsheirer.module.decode.ip.mototrbo.xcmp.XCMPMessageType;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -78,7 +77,7 @@ public class ConnectPlusOTAAnnouncement extends CSBKMessage implements ITimeslot
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" CON+ ANNOUNCE OTA ").append(getMessageType());
|
sb.append(" CSBK CON+ ANNOUNCE OTA ").append(getMessageType());
|
||||||
sb.append(" VER:").append(getMessageVersion());
|
sb.append(" VER:").append(getMessageVersion());
|
||||||
sb.append(" AVAILABLE ON ").append(getDataChannel());
|
sb.append(" AVAILABLE ON ").append(getDataChannel());
|
||||||
sb.append(" MSG:").append(getMessage().toHexString());
|
sb.append(" MSG:").append(getMessage().toHexString());
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,7 +27,6 @@ import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -72,7 +71,7 @@ public class ConnectPlusRegistrationRequest extends CSBKMessage
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" CON+ REGISTRATION REQUEST FM:").append(getSourceRadio());
|
sb.append(" CSBK CON+ REGISTRATION REQUEST FM:").append(getSourceRadio());
|
||||||
sb.append(" TO:").append(getTargetRadio());
|
sb.append(" TO:").append(getTargetRadio());
|
||||||
sb.append(" UNK:").append(getUnknown());
|
sb.append(" UNK:").append(getUnknown());
|
||||||
sb.append(" MSG:").append(getMessage().toHexString());
|
sb.append(" MSG:").append(getMessage().toHexString());
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,7 +27,6 @@ import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -72,7 +71,7 @@ public class ConnectPlusRegistrationResponse extends CSBKMessage
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" CON+ REGISTRATION RESPONSE FM:").append(getSourceRadio());
|
sb.append(" CSBK CON+ REGISTRATION RESPONSE FM:").append(getSourceRadio());
|
||||||
sb.append(" TO:").append(getTargetRadio());
|
sb.append(" TO:").append(getTargetRadio());
|
||||||
sb.append(" UNK:").append(getUnknown());
|
sb.append(" UNK:").append(getUnknown());
|
||||||
sb.append(" MSG:").append(getMessage().toHexString());
|
sb.append(" MSG:").append(getMessage().toHexString());
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -29,7 +29,6 @@ import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -74,7 +73,7 @@ public class ConnectPlusTalkgroupAffiliation extends CSBKMessage
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" CON+ AFFILIATE RADIO:").append(getRadio());
|
sb.append(" CSBK CON+ AFFILIATE RADIO:").append(getRadio());
|
||||||
sb.append(" TO TALKGROUP:").append(getTalkgroup());
|
sb.append(" TO TALKGROUP:").append(getTalkgroup());
|
||||||
sb.append(" UNK:").append(getUnknown());
|
sb.append(" UNK:").append(getUnknown());
|
||||||
sb.append(" MSG:").append(getMessage().toHexString());
|
sb.append(" MSG:").append(getMessage().toHexString());
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -32,7 +32,6 @@ import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -80,7 +79,7 @@ public class ConnectPlusVoiceChannelUser extends CSBKMessage implements ITimeslo
|
|||||||
}
|
}
|
||||||
|
|
||||||
sb.append("CC:").append(getSlotType().getColorCode());
|
sb.append("CC:").append(getSlotType().getColorCode());
|
||||||
sb.append(" CON+ VOICE CHANNEL USER FM:").append(getRadio());
|
sb.append(" CSBK CON+ VOICE CHANNEL USER FM:").append(getRadio());
|
||||||
sb.append(" TO:").append(getTalkgroup());
|
sb.append(" TO:").append(getTalkgroup());
|
||||||
sb.append(" ").append(getChannel());
|
sb.append(" ").append(getChannel());
|
||||||
sb.append(" UNK:").append(getUnknownField());
|
sb.append(" UNK:").append(getUnknownField());
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,14 +23,13 @@ import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
|||||||
import io.github.dsheirer.identifier.Identifier;
|
import io.github.dsheirer.identifier.Identifier;
|
||||||
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.ServiceFunction;
|
import io.github.dsheirer.module.decode.dmr.message.type.ServiceFunction;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.SystemIdentityCode;
|
import io.github.dsheirer.module.decode.dmr.message.type.SystemIdentityCode;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.Version;
|
import io.github.dsheirer.module.decode.dmr.message.type.Version;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -153,7 +152,7 @@ public class Aloha extends CSBKMessage
|
|||||||
{
|
{
|
||||||
if(mRadioIdentifier == null)
|
if(mRadioIdentifier == null)
|
||||||
{
|
{
|
||||||
mRadioIdentifier = DMRRadio.createTo(getMessage().getInt(RADIO));
|
mRadioIdentifier = DmrTier3Radio.createTo(getMessage().getInt(RADIO));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mRadioIdentifier;
|
return mRadioIdentifier;
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ import io.github.dsheirer.module.decode.dmr.channel.DMRLogicalChannel;
|
|||||||
import io.github.dsheirer.module.decode.dmr.channel.DMRTier3Channel;
|
import io.github.dsheirer.module.decode.dmr.channel.DMRTier3Channel;
|
||||||
import io.github.dsheirer.module.decode.dmr.channel.ITimeslotFrequencyReceiver;
|
import io.github.dsheirer.module.decode.dmr.channel.ITimeslotFrequencyReceiver;
|
||||||
import io.github.dsheirer.module.decode.dmr.channel.TimeslotFrequency;
|
import io.github.dsheirer.module.decode.dmr.channel.TimeslotFrequency;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
@@ -141,7 +141,7 @@ public class Clear extends CSBKMessage implements ITimeslotFrequencyReceiver
|
|||||||
{
|
{
|
||||||
if(mSourceRadio == null)
|
if(mSourceRadio == null)
|
||||||
{
|
{
|
||||||
mSourceRadio = DMRRadio.createFrom(getMessage().getInt(SOURCE));
|
mSourceRadio = DmrTier3Radio.createFrom(getMessage().getInt(SOURCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mSourceRadio;
|
return mSourceRadio;
|
||||||
@@ -157,7 +157,7 @@ public class Clear extends CSBKMessage implements ITimeslotFrequencyReceiver
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mDestinationId = DMRRadio.createTo(getMessage().getInt(DESTINATION));
|
mDestinationId = DmrTier3Radio.createTo(getMessage().getInt(DESTINATION));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -25,14 +25,13 @@ import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
|||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.channel.DMRChannel;
|
import io.github.dsheirer.module.decode.dmr.channel.DMRChannel;
|
||||||
import io.github.dsheirer.module.decode.dmr.channel.DMRTier3Channel;
|
import io.github.dsheirer.module.decode.dmr.channel.DMRTier3Channel;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.mbc.MBCContinuationBlock;
|
import io.github.dsheirer.module.decode.dmr.message.data.mbc.MBCContinuationBlock;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.AbsoluteChannelParameters;
|
import io.github.dsheirer.module.decode.dmr.message.type.AbsoluteChannelParameters;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.DataType;
|
import io.github.dsheirer.module.decode.dmr.message.type.DataType;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -178,7 +177,7 @@ public class MoveTSCC extends CSBKMessage
|
|||||||
{
|
{
|
||||||
if(mRadioIdentifier == null)
|
if(mRadioIdentifier == null)
|
||||||
{
|
{
|
||||||
mRadioIdentifier = DMRRadio.createTo(getMessage().getInt(RADIO));
|
mRadioIdentifier = DmrTier3Radio.createTo(getMessage().getInt(RADIO));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mRadioIdentifier;
|
return mRadioIdentifier;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -24,12 +24,11 @@ import io.github.dsheirer.identifier.Identifier;
|
|||||||
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
|
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
|
||||||
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -126,7 +125,7 @@ public class Preamble extends CSBKMessage
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mTargetAddress = DMRRadio.createTo(getMessage().getInt(TARGET_ADDRESS));
|
mTargetAddress = DmrTier3Radio.createTo(getMessage().getInt(TARGET_ADDRESS));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,7 +139,7 @@ public class Preamble extends CSBKMessage
|
|||||||
{
|
{
|
||||||
if(mSourceAddress == null)
|
if(mSourceAddress == null)
|
||||||
{
|
{
|
||||||
mSourceAddress = DMRRadio.createFrom(getMessage().getInt(SOURCE_ADDRESS));
|
mSourceAddress = DmrTier3Radio.createFrom(getMessage().getInt(SOURCE_ADDRESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mSourceAddress;
|
return mSourceAddress;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -24,13 +24,12 @@ import io.github.dsheirer.identifier.Identifier;
|
|||||||
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
|
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
|
||||||
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.ProtectKind;
|
import io.github.dsheirer.module.decode.dmr.message.type.ProtectKind;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -104,7 +103,7 @@ public class Protect extends CSBKMessage
|
|||||||
{
|
{
|
||||||
if(mSourceRadio == null)
|
if(mSourceRadio == null)
|
||||||
{
|
{
|
||||||
mSourceRadio = DMRRadio.createFrom(getMessage().getInt(SOURCE));
|
mSourceRadio = DmrTier3Radio.createFrom(getMessage().getInt(SOURCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mSourceRadio;
|
return mSourceRadio;
|
||||||
@@ -123,7 +122,7 @@ public class Protect extends CSBKMessage
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mDestinationId = DMRRadio.createTo(getMessage().getInt(DESTINATION));
|
mDestinationId = DmrTier3Radio.createTo(getMessage().getInt(DESTINATION));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2022 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -24,14 +24,13 @@ import io.github.dsheirer.identifier.Identifier;
|
|||||||
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
|
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
|
||||||
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.AcknowledgeType;
|
import io.github.dsheirer.module.decode.dmr.message.type.AcknowledgeType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.Reason;
|
import io.github.dsheirer.module.decode.dmr.message.type.Reason;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -136,7 +135,7 @@ public class Acknowledge extends CSBKMessage
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mTargetAddress = DMRRadio.createTo(getMessage().getInt(TARGET_ADDRESS));
|
mTargetAddress = DmrTier3Radio.createTo(getMessage().getInt(TARGET_ADDRESS));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +158,7 @@ public class Acknowledge extends CSBKMessage
|
|||||||
{
|
{
|
||||||
if(mSourceRadio == null)
|
if(mSourceRadio == null)
|
||||||
{
|
{
|
||||||
mSourceRadio = DMRRadio.createFrom(getMessage().getInt(ADDITIONAL_INFO_SOURCE_ADDRESS));
|
mSourceRadio = DmrTier3Radio.createFrom(getMessage().getInt(ADDITIONAL_INFO_SOURCE_ADDRESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mSourceRadio;
|
return mSourceRadio;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -22,8 +22,8 @@ package io.github.dsheirer.module.decode.dmr.message.data.csbk.standard.ahoy;
|
|||||||
import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
||||||
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
|
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
import io.github.dsheirer.module.decode.dmr.identifier.DMRTalkgroup;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
@@ -117,7 +117,7 @@ public abstract class Ahoy extends CSBKMessage
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mTargetAddress = DMRRadio.createTo(getMessage().getInt(TARGET_ADDRESS));
|
mTargetAddress = DmrTier3Radio.createTo(getMessage().getInt(TARGET_ADDRESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -26,8 +26,7 @@ import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
|||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.Gateway;
|
import io.github.dsheirer.module.decode.dmr.message.type.Tier3Gateway;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -84,9 +83,9 @@ public class AuthenticateRegisterRadioCheck extends Ahoy
|
|||||||
/**
|
/**
|
||||||
* Gateway address from the multi-purpose field
|
* Gateway address from the multi-purpose field
|
||||||
*/
|
*/
|
||||||
public Gateway getGateway()
|
public Tier3Gateway getGateway()
|
||||||
{
|
{
|
||||||
return Gateway.fromValue(getMultiPurposeFieldValue());
|
return Tier3Gateway.fromValue(getMultiPurposeFieldValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -108,7 +107,7 @@ public class AuthenticateRegisterRadioCheck extends Ahoy
|
|||||||
*/
|
*/
|
||||||
public boolean isAuthenticateCommand()
|
public boolean isAuthenticateCommand()
|
||||||
{
|
{
|
||||||
return getGateway() != Gateway.TSI;
|
return getGateway() != Tier3Gateway.TSI;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -26,8 +26,7 @@ import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
|||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.Gateway;
|
import io.github.dsheirer.module.decode.dmr.message.type.Tier3Gateway;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -80,9 +79,9 @@ public class StunReviveKill extends Ahoy
|
|||||||
/**
|
/**
|
||||||
* Gateway address from the multi-purpose field
|
* Gateway address from the multi-purpose field
|
||||||
*/
|
*/
|
||||||
public Gateway getGateway()
|
public Tier3Gateway getGateway()
|
||||||
{
|
{
|
||||||
return Gateway.fromValue(getMultiPurposeFieldValue());
|
return Tier3Gateway.fromValue(getMultiPurposeFieldValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -26,8 +26,7 @@ import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
|||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.Gateway;
|
import io.github.dsheirer.module.decode.dmr.message.type.Tier3Gateway;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -81,9 +80,9 @@ public class UnknownAhoy extends Ahoy
|
|||||||
/**
|
/**
|
||||||
* Gateway address from the multi-purpose field
|
* Gateway address from the multi-purpose field
|
||||||
*/
|
*/
|
||||||
public Gateway getGateway()
|
public Tier3Gateway getGateway()
|
||||||
{
|
{
|
||||||
return Gateway.fromValue(getMultiPurposeFieldValue());
|
return Tier3Gateway.fromValue(getMultiPurposeFieldValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,10 +23,9 @@ import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
|||||||
import io.github.dsheirer.identifier.Identifier;
|
import io.github.dsheirer.identifier.Identifier;
|
||||||
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -102,7 +101,7 @@ public class MassRegistration extends Announcement
|
|||||||
{
|
{
|
||||||
if(mDestinationRadio == null)
|
if(mDestinationRadio == null)
|
||||||
{
|
{
|
||||||
mDestinationRadio = DMRRadio.createTo(getMessage().getInt(DESTINATION_RADIO));
|
mDestinationRadio = DmrTier3Radio.createTo(getMessage().getInt(DESTINATION_RADIO));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mDestinationRadio;
|
return mDestinationRadio;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,11 +23,10 @@ import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
|||||||
import io.github.dsheirer.identifier.Identifier;
|
import io.github.dsheirer.identifier.Identifier;
|
||||||
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.mbc.MBCContinuationBlock;
|
import io.github.dsheirer.module.decode.dmr.message.data.mbc.MBCContinuationBlock;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -121,11 +120,11 @@ public class DuplexPrivateDataChannelGrant extends ChannelGrant
|
|||||||
{
|
{
|
||||||
if(getMessage().get(TARGET_IS_SOURCE_ADDRESS_FLAG))
|
if(getMessage().get(TARGET_IS_SOURCE_ADDRESS_FLAG))
|
||||||
{
|
{
|
||||||
mSourceRadio = DMRRadio.createFrom(getMessage().getInt(DESTINATION));
|
mSourceRadio = DmrTier3Radio.createFrom(getMessage().getInt(DESTINATION));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mSourceRadio = DMRRadio.createFrom(getMessage().getInt(SOURCE));
|
mSourceRadio = DmrTier3Radio.createFrom(getMessage().getInt(SOURCE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,11 +140,11 @@ public class DuplexPrivateDataChannelGrant extends ChannelGrant
|
|||||||
{
|
{
|
||||||
if(getMessage().get(TARGET_IS_SOURCE_ADDRESS_FLAG))
|
if(getMessage().get(TARGET_IS_SOURCE_ADDRESS_FLAG))
|
||||||
{
|
{
|
||||||
mDestinationRadio = DMRRadio.createTo(getMessage().getInt(SOURCE));
|
mDestinationRadio = DmrTier3Radio.createTo(getMessage().getInt(SOURCE));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mDestinationRadio = DMRRadio.createTo(getMessage().getInt(DESTINATION));
|
mDestinationRadio = DmrTier3Radio.createTo(getMessage().getInt(DESTINATION));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,11 +23,10 @@ import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
|||||||
import io.github.dsheirer.identifier.Identifier;
|
import io.github.dsheirer.identifier.Identifier;
|
||||||
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.mbc.MBCContinuationBlock;
|
import io.github.dsheirer.module.decode.dmr.message.data.mbc.MBCContinuationBlock;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -121,11 +120,11 @@ public class DuplexPrivateVoiceChannelGrant extends ChannelGrant
|
|||||||
{
|
{
|
||||||
if(getMessage().get(TARGET_IS_SOURCE_ADDRESS_FLAG))
|
if(getMessage().get(TARGET_IS_SOURCE_ADDRESS_FLAG))
|
||||||
{
|
{
|
||||||
mSourceRadio = DMRRadio.createFrom(getMessage().getInt(DESTINATION));
|
mSourceRadio = DmrTier3Radio.createFrom(getMessage().getInt(DESTINATION));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mSourceRadio = DMRRadio.createFrom(getMessage().getInt(SOURCE));
|
mSourceRadio = DmrTier3Radio.createFrom(getMessage().getInt(SOURCE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,11 +140,11 @@ public class DuplexPrivateVoiceChannelGrant extends ChannelGrant
|
|||||||
{
|
{
|
||||||
if(getMessage().get(TARGET_IS_SOURCE_ADDRESS_FLAG))
|
if(getMessage().get(TARGET_IS_SOURCE_ADDRESS_FLAG))
|
||||||
{
|
{
|
||||||
mDestinationRadio = DMRRadio.createTo(getMessage().getInt(SOURCE));
|
mDestinationRadio = DmrTier3Radio.createTo(getMessage().getInt(SOURCE));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mDestinationRadio = DMRRadio.createTo(getMessage().getInt(DESTINATION));
|
mDestinationRadio = DmrTier3Radio.createTo(getMessage().getInt(DESTINATION));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,11 +23,10 @@ import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
|||||||
import io.github.dsheirer.identifier.Identifier;
|
import io.github.dsheirer.identifier.Identifier;
|
||||||
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.mbc.MBCContinuationBlock;
|
import io.github.dsheirer.module.decode.dmr.message.data.mbc.MBCContinuationBlock;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -132,7 +131,7 @@ public class PrivateDataChannelGrant extends ChannelGrant
|
|||||||
{
|
{
|
||||||
if(mSourceRadio == null)
|
if(mSourceRadio == null)
|
||||||
{
|
{
|
||||||
mSourceRadio = DMRRadio.createFrom(getMessage().getInt(SOURCE));
|
mSourceRadio = DmrTier3Radio.createFrom(getMessage().getInt(SOURCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mSourceRadio;
|
return mSourceRadio;
|
||||||
@@ -145,7 +144,7 @@ public class PrivateDataChannelGrant extends ChannelGrant
|
|||||||
{
|
{
|
||||||
if(mDestinationRadio == null)
|
if(mDestinationRadio == null)
|
||||||
{
|
{
|
||||||
mDestinationRadio = DMRRadio.createTo(getMessage().getInt(DESTINATION));
|
mDestinationRadio = DmrTier3Radio.createTo(getMessage().getInt(DESTINATION));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mDestinationRadio;
|
return mDestinationRadio;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,11 +23,10 @@ import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
|||||||
import io.github.dsheirer.identifier.Identifier;
|
import io.github.dsheirer.identifier.Identifier;
|
||||||
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
import io.github.dsheirer.identifier.radio.RadioIdentifier;
|
||||||
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
|
||||||
import io.github.dsheirer.module.decode.dmr.identifier.DMRRadio;
|
import io.github.dsheirer.module.decode.dmr.identifier.DmrTier3Radio;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
import io.github.dsheirer.module.decode.dmr.message.CACH;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.mbc.MBCContinuationBlock;
|
import io.github.dsheirer.module.decode.dmr.message.data.mbc.MBCContinuationBlock;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -118,7 +117,7 @@ public class PrivateVoiceChannelGrant extends ChannelGrant
|
|||||||
{
|
{
|
||||||
if(mSourceRadio == null)
|
if(mSourceRadio == null)
|
||||||
{
|
{
|
||||||
mSourceRadio = DMRRadio.createFrom(getMessage().getInt(SOURCE));
|
mSourceRadio = DmrTier3Radio.createFrom(getMessage().getInt(SOURCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mSourceRadio;
|
return mSourceRadio;
|
||||||
@@ -131,7 +130,7 @@ public class PrivateVoiceChannelGrant extends ChannelGrant
|
|||||||
{
|
{
|
||||||
if(mDestinationRadio == null)
|
if(mDestinationRadio == null)
|
||||||
{
|
{
|
||||||
mDestinationRadio = DMRRadio.createTo(getMessage().getInt(DESTINATION));
|
mDestinationRadio = DmrTier3Radio.createTo(getMessage().getInt(DESTINATION));
|
||||||
}
|
}
|
||||||
|
|
||||||
return mDestinationRadio;
|
return mDestinationRadio;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* *****************************************************************************
|
* *****************************************************************************
|
||||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -26,8 +26,8 @@ import io.github.dsheirer.module.decode.dmr.message.CACH;
|
|||||||
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.data.csbk.Opcode;
|
import io.github.dsheirer.module.decode.dmr.message.data.csbk.Opcode;
|
||||||
|
import io.github.dsheirer.module.decode.dmr.message.type.AnnouncementType;
|
||||||
import io.github.dsheirer.module.decode.dmr.message.type.Vendor;
|
import io.github.dsheirer.module.decode.dmr.message.type.Vendor;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -36,6 +36,8 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class MBCHeader extends CSBKMessage
|
public class MBCHeader extends CSBKMessage
|
||||||
{
|
{
|
||||||
|
private static final int[] ANNOUNCEMENT_TYPE = new int[]{16, 17, 18, 19, 20};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an instance
|
* Constructs an instance
|
||||||
*
|
*
|
||||||
@@ -87,7 +89,7 @@ public class MBCHeader extends CSBKMessage
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sb.append(" VENDOR:").append(vendor);
|
sb.append(" ").append(vendor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,6 +99,10 @@ public class MBCHeader extends CSBKMessage
|
|||||||
{
|
{
|
||||||
sb.append(" UNKNOWN CSBKO:").append(getOpcodeValue());
|
sb.append(" UNKNOWN CSBKO:").append(getOpcodeValue());
|
||||||
}
|
}
|
||||||
|
else if(opcode == Opcode.HYTERA_08_ANNOUNCEMENT)
|
||||||
|
{
|
||||||
|
sb.append(" ANNOUNCEMENT:").append(AnnouncementType.fromValue(getMessage().getInt(ANNOUNCEMENT_TYPE)));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sb.append(" ").append(opcode);
|
sb.append(" ").append(opcode);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user