Programming Information for WiNRADiO G65DDC receiver.

The G65DDC API SDK is implemented as a dynamic library (libg65ddcapi.so) for 32-bit i386 and 64-bit x86_64 platforms. It provides object-oriented and non-object-oriented interfaces to control the G65DDC device. This document describes the non-object-oriented interface. The libg65ddcapi.so 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.

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 API

The lib65ddcapi.so library can be loaded to the application using the dlopen function of dynamic linking loader (link with -ldl). After the library is loaded, it is necessary to get addresses of exported functions. When the API is no longer required in the memory, the dlclose function can be used to unload the API. Before the dlclose is called, all the handles to G65DDC devices returned by the OpenDevice function must be closed by the CloseDevice function, otherwise the application can be placed into an unpredictable state.

The following source code shows how to load the API.

 
#include <stdio.h>
#include <dlfcn.h>
#include "g65ddcapi.h"

G65DDC_OPEN_DEVICE OpenDevice;
G65DDC_CLOSE_DEVICE CloseDevice;
void *API;

int main(void)
{  
    //Loading the API
    API=dlopen("libg65ddcapi.so",RTLD_LAZY);

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

        //Here place code that uses the API

        dlclose(API);
    }
    else
    {
        //If the dlopen fails
        printf("Failed to load libg65ddcapi.so. %s\n",dlerror());
    }
    
    return 0;
}

List of available G65DDC devices

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

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

#include <stdio.h>
#include <stdint.h>
#include <dlfcn.h>
#include <stdlib.h>
#include <errno.h>
#include "g65ddcapi.h"

G65DDC_GET_DEVICE_LIST GetDeviceList;
G65DDC_FREE_DEVICE_LIST FreeDeviceList;
void *API;

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

    //Loading the API
    API=dlopen("libg65ddcapi.so",RTLD_LAZY);

    if(API!=NULL)
    {
        //Retrieving address of the GetDeviceList function
        GetDeviceList=(G65DDC_GET_DEVICE_LIST)dlsym(API,"GetDeviceList");
        FreeDeviceList=(G65DDC_FREE_DEVICE_LIST)dlsym(API,"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 %d\n",errno);
        }

        dlclose(API);
    }
    else
    {
        printf("Failed to load libg65ddcapi.so. %s\n",dlerror());
    }

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

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 <dlfcn.h>
#include <errno.h>
#include "g65ddcapi.h"

G65DDC_OPEN_DEVICE OpenDevice;
G65DDC_CLOSE_DEVICE CloseDevice;
void *API;

int main(void)
{  
 int32_t hDevice;
 
    //Loading the API
    API=dlopen("libg65ddcapi.so",RTLD_LAZY);

    if(API!=NULL)
    {
        //Retrieving addresses of the OpenDevice and CloseDevice API functions
        OpenDevice=(G65DDC_OPEN_DEVICE)dlsym(API,"OpenDevice");
        CloseDevice=(G65DDC_CLOSE_DEVICE)dlsym(API,"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 %d.\n",errno);
        }

        dlclose(API);
    }
    else
    {
        //If the dlopen fails
        printf("Failed to load libg65ddcapi.so. %s\n",dlerror());
    }
    
    return 0;
}

GetDeviceList

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

C/C++ declaration

int GetDeviceList(G65DDC_DEVICE_INFO **DeviceList,uint32_t *Count);

Address retrieval

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

Parameters

DeviceList
[out] Pointer to a variable which receives a 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, check errno.

FreeDeviceList

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

C/C++ declaration

void FreeDeviceList(G65DDC_DEVICE_INFO *DeviceList);

Address retrieval

G65DDC_FREE_DEVICE_LIST GetDeviceList=(G65DDC_FREE_DEVICE_LIST)dlsym(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

int SearchNetworkDevices(G65DDC_SEARCH_NETWORK_DEVICES_CALLBACK Callback,uintptr_t UserData,uint32_t Timeout);

Address retrieval

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

Parameters

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

C/C++ declaration

int SearchNetworkDevicesCallback(uint32_t IpAddress,uint16_t Port,const char *SerialNumber,uint32_t Flags,uintptr_t 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 opened. If (Flags & 0x04) is zero, the device is ready to be opened, otherwise it is locked by another client software instance.
UserData
User-defined data. It is the 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, check errno.

OpenDevice

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

C/C++ declaration

int32_t OpenDevice(const char *SerialNumber);

Address retrieval

G65DDC_OPEN_DEVICE OpenDevice=(G65DDC_OPEN_DEVICE)dlsym(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 format: 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 returned handle to the specified G65DDC device is given. 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, check errno.

Remarks

The OpenDevice function can be called from any user thread, the returned handle can only be used in the same thread, otherwise the application can enter an unpredictable state.

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


CloseDevice

Closes the G65DDC device.

C/C++ declaration

int CloseDevice(int32_t hDevice);

Address retrieval

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

Parameters

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

IsDeviceConnected

Checks if the device is still connected to the computer.

C/C++ declaration

int IsDeviceConnected(int32_t hDevice,int *Connected);

Address retrieval

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

Parameters

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

Remarks

If it is determined that the device is disconnected, the corresponding device handle is no longer usable and it should be closed using the CloseDevice function.

GetDeviceInfo

Retrieves information about the G65DDC device.

C/C++ declaration

int GetDeviceInfo(int32_t hDevice,G65DDC_DEVICE_INFO *Info);

Address retrieval

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

Parameters

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

SetLED

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

C/C++ declaration

int SetLED(int32_t hDevice,uint32_t LEDMode);

Address retrieval

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

Parameters

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

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

int GetLED(int32_t hDevice,uint32_t *LEDMode);

Address retrieval

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

Parameters

hDevice
[in] Handle to the 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 a 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, check errno.

SetPower

Turns the G65DDC device on or off.

C/C++ declaration

int SetPower(int32_t hDevice,int Power);

Address retrieval

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

Parameters

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

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

int GetPower(int32_t hDevice,int *Power);

Address retrieval

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

Parameters

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

GetDeviceState

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

C/C++ declaration

int GetDeviceState(int32_t hDevice,G65DDC_DEVICE_STATE *State);

Address retrieval

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

Parameters

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

SetExternalReference

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

C/C++ declaration

int SetExternalReference(int32_t hDevice,int Enabled);

Address retrieval

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

Parameters

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

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_t 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

int GetExternalReference(int32_t hDevice,int *Enabled);

Address retrieval

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

Parameters

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

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

int SetBuiltInTest(int32_t hDevice,int Enabled);

Address retrieval

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

Parameters

hDevice
[in] Handle to the 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
145 MHz ± 2.5 MHz-60 dBm ± 5 dB
2152 MHz ± 2.5 MHz-48 dBm ± 5 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, check errno.

GetBuiltInTest

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

C/C++ declaration

int GetBuiltInTest(int32_t hDevice,int *Enabled);

Address retrieval

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

Parameters

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

SetAttenuator

Sets the input attenuator.

C/C++ declaration

int SetAttenuator(int32_t hDevice,uint32_t Attenuator);

Address retrieval

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

Parameters

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

Remarks

Use the GetAttenuator function to determine the current setting of the attenuator.

GetAttenuator

Retrieves the current setting of the attenuator.

C/C++ declaration

int GetAttenuator(int32_t hDevice,uint32_t *Attenuator);

Address retrieval

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

Parameters

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

SetPreselectors

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

C/C++ declaration

int SetPreselectors(int32_t hDevice,uint32_t Low,uint32_t High);

Address retrieval

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

Parameters

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

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

int GetPreselectors(int32_t hDevice,uint32_t *Low,uint32_t *High);

Address retrieval

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

Parameters

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

SetPreamplifier

Enables or disables the RF input preamplifier.

C/C++ declaration

int SetPreamplifier(int32_t hDevice,int Preamp);

Address retrieval

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

Parameters

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

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

int GetPreamplifier(int32_t hDevice,int *Preamp);

Address retrieval

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

Parameters

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

SetInverted

Enables or disables frequency spectrum inversion.

C/C++ declaration

int SetInverted(int32_t hDevice,int Inverted);

Address retrieval

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

Parameters

hDevice
[in] Handle to the G65DDC device returned by the OpenDevice function.
Inverted
[in] Specifies whether to enable or disable frequency spectrum inversion. If this parameter is non-zero, the 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, check errno.

GetInverted

Retrieves the current frequency spectrum inversion setting.

C/C++ declaration

int GetInverted(int32_t hDevice,int *Inverted);

Address retrieval

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

Parameters

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

SetRange

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

C/C++ declaration

int SetRange(int32_t hDevice,uint32_t Range);

Address retrieval

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

Parameters

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

GetRange

Retrieves information regarding which range is active.

C/C++ declaration

int GetRange(int32_t hDevice,uint32_t *Range);

Address retrieval

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

Parameters

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

SetADCNoiseBlanker

Enables or disables the noise blanker on the ADC stream.

C/C++ declaration

int SetADCNoiseBlanker(int32_t hDevice,int Enabled);

Address retrieval

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

Parameters

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

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

int GetADCNoiseBlanker(int32_t hDevice,int *Enabled);

Address retrieval

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

Parameters

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

SetADCNoiseBlankerThreshold

Specifies the ADC noise blanker threshold.

C/C++ declaration

int SetADCNoiseBlankerThreshold(int32_t hDevice,uint16_t Threshold);

Address retrieval

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

Parameters

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

Remarks

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

GetADCNoiseBlankerThreshold

Determines the ADC noise blanker threshold.

C/C++ declaration

int GetADCNoiseBlankerThreshold(int32_t hDevice,uint16_t *Threshold);

Address retrieval

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

Parameters

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

StartADCSnapshots

Starts sending ADC snapshots.

C/C++ declaration

int StartADCSnapshots(int32_t hDevice,uint16_t Interval,uint32_t SamplesPerSnapshot);

Address retrieval

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

Parameters

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

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 the USB/LAN connection which could cause failure of the active streaming.


StopADCSnapshots

Stops sending ADC snapshots.

C/C++ declaration

int StopADCSnapshots(int32_t hDevice);

Address retrieval

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

Parameters

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

Remarks

The ADCSnapshotCallback callback function is not called after StopADCSnapshots returns.


GetDDCInfo

Retrieves information about DDC format.

C/C++ declaration

int GetDDCInfo(int32_t hDevice,uint32_t DDCTypeIndex,G65DDC_DDC_INFO *DDCInfo);

Address retrieval

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

Parameters

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

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

int CreateDDC1(int32_t hDevice,uint32_t *DDC1ChannelId);

Address retrieval

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

Parameters

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

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

int CreateDDC2(int32_t hDevice,uint32_t DDC1ChannelId,uint32_t *DDC2ChannelId);

Address retrieval

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

Parameters

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

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

int DeleteDDC(int32_t hDevice,uint32_t DDCChannelId);

Address retrieval

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

Parameters

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

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

int GetDDCCount(int32_t hDevice,uint32_t DDCChannelId,uint32_t *Count);

Address retrieval

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

Parameters

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

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 the 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

int SetDDC(int32_t hDevice,uint32_t DDCChannelId,uint32_t DDCTypeIndex);

Address retrieval

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

Parameters

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

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

int GetDDC(int32_t hDevice,uint32_t DDCChannelId,uint32_t *DDCTypeIndex,G65DDC_DDC_INFO *DDCInfo);

Address retrieval

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

Parameters

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

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 the identification number of a 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 the center frequency of the DDC1 or DDC2.

C/C++ declaration

int SetDDCFrequency(int32_t hDevice,uint32_t DDCChannelId,int32_t Frequency);

Address retrieval

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

Parameters

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

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 for the 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 the 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 a 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 the 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_t hDevice; //Handle to the G65DDC device returned by the OpenDevice function
uint32_t DDC1Id; //Identifier of the DDC1 channel created by the CreateDDC1 function: CreateDDC1(hDevice,&DDC1Id)
uint32_t 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

int GetDDCFrequency(int32_t hDevice,uint32_t DDCChannelId,int32_t *Frequency);

Address retrieval

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

Parameters

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

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

int StartDDC(int32_t hDevice,uint32_t DDCChannelId,uint32_t SampleSetsPerBuffer);

Address retrieval

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

Parameters

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

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

int StopDDC(int32_t hDevice,uint32_t DDCChannelId);

Address retrieval

G65DDC_STOP_DDC1 StopDDC=(G65DDC_STOP_DDC1)dlsym(hAPI,"StopDDC");

Parameters

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

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

int StartDDC1Playback(int32_t hDevice,uint32_t DDC1ChannelId,uint32_t SampleSetsPerBuffer,uint32_t BitsPerSample);

Address retrieval

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

Parameters

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

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

int PauseDDC1Playback(int32_t hDevice,uint32_t DDC1ChannelId);

Address retrieval

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

Parameters

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

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

int ResumeDDC1Playback(int32_t hDevice,uint32_t DDC1ChannelId);

Address retrieval

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

Parameters

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

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

int SetDDC2NoiseBlanker(int32_t hDevice,uint32_t DDC2ChannelId,int Enabled);

Address retrieval

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

Parameters

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

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

int GetDDC2NoiseBlanker(int32_t hDevice,uint32_t DDC2ChannelId,int *Enabled);

Address retrieval

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

Parameters

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

SetDDC2NoiseBlankerThreshold

Specifies the DDC2 noise blanker threshold.

C/C++ declaration

int SetDDC2NoiseBlankerThreshold(int32_t hDevice,uint32_t DDC2ChannelId,double Threshold);

Address retrieval

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

Parameters

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

Remarks

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

GetDDC2NoiseBlankerThreshold

Retrieves the DDC2 noise blanker threshold.

C/C++ declaration

int GetDDC2NoiseBlankerThreshold(int32_t hDevice,uint32_t DDC2ChannelId,double *Threshold);

Address retrieval

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

Parameters

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

GetDDC2NoiseBlankerExcessValue

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

C/C++ declaration

int GetDDC2NoiseBlankerExcessValue(int32_t hDevice,uint32_t DDC2ChannelId,double *Value);

Address retrieval

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

Parameters

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

GetSignalLevel

Determines the current signal level for the given channel.

C/C++ declaration

int GetSignalLevel(int32_t hDevice,uint32_t DDC2ChannelId,float *Peak,float *RMS);

Address retrieval

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

Parameters

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

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 before 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_t hDevice; //Handle to the G65DDC device returned by the OpenDevice function
uint32_t DDC1Id; //Identifier of the DDC1 channel created by the CreateDDC1 function: CreateDDC1(hDevice,&DDC1Id)
uint32_t 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

int SetNotchFilter(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,int Enabled);

Address retrieval

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

Parameters

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

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

int GetNotchFilter(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,int *Enabled);

Address retrieval

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

Parameters

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

SetNotchFilterFrequency

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

C/C++ declaration

int SetNotchFilterFrequency(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,int32_t Frequency);

Address retrieval

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

Parameters

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

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

int GetNotchFilterFrequency(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,int32_t *Frequency);

Address retrieval

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

Parameters

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

SetNotchFilterBandwidth

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

C/C++ declaration

int SetNotchFilterBandwidth(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,uint32_t Bandwidth);

Address retrieval

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

Parameters

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

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

int GetNotchFilterBandwidth(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,uint32_t *Bandwidth);

Address retrieval

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

Parameters

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

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

int SetNotchFilterLength(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,uint32_t Length);

Address retrieval

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

Parameters

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

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 the current length of the notch filter.


GetNotchFilterLength

Retrieves the current notch filter length for the given channel.

C/C++ declaration

int GetNotchFilterLength(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,uint32_t *Length);

Address retrieval

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

Parameters

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

SetAGC

Enables or disables the AGC for the given channel.

C/C++ declaration

int SetAGC(int32_t hDevice,uint32_t DDC2ChannelId,int Enabled);

Address retrieval

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

Parameters

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

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

int GetAGC(int32_t hDevice,uint32_t DDC2ChannelId,int *Enabled);

Address retrieval

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

Parameters

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

SetAGCParams

Sets parameters of the AGC for the given channel.

C/C++ declaration

int SetAGCParams(int32_t hDevice,uint32_t DDC2ChannelId,double AttackTime,double DecayTime,double ReferenceLevel);

Address retrieval

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

Parameters

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

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

int GetAGCParams(int32_t hDevice,uint32_t DDC2ChannelId,double *AttackTime,double *DecayTime,double *ReferenceLevel);

Address retrieval

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

Parameters

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

SetMaxAGCGain

Sets maximum gain of the AGC for the given channel.

C/C++ declaration

int SetMaxAGCGain(int32_t hDevice,uint32_t DDC2ChannelId,double MaxGain);

Address retrieval

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

Parameters

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

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

int GetMaxAGCGain(int32_t hDevice,uint32_t DDC2ChannelId,double *MaxGain);

Address retrieval

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

Parameters

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

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

int SetGain(int32_t hDevice,uint32_t DDC2ChannelId,double Gain);

Address retrieval

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

Parameters

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

Remarks

Use the GetGain function to determine the current fixed gain.


GetGain

Retrieves the current fixed gain for the given channel.

C/C++ declaration

int GetGain(int32_t hDevice,uint32_t DDC2ChannelId,double *Gain);

Address retrieval

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

Parameters

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

GetCurrentGain

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

C/C++ declaration

int GetCurrentGain(int32_t hDevice,uint32_t DDC2ChannelId,double *CurrentGain);

Address retrieval

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

Parameters

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

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

int SetDemodulatorFilterBandwidth(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Bandwidth);

Address retrieval

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

Parameters

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

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

int GetDemodulatorFilterBandwidth(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t *Bandwidth);

Address retrieval

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

Parameters

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

SetDemodulatorFilterShift

Sets the demodulator filter shift for the given channel.

C/C++ declaration

int SetDemodulatorFilterShift(int32_t hDevice,uint32_t DDC2ChannelId,int32_t Shift);

Address retrieval

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

Parameters

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

Remarks

The value of the Shift parameter is the shift in Hz relative to center of the demodulator. This value can be negative.

This function does not change the 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

int GetDemodulatorFilterShift(int32_t hDevice,uint32_t DDC2ChannelId,int32_t *Shift);

Address retrieval

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

Parameters

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

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

int SetDemodulatorFilterLength(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Length);

Address retrieval

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

Parameters

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

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

int GetDemodulatorFilterLength(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t *Length);

Address retrieval

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

Parameters

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

SetDemodulatorMode

Sets the demodulator mode for the given channel.

C/C++ declaration

int SetDemodulatorMode(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Mode);

Address retrieval

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

Parameters

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

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, check errno.

Remarks

Use the GetDemodulatorMode function to retrieve the current demodulator mode.


GetDemodulatorMode

Retrieves the current demodulator mode for the given channel.

C/C++ declaration

int GetDemodulatorMode(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t *Mode);

Address retrieval

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

Parameters

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

SetDemodulatorFrequency

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

C/C++ declaration

int SetDemodulatorFrequency(int32_t hDevice,uint32_t DDC2ChannelId,int32_t Frequency);

Address retrieval

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

Parameters

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

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 the 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_t hDevice; //Handle to the G65DDC device returned by the OpenDevice function
uint32_t DDC1Id; //Identifier of the DDC1 channel created by the CreateDDC1 function: CreateDDC1(hDevice,&DDC1Id)
uint32_t 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

int GetDemodulatorFrequency(int32_t hDevice,uint32_t DDC2ChannelId,int32_t *Frequency);

Address retrieval

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

Parameters

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

SetDemodulatorParam

Sets a parameter of the demodulation for the given channel.

C/C++ declaration

int SetDemodulatorParam(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Code,const void *Buffer,uint32_t BufferSize);

Address retrieval

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

Parameters

hDevice
[in] Handle to the 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_t variable, and the BufferSize parameter has to be sizeof(uint32_t)

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_t variable, and the BufferSize parameter has to be sizeof(int32_t)

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_t variable, and the BufferSize parameter has to be sizeof(uint32_t)

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_t variable, and the BufferSize parameter has to be sizeof(uint32_t)

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.

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, check errno.

GetDemodulatorParam

Retrieves a parameter of the demodulation for the given channel.

C/C++ declaration

int GetDemodulatorParam(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Code,void *Buffer,uint32_t BufferSize);

Address retrieval

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

Parameters

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

GetDemodulatorState

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

C/C++ declaration

int GetDemodulatorState(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Code,void *Buffer,uint32_t BufferSize);

Address retrieval

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

Parameters

hDevice
[in] Handle to the 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 an int variable, and the BufferSize parameter has to be sizeof(int)

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 an int variable, and the BufferSize parameter has to be sizeof(int)

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_t variable, and the BufferSize parameter has to be sizeof(int32_t)

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_FM_DEVIATION

Estimated frequency deviation in Hz

The Buffer parameter has to be pointer to an uint32_t variable, and the BufferSize parameter has to be sizeof(uint32_t)

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, check errno.

StartAudio

Starts audio streaming for the given channel.

C/C++ declaration

int StartAudio(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t SampleSetsPerBuffer);

Address retrieval

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

Parameters

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

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

int StopAudio(int32_t hDevice,uint32_t DDC2ChannelId);

Address retrieval

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

Parameters

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

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

int StartAudioPlayback(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t SampleSetsPerBuffer);

Address retrieval

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

Parameters

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

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

int PauseAudioPlayback(int32_t hDevice,uint32_t DDC2ChannelId);

Address retrieval

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

Parameters

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

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

int ResumeAudioPlayback(int32_t hDevice,uint32_t DDC2ChannelId);

Address retrieval

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

Parameters

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

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

int SetAudioGain(int32_t hDevice,uint32_t DDC2ChannelId,double Gain);

Address retrieval

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

Parameters

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

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

int GetAudioGain(int32_t hDevice,uint32_t DDC2ChannelId,double *Gain);

Address retrieval

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

Parameters

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

SetAudioFilter

Enables or disables the audio filter for the given channel.

C/C++ declaration

int SetAudioFilter(int32_t hDevice,uint32_t DDC2ChannelId,int Enabled);

Address retrieval

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

Parameters

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

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

int GetAudioFilter(int32_t hDevice,uint32_t DDC2ChannelId,int *Enabled);

Address retrieval

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

Parameters

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

SetAudioFilterParams

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

C/C++ declaration

int SetAudioFilterParams(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t CutOffLow,uint32_t CutOffHigh,double Deemphasis);

Address retrieval

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

Parameters

hDevice
[in] Handle to the 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 than 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, check errno.

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

int GetAudioFilterParams(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t *CutOffLow,uint32_t *CutOffHigh,double *Deemphasis);

Address retrieval

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

Parameters

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

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

int SetAudioFilterLength(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Length);

Address retrieval

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

Parameters

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

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

int GetAudioFilterLength(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t *Length);

Address retrieval

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

Parameters

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

SetVolume

Sets the audio volume for the given channel.

C/C++ declaration

int SetVolume(int32_t hDevice,uint32_t DDC2ChannelId,uint8_t Volume);

Address retrieval

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

Parameters

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

GetVolume

Retrieve the current volume for the given channel.

C/C++ declaration

int GetVolume(int32_t hDevice,uint32_t DDC2ChannelId,uint8_t *Volume);

Address retrieval

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

Parameters

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

SetMute

Mutes or unmutes the audio.

C/C++ declaration

int SetMute(int32_t hDevice,uint32_t DDC2ChannelId,int Mute);

Address retrieval

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

Parameters

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

GetMute

Retrieves the current mute state for the given channel.

C/C++ declaration

int GetMute(int32_t hDevice,uint32_t DDC2ChannelId,int *Mute);

Address retrieval

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

Parameters

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

SetDAC

Enables or disables playing of the demodulated audio signal from the specified DDC2 channel on the receiver's audio output connector.

C/C++ declaration

int SetDAC(int32_t hDevice,uint32_t DDC2ChannelId,int Enabled);

Address retrieval

G65DDC_SET_DAC SetDAC=(G65DDC_SET_DAC)dlsym(hAPI,"SetDAC");

Parameters

hDevice
[in] Handle to the 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 playing of the demodulated audio signal on the receiver's audio output connector. If this parameter is non-zero, the audio signal from the specified DDC2 channel is played on the audio output connector. If the parameter is zero, the audio signal is not played on the audio output connector.

Return value

If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.

Remarks

The audio output connector is optional. The following example shows how to determine whether the receiver includes the audio output connector:
    G65DDC_DEVICE_INFO DeviceInfo;
    int32_t hDevice;  //handle to open G65DDC device
    
    GetDeviceInfo(hDevice,&DeviceInfo);
    
    if(DeviceInfo.Flags & G65DDC_FLAGS_AUDIO_OUTPUT)
    {
        //the receiver includes audio output connector
    }
    else
    {
        //the receiver is without an audio output connector
    }

GetDAC

Determines whether playing of the demodulated audio signal from the specified DDC2 channel on the receiver's audio output connector is enabled or disabled.

C/C++ declaration

int GetDAC(int32_t hDevice,uint32_t DDC2ChannelId,int *Enabled);

Address retrieval

G65DDC_GET_DAC GetDAC=(G65DDC_GET_DAC)dlsym(hAPI,"GetDAC");

Parameters

hDevice
[in] Handle to the 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 information as to whether playing of the audio signal from the specified DDC2 channel on the audio output connector is enabled or disabled. The value is non-zero if it 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, check errno.

SetFrequency

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

C/C++ declaration

int SetFrequency(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Frequency);

Address retrieval

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

Parameters

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

Remarks

This function selects the appropriate receiver RF 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 RF 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

int GetFrequency(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t *Frequency);

Address retrieval

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

Parameters

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

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 the 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

int GetSpectrumCompensation(int32_t hDevice,int32_t CenterFrequency,uint32_t Bandwidth,float *Buffer,uint32_t Count);

Address retrieval

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

Parameters

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

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_t hDevice; //handle to G65DDC device
uint32_t DDC1Id; //Identifier of the DDC1 channel created by the CreateDDC1 function: CreateDDC1(hDevice,&DDC1Id)
uint32_t DDC2Id; //Identifier of the DDC2 channel created by the CreateDDC2 function: CreateDDC2(hDevice,DDC1Id,&DDC2Id)
int32_t AbsDDC2Frequency; //Absolute frequency of the DDC2
int32_t RelDDC2Frequency; //Relative frequency of the DDC2
int32_t 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_t 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 MyDDC2StreamCallback(uint32_t DDC2ChannelId,const float *Buffer,uint32_t NumberOfSamples,uintptr_t UserData)
{
 uint32_t 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

int SetCallbacks(int32_t hDevice,const G65DDC_CALLBACKS *Callbacks,uintptr_t UserData);

Address retrieval

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

Parameters

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

Remarks

If the application does not require that the API calls a callback function, set the related member of the G65DDC_CALLBACKS structure to NULL.

If value of the Callbacks parameter is NULL, all the callback functions are unregistered and the API will not call any callback function.


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

int SetNetworkParams(int32_t hDevice,const G65DDC_NETWORK_PARAMS *Params);

Address retrieval

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

Parameters

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

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

int GetNetworkParams(int32_t hDevice,G65DDC_NETWORK_PARAMS *Params);

Address retrieval

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

Parameters

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

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

int Get1PPSCounters(int32_t hDevice,uint32_t *EventCounter,uint32_t *ADCPeriodCounter);

Address retrieval

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

Parameters

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

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_t 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

int Get1PPSDDC1Counters(int32_t hDevice,uint32_t DDC1ChannelId,double *SampleCounter,uint64_t *ADCPeriodCounter);

Address retrieval

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

Parameters

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

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_t 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
{
    uint8_t      DevicePath[256];
    uint8_t      InterfaceType;
    char         SerialNumber[9];
    uint16_t     HWVersion;
    uint16_t     FWVersion[3];
    uint8_t      EEPROMVersion;    	
    struct
    {
        uint32_t MinFrequency;
        uint32_t MaxFrequency;
    }            Ranges[2];  	
    uint32_t     MaxDDC1ChannelCount;    
    uint32_t     MaxDDC2ChannelCount;
    uint32_t     MaxDDC1TypeCount;
    uint32_t     MaxDDC2TypeCount;   
    uint32_t     MaxDDC2ChannelsPerDDC1Channel;	
    uint32_t     Flags;
    uint8_t      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 a null-terminated string.
HWVersion
Version of the hardware.
FWVersion[3]
Version of the firmware.
EEPROMVersion
EEPROM structure version.
Ranges
Specifies the minimum (MinFrequency) and the maximum (MaxFrequency) frequencies (in Hz) for both of the supported receiver's RF 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.
MACAddress
Physical Ethernet address of the devices.

G65DDC_DEVICE_STATE

Contains information about the DDC type.

C/C++ declaration

#pragma pack(push,1)

typedef struct
{
    uint32_t  Flags;
    int32_t   Temperatures[3];
    uint32_t  FanRPM;
    uint64_t  DataTransferred;
    uint64_t  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 the temperature is not available or 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 the 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_t  SampleRate;
    uint32_t  Bandwidth;
    uint32_t  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_t  Tune;
    uint32_t  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
{
    uint16_t  Size
    uint32_t  IpAddress;
    uint32_t  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 the thread created by the API. If some shared data is accessed inside callback functions, use of a mutual-exclusion synchronization method is recommended. The application should not call any G65DDC API function from the inside callback functions, otherwise the function fails. The only exception is the GetSpectrumCompensation function which can be called from 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 an 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 ADCSnapshotCallback(const short *Buffer,uint32_t Count,uint32_t CenterFrequency,uint16_t ADCLevel,uintptr_t UserData);

Parameters

Buffer
Pointer to the buffer which contains samples directly received from the ADC. The 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. The usable bandwidth depends on the selected receiver's RF 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. This value is passed to the SetCallbacks function as the UserData parameter.
DDC1StreamCallback

Pointer to a user-defined function to be registered as a 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 DDC1StreamCallback(uint32_t DDC1ChannelId,const void *Buffer,uint32_t Count,uint32_t BitsPerSample,uintptr_t 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. This value is passed to the SetCallbacks function as the UserData parameter.
DDC1PlaybackStreamCallback

Pointer to a user-defined function to be registered as a 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

int DDC1PlaybackStreamCallback(uint32_t DDC1ChannelId,void *Buffer,uint32_t Count,uint32_t BitsPerSample,uintptr_t 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 DDC type used, 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. This value is 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 a 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 DDC2StreamCallback(uint32_t DDC2ChannelId,const float *Buffer,uint32_t Count,uintptr_t 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 the 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. This value is passed to the SetCallbacks function as the UserData parameter.
DDC2PreprocessedStreamCallback

Pointer to a user-defined function to be registered as a 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 DDC2PreprocessedStreamCallback(uint32_t DDC2ChannelId,const float *Buffer,uint32_t Count, 
                                     float SlevelPeak,float SlevelRMS,uintptr_t 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 the 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.
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. This value is passed to the SetCallbacks function as the UserData parameter.
AudioStreamCallback

Pointer to a user-defined function to be registered as an audio stream callback. It is called by the API to pass audio samples to the application. The audio streaming can be started using the StartAudio or StartAudioPlayback function. The callback is invoked three times for each audio buffer (see description of the Type parameter).

C/C++ declaration

void AudioStreamCallback(uint32_t DDC2ChannelId,uint32_t Stage,const float *Buffer,uint32_t Count,uintptr_t 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. This value is passed to the SetCallbacks function as the UserData parameter.
AudioPlaybackStreamCallback

Pointer to a user-defined function to be registered as an audio playback stream callback. It is called by the API to fill the buffer with audio samples by the application. The audio playback can be started using the StartAudioPlayback function.

C/C++ declaration

int AudioPlaybackStreamCallback(uint32_t DDC2ChannelId,float *Buffer,uint32_t Count,uintptr_t 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 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. This value is 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.