Programming Information for WiNRADiO G65DDC receiver.

The G65DDC API SDK is implemented as a dynamic library (G65DDCAPI.dll). It provides object-oriented and non-object-oriented interfaces to control the G65DDC device. This document describes the non-object-oriented interface. The G65DDCAPI.dll library exports several functions which makes it possible to control G65DDC 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 G65DDC receiver can be controlled from a single user thread only.

A C/C++ header file G65DDCAPI.h is a part of the SDK. The API can be used by any 32-bit application under Microsoft 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.

Block diagram of G65DDC processing chain

Simplified block diagram of G65DDC processing chain
Built-in test Preselectors Attenuator Attenuator Preamplifier Preamplifier Range switch Noise blanker ADC snapshots DDC1 frequency shift DDC1 DDC1 stream DDC2 frequency shift DDC2 DDC2 stream DDC2 noise blanker Demodulator filter Signal level Notch filter Gain Pre-processed DDC2 stream Demodulator Audio gain Audio stream Audio filter Volume DDC2 frequency shift DDC2 DDC2 stream DDC2 noise blanker Demodulator filter Signal level Notch filter Gain Pre-processed DDC2 stream Demodulator Audio gain Audio stream Audio filter Volume DDC2 frequency shift DDC2 DDC2 stream DDC2 noise blanker Demodulator filter Signal level Notch filter Gain Pre-processed DDC2 stream Demodulator Audio gain Audio stream Audio filter Volume Simplified block diagram of G65DDC processing chain

Using the WiNRADiO G65DDC API

Loading the API

The G65DDCAPI.dll library can be loaded to the application by two Microsoft Windows API functions. The first one is LoadLibrary and the other one 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 the memory, the FreeLibrary function can be used to unload the API. Before the FreeLibrary is called, all the handles to G65DDC devices returned by the OpenDevice function must be closed by the CloseDevice function, otherwise the application may become to unpredictable state.

The following source code shows how to load the API.

 
#include <stdio.h>
#include "G65DDCAPI.h"

G65DDC_OPEN_DEVICE OpenDevice;
G65DDC_CLOSE_DEVICE CloseDevice;
HMODULE hAPI;

void main(void)
{  
    //Loading the API
    hAPI=LoadLibrary("G65DDCAPI.dll");

    if(hAPI!=NULL)
    {
        //Retrieving addresses of used API functions
        OpenDevice=(G65DDC_OPEN_DEVICE)GetProcAddress(hAPI,"OpenDevice");
        CloseDevice=(G65DDC_CLOSE_DEVICE)GetProcAddress(hAPI,"CloseDevice");

        //Here place code that uses the API

        FreeLibrary(hAPI);
    }
    else
    {
        //If the LoadLibrary fails
        printf("Failed to load G65DDCAPI.dll.\n");
    }
}

List of available G65DDC devices

The G65DDC API provides the GetDeviceList function which returns list of locally available G65DDC devices which can be open by the OpenDevice function.

The following source code produces a list of serial numbers for the available G65DDC devices.

#include <stdio.h>
#include "G65DDCAPI.h"

G65DDC_GET_DEVICE_LIST GetDeviceList;
G65DDC_FREE_DEVICE_LIST FreeDeviceList;
HMODULE hAPI;

void main(void)
{
 UINT32 Count,i;
 G65DDC_DEVICE_INFO *DeviceList;


    //Loading the API
    hAPI=LoadLibrary("G65DDCAPI.dll");

    if(hAPI!=NULL)
    {
        //Retrieving address of the GetDeviceList function
        GetDeviceList=(G65DDC_GET_DEVICE_LIST)GetProcAddress(hAPI,"GetDeviceList");
        FreeDeviceList=(G65DDC_FREE_DEVICE_LIST)GetProcAddress(hAPI,"FreeDeviceList");

        //Retrieving information about available devices
        if(GetDeviceList(&DeviceList,&Count))        
        {
            if(Count!=0)
            {
                printf("Available G65DDC devices count=%d:\n",Count);
    
                for(i=0;i<Count;i++)
                {
                    printf("%d. SN: %s\n",i,DeviceList[i].SerialNumber);
                }                    
        
                FreeDeviceList(DeviceList);
            }
            else
            {
                printf("No available G65DDC device found.\n");
            }
        }
        else
        {
            printf("GetDeviceList failed with error %08X\n",GetLastError());
        }

        FreeLibrary(hAPI);
    }
    else
    {
        printf("Failed to load G65DDCAPI.dll.\n");
    }

    printf("Press enter to exit\n");
    getchar();
}

Opening G65DDC device

G65DDC 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 G65DDC device.

#include <stdio.h>
#include "G65DDCAPI.h"

G65DDC_OPEN_DEVICE OpenDevice;
G65DDC_CLOSE_DEVICE CloseDevice;
HMODULE hAPI;

void main(void)
{  
 INT32 hDevice;
 
    //Loading the API
    hAPI=LoadLibrary("G65DDCAPI.dll");

    if(hAPI!=NULL)
    {
        //Retrieving addresses of the OpenDevice and CloseDevice API functions
        OpenDevice=(G65DDC_OPEN_DEVICE)GetProcAddress(hAPI,"OpenDevice");
        CloseDevice=(G65DDC_CLOSE_DEVICE)GetProcAddress(hAPI,"CloseDevice");

        //Opening the first available G65DDC device using predefined G65DDC_OPEN_FIRST constant
        hDevice=OpenDevice(G65DDC_OPEN_FIRST);
        
        if(hDevice>=0)
        {
            //Here place code that works with the open G65DDC device
            
            //Closing handle to opened G65DDC device
            CloseDevice(hDevice);
        }
        else
        {
            printf("OpenDevice failed with error %08X\n",GetLastError());
        }

        FreeLibrary(hAPI);
    }
    else
    {
        //If the LoadLibrary fails
        printf("Failed to load G65DDCAPI.dll.\n");
    }
}

GetDeviceList

The GetDeviceList function returns information about the locally available G65DDC devices which can be open.

C/C++ declaration

BOOL __stdcall GetDeviceList(G65DDC_DEVICE_INFO **DeviceList,UINT32 *Count);

Address retrieval

G65DDC_GET_DEVICE_LIST GetDeviceList=(G65DDC_GET_DEVICE_LIST)GetProcAddress(hAPI,"GetDeviceList");

Parameters

DeviceList
[out] Pointer to a variable which receives pointer to an array of G65DDC_DEVICE_INFO structures to be filled with information about available G65DDC devices. The array does not contain information about G65DDC devices connected via their LAN interface. Number of the structures in the array is equal to the number of available G65DDC devices.

When the array is no longer required, use the FreeDeviceList function, to free the used memory.

If no available G65DDC device is found the received value is equal to NULL.

Count
[in] Pointer to a variable which receives the number of available G65DDC devices.

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.

FreeDeviceList

The FreeDeviceList function frees the memory previously allocated by the GetDeviceList function.

C/C++ declaration

void __stdcall FreeDeviceList(G65DDC_DEVICE_INFO *DeviceList);

Address retrieval

G65DDC_FREE_DEVICE_LIST GetDeviceList=(G65DDC_FREE_DEVICE_LIST)GetProcAddress(hAPI,"FreeDeviceList");

Parameters

DeviceList
[out] Pointer to array of G65DDC_DEVICE_INFO structures provided by the GetDeviceList function.

This parameter can be NULL, in this case the function does nothing.

No return value


SearchNetworkDevices

The SearchNetworkDevices function searches for G65DDC devices connected via their LAN interface in the computer's subnet. It discovers the devices broadcasting a UDP packet to all IP addresses contained within the computer's subnet.

C/C++ declaration

BOOL __stdcall SearchNetworkDevices(G65DDC_SEARCH_NETWORK_DEVICES_CALLBACK Callback,UINT_PTR UserData,UINT32 Timeout);

Address retrieval

G65DDC_SEARCH_NETWORK_DEVICES SearchNetworkDevices=(G65DDC_SEARCH_NETWORK_DEVICES)GetProcAddress(hAPI,"SearchNetworkDevices");

Parameters

Callback
[in] Pointer to an application-defined callback function. It is called every time when new remote G65DDC device is discovered.

C/C++ declaration

BOOL __stdcall SearchNetworkDevicesCallback(UINT32 IpAddress,WORD Port,const char *SerialNumber,UINT32 Flags,DWORD_PTR UserData);

Parameters

IpAddress
IPv4 address of the discovered G65DDC device in network byte order.
Port
IP port number in network byte order.
SerialNumber
Serial number in null-terminated string.
Flags
Flags which allow testing whether the discovered device is idle and ready to be open. If (Flags & 0x04) is zero, the device is ready to be open, otherwise it is locked by another client software.
UserData
User-defined data. It is value passed to the SearchNetworkDevices function as the UserData parameter.

Return value

To continue searching, the callback function has to return non-zero value, to stop searching, it has to return zero.
UserData
[in] Specifies a user-defined value which is passed to the callback function.
Timeout
[in] Timeout interval in milliseconds. The function stops searching for the G65DDC devices and returns if the interval elapses. If the Timeout is zero, the function returns immediately.

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.

OpenDevice

Opens the G65DDC device by its serial number or network address.

C/C++ declaration

INT32 __stdcall OpenDevice(const char *SerialNumber);

Address retrieval

G65DDC_OPEN_DEVICE OpenDevice=(G65DDC_OPEN_DEVICE)GetProcAddress(hAPI,"OpenDevice");

Parameters

SerialNumber
[in] Pointer to a null-terminated string which specifies the serial number of the G65DDC device to open.

If the G65DDCe device is connected via its LAN interface this parameter specifies its remote address and port in the following form: udp:remote_address:remote_port (e.g. "udp:192.168.1.250:6500").

One of the following values can be used instead of the serial number and remote address:

ValueMeaning
G65DDC_OPEN_FIRSTThis function opens the first available G65DDC device.
G65DDC_OPEN_DEMOThis function opens demo G65DDC device. This allows developers to work with the API without physical G65DDC device.

Return value

If the function succeeds, the return value is handle to the specified G65DDC device. This handle can only be used with functions of G65DDC 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 application can enter an unpredictable state.

Use the CloseDevice function to close G65DDC device handle returned by the OpenDevice function.

Note:
The G65DDCe USB connection takes priority over the Ethernet port. As a result, when a USB cable is connected between the receiver and a computer, the G65DDCe Ethernet port is unavailable for use. Disconnect the USB connection to the computer when the receiver's Ethernet port is to be used.


CloseDevice

Closes the G65DDC device.

C/C++ declaration

BOOL __stdcall CloseDevice(INT32 hDevice);

Address retrieval

G65DDC_CLOSE_DEVICE CloseDevice=(G65DDC_CLOSE_DEVICE)GetProcAddress(hAPI,"CloseDevice");

Parameters

hDevice
[in] Handle to G65DDC 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.

IsDeviceConnected

Checks if the device is still connected to the computer.

C/C++ declaration

BOOL __stdcall IsDeviceConnected(INT32 hDevice,BOOL *Connected);

Address retrieval

G65DDC_IS_DEVICE_CONNECTED IsDeviceConnected=(G65DDC_IS_DEVICE_CONNECTED)GetProcAddress(hAPI,"IsDeviceConnected");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Connected
[out] Pointer to a variable which receives the current connection status. If the received value is non-zero, the device is still connected and available. If the device is disconnected the received value is zero.

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 it is determined that the device is disconnected, corresponding device handle is no longer usable and it should be closed using the CloseDevice function.

GetDeviceInfo

Retrieves information about the G65DDC device.

C/C++ declaration

BOOL __stdcall GetDeviceInfo(INT32 hDevice,G65DDC_DEVICE_INFO *Info);

Address retrieval

G65DDC_GET_DEVICE_INFO GetDeviceInfo=(G65DDC_GET_DEVICE_INFO)GetProcAddress(hAPI,"GetDeviceInfo");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Info
[out] Pointer to a G65DDC_DEVICE_INFO structure to be filled with information about the device. 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.

SetLED

Sets the front panel LED flashing mode of the G65DDCe device.

C/C++ declaration

BOOL __stdcall SetLED(INT32 hDevice,UINT32 LEDMode);

Address retrieval

G65DDC_SET_LED SetLED=(G65DDC_SET_LED)GetProcAddress(hAPI,"SetLED");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
LEDMode
[in] Specifies front panel LED flashing mode, which can be one of the following:

ValueMeaning
G65DDC_FRONT_PANEL_LED_MODE_DIAGDiagnostic flashing.
G65DDC_FRONT_PANEL_LED_MODE_ONAlways on.
G65DDC_FRONT_PANEL_LED_MODE_OFFAlways 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
 
Fading No connection to computer
3
        
Two short flashes USB or LAN client connected, radio off
4
        
One short flash followed by a long one USB or LAN connected, radio on, ready
5
        
Two short flashes followed by a long one USB connected, driver not installed
6
        
Three short flashes USB or LAN connected, driver installed, application not running

GetLED

Determines the current flashing mode of device's front panel LED.

C/C++ declaration

BOOL __stdcall GetLED(INT32 hDevice,UINT32 *LEDMode);

Address retrieval

G65DDC_GET_LED GetLED=(G65DDC_GET_LED)GetProcAddress(hAPI,"GetLED");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
LEDMode
[out] Pointer to a variable which receives the 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.

SetPower

Turns the G65DDC device on or off.

C/C++ declaration

BOOL __stdcall SetPower(INT32 hDevice,BOOL Power);

Address retrieval

G65DDC_SET_POWER SetPower=(G65DDC_SET_POWER)GetProcAddress(hAPI,"SetPower");

Parameters

hDevice
[in] Handle to G65DDC 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 streams are stopped.

Use the GetPower function to determine the current power state of the device.


GetPower

The GetPower function determines whether the device is turned on or off.

C/C++ declaration

BOOL __stdcall GetPower(INT32 hDevice,BOOL *Power);

Address retrieval

G65DDC_GET_POWER GetPower=(G65DDC_GET_POWER)GetProcAddress(hAPI,"GetPower");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Power
[out] Pointer to a variable which receives the 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.

GetDeviceState

Retrieves the current state of the G65DDC device, like internal temperatures, error state, data transfer counters.

C/C++ declaration

BOOL __stdcall GetDeviceState(INT32 hDevice,G65DDC_DEVICE_STATE *State);

Address retrieval

G65DDC_GET_DEVICE_STATE GetDeviceState=(G65DDC_GET_DEVICE_STATE)GetProcAddress(hAPI,"GetDeviceState");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
State
[out] Pointer to a G65DDC_DEVICE_STATE structure to be filled with the current device 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.

SetExternalReference

Enables or disables the use of an external reference as the clock source.

C/C++ declaration

BOOL __stdcall SetExternalReference(INT32 hDevice,BOOL Enabled);

Address retrieval

G65DDC_SET_EXTERNAL_REFERENCE SetExternalReference=(G65DDC_SET_EXTERNAL_REFERENCE)GetProcAddress(hAPI,"SetExternalReference");

Parameters

hDevice
[in] Handle to G65DDC 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 input is optional. If the receiver does not support external reference, SetExternalReference fails. The following example shows how to determine whether the receiver supports an external reference:
    G65DDC_DEVICE_INFO DeviceInfo;
    INT32 hDevice;  //handle to open G65DDC device
    
    GetDeviceInfo(hDevice,&DeviceInfo);
    
    if(DeviceInfo.Flags & G65DDC_FLAGS_EXTERNAL_REFERENCE_IN)
    {
        //the receiver has external reference input
    }
    else
    {
        //the receiver does not have external reference input
    }

GetExternalReference

Retrieves the current clock source.

C/C++ declaration

BOOL __stdcall GetExternalReference(INT32 hDevice,BOOL *Enabled);

Address retrieval

G65DDC_GET_EXTERNAL_REFERENCE GetExternalReference=(G65DDC_GET_EXTERNAL_REFERENCE)GetProcAddress(hAPI,"GetExternalReference");

Parameters

hDevice
[in] Handle to G65DDC 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.

SetBuiltInTest

Enables or disables the test signal at the receiver's input, which allows testing of the entire signal and processing path.

C/C++ declaration

BOOL __stdcall SetBuiltInTest(INT32 hDevice,BOOL Enabled);

Address retrieval

G65DDC_SET_BUILT_IN_TEST SetBuiltInTest=(G65DDC_SET_BUILT_IN_TEST)GetProcAddress(hAPI,"SetBuiltInTest");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Enabled
[in] Specifies whether to enable or disable the built-in test. If this parameter is non-zero, the test signal is enabled. If the parameter is zero, the test signal is disabled.

Test signal parameters:

RangeFrequencyLevel
165 MHz ± 5 MHz-40 dBm ± 3 dB
2152 MHz ± 5 MHz-34 dBm ± 3 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.

GetBuiltInTest

Retrieves information about whether the test signal is enabled or not.

C/C++ declaration

BOOL __stdcall GetBuiltInTest(INT32 hDevice,BOOL *Enabled);

Address retrieval

G65DDC_GET_BUILT_IN_TEST GetBuiltInTest=(G65DDC_GET_BUILT_IN_TEST)GetProcAddress(hAPI,"GetBuiltInTest");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Enabled
[out] Pointer to a variable which receives information about the test signal state. If it is non-zero, test signal is enabled, if it is zero, test signal is not enabled. 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.

SetAttenuator

Sets the input attenuator.

C/C++ declaration

BOOL __stdcall SetAttenuator(INT32 hDevice,UINT32 Attenuator);

Address retrieval

G65DDC_SET_ATTENUATOR SetAttenuator=(G65DDC_SET_ATTENUATOR)GetProcAddress(hAPI,"SetAttenuator");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Attenuator
[in] Value that specifies the attenuation level in dB. Possible values are: 0, 3, 6, 9, 12, 15, 18, 21. If the value is not from this list, the SetAttenuator function rounds the value to the nearest lower one.

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.

GetAttenuator

Retrieves the current setting of the attenuator.

C/C++ declaration

BOOL __stdcall GetAttenuator(INT32 hDevice,UINT32 *Attenuator);

Address retrieval

G65DDC_GET_ATTENUATOR GetAttenuator=(G65DDC_GET_ATTENUATOR)GetProcAddress(hAPI,"GetAttenuator");

Parameters

hDevice
[in] Handle to G65DDC 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.

SetPreselectors

Controls the band pass filter at the RF input in the first range.

C/C++ declaration

BOOL __stdcall SetPreselectors(INT32 hDevice,UINT32 Low,UINT32 High);

Address retrieval

G65DDC_SET_PRESELECTORS SetPreselectors=(G65DDC_SET_PRESELECTORS)GetProcAddress(hAPI,"SetPreselectors");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Low
[in] Specifies the cut-off low frequency of the filter in Hz. Possible values are: 0, 850000, 2400000, 5400000, 11800000. If the value is not from this list, the function rounds it to the nearest one.
High
[in] Specifies the cut-off high frequency of the filter in Hz. Possible values are: 3100000, 5400000, 11800000, 23300000, 88000000. If the value is not from this list, the function rounds it to the nearest one.

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 Low parameter must not be higher than value of the High parameter, otherwise the function fails.

Use the GetPreselectors function to determine the current setting of the preselectors.


GetPreselectors

Retrieves the current setting of the RF input band pass filter.

C/C++ declaration

BOOL __stdcall GetPreselectors(INT32 hDevice,UINT32 *Low,UINT32 *High);

Address retrieval

G65DDC_GET_PRESELECTORS GetPreselectors=(G65DDC_GET_PRESELECTORS)GetProcAddress(hAPI,"GetPreselectors");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Low
[out] Pointer to a variable which receives the current cut-off low frequency of the filter in Hz. This parameter can be NULL if the application does not require this information.
High
[out] Pointer to a variable which receives the current cut-off high frequency of the filter in Hz. 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.

SetPreamplifier

Enables or disables the RF input preamplifier.

C/C++ declaration

BOOL __stdcall SetPreamplifier(INT32 hDevice,BOOL Preamp);

Address retrieval

G65DDC_SET_PREAMPLIFIER SetPreamplifier=(G65DDC_SET_PREAMPLIFIER)GetProcAddress(hAPI,"SetPreamplifier");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Preamp
[in] Specifies whether to enable or disable the RF 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.


GetPreamplifier

Retrieves the current state of the RF input preamplifier.

C/C++ declaration

BOOL __stdcall GetPreamplifier(INT32 hDevice,BOOL *Preamp);

Address retrieval

G65DDC_GET_PREAMPLIFIER GetPreamplifier=(G65DDC_GET_PREAMPLIFIER)GetProcAddress(hAPI,"GetPreamplifier");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Preamp
[out] Pointer to a variable which receives the 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.

SetInverted

Enables or disables frequency spectrum inversion.

C/C++ declaration

BOOL __stdcall SetInverted(INT32 hDevice,BOOL Inverted);

Address retrieval

G65DDC_SET_INVERTED SetInverted=(G65DDC_SET_INVERTED)GetProcAddress(hAPI,"SetInverted");

Parameters

hDevice
[in] Handle to G65DDC 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.

GetInverted

Retrieves the current frequency spectrum inversion setting.

C/C++ declaration

BOOL __stdcall GetInverted(INT32 hDevice,BOOL *Inverted);

Address retrieval

G65DDC_GET_INVERTED GetInverted=(G65DDC_GET_INVERTED)GetProcAddress(hAPI,"GetInverted");

Parameters

hDevice
[in] Handle to G65DDC 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.

SetRange

Switches the active receiver's input between range 1 and range 2.

C/C++ declaration

BOOL __stdcall SetRange(INT32 hDevice,UINT32 Range);

Address retrieval

G65DDC_SET_RANGE SetRange=(G65DDC_SET_RANGE)GetProcAddress(hAPI,"SetRange");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Range
[in] Specifies which range will be active. The value can be G65DDC_RANGE_1 for range 1, or G65DDC_RANGE_2 for range 2.

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.

GetRange

Retrieves information regarding which range is active.

C/C++ declaration

BOOL __stdcall GetRange(INT32 hDevice,UINT32 *Range);

Address retrieval

G65DDC_GET_RANGE GetRange=(G65DDC_GET_RANGE)GetProcAddress(hAPI,"GetRange");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Range
[out] Pointer to a variable which receives G65DDC_RANGE_1 if range 1 is active, or G65DDC_RANGE_2 if range 2 is active. 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.

SetADCNoiseBlanker

Enables or disables the noise blanker on ADC stream.

C/C++ declaration

BOOL __stdcall SetADCNoiseBlanker(INT32 hDevice,BOOL Enabled);

Address retrieval

G65DDC_SET_ADC_NOISE_BLANKER SetADCNoiseBlanker=(G65DDC_SET_ADC_NOISE_BLANKER)GetProcAddress(hAPI,"SetADCNoiseBlanker");

Parameters

hDevice
[in] Handle to G65DDC 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, 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.

GetADCNoiseBlanker

Retrieves the current ADC noise blanker state.

C/C++ declaration

BOOL __stdcall GetADCNoiseBlanker(INT32 hDevice,BOOL *Enabled);

Address retrieval

G65DDC_GET_ADC_NOISE_BLANKER GetADCNoiseBlanker=(G65DDC_GET_ADC_NOISE_BLANKER)GetProcAddress(hAPI,"GetADCNoiseBlanker");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
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.

SetADCNoiseBlankerThreshold

Specifies the ADC noise blanker threshold.

C/C++ declaration

BOOL __stdcall SetADCNoiseBlankerThreshold(INT32 hDevice,WORD Threshold);

Address retrieval

G65DDC_SET_ADC_NOISE_BLANKER_THRESHOLD SetADCNoiseBlankerThreshold=
    (G65DDC_SET_ADC_NOISE_BLANKER_THRESHOLD)GetProcAddress(hAPI,"SetADCNoiseBlankerThreshold");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Threshold
[in] Specifies the maximum acceptable input signal. The maximum possible value of threshold is 32767, in this case the noise blanker has no effect even if it is enabled using the SetADCNoiseBlanker 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

Use the GetADCNoiseBlankerThreshold function to retrieve the current threshold of the noise blanker.

GetADCNoiseBlankerThreshold

Determines the ADC noise blanker threshold.

C/C++ declaration

BOOL __stdcall GetADCNoiseBlankerThreshold(INT32 hDevice,WORD *Threshold);

Address retrieval

G65DDC_GET_ADC_NOISE_BLANKER_THRESHOLD GetADCNoiseBlankerThreshold=
    (G65DDC_GET_ADC_NOISE_BLANKER_THRESHOLD)GetProcAddress(hAPI,"GetADCNoiseBlankerThreshold");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Threshold
[out] Pointer to a variable which receives the threshold of 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.

StartADCSnapshots

Starts sending ADC snapshots.

C/C++ declaration

BOOL __stdcall StartADCSnapshots(INT32 hDevice,WORD Interval,UINT32 SamplesPerSnapshot);

Address retrieval

G65DDC_START_ADC_SNAPSHOTS StartADCSnapshots=(G65DDC_START_ADC_SNAPSHOTS)GetProcAddress(hAPI,"StartADCSnapshots");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Interval
[in] Specifies the time interval in milliseconds for how often the ADC snapshots are sent to the ADCSnapshotCallback callback function.
SamplesPerSnapshot
[in] Specifies the number of 16-bit samples per single ADC snapshot. In other words, it is the number of samples per buffer passed to the ADCSnapshotCallback callback function. It can be one of the following:

ValueNumber of samples per snapshot
G65DDC_ADC_SAMPLES_PER_SNAPSHOT_64K65536
G65DDC_ADC_SAMPLES_PER_SNAPSHOT_128K131072
G65DDC_ADC_SAMPLES_PER_SNAPSHOT_256K262144

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 G65DDC device has to be turned on using the SetPower function before use of StartADCSnapshots, otherwise the StartADCSnapshots function fails.

Too low a value of the Interval parameter and high number of samples per snapshot can dramatically increase data flow through USB/LAN which could cause failure of active streaming.


StopADCSnapshots

Stops sending ADC snapshots.

C/C++ declaration

BOOL __stdcall StopADCSnapshots(INT32 hDevice);

Address retrieval

G65DDC_STOP_ADC_SNAPSHOTS StopADCSnapshots=(G65DDC_STOP_ADC_SNAPSHOTS)GetProcAddress(hAPI,"StopADCSnapshots");

Parameters

hDevice
[in] Handle to G65DDC 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 ADCSnapshotCallback callback function is not called after StopADCSnapshots returns.


GetDDCInfo

Retrieves information about DDC format.

C/C++ declaration

BOOL __stdcall GetDDCInfo(INT32 hDevice,UINT32 DDCTypeIndex,G65DDC_DDC_INFO *DDCInfo);

Address retrieval

G65DDC_GET_DDC_INFO GetDDCInfo=(G65DDC_GET_DDC_INFO)GetProcAddress(hAPI,"GetDDCInfo");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDCTypeIndex
[in] Specifies the index of DDC type. For more information, see remarks.
DDCInfo
[out] Pointer to a G65DDC_DDC_INFO structure to be filled with information about 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 GetDDCCount function to determine the number of possible DDC types of DDC channel (DDC1 or DDC2). In this case the DDCTypeIndex parameter can vary from zero to one less than the number determined by the GetDDCCount.

Use the GetDDC function to determine the current DDC type index of DDC channel (DDC1 or DDC2).

DDC channels are created dynamically during run time when they are required. The DDC1 channel can be created using the CreateDDC1 function and the DDC2 channel can be created using the CreateDDC2 function.


CreateDDC1

Creates the primary digital down-converter (DDC1) channel. The DDC1 makes the down-conversion of the signal produced by the ADC.

C/C++ declaration

BOOL __stdcall CreateDDC1(INT32 hDevice,UINT32 *DDC1ChannelId);

Address retrieval

G65DDC_CREATE_DDC1 CreateDDC1=(G65DDC_CREATE_DDC1)GetProcAddress(hAPI,"CreateDDC1");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC1ChannelId
[out] Pointer to a variable which receives the identification number of a newly created DDC1 channel. The value of the identification number can vary from 0 to one less than sum of values of the MaxDDC1ChannelCount and MaxDDC2ChannelCount members of the G65DDC_DEVICE_INFO structure. 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 maximum number of DDC1 channels which can be created with the CreateDDC1 function, is determined by the MaxDDC1ChannelCount member of the G65DDC_DEVICE_INFO structure.

Use the DeleteDDC function to delete the DDC1 channel created by CreateDDC1.


CreateDDC2

Creates the secondary digital down-converter (DDC2) channel. The DDC2 channel makes the down-conversion of the signal produced by the primary digital down-converter (DDC1) and subsequently other signal processing like AGC, filtering, demodulation, etc.

C/C++ declaration

BOOL __stdcall CreateDDC2(INT32 hDevice,UINT32 DDC1ChannelId,UINT32 *DDC2ChannelId);

Address retrieval

G65DDC_CREATE_DDC2 CreateDDC2=(G65DDC_CREATE_DDC2)GetProcAddress(hAPI,"CreateDDC2");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC1ChannelId
[in] Identification number of the DDC1 channel created by the CreateDDC1 function. The signal from this DDC1 will be subsequently processed by a newly create DDC2 channel.
DDC2ChannelId
[out] Pointer to a variable which receives the identification number of a newly created DDC2 channel. The value of the identification number can vary from 0 to one less than sum of values of the MaxDDC1ChannelCount and MaxDDC2ChannelCount members of the G65DDC_DEVICE_INFO structure. 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 maximum number of DDC2 channels which can be created with the CreateDDC2 function, is determined by the MaxDDC2ChannelCount member of the G65DDC_DEVICE_INFO structure.

The maximum number of DDC2 channels which are connected to the same DDC1 channel, is determined by the MaxDDC2ChannelsPerDDC1Channel member of the G65DDC_DEVICE_INFO structure.

Use the DeleteDDC function to delete the DDC2 channel created by CreateDDC2.


DeleteDDC

Deletes the DDC (DDC1 or DDC2) channel previously created by the CreateDDC1 or CreateDDC2 function.

C/C++ declaration

BOOL __stdcall DeleteDDC(INT32 hDevice,UINT32 DDCChannelId);

Address retrieval

G65DDC_DELETE_DDC DeleteDDC=(G65DDC_DELETE_DDC)GetProcAddress(hAPI,"DeleteDDC");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDCChannelId
[in] Identification number of the DDC channel created by the CreateDDC1 or CreateDDC2 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

If DDCChannelId is the identification number of the DDC1 channel (primary DDC), the DeleteDDC function deletes this DDC1 channel including all the DDC2 (secondary DDC) channels connected to the deleted DDC1 channel. When the DeleteDDC returns, identification numbers of these DDC channels will be invalid and no longer usable.


GetDDCCount

Retrieves the number of DDC types supported by the given DDC channel (DDC1 or DDC2).

C/C++ declaration

BOOL __stdcall GetDDCCount(INT32 hDevice,UINT32 DDCChannelId,UINT32 *Count);

Address retrieval

G65DDC_GET_DDC_COUNT GetDDCCount=(G65DDC_GET_DDC_COUNT)GetProcAddress(hAPI,"GetDDCCount");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDCChannelId
[in] Identification number of the DDC channel created by the CreateDDC1 or CreateDDC2 function.
Count
[out] Pointer to a variable which receives the number of DDC types supported by the given DDC channel. 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

Different DDC channels can support a different number of DDC types.

The maximum number of DDC types supported by the DDC1 channel is determined by the MaxDDC1TypeCount member of the G65DDC_DEVICE_INFO structure. This number can be affected by the type of interface used for connection of the G65DDC device to computer. The G65DDC device, which is connected via LAN or USB2 interface, supports less DDC types than the device connected via USB3.

The maximum number of DDC types supported by the DDC2 channel is determined by the MaxDDC2TypeCount member of the G65DDC_DEVICE_INFO structure but it cannot be greater than the current DDC type index of the connected DDC1 channel + 1.


SetDDC

Sets the current DDC type in the given DDC channel (DDC1 or DDC2).

C/C++ declaration

BOOL __stdcall SetDDC(INT32 hDevice,UINT32 DDCChannelId,UINT32 DDCTypeIndex);

Address retrieval

G65DDC_SET_DDC SetDDC=(G65DDC_SET_DDC)GetProcAddress(hAPI,"SetDDC");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDCChannelId
[in] Identification number of the DDC channel created by the CreateDDC1 or CreateDDC2 function.
DDCTypeIndex
[in] Specifies the index of DDC type to be used in the specified DDC channel. It can vary from zero to one less than number of supported DDC types of the DDC channel.

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 GetDDCCount function to determine the number of possible DDC types of DDC channel. The DDCTypeIndex parameter can vary from zero to one less than the number determined by GetDDCCount.

The specified DDC channel must be idle, DDC streaming must not run when calling SetDDC. In other words, DDC streaming which is started using the StartDDC function has to be stopped using the StopDDC function before calling of SetDDC, otherwise SetDDC fails. The SetDDC function does not start and stop DDC streaming, it just changes the DDC type of the DDC channel.

Calling of SetDDC on the DDC1 channel can change the current DDC type of its DDC2 channels and current bandwidth of demodulator filters, so it is useful to call the GetDDC for DDC2 channels connected to the given DDC1 and GetDemodulatorFilterBandwidth functions immediately after SetDDC to determine the current DDC type of DDC2 channels and current bandwidth of demodulator filters.

Use the GetDDC function to determine the current DDC type of the DDC channel.


GetDDC

Retrieves information about the current DDC type of the DDC1 or DDC2 channel.

C/C++ declaration

BOOL __stdcall GetDDC(INT32 hDevice,UINT32 DDCChannelId,UINT32 *DDCTypeIndex,G65DDC_DDC_INFO *DDCInfo);

Address retrieval

G65DDC_GET_DDC GetDDC=(G65DDC_GET_DDC)GetProcAddress(hAPI,"GetDDC");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDCChannelId
[in] Identification number of the DDC channel created by the CreateDDC1 or CreateDDC2 function.
DDCTypeIndex
[out] Pointer to a variable which receives the index of current DDC type of the specified DDC channel. This parameter can be NULL if the application does not require this information.
DDCInfo
[out] Pointer to a G65DDC_DDC_INFO structure to be filled with information about the current DDC type of the specified DDC channel. 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

The BitsPerSample member of the G65DDC_DDC_INFO structure is not used and it can be ignored for DDC2 channels (if the DDCChannelId is identification number of DDC2 channel). I and Q samples in buffers passed to the DDC2StreamCallback and DDC2PreprocessedStreamCallback callback functions are always in IEEE float (32 bit, little endian) format.


SetDDCFrequency

Sets center frequency of the DDC1 or DDC2.

C/C++ declaration

BOOL __stdcall SetDDCFrequency(INT32 hDevice,UINT32 DDCChannelId,INT32 Frequency);

Address retrieval

G65DDC_SET_DDC_FREQUENCY SetDDCFrequency=(G65DDC_SET_DDC_FREQUENCY)GetProcAddress(hAPI,"SetDDCFrequency");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDCChannelId
[in] Identification number of DDC channel created by the CreateDDC1 or CreateDDC2 function.
Frequency
[in] Specifies the new center frequency of the DDC 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

If the value of the DDCChannelId parameter is the identification number of the DDC1 channel, the Frequency parameter specifies a new absolute center frequency of given DDC1 channel.

If the value of the DDCChannelId parameter is the identification number of the DDC2 channel, the Frequency specifies a new center frequency of the DDC2 channel relative to center frequency of its DDC1 channel. The value can be negative. The absolute center frequency of the DDC2 channel is given by the following formula:

faDDC2 = faDDC1 + frDDC2

Where faDDC2 is the absolute center frequency of DDC2 channel in Hz, faDDC1 is the absolute center frequency of the corresponding DDC1 channel in Hz and frDDC2 is the relative center frequency of DDC2 channel in Hz.

A change of center frequency of the DDC1 channel causes a change of absolute frequency of the DDC2 channels (and its demodulators) connected to the given DDC1 channel.

Use the GetDDCFrequency function to determine the current center frequency of the DDC1 or DDC2 channel.

The following example shows three methods of how it is possible to set the absolute DDC2 center frequency to 11.01 MHz:

INT32 hDevice; //Handle to G65DDC device returned by the OpenDevice function
UINT32 DDC1Id; //Identifier of the DDC1 channel created by the CreateDDC1 function: CreateDDC1(hDevice,&DDC1Id)
UINT32 DDC2Id; //Identifier of the DDC2 channel created by the CreateDDC2 function: CreateDDC2(hDevice,DDC1Id,&DDC2Id)

//1. method
SetRange(hDevice,G65DDC_RANGE_1); //Set active receiver's input to the range 1 (0 - 88 MHz)
SetDDCFrequency(hDevice,DDC1Id,11010000);
SetDDCFrequency(hDevice,DDC2Id,0);

//2. method, it can be used if bandwidth of DDC2 is less than bandwidth of DDC1
SetRange(hDevice,G65DDC_RANGE_1);
SetDDCFrequency(hDevice,DDC1Id,11000000);
SetDDCFrequency(hDevice,DDC2Id,10000);

//3. method, it can be used if bandwidth of DDC2 is less than bandwidth of DDC1
SetRange(hDevice,G65DDC_RANGE_1);
SetDDCFrequency(hDevice,DDC1Id,11020000);
SetDDCFrequency(hDevice,DDC2Id,-10000);

GetDDCFrequency

Retrieves the current center frequency of DDC1 or DDC2.

C/C++ declaration

BOOL __stdcall GetDDCFrequency(INT32 hDevice,UINT32 DDCChannelId,INT32 *Frequency);

Address retrieval

G65DDC_GET_DDC_FREQUENCY GetDDCFrequency=(G65DDC_GET_DDC_FREQUENCY)GetProcAddress(hAPI,"GetDDCFrequency");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDCChannelId
[in] Identification number of the DDC channel created by the CreateDDC1 or CreateDDC2 function.
Frequency
[out] Pointer to a variable which receives the current center frequency of the DDC1 or DDC2 channel 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.

Remarks

If the value of the DDCChannelId parameter is the identification number of the DDC1 channel, the received frequency is the absolute center frequency of the given DDC1 channel.

If the value of the DDCChannelId parameter is the identification number of the DDC2 channel, the received frequency is the center frequency of the DDC2 channel relative to the center frequency of its DDC1 channel.


StartDDC

Starts DDC1 or DDC2 streaming.

C/C++ declaration

BOOL __stdcall StartDDC(INT32 hDevice,UINT32 DDCChannelId,UINT32 SampleSetsPerBuffer);

Address retrieval

G65DDC_START_DDC StartDDC=(G65DDC_START_DDC)GetProcAddress(hAPI,"StartDDC");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDCChannelId
[in] Identification number of the DDC channel created by the CreateDDC1 or CreateDDC2 function.
SampleSetsPerBuffer
[in] If the DDCChannelId is the identification number of the DDC1 channel, this parameter specifies the number of I/Q sample sets in each buffer passed to the DDC1StreamCallback callback function. If the DDCChannelId parameter is the identification number of the DDC2, the SampleSetsPerBuffer specifies the number of I/Q sample sets in each buffer passed to the DDC2StreamCallback and DDC2StreamCallback callback functions. If the current DDC type index (specified by the SetDDC function) is less than or equal to 24 (DDC bandwidth <= 5 MHz) the value of the SampleSetsPerBuffer has to be a multiple of 64. If the current DDC type index is greater than 24 (DDC bandwidth > 5 MHz), the SampleSetsPerBuffer has to be a multiple of 1024. If the value of the SampleSetsPerBuffer is not a multiple of 64/1024, the function rounds it up to the nearest multiple of 64/1024. If it is zero, the StartDDC function fails.

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 G65DDC device has to be turned on using the SetPower function before StartDDC is used otherwise StartDDC fails.

If the DDC streaming is already running before use of StartDDC, StartDDC fails.

If the DDCChannelId is the identification number of the DDC2 channel, streaming in the connected DDC1 channel has to be already started (using StartDDC or the StartDDC1Playback function) before starting the DDC2 streaming.

Use the StopDDC function to stop streaming in the given DDC channel.

Decreasing the value of the SampleSetsPerBuffer parameter decreases latency and may increase CPU usage. Increasing the value of the SampleSetsPerBuffer parameter increases latency and may decrease CPU usage.


StopDDC

Stops DDC1 or DDC2 streaming.

C/C++ declaration

BOOL __stdcall StopDDC(INT32 hDevice,UINT32 DDCChannelId);

Address retrieval

G65DDC_STOP_DDC StopDDC=(G65DDC_STOP_DDC)GetProcAddress(hAPI,"StopDDC");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDCChannelId
[in] Identification number of the DDC channel created by the CreateDDC1 or CreateDDC2 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

If streaming is not active in the given DDC channel, StopDDC does nothing.

If the DDCChannelId parameter specifies the identification number of the DDC1 channel, the StopDDC function also stops all the streaming beyond this DDC channel in the processing chain (DDC2 and audio streaming in all the connected channels).

If DDC1 playback is running (started using StartDDC1Playback) before use of StopDDC, the StopDDC function stops it.

The DDC1StreamCallback and DDC1PlaybackStreamCallback callback functions are not called after StopDDC returns.

If the DDCChannelId parameter specifies the identification number of the DDC2 channel, the StopDDC function also stops the corresponding audio streaming.

The DDC2StreamCallback and DDC2PreprocessedStreamCallback callback functions are not called after StopDDC returns.


StartDDC1Playback

Starts DDC1 playback. It allows passing of 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 DDC1ChannelId,UINT32 SampleSetsPerBuffer,UINT32 BitsPerSample);

Address retrieval

G65DDC_START_DDC1_PLAYBACK StartDDC1Playback=(G65DDC_START_DDC1_PLAYBACK)GetProcAddress(hAPI,"StartDDC1Playback");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC1ChannelId
[in] Identification number of the DDC1 channel created by the CreateDDC1 function.
SampleSetsPerBuffer
[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. If the current DDC type index (specified by the SetDDC function) is less than or equal to 24 (DDC bandwidth <= 5 MHz) the value of the SampleSetsPerBuffer has to be a multiple of 64. If the current the DDC type index is greater than 24 (DDC bandwidth > 5 MHz), the SampleSetsPerBuffer has to be a multiple of 1024. If the value of the SampleSetsPerBuffer is not a multiple of 64/1024, the function rounds it up to the nearest multiple of 64/1024. If it is zero, the StartDDC1Playback function fails.
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:

ValueMeaning
0I and Q samples have a default number of bits. It is given by BitsPerSample member of the G65DDC_DDC_INFO structure which can be retrieved using the GetDDC or GetDDCInfo function. Possible values are 16 or 32 bits per sample, signed, little endian.
16I and Q samples have 16 bit (16 bits per I, 16 bits per Q), signed, little endian.
32I 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 G65DDC device has to be turned on using the SetPower function before use of StartDDC1Playback.

If the DDC streaming is already running before use of StartDDC1Playback, StartDDC1Playback fails.

Use the StopDDC function to stop DDC1 playback.


PauseDDC1Playback

Pauses DDC1 playback.

C/C++ declaration

BOOL __stdcall PauseDDC1Playback(INT32 hDevice,UINT32 DDC1ChannelId);

Address retrieval

G65DDC_PAUSE_DDC1_PLAYBACK PauseDDC1Playback=(G65DDC_PAUSE_DDC1_PLAYBACK)GetProcAddress(hAPI,"PauseDDC1Playback");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC1ChannelId
[in] Identification number of the DDC1 channel created by the CreateDDC1 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

If DDC1 playback is not active or 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.


ResumeDDC1Playback

Resumes paused DDC1 playback.

C/C++ declaration

BOOL __stdcall ResumeDDC1Playback(INT32 hDevice,UINT32 DDC1ChannelId);

Address retrieval

G65DDC_RESUME_DDC1_PLAYBACK ResumeDDC1Playback=(G65DDC_RESUME_DDC1_PLAYBACK)GetProcAddress(hAPI,"ResumeDDC1Playback");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC1ChannelId
[in] Identification number of the DDC1 channel created by the CreateDDC1 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

If DDC1 playback is not active or is not paused, ResumeDDC1Playback does nothing.


SetDDC2NoiseBlanker

Enables or disables the noise blanker on DDC2 stream.

C/C++ declaration

BOOL __stdcall SetDDC2NoiseBlanker(INT32 hDevice,UINT32 DDC2ChannelId,BOOL Enabled);

Address retrieval

G65DDC_SET_DDC2_NOISE_BLANKER SetDDC2NoiseBlanker=(G65DDC_SET_DDC2_NOISE_BLANKER)GetProcAddress(hAPI,"SetDDC2NoiseBlanker");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
Enabled
[in] Specifies whether to enable or disable the 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.

GetDDC2NoiseBlanker

Retrieves the current DDC2 noise blanker state.

C/C++ declaration

BOOL __stdcall GetDDC2NoiseBlanker(INT32 hDevice,UINT32 DDC2ChannelId,BOOL *Enabled);

Address retrieval

G65DDC_GET_DDC2_NOISE_BLANKER GetDDC2NoiseBlanker=(G65DDC_GET_DDC2_NOISE_BLANKER)GetProcAddress(hAPI,"GetDDC2NoiseBlanker");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
Enabled
[out] Pointer to a variable which receives the current state of the noise blanker. The value is non-zero if the 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.

SetDDC2NoiseBlankerThreshold

Specifies the DDC2 noise blanker threshold.

C/C++ declaration

BOOL __stdcall SetDDC2NoiseBlankerThreshold(INT32 hDevice,UINT32 DDC2ChannelId,double Threshold);

Address retrieval

G65DDC_SET_DDC2_NOISE_BLANKER_THRESHOLD SetDDC2NoiseBlankerThreshold=
    (G65DDC_SET_DDC2_NOISE_BLANKER_THRESHOLD)GetProcAddress(hAPI,"SetDDC2NoiseBlankerThreshold");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
Threshold
[in] Specifies the 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.

GetDDC2NoiseBlankerThreshold

Retrieves the DDC2 noise blanker threshold.

C/C++ declaration

BOOL __stdcall GetDDC2NoiseBlankerThreshold(INT32 hDevice,UINT32 DDC2ChannelId,double *Threshold);

Address retrieval

G65DDC_GET_DDC2_NOISE_BLANKER_THRESHOLD GetDDC2NoiseBlankerThreshold=
    (G65DDC_GET_DDC2_NOISE_BLANKER_THRESHOLD)GetProcAddress(hAPI,"GetDDC2NoiseBlankerThreshold");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

GetDDC2NoiseBlankerExcessValue

Determines a value which indicates the percentage ratio between the 'short time average signal level' and 'maximum level'.

C/C++ declaration

BOOL __stdcall GetDDC2NoiseBlankerExcessValue(INT32 hDevice,UINT32 DDC2ChannelId,double *Value);

Address retrieval

G65DDC_GET_DDC2_NOISE_BLANKER_EXCESS_VALUE GetDDC2NoiseBlankerExcessValue=
    (G65DDC_GET_DDC2_NOISE_BLANKER_EXCESS_VALUE)GetProcAddress(hAPI,"GetDDC2NoiseBlankerExcessValue");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
Value
[out] Pointer to a variable which receives the 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.

GetSignalLevel

Determines the current signal level for the given channel.

C/C++ declaration

BOOL __stdcall GetSignalLevel(INT32 hDevice,UINT32 DDC2ChannelId,FLOAT *Peak,FLOAT *RMS);

Address retrieval

G65DDC_GET_SIGNAL_LEVEL GetSignalLevel=(G65DDC_GET_SIGNAL_LEVEL)GetProcAddress(hAPI,"GetSignalLevel");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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 StartDDC function) before calling of GetSignalLevel, otherwise the returned peak and RMS signal level values are invalid.

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 demodulator filter. Buffer size (signal level evaluation rate) is given by the SampleSetsPerBuffer parameter of the StartDDC function.

The DDC2PreprocessedStreamCallback callback function provides the signal level for each buffer passed to the callback, i.e. for each buffer used in the signal level evaluation. This provides a way to get the signal level from each processed buffer without the need to poll 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 the RMS signal level in Volts obtained by GetSignalLevel, R is the G65DDC receiver input impedance (50 Ω), P[W] is power in Watts and P[dBm] is power in dBm and 1000 is conversion coefficient W -> mW.

The following example shows how to obtain the current signal level in dBm from DDC2 channel:

#include <stdio.h>
#include <math.h>

INT32 hDevice; //Handle to G65DDC device returned by the OpenDevice function
UINT32 DDC1Id; //Identifier of the DDC1 channel created by the CreateDDC1 function: CreateDDC1(hDevice,&DDC1Id)
UINT32 DDC2Id; //Identifier of the DDC2 channel created by the CreateDDC2 function: CreateDDC2(hDevice,DDC1Id,&DDC2Id)
float P_dBm,V_RMS;

GetSignalLevel(hDevice,DDC2Id,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);

SetNotchFilter

Enables or disables the notch filter for the given channel.

C/C++ declaration

BOOL __stdcall SetNotchFilter(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 NotchFilterIndex,BOOL Enabled);

Address retrieval

G65DDC_SET_NOTCH_FILTER SetNotchFilter=(G65DDC_SET_NOTCH_FILTER)GetProcAddress(hAPI,"SetNotchFilter");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

GetNotchFilter

Retrieves the current notch filter state for the given channel.

C/C++ declaration

BOOL __stdcall GetNotchFilter(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 NotchFilterIndex,BOOL *Enabled);

Address retrieval

G65DDC_SET_NOTCH_FILTER SetNotchFilter=(G65DDC_SET_NOTCH_FILTER)GetProcAddress(hAPI,"SetNotchFilter");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetNotchFilterFrequency

Specifies the relative center frequency of the notch filter for the given channel.

C/C++ declaration

BOOL __stdcall SetNotchFilterFrequency(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 NotchFilterIndex,INT32 Frequency);

Address retrieval

G65DDC_SET_NOTCH_FILTER_FREQUENCY SetNotchFilterFrequency=
        (G65DDC_SET_NOTCH_FILTER_FREQUENCY)GetProcAddress(hAPI,"SetNotchFilterFrequency");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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

The value of the Frequency parameter is the new center frequency of the notch filter relative to center of the DDC2 (see the SetDDCFrequency function). The value can be negative.

Use the GetNotchFilterFrequency function to retrieve the current center frequency of the notch filter.


GetNotchFilterFrequency

Retrieves the current relative center frequency of the notch filter.

C/C++ declaration

BOOL __stdcall GetNotchFilterFrequency(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 NotchFilterIndex,INT32 *Frequency);

Address retrieval

G65DDC_GET_NOTCH_FILTER_FREQUENCY GetNotchFilterFrequency=
        (G65DDC_GET_NOTCH_FILTER_FREQUENCY)GetProcAddress(hAPI,"GetNotchFilterFrequency");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetNotchFilterBandwidth

Specifies the bandwidth of the notch filter for the given channel.

C/C++ declaration

BOOL __stdcall SetNotchFilterBandwidth(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 NotchFilterIndex,UINT32 Bandwidth);

Address retrieval

G65DDC_SET_NOTCH_FILTER_BANDWIDTH SetNotchFilterBandwidth=
        (G65DDC_SET_NOTCH_FILTER_BANDWIDTH)GetProcAddress(hAPI,"SetNotchFilterBandwidth");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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 - 5000 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.


GetNotchFilterBandwidth

Retrieves the current bandwidth of the notch filter for the given channel.

C/C++ declaration

BOOL __stdcall GetNotchFilterBandwidth(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 NotchFilterIndex,UINT32 *Bandwidth);

Address retrieval

G65DDC_GET_NOTCH_FILTER_BANDWIDTH GetNotchFilterBandwidth=
        (G65DDC_GET_NOTCH_FILTER_BANDWIDTH)GetProcAddress(hAPI,"GetNotchFilterBandwidth");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetNotchFilterLength

Specifies the notch filter length for the given channel. The notch filter is implemented as an FIR filter. This function specifies the number of coefficients used in the filtration procedure.

C/C++ declaration

BOOL __stdcall SetNotchFilterLength(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 NotchFilterIndex,UINT32 Length);

Address retrieval

G65DDC_SET_NOTCH_FILTER_LENGTH SetNotchFilterLength=
        (G65DDC_SET_NOTCH_FILTER_LENGTH)GetProcAddress(hAPI,"SetNotchFilterLength");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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 8, greater than or equal to 64 and less than or equal to 32768. If it is not multiple of 8, the function rounds it up to the nearest multiple of 8.

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 given DDC2 channel has to be idle (streaming is not started using the StartDDC function) when calling the SetNotchFilterLength function, otherwise it fails.

Increasing the filter length increases the filter steepness and may increase CPU usage.

Use the GetNotchFilterLength function to determine current length of the notch filter.


GetNotchFilterLength

Retrieves the current notch filter length for the given channel.

C/C++ declaration

BOOL __stdcall GetNotchFilterLength(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 NotchFilterIndex,UINT32 *Length);

Address retrieval

G65DDC_GET_NOTCH_FILTER_LENGTH GetNotchFilterLength=
        (G65DDC_GET_NOTCH_FILTER_LENGTH)GetProcAddress(hAPI,"GetNotchFilterLength");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetAGC

Enables or disables the AGC for the given channel.

C/C++ declaration

BOOL __stdcall SetAGC(INT32 hDevice,UINT32 DDC2ChannelId,BOOL Enabled);

Address retrieval

G65DDC_SET_AGC SetAGC=(G65DDC_SET_AGC)GetProcAddress(hAPI,"SetAGC");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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 the 'fixed gain' specified using the SetGain function.

Use the GetAGC function to determine the current state of the AGC.


GetAGC

Retrieves the current state of the AGC for the given channel.

C/C++ declaration

BOOL __stdcall GetAGC(INT32 hDevice,UINT32 DDC2ChannelId,BOOL *Enabled);

Address retrieval

G65DDC_GET_AGC GetAGC=(G65DDC_GET_AGC)GetProcAddress(hAPI,"GetAGC");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetAGCParams

Sets parameters of the AGC for the given channel.

C/C++ declaration

BOOL __stdcall SetAGCParams(INT32 hDevice,UINT32 DDC2ChannelId,double AttackTime,double DecayTime,double ReferenceLevel);

Address retrieval

G65DDC_SET_AGC_PARAMS SetAGCParams=(G65DDC_SET_AGC_PARAMS)GetProcAddress(hAPI,"SetAGCParams");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.


GetAGCParams

Retrieves the current parameters of the AGC for the given channel.

C/C++ declaration

BOOL __stdcall GetAGCParams(INT32 hDevice,UINT32 DDC2ChannelId,double *AttackTime,double *DecayTime,double *ReferenceLevel);

Address retrieval

G65DDC_GET_AGC_PARAMS GetAGCParams=(G65DDC_GET_AGC_PARAMS)GetProcAddress(hAPI,"GetAGCParams");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetMaxAGCGain

Sets maximum gain of the AGC for the given channel.

C/C++ declaration

BOOL __stdcall SetMaxAGCGain(INT32 hDevice,UINT32 DDC2ChannelId,double MaxGain);

Address retrieval

G65DDC_SET_MAX_AGC_GAIN SetMaxAGCGain=(G65DDC_SET_MAX_AGC_GAIN)GetProcAddress(hAPI,"SetMaxAGCGain");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.


GetMaxAGCGain

Retrieves the current maximum gain of the AGC for the given channel.

C/C++ declaration

BOOL __stdcall GetMaxAGCGain(INT32 hDevice,UINT32 DDC2ChannelId,double *MaxGain);

Address retrieval

G65DDC_GET_MAX_AGC_GAIN GetMaxAGCGain=(G65DDC_GET_MAX_AGC_GAIN)GetProcAddress(hAPI,"GetMaxAGCGain");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetGain

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 DDC2ChannelId,double Gain);

Address retrieval

G65DDC_SET_GAIN SetGain=(G65DDC_SET_GAIN)GetProcAddress(hAPI,"SetGain");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.


GetGain

Retrieves the current fixed gain for the given channel.

C/C++ declaration

BOOL __stdcall GetGain(INT32 hDevice,UINT32 DDC2ChannelId,double *Gain);

Address retrieval

G65DDC_GET_GAIN GetGain=(G65DDC_GET_GAIN)GetProcAddress(hAPI,"GetGain");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

GetCurrentGain

Retrieves the current gain that is applied to the I/Q signal.

C/C++ declaration

BOOL __stdcall GetCurrentGain(INT32 hDevice,UINT32 DDC2ChannelId,double *CurrentGain);

Address retrieval

G65DDC_GET_CURRENT_GAIN GetCurrentGain=(G65DDC_GET_CURRENT_GAIN)GetProcAddress(hAPI,"GetCurrentGain");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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 a fixed gain that is specified using the SetGain function.

SetDemodulatorFilterBandwidth

Sets bandwidth of the demodulator filter for the given channel.

C/C++ declaration

BOOL __stdcall SetDemodulatorFilterBandwidth(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 Bandwidth);

Address retrieval

G65DDC_SET_DEMODULATOR_FILTER_BANDWIDTH SetDemodulatorFilterBandwidth=
    (G65DDC_SET_DEMODULATOR_FILTER_BANDWIDTH)GetProcAddress(hAPI,"SetDemodulatorFilterBandwidth");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
Bandwidth
[in] Specifies the new bandwidth of the demodulator filter in Hz. Possible values range from 1 Hz to the current DDC2 bandwidth. Use the GetDDC function 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 by changing the DDC type of the corresponding DDC1 channel (using the SetDDC 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 SetDDC.

GetDemodulatorFilterBandwidth

Retrieves the current demodulator filter bandwidth for the given channel.

C/C++ declaration

BOOL __stdcall GetDemodulatorFilterBandwidth(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 *Bandwidth);

Address retrieval

G65DDC_GET_DEMODULATOR_FILTER_BANDWIDTH GetDemodulatorFilterBandwidth=
    (G65DDC_GET_DEMODULATOR_FILTER_BANDWIDTH)GetProcAddress(hAPI,"GetDemodulatorFilterBandwidth");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetDemodulatorFilterShift

Sets the demodulator filter shift for the given channel.

C/C++ declaration

BOOL __stdcall SetDemodulatorFilterShift(INT32 hDevice,UINT32 DDC2ChannelId,INT32 Shift);

Address retrieval

G65DDC_SET_DEMODULATOR_FILTER_SHIFT SetDemodulatorFilterShift=
    (G65DDC_SET_DEMODULATOR_FILTER_SHIFT)GetProcAddress(hAPI,"SetDemodulatorFilterShift");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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

The 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.


GetDemodulatorFilterShift

Retrieves the current shift of the demodulator filter for the given channel.

C/C++ declaration

BOOL __stdcall GetDemodulatorFilterShift(INT32 hDevice,UINT32 DDC2ChannelId,INT32 *Shift);

Address retrieval

G65DDC_GET_DEMODULATOR_FILTER_SHIFT GetDemodulatorFilterShift=
    (G65DDC_GET_DEMODULATOR_FILTER_SHIFT)GetProcAddress(hAPI,"GetDemodulatorFilterShift");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetDemodulatorFilterLength

Specifies the 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 DDC2ChannelId,UINT32 Length);

Address retrieval

G65DDC_SET_DEMODULATOR_FILTER_LENGTH SetDemodulatorFilterLength=
    (G65DDC_SET_DEMODULATOR_FILTER_LENGTH)GetProcAddress(hAPI,"SetDemodulatorFilterLength");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
Length
[in] Specifies the length of the demodulator filter. The value has to be multiple of 8, greater than or equal to 64 and less than or equal to 32768. If it is not a multiple of 8, the function rounds it up to nearest multiple of 8.

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 given DDC2 channel has to be idle (streaming is not started using the StartDDC function) when calling the SetDemodulatorFilterLength function, otherwise it fails.

Increasing the filter length increases the filter steepness and may increase CPU usage.

Use the GetDemodulatorFilterLength function to determine the current length of the demodulator filter.


GetDemodulatorFilterLength

Retrieves the current length of the demodulator filter for the given channel.

C/C++ declaration

BOOL __stdcall GetDemodulatorFilterLength(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 *Length);

Address retrieval

G65DDC_GET_DEMODULATOR_FILTER_LENGTH GetDemodulatorFilterLength=
    (G65DDC_GET_DEMODULATOR_FILTER_LENGTH)GetProcAddress(hAPI,"GetDemodulatorFilterLength");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetDemodulatorMode

Sets the demodulator mode for the given channel.

C/C++ declaration

BOOL __stdcall SetDemodulatorMode(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 Mode);

Address retrieval

G65DDC_SET_DEMODULATOR_MODE SetDemodulatorMode=(G65DDC_SET_DEMODULATOR_MODE)GetProcAddress(hAPI,"SetDemodulatorMode");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
Mode
[in] Specifies new the demodulator mode. This value can be one of the following:

ValueMeaning
G65DDC_MODE_AMAmplitude modulation
G65DDC_MODE_AMSAmplitude modulation
G65DDC_MODE_LSBLower sideband modulation
G65DDC_MODE_USBUpper sideband modulation
G65DDC_MODE_DSBDouble sideband modulation
G65DDC_MODE_ISBIndependent sideband modulation
G65DDC_MODE_CWContinuous wave
G65DDC_MODE_FMFrequency modulation
G65DDC_MODE_DRMDigital 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 can be viewed at https://www.winradio.com/home/drm.htm.

Use the GetDemodulatorMode function to retrieve the current demodulator mode.


GetDemodulatorMode

Retrieves the current demodulator mode for the given channel.

C/C++ declaration

BOOL __stdcall GetDemodulatorMode(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 *Mode);

Address retrieval

G65DDC_GET_DEMODULATOR_MODE GetDemodulatorMode=(G65DDC_GET_DEMODULATOR_MODE)GetProcAddress(hAPI,"GetDemodulatorMode");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetDemodulatorFrequency

Sets the relative center frequency of the demodulator for the given channel.

C/C++ declaration

BOOL __stdcall SetDemodulatorFrequency(INT32 hDevice,UINT32 DDC2ChannelId,INT32 Frequency);

Address retrieval

G65DDC_SET_DEMODULATOR_FREQUENCY SetDemodulatorFrequency=
    (G65DDC_SET_DEMODULATOR_FREQUENCY)GetProcAddress(hAPI,"SetDemodulatorFrequency");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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

The value of the Frequency parameter is the center frequency of the demodulator relative to the center of the DDC2. The value can be negative.

The absolute frequency of the demodulator is given by the following formula:

faDEM = faDDC1 + frDDC2 + frDEM

Where faDEM is the absolute center frequency of the demodulator in Hz, faDDC1 is the absolute center frequency of the DDC1 in Hz (set using the SetDDCFrequency function), frDDC2 is the relative center frequency of DDC2 in Hz (set using the SetDDCFrequency) and frDEM is relative center frequency of the demodulator in Hz (set using SetDemodulatorFrequency).

The 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 of how to set the absolute demodulator center frequency to 11.01 MHz:

INT32 hDevice; //Handle to G65DDC device returned by the OpenDevice function
UINT32 DDC1Id; //Identifier of the DDC1 channel created by the CreateDDC1 function: CreateDDC1(hDevice,&DDC1Id)
UINT32 DDC2Id; //Identifier of the DDC2 channel created by the CreateDDC2 function: CreateDDC2(hDevice,DDC1Id,&DDC2Id)

//1. method
SetRange(hDevice,G65DDC_RANGE_1); //Set active receiver's input to the range 1 (0 - 88 MHz)
SetDDCFrequency(hDevice,DDC1Id,11010000);
SetDDCFrequency(hDevice,DDC2Id,0);
SetDemodulatorFrequency(hDevice,DDC2Id,0);

//2. method
SetRange(hDevice,G65DDC_RANGE_1);
SetDDCFrequency(hDevice,DDC1Id,11000000);
SetDDCFrequency(hDevice,DDC2Id,10000);
SetDemodulatorFrequency(hDevice,DDC2Id,0);

//3. method
SetRange(hDevice,G65DDC_RANGE_1);
SetDDCFrequency(hDevice,DDC1Id,11020000);
SetDDCFrequency(hDevice,DDC2Id,-5000);
SetDemodulatorFrequency(hDevice,DDC2Id,-5000);

//4. method
SetFrequency(hDevice,DDC2Id,11010000); 
//The SetFrequency function selects proper receiver's input range and sets DDC1, DDC2 and demodulator
//center frequencies so that demodulator's absolute frequency is set to the required frequency

GetDemodulatorFrequency

Retrieves the current relative center frequency of the demodulator for the given channel.

C/C++ declaration

BOOL __stdcall GetDemodulatorFrequency(INT32 hDevice,UINT32 DDC2ChannelId,INT32 *Frequency);

Address retrieval

G65DDC_GET_DEMODULATOR_FREQUENCY GetDemodulatorFrequency=
    (G65DDC_GET_DEMODULATOR_FREQUENCY)GetProcAddress(hAPI,"GetDemodulatorFrequency");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetDemodulatorParam

Sets a parameter of the demodulation for the given channel.

C/C++ declaration

BOOL __stdcall SetDemodulatorParam(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 Code,CONST VOID *Buffer,UINT32 BufferSize);

Address retrieval

G65DDC_SET_DEMODULATOR_PARAM SetDemodulatorParam=
    (G65DDC_SET_DEMODULATOR_PARAM)GetProcAddress(hAPI,"SetDemodulatorParam");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
Code
[in] Specifies the code of the demodulator parameter to be set by this function. The code can be one of the following:

ValueMeaning
G65DDC_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:

G65DDC_SIDE_BAND_LOWER
AMS demodulator will use lower sideband

G65DDC_SIDE_BAND_UPPER
AMS demodulator will use upper sideband

G65DDC_SIDE_BAND_BOTH
AMS demodulator will use both side bands.

G65DDC_DEMODULATOR_PARAM_AMS_CAPTURE_RANGE

Capture range of synchronous AM demodulator.

The Buffer parameter has to be pointer to a G65DDC_AMS_CAPTURE_RANGE structure, and the BufferSize parameter has to be sizeof(G65DDC_AMS_CAPTURE_RANGE).

G65DDC_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.

G65DDC_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:

G65DDC_SIDE_BAND_LOWER
DSB demodulator will use lower sideband

G65DDC_SIDE_BAND_UPPER
DSB demodulator will use upper sideband

G65DDC_SIDE_BAND_BOTH
DSB demodulator will use both side bands.

G65DDC_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:

G65DDC_SIDE_BAND_LOWER
ISB demodulator will use lower sideband

G65DDC_SIDE_BAND_UPPER
ISB demodulator will use upper sideband

G65DDC_SIDE_BAND_BOTH
ISB demodulator will use both side bands.

G65DDC_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 values are: 1, 2, 3, 4, where 1 is the first audio service, 2 is the second one, etc. Use the GetDemodulatorState function with G65DDC_DEMODULATOR_STATE_DRM_STATUS to retrieve information about available audio services for currently received DRM station.

G65DDC_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 values are: 1, 2, 3, 4, where 1 is the first multimedia service, 2 is the second one, etc. Use the GetDemodulatorState function with G65DDC_DEMODULATOR_STATE_DRM_STATUS to retrieve information about available multimedia services for currently received DRM station.

It is required that DRM multimedia player has to be installed to display multimedia content. It is included in G65DDC software installer as an option.

Buffer
[in] Pointer to a buffer containing the value of the demodulator parameter which this 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.

GetDemodulatorParam

Retrieves a parameter of the demodulation for the given channel.

C/C++ declaration

BOOL __stdcall GetDemodulatorParam(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 Code,VOID *Buffer,UINT32 BufferSize);

Address retrieval

G65DDC_GET_DEMODULATOR_PARAM GetDemodulatorParam=
    (G65DDC_GET_DEMODULATOR_PARAM)GetProcAddress(hAPI,"GetDemodulatorParam");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
Code
[in] Specifies the 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.

GetDemodulatorState

Retrieves information about the current demodulator state for the given channel.

C/C++ declaration

BOOL __stdcall GetDemodulatorState(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 Code,VOID *Buffer,UINT32 BufferSize);

Address retrieval

G65DDC_GET_DEMODULATOR_STATE GetDemodulatorState=
    (G65DDC_GET_DEMODULATOR_STATE)GetProcAddress(hAPI,"GetDemodulatorState");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
Code
[in] Specifies the code of the demodulator state to be retrieved. The code can be one of the following:

ValueMeaning
G65DDC_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.

G65DDC_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).

G65DDC_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).

G65DDC_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.

G65DDC_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).

G65DDC_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.

G65DDC_DEMODULATOR_STATE_DRM_STATUS

Status of DRM demodulator/decoder.

The Buffer parameter has to be pointer to a G65DDC_DRM_STATUS structure, and the BufferSize parameter has to be sizeof(G65DDC_DRM_STATUS).

G65DDC_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).

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.

StartAudio

Starts audio streaming for the given channel.

C/C++ declaration

BOOL __stdcall StartAudio(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 SampleSetsPerBuffer);

Address retrieval

G65DDC_START_AUDIO StartAudio=(G65DDC_START_AUDIO)GetProcAddress(hAPI,"StartAudio");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
SampleSetsPerBuffer
[in] Specifies the number of sample sets in each buffer passed to the AudioStreamCallback callback function (the sample set consists of two samples). The value has to be a multiple of 64 greater than zero. If it is zero, the StartAudio 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

Before StartAudio is used, the G65DDC device has to be turned on using the SetPower function, DDC1 streaming has to be started using the StartDDC or StartDDC1Playback function and DDC2 streaming has to be started using the StartDDC function, otherwise StartAudio fails.

If the audio streaming for the given DDC2 channel is already running, StartAudio fails.

Use the StopAudio function to stop audio streaming.

Decreasing the value of the SampleSetsPerBuffer parameter decreases latency and may increase CPU usage. Increasing value of the SampleSetsPerBuffer parameter increases latency and may decrease CPU usage.


StopAudio

Stops audio streaming for the given channel.

C/C++ declaration

BOOL __stdcall StopAudio(INT32 hDevice,UINT32 DDC2ChannelId);

Address retrieval

G65DDC_STOP_AUDIO StopAudio=(G65DDC_STOP_AUDIO)GetProcAddress(hAPI,"StopAudio");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 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

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.


StartAudioPlayback

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 DDC2ChannelId,UINT32 SampleSetsPerBuffer);

Address retrieval

G65DDC_START_AUDIO_PLAYBACK StartAudioPlayback=(G65DDC_START_AUDIO_PLAYBACK)GetProcAddress(hAPI,"StartAudioPlayback");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
SampleSetsPerBuffer
[in] Specifies the number of sample sets in each buffer passed to the AudioPlaybackStreamCallback callback to fill the buffer by the application and to the AudioStreamCallback callback function (the sample set consists of two samples). The value has to be a multiple of 64 greater than zero. If it is zero, the StartAudioPlayback 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 G65DDC device has to be turned on using SetPower function before use of StartAudioPlayback.

If the audio streaming for the given DDC2 channel is already running, StartAudioPlayback fails.

Use the StopAudio function to stop audio playback.


PauseAudioPlayback

Pauses audio playback for the given channel.

C/C++ declaration

BOOL __stdcall PauseAudioPlayback(INT32 hDevice,UINT23 DDC2ChannelId);

Address retrieval

G65DDC_PAUSE_AUDIO_PLAYBACK PauseAudioPlayback=(G65DDC_PAUSE_AUDIO_PLAYBACK)GetProcAddress(hAPI,"PauseAudioPlayback");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 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

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.


ResumeAudioPlayback

Resumes paused audio playback for the given channel.

C/C++ declaration

BOOL __stdcall ResumeAudioPlayback(INT32 hDevice,UINT32 DDC2ChannelId);

Address retrieval

G65DDC_RESUME_AUDIO_PLAYBACK ResumeAudioPlayback=(G65DDC_RESUME_AUDIO_PLAYBACK)GetProcAddress(hAPI,"ResumeAudioPlayback");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 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

If audio playback is not active or not paused, ResumeAudioPlayback does nothing.


SetAudioGain

Sets fixed audio gain for the given channel.

C/C++ declaration

BOOL __stdcall SetAudioGain(INT32 hDevice,UINT32 DDC2ChannelId,double Gain);

Address retrieval

G65DDC_SET_AUDIO_GAIN SetAudioGain=(G65DDC_SET_AUDIO_GAIN)GetProcAddress(hAPI,"SetAudioGain");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
Gain
[in] Specifies a 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

Use the GetAudioGain function to retrieve the current audio gain.

GetAudioGain

Retrieves the current fixed audio gain for the given channel.

C/C++ declaration

BOOL __stdcall GetAudioGain(INT32 hDevice,UINT32 DDC2ChannelId,double *Gain);

Address retrieval

G65DDC_GET_AUDIO_GAIN GetAudioGain=(G65DDC_GET_AUDIO_GAIN)GetProcAddress(hAPI,"GetAudioGain");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
Gain
[out] Pointer to a variable that 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.

SetAudioFilter

Enables or disables the audio filter for the given channel.

C/C++ declaration

BOOL __stdcall SetAudioFilter(INT32 hDevice,UINT32 DDC2ChannelId,BOOL Enabled);

Address retrieval

G65DDC_SET_AUDIO_FILTER SetAudioFilter=(G65DDC_SET_AUDIO_FILTER)GetProcAddress(hAPI,"SetAudioFilter");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

GetAudioFilter

Retrieves the current state of the audio filter for the given channel.

C/C++ declaration

BOOL __stdcall GetAudioFilter(INT32 hDevice,UINT32 DDC2ChannelId,BOOL *Enabled);

Address retrieval

G65DDC_GET_AUDIO_FILTER GetAudioFilter=(G65DDC_GET_AUDIO_FILTER)GetProcAddress(hAPI,"GetAudioFilter");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetAudioFilterParams

Sets the parameters of the audio filter for the given channel.

C/C++ declaration

BOOL __stdcall SetAudioFilterParams(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 CutOffLow,UINT32 CutOffHigh,double Deemphasis);

Address retrieval

G65DDC_SET_AUDIO_FILTER_PARAMS SetAudioFilterParams=
    (G65DDC_SET_AUDIO_FILTER_PARAMS)GetProcAddress(hAPI,"SetAudioFilterParams");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
CutOffLow
[in] Specifies the cut-off low frequency of the filter in Hz. This is the start frequency of the filter's passband, it can range from 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 the filter's passband, it can range from 1 to 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 of the filter in dB per octave. De-emphasis starts at the cut-off low frequency of the filter. This value can range from -9.9 to 0.0 dB/octave. Zero means that 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.

GetAudioFilterParams

Retrieves the current parameters of the audio filter for the given channel.

C/C++ declaration

BOOL __stdcall GetAudioFilterParams(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 *CutOffLow,UINT32 *CutOffHigh,double *Deemphasis);

Address retrieval

G65DDC_GET_AUDIO_FILTER_PARAMS GetAudioFilterParams=
    (G65DDC_GET_AUDIO_FILTER_PARAMS)GetProcAddress(hAPI,"GetAudioFilterParams");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetAudioFilterLength

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 DDC2ChannelId,UINT32 Length);

Address retrieval

G65DDC_SET_AUDIO_FILTER_LENGTH SetAudioFilterLength=
        (G65DDC_SET_AUDIO_FILTER_LENGTH)GetProcAddress(hAPI,"SetAudioFilterLength");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
Length
[in] Specifies the length of the audio filter. The value has to be a multiple of 8, greater than or equal to 64 and less than or equal to 32768. If it is not a multiple of 8, the function rounds it up to nearest multiple of 8.

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

Audio streaming in given DDC2 channel has to be idle (streaming is not started using the StartAudio or StartAudioPlayback function) when calling the SetAudioFilterLength function, otherwise it fails.

Increasing the filter length increases the filter steepness and may increase CPU usage.

Use the GetAudioFilterLength function to determine the current length of the audio filter.


GetAudioFilterLength

Retrieves the current audio filter length for the given channel.

C/C++ declaration

BOOL __stdcall GetAudioFilterLength(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 *Length);

Address retrieval

G65DDC_GET_AUDIO_FILTER_LENGTH GetAudioFilterLength=
        (G65DDC_GET_AUDIO_FILTER_LENGTH)GetProcAddress(hAPI,"GetAudioFilterLength");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetVolume

Sets the audio volume for the given channel.

C/C++ declaration

BOOL __stdcall SetVolume(INT32 hDevice,UINT32 DDC2ChannelId,BYTE Volume);

Address retrieval

G65DDC_SET_VOLUME SetVolume=(G65DDC_SET_VOLUME)GetProcAddress(hAPI,"SetVolume");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

GetVolume

Retrieve the current volume for the given channel.

C/C++ declaration

BOOL __stdcall GetVolume(INT32 hDevice,UINT32 DDC2ChannelId,BYTE *Volume);

Address retrieval

G65DDC_GET_VOLUME GetVolume=(G65DDC_GET_VOLUME)GetProcAddress(hAPI,"GetVolume");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetMute

Mutes or unmutes the audio.

C/C++ declaration

BOOL __stdcall SetMute(INT32 hDevice,UINT32 DDC2ChannelId,BOOL Mute);

Address retrieval

G65DDC_SET_MUTE SetMute=(G65DDC_SET_MUTE)GetProcAddress(hAPI,"SetMute");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

GetMute

Retrieves the current mute state for the given channel.

C/C++ declaration

BOOL __stdcall GetMute(INT32 hDevice,UINT32 DDC2ChannelId,BOOL *Mute);

Address retrieval

G65DDC_GET_MUTE GetMute=(G65DDC_GET_MUTE)GetProcAddress(hAPI,"GetMute");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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.

SetFrequency

Sets the absolute frequency of the demodulator for the given channel.

C/C++ declaration

BOOL __stdcall SetFrequency(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 Frequency);

Address retrieval

G65DDC_SET_FREQUENCY SetFrequency=(G65DDC_SET_FREQUENCY)GetProcAddress(hAPI,"SetFrequency");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
Frequency
[in] Specifies the 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 selects proper receiver's input range and sets DDC1, DDC2 and demodulator frequencies so that the new absolute frequency of the demodulator is the requested one.

The absolute frequency of the demodulator is given by the following formula:

faDEM = faDDC1 + frDDC2 + frDEM

Where faDEM is the absolute center frequency of the demodulator in Hz, faDDC1 is the absolute center frequency of the DDC1 in Hz (set using the SetDDCFrequency function), frDDC2 is the relative center frequency of DDC2 in Hz (set using the SetDDCFrequency) and frDEM[i] is the relative center frequency of the demodulator in Hz (set using the SetDemodulatorFrequency function).

The absolute center frequency of the demodulator is the real-world frequency which you are listening to.

When changing the receiver's input range or DDC1 center frequency, the function can affect absolute center frequency of other DDC2 channels (demodulators) which are connected to the same DDC1 as the given DDC2 channel.

Use the GetFrequency function to retrieve the current absolute frequency of the demodulator.


GetFrequency

Determines the absolute frequency of the demodulator for the given channel.

C/C++ declaration

BOOL __stdcall GetFrequency(INT32 hDevice,UINT32 DDC2ChannelId,UINT32 *Frequency);

Address retrieval

G65DDC_GET_FREQUENCY GetFrequency=(G65DDC_GET_FREQUENCY)GetProcAddress(hAPI,"GetFrequency");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC2ChannelId
[in] Identification number of the DDC2 channel created by the CreateDDC2 function.
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

The returned value of the variable pointed to by the Frequency parameter is the sum of absolute center frequency of DDC1 and relative frequencies of the DDC2 and demodulator. For more information, see remarks for the SetFrequency function.

GetSpectrumCompensation

Determines compensation data for the frequency spectrum computed from the DDC1 or DDC2 signal or ADC snapshots. It is used to convert relative amplitudes in dB to absolutes ones in dBm.

C/C++ declaration

BOOL __stdcall GetSpectrumCompensation(INT32 hDevice,INT32 CenterFrequency,UINT32 Bandwidth,FLOAT *Buffer,UINT32 Count);

Address retrieval

G65DDC_GET_SPECTRUM_COMPENSATION GetSpectrumCompensation=
    (G65DDC_GET_SPECTRUM_COMPENSATION)GetProcAddress(hAPI,"GetSpectrumCompensation");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
CenterFrequency
[in] Specifies the absolute center frequency of the requested compensation data in Hz.
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 computes 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 2048 bins FFT.
void FFT(float *Output,const float *Input,int Size);

INT32 hDevice; //handle to G65DDC device
UINT32 DDC1Id; //Identifier of the DDC1 channel created by the CreateDDC1 function: CreateDDC1(hDevice,&DDC1Id)
UINT32 DDC2Id; //Identifier of the DDC2 channel created by the CreateDDC2 function: CreateDDC2(hDevice,DDC1Id,&DDC2Id)
INT32 AbsDDC2Frequency; //Absolute frequency of the DDC2
INT32 RelDDC2Frequency; //Relative frequency of the DDC2
INT32 AbsDDC1Frequency; //Absolute DDC1 frequency
G65DDC_DDC_INFO DDC2Info; //Information about current DDC type of the DDC2
FLOAT FFTBuffer[2*2048]; //Buffer for FFT result
FLOAT Compensation[2048]; //Buffer for compensation data
UINT32 FirstBin,LastBin; //the first and last bins in the FFT of useful DDC2 band
G65DDC_CALLBACKS Callbacks; //Structure which contains pointer to callback functions

Code before...

//Retrieve absolute frequency of the DDC1
GetDDCFrequency(hDevice,DDC1Id,&AbsDDC1Frequency);

//Retrieve relative frequency of the DDC2
GetDDCFrequency(hDevice,DDC2Id,&RelDDC2Frequency);

//Calculate absolute frequency of the DDC2
AbsDDC2Frequency=AbsDDC1Frequency+RelDDC2Frequency;

//Retrieve DDC type information of the DDC2
GetDDC(hDevice,DDC2Id,NULL,&DDC2Info);

//Retrieve compensation data
GetSpectrumCompensation(hDevice,AbsDDC2Frequency,DDC2Info.SampleRate,Compensation,2048);
//In this case the Bandwidth parameter is equal to sample rate, because we need compensation data
//for whole DDC2 band.
//Compensation data have to be updated after change of absolute DDC2 frequency changing center frequency of its DDC1 or relative center frequency of itself.


FirstBin=2048*(DDC2Info.SampleRate-DDC2Info.Bandwidth)/2/DDC2Info.SampleRate;
LastBin=2048*(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
//The SampleSetsPerBuffer parameter is set to 2048 which is size of the FFT to simplify
//the example.
StartDDC(hDevice,DDC2Id,2048);

Code after...
    
void __stdcall MyDDC2StreamCallback(UINT32 DDC2ChannelId,CONST FLOAT *Buffer,UINT32 NumberOfSamples,DWORD_PTR UserData)
{
 UINT32 i;
 
    //Compute FFT
    FFT(FFTBuffer,Buffer,2048);
    
    //Converts complex FFT result to dB
    for(i=0;i<2048;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<2048;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.
}


SetCallbacks

Registers user-defined functions as callback functions called by the API.

C/C++ declaration

BOOL __stdcall SetCallbacks(INT32 hDevice,CONST G65DDC_CALLBACKS *Callbacks,DWORD_PTR UserData);

Address retrieval

G65DDC_SET_CALLBACKS SetCallbacks=(G65DDC_SET_CALLBACKS)GetProcAddress(hAPI,"SetCallbacks");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Callbacks
[in] Pointer to a G65DDC_CALLBACKS structure which contains pointers to the user-defined functions 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 G65DDC_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.


SetDRMKey

Sets a directory which should contain a DRM key file to unlock the DRM demodulator/decoder.

C/C++ declaration

BOOL __stdcall SetDRMKey(INT32 hDevice,CONST CHAR *DRMKeyFileDirectory);

Address retrieval

G65DDC_SET_DRM_KEY SetDRMKey=(G65DDC_SET_DRM_KEY)GetProcAddress(hAPI,"SetDRMKey");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DRMKeyFileDirectory
[in] Pointer to a null-terminated string that specifies the directory which contains 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, this function does nothing.

Use the IsDRMUnlocked function to determine whether the DRM demodulator/decoder is unlocked or not.

More information about obtaining a DRM key can be viewed at https://www.winradio.com/home/drm.htm.


IsDRMUnlocked

Determines whether the DRM demodulator/decoder is unlocked or not.

C/C++ declaration

BOOL __stdcall IsDRMUnlocked(INT32 hDevice);

Address retrieval

G65DDC_IS_DRM_UNLOCKED IsDRMUnlocked=(G65DDC_IS_DRM_UNLOCKED)GetProcAddress(hAPI,"IsDRMUnlocked");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.

Return value

If this 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.

SetNetworkParams

Sets the device network parameters (IPv4 address and netmask) which are used when the device is connected to the computer via a LAN interface. The network parameters can only be set when the device is connected to the computer via USB.

C/C++ declaration

BOOL __stdcall SetNetworkParams(INT32 hDevice,const G65DDC_NETWORK_PARAMS *Params);

Address retrieval

G65DDC_SET_NETWORK_PARAMS SetNetworkParams=
    (G65DDC_SET_NETWORK_PARAMS)GetProcAddress(hAPI,"SetNetworkParams");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Params
[in] Pointer to a G65DDC_NETWORK_PARAMS structure which contains new network parameters.

Before calling the SetNetworkParams function, set the Size member of the structure to sizeof(G65DDC_NETWORK_PARAMS).

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 SetNetworkParams function is available only when the G65DDC device is connected to the computer via USB.

Use the GetNetworkParams function to retrieve the current network parameters of the device.


GetNetworkParams

Retrieves the current device network parameters. The network parameters can be retrieved only when the device is connected to the computer via USB.

C/C++ declaration

BOOL __stdcall GetNetworkParams(INT32 hDevice,G65DDC_NETWORK_PARAMS *Params);

Address retrieval

G65DDC_GET_NETWORK_PARAMS GetNetworkParams=
    (G65DDC_GET_NETWORK_PARAMS)GetProcAddress(hAPI,"GetNetworkParams");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
Params
[out] Pointer to a G65DDC_NETWORK_PARAMS structure to be filled with the device network parameters. This parameter cannot be NULL.

Before calling the GetNetworkParams function, set the Size member of the structure to sizeof(G65DDC_NETWORK_PARAMS).

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 GetNetworkParams function is available only when the G65DDC device is connected to the computer via USB.

Get1PPSCounters

Retrieves the state of the 1PPS counters. These counters can be used for evaluation of presence and quality of the 1PPS signal used for time stamping of the DDC1 signal.

C/C++ declaration

BOOL __stdcall Get1PPSCounters(INT32 hDevice,UINT32 *EventCounter,UINT32 *ADCPeriodCounter);

Address retrieval

G65DDC_GET_1PPS_COUNTERS Get1PPSCounters=
    (G65DDC_GET_1PPS_COUNTERS)GetProcAddress(hAPI,"Get1PPSCounters");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
EventCounter
[out] Pointer to a variable which receives the current value of the 1PPS event counter. The value represents the number of 1PPS events since the device was turned on using the SetPower function. This parameter can be NULL.
ADCPeriodCounter
[out] Pointer to a variable which receives the current value of ADC sample counter. The value specifies the number of ADC samples elapsed between the last two 1PPS events. The normal value is ~210e6. This parameter can 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 1PSS input is optional. The following example shows how to determine whether the receiver includes the 1PPS input:
    G65DDC_DEVICE_INFO DeviceInfo;
    INT32 hDevice;  //handle to open G65DDC device
    
    GetDeviceInfo(hDevice,&DeviceInfo);
    
    if(DeviceInfo.Flags & G65DDC_FLAGS_1PPS)
    {
        //the receiver includes 1PPS input
    }
    else
    {
        //the receiver does not include 1PPS input
    }

Get1PPSDDC1Counters

Retrieves the state of DDC1 sample counter.

C/C++ declaration

BOOL __stdcall Get1PPSDDC1Counters(INT32 hDevice,UINT32 DDC1ChannelId,double *SampleCounter,UINT64 *ADCPeriodCounter);

Address retrieval

G65DDC_GET_1PPS_DDC1_COUNTERS Get1PPSDDC1Counters=
    (G65DDC_GET_1PPS_DDC1_COUNTERS)GetProcAddress(hAPI,"Get1PPSDDC1Counters");

Parameters

hDevice
[in] Handle to G65DDC device returned by the OpenDevice function.
DDC1ChannelId
[in] Identification number of the DDC1 channel created by the CreateDDC1 function.
SampleCounter
[out] Pointer to a variable which receives the current value of the DDC1 sample counter. The value is the number of samples produced by the given DDC1 from the time when it was started (using the StartDDC function) to the last 1PPS event. This parameter can be NULL.
ADCPeriodCounter
[out] Pointer to a variable which receives the current value of the ADC sample counter. The value is the number of ADC samples at the input of the given DDC1 from the time when it was started (using the StartDDC function) to the last 1PPS event. This parameter can 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 1PSS input is optional. The following example shows how to determine whether the receiver includes the 1PPS input:
    G65DDC_DEVICE_INFO DeviceInfo;
    INT32 hDevice;  //handle to open G65DDC device
    
    GetDeviceInfo(hDevice,&DeviceInfo);
    
    if(DeviceInfo.Flags & G65DDC_FLAGS_1PPS)
    {
        //the receiver includes 1PPS input
    }
    else
    {
        //the receiver does not include 1PPS input
    }

Structures

G65DDC_DEVICE_INFO

Contains information about the G65DDC device.

C/C++ declaration

#pragma pack(push,1)

typedef struct
{
    CHAR        DevicePath[MAX_PATH];
    BYTE        InterfaceType;
    CHAR        SerialNumber[9];
    WORD        HWVersion;
    WORD        FWVersion[3];
    BYTE        EEPROMVersion;    	
    struct
    {
        UINT32  MinFrequency;
        UINT32  MaxFrequency;
    }           Ranges[2];  	
    UINT32      MaxDDC1ChannelCount;    
    UINT32      MaxDDC2ChannelCount;
    UINT32      MaxDDC1TypeCount;
    UINT32      MaxDDC2TypeCount;   
    UINT32      MaxDDC2ChannelsPerDDC1Channel;	
    UINT32      Flags;
    BYTE        MACAddress[6];
} G65DDC_DEVICE_INFO;

#pragma pack(pop)

Members

DevicePath
The device system path in a null-terminated string.

If the device information structure is obtained from an already open device using the GetDeviceInfo function, the DevicePath can contain a remote address/port of the device, if it is connected via its LAN interface.

InterfaceType
Device interface type. The value can be one of the following:

ValueMeaning
G65DDC_INTERFACE_TYPE_PCIEThe device is connected to the computer via PCI express.
G65DDC_INTERFACE_TYPE_USB2The device is connected to the computer via USB that is not capable of USB3 speeds. The receiver works in limited mode, DDC1 bandwidths above 6.4 MHz are not available.
G65DDC_INTERFACE_TYPE_USB3The device is connected to the computer via USB3.
G65DDC_INTERFACE_TYPE_LANThe device is connected to the computer via a LAN interface. The receiver works in limited mode, DDC1 bandwidths above 16 MHz are not available.
G65DDC_INTERFACE_TYPE_DEMODemo G65DDC device.
SerialNumber
Serial number in null-terminated string.
HWVersion
Version of the hardware.
FWVersion[3]
Version of the firmwares.
EEPROMVersion
EEPROM structure version.
Ranges
Specifies the minimum (MinFrequency) and the maximum (MaxFrequency) frequencies (in Hz) for both of the supported receiver's input ranges.
MaxDDC1ChannelCount
Maximum number of DDC1 channels which can be created by the CreateDDC1 function per single device.
MaxDDC2ChannelCount
Maximum number of DDC2 channels which can be created by the CreateDDC2 function per single device.
MaxDDC1TypeCount
Maximum number of DDC types supported by the DDC1 channel.
MaxDDC2TypeCount
Maximum number of DDC types supported by the DDC2 channel. The current maximum can be determined using the GetDDCCount function because it is also limited by the currently selected DDC type of related DDC1 channel.
MaxDDC2ChannelsPerDDC1Channel
Maximum number of DDC2 channels per DDC1 channel.
Flags
Hardware configuration flags can be a combination of the following values:

ValueMeaning
G65DDC_FLAGS_EXTERNAL_REFERENCE_INThe device includes an external reference oscillator input.
G65DDC_FLAGS_COHERENTThe device supports coherent mode.
G65DDC_FLAGS_EXTERNAL_REFERENCE_OUTThe device includes a reference oscillator output.
G65DDC_FLAGS_1PPSThe device includes an 1PPS input.
MACAddress
Physical Ethernet address of the devices.

G65DDC_DEVICE_STATE

Contains information about the device state.

C/C++ declaration

#pragma pack(push,1)

typedef struct
{
    UINT32  Flags;
    INT32   Temperatures[3];
    UINT32  FanRPM;
    UINT64  DataTransferred;
    UINT64  DataLost;
} G65DDC_DEVICE_STATE;

#pragma pack(pop)

Members

Flags
A set of bits flags. This member can be a combination of the following flags:

ValueMeaning
G65DDC_DEVICE_STATE_HIGH_TEMPERATURECritical temperature is detected and the device is turned off automatically. In this case the application should call SetPower to turn off explicitly.
Temperatures
Internal device's temperatures in °C. If temperature is not available or it is unknown the value is equal to G65DDC_TEMPERATURE_UNKNOWN.
FanRPM
Device's fan rotations per minute. Zero value means the fan is off.
DataTransferred
Total number of bytes transferred from/to device since is has been open.
DataLost
Total number of bytes lost. A non-zero value can indicate an unreliable (USB/LAN) connection or connection with insufficient data throughput.

G65DDC_DDC_INFO

Contains information about the DDC type.

C/C++ declaration

#pragma pack(push,1)

typedef struct
{
    UINT32  SampleRate;
    UINT32  Bandwidth;
    UINT32  BitsPerSample;
} G65DDC_DDC_INFO;

#pragma pack(pop)

Members

SampleRate
Sample rate of I/Q signal in Hz.
Bandwidth
Useful bandwidth in Hz.
BitsPerSample
Number of bits per sample. This can be 16 or 32. It is used to determine the bits per sample for DDC1.

G65DDC_AMS_CAPTURE_RANGE

Contains information about AMS capture range.

C/C++ declaration

#pragma pack(push,1)

typedef struct
{
    UINT32  Tune;
    UINT32  Lock;
} G65DDC_AMS_CAPTURE_RANGE;

#pragma pack(pop)

Members

Tune
Initial capture range in Hz.
Lock
Capture range (in Hz) used when the AMS demodulator is locked.

G65DDC_NETWORK_PARAMS

Contains network parameters of the device.

C/C++ declaration

#pragma pack(push,1)

typedef struct
{
    WORD    Size
    UINT32  IpAddress;
    UINT32  Mask;
} G65DDC_NETWORK_PARAMS;

#pragma pack(pop)

Members

Size
The size of this data structure, in bytes. Set this member to sizeof(G65DDC_NETWORK_PARAMS).
IpAddress
IPv4 address in network byte order.
Mask
Netmask in network byte order.

G65DDC_CALLBACKS

Contains pointers to user-defined functions to be registered as callback functions.

Each callback function is called in context of thread created by the API. If some shared data are accessed inside callback functions, it is recommended to use a mutual-exclusion synchronization method. The application should not call any G65DDC API function from the inside callback functions, otherwise function fails. The only exception is the GetSpectrumCompensation function which can be called from the inside the callback functions.

C/C++ declaration

#pragma pack(push,1)

typedef struct
{
    G65DDC_ADC_SNAPSHOT_CALLBACK                ADCSnapshotCallback;
    G65DDC_DDC1_STREAM_CALLBACK                 DDC1StreamCallback;
    G65DDC_DDC1_PLAYBACK_STREAM_CALLBACK        DDC1PlaybackStreamCallback;
    G65DDC_DDC2_STREAM_CALLBACK                 DDC2StreamCallback;
    G65DDC_DDC2_PREPROCESSED_STREAM_CALLBACK    DDC2PreprocessedStreamCallback;
    G65DDC_AUDIO_STREAM_CALLBACK                AudioStreamCallback;
    G65DDC_AUDIO_PLAYBACK_STREAM_CALLBACK       AudioPlaybackStreamCallback;
} G65DDC_CALLBACKS;

#pragma pack(pop)

Members

ADCSnapshotCallback

Pointer to a user-defined function to be registered as ADC snapshot callback. It is called by the API to pass ADC snapshots to the application. Sending of ADC snapshots is started using the StartADCSnapshots function.

C/C++ declaration

void __stdcall ADCSnapshotCallback(const short *Buffer,UINT32 Count,UINT32 CenterFrequency,WORD ADCLevel,DWORD_PTR UserData);

Parameters

Buffer
Pointer to the buffer which contains samples directly received from the ADC. Sample rate is 210 MHz, the sample is 16-bit signed little endian.
Count
Specifies the number of samples in the buffer pointed to by the Buffer parameter. This depends on the SamplesPerSnapshot parameter of the StartADCSnapshots function.
CenterFrequency
Specifies the center frequency of the useful band in the received 105 MHz wide snapshot. Not all of the 105 MHz band of the snapshot is usable. Usable bandwidth depends on the selected receiver's input range and is given by the difference of the MaxFrequency and MinFrequency of the Ranges member of the G65DDC_DEVICE_INFO structure.
ADCLevel
Specifies the maximum amplitude. Measurement of the maximum is started at the end of the previous snapshot to the current one. The possible value ranges from 0 to 32767. The value 32767 means ADC clipping.
UserData
User-defined data. It is value passed to the SetCallbacks function as the UserData parameter.
DDC1StreamCallback

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 StartDDC or StartDDC1Playback function.

C/C++ declaration

void __stdcall DDC1StreamCallback(UINT32 DDC1ChannelId,const void *Buffer,UINT32 Count,UINT32 BitsPerSample,DWORD_PTR UserData);

Parameters

DDC1ChannelId
Specifies the identification number of the DDC1 channel. See CreateDDC1.
Buffer
Pointer to the buffer which contains I/Q sample sets from DDC1. Sample rate and bits per sample is given by the used DDC type, see the SetDDC function. One I/Q sample set consists of two samples.
Count
Specifies the number of I/Q sample sets in the buffer pointed to by the Buffer parameter. This value is equal to the value of the SampleSetsPerBuffer parameter of the StartDDC or StartDDC1Playback function.
BitsPerSample
Specifies the number of bits per sample. It is given by the DDC type used for DDC1 and it can be 16 or 32. If it is 16, the sample is 16-bit integer (32-bits per I/Q sample set), signed, little endian, from the range -32768 to 32767. If it is 32, the sample is 32-bit integer (64-bits per I/Q sample set), signed, little endian, from the range -2147483648 to 2147483647.
UserData
User-defined data. It is value passed to the SetCallbacks function as the UserData parameter.
DDC1PlaybackStreamCallback

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 DDC1ChannelId,void *Buffer,UINT32 Count,UINT32 BitsPerSample,DWORD_PTR UserData);

Parameters

DDC1ChannelId
Specifies the identification number of the DDC1 channel. See CreateDDC1.
Buffer
Pointer to the buffer to be filled with I/Q sample sets. Sample rate and bits per sample are given by the used DDC type, see the SetDDC function.
Count
Specifies the number of I/Q sample sets to be stored to the buffer pointed to by the Buffer parameter. This value is equal to the value of the SampleSetsPerBuffer 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.
BitsPerSample
Specifies the number of bits per sample. It is given by the DDC type used for DDC1 and it can be 16 or 32. If it is 16, the sample is 16-bit integer (32-bits per I/Q sample set), signed, little endian, from the range -32768 to 32767. If it is 32, the sample is 32-bit integer (64-bits per I/Q sample set), signed, little endian, from the range -2147483648 to 2147483647.
UserData
User-defined data. It is 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 DDC1PlaybackStreamCallback again. This does not stop DDC1 playback, it has to be done explicitly by the application calling the StopDDC function from the thread in which the device was open using the OpenDevice function. StopDDC must not be called from inside the callback function.
DDC2StreamCallback

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 StartDDC function.

C/C++ declaration

void __stdcall DDC2StreamCallback(UINT32 DDC2ChannelId,const float *Buffer,UINT32 Count,DWORD_PTR UserData);

Parameters

DDC2ChannelId
Specifies the identification number of the DDC2 channel. See CreateDDC2.
Buffer
Pointer to the buffer which contains I/Q sample sets from DDC2. Sample rate is given by the DDC type of the DDC2. Use the GetDDC function to determine current DDC type of the DDC2. The sample is 32-bit IEEE float from the range of -1.0 to 1.0. One I/Q sample set consists of two samples.
Count
Specifies the number of I/Q sample sets in the buffer pointed to by the Buffer parameter. This value is equal to value of the SampleSetsPerBuffer parameter of the StartDDC function.
UserData
User-defined data. It is value passed to the SetCallbacks function as the UserData parameter.
DDC2PreprocessedStreamCallback

Pointer to a user-defined function to be registered as pre-processed DDC2 stream callback. It is called by the API to pass pre-processed I/Q samples from DDC2 to the application. The samples are filtered by the demodulator filter, notch filter and affected by AGC or fixed gain. The DDC2 streaming can be started using the StartDDC function.

C/C++ declaration

void __stdcall DDC2PreprocessedStreamCallback(UINT32 DDC2ChannelId,const float *Buffer,UINT32 Count, 
                                     float SlevelPeak,float SlevelRMS,DWORD_PTR UserData);

Parameters

DDC2ChannelId
Specifies the identification number of the DDC2 channel. See CreateDDC2.
Buffer
Pointer to the buffer which contains pre-processed I/Q sample sets from DDC2. Sample rate is given by the DDC type of the DDC2. Use the GetDDC function to determine current DDC type of the DDC2. Sample is 32-bit IEEE float from the range of -1.0 to 1.0. One I/Q sample set consists of two samples.
NumberOfSamples
Specifies the number of I/Q sample sets in the buffer pointed to by the Buffer parameter. This value is equal to value of the SampleSetsPerBuffer parameter of the StartDDC function.
SlevelPeak
Specifies the peak signal level in Volts evaluated from samples stored in the buffer pointed to by the Buffer parameter.
SlevelRMS
Specifies 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.
UserData
User-defined data. It is value passed to the SetCallbacks function as the UserData parameter.
AudioStreamCallback

Pointer to a user-defined function to be registered as 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 function. The callback is invoked three times for each audio buffer (see description of the Stage parameter).

C/C++ declaration

void __stdcall AudioStreamCallback(UINT32 DDC2ChannelId,UINT32 Stage,const float *Buffer,UINT32 Count,DWORD_PTR UserData);

Parameters

DDC2ChannelId
Specifies the identification number of the DDC2 channel. See CreateDDC2.
Stage
Specifies the 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:

ValueMeaning
G65DDC_AUDIO_STREAM_CALLBACK_STAGE_0The buffer contains audio samples affected by audio gain (see SetAudioGain).
G65DDC_AUDIO_STREAM_CALLBACK_STAGE_1The buffer contains audio samples affected by audio gain and audio filter (see SetAudioGain and SetAudioFilter).
G65DDC_AUDIO_STREAM_CALLBACK_STAGE_2The buffer contains audio samples affected by audio gain, audio filter and volume (see SetAudioGain, SetAudioFilter, SetVolume and SetMute).
Buffer
Pointer to the buffer which contains samples of the audio signal. The audio signal consists of two channels (interleaved), the sample rate is 48000 Hz, each sample is 32-bit IEEE float from the range of -1.0 to 1.0.
Count
Specifies the number of sample sets stored in the buffer pointed to by the Buffer parameter (the sample set consists of two samples). This value is equal to the value of the SampleSetsPerBuffer parameter of the StartAudio or StartAudioPlayback function.
UserData
User-defined data. It is value passed to the SetCallbacks function as the UserData parameter.
AudioPlaybackStreamCallback

Pointer to a user-defined function to be registered as 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 DDC2ChannelId,float *Buffer,UINT32 Count,DWORD_PTR UserData);

Parameters

DDC2ChannelId
Specifies the identification number of the DDC2 channel. See CreateDDC2.
Buffer
Pointer to the buffer to be filled with audio samples. The audio signal consists of two channels (interleaved), the sample rate is 48000 Hz, each sample is 32-bit IEEE float from the the range of -1.0 to 1.0.
Count
Specifies the number of sample sets in the buffer pointed to by the Buffer parameter (the sample set consists of two samples). This value is equal to value of the SampleSetsPerBuffer 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.
UserData
User-defined data. It is 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 from calling 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.

G65DDC_DRM_STATUS

Contains information about the 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];
} G65DDC_DRM_STATUS;

#pragma pack(pop)

Members

Valid
The value is non-zero if the content of the structure is valid. It is zero if the content of the structure is invalid.
DecodingState

Structure that contains status of the decoder modules.

Members

SyncFound
Status of the sync detection. It is non-zero if sync is detected.
FACDecoded
Status of the FAC decoder. It is non-zero if FAC is decoded.
SDCDecoded
Status of the SDC decoder. It is non-zero if SDC is decoded.
AudioDecoded
Status of the audio decoder. It is non-zero if audio is decoded.
NumberOfAudioFrames
Number of audio frames in the transmission frame. It is -1 if this information is not available.
NumberOfAudioErrors
Number of audio frames that were invalid.
Mode
The used DRM robustness mode can be one of the following:

ValueMeaning
G65DDC_DRM_STATE_MODE_NOT_DETERMINED_YETRobustness mode is not determined yet.
G65DDC_DRM_STATE_MODE_ABroadcast is using DRM robustness mode A.
G65DDC_DRM_STATE_MODE_BDRM robustness mode B.
G65DDC_DRM_STATE_MODE_CDRM robustness mode C.
G65DDC_DRM_STATE_MODE_DDRM robustness mode D.
RFBandwidth
Occupied RF bandwidth in kHz. It is zero if it is invalid, or this information is not available (yet).
Interleaver
The Interleaver length can be one of the following:

ValueMeaning
G65DDC_DRM_STATE_INTERLEAVER_LONGLong interleaver used (2 sec).
G65DDC_DRM_STATE_INTERLEAVER_SHORTShort interleaver used (400 msec).
SDCQam
Coding of the SDC (QAM). It is zero if this information is not available (yet).
MSCQam
Coding of the MSC (QAM). It is zero if this information is not available (yet).
MSCQamType
The QAM coding used for the MSC can be one of the following:

ValueMeaning
G65DDC_DRM_STATE_QAM_TYPE_STDStandard
G65DDC_DRM_STATE_QAM_TYPE_HIER_SYMHierarchical symmetrical
G65DDC_DRM_STATE_QAM_TYPE_HIER_MIXHierarchical mixed
CoderateH
Used code-rate for hierarchical coding, values less than or equal to zero indicate not available or not used.
CoderateA
Used code-rate for protection level A, values less than or equal to zero indicate not available or not used.
CoderateB
Used code-rate for protection level B, values less than or equal to zero indicate not available or not used.
EstimatedSNR
Estimated SNR in dB of the decoded signal.
TextMessage
Decoded text message for the selected service in 16-bit Unicode null-terminated string.
ServiceInfo

Array of four structures which contain general information about the services.

Members

Content
The type of the service can be a combination of the following:

ValueMeaning
G65DDC_DRM_STATE_SERVICE_CONTENT_EMPTYGiven service is not used, it contains no data, all other members of the structure are invalid.
G65DDC_DRM_STATE_SERVICE_CONTENT_AUDIOGiven service contains audio data.
G65DDC_DRM_STATE_SERVICE_CONTENT_TEXTMSGGiven service contains text messages.
G65DDC_DRM_STATE_SERVICE_CONTENT_MULTIMEDIAGiven service contains multimedia data.
G65DDC_DRM_STATE_SERVICE_CONTENT_DATAGiven service contains application specific data.
DynamicLabel
16-bit Unicode null-terminated string containing a dynamic label of the service.
Country
16-bit Unicode null-terminated string containing the signalled country for this service.
Language
16-bit Unicode null-terminated string containing the signalled language for this service.
ProgramType
16-bit Unicode null-terminated string containing the signalled program type for this service.
AudioBitrate
Data rate for the audio content. It is zero if this information is not available.
TextMsgBitrate
Data rate for the text message content. It is zero if this information is not available.
MultimediaBitrate
Data rate for the multimedia content. It is zero if this information is not available.
DataBitrate
Data rate for the data content. It is zero if this information is not available.
AudioDecoderInfo

Array of four structures which contain audio decoder specific information about the services.

Members

Valid
If 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.
AudioCoding
Used audio coding, which can be one of the following:

ValueMeaning
G65DDC_DRM_STATE_AUDIO_CODING_AACAudio coding for given service is AAC.
G65DDC_DRM_STATE_AUDIO_CODING_CELPAudio coding for given service is CELP.
G65DDC_DRM_STATE_AUDIO_CODING_HVXCAudio coding for given service is HVXC.
G65DDC_DRM_STATE_AUDIO_CODING_RFUReserved for future use.
SBR
If it is non-zero, SBR is used, if it is zero, SBR is not used.
AudioMode
The value depends upon the audio coding and can be one of the following:

ValueMeaning
G65DDC_DRM_STATE_AUDIO_MODE_AAC_MONOMono
G65DDC_DRM_STATE_AUDIO_MODE_AAC_PARAM_STEREOParametric stereo
G65DDC_DRM_STATE_AUDIO_MODE_AAC_STEREOStereo
G65DDC_DRM_STATE_AUDIO_MODE_AAC_RFUReserved for future use
G65DDC_DRM_STATE_AUDIO_MODE_CELP_NO_CRCAudio data is without CRC
G65DDC_DRM_STATE_AUDIO_MODE_CELP_CRCCRC used
G65DDC_DRM_STATE_AUDIO_MODE_CELP_RFU_10Reserved for future use
G65DDC_DRM_STATE_AUDIO_MODE_CELP_RFU_11Reserved for future use
G65DDC_DRM_STATE_AUDIO_MODE_HVXC_RFU_00Reserved for future use
G65DDC_DRM_STATE_AUDIO_MODE_HVXC_RFU_01Reserved for future use
G65DDC_DRM_STATE_AUDIO_MODE_HVXC_RFU_10Reserved for future use
G65DDC_DRM_STATE_AUDIO_MODE_HVXC_RFU_11Reserved for future use