The G39DDC API SDK is implemented as a dynamic library (G39DDCAPI.dll). It provides object-oriented and non-object-oriented interfaces to control the G39DDC device. This document describes the non-object-oriented interface. The G39DDCAPI.dll library exports several functions which makes it possible to control G39DDC receivers.
The API is not fully thread-safe so preferably it should be used in single-threaded applications. It can be used in multi-threaded applications as well, but with some care: One G39DDC receiver can be controlled from a single user thread only.
A C/C++ header file G39DDCAPI.h is a part of the SDK. The API can be used by any 32-bit application under Microsoft Windows 7, Windows 8, Windows 10 and Windows 11 (including their 64-bit versions). The API can be used also by any 64-bit application but only under 64-bit versions of the supported operating systems.
The G39DDCAPI.dll library can be loaded to the application by two Microsoft Windows API functions. The first is LoadLibrary and
the second is LoadLibraryEx. After the library is loaded, it is necessary to get the addresses of exported functions.
When the API is no longer required in memory, the FreeLibrary function can be used to unload the API. Before FreeLibrary is called, all the handles to the G39DDC devices returned by the OpenDevice function must be closed by the CloseDevice function, otherwise the application may enter an unpredictable state.
The following source code shows how to load the API.
#include <stdio.h> #include "G39DDCAPI.h" G39DDC_OPEN_DEVICE OpenDevice; G39DDC_CLOSE_DEVICE CloseDevice; HMODULE hAPI; void main(void) { //Loading the API hAPI=LoadLibrary("G39DDCAPI.dll"); if(hAPI!=NULL) { //Retrieving addresses of used API functions OpenDevice=(G39DDC_OPEN_DEVICE)GetProcAddress(hAPI,"OpenDevice"); CloseDevice=(G39DDC_CLOSE_DEVICE)GetProcAddress(hAPI,"CloseDevice"); //Here place code that uses the API FreeLibrary(hAPI); } else { //If the LoadLibrary fails printf("Failed to load G39DDCAPI.dll.\n"); } }
The G39DDC API provides the GetDeviceList function which returns a list of available G39DDC devices which can be open by the OpenDevice function.
The following source code produces a list of serial numbers for available G39DDC devices.
#include <stdio.h> #include "G39DDCAPI.h" G39DDC_GET_DEVICE_LIST GetDeviceList; HMODULE hAPI; void main(void) { UINT32 Count,i,ItemSize; G39DDC_DEVICE_INFO *DeviceList; //Loading the API hAPI=LoadLibrary("G39DDCAPI.dll"); if(hAPI!=NULL) { //Retrieving address of the GetDeviceList function GetDeviceList=(G39DDC_GET_DEVICE_LIST)GetProcAddress(hAPI,"GetDeviceList"); //Retrieving number of available devices if(GetDeviceList(NULL,0,&Count,&ItemSize)) { if(Count!=0) { //Allocating memory for device information structures DeviceList=(G39DDC_DEVICE_INFO*)malloc(Count*sizeof(G39DDC_DEVICE_INFO)); if(DeviceList!=NULL) { //Retrieving information about available devices if(GetDeviceList(DeviceList,Count*sizeof(G39DDC_DEVICE_INFO),&Count,&ItemSize)) { printf("Available G39DDC devices count=%d:\n",Count); for(i=0;i<Count;i++) { printf("%d. SN: %s\n",i,DeviceList[i].SerialNumber); } } else { printf("GetDeviceList failed with error %08X\n",GetLastError()); } free(DeviceList); } else { printf("Out of memory\n"); } } else { printf("No available G39DDC device found.\n"); } } else { printf("GetDeviceList failed with error %08X\n",GetLastError()); } FreeLibrary(hAPI); } else { printf("Failed to load G39DDCAPI.dll.\n"); } printf("Press enter to exit\n"); getchar(); }
The G39DDC device has to be open before it can be controlled. The API provides the OpenDevice function to open the device.
The following source code shows how to open the first available G39DDC device.
#include <stdio.h> #include "G39DDCAPI.h" G39DDC_OPEN_DEVICE OpenDevice; G39DDC_CLOSE_DEVICE CloseDevice; HMODULE hAPI; void main(void) { INT32 hDevice; //Loading the API hAPI=LoadLibrary("G39DDCAPI.dll"); if(hAPI!=NULL) { //Retrieving addresses of the OpenDevice and CloseDevice API functions OpenDevice=(G39DDC_OPEN_DEVICE)GetProcAddress(hAPI,"OpenDevice"); CloseDevice=(G39DDC_CLOSE_DEVICE)GetProcAddress(hAPI,"CloseDevice"); //Opening the first available G39DDC device using predefined G39DDC_OPEN_FIRST constant hDevice=OpenDevice(G39DDC_OPEN_FIRST); if(hDevice>=0) { //Here place code that works with the open G39DDC device //Closing handle to opened G39DDC device CloseDevice(hDevice); } else { printf("OpenDevice failed with error %08X\n",GetLastError()); } FreeLibrary(hAPI); } else { //If the LoadLibrary fails printf("Failed to load G39DDCAPI.dll.\n"); } }
The GetDeviceList function returns information about available G39DDC devices which can be open.
C/C++ declaration
BOOL __stdcall GetDeviceList(G39DDC_DEVICE_INFO *DeviceList,UINT32 BufferSize,UINT32 *Count,UINT32 *ItemSize);
Address retrieval
G39DDC_GET_DEVICE_LIST GetDeviceList=(G39DDC_GET_DEVICE_LIST)GetProcAddress(hAPI,"GetDeviceList");
Parameters
DeviceList[out] Pointer to array of G39DDC_DEVICE_INFO structures to be filled with information about available G39DDC devices.
This parameter can be NULL only if the BufferSize parameter is zero, otherwise the function fails.BufferSize[in] Specifies the size in bytes of the buffer pointed to by the DeviceList parameter. If this value is zero, the function returns the number of available G39DDC devices and makes no use of the DeviceList buffer.Count[out] Pointer to a variable which receives the number of available G39DDC devices. This parameter cannot be NULL.ItemSize[out] Pointer to a variable which receives the size of a single item of the buffer pointed to by the DeviceList parameter. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Opens the G39DDC device by its serial number.
C/C++ declaration
INT32 __stdcall OpenDevice(CONST CHAR *SerialNumber);
Address retrieval
G39DDC_OPEN_DEVICE OpenDevice=(G39DDC_OPEN_DEVICE)GetProcAddress(hAPI,"OpenDevice");
Parameters
SerialNumber[in] Pointer to a null-terminated string which specifies the serial number of the G39DDC device to open. It can use one of the following values instead of a serial number:
Value Meaning G39DDC_OPEN_FIRST The function opens first available G39DDC device. G39DDC_OPEN_DEMO The function opens a demo G39DDC device. This allows work with the API without a physical G39DDC device.
Return value
If the function succeeds, the return value is the handle to the specified G39DDC device. This handle can only be used with functions of G39DDC API.
If the function fails, the return value is negative. To get extended error information, call GetLastError.
Remarks
The OpenDevice function can be called from any user thread, the returned handle can only be used in the same thread, otherwise the application may enter an unpredictable state.
Use the CloseDevice function to close the G39DDC device handle returned by OpenDevice.
Closes the G39DDC device.
C/C++ declaration
BOOL __stdcall CloseDevice(INT32 hDevice);
Address retrieval
G39DDC_CLOSE_DEVICE CloseDevice=(G39DDC_CLOSE_DEVICE)GetProcAddress(hAPI,"CloseDevice");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Checks if the device is still connected to the computer.
C/C++ declaration
BOOL __stdcall IsDeviceConnected(INT32 hDevice);
Address retrieval
G39DDC_IS_DEVICE_CONNECTED IsDeviceConnected=(G39DDC_IS_DEVICE_CONNECTED)GetProcAddress(hAPI,"IsDeviceConnected");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.
Return value
The function returns non-zero value if the device is still connected.
If the device is disconnected or the function fails, the return value is zero. To determine whether the function failed, call GetLastError. GetLastError returns ERROR_SUCCESS if the device is disconnected, or another error code if IsDeviceConnected failed.
Remarks
If it is determined that the device is disconnected, the corresponding device handle is no longer usable and it should be closed using the CloseDevice function.
Retrieves information about the G39DDC device.
C/C++ declaration
BOOL __stdcall GetDeviceInfo(INT32 hDevice,G39DDC_DEVICE_INFO *Info,UINT32 BufferLength);
Address retrieval
G39DDC_GET_DEVICE_INFO GetDeviceInfo=(G39DDC_GET_DEVICE_INFO)GetProcAddress(hAPI,"GetDeviceInfo");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Info[out] Pointer to a G39DDC_DEVICE_INFO structure to be filled with information about the device. This parameter cannot be NULL.BufferLength[in] Size in bytes of the G39DDC_DEVICE_INFO structure.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sets the front panel LED flashing mode.
C/C++ declaration
BOOL __stdcall SetLED(INT32 hDevice,UINT32 LEDMode);
Address retrieval
G39DDC_SET_LED SetLED=(G39DDC_SET_LED)GetProcAddress(hAPI,"SetLED");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.LEDMode[in] Specifies front panel LED flashing mode which can be one of the following:
Value Meaning G39DDC_FRONT_PANEL_LED_MODE_DIAG Diagnostic flashing. G39DDC_FRONT_PANEL_LED_MODE_ON Always on. G39DDC_FRONT_PANEL_LED_MODE_OFF Always off.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetLED function to determine the current flashing mode of the front panel LED.
A complete list of the diagnostic flashing patterns and their meaning is as follows:
No. Pattern Description Mode 1
Off No power 2
Long flash, equal gap No connection to computer 3
Two short flashes USB connected, radio off 4
One short flash followed by a long one USB connected, radio on, ready 5
Two short flashes followed by a long one USB connected, driver not installed 6
Three short flashes USB connected, driver installed, application not running
Determines the current flashing mode of device's front panel LED.
C/C++ declaration
BOOL __stdcall GetLED(INT32 hDevice,UINT32 *LEDMode);
Address retrieval
G39DDC_GET_LED GetLED=(G39DDC_GET_LED)GetProcAddress(hAPI,"GetLED");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.LEDMode[out] Pointer to a variable which receives current flashing mode of device's front panel LED. For list of possible values, see SetLED. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Turns the G39DDC device on or off.
C/C++ declaration
BOOL __stdcall SetPower(INT32 hDevice,BOOL Power);
Address retrieval
G39DDC_SET_POWER SetPower=(G39DDC_SET_POWER)GetProcAddress(hAPI,"SetPower");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Power[in] Specifies whether to turn on or off the device. If this parameter is non-zero the device is turned on, if it is zero the device is turned off.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If SetPower turns the device off, all the running streaming are stopped.
Use the GetPower function to determine current power state of the device.
The GetPower function determines whether the device is turned on or off.
C/C++ declaration
BOOL __stdcall GetPower(INT32 hDevice,BOOL *Power);
Address retrieval
G39DDC_GET_POWER GetPower=(G39DDC_GET_POWER)GetProcAddress(hAPI,"GetPower");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Power[out] Pointer to a variable which receives current power state of the device. If it is non-zero, the device is turned on. If it is zero the device is turned off. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sets the absolute frequency of the demodulator for the given channel.
C/C++ declaration
BOOL __stdcall SetFrequency(INT32 hDevice,UINT32 Channel,UINT64 Frequency);
Address retrieval
G39DDC_SET_FREQUENCY SetFrequency=(G39DDC_SET_FREQUENCY)GetProcAddress(hAPI,"SetFrequency");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies channel index. Possible values are: 0, 1.Frequency[in] Specifies new absolute frequency of the demodulator in Hz.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The function sets front-end frequency, relative DDC1, DDC2 and demodulator frequencies, so that the new absolute frequency of the demodulator is the required one.
Absolute frequency of the demodulator is given by the following formula:
faDEM[i] = fFE + frDDC1[i] + frDDC2[i] + frDEM[i]
Where faDEM[i] is absolute center frequency of the demodulator of i-th channel in Hz, fFE is front-end frequency (see SetFrontEndFrequency), frDDC1[i] is relative center frequency of the DDC1 in Hz (set using the SetDDC1Frequency function), frDDC2[i] is relative center frequency of DDC2 of i-th channel in Hz (set using the SetDDC2Frequency) and frDEM[i] is relative center frequency of the demodulator of i-th channel in Hz (set using the SetDemodulatorFrequency function).
Absolute center frequency of the demodulator is the real-world frequency that you are listening to.
Use the GetFrequency function to retrieve the current absolute frequency of the demodulator.
Determines the absolute frequency of the demodulator for a given channel.
C/C++ declaration
BOOL __stdcall GetFrequency(INT32 hDevice,UINT32 Channel,UINT64 *Frequency);
Address retrieval
G39DDC_GET_FREQUENCY GetFrequency=(G39DDC_GET_FREQUENCY)GetProcAddress(hAPI,"GetFrequency");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies channel index. Possible values are: 0, 1.Frequency[out] Pointer to a variable which receives current absolute frequency of the demodulator. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Returned value of the variable pointed to by the Frequency parameter is sum of front-end frequency and relative DDC1, DDC2 and demodulator frequencies. For more information, see remarks of the SetFrequency function.
Enables or disables the use of external reference as the clock source.
C/C++ declaration
BOOL __stdcall SetExternalReference(INT32 hDevice,BOOL Enabled);
Address retrieval
G39DDC_SET_EXTERNAL_REFERENCE SetExternalReference=(G39DDC_SET_EXTERNAL_REFERENCE)GetProcAddress(hAPI,"SetExternalReference");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Enabled[in] Specifies the desired clock source: nonzero - external reference, zero - internal.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
External reference is optional. If the receiver does not support external reference, SetExternalReference fails. The following example shows how to determine whether the receiver supports external reference:
G39DDC_DEVICE_INFO DeviceInfo; INT32 hDevice; //handle to open G39DDC device GetDeviceInfo(hDevice,&DeviceInfo,sizeof(DeviceInfo)); if(DeviceInfo.HardwareOptions & G39DDC_HARDWARE_OPTIONS_EXTERNAL_REFERENCE) { //the receiver supports external reference } else { //the receiver does not support external reference }
Retrieves the current clock source.
C/C++ declaration
BOOL __stdcall GetExternalReference(INT32 hDevice,BOOL *Enabled);
Address retrieval
G39DDC_GET_EXTERNAL_REFERENCE GetExternalReference=(G39DDC_GET_EXTERNAL_REFERENCE)GetProcAddress(hAPI,"GetExternalReference");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Enabled[out] Pointer to a variable which receives information about the current clock source. If it is non-zero, external reference is used, if it is zero, internal reference is used. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sets the input attenuator. The attenuator is applied for front-end frequencies (see SetFrontEndFrequency) below 60 MHz.
C/C++ declaration
BOOL __stdcall SetAttenuator(INT32 hDevice,UINT32 Attenuator);
Address retrieval
G39DDC_SET_ATTENUATOR SetAttenuator=(G39DDC_SET_ATTENUATOR)GetProcAddress(hAPI,"SetAttenuator");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Attenuator[in] Value that specifies the desired attenuation level. The value must be one of the following:
Value Meaning G39DDC_ATTENUATOR_0dB No attenuation. G39DDC_ATTENUATOR_6dB 6 dB attenuation. G39DDC_ATTENUATOR_12dB 12 dB attenuation. G39DDC_ATTENUATOR_18dB 18 dB attenuation.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetAttenuator function to determine the current setting of the attenuator.
Retrieves current setting of the attenuator.
C/C++ declaration
BOOL __stdcall GetAttenuator(INT32 hDevice,UINT32 *Attenuator);
Address retrieval
G39DDC_GET_ATTENUATOR GetAttenuator=(G39DDC_GET_ATTENUATOR)GetProcAddress(hAPI,"GetAttenuator");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Attenuator[out] Pointer to a variable which receives the current attenuation level. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Enables or disables the RF input preamplifier. The preamplifier is applied to front-end frequencies (see SetFrontEndFrequency) above 50 MHz.
C/C++ declaration
BOOL __stdcall SetPreamplifier(INT32 hDevice,BOOL Preamp);
Address retrieval
G39DDC_SET_PREAMPLIFIER SetPreamplifier=(G39DDC_SET_PREAMPLIFIER)GetProcAddress(hAPI,"SetPreamplifier");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Preamp[in] Specifies whether to enable or disable the preamplifier. If this parameter is non-zero, the preamplifier is enabled. If the parameter is zero, the preamplifier is disabled.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetPreamplifier function to determine the current state of the preamplifier.
Retrieves the current state of the RF input preamplifier.
C/C++ declaration
BOOL __stdcall GetPreamplifier(INT32 hDevice,BOOL *Preamp);
Address retrieval
G39DDC_GET_PREAMPLIFIER GetPreamplifier=(G39DDC_GET_PREAMPLIFIER)GetProcAddress(hAPI,"GetPreamplifier");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Preamp[out] Pointer to a variable which receives current state of the preamplifier. The value is non-zero if the preamplifier is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sets the frequency of the device's analog front-end.
C/C++ declaration
BOOL __stdcall SetFrontEndFrequency(INT32 hDevice,UINT64 Frequency);
Address retrieval
G39DDC_SET_FRONT_END_FREQUENCY SetFrontEndFrequency=(G39DDC_SET_FRONT_END_FREQUENCY)GetProcAddress(hAPI,"SetFrontEndFrequency");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Frequency[in] Specifies new front-end frequency in Hz. The value can be between (including) values provided by the FrontEndMinFrequency and FrontEndMaxFrequency members of the G39DDC_DEVICE_INFO structure. If the specified frequency is not equal to the FrontEndMinFrequency, it has to be multiple of the FrontEndFrequencyStep member of the G39DDC_DEVICE_INFO structure.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Changes to the front-end frequency causes a change of absolute frequency for the DDC1, DDC2 and demodulator in each channel.
Use the GetFrontEndFrequency function to retrieve the current front-end frequency.
Retrieves current front-end frequency.
C/C++ declaration
BOOL __stdcall GetFrontEndFrequency(INT32 hDevice,UINT64 *Frequency);
Address retrieval
G39DDC_GET_FRONT_END_FREQUENCY GetFrontEndFrequency=(G39DDC_GET_FRONT_END_FREQUENCY)GetProcAddress(hAPI,"GetFrontEndFrequency");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Frequency[out] Pointer to a variable which receives the current current front-end frequency in Hz. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Enables or disables ADC dithering.
C/C++ declaration
BOOL __stdcall SetDithering(INT32 hDevice,BOOL Enabled);
Address retrieval
G39DDC_SET_DITHERING SetDithering=(G39DDC_SET_DITHERING)GetProcAddress(hAPI,"SetDithering");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Enabled[in] Specifies whether to enable or disable ADC dithering. If this parameter is non-zero, dithering is enabled. If the parameter is zero, dithering is disabled.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetDithering function to determine the current state of ADC dithering.
Retrieves current state of ADC dithering.
C/C++ declaration
BOOL __stdcall GetDithering(INT32 hDevice,BOOL *Enabled);
Address retrieval
G39DDC_GET_DITHERING GetDithering=(G39DDC_GET_DITHERING)GetProcAddress(hAPI,"GetDithering");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Enabled[out] Pointer to a variable which receives current state of dithering. The value is non-zero if dithering is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Enables or disables the noise blanker on the ADC stream.
C/C++ declaration
BOOL __stdcall SetADCNoiseBlanker(INT32 hDevice,BOOL Enabled);
Address retrieval
G39DDC_SET_ADC_NOISE_BLANKER SetADCNoiseBlanker=(G39DDC_SET_ADC_NOISE_BLANKER)GetProcAddress(hAPI,"SetADCNoiseBlanker");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Enabled[in] Specifies whether to enable or disable the noise blanker. If this parameter is non-zero, noise blanker is enabled. If the parameter is zero, the noise blanker is disabled.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetADCNoiseBlanker function to determine the current state of the noise blanker.
Retrieves current ADC noise blanker state.
C/C++ declaration
BOOL __stdcall GetADCNoiseBlanker(INT32 hDevice,BOOL *Enabled);
Address retrieval
G39DDC_GET_ADC_NOISE_BLANKER GetADCNoiseBlanker=(G39DDC_GET_ADC_NOISE_BLANKER)GetProcAddress(hAPI,"GetADCNoiseBlanker");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Enabled[out] Pointer to a variable which receives current state of noise blanker. The value is non-zero if noise blanker is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Specifies ADC noise blanker threshold.
C/C++ declaration
BOOL __stdcall SetADCNoiseBlankerThreshold(INT32 hDevice,WORD Threshold);
Address retrieval
G39DDC_SET_ADC_NOISE_BLANKER_THRESHOLD SetADCNoiseBlankerThreshold= (G39DDC_SET_ADC_NOISE_BLANKER_THRESHOLD)GetProcAddress(hAPI,"SetADCNoiseBlankerThreshold");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Threshold[in] Specifies the maximum acceptable input signal. The maximum possible value of threshold is 32767.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetADCNoiseBlankerThreshold function to retrieve current threshold of the noise blanker.
Determines ADC noise blanker threshold.
C/C++ declaration
BOOL __stdcall GetADCNoiseBlankerThreshold(INT32 hDevice,WORD *Threshold);
Address retrieval
G39DDC_GET_ADC_NOISE_BLANKER_THRESHOLD GetADCNoiseBlankerThreshold= (G39DDC_GET_ADC_NOISE_BLANKER_THRESHOLD)GetProcAddress(hAPI,"GetADCNoiseBlankerThreshold");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Threshold[out] Pointer to a variable which receives threshold of the ADC noise blanker. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Enables or disables frequency spectrum inversion.
C/C++ declaration
BOOL __stdcall SetInverted(INT32 hDevice,BOOL Inverted);
Address retrieval
G39DDC_SET_INVERTED SetInverted=(G39DDC_SET_INVERTED)GetProcAddress(hAPI,"SetInverted");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Inverted[in] Specifies whether to enable or disable frequency spectrum inversion. If this parameter is non-zero, IF spectrum is inverted.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Retrieves current frequency spectrum inversion setting.
C/C++ declaration
BOOL __stdcall GetInverted(INT32 hDevice,BOOL *Inverted);
Address retrieval
G39DDC_GET_INVERTED GetInverted=(G39DDC_GET_INVERTED)GetProcAddress(hAPI,"GetInverted");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Inverted[out] Pointer to a variable which receives a non-zero value if the frequency spectrum inversion is enabled, and zero if the inversion is disabled. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Starts sending of IF snapshots.
C/C++ declaration
BOOL __stdcall StartIF(INT32 hDevice,WORD Period);
Address retrieval
G39DDC_START_IF StartIF=(G39DDC_START_IF)GetProcAddress(hAPI,"StartIF");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Period[in] Specifies time interval in milliseconds for how often the IF snapshots are sent to the IFCallback callback function.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The G39DDC device has to be turned on using the SetPower function before use of StartIF, otherwise the StartIF function fails.
Too low a value of the Period parameter can dramatically increase data flow through USB/PCIe, this could cause failure of active streaming.
Stops sending of IF snapshots.
C/C++ declaration
BOOL __stdcall StopIF(INT32 hDevice);
Address retrieval
G39DDC_STOP_IF StopIF=(G39DDC_STOP_IF)GetProcAddress(hAPI,"StopIF");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The IFCallback callback function is not called after StopIF returns.
Retrieves information about DDC format.
C/C++ declaration
BOOL __stdcall GetDDCInfo(UINT32 DDCTypeIndex,G39DDC_DDC_INFO *Info);
Address retrieval
G39DDC_GET_DDC_INFO GetDDCInfo=(G39DDC_GET_DDC_INFO)GetProcAddress(hAPI,"GetDDCInfo");
Parameters
DDCTypeIndex[in] Specifies the index of DDC type. For more information, see remarks.Info[out] Pointer to a G39DDC_DDC_INFO structure to be filled with information about the DDC type.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetDDC1Count function to determine the number of possible DDC types of DDC1. In this case the DDCTypeIndex parameter can vary from zero to one less than the number determined by GetDDC1Count.
Use the GetDDC2Count function to determine the number of possible DDC types of DDC2. In this case the DDCTypeIndex parameter can vary from zero to one less than the number determined by GetDDC2Count.
Use the GetDDC1 function to determine the current DDC type index of DDC1 and the GetDDC2 function to determine the current DDC type of DDC2.
Sets DDC1 mode.
C/C++ declaration
BOOL __stdcall SetDDC1Mode(INT32 hDevice,UINT32 DDC1Mode);
Address retrieval
G39DDC_SET_DDC1_MODE SetDDC1Mode=(G39DDC_SET_DDC1_MODE)GetProcAddress(hAPI,"SetDDC1Mode");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.DDC1Mode[in] Specifies DDC1 mode. The value is one of the following:
Value Meaning G39DDC_DDC1_MODE_DEFAULT Both channels 0 and 1 are fully available in this mode. DDC1 bandwidth can be specified up to 4 MHz in both channels for PCIe receivers. DDC1 bandwidth of the second channel is limited to 2 MHz for USB receivers. G39DDC_DDC1_MODE_WIDEBAND Only channel 0 is fully available in this mode. DDC1 bandwidth can be specified up to 6 MHz. DDC1, DDC2 and audio streams of the second channel cannot be started.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The function changes the number of available DDC types of the DDC1. Use the GetDDC1Count function to determine this number.
The SetDDC1Mode function stops DDC1, DDC2 and audio streams in both channels.
The SetDDC1Mode function changes DDC type of the DDC1 in channel 0 if current DDC type is not available in the new DDC1 mode. Use the GetDDC1 function to determine current DDC type index of DDC1
Use the GetDDC1Mode function to determine current DDC1 mode.
Retrieves the current DDC1 mode.
C/C++ declaration
BOOL __stdcall GetDDC1Mode(INT32 hDevice,UINT32 *DDC1Mode);
Address retrieval
G39DDC_GET_DDC1_MODE GetDDC1Mode=(G39DDC_GET_DDC1_MODE)GetProcAddress(hAPI,"GetDDC1Mode");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.DDC1Mode[out] Pointer to a variable which receives the current DDC1 mode. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Retrieves number of DDC types supported by DDC1 for the given channel.
C/C++ declaration
BOOL __stdcall GetDDC1Count(INT32 hDevice,UINT32 Channel,UINT32 *Count);
Address retrieval
G39DDC_GET_DDC1_COUNT GetDDC1Count=(G39DDC_GET_DDC1_COUNT)GetProcAddress(hAPI,"GetDDC1Count");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are 0 and 1.Count[out] Pointer to a variable which receives the number of DDC types. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The number of supported DDC types of the DDC1 in channel 0 can be changed using the SetDDC1Mode function.
Sets current DDC type of DDC1 for the given channel.
C/C++ declaration
BOOL __stdcall SetDDC1(INT32 hDevice,UINT32 Channel,UINT32 DDCTypeIndex);
Address retrieval
G39DDC_SET_DDC1 SetDDC1=(G39DDC_SET_DDC1)GetProcAddress(hAPI,"SetDDC1");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are 0 and 1.DDCTypeIndex[in] Specifies the index of DDC type to be used in DDC1.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetDDC1Count function to determine the number of possible DDC types of DDC1 for given channel. The DDCTypeIndex parameter can vary from zero to one less than the number determined by GetDDC1Count.
Number of DDC types of DDC1 for second channel (channel index 1) can be reduced. To determine number of available DDC types of DDC1 for second channel use the GetDDC1Count function with parameter Channel set to 1.
DDC1 streaming must not run when calling SetDDC1. In other words, DDC1 streaming that is started using the StartDDC1 function has to be stopped using the StopDDC1 function before calling of SetDDC1, otherwise SetDDC1 fails. The SetDDC1 function does not start and stop DDC1 streaming, just changes DDC type of DDC1.
Calling of SetDDC1 can change number of DDC types of DDC2, therefore it is useful to call the GetDDC2Count function immediately after SetDDC1.
Calling of SetDDC1 can change the current DDC type of DDC2 and current bandwidth of demodulator filter if current DDC type index of DDC2 is greater than the DDCTypeIndex parameter, so it is useful to call the GetDDC2 and GetDemodulatorFilterBandwidth functions immediately after SetDDC1 to determine current DDC type of DDC2 and current bandwidth of demodulator filter.
Use the GetDDC1 function to determine current DDC type of the DDC1.
Retrieves information about current DDC type of the DDC1 for the given channel.
C/C++ declaration
BOOL __stdcall GetDDC1(INT32 hDevice,UINT32 Channel,UINT32 *DDCTypeIndex);
Address retrieval
G39DDC_GET_DDC1 GetDDC1=(G39DDC_GET_DDC1)GetProcAddress(hAPI,"GetDDC1");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are 0 and 1.DDCTypeIndex[out] Pointer to a variable which receives the index of current DDC type of the DDC1. The received value can be passed to the GetDDCInfo function to retrieve information about current DDC type of the DDC1. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sets relative center frequency of DDC1 for the given channel.
C/C++ declaration
BOOL __stdcall SetDDC1Frequency(INT32 hDevice,UINT32 Channel,INT32 Frequency);
Address retrieval
G39DDC_SET_DDC1_FREQUENCY SetDDC1Frequency=(G39DDC_SET_DDC1_FREQUENCY)GetProcAddress(hAPI,"SetDDC1Frequency");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are 0 and 1.Frequency[in] Specifies the new center frequency of DDC1 in Hz.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The frequency is relative to the front-end frequency (see SetFrontEndFrequency), it can be negative. Usable bandwidth at the front-end output is specified by the FrontEndWindowWidth member of the G39DDC_DEVICE_INFO structure. The Frequency parameter should vary from (-(INT32)FrontEndWindowWidth/2 + half of current usable bandwidth of DDC1) to (FrontEndWindowWidth/2 - half of current usable bandwidth of DDC1). Use GetDDC1 and GetDDCInfo functions to determine the current usable bandwidth of the DDC1.
Changing of DDC1 frequency causes change of absolute frequency of the DDC2 and demodulator for the given channel.
Absolute frequency of the DDC1 is given by the following formula:
faDDC1[i] = fFE + frDDC1[i]
Where faDDC1[i] is absolute center frequency of DDC1 of i-th channel in Hz, fFE is front-end frequency in Hz (set using the SetFrontEndFrequency function) and frDDC1[i] is relative center frequency of DDC1 of i-th channel in Hz (set using SetDDC1Frequency).
Changing of DDC1 relative frequency changes absolute frequency of the DDC1 and demodulator in the specified channel.
Use the GetDDC1Frequency function to determine the current relative center frequency of the DDC1 for the given channel.
The following example shows how to set absolute DDC1 center frequency of channel 0 to 11.01 MHz:
INT32 hDevice; //Handle to G39DDC device returned by the OpenDevice function SetFrontEndFrequency(hDevice,10000000); SetDDC1Frequency(hDevice,0,1010000);
Retrieves current center frequency of DDC1 for the given channel.
C/C++ declaration
BOOL __stdcall GetDDC1Frequency(INT32 hDevice,UINT32 Channel,INT32 *Frequency);
Address retrieval
G39DDC_GET_DDC1_FREQUENCY GetDDC1Frequency=(G39DDC_GET_DDC1_FREQUENCY)GetProcAddress(hAPI,"GetDDC1Frequency");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are 0 and 1.Frequency[out] Pointer to a variable which receives the current center frequency of DDC1 in Hz. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Starts DDC1 streaming for the given channel.
C/C++ declaration
BOOL __stdcall StartDDC1(INT32 hDevice,UINT32 Channel,UINT32 SamplesPerBuffer);
Address retrieval
G39DDC_START_DDC1 StartDDC1=(G39DDC_START_DDC1)GetProcAddress(hAPI,"StartDDC1");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are 0 and 1.SamplesPerBuffer[in] Specifies number of I/Q sample sets in each buffer passed to the DDC1StreamCallback callback function. The value has to be multiple of 64 greater than zero. If it is zero, the StartDDC1 function fails. If it is not a multiple of 64, the function rounds it up to nearest multiple of 64.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The G39DDC device has to be turned on using the SetPower function before StartDDC1 is used, otherwise StartDDC1 fails.
Sweeping (see StartSweeping or StartSweepingEx) must not be running before StartDDC1 is used, otherwise StartDDC1 fails.
If the DDC1 streaming is already running before use of StartDDC1, StartDDC1 restarts the streaming except when it was previously started with the same SamplesPerBuffer parameter. In this case StartDDC1 does nothing. Restart of DDC1 streaming stops of DDC2 and audio streaming for the given channel. StartDDC1 does not restart DDC2 and audio streaming.
If DDC1 playback is running (started using StartDDC1Playback function) before use of StartDDC1, StartDDC1 stops it then starts DDC1 streaming from the device.
Use the StopDDC1 function to stop DDC1 streaming.
Decreasing the value of the SamplesPerBuffer parameter decreases latency and may increase CPU usage. Increasing the value of the SamplesPerBuffer parameter increases latency and may decrease CPU usage.
Stops DDC1 streaming for the given channel.
C/C++ declaration
BOOL __stdcall StopDDC1(INT32 hDevice,UINT32 Channel);
Address retrieval
G39DDC_STOP_DDC1 StopDDC1=(G39DDC_STOP_DDC1)GetProcAddress(hAPI,"StopDDC1");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are 0 and 1.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If DDC1 playback is running (started using StartDDC1Playback) before use of StopDDC1, the StopDDC1 function stops it.
The StopDDC1 function stops all the streaming beyond the DDC1 in the processing chain (DDC2 and audio streaming) for the specified channel. The streaming in the other channel is not affected
The DDC1StreamCallback and DDC1PlaybackStreamCallback callback functions are not called after StopDDC1 returns.
Starts DDC1 playback for the given channel. It passes previously recorded DDC1 I/Q samples to the processing chain instead of the samples received from the device.
C/C++ declaration
BOOL __stdcall StartDDC1Playback(INT32 hDevice,UINT32 Channel,UINT32 SamplesPerBuffer,UINT32 BitsPerSample);
Address retrieval
G39DDC_START_DDC1_PLAYBACK StartDDC1Playback=(G39DDC_START_DDC1_PLAYBACK)GetProcAddress(hAPI,"StartDDC1Playback");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are 0 and 1.SamplesPerBuffer[in] Specifies the number of I/Q sample sets in each buffer passed to the DDC1PlaybackStreamCallback callback to fill the buffer by the application and to the DDC1StreamCallback callback function. The value has to be multiple of 64 greater than zero. If it is zero, the StartDDC1Playback function fails. If it is not multiple of 64 the function rounds it up to nearest multiple of 64.BitsPerSample[in] Specifies the number of bits per I and Q samples. It is used for both DDC1PlaybackStreamCallback and DDC1StreamCallback callback functions. The possible value is one of the following:
Value Meaning 0 I and Q samples have default number of bits. It is given by by BitsPerSample member of the G39DDC_DDC_INFO structure which can be retrieved using the GetDDC1 and GetDDCInfo function. Possible values are 16 or 32 bits per sample, signed, little endian. 16 I and Q samples have 16 bit (16 bits per I, 16 bits per Q), signed, little endian. 32 I and Q samples have 32 bit (32 bits per I, 32 bits per Q), signed, little endian.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The G39DDC device has to be turned on using the SetPower function before use of StartDDC1Playback.
The StartDDC1Playback function stops DDC1 streaming which was previously started by the StartDDC1 or StartDDC1Playback functions and starts DDC1 playback with new parameters. Stopping DDC1 streaming stops DDC2 and audio steaming in each channel. StartDDC1Playback does not restart DDC2 and audio streaming.
Use the StopDDC1 function to stop DDC1 playback.
Pauses DDC1 playback for the given channel.
C/C++ declaration
BOOL __stdcall PauseDDC1Playback(INT32 hDevice,UINT32 Channel);
Address retrieval
G39DDC_PAUSE_DDC1_PLAYBACK PauseDDC1Playback=(G39DDC_PAUSE_DDC1_PLAYBACK)GetProcAddress(hAPI,"PauseDDC1Playback");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are 0 and 1.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If DDC1 playback is not active or it is already paused, PauseDDC1Playback does nothing.
The DDC1PlaybackStreamCallback and DDC1StreamCallback callback functions can be called once after PauseDDC1Playback returns. Then they are not called until playback is resumed using the ResumeDDC1Playback function.
Resumes paused DDC1 playback for the given channel.
C/C++ declaration
BOOL __stdcall ResumeDDC1Playback(INT32 hDevice,UINT32 Channel);
Address retrieval
G39DDC_RESUME_DDC1_PLAYBACK ResumeDDC1Playback=(G39DDC_RESUME_DDC1_PLAYBACK)GetProcAddress(hAPI,"ResumeDDC1Playback");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are 0 and 1.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If DDC1 playback is not active or it is not paused, ResumeDDC1Playback does nothing.
Retrieves number of DDC types supported by DDC2 for the given channel.
C/C++ declaration
BOOL __stdcall GetDDC2Count(INT32 hDevice,UINT32 Channel,UINT32 *Count);
Address retrieval
G39DDC_GET_DDC2_COUNT GetDDC1Count=(G39DDC_GET_DDC2_COUNT)GetProcAddress(hAPI,"GetDDC1Count");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are 0 and 1.Count[out] Pointer to a variable which receives the number of DDC types. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Each channel has its own DDC2, see the block diagram. DDC type of each DDC2 can be different. Number of DDC types of DDC2 depends on DDC1 but maximum is 13 (DDC type index 12). If DDC type index of DDC1 is below 12, maximum of DDC types supported by DDC2 is DDC type index of DDC1 + 1. Changing of DDC type of DDC1 can cause change of DDC type of DDC2 and number of DDC types of DDC2, so it is useful to call GetDDC2 immediately after the SetDDC1 function to determine the current DDC type of DDC2 if the application needs to know parameters of DDC2.
The BitsPerSample member of the G39DDC_DDC_INFO structure is not used and it can be ignored for DDC2. I and Q samples in buffers passed to the DDC2StreamCallback and DDC2PreprocessedStreamCallback DDC2 callback functions are always in IEEE float (32 bit, little endian) format.
Sets current DDC type of DDC2 for the given channel.
C/C++ declaration
BOOL __stdcall SetDDC2(INT32 hDevice,UINT32 Channel,UINT32 DDCTypeIndex);
Address retrieval
G39DDC_SET_DDC2 SetDDC2=(G39DDC_SET_DDC2)GetProcAddress(hAPI,"SetDDC2");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are 0 and 1.DDCTypeIndex[in] Specifies index of DDC type to be used in DDC2.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetDDC2Count function to determine the number of possible DDC types of DDC2 for the given channel. The DDCTypeIndex parameter can vary from zero to one less than the number determined by GetDDC2Count.
DDC2 streaming must not run when calling SetDDC2. In other words, DDC2 streaming that is started using the StartDDC2 function has to be stopped using the StopDDC2 function before calling of SetDDC2, otherwise SetDDC2 fails. The SetDDC2 function does not start and stop DDC2 streaming, just changes DDC type of DDC2.
Calling of SetDDC2 can change the current bandwidth of demodulator filter, therefore it is useful to call the GetDemodulatorFilterBandwidth functions immediately after SetDDC2 to determine current bandwidth of demodulator filter.
Use the GetDDC2 function to determine the current DDC type of the DDC2.
Retrieves information about current DDC type of the DDC2 for the given channel.
C/C++ declaration
BOOL __stdcall GetDDC2(INT32 hDevice,UINT32 Channel,UINT32 *DDCTypeIndex);
Address retrieval
G39DDC_GET_DDC2 GetDDC2=(G39DDC_GET_DDC2)GetProcAddress(hAPI,"GetDDC2");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.DDCTypeIndex[out] Pointer to a variable which receives index of current DDC type of the DDC2. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Each channel has its own DDC2, see the block diagram. DDC type of DDC2 in each channel can be different. Number of provided DDC types for DDC2 depends on current DDC type of DDC1. Maximum number of DDC types for DDC2 is 13, maximum DDC type index for DDC2 is 12.
Chanding DDC type index of DDC1 (using the SetDDC1 function can cause change of number of supported DDC types and current DDC type index for DDC2. Therefore it is useful to call GetDDC2 and GetDDCInfo immediately after the SetDDC1 function.
Returned DDCTypeIndex can be passed to the GetDDCInfo function. The BitsPerSample member of the G39DDC_DDC_INFO structure is not used and it can be ignored for DDC2. I and Q samples in buffers passed to the DDC2StreamCallback and DDC2PreprocessedStreamCallback DDC2 callback functions are always in IEEE float (32 bit, little endian) format.
Sets relative center frequency of DDC2 for the given channel.
C/C++ declaration
BOOL __stdcall SetDDC2Frequency(INT32 hDevice,UINT32 Channel,INT32 Frequency);
Address retrieval
G39DDC_SET_DDC2_FREQUENCY SetDDC2Frequency=(G39DDC_SET_DDC2_FREQUENCY)GetProcAddress(hAPI,"SetDDC2Frequency");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Frequency[in] Specifies new center frequency of DDC2 in Hz.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Value of the Frequency parameter is center frequency of the DDC2 relative to center of the DDC1. The value can be negative.
Absolute frequency of the DDC2 is given by the following formula:
faDDC2[i] = fFE + frDDC1[i] + frDDC2[i]
Where faDDC2[i] is absolute center frequency of DDC2 of i-th channel in Hz, fFE is front-end frequency (see SetFrontEndFrequency), fDDC1[i] is relative center frequency of the DDC1 in Hz (set using the SetDDC1Frequency function) and frDDC2[i] is relative center frequency of DDC2 of i-th channel in Hz (set using SetDDC2Frequency).
Changing of DDC2 relative frequency changes the absolute frequency of the DDC2 and demodulator in the specified channel.
Use the GetDDC2Frequency function to determine the current relative center frequency of the DDC2 for given channel.
The following example shows how it is possible to set the absolute DDC2 center frequency of channel 0 to 11.01 MHz:
INT32 hDevice; //Handle to G39DDC device returned by the OpenDevice function //1. method SetFrontEndFrequency(hDevice,10000000); SetDDC1Frequency(hDevice,0,1000000); SetDDC2Frequency(hDevice,0,10000); //2. method SetFrontEndFrequency(hDevice,10000000); SetDDC1Frequency(hDevice,0,1010000); SetDDC2Frequency(hDevice,0,0); //2. method SetFrontEndFrequency(hDevice,10000000); SetDDC1Frequency(hDevice,0,1020000); SetDDC2Frequency(hDevice,0,-10000);
Retrieves current relative center frequency of DDC2.
C/C++ declaration
BOOL __stdcall GetDDC2Frequency(INT32 hDevice,UINT32 Channel,INT32 *Frequency);
Address retrieval
G39DDC_GET_DDC2_FREQUENCY GetDDC2Frequency=(G39DDC_GET_DDC2_FREQUENCY)GetProcAddress(hAPI,"GetDDC2Frequency");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Frequency[out] Pointer to a variable which receives current relative center frequency of DDC2 in Hz. The returned value can be negative. See remarks of the SetDDC2Frequency for information on how to calculate the absolute center frequency of DDC2. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Starts DDC2 streaming for the given channel.
C/C++ declaration
BOOL __stdcall StartDDC2(INT32 hDevice,UINT32 Channel,UINT32 SamplesPerBuffer);
Address retrieval
G39DDC_START_DDC2 StartDDC2=(G39DDC_START_DDC2)GetProcAddress(hAPI,"StartDDC2");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.SamplesPerBuffer[in] Specifies the number of I/Q sample sets in each buffer passed to the DDC2StreamCallback and DDC2PreprocessedStreamCallback callback functions. The value has to be multiple of 64 greater than zero. If it is zero, the StartDDC2 function fails. If it is not multiple of 64, the function rounds it up to nearest multiple of 64.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Before StartDDC2 is used, the G39DDC device has to be turned on using the SetPower function and DDC1 streaming has to be started using the StartDDC1 or StartDDC1Playback function, otherwise StartDDC2 fails.
If the DDC2 streaming for the given channel is already running, StartDDC2 restarts it except when the streaming was previously started with the same SamplesPerBuffer parameter. In this case StartDDC2 does nothing. Restart of the DDC2 streaming stops audio streaming for the given channel. StartDDC2 does not restart audio streaming.
Use the StopDDC2 function to stop DDC2 streaming.
Decreasing the value of the SamplesPerBuffer parameter decreases latency and it may increase CPU usage. Increasing the value of the SamplesPerBuffer parameter increases latency and may decrease CPU usage.
Stops DDC2 streaming for the given channel.
C/C++ declaration
BOOL __stdcall StopDDC2(INT32 hDevice,UINT32 Channel);
Address retrieval
G39DDC_STOP_DDC2 StopDDC2=(G39DDC_STOP_DDC2)GetProcAddress(hAPI,"StopDDC2");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If audio streaming for the given channel is running, it is stopped too.
If DDC2 streaming is not active, StopDDC2 does nothing.
The DDC2StreamCallback and DDC2PreprocessedStreamCallback callback functions are not called after StopDDC2 returns.
Enables or disables noise blanker on DDC2 stream for the given channel.
C/C++ declaration
BOOL __stdcall SetDDC2NoiseBlanker(INT32 hDevice,UINT32 Channel,BOOL Enabled);
Address retrieval
G39DDC_SET_DDC2_NOISE_BLANKER SetDDC2NoiseBlanker=(G39DDC_SET_DDC2_NOISE_BLANKER)GetProcAddress(hAPI,"SetDDC2NoiseBlanker");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Enabled[in] Specifies whether to enable or disable noise blanker. If this parameter is non-zero, the noise blanker is enabled. If the parameter is zero, the noise blanker is disabled.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetDDC2NoiseBlanker function to determine the current state of the noise blanker.
Retrieves current DDC2 noise blanker state of the given channel.
C/C++ declaration
BOOL __stdcall GetDDC2NoiseBlanker(INT32 hDevice,UINT32 Channel,BOOL *Enabled);
Address retrieval
G39DDC_GET_DDC2_NOISE_BLANKER GetDDC2NoiseBlanker=(G39DDC_GET_DDC2_NOISE_BLANKER)GetProcAddress(hAPI,"GetDDC2NoiseBlanker");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Enabled[out] Pointer to a variable which receives the current state of the noise blanker. The value is non-zero if noise blanker is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Specifies DDC2 noise blanker threshold for the given channel.
C/C++ declaration
BOOL __stdcall SetDDC2NoiseBlankerThreshold(INT32 hDevice,UINT32 Channel,double Threshold);
Address retrieval
G39DDC_SET_DDC2_NOISE_BLANKER_THRESHOLD SetDDC2NoiseBlankerThreshold= (G39DDC_SET_DDC2_NOISE_BLANKER_THRESHOLD)GetProcAddress(hAPI,"SetDDC2NoiseBlankerThreshold");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Threshold[in] Specifies threshold in %.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetDDC2NoiseBlankerThreshold function to retrieve the current threshold of the noise blanker.
Retrieves DDC2 noise blanker threshold of the given channel.
C/C++ declaration
BOOL __stdcall GetDDC2NoiseBlankerThreshold(INT32 hDevice,UINT32 Channel,double *Threshold);
Address retrieval
G39DDC_GET_DDC2_NOISE_BLANKER_THRESHOLD GetDDC2NoiseBlankerThreshold= (G39DDC_GET_DDC2_NOISE_BLANKER_THRESHOLD)GetProcAddress(hAPI,"GetDDC2NoiseBlankerThreshold");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Threshold[out] Pointer to a variable which receives the threshold of the noise blanker. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Determines value which indicates percentage ratio between the short time average signal level and maximum level.
C/C++ declaration
BOOL __stdcall GetDDC2NoiseBlankerExcessValue(INT32 hDevice,UINT32 Channel,double *Value);
Address retrieval
G39DDC_GET_DDC2_NOISE_BLANKER_EXCESS_VALUE GetDDC2NoiseBlankerExcessValue= (G39DDC_GET_DDC2_NOISE_BLANKER_EXCESS_VALUE)GetProcAddress(hAPI,"GetDDC2NoiseBlankerExcessValue");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Value[out] Pointer to a variable which receives current excess value in %. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Determines current signal level for the given channel.
C/C++ declaration
BOOL __stdcall GetSignalLevel(INT32 hDevice,UINT32 Channel,FLOAT *Peak,FLOAT *RMS);
Address retrieval
G39DDC_GET_SIGNAL_LEVEL GetSignalLevel=(G39DDC_GET_SIGNAL_LEVEL)GetProcAddress(hAPI,"GetSignalLevel");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Peak[out] Pointer to a variable which receives the current signal level (peak) in Volts. This parameter can be NULL if the application does not require this information.RMS[out] Pointer to a variable which receives the current signal level (RMS) in Volts. This parameter can be NULL if the application does not require this information.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
DDC2 streaming has to be active (started using the StartDDC2 function) before calling GetSignalLevel, otherwise the returned peak and RMS signal levels are zero.
Signal level is evaluated from the signal after the demodulator filter and before the notch filter (see block diagram), the signal is selected by the demodulator filter.
Signal level is evaluated for each buffer processed by the demoduletor filter. Buffer size (signal level evaluation rate) is given by the SamplesPerBuffer parameter of the StartDDC2 function.
The DDC2PreprocessedStreamCallback callback function provides signal level for each buffer passed by the callback, i.e. for each buffer used in signal level evaluation. This provides a way to get the signal level from each processed buffer without the need for pulling it using GetSignalLevel.
To convert RMS signal level in Volts to power in dBm use the following formulas:
P[W] = (VRMS)2 / R = (VRMS)2 / 50
P[dBm]= 10 * log10( P[W] * 1000 )
Where VRMS is RMS signal level in Volts obtained by GetSignalLevel, R is G39DDC receiver input impedance (50 Ω), P[W] is power in Watts, P[dBm] is power in dBm and 1000 is conversion coefficient W -> mW.
The following example shows how to obtain current signal level in dBm from channel 0:
#include <stdio.h> #include <math.h> INT32 hDevice; //handle to G39DDC device returned by the OpenDevice function float P_dBm,V_RMS; GetSignalLevel(hDevice,0,NULL,&V_RMS); P_dBm=10.0*log10(V_RMS*V_RMS*(1000.0/50.0)); printf("Current signal level [RMS]: %.1f dBm\n",P_dBm);
Enables or disables notch filter for the given channel.
C/C++ declaration
BOOL __stdcall SetNotchFilter(INT32 hDevice,UINT32 Channel,UINT32 NotchFilterIndex,BOOL Enabled);
Address retrieval
G39DDC_SET_NOTCH_FILTER SetNotchFilter=(G39DDC_SET_NOTCH_FILTER)GetProcAddress(hAPI,"SetNotchFilter");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Enabled[in] Specifies whether to enable or disable the notch filter. If this parameter is non-zero, the filter is enabled. If the parameter is zero, the filter is disabled.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetNotchFilter function to determine whether the filter is enabled or disabled.
Retrieves current notch filter state for the given channel.
C/C++ declaration
BOOL __stdcall GetNotchFilter(INT32 hDevice,UINT32 Channel,UINT32 NotchFilterIndex,BOOL *Enabled);
Address retrieval
G39DDC_GET_NOTCH_FILTER GetNotchFilter=(G39DDC_GET_NOTCH_FILTER)GetProcAddress(hAPI,"GetNotchFilter");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Enabled[out] Pointer to a variable which receives the current state of the notch filter. The value is non-zero if the filter is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Specifies relative center frequency of the notch filter for the given channel.
C/C++ declaration
BOOL __stdcall SetNotchFilterFrequency(INT32 hDevice,UINT32 Channel,UINT32 NotchFilterIndex,INT32 Frequency);
Address retrieval
G39DDC_SET_NOTCH_FILTER_FREQUENCY SetNotchFilterFrequency= (G39DDC_SET_NOTCH_FILTER_FREQUENCY)GetProcAddress(hAPI,"SetNotchFilterFrequency");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Frequency[in] Specifies the new center frequency of the notch filter in Hz.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Value of the Frequency parameter is the new center frequency of the notch filter relative to center of DDC2 (see the SetDDC2Frequency function). The value can be negative.
Use the GetNotchFilterFrequency function to retrieve the current center frequency of the notch filter.
Retrieves current relative center frequency of the notch filter.
C/C++ declaration
BOOL __stdcall GetNotchFilterFrequency(INT32 hDevice,UINT32 Channel,UINT32 NotchFilterIndex,INT32 *Frequency);
Address retrieval
G39DDC_GET_NOTCH_FILTER_FREQUENCY GetNotchFilterFrequency= (G39DDC_GET_NOTCH_FILTER_FREQUENCY)GetProcAddress(hAPI,"GetNotchFilterFrequency");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Frequency[out] Pointer to a variable which receives the current center frequency of the notch filter. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Specifies bandwidth of the notch filter for the given channel.
C/C++ declaration
BOOL __stdcall SetNotchFilterBandwidth(INT32 hDevice,UINT32 Channel,UINT32 NotchFilterIndex,UINT32 Bandwidth);
Address retrieval
G39DDC_SET_NOTCH_FILTER_BANDWIDTH SetNotchFilterBandwidth= (G39DDC_SET_NOTCH_FILTER_BANDWIDTH)GetProcAddress(hAPI,"SetNotchFilterBandwidth");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Bandwidth[in] Specifies the new bandwidth of the notch filter in Hz. The bandwidth can be from range 1 - 3000 Hz.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetNotchFilterBandwidth function to retrieve the current bandwidth of the notch filter.
Retrieves current bandwidth of the notch filter for the given channel.
C/C++ declaration
BOOL __stdcall GetNotchFilterBandwidth(INT32 hDevice,UINT32 Channel,UINT32 NotchFilterIndex,UINT32 *Bandwidth);
Address retrieval
G39DDC_GET_NOTCH_FILTER_BANDWIDTH GetNotchFilterBandwidth= (G39DDC_GET_NOTCH_FILTER_BANDWIDTH)GetProcAddress(hAPI,"GetNotchFilterBandwidth");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Bandwidth[out] Pointer to a variable which receives the current bandwidth of the notch filter. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Specifies notch filter length for the given channel. The notch filter is implemented as FIR filter. This function specifies number of coefficients used in filtration procedure.
C/C++ declaration
BOOL __stdcall SetNotchFilterLength(INT32 hDevice,UINT32 Channel,UINT32 NotchFilterIndex,UINT32 Length);
Address retrieval
G39DDC_SET_NOTCH_FILTER_LENGTH SetNotchFilterLength= (G39DDC_SET_NOTCH_FILTER_LENGTH)GetProcAddress(hAPI,"SetNotchFilterLength");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Length[in] Specifies the length of the notch filter. The value has to be multiple of 64, greater than or equal to 64 and less than or equal to 32768. If it is not multiple of 64, the function rounds it up to nearest multiple of 64.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Increasing the filter length increases filter steepness and it may increase CPU usage.
Use the GetNotchFilterLength function to determine the current length of the notch filter.
Retrieves current notch filter length for the given channel.
C/C++ declaration
BOOL __stdcall GetNotchFilterLength(INT32 hDevice,UINT32 Channel,UINT32 NotchFilterIndex,UINT32 *Length);
Address retrieval
G39DDC_GET_NOTCH_FILTER_LENGTH GetNotchFilterLength= (G39DDC_GET_NOTCH_FILTER_LENGTH)GetProcAddress(hAPI,"GetNotchFilterLength");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Length[out] Pointer to a variable which receives the current length of the notch filter. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Enables or disables AGC for the given channel.
C/C++ declaration
BOOL __stdcall SetAGC(INT32 hDevice,UINT32 Channel,BOOL Enabled);
Address retrieval
G39DDC_SET_AGC SetAGC=(G39DDC_SET_AGC)GetProcAddress(hAPI,"SetAGC");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Enabled[in] Specifies whether to enable or disable the AGC. If this parameter is non-zero, the AGC is enabled. If the parameter is zero, the AGC is disabled.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If the AGC is disabled, the signal is affected by fixed gain specified using the SetGain function.
Use the GetAGC function to determine the current state of the AGC.
Retrieves current state of the AGC for the given channel.
C/C++ declaration
BOOL __stdcall GetAGC(INT32 hDevice,UINT32 Channel,BOOL *Enabled);
Address retrieval
G39DDC_GET_AGC GetAGC=(G39DDC_GET_AGC)GetProcAddress(hAPI,"GetAGC");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Enabled[out] Pointer to a variable which receives the current state of the AGC. The value is non-zero if the AGC is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sets parameters of the AGC for the given channel.
C/C++ declaration
BOOL __stdcall SetAGCParams(INT32 hDevice,UINT32 Channel,double AttackTime,double DecayTime,double ReferenceLevel);
Address retrieval
G39DDC_SET_AGC_PARAMS SetAGCParams=(G39DDC_SET_AGC_PARAMS)GetProcAddress(hAPI,"SetAGCParams");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.AttackTime[in] Specifies the new attack time of the AGC in seconds.DecayTime[in] Specifies the new decay time of the AGC in seconds.ReferenceLevel[in] Specifies the new reference level of the AGC in dB.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetAGCParams function to determine the current parameters of the AGC.
Retrieves current parameters of the AGC for the given channel.
C/C++ declaration
BOOL __stdcall GetAGCParams(INT32 hDevice,UINT32 Channel,double *AttackTime,double *DecayTime,double *ReferenceLevel);
Address retrieval
G39DDC_GET_AGC_PARAMS GetAGCParams=(G39DDC_GET_AGC_PARAMS)GetProcAddress(hAPI,"GetAGCParams");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.AttackTime[out] Pointer to a variable which receives the current attack time of the AGC in seconds. This parameter can be NULL if the application does not require this information.DecayTime[out] Pointer to a variable which receives the current decay time of the AGC in seconds. This parameter can be NULL if the application does not require this information.ReferenceLevel[out] Pointer to a variable which receives the current reference level of the AGC in dB. This parameter can be NULL if the application does not require this information.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sets maximum gain of the AGC for the given channel.
C/C++ declaration
BOOL __stdcall SetMaxAGCGain(INT32 hDevice,UINT32 Channel,double MaxGain);
Address retrieval
G39DDC_SET_MAX_AGC_GAIN SetMaxAGCGain=(G39DDC_SET_MAX_AGC_GAIN)GetProcAddress(hAPI,"SetMaxAGCGain");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.MaxGain[in] Specifies the new maximum gain of the AGC in dB.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetMaxAGCGain function to determine the maximum gain of the AGC.
Retrieves current maximum gain of the AGC for the given channel.
C/C++ declaration
BOOL __stdcall GetMaxAGCGain(INT32 hDevice,UINT32 Channel,double *MaxGain);
Address retrieval
G39DDC_GET_MAX_AGC_GAIN GetMaxAGCGain=(G39DDC_GET_MAX_AGC_GAIN)GetProcAddress(hAPI,"GetMaxAGCGain");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.MaxGain[out] Pointer to a variable which receives the current maximum gain of the AGC in dB. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sets fixed gain for the given channel. This gain is applied to the I/Q signal if the AGC is disabled, otherwise it is not used.
C/C++ declaration
BOOL __stdcall SetGain(INT32 hDevice,UINT32 Channel,double Gain);
Address retrieval
G39DDC_SET_GAIN SetGain=(G39DDC_SET_GAIN)GetProcAddress(hAPI,"SetGain");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Gain[in] Specifies the new fixed gain in dB.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetGain function to determine the current fixed gain.
Retrieves the current fixed gain for the given channel.
C/C++ declaration
BOOL __stdcall GetGain(INT32 hDevice,UINT32 Channel,double *Gain);
Address retrieval
G39DDC_GET_GAIN GetGain=(G39DDC_GET_GAIN)GetProcAddress(hAPI,"GetGain");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Gain[out] Pointer to a variable which receives the current fixed gain in dB. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Retrieves current gain that is applied to I/Q signal.
C/C++ declaration
BOOL __stdcall GetCurrentGain(INT32 hDevice,UINT32 Channel,double *CurrentGain);
Address retrieval
G39DDC_GET_CURRENT_GAIN GetCurrentGain=(G39DDC_GET_CURRENT_GAIN)GetProcAddress(hAPI,"GetCurrentGain");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.CurrentGain[out] Pointer to a variable which receives the current gain in dB. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If the AGC is enabled (using the SetAGC function), the variable pointed to by the CurrentGain parameter is filled by the current gain of the AGC. If the AGC is disabled, the variable pointed to by the CurrentGain parameter is filled by fixed gain that is specified using the SetGain function.
Sets bandwidth of the demodulator filter for given channel.
C/C++ declaration
BOOL __stdcall SetDemodulatorFilterBandwidth(INT32 hDevice,UINT32 Channel,UINT32 Bandwidth);
Address retrieval
G39DDC_SET_DEMODULATOR_FILTER_BANDWIDTH SetDemodulatorFilterBandwidth= (G39DDC_SET_DEMODULATOR_FILTER_BANDWIDTH)GetProcAddress(hAPI,"SetDemodulatorFilterBandwidth");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Bandwidth[in] Specifies the new bandwidth of the demodulator filter in Hz. Possible values are from range 1 Hz to current DDC2 bandwidth. Use the GetDDC2 and GetDDCInfo functions to retrieve information about the current DDC type of DDC2.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The demodulator filter bandwidth can be changed using the SetDDC1 function. It can change DDC type of DDC2 and if the current demodulator filter bandwidth is greater than the new bandwidth of DDC2, the demodulator filter bandwidth is reduced. So it is useful to call the GetDemodulatorFilterBandwidth function immediately after SetDDC1 and SetDDC2 functions.
Retrieves the current demodulator filter bandwidth for the given channel.
C/C++ declaration
BOOL __stdcall GetDemodulatorFilterBandwidth(INT32 hDevice,UINT32 Channel,UINT32 *Bandwidth);
Address retrieval
G39DDC_GET_DEMODULATOR_FILTER_BANDWIDTH GetDemodulatorFilterBandwidth= (G39DDC_GET_DEMODULATOR_FILTER_BANDWIDTH)GetProcAddress(hAPI,"GetDemodulatorFilterBandwidth");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Bandwidth[out] Pointer to a variable which receives the current demodulator filter bandwidth. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sets demodulator filter shift for the given channel.
C/C++ declaration
BOOL __stdcall SetDemodulatorFilterShift(INT32 hDevice,UINT32 Channel,INT32 Shift);
Address retrieval
G39DDC_SET_DEMODULATOR_FILTER_SHIFT SetDemodulatorFilterShift= (G39DDC_SET_DEMODULATOR_FILTER_SHIFT)GetProcAddress(hAPI,"SetDemodulatorFilterShift");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Shift[in] Specifies the new shift of the demodulator filter in Hz.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Value of the Shift parameter is shift in Hz relative to center of the demodulator. This value can be negative.
This function does not change demodulator frequency, just shifts the filter from the demodulator's centre.
Use the GetDemodulatorFilterShift function to determine the current demodulator filter shift.
Retrieves current shift of the demodulator filter for the given channel.
C/C++ declaration
BOOL __stdcall GetDemodulatorFilterShift(INT32 hDevice,UINT32 Channel,INT32 *Shift);
Address retrieval
G39DDC_GET_DEMODULATOR_FILTER_SHIFT GetDemodulatorFilterShift= (G39DDC_GET_DEMODULATOR_FILTER_SHIFT)GetProcAddress(hAPI,"GetDemodulatorFilterShift");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Shift[out] Pointer to a variable which receives the current shift of the demodulator. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Specifies demodulator filter length for the given channel. The demodulator filter is implemented as an FIR filter. This function specifies the number of coefficients used in the filtration procedure.
C/C++ declaration
BOOL __stdcall SetDemodulatorFilterLength(INT32 hDevice,UINT32 Channel,UINT32 Length);
Address retrieval
G39DDC_SET_DEMODULATOR_FILTER_LENGTH SetDemodulatorFilterLength= (G39DDC_SET_DEMODULATOR_FILTER_LENGTH)GetProcAddress(hAPI,"SetDemodulatorFilterLength");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Length[in] Specifies the length of the demodulator filter. The value has to be multiple of 64, greater than or equal to 64 and less than or equal to 32768. If it is not multiple of 64, the function rounds it up to nearest multiple of 64..
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Increasing the filter length increases filter steepness and may increase CPU usage.
Use the GetDemodulatorFilterLength function to determine the current length of the demodulator filter.
Retrieves the current length of the demodulator filter for the given channel.
C/C++ declaration
BOOL __stdcall GetDemodulatorFilterLength(INT32 hDevice,UINT32 Channel,UINT32 *Length);
Address retrieval
G39DDC_GET_DEMODULATOR_FILTER_LENGTH GetDemodulatorFilterLength= (G39DDC_GET_DEMODULATOR_FILTER_LENGTH)GetProcAddress(hAPI,"GetDemodulatorFilterLength");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Length[out] Pointer to a variable which receives the current demodulator filter length. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sets demodulator mode for the given channel.
C/C++ declaration
BOOL __stdcall SetDemodulatorMode(INT32 hDevice,UINT32 Channel,UINT32 Mode);
Address retrieval
G39DDC_SET_DEMODULATOR_MODE SetDemodulatorMode=(G39DDC_SET_DEMODULATOR_MODE)GetProcAddress(hAPI,"SetDemodulatorMode");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Mode[in] Specifies the new demodulator mode. This value can be one of the following:
Value Meaning G39DDC_MODE_CW Continuous wave G39DDC_MODE_AM Amplitude modulation G39DDC_MODE_FM Frequency modulation G39DDC_MODE_FMW Wide-band frequency modulation. G39DDC_MODE_LSB Lower sideband modulation G39DDC_MODE_USB Upper sideband modulation G39DDC_MODE_AMS Amplitude modulation G39DDC_MODE_DSB Double sideband modulation G39DDC_MODE_ISB Independent sideband modulation G39DDC_MODE_DRM Digital Radio Mondiale
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
DRM demodulation is only available if a valid DRM key is loaded using the SetDRMKey function. More information about obtaining a DRM key is available at https://www.winradio.com/home/drm.htm.
The difference between FM and FMW modes is that the FMW demodulator provides stereo decoding and is suitable for FM broadcasting. FMW mode is available only if DDC type index of DDC2 is 7 (bandwidth = 100 kHz, sample rate = 125 kHz) or above. SetDemodulatorMode fails trying to set FMW mode if the DDC type index of DDC2 is less than 7. If the current demodulator mode is FMW and DDC type index of DDC2 is changed to a value below 7 (using SetDDC2 or SetDDC1 function), the mode is changed to FM.
Use the GetDemodulatorMode function to retrieve the current demodulator mode.
Retrieves current demodulator mode for the given channel.
C/C++ declaration
BOOL __stdcall GetDemodulatorMode(INT32 hDevice,UINT32 Channel,UINT32 *Mode);
Address retrieval
G39DDC_GET_DEMODULATOR_MODE GetDemodulatorMode=(G39DDC_GET_DEMODULATOR_MODE)GetProcAddress(hAPI,"GetDemodulatorMode");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Mode[out] Pointer to a variable which receives the current demodulator mode. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sets relative center frequency of the demodulator for the given channel.
C/C++ declaration
BOOL __stdcall SetDemodulatorFrequency(INT32 hDevice,UINT32 Channel,INT32 Frequency);
Address retrieval
G39DDC_SET_DEMODULATOR_FREQUENCY SetDemodulatorFrequency= (G39DDC_SET_DEMODULATOR_FREQUENCY)GetProcAddress(hAPI,"SetDemodulatorFrequency");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Frequency[in] Specifies the new center frequency of the demodulator in Hz.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Value of the Frequency parameter is the center frequency of the demodulator relative to the center of the DDC2. The value can be negative.
Absolute frequency of the demodulator is given by the following formula:
faDEM[i] = fFE + frDDC1[i] + frDDC2[i] + frDEM[i]
Where faDEM[i] is absolute center frequency of the demodulator of i-th channel in Hz, fFE is front-end frequency (see SetFrontEndFrequency), frDDC1[i] is relative center frequency of the DDC1 in Hz (set using the SetDDC1Frequency function), frDDC2[i] is relative center frequency of DDC2 of i-th channel in Hz (set using the SetDDC2Frequency) and frDEM[i] is relative center frequency of the demodulator of i-th channel in Hz (set using SetDemodulatorFrequency).
Absolute center frequency of the demodulator is the real-world frequency which you are listening to.
Use the GetDemodulatorFrequency function to determine the current relative center frequency of the demodulator for the given channel.
The following example shows four methods to set the absolute demodulator center frequency of channel 0 to 11.01 MHz:
INT32 hDevice; //Handle to G39DDC device returned by the OpenDevice function //1. method SetFrontEndFrequency(hDevice,10000000); SetDDC1Frequency(hDevice,0,1010000); SetDDC2Frequency(hDevice,0,0); SetDemodulatorFrequency(hDevice,0,0); //2. method SetFrontEndFrequency(hDevice,10000000); SetDDC1Frequency(hDevice,0,1000000); SetDDC2Frequency(hDevice,0,10000); SetDemodulatorFrequency(hDevice,0,0); //3. method SetFrontEndFrequency(hDevice,10000000); SetDDC1Frequency(hDevice,0,1000000); SetDDC2Frequency(hDevice,0,20000); SetDemodulatorFrequency(hDevice,0,-10000); //4. method SetFrequency(hDevice,11010000);
Retrieves the current relative center frequency of the demodulator for the given channel.
C/C++ declaration
BOOL __stdcall GetDemodulatorFrequency(INT32 hDevice,UINT32 Channel,INT32 *Frequency);
Address retrieval
G39DDC_GET_DEMODULATOR_FREQUENCY GetDemodulatorFrequency= (G39DDC_GET_DEMODULATOR_FREQUENCY)GetProcAddress(hAPI,"GetDemodulatorFrequency");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Frequency[out] Pointer to a variable which receives the current center frequency of the demodulator. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sets a parameter of the demodulation for the given channel.
C/C++ declaration
BOOL __stdcall SetDemodulatorParam(INT32 hDevice,UINT32 Channel,UINT32 Code,CONST VOID *Buffer,UINT32 BufferSize);
Address retrieval
G39DDC_SET_DEMODULATOR_PARAM SetDemodulatorParam= (G39DDC_SET_DEMODULATOR_PARAM)GetProcAddress(hAPI,"SetDemodulatorParam");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Code[in] Specifies the code of the demodulator parameter to be set by the function. The code can be one of the following:
Value Meaning G39DDC_DEMODULATOR_PARAM_AMS_SIDE_BAND Side band for synchronous AM demodulation.
The Buffer parameter has to be pointer to an UINT32 variable, and the BufferSize parameter has to be sizeof(UINT32).
Value of the variable pointed to by the Buffer parameter can be one of the following:
G39DDC_SIDE_BAND_LOWER
AMS demodulator will use lower sidebandG39DDC_SIDE_BAND_UPPER
AMS demodulator will use upper sidebandG39DDC_SIDE_BAND_BOTH
AMS demodulator will use both side bands.G39DDC_DEMODULATOR_PARAM_AMS_CAPTURE_RANGE Capture range of synchronous AM demodulator.
The Buffer parameter has to be pointer to a G39DDC_AMS_CAPTURE_RANGE structure, and the BufferSize parameter has to be sizeof(G39DDC_AMS_CAPTURE_RANGE).
G39DDC_DEMODULATOR_PARAM_CW_FREQUENCY CW tone frequency
The Buffer parameter has to be pointer to a INT32 variable, and the BufferSize parameter has to be sizeof(INT32).
Value of the variable pointed to by the Buffer parameter is CW tone frequency in Hz.
G39DDC_DEMODULATOR_PARAM_DSB_SIDE_BAND Side band for DSB demodulation.
The Buffer parameter has to be pointer to an UINT32 variable, and the BufferSize parameter has to be sizeof(UINT32).
Value of the variable pointed to by the Buffer parameter can be one of the following:
G39DDC_SIDE_BAND_LOWER
DSB demodulator will use lower sidebandG39DDC_SIDE_BAND_UPPER
DSB demodulator will use upper sidebandG39DDC_SIDE_BAND_BOTH
DSB demodulator will use both side bands.G39DDC_DEMODULATOR_PARAM_ISB_SIDE_BAND Side band for ISB demodulation.
The Buffer parameter has to be pointer to an UINT32 variable, and the BufferSize parameter has to be sizeof(UINT32).
Value of the variable pointed to by the Buffer parameter can be one of the following:
G39DDC_SIDE_BAND_LOWER
ISB demodulator will use lower sidebandG39DDC_SIDE_BAND_UPPER
ISB demodulator will use upper sidebandG39DDC_SIDE_BAND_BOTH
ISB demodulator will use both side bands.G39DDC_DEMODULATOR_PARAM_DRM_AUDIO_SERVICE Audio service of DRM demodulator/decoder to be listening to.
The Buffer parameter has to be pointer to an UINT32 variable, and the BufferSize parameter has to be sizeof(UINT32).
Value of the variable pointed to by the Buffer parameter is index of the audio service. Possible value are: 1, 2, 3, 4, where 1 is the first audio service, 2 is the second one, etc. Use the GetDemodulatorState function with G39DDC_DEMODULATOR_STATE_DRM_STATUS to retrieve information about available audio services for currently received DRM station.
G39DDC_DEMODULATOR_PARAM_DRM_MULTIMEDIA_SERVICE Multimedia service of DRM demodulator/decoder to be decoded.
The Buffer parameter has to be pointer to an UINT32 variable, and the BufferSize parameter has to be sizeof(UINT32).
Value of the variable pointed to by the Buffer parameter is index of the multimedia service. Possible value are: 1, 2, 3, 4, where 1 is the first multimedia service, 2 is the second one, etc. Use the GetDemodulatorState function with G39DDC_DEMODULATOR_STATE_DRM_STATUS to retrieve information about available multimedia services for currently received DRM station.
It is required that a DRM multimedia player has to be installed to display multimedia content. It is included in G39DDC software installer as an option.
G39DDC_DEMODULATOR_PARAM_FMW_STEREO Stereo switch of FMW demodulator
The Buffer parameter has to be pointer to a BOOL variable, and the BufferSize parameter has to be sizeof(BOOL).
Value of the variable pointed to by the Buffer parameter is non-zero to enable stereo decoder, zero to disable stereo decoder.
G39DDC_DEMODULATOR_PARAM_FMW_DEEMPHASIS De-emphasis (FMW demodulator)
The Buffer parameter has to be pointer to a UINT32 variable, and the BufferSize parameter has to be sizeof(UINT32).
Value of the variable pointed to by the Buffer parameter is de-emphasis at demodulator audio output in µs. In North America it is 75 µs, while most of the rest of the world uses 50 µs. If it is zero, the de-emphasis is disabled.
Buffer[in] Pointer to a buffer containing the value of the demodulator parameter which the function will set. This parameter cannot be NULL.BufferSize[in] Specifies the size of the buffer.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Retrieves a parameter of the demodulation for the given channel.
C/C++ declaration
BOOL __stdcall GetDemodulatorParam(INT32 hDevice,UINT32 Channel,UINT32 Code,VOID *Buffer,UINT32 BufferSize);
Address retrieval
G39DDC_GET_DEMODULATOR_PARAM GetDemodulatorParam= (G39DDC_GET_DEMODULATOR_PARAM)GetProcAddress(hAPI,"GetDemodulatorParam");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Code[in] Specifies code of the demodulator parameter to be retrieved. For detailed information about available codes see SetDemodulatorParam.Buffer[out] Pointer to a buffer which receives the requested parameter. This parameter cannot be NULL.BufferSize[in] Specifies the size of the buffer.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Retrieves information about the current demodulator state for the given channel.
C/C++ declaration
BOOL __stdcall GetDemodulatorState(INT32 hDevice,UINT32 Channel,UINT32 Code,VOID *Buffer,UINT32 BufferSize);
Address retrieval
G39DDC_GET_DEMODULATOR_STATE GetDemodulatorState= (G39DDC_GET_DEMODULATOR_STATE)GetProcAddress(hAPI,"GetDemodulatorState");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Code[in] Specifies the code of the demodulator state to be retrieved. It can be one of the following:
Value Meaning G39DDC_DEMODULATOR_STATE_AMS_LOCK Lock state of synchronous AM demodulation.
The Buffer parameter has to be pointer to a BOOL variable, and the BufferSize parameter has to be sizeof(BOOL).
Received value is non-zero if synchronous AM demodulator is locked to signal, and zero if it is not locked.
G39DDC_DEMODULATOR_STATE_AMS_FREQUENCY Frequency in Hz which synchronous AM demodulator is locked to. It is relative to center of the demodulator. It can be negative.
The Buffer parameter has to be pointer to a double variable, and the BufferSize parameter has to be sizeof(double).
G39DDC_DEMODULATOR_STATE_AM_DEPTH Depth of AM modulation in %.
The Buffer parameter has to be pointer to a double variable, and the BufferSize parameter has to be sizeof(double).
G39DDC_DEMODULATOR_STATE_DSB_LOCK Lock state of DSB demodulation.
The Buffer parameter has to be pointer to a BOOL variable, and the BufferSize parameter has to be sizeof(BOOL).
Received value is non-zero if DSB demodulator is locked to signal, and zero if it is not locked.
G39DDC_DEMODULATOR_STATE_DSB_FREQUENCY Frequency in Hz which DSB demodulator is locked to. It is relative to center of the demodulator. It can be negative.
The Buffer parameter has to be pointer to a double variable, and the BufferSize parameter has to be sizeof(double).
G39DDC_DEMODULATOR_STATE_TUNE_ERROR Estimated tune error in Hz.
The Buffer parameter has to be pointer to an INT32 variable, and the BufferSize parameter has to be sizeof(INT32).
Received value is difference between demodulator frequency and frequency of received signal. Subtract the returned tune error from demodulator frequency to get frequency of the received signal. Tune error is relative to center of the demodulator and it can be negative.
G39DDC_DEMODULATOR_STATE_DRM_STATUS Status of DRM demodulator/decoder.
The Buffer parameter has to be pointer to a G39DDC_DRM_STATUS structure, and the BufferSize parameter has to be sizeof(G39DDC_DRM_STATUS).
G39DDC_DEMODULATOR_STATE_FM_DEVIATION Estimated frequency deviation in Hz.
The Buffer parameter has to be pointer to an UINT32 variable, and the BufferSize parameter has to be sizeof(UINT32).
G39DDC_DEMODULATOR_STATE_FMW_STEREO State of FMW stereo decoder.
The Buffer parameter has to be pointer to a BOOL variable, and the BufferSize parameter has to be sizeof(BOOL).
Received value is non-zero if received signal is stereo (stereo pilot detected), and zero if it is not stereo (stereo pilot is not detected).
Buffer[out] Pointer to a buffer which receives the requested information. This parameter cannot be NULL.BufferSize[in] Specifies the size of the buffer.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Retrieves the number of audio sample rates supported by the G39DDC.
C/C++ declaration
BOOL __stdcall GetAudioSampleRateCount(INT32 hDevice,UINT32 *Count);
Address retrieval
G39DDC_GET_AUDIO_SAMPLE_RATE_COUNT GetAudioSampleRateCount= (G39DDC_GET_AUDIO_SAMPLE_RATE_COUNT)GetProcAddress(hAPI,"GetAudioSampleRateCount");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Count[out] Pointer to a variable which receives the number of audio sample rates supported by the G39DDC. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Retrieves the audio sample rate by its index.
C/C++ declaration
BOOL __stdcall GetAudioSampleRate(INT32 hDevice,UINT32 Index,UINT32 *SampleRate);
Address retrieval
G39DDC_GET_AUDIO_SAMPLE_RATE GetAudioSampleRate= (G39DDC_GET_AUDIO_SAMPLE_RATE)GetProcAddress(hAPI,"GetAudioSampleRate");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Index[in] Specifies the audio sample rate index. This value can vary from 0 to value retrieved by the GetAudioSampleRateCount - 1.SampleRate[out] Pointer to a variable which receives the audio sample rate. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sets the output audio sample rate.
C/C++ declaration
BOOL __stdcall SetAudio(INT32 hDevice,UINT32 Channel,UINT32 Index);
Address retrieval
G39DDC_SET_AUDIO SetAudio=(G39DDC_SET_AUDIO)GetProcAddress(hAPI,"SetAudio");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Index[in] Specifies the audio sample rate index.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetAudioSampleRateCount function to determine the number of possible audio sample rates. The Index parameter can vary from zero to one less than the number determined by GetAudioSampleRateCount.
Audio streaming must not run when calling SetAudio. In other words, audio streaming which is started using the StartAudio function has to be stopped using the StopAudio function before calling SetAudio, otherwise SetAudio fails. The SetAudio function does not start and stop audio streaming, but changes the current audio sample rate.
Use the GetAudio function to determine the current audio sample rate index and use the GetAudioSampleRate to convert the index to sample rate.
Retrieves the audio sample rate index.
C/C++ declaration
BOOL __stdcall GetAudio(INT32 hDevice,UINT32 Channel,UINT32 *SampleRateIndex);
Address retrieval
G39DDC_GET_AUDIO GetAudio=(G39DDC_GET_AUDIO)GetProcAddress(hAPI,"GetAudio");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.SampleRate[out] Pointer to a variable which receives the current audio sample rate index. This parameter cannot be NULL. Use GetAudioSampleRate function to convert the index to sample rate.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Starts audio streaming for the given channel.
C/C++ declaration
BOOL __stdcall StartAudio(INT32 hDevice,UINT32 Channel,UINT32 SamplesPerBuffer);
Address retrieval
G39DDC_START_AUDIO StartAudio=(G39DDC_START_AUDIO)GetProcAddress(hAPI,"StartAudio");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.SamplesPerBuffer[in] Specifies the number of samples in each buffer passed to the AudioStreamCallback callback function. The value has to be multiple of 64 greater than zero. If it is zero, the StartAudio function fails. If it is not multiple of 64, the function rounds it up to nearest multiple of 64.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Before StartAudio is used, the G39DDC device has to be turned on using the SetPower function and DDC1 streaming has to be started using the StartDDC1 or StartDDC1Playback function and DDC2 streaming has to be started using the StartDDC2 function, otherwise StartAudio fails.
If the audio streaming for the given channel is already running, StartAudio restarts it except when the streaming was previously started with the same SamplesPerBuffer parameter. In this case StartAudio does nothing.
Use the StopAudio function to stop audio streaming.
Decreasing the value of the SamplesPerBuffer parameter decreases latency and may increase CPU usage. Increasing the value of the SamplesPerBuffer parameter increases latency and may decrease CPU usage.
Stops audio streaming for the given channel.
C/C++ declaration
BOOL __stdcall StopAudio(INT32 hDevice,UINT32 Channel);
Address retrieval
G39DDC_STOP_AUDIO StopAudio=(G39DDC_STOP_AUDIO)GetProcAddress(hAPI,"StopAudio");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If audio streaming is not active, StopAudio does nothing.
If audio playback (started using the StartAudioPlayback function) is active, StopAudio stops it.
The AudioStreamCallback and AudioPlaybackStreamCallback callback functions are not called after StopAudio returns.
Starts audio playback for the given channel. It passes previously recorded audio samples to the processing chain instead of the samples from the demodulator.
C/C++ declaration
BOOL __stdcall StartAudioPlayback(INT32 hDevice,UINT32 Channel,UINT32 SamplesPerBuffer);
Address retrieval
G39DDC_START_AUDIO_PLAYBACK StartAudioPlayback=(G39DDC_START_AUDIO_PLAYBACK)GetProcAddress(hAPI,"StartAudioPlayback");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.SamplesPerBuffer[in] Specifies the number of samples in each buffer passed to the AudioPlaybackStreamCallback callback to fill the buffer by the application and to the AudioStreamCallback callback function. The value has to be multiple of 64 greater than zero. If it is zero, the StartAudioPlayback function fails. If it is not multiple of 64, the function rounds it up to nearest multiple of 64.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The G39DDC device has to be turned on using the SetPower function before use of StartAudioPlayback.
The StartAudioPlayback function stops audio streaming which was previously started by the StartAudio or StartAudioPlayback function and starts audio playback with new parameters.
Use the StopAudio function to stop audio playback.
Pauses audio playback for the given channel.
C/C++ declaration
BOOL __stdcall PauseAudioPlayback(INT32 hDevice,UINT23 Channel);
Address retrieval
G39DDC_PAUSE_AUDIO_PLAYBACK PauseAudioPlayback=(G39DDC_PAUSE_AUDIO_PLAYBACK)GetProcAddress(hAPI,"PauseAudioPlayback");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If audio playback is not active or is already paused, PauseAudioPlayback does nothing.
The AudioPlaybackStreamCallback and AudioStreamCallback callback functions can be called once after PauseAudioPlayback returns. Then they are not called until playback is resumed using the ResumeAudioPlayback function.
Resumes paused audio playback for the given channel.
C/C++ declaration
BOOL __stdcall ResumeAudioPlayback(INT32 hDevice,UINT32 Channel);
Address retrieval
G39DDC_RESUME_AUDIO_PLAYBACK ResumeAudioPlayback=(G39DDC_RESUME_AUDIO_PLAYBACK)GetProcAddress(hAPI,"ResumeAudioPlayback");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If audio playback is not active or not paused, ResumeAudioPlayback does nothing.
Sets fixed audio gain for the given channel.
C/C++ declaration
BOOL __stdcall SetAudioGain(INT32 hDevice,UINT32 Channel,double Gain);
Address retrieval
G39DDC_SET_AUDIO_GAIN SetAudioGain=(G39DDC_SET_AUDIO_GAIN)GetProcAddress(hAPI,"SetAudioGain");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Gain[in] Specifies the new fixed audio gain in dB.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If the G39DDC receiver has an audio output connector (optional), the SetAudioGain function affects the audio signal level at this output (see also SetDAC).
Use the GetAudioGain function to retrieve the current audio gain.
Retrieves current fixed audio gain for the given channel.
C/C++ declaration
BOOL __stdcall GetAudioGain(INT32 hDevice,UINT32 Channel,double *Gain);
Address retrieval
G39DDC_GET_AUDIO_GAIN GetAudioGain=(G39DDC_GET_AUDIO_GAIN)GetProcAddress(hAPI,"GetAudioGain");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Gain[out] Pointer to a variable which receives the current fixed gain in dB. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Enables or disables the audio filter for the given channel.
C/C++ declaration
BOOL __stdcall SetAudioFilter(INT32 hDevice,UINT32 Channel,BOOL Enabled);
Address retrieval
G39DDC_SET_AUDIO_FILTER SetAudioFilter=(G39DDC_SET_AUDIO_FILTER)GetProcAddress(hAPI,"SetAudioFilter");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Enabled[in] Specifies whether to enable or disable the audio filter. If this parameter is non-zero, the filter is enabled. If the parameter is zero, the filter is disabled.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetAudioFiler function to retrieve the current state of the audio filter.
Retrieves the current state of the audio filter for the given channel.
C/C++ declaration
BOOL __stdcall GetAudioFilter(INT32 hDevice,UINT32 Channel,BOOL *Enabled);
Address retrieval
G39DDC_GET_AUDIO_FILTER GetAudioFilter=(G39DDC_GET_AUDIO_FILTER)GetProcAddress(hAPI,"GetAudioFilter");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Enabled[out] Pointer to a variable which receives the current state of the audio filter. The value is non-zero if the filter is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sets parameters of the audio filter for the given channel.
C/C++ declaration
BOOL __stdcall SetAudioFilterParams(INT32 hDevice,UINT32 Channel,UINT32 CutOffLow,UINT32 CutOffHigh,double Deemphasis);
Address retrieval
G39DDC_SET_AUDIO_FILTER_PARAMS SetAudioFilterParams= (G39DDC_SET_AUDIO_FILTER_PARAMS)GetProcAddress(hAPI,"SetAudioFilterParams");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.CutOffLow[in] Specifies the cut-off low frequency of the filter in Hz. This is the start frequency of filter's passband, it can be from range 0 to 23999 Hz. The value has to be less then the cut-off high frequency specified by the CutOffHigh parameter.CutOffHigh[in] Specifies the cut-off high frequency of the filter in Hz. This is the end frequency of filter's passband it can be from range 1 - 24000 Hz. The value has to be greater than the cut-off low frequency specified by the CutOffLow parameter.Deemphasis[in] Specifies the de-emphasis for the filter in dB per octave. De-emphasis starts at cut-off low frequency of the filter. This value can be from range -9.9 to 0.0 dB/octave. Zero means the de-emphasis is disabled.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Use the GetAudioFilerParams function to retrieve the current parameters of the audio filter.
Retrieves the current parameters of the audio filter for the given channel.
C/C++ declaration
BOOL __stdcall GetAudioFilterParams(INT32 hDevice,UINT32 Channel,UINT32 *CutOffLow,UINT32 *CutOffHigh,double *Deemphasis);
Address retrieval
G39DDC_GET_AUDIO_FILTER_PARAMS GetAudioFilterParams= (G39DDC_GET_AUDIO_FILTER_PARAMS)GetProcAddress(hAPI,"GetAudioFilterParams");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.CutOffLow[out] Pointer to a variable which receives the current cut-off low frequency of the filter. This parameter can be NULL if the application does not require this information.CutOffHigh[out] Pointer to a variable which receives the current cut-off high frequency of the filter. This parameter can be NULL if the application does not require this information.Deemphasis[out] Pointer to a variable which receives the current de-emphasis setting of the filter. This parameter can be NULL if the application does not require this information.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Specifies the audio filter length for the given channel. The audio filter is implemented as an FIR filter. This function specifies the number of coefficients used in the filtration procedure.
C/C++ declaration
BOOL __stdcall SetAudioFilterLength(INT32 hDevice,UINT32 Channel,UINT32 Length);
Address retrieval
G39DDC_SET_AUDIO_FILTER_LENGTH SetAudioFilterLength= (G39DDC_SET_AUDIO_FILTER_LENGTH)GetProcAddress(hAPI,"SetAudioFilterLength");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Length[in] Specifies the length of the audio filter. The value has to be multiple of 64, greater than or equal to 64 and less than or equal to 32768. If it is not multiple of 64, the function rounds it up to nearest multiple of 64.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Increasing the filter length increases filter steepness and may increase CPU usage.
Use the GetAudioFilterLength function to determine the current length of the audio filter.
Retrieves the current audio filter length for the given channel.
C/C++ declaration
BOOL __stdcall GetAudioFilterLength(INT32 hDevice,UINT32 Channel,UINT32 *Length);
Address retrieval
G39DDC_GET_AUDIO_FILTER_LENGTH GetAudioFilterLength= (G39DDC_GET_AUDIO_FILTER_LENGTH)GetProcAddress(hAPI,"GetAudioFilterLength");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Length[out] Pointer to a variable which receives the current length of the audio filter. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sets the audio volume for the given channel.
C/C++ declaration
BOOL __stdcall SetVolume(INT32 hDevice,UINT32 Channel,BYTE Volume);
Address retrieval
G39DDC_SET_VOLUME SetVolume=(G39DDC_SET_VOLUME)GetProcAddress(hAPI,"SetVolume");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Volume[in] Specifies the new volume. The value can vary from 0 to 31, where 31 means maximum volume.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If the G39DDC receiver has an audio output connector (optional), the SetVolume function affects the audio signal level at this output (see also SetDAC).
Use the GetVolume function to retrieve the current volume.
Retrieve the current volume for the given channel.
C/C++ declaration
BOOL __stdcall GetVolume(INT32 hDevice,UINT32 Channel,BYTE *Volume);
Address retrieval
G39DDC_GET_VOLUME GetVolume=(G39DDC_GET_VOLUME)GetProcAddress(hAPI,"GetVolume");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Volume[out] Pointer to a variable which receives the current volume. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Mutes or unmutes the audio.
C/C++ declaration
BOOL __stdcall SetMute(INT32 hDevice,UINT32 Channel,BOOL Mute);
Address retrieval
G39DDC_SET_MUTE SetMute=(G39DDC_SET_MUTE)GetProcAddress(hAPI,"SetMute");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Mute[in] Specifies whether to mute or unmute audio. If this parameter is non-zero, the audio is muted. If the parameter is zero, the audio is unmuted.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If the G39DDC receiver has an audio output connector (optional), the SetMute function affects the audio signal at this output (see also SetDAC).
Use the GetMute function to retrieve the current mute state.
Retrieves the current mute state for the given channel.
C/C++ declaration
BOOL __stdcall GetMute(INT32 hDevice,UINT32 Channel,BOOL *Mute);
Address retrieval
G39DDC_GET_MUTE GetMute=(G39DDC_GET_MUTE)GetProcAddress(hAPI,"GetMute");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. Possible values are: 0, 1.Mute[out] Pointer to a variable which receives the current mute state. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Provides routing of audio output for each channel to the DAC (Digital-to-analog converter). DAC output is connected to audio output connector of the receiver.
C/C++ declaration
BOOL __stdcall SetDAC(INT32 hDevice,UINT32 DAC);
Address retrieval
G39DDC_SET_DAC SetDAC=(G39DDC_SET_DAC)GetProcAddress(hAPI,"SetDAC");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.DAC[in] Specifies which channel should be routed to the audio output connector.
Bit Meaning 0 If set, audio output of the channel 0 is routed to the audio output connector. 1 If set, audio output of the channel 1 is routed to the audio output connector. 2 - 31 Reserved. Must be zero. If both bits (0 and 1) are set, audio outputs for both channels are mixed and routed to the audio output connector.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The audio output connector is optional. If the receiver does not have an audio output connector, SetDAC fails. The following example shows how to determine whether the receiver has an audio output connector.
G39DDC_DEVICE_INFO DeviceInfo; INT32 hDevice; //handle to open G39DDC device GetDeviceInfo(hDevice,&DeviceInfo,sizeof(DeviceInfo)); if(DeviceInfo.HardwareOptions & G39DDC_HARDWARE_OPTIONS_AUDIO_OUTPUT) { //the receiver has audio output connector //route audio output of both channels to the audio output connector SetDAC(hDevice,0x01 | 0x02); } else { //the receiver does not have audio output connector }
Determines which channel (its audio output) is routed to the audio output connector.
C/C++ declaration
BOOL __stdcall GetDAC(INT32 hDevice,UINT32 *DAC);
Address retrieval
G39DDC_GET_DAC GetDAC=(G39DDC_GET_DAC)GetProcAddress(hAPI,"GetDAC");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.DAC[out] Pointer to a variable which receives a bitwise array which specifies which channel is routed to the audio output connector. For more information, see SetDAC. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Starts sweeping.
C/C++ declaration
BOOL __stdcall StartSweeping(INT32 hDevice,UINT64 BeginFrequency,UINT64 EndFrequency,UINT64 StartFrequency,WORD SettlingTime,BOOL Forward);
Address retrieval
G39DDC_START_SWEEPING StartSweeping=(G39DDC_START_SWEEPING)GetProcAddress(hAPI,"StartSweeping");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.BeginFrequency[in] Specifies the start frequency of the sweeping range in Hz.EndFrequency[in] Specifies the end frequency of the sweeping range in Hz.StartFrequency[in] Specifies the frequency to start sweeping from. It must be between (including) BeginFrequency and EndFrequency. Use the same value as for BeginFrequency to start sweeping from the beginning of the sweeping range.SettlingTime[in] The settling time in milliseconds. This is the minimum delay time after tuning before the signal snapshot is taken. The value can vary from 1 to 1023 milliseconds.Forward[in] Specifies sweeping direction. If the value is non-zero, the sweeping runs in a loop from the BeginFrequency to the EndFrequency. If the value is zero, the sweeping runs in a loop from the EndFrequency to BeginFrequency.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The G39DDC device has to be turned on using the SetPower function before StartSweeping is used, otherwise StartSweeping fails.
DDC1 streaming (StartDDC1) in each channel and IF snapshots (StartIF) must not be running before StartSweeping is used, otherwise StartSweeping fails.
When the sweeping runs, the receiver is tuned sequentially to frequencies from the range specified by the BeginFrequency and EndFrequency parameters. The tuning direction is given by the Forward parameter. Tuning step is specified by the FrontEndFrequencyStep member of the G39DDC_DEVICE_INFO structure (see GetDeviceInfo).
The BeginFrequency has to be less than the EndFrequency.
The BeginFrequency and EndFrequency can be between (including) values provided by the FrontEndMinFrequency and FrontEndMaxFrequency members of the G39DDC_DEVICE_INFO structure.
If the value of the BeginFrequency, EndFrequency or StartFrequency is not equal to the FrontEndMinFrequency member of G39DDC_DEVICE_INFO structure, it has to be a multiple of the FrontEndFrequencyStep member of G39DDC_DEVICE_INFO structure.
The SweepingCallback callback is invoked once for each tuned frequency to pass the IF snapshot to the application during sweeping. Each snapshot consists of 65536 samples.
To use extended sweeping parameters in addition to parameters supported by StartSweeping, use the StartSweepingEx function.
StartSweeping(hDevice,BeginFrequency,EndFrequency,StartFrequency,SettlingTime,Forward) is equivalent to StartSweepingEx(hDevice,BeginFrequency,EndFrequency,StartFrequency,SettlingTime,Forward,0,FALSE).
Use the StopSweeping function to stop sweeping.
Starts sweeping.
C/C++ declaration
BOOL __stdcall StartSweepingEx(INT32 hDevice,UINT64 BeginFrequency,UINT64 EndFrequency,UINT64 StartFrequency,WORD SettlingTime,BOOL Forward,UINT32 Repeat,BOOL LargeIfBuffer);
Address retrieval
G39DDC_START_SWEEPING_EX StartSweepingEx=(G39DDC_START_SWEEPING_EX)GetProcAddress(hAPI,"StartSweepingEx");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.BeginFrequency[in] Specifies the start frequency of the sweeping range in Hz.EndFrequency[in] Specifies the end frequency of the sweeping range in Hz.StartFrequency[in] Specifies the frequency to start sweeping from. It must be between (including) BeginFrequency and EndFrequency. Use the same value as for BeginFrequency to start sweeping from the beginning of the sweeping range.SettlingTime[in] The settling time in milliseconds. This is the minimum delay time after tuning before the signal snapshot is taken. The value can vary from 1 to 1023 milliseconds.Forward[in] Specifies sweeping direction. If the value is non-zero, the sweeping runs in a loop from the BeginFrequency to the EndFrequency. If the value is zero, the sweeping runs in a loop from the EndFrequency to BeginFrequency.Repeat[in] Specifies how many additional snapshots will be taken at the same front-end frequency in intervals given by the SettlingTime parameter. If this parameter is zero, a single snapshot is taken on each tuned front-end frequency. If this parameter is non-zero Repeat+1 snapshots are taken at the same front-end frequency with each SettlingTime interval. This can be useful for frequency spectrum averaging during sweeping.LargeIfBuffer[in] Specifies the number of samples in each IF snapshot during sweeping. If the value is zero, each snapshot consists of 65536 samples. If the value is non-zero, the snapshot consists of 262144 samples. Large snapshots can be useful for a precise frequency spectrum during sweeping
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The G39DDC device has to be turned on using the SetPower function before StartSweepingEx is used, otherwise StartSweepingEx fails.
DDC1 streaming (StartDDC1) in each channel and IF snapshot (StartIF) must not be running before StartSweepingEx is used, otherwise StartSweepingEx fails.
When the sweeping runs, the receiver is tuned sequentially to frequencies from the range specified by the BeginFrequency and EndFrequency parameters. The tuning direction is given by the Forward parameter. Tuning step is specified by the FrontEndFrequencyStep member of the G39DDC_DEVICE_INFO structure (see GetDeviceInfo).
The BeginFrequency has to be less than the EndFrequency.
The BeginFrequency and EndFrequency can be between (including) values provided by the FrontEndMinFrequency and FrontEndMaxFrequency members of the G39DDC_DEVICE_INFO structure.
If value of the BeginFrequency, EndFrequency or StartFrequency is not equal to the FrontEndMinFrequency member of G39DDC_DEVICE_INFO structure, it has to be multiple of the FrontEndFrequencyStep member of G39DDC_DEVICE_INFO structure.
The SweepingCallback callback is invoked N times for each tuned frequency to pass the IF snapshot to the application during sweeping, where N = Repeat + 1. Time interval between repeated snapshots is equal to SettlingTime.
Use StopSweeping function to stop sweeping.
When the SettlingTime is very short (below 20 ms) the sweeping can be significantly slower with the LargeIfBuffer set to a non-zero value than sweeping with the LargeIfBuffer set to zero. More time is required to make and transfer a large snapshot to system memory.
Stops sweeping previously started using the StartSweeping or StartSweepingEx function.
C/C++ declaration
BOOL __stdcall StopSweeping(INT32 hDevice);
Address retrieval
G39DDC_STOP_SWEEPING StopSweeping=(G39DDC_STOP_SWEEPING)GetProcAddress(hAPI,"StopSweeping");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Determines compensation data for frequency spectrum computed from DDC1 or DDC2 signal. It is used to convert relative amplitudes in dB to absolutes ones in dBm.
C/C++ declaration
BOOL __stdcall GetSpectrumCompensation(INT32 hDevice,UINT64 FrontEndFrequency,INT32 Shift,UINT32 Bandwidth,FLOAT *Buffer,UINT32 Count);
Address retrieval
G39DDC_GET_SPECTRUM_COMPENSATION GetSpectrumCompensation= (G39DDC_GET_SPECTRUM_COMPENSATION)GetProcAddress(hAPI,"GetSpectrumCompensation");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.FrontEndFrequency[in] Specifies the front-end frequency in Hz.Shift[in] Specifies the relative center frequency (in Hz) of the bandwidth given by the Bandwidth parameter. It is relative to front-end frequency given by the FrontEndFrequency parameter. It can be negative.Bandwidth[in] Specifies the width of the requested compensation data in Hz.Buffer[out] Pointer to a buffer to be filled with compensation data. This parameter cannot be NULL.Count[in] Specifies the number of FLOAT items in the buffer pointed to by the Buffer parameter.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The following example shows how to use the GetSpectrumCompensation function in DDC2StreamCallback callback function:
//Let the following is prototype of a function which compute FFT from I/Q signal stored in //the buffer pointed to be the Input parameter. Result is stored in complex form in the buffer //pointed to by the Output parameter. Size of the FFT is given be the Size parameter. //The example uses FFT with size 2048. void FFT(float *Output,const float *Input,int Size); #define FFT_SIZE 2048 INT32 hDevice; //handle to G39DDC device UINT64 FrontEndFrequency; //Front-end frequency INT32 RelDDC2Frequency; //Relative frequency of the DDC2 INT32 RelDDC1Frequency; //Relative frequency of the DDC1 INT32 DDC2Shift; //Total shift of DDC2 from front-end frequency G39DDC_DDC_INFO DDC2Info; //Information about current DDC type of the DDC2 FLOAT FFTBuffer[2*FFT_SIZE]; //Buffer for FFT result FLOAT Compensation[FFT_SIZE]; //Buffer for compensation data UINT32 FirstBin,LastBin; //the first and last bins in the FFT of useful DDC2 band G39DDC_CALLBACKS Callbacks; //Structure which contains pointer to callback functions Code before... //Retrieve front-end frequency GetFrontEndFrequency(hDevice,&FrontEndFrequency); //Retrieve relative frequency of the DDC1 for channel 0 GetDDC1Frequency(hDevice,0,&RelDDC1Frequency); //Retrieve relative frequency of the DDC2 for channel 0 GetDDC2Frequency(hDevice,0,&RelDDC2Frequency); //Calculate DDC2 shift DDC2Shift=RelDDC2Frequency+RelDDC1Frequency; //Retrieve DDC type information of the DDC2 GetDDC2(hDevice,NULL,&DDC2Info); //Retrieve compensation data GetSpectrumCompensation(hDevice,FrontEndFrequency,DDC2Shift,DDC2Info.SampleRate,Compensation,FFT_SIZE); //In this case the Bandwidth parameter is equal to sample rate, because we need compensation data //for whole DDC2 band not only for usable bandwidth. //Compensation data have to be updated after change of absolute DDC2 frequency using //the SetDDC1Frequency, SetDDC2Frequency or SetFrontEndFrequency function. //In this case a mutual-exclusion synchronization method (for example critical section) should be used //if the Compensation buffer would be modified outside the MyDDC2StreamCallback callback. FirstBin=FFT_SIZE*(DDC2Info.SampleRate-DDC2Info.Bandwidth)/2/DDC2Info.SampleRate; LastBin=FFT_SIZE*(DDC2Info.SampleRate+DDC2Info.Bandwidth)/2/DDC2Info.SampleRate; //Set callback function for DDC2 streaming //Pointers to callback function which should not be called by the API have to be set to NULL. Callbacks.DDC2StreamCallback=MyDDC2StreamCallback; //Start DDC2 streaming for channel 0 //The SamplesPerBuffer parameter is set to FFT_SIZE which is size of the FFT to simplify //the example. StartDDC2(hDevice,0,2048); Code after... void __stdcall MyDDC2StreamCallback(UINT32 Channel,CONST FLOAT *Buffer,UINT32 NumberOfSamples,DWORD_PTR UserData) { UINT32 i; //Compute FFT FFT(FFTBuffer,Buffer,FFT_SIZE); //Converts complex FFT result to dB for(i=0;i<FFT_SIZE;i++) { FFTBuffer[i]=(FLOAT)(10.0*log10(FFTBuffer[i*2]*FFTBuffer[i*2]+FFTBuffer[i*2+1]*FFTBuffer[i*2+1])); } //Apply compensation data to get amplitudes in frequency spectrum in dBm for(i=0;i<FFT_SIZE;i++) { FFTBuffer[i]+=Compensation[i]; } //now the FFTBuffer contains amplitudes in dBm //Useful band starts at the bin given by the FirstBin variable //and ends at the bin given by the LastBin variable. }
Determines compensation data for frequency spectrum of IF snapshots provided by the IFCallback and SweepingCallback callbacks.
C/C++ declaration
BOOL __stdcall GetIFSpectrumCompensation(INT32 hDevice,UINT64 FrontEndFrequency,FLOAT *Buffer,UINT32 Count);
Address retrieval
G39DDC_GET_IF_SPECTRUM_COMPENSATION GetIFSpectrumCompensation=(G39DDC_GET_IF_SPECTRUM_COMPENSATION)GetProcAddress(hAPI,"GetIFSpectrumCompensation");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.FrontEndFrequency[in] Specifies the front-end frequency in Hz.Buffer[out] Pointer to a buffer to be filled with compensation data. This parameter cannot be NULL.Count[in] Specifies the number of FLOAT items in the buffer pointed to by the Buffer parameter.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The following example shows how to use the GetIFSpectrumCompensation function in IFCallback callback function:
//Let the following is prototype of a function which compute FFT from real signal stored in //the buffer pointed to be the Input parameter. Input samples are 16 bit, signed (from -32768 to +32767). Result is stored //in complex form in the buffer pointed to by the Output parameter. Size of the FFT is given be //the Size parameter. The example uses FFT with size 8192. void FFT(float *Output,const short *Input,int Size); #define FFT_SIZE 8192 //half of FFT size, we will use only the lower half of the FFT result with real input #define FFT_SIZE_2 (FFT_SIZE/2) //ADC sample rate - 100 MHz #define ADC_SAMPLE_RATE 100000000 INT32 hDevice; //handle to G39DDC device UINT64 FrontEndFrequency; //Front-end frequency FLOAT FFTBuffer[2*FFT_SIZE]; //Buffer for FFT result FLOAT Compensation[FFT_SIZE_2]; //Buffer for compensation data UINT32 FirstBin,LastBin; //the first and last bins in the FFT of useful IF band. G39DDC_CALLBACKS Callbacks; //Structure which contains pointer to callback functions G39DDC_DEVICE_INFO DeviceInfo; //Structure which contains device information to determine useful band in the IF snapshot Code before... //Retrieve device information GetDeviceInfo(hDevice,&DeviceInfo,sizeof(DeviceInfo)); //Retrieve front-end frequency GetFrontEndFrequency(hDevice,&FrontEndFrequency); //Retrieve compensation data. It is required the number of items to be equal to half of FFT size. GetIFSpectrumCompensation(hDevice,FrontEndFrequency,Compensation,FFT_SIZE_2); //Compensation data have to be updated after change of front-end frequency using SetFrontEndFrequency function. //In this case a mutual-exclusion synchronization method (for example critical section) should be used //if the Compensation buffer would be modified outside the MyDDC2StreamCallback callback. //Set callback function for IF snapshots //Pointers to callback function which should not be called by the API have to be set to NULL. Callbacks.IFCallback=MyIFCallback; SetCallbacks(hDevice,&Callbacks); //Start IF with snapshot period 50 ms StartIF(hDevice,50); Code after... void __stdcall MyIFCallback(CONST SHORT *Buffer,UINT32 NumberOfSamples,UINT32 CenterFrequency,WORD Amplitude,UINT32 ADCSampleRate,DWORD_PTR UserData) { UINT32 i; UINT32 FirstBin,LastBin; //Compute FFT FFT(FFTBuffer,Buffer,FFT_SIZE); //Converts complex FFT result to dB, only for the lower half of the result, upper one is the same as lower but inverted for(i=0;i<FFT_SIZE_2;i++) { FFTBuffer[i]=(FLOAT)(10.0*log10(FFTBuffer[i*2]*FFTBuffer[i*2]+FFTBuffer[i*2+1]*FFTBuffer[i*2+1])); } //Apply compensation data to get amplitudes in frequency spectrum in dBm //We use only the lower half of the FFT result, because the upper one is the same but inverted for(i=0;i<FFT_SIZE_2;i++) { FFTBuffer[i]+=Compensation[i]; } //Calculate the first and last bins of the useful band in the FFT result //Center of the band is specified by the CenterFrequency parameter FirstBin=FFT_SIZE*(CenterFrequency-DeviceInfo.FrontEndWindowWidth/2)/ADC_SAMPLE_RATE; LastBin=FFT_SIZE*(CenterFrequency+DeviceInfo.FrontEndWindowWidth/2)/ADC_SAMPLE_RATE; //now the FFTBuffer contains amplitudes in dBm //Useful band starts at the bin given by the FirstBin variable //and ends at the bin given by the LastBin variable. }
Registers user-defined functions as callback functions called by the API.
C/C++ declaration
BOOL __stdcall SetCallbacks(INT32 hDevice,CONST G39DDC_CALLBACKS *Callbacks,DWORD_PTR UserData);
Address retrieval
G39DDC_SET_CALLBACKS SetCallbacks=(G39DDC_SET_CALLBACKS)GetProcAddress(hAPI,"SetCallbacks");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Callbacks[in] Pointer to a G39DDC_CALLBACKS structure which contains pointers to the user-defined function to be registered as callback functions.UserData[in] Specifies a user-defined value which is passed to callback functions.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If the application does not require that the API calls some callback function, set related member of the G39DDC_CALLBACKS structure to NULL.
If value of the Callbacks parameter is NULL, all the callback functions are unregistered, the API will not call any callback function.
Sets directory with DRM key file to unlock the DRM demodulator/decoder.
C/C++ declaration
BOOL __stdcall SetDRMKey(INT32 hDevice,CONST CHAR *DRMKeyFileDirectory);
Address retrieval
G39DDC_SET_DRM_KEY SetDRMKey=(G39DDC_SET_DRM_KEY)GetProcAddress(hAPI,"SetDRMKey");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.DRMKeyFileDirectory[in] Pointer to a null-terminated string that specifies the directory which contains a valid DRM key file.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If the specified directory contains a valid DRM key file, the key is loaded and the DRM demodulator/decoder is unlocked and available for use, otherwise the function fails.
If the DRM demodulator/decoder is already unlocked, the function does nothing.
Use the IsDRMUnlocked function to determine whether DRM demodulator/decoder is unlocked or not.
Information about obtaining a DRM key can be found at https://www.winradio.com/home/drm.htm.
Determined whether the DRM demodulator/decoder is unlocked or not.
C/C++ declaration
BOOL __stdcall IsDRMUnlocked(INT32 hDevice);
Address retrieval
G39DDC_IS_DRM_UNLOCKED IsDRMUnlocked=(G39DDC_IS_DRM_UNLOCKED)GetProcAddress(hAPI,"IsDRMUnlocked");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.
Return value
If the function succeeds and the DRM demodulator/decoder is unlocked, the return value is non-zero.
If the function fails or the DRM demodulator/decoder is locked, the return value is zero. To get extended error information, call GetLastError.
Flushes internal buffers and FIFOs in software and hardware parts. It marks specified buffers (filled by any samples) as empty. This can be useful in a scanning engine.
C/C++ declaration
BOOL __stdcall FlushBuffers(INT32 hDevice,UINT32 Channel,UINT32 Flags);
Address retrieval
G39DDC_FLUSH_BUFFERS FlushBuffers=(G39DDC_FLUSH_BUFFERS)GetProcAddress(hAPI,"FlushBuffers");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Channel[in] Specifies the channel index. It can be 0, 1.Flags[in] Specifies which buffers should be flushed. The value can be a combination of the following:
Value Meaning G39DDC_FLUSH_BUFFERS_IF Buffers which contains IF snapshots samples are flushed. In this case the Channel parameter is ignored. G39DDC_FLUSH_BUFFERS_DDC1 Buffers which contains samples from DDC1 output are flushed. G39DDC_FLUSH_BUFFERS_DDC2 Buffers which contains samples from DDC2 output are flushed. G39DDC_FLUSH_BUFFERS_AUDIO Buffers which contains samples from audio output are flushed.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The function is synchronous. When it is finished, specified buffers are already flushed.
Retrieves the current internal temperature of the G39DDC device.
C/C++ declaration
BOOL __stdcall GetTemperature(INT32 hDevice,UINT32 *Temperature);
Address retrieval
G39DDC_GET_TEMPERATURE GetTemperature=(G39DDC_GET_TEMPERATURE)GetProcAddress(hAPI,"GetTemperature");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.Temperature[out] Pointer to a variable which receives the current internal temperature in degrees of Celsius. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The G39DDC device has to be turned on using the SetPower function before GetTemperature is used. Otherwise GetTemperature fails.
Retrieves the current error state of the G39DDC device.
C/C++ declaration
BOOL __stdcall GetDeviceState(INT32 hDevice,UINT32 *State);
Address retrieval
G39DDC_GET_DEVICE_STATE GetDeviceState=(G39DDC_GET_DEVICE_STATE)GetProcAddress(hAPI,"GetDeviceState");
Parameters
hDevice[in] Handle to G39DDC device returned by the OpenDevice function.State[out] Pointer to a variable which receives the current error state of the device. This parameter cannot be NULL.It is a combination of the following values:
Value Meaning G39DDC_DEVICE_STATE_TEMP_ERROR Critical temperature detected. G39DDC_DEVICE_STATE_FAN_ERROR Built-in fan error detected. The fun is not operational. G39DDC_DEVICE_STATE_VCC_ERROR Voltage error detected. G39DDC_DEVICE_STATE_COMM_ERROR Internal hardware communication error detected.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, call GetLastError.
Contains information about the G39DDC device.
C/C++ declaration
#pragma pack(push,1) typedef struct { char DevicePath[MAX_PATH]; BYTE InterfaceType; CHAR SerialNumber[9]; WORD HWVersion; WORD FWVersion; BYTE EEPROMVersion; UINT32 ChannelCount; UINT64 FrontEndMinFrequency; UINT64 FrontEndMaxFrequency; UINT64 FrontEndMaxHFFrequency; UINT32 FrontEndFrequencyStep; UINT32 FrontEndWindowWidth; UINT32 HardwareOptions; } G39DDC_DEVICE_INFO; #pragma pack(pop)
Members
DevicePathDevice system path in a null-terminated string. It is used to open the device using object interface.InterfaceTypeDevice interface type. The value can be one of the following:
G39DDC_INTERFACE_TYPE_PCIE
The device is connected to the computer via PCI express.G39DDC_INTERFACE_TYPE_USB
The device is connected to the computer via USB.SerialNumberSerial number in null-terminated string.HWVersionVersion of the hardware.FWVersionVersion of the firmware.EEPROMVersionEEPROM structure version.ChannelCountNumber of channels. It is equal to 2.FrontEndMinFrequencyMinimum front-end frequency (in Hz) which can be used in the SetFrontEndFrequency and StartSweeping functions.FrontEndMaxFrequencyMaximum front-end frequency (in Hz) which can be used in the SetFrontEndFrequency and StartSweeping functions.FrontEndMaxHFFrequencyMaximum front-end frequency (in Hz) when the front-end is in HF mode.FrontEndFrequencyStepTuning step (in Hz) of the front-end. The frequencies used in the SetFrontEndFrequency and StartSweeping functions have to be multiple of this value. The only exception is if the frequency is equal to FrontEndMinFrequency which need not be a multiple of this value.FrontEndWindowWidthUseful bandwidth (in Hz) in IF snapshots passed to the IFCallback and SweepingCallback callbacks. Center of the bandwidth is specified by the CenterFrequency parameter of these callbacks.HardwareOptionsHardware options. It can be combination of the following values:
Value Meaning G39DDC_HARDWARE_OPTIONS_EXTERNAL_REFERENCE The device supports external reference. G39DDC_HARDWARE_OPTIONS_AUDIO_OUTPUT The device has an audio output connector. G39DDC_HARDWARE_OPTIONS_FCC FCC receiver. The receiver does not allow tuning to prohibited frequency bands.
Contains information about the DDC type.
C/C++ declaration
#pragma pack(push,1) typedef struct { UINT32 SampleRate; UINT32 Bandwidth; UINT32 BitsPerSample; } G39DDC_DDC_INFO; #pragma pack(pop)
Members
SampleRateSample rate of I/Q signal in Hz.BandwidthUseful bandwidth in Hz.BitsPerSampleNumber of bits per sample. It can be 16 or 32. It is used to determine bits per sample for DDC1.
Contains information about the AMS capture range.
C/C++ declaration
#pragma pack(push,1) typedef struct { UINT32 Tune; UINT32 Lock; } G39DDC_AMS_CAPTURE_RANGE; #pragma pack(pop)
Members
TuneInitial capture range in Hz.LockCapture range (in Hz) used when AMS demodulator is locked.
Contains pointers to user-defined functions to be registered as callback functions.
Each callback function is called in context of a thread created by the API. If some shared data are accessed inside callback functions, it is recommended that a mutual-exclusion synchronization method be used. The application should not call any G39DDC API function from inside callback functions, otherwise it can cause deadlock or the application can become unpredictable.
C/C++ declaration
#pragma pack(push,1) typedef struct { G39DDC_IF_CALLBACK IFCallback; G39DDC_DDC1_STREAM_CALLBACK DDC1StreamCallback; G39DDC_DDC1_PLAYBACK_STREAM_CALLBACK DDC1PlaybackStreamCallback; G39DDC_DDC2_STREAM_CALLBACK DDC2StreamCallback; G39DDC_DDC2_PREPROCESSED_STREAM_CALLBACK DDC2PreprocessedStreamCallback; G39DDC_AUDIO_STREAM_CALLBACK AudioStreamCallback; G39DDC_AUDIO_PLAYBACK_STREAM_CALLBACK AudioPlaybackStreamCallback; G39DDC_SWEEPING_CALLBACK SweepingCallback; } G39DDC_CALLBACKS; #pragma pack(pop)
Members
Pointer to a user-defined function to be registered as IF callback. It is called by the API to pass IF snapshots to the application. Sending of IF snapshots is started using the StartIF function.
C/C++ declaration
void __stdcall IFCallback(CONST SHORT *Buffer,UINT32 NumberOfSamples,UINT32 CenterFrequency,WORD Amplitude,UINT32 ADCSampleRate,DWORD_PTR UserData);Parameters
BufferPointer to the buffer which contains samples directly received from the ADC. Sample rate is 100 MHz, sample is 16 bit signed little endian (values are from range -32768 to +32767).NumberOfSamplesSpecifies number of samples in the buffer pointed to be the Buffer parameter. This is usually 65536.CenterFrequencySpecifies the center frequency of the useful band in received 50 MHz wide snapshot. Not whole 50 MHz band of the snapshot is usable. Usable bandwidth is specified by the FrontEndWindowWidth member of the G39DDC_DEVICE_INFO structure.AmplitudeSpecifies the maximum amplitude at ADC output. Measurement of the maximum is started at the end of the previous snapshot to the current one. The possible value is 0 to 32767.ADCSampleRateSpecifies the sample rate of the ADC in Hz. It can be a bit different from 100 MHz.UserDataUser-defined data. It is value passed to the SetCallbacks function as the UserData parameter.Pointer to a user-defined function to be registered as DDC1 stream callback. It is called by the API to pass I/Q samples from DDC1 to the application. The DDC1 streaming can be started using the StartDDC1 or StartDDC1Playback function.
C/C++ declaration
void __stdcall DDC1StreamCallback(UINT32 Channel,CONST VOID *Buffer,UINT32 NumberOfSamples,UINT32 BitsPerSample,DWORD_PTR UserData);Parameters
ChannelSpecifies the channel index. It can be 0, 1.BufferPointer to the buffer which contains I/Q sample sets from DDC1. Sample rate and bits per sample is given by used DDC type, see the SetDDC1 function. One I/Q sample set consists of two samples.NumberOfSamplesSpecifies number of I/Q sample sets in the buffer pointed to by the Buffer parameter. This value is equal to value of the SamplesPerBuffer parameter of the StartDDC1 or StartDDC1Playback function.BitsPerSampleSpecifies number of bits per sample. It is given by DDC type used for DDC1 and it can be 16 or 32. If it is 16, sample is 16 bit integer (32bits per I/Q sample set), signed, little endian, from range -32768 to +32767. If it is 32, sample is 32bit integer (64bits per I/Q sample set), signed, little endian, from range -2147483648 to +2147483647.UserDataUser-defined data. A value passed to the SetCallbacks function as the UserData parameter.Pointer to a user-defined function to be registered as DDC1 playback stream callback. It is called by the API to fill the buffer with I/Q samples by the application. The DDC1 playback can be started using the StartDDC1Playback function.
C/C++ declaration
BOOL __stdcall DDC1PlaybackStreamCallback(UINT32 Channel,VOID *Buffer,UINT32 NumberOfSamples,UINT32 BitsPerSample,DWORD_PTR UserData);Parameters
ChannelSpecifies the channel index. It can be 0, 1.BufferPointer to the buffer to be filled with I/Q sample sets. Sample rate and bits per sample is given by used DDC type, see the SetDDC1 function.NumberOfSamplesSpecifies number of I/Q sample sets to be stored to the buffer pointed to by the Buffer parameter. This value is equal to value of the SamplesPerBuffer parameter of the StartDDC1Playback function. If the application does not have the requested number of sample sets, it has to fill the buffer with zeros. One I/Q sample set consists of two samples.BitsPerSampleSpecifies the number of bits per sample. It is given by DDC type used for DDC1 and it can be 16 or 32. If it is 16, sample is 16 bit integer (32bits per I/Q sample set), signed, little endian, from range -32768 to +32767. If it is 32, sample is 32bit integer (64bits per I/Q sample set), signed, little endian, from range -2147483648 to +2147483647.UserDataUser-defined data. A value passed to the SetCallbacks function as the UserData parameter.Return value
The application should return non-zero to continue playback. The application should return zero to stop the API to call the DDC1PlaybackStreamCallback again. This does not stop DDC1 playback, it has to be done explicitly by the application calling the StopDDC1 function from the thread in which the device was open using the OpenDevice function. StopDDC1 must not be called from inside the callback function.Pointer to a user-defined function to be registered as DDC2 stream callback. It is called by the API to pass I/Q samples from DDC2 to the application. The DDC2 streaming can be started using the StartDDC2 function.
C/C++ declaration
void __stdcall DDC2StreamCallback(UINT32 Channel,CONST FLOAT *Buffer,UINT32 NumberOfSamples,DWORD_PTR UserData);Parameters
ChannelSpecifies the channel index. It can be 0, 1.BufferPointer to the buffer which contains I/Q sample sets from DDC2. Sample rate is given by the DDC type of the DDC2. Use the GetDDC2 function to determine current DDC type of the DDC2. Sample is 32bit IEEE float from range -1.0 to 1.0. One I/Q sample set consists of two samples.NumberOfSamplesSpecifies the number of I/Q sample sets in the buffer pointed to by the Buffer parameter. This value is equal to value of the SamplesPerBuffer parameter of the StartDDC2 function.UserDataUser-defined data. A value passed to the SetCallbacks function as the UserData parameter.Pointer to a user-defined function to be registered as preprocessed DDC2 stream callback. It is called by the API to pass preprocessed I/Q samples from DDC2 to the application. The samples are filtered by the demodulator filter, notch filter and affected by the AGC or fixed gain. The DDC2 streaming can be started using the StartDDC2 function.
C/C++ declaration
void __stdcall DDC2PreprocessedStreamCallback(UINT32 Channel,CONST FLOAT *Buffer,UINT32 NumberOfSamples, FLOAT SlevelPeak,FLOAT SlevelRMS,DWORD_PTR UserData);Parameters
ChannelSpecifies the channel index. It can be 0, 1.BufferPointer to the buffer which contains preprocessed I/Q sample sets from DDC2. Sample rate is given by the DDC type of the DDC2. Use the GetDDC2 function to determine current DDC type of the DDC2. Sample is 32bit IEEE float from range -1.0 to 1.0. One I/Q sample set consists of two samples.NumberOfSamplesSpecifies the number of I/Q sample sets in the buffer pointed to by the Buffer parameter. This value is equal to value of the SamplesPerBuffer parameter of the StartDDC2 function.SlevelPeakSpecifies the peak signal level in Volts evaluated from samples stored in the buffer pointed to by the Buffer parameter.SlevelRMSSpecifies the RMS signal level in Volts evaluated from samples stored in the buffer pointed to by the Buffer parameter. For detailed information how to convert RMS signal level to dBm, see remarks of the GetSignalLevel function.UserDataUser-defined data. A value passed to the SetCallbacks function as the UserData parameter.Pointer to a user-defined function to be registered as an audio stream callback. It is called by the API to pass audio samples to the application. The audio streaming can be started using the StartAudio or StartAudioPlayback functions. The callback is invoked three times for each audio buffer (see description of the Type parameter).
C/C++ declaration
void __stdcall AudioStreamCallback(UINT32 Channel,UINT32 Type,CONST FLOAT *Buffer,UINT32 NumberOfSamples,DWORD_PTR UserData);Parameters
ChannelSpecifies the channel index. It can be 0, 1.TypeSpecifies the type (stage) of audio samples stored in the buffer pointed to by the Buffer parameter. The value of this parameter can be one of the following:
Value Meaning 0 The buffer contains audio samples affected by audio gain (see SetAudioGain). 1 The buffer contains audio samples affected by audio gain and audio filter (see SetAudioGain and SetAudioFilter). 2 The buffer contains audio samples affected by audio gain, audio filter and volume (see SetAudioGain, SetAudioFilter, SetVolume and SetMute). BufferPointer to the buffer which contains samples of audio signal. The signal consists of two channels (interleaved), sample rate is specified by the SetAudio function, sample is 32bit IEEE float from range -1.0 to 1.0.NumberOfSamplesSpecifies the number of samples to be stored in the buffers pointed to by the Buffer parameter. This value is equal to value of the SamplesPerBuffer parameter of the StartAudio or StartAudioPlayback function.UserDataUser-defined data. A value passed to the SetCallbacks function as the UserData parameter.Pointer to a user-defined function to be registered as an audio playback stream callback. It is called by the API to fill the buffer with audio samples by the application. The audio playback can be started using the StartAudioPlayback function.
C/C++ declaration
BOOL __stdcall AudioPlaybackStreamCallback(UINT32 Channel,FLOAT *Buffer,UINT32 NumberOfSamples,DWORD_PTR UserData);Parameters
ChannelSpecifies the channel index. It can be 0, 1.BufferPointer to the buffer to by filled with audio samples. The audio signal is two channel, sample rate is specified by the SetAudio function, sample is 32bit IEEE float from range -1.0 to 1.0.NumberOfSamplesSpecifies the number of samples in the buffer pointed to by the Buffer parameter. This value is equal to the value of the SamplesPerBuffer parameter of the StartAudioPlayback function. If the application does not have the requested number of samples, the application has to fill the buffer with zeros.UserDataUser-defined data. A value passed to the SetCallbacks function as the UserData parameter.Return value
The application should return non-zero to continue playback. The application should return zero to stop the API to call AudioPlaybackStreamCallback again. This does not stop audio playback, it has to be done explicitly by the application calling the StopAudio function from the thread in which the device was open using the OpenDevice function. StopAudio must not be called from inside the callback function.Pointer to a user-defined function to be registered as a sweeping callback. It is called by the API to pass IF snapshots to the application during sweeping. Sending (of them) is started using the StartSweeping or StartSweepingEx function.
C/C++ declaration
BOOL __stdcall SweepingCallback(CONST SHORT *Buffer,UINT32 NumberOfSamples,UINT32 CenterFrequency,UINT64 Frequency,DWORD_PTR UserData);Parameters
BufferPointer to the buffer which contains samples directly received from ADC. Sample rate is 100 MHz, sample is 16 bit signed little endian (values are from range -32768 to +32767).NumberOfSamplesSpecifies the number of samples in the buffer pointed to be the Buffer parameter. If the sweeping is started using the StartSweeping function, the NumberOfSamples is equal to 65536. If the sweeping is started using the StartSweeppingEx function and its LargeIfBuffer parameter is zero, the NumberOfSamples is equal to 65536. If the sweeping is started using the StartSweeppingEx function and its LargeIfBuffer parameter is non-zero, the NumberOfSamples is equal to 262144.CenterFrequencySpecifies the center frequency of the useful band in received 50 MHz wide snapshot. Not the whole 50 MHz band of the snapshot is usable. Usable bandwidth is specified by the FrontEndWindowWidth member of the G39DDC_DEVICE_INFO structure.FrequencyFront-end frequency (in Hz) when the snapshot was made.UserDataUser-defined data. A value passed to the SetCallbacks function as the UserData parameter.Return value
The application should return non-zero to continue sweeping. The application should return zero to stop API to call SweepingCallback again. This does not stop the sweeping, it has to be done explicitly by the application calling the StopSweeping function from the thread in which the device was open using the OpenDevice function. StopSweeping must not be called from inside the callback function.
Contains information about DRM demodulator/decoder status.
C/C++ declaration
#pragma pack(push,1) typedef struct { BOOL Valid; struct { BOOL SyncFound; BOOL FACDecoded; BOOL SDCDecoded; BOOL AudioDecoded; SHORT NumberOfAudioFrames; SHORT NumberOfAudioErrors; } DecodingState; INT32 Mode; double RFBandwidth; BYTE Interleaver; SHORT SDCQam; SHORT MSCQam; BYTE MSCQamType; double CoderateH; double CoderateA; double CoderateB; double EstimatedSNR; WCHAR TextMessage[128 + 1 + 16]; struct { BYTE Content; WCHAR DynamicLabel[256]; WCHAR Country[256]; WCHAR Language[256]; WCHAR ProgramType[256]; double AudioBitrate; double TextMsgBitrate; double MultimediaBitrate; double DataBitrate; } ServiceInfo[4]; struct { BOOL Valid; BYTE AudioCoding; BOOL SBR; INT32 AudioMode; } AudioDecoderInfo[4]; } G39DDC_DRM_STATUS; #pragma pack(pop)
Members
ValidThe value is non-zero if the content of the structure is valid. It is zero, if the content of the structure is not valid.DecodingStateStructure which contains status of the decoder modules.
Members
SyncFoundStatus of the sync detection. It is non-zero if sync is detected.FACDecodedStatus of the FAC decoder. It is non-zero if FAC is decoded.SDCDecodedStatus of the SDC decoder. It is non-zero if SDC is decoded.AudioDecodedStatus of the audio decoder. It is non-zero if audio is decoded.NumberOfAudioFramesNumber of audio frames in the transmission frame. It is -1 if this information is not available.NumberOfAudioErrorsNumber of audio frames which were invalid.ModeUse of DRM robustness mode. It can be one of the following:
Value Meaning G39DDC_DRM_STATE_MODE_NOT_DETERMINED_YET Robustness mode is not determined yet. G39DDC_DRM_STATE_MODE_A Broadcast is using DRM robustness mode A. G39DDC_DRM_STATE_MODE_B DRM robustness mode B. G39DDC_DRM_STATE_MODE_C DRM robustness mode C. G39DDC_DRM_STATE_MODE_D DRM robustness mode D. RFBandwidthOccupied RF bandwidth in kHz. It is zero if it is invalid or this information is not available (yet).InterleaverInterleaver length. It can be one of the following:
Value Meaning G39DDC_DRM_STATE_INTERLEAVER_LONG Long interleaver used (2 sec). G39DDC_DRM_STATE_INTERLEAVER_SHORT Short interleaver used (400 msec). SDCQamCoding of the SDC (QAM). It is zero if this information is not available (yet).MSCQamCoding of the MSC (QAM). It is zero if this information is not available (yet).MSCQamTypeUsed QAM coding for the MSC. It can be one of the following:
Value Meaning G39DDC_DRM_STATE_QAM_TYPE_STD Standard G39DDC_DRM_STATE_QAM_TYPE_HIER_SYM Hierarchical symmetrical G39DDC_DRM_STATE_QAM_TYPE_HIER_MIX Hierarchical mixed CoderateHUsed code-rate for hierarchical coding, values less than or equal to zero indicate not available or not used.CoderateAUsed code-rate for protection level A, values less than or equal to zero indicate not available or not used.CoderateBUsed code-rate for protection level B, values less than or equal to zero indicate not available or not used.EstimatedSNREstimated SNR in dB of the decoded signal.TextMessageDecoded text message for the selected service in 16 bit Unicode null-terminated string.ServiceInfoArray of four structures which contain general information on the services.
Members
ContentType of the service. It can be a combination of the following:
Value Meaning G39DDC_DRM_STATE_SERVICE_CONTENT_EMPTY Given service is not used, it contains no data, all other members of the structure are invalid. G39DDC_DRM_STATE_SERVICE_CONTENT_AUDIO Given service contains audio data. G39DDC_DRM_STATE_SERVICE_CONTENT_TEXTMSG Given service contains text messages. G39DDC_DRM_STATE_SERVICE_CONTENT_MULTIMEDIA Given service contains multimedia data. G39DDC_DRM_STATE_SERVICE_CONTENT_DATA Given service contains application specific data. DynamicLabel16 bit Unicode null-terminated string containing dynamic label of the service.Country16 bit Unicode null-terminated string containing the signalled country for this service.Language16 bit Unicode null-terminated string containing the signalled language for this service.ProgramType16 bit Unicode null-terminated string containing the signalled program type for this service.AudioBitrateData rate for the audio content. It is zero if this information is not available.TextMsgBitrateData rate for the text message content. It is zero if this information is not available.MultimediaBitrateData rate for the multimedia content. It is zero if this information is not available.DataBitrateData rate for the data content. It is zero if this information is not available.AudioDecoderInfoArray of four structures which contain audio decoder specific information on the services.
Members
ValidIf it is non-zero, audio decoder information is valid, if it is zero, audio decoder information is invalid and all other members of the structure contain no valid data.AudioCodingType of audio coding. It can be one of the following:
Value Meaning G39DDC_DRM_STATE_AUDIO_CODING_AAC Audio coding for given service is AAC. G39DDC_DRM_STATE_AUDIO_CODING_CELP Audio coding for given service is CELP. G39DDC_DRM_STATE_AUDIO_CODING_HVXC Audio coding for given service is HVXC. G39DDC_DRM_STATE_AUDIO_CODING_RFU Reserved for future use. SBRIf it is non-zero, SBR is used, if it is zero, SBR is not used.AudioModeThe value depends on audio coding. It can be one of the following:
Value Meaning G39DDC_DRM_STATE_AUDIO_MODE_AAC_MONO Mono G39DDC_DRM_STATE_AUDIO_MODE_AAC_PARAM_STEREO Parametric stereo G39DDC_DRM_STATE_AUDIO_MODE_AAC_STEREO Stereo G39DDC_DRM_STATE_AUDIO_MODE_AAC_RFU Reserved for future use G39DDC_DRM_STATE_AUDIO_MODE_CELP_NO_CRC Audio data is without CRC G39DDC_DRM_STATE_AUDIO_MODE_CELP_CRC CRC used G39DDC_DRM_STATE_AUDIO_MODE_CELP_RFU_10 Reserved for future use G39DDC_DRM_STATE_AUDIO_MODE_CELP_RFU_11 Reserved for future use G39DDC_DRM_STATE_AUDIO_MODE_HVXC_RFU_00 Reserved for future use G39DDC_DRM_STATE_AUDIO_MODE_HVXC_RFU_01 Reserved for future use G39DDC_DRM_STATE_AUDIO_MODE_HVXC_RFU_10 Reserved for future use G39DDC_DRM_STATE_AUDIO_MODE_HVXC_RFU_11 Reserved for future use