Programming Information for WiNRADiO G69DDC receiver.

The G69DDC API SDK is implemented as a dynamic library (libg69ddcapi.so) for 32-bit i386 and 64-bit x86_64 platforms. It provides object-oriented and non-object-oriented interface to control the G69DDC device. This document describes the object-oriented interface. The libg69ddcapi.so library provides several object types which makes it possible to control G69DDC 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 G69DDC receiver can be controlled from a single user thread only.

A C/C++ header file g69ddcapi.h is a part of the SDK.

Block diagram of G69DDC processing chain

Built-in test Attenuator MW filter Attenuator Preamplifier Preselectors LO1 LO2 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 G69DDC processing chain
Simplified block diagram of G69DDC processing chain

Using the WiNRADiO G69DDC API

Loading the API

The lib69ddcapi.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 objects created using CreateInstance function must be freed releasing their interfaces using the Release method, otherwise the application can enter an unpredictable state.

The following source code shows how to load the API:

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

G69DDC_CREATE_INSTANCE CreateInstance;
void *API;

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

    if(API!=NULL)
    {
        //Retrieving addresses of CreateInstance functions
        CreateInstance=(G69DDC_CREATE_INSTANCE)dlsym(API,"CreateInstance");

        //Here place code that uses the API

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

Enumerating available G69DDC devices

To enumerate available G69DDC devices the API provides an enumeration object. The object has to be created using the CreateInstance function. The following source code in C++ produces a list of serial numbers for the available G69DDC devices:

#include <stdio.h>
#include <dlfcn.h>
#include <errno.h>
#include "g69ddcapi.h"

int main(void)
{
 G69DDC_CREATE_INSTANCE CreateInstance;
 void *API;
 IG69DDCDeviceEnumerator *Enumerator=NULL;
 G69DDC_DEVICE_INFO DevInfo;
 uint32_t Index;
 uint32_t Count;

    API=dlopen("libg69ddcapi.so",RTLD_LAZY);

    if(API!=NULL)
    {
        CreateInstance=(G69DDC_CREATE_INSTANCE)dlsym(API,"CreateInstance");

        if(CreateInstance(G69DDC_CLASS_ID_DEVICE_ENUMERATOR,(void**)&Enumerator))
        {
            Enumerator->Enumerate();

            Count=Enumerator->GetCount();
            
            if(Count!=0)
            {
                printf("Available G69DDC devices count=%d:\n",Count);

                for(Index=0;Index<Count;Index++)
                {
                    Enumerator->GetDeviceInfo(Index,&DevInfo);
                    printf("%d. SN: %s\n",Index,DevInfo.SerialNumber);
                }
            }
            else
            {
                printf("No available G69DDC device found.\n");
            }

            Enumerator->Free();
        }
        else
        {
            printf("Failed to create enumerator object. Error code=%d\n",errno);
        }

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

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

Opening the G69DDC device

The API provides an object to control the G69DDC device. Before the device is open, the object has to be created using the CreateInstance function.
The following source code in C++ shows how to open the first available G69DDC device.

#include <stdio.h>
#include <dlfcn.h>
#include <errno.h>
#include "g69ddcapi.h"


int main(void)
{  
 G69DDC_CREATE_INSTANCE CreateInstance;
 void *API;
 IG69DDCDevice *Device;
 
    //Loading the API
    API=dlopen("libg69ddcapi.so",RTLD_LAZY);

    if(API!=NULL)
    {
        //Retrieving address of the CreateInstance API functions
        CreateInstance=(G69DDC_CREATE_INSTANCE)dlsym(API,"CreateInstance");
        
        //Creating instance of the device object
        if(CreateInstance(G69DDC_CLASS_ID_DEVICE,(void**)&Device))
        {
            //Opening the first available G69DDC device using predefined G69DDC_OPEN_FIRST constant            
            if(Device->Open(G69DDC_OPEN_FIRST))
            {            
                //Here place code that works with the open G69DDC device            
                
                //Closing device
                Device->Close();
            }
            else
            {
                printf("Failed to open device. Error code=%d\n",errno);
            }
            
            //Release interface of device object
            Device->Free();
        }
        else
        {
            printf("Failed to create device object. Error code=%d\n",errno);
        }        
 
        dlclose(API);
    }
    else
    {
        //If the dlopen fails
        printf("Failed to load libg69ddcapi.so. %s\n",dlerror());
    }
    
    return 0;
} 

Functions

CreateInstance

Creates single object of the specified class and returns the interface of the object.

C/C++ declaration

int CreateInstance(uint32_t ClassId,void **Interface);

Address retrieval

G69DDC_CREATE_INSTANCE CreateInstance=(G69DDC_CREATE_INSTANCE)dlsym(hAPI,"CreateInstance");

Parameters

ClassId
[in] Specifies class identifier of the object to be created. This parameter must be one of the following:

ValueMeaning
G69DDC_CLASS_ID_DEVICE_ENUMERATORClass identifier of the enumerator object. When the function finished successfully, IG69DDCDeviceEnumerator interface is stored to a pointer variable pointed to by the Interface parameter.
G69DDC_CLASS_ID_NETWORK_ENUMERATORClass identifier of the object which allows to enumerate G69DDC devices connected via their LAN interface. When the function finished successfully, IG69DDCNetworkEnumerator interface is stored to a pointer variable pointed to by the Interface parameter.
G69DDC_CLASS_ID_DEVICEClass identifier of the device object. When the function finished successfully, IG69DDCDevice interface is stored to pointer variable pointed to by the Interface parameter.

Interface
[out] Pointer to a variable which receives the interface to a newly created object of the specified class. 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

All the objects created using CreateInstance must be freed, using the Free method before the API is unloaded using the FreeLibrary function.


Interfaces

IG69DDCDeviceEnumerator interface

IG69DDCDeviceEnumerator interface is the interface of the enumerator object which is created using the CreateInstance function and provides an enumeration mechanism of available G69DDC devices. The enumerator does not discover G69DDC devices connected via their LAN interface.


IG69DDCDeviceEnumerator::Free

Frees the enumerator object from memory. The interface is no longer usable.

C/C++ declaration

void Free(void);

Parameters

None

Return value

None

IG69DDCDeviceEnumerator::Enumerate

Performs enumeration of available G69DDC devices.

C/C++ declaration

int Enumerate(void);

Parameters

None

Return value

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

IG69DDCDeviceEnumerator::GetCount

Retrieves the number of available G69DDC devices enumerated using the IG69DDCDeviceEnumerator::Enumerate method.

C/C++ declaration

uint32_t GetCount(void);

Parameters

None

Return value

The method returns the number of available G69DDC devices.

IG69DDCDeviceEnumerator::GetDeviceInfo

Retrieves information about the available G69DDC device.

C/C++ declaration

int GetDeviceInfo(uint32_t DeviceIndex,G69DDC_DEVICE_INFO *DeviceInfo);

Parameters

DeviceIndex
[in] Specifies the index of the device. It can vary from zero to 'one less' than the value returned by the IG69DDCDeviceEnumerator::GetCount method.
DeviceInfo
[out] Pointer to a G69DDC_DEVICE_INFO structure to be filled with information about the device.

Return value

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

IG69DDCNetworkEnumerator interface

IG69DDCNetworkEnumerator interface is the interface of the network device enumerator object which is created using the CreateInstance function and which allows to a search for G69DDC 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. The enumerator does not enumerate local G69DDC devices connected via USB/PCIe interfaces.


IG69DDCNetworkEnumerator::Free

Frees the object from memory. The interface is no longer usable.

C/C++ declaration

void Free(void);

Parameters

None

Return value

None

IG69DDCNetworkEnumerator::Start

Starts searching for G69DDC devices in the computer's subnet.

C/C++ declaration

int Start(IG69DDCNetworkEnumeratorCallback *Callback);

Parameters

Callback
[in] Interface to a user-device object which implements IG69DDCNetworkEnumeratorCallback::G69DDC_DeviceFound method. This method is called when a G69DDC device is found on the computer's subnet.

Return value

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

Remarks

The method starts searching for G69DDC devices in the computer's subnet broadcasting a UDP packet to all IP addresses in the subnet. The method returns within a short time, it does not wait for found devices. Responses from G69DDC devices are processed asynchronously in a working thread. Information about a discovered G69DDC device (IP address, port number and serial number) is passed to the application calling the IG69DDCNetworkEnumeratorCallback::G69DDC_DeviceFound method of the provided user-defined callback object.

The provided user-defined callback object must exists during entire searching time.

The searching is finished using the IG69DDCNetworkEnumerator::Stop method or freeing the enumerator object using the IG69DDCNetworkEnumerator::Free method.

Subsequent calls of the Start function (without stopping the searching using the IG69DDCNetworkEnumerator::Stop method) broadcasts a G69DDC discovery UDP packet again to all IP addresses in the computer's subnet.


IG69DDCNetworkEnumerator::Stop

Stops searching for G69DDC devices in the computer's subnet.

C/C++ declaration

void __stdcall Stop(void);

Parameters

None

Return value

None

IG69DDCDevice interface

IG69DDCDevice interface is an interface of the device object which is created using the CreateInstance function. This interface allows control of the selected G69DDC device.


IG69DDCDevice::Free

Frees the device object from memory. The interface is no longer usable.

C/C++ declaration

void Free(void);

Parameters

None

Return value

None

IG69DDCDevice::Open

Opens the G69DDC device by its system path and associates the device with the device object given by its interface pointer.

C/C++ declaration

int Open(const char *DevicePath);

Parameters

DevicePath
[in] Pointer to a null-terminated string which specifies the system path of the G69DDC device to open. The system device path of the device can be obtained from the G69DDC_DEVICE_INFO structure filled by the IG69DDCDeviceEnumerator::GetDeviceInfo method.

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

Instead of the system path and remote address, it can use a device's serial number or one of the following values:

ValueMeaning
G69DDC_OPEN_FIRSTThis method opens the first available G69DDC device.
G69DDC_OPEN_DEMOThis method opens a demo G69DDC device. This allows developers to work with the API without a physical G69DDC device.

Return value

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

Remarks

Use the IG69DDCDevice::Close method to close the currently open G69DDC device associated with the device object.


IG69DDCDevice::Close

Closes the currently open G69DDC device associated with the device object and makes the object available for use with another G69DDC device.

C/C++ declaration

int Close(void);

Parameters

None

Return value

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

Remarks

If the method fails the device object stays associated with currently open G69DDC device.

If no 'open' G69DDC device is associated with the object, the Close method does nothing.


IG69DDCDevice::IsOpen

Checks if a device is associated with the device object.

C/C++ declaration

int IsOpen(void);

Parameters

None

Return value

This method returns a non-zero value if a device is associated with the device object (using the IG69DDCDevice::Open method) and it can be controlled using methods of the device object interface.
The method returns zero if no device is associated with the device object.

IG69DDCDevice::IsConnected

Checks whether the device is still connected to the computer.

C/C++ declaration

int IsConnected(int *Connected);

Parameters

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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

Remarks

If it is determined that the device is disconnected, the IG69DDCDevice::Close should be used.

IG69DDCDevice::GetDeviceInfo

Retrieves information about the G69DDC device.

C/C++ declaration

int GetDeviceInfo(G69DDC_DEVICE_INFO *DeviceInfo);

Parameters

DeviceInfo
[out] Pointer to the G69DDC_DEVICE_INFO structure to be filled with information about the device. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::SetLED

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

C/C++ declaration

int SetLED(uint32_t LEDMode);

Parameters

LEDMode
[in] Specifies the front panel LED flashing mode which can be one of the following:

ValueMeaning
G69DDC_FRONT_PANEL_LED_MODE_DIAGDiagnostic flashing.
G69DDC_FRONT_PANEL_LED_MODE_ONAlways on.
G69DDC_FRONT_PANEL_LED_MODE_OFFAlways off.

Return value

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

Remarks

Use the IG69DDCDevice::GetLED method 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 a 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

IG69DDCDevice::GetLED

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

C/C++ declaration

int GetLED(uint32_t *LEDMode);

Parameters

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 IG69DDCDevice::SetLED. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::SetPower

Turns the G69DDC device on or off.

C/C++ declaration

int SetPower(int Power);

Parameters

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 method succeeds, the return value is non-zero.
If the method 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 IG69DDCDevice::GetPower method to determine the current power state of the device.


IG69DDCDevice::GetPower

Determines whether the device is turned on or off.

C/C++ declaration

int GetPower(int *Power);

Parameters

Power
[out] Pointer to a variable which receives current power state of the device. If it is non-zero, the device is turned on. If it is zero the device is turned off. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::GetDeviceState

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

C/C++ declaration

int GetDeviceState(G69DDC_DEVICE_STATE *State);

Parameters

State
[out] Pointer to a G69DDC_DEVICE_STATE structure to be filled with the current device state. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::SetExternalReference

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

C/C++ declaration

int SetExternalReference(int Enabled);

Parameters

Enabled
[in] Specifies the desired clock source: nonzero - external reference, zero - internal.

Return value

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

Remarks

External reference is optional. If the receiver does not support external reference, IG69DDCDevice::SetExternalReference fails. The following example shows how to determine whether the receiver supports an external reference:
    G69DDC_DEVICE_INFO DeviceInfo;
    IG69DDCDevice *Device;  //Interface of G69DDC device object, created using the CreateInstance function
    
    Device->GetDeviceInfo(&DeviceInfo);
    
    if(DeviceInfo.Flags & G69DDC_FLAGS_EXTERNAL_REFERENCE_IN)
    {
        //the receiver has external reference input
    }
    else
    {
        //the receiver does not have external reference input
    }

IG69DDCDevice::GetExternalReference

Retrieves the current clock source.

C/C++ declaration

int GetExternalReference(int *Enabled);

Parameters

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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::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(int Enabled);

Parameters

Enabled
[in] Specifies whether to enable or disable the built-in test. If this parameter is non-zero, the test signal is enabled. If the parameter is zero, the test signal is disabled.

Test signal parameters:

RangeFrequencyLevel
165 MHz ± 5 MHz-53 dBm ± 5 dB
2340 MHz ± 8 MHz-70 dBm ± 5 dB

Return value

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

IG69DDCDevice::GetBuiltInTest

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

C/C++ declaration

int GetBuiltInTest(int *Enabled);

Parameters

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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::SetAttenuator

Sets the input attenuator.

C/C++ declaration

int SetAttenuator(uint32_t Attenuator);

Parameters

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 method rounds the value to the nearest lower one.

Return value

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

Remarks

Use the IG69DDCDevice::GetAttenuator method to determine the current setting of the attenuator.

IG69DDCDevice::GetAttenuator

Retrieves current setting of the attenuator.

C/C++ declaration

int GetAttenuator(uint32_t *Attenuator);

Parameters

Attenuator
[out] Pointer to a variable which receives the current attenuation level. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::SetMWFilter

Enables or disables the MW filter (medium wave filter).

C/C++ declaration

int SetMWFilter(int Enabled);

Parameters

Enabled
[in] Specifies whether to enable or disable the MW filter. If this parameter is non-zero, the filter is enabled. If the parameter is zero, the filter is disabled.

Return value

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

Remarks

Use the IG69DDCDevice::GetMWFilter method to determine the current state of the MW filter.


IG69DDCDevice::GetMWFilter

Retrieves the current state of the MW filter.

C/C++ declaration

int GetMWFilter(int *Enabled);

Parameters

Enabled
[out] Pointer to a variable that receives the current state of the MW 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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::SetPreamplifier

Enables or disables the RF input preamplifier.

C/C++ declaration

int SetPreamplifier(int Preamp);

Parameters

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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

Remarks

The preamplifier is only available in the RF frequency range 2.

Use the IG69DDCDevice::GetPreamplifier method to determine the current state of the preamplifier.


IG69DDCDevice::GetPreamplifier

Retrieves the current state of the RF input preamplifier.

C/C++ declaration

int GetPreamplifier(int *Preamp);

Parameters

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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::SetInverted

Enables or disables frequency spectrum inversion.

C/C++ declaration

int SetInverted(int Inverted);

Parameters

Inverted
[in] Specifies whether to enable or disable frequency spectrum inversion. If this parameter is non-zero, IF spectrum is inverted.

Return value

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

IG69DDCDevice::GetInverted

Retrieves the current frequency spectrum inversion setting.

C/C++ declaration

int GetInverted(int *Inverted);

Parameters

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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::SetFrontEndFrequency

Sets the frequency of the device's analog front-end. It automatically switches the active receiver's RF input between range 1 and range 2 depending on the specified frequency.

C/C++ declaration

int SetFrontEndFrequency(uint64_t Frequency);

Parameters

Frequency
[in] Specifies a new front-end frequency in Hz. If the value is zero, the function switches the receiver's active input to range 1 (direct sampling). If the value is a non-zero, range 2 is used. A non-zero value can be between (including) the values provided by the Range2.MinFrequency and Range2.MaxFrequency members of the G69DDC_DEVICE_INFO structure. The frequency has to be a multiple of the Range2.Step member of the G69DDC_DEVICE_INFO structure.

Return value

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

Remarks

Use the IG69DDCDevice::GetFrontEndFrequency method to determine the current front-end frequency.


IG69DDCDevice::GetFrontEndFrequency

Retrieves the current front-end frequency and active receiver's RF input.

C/C++ declaration

int GetFrontEndFrequency(uint64_t *Frequency);

Parameters

Frequency
[out] Pointer to a variable which receives the current front-end frequency in Hz. If the received value is zero, range 1 is active, otherwise range 2 is active. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::SetADCNoiseBlanker

Enables or disables the noise blanker on the ADC stream.

C/C++ declaration

int SetADCNoiseBlanker(int Enabled);

Parameters

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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

Remarks

Use the IG69DDCDevice::GetADCNoiseBlanker method to determine the current state of the noise blanker.

IG69DDCDevice::GetADCNoiseBlanker

Retrieves the current ADC noise blanker state.

C/C++ declaration

int GetADCNoiseBlanker(int *Enabled);

Parameters

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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::SetADCNoiseBlankerThreshold

Specifies the ADC noise blanker threshold.

C/C++ declaration

int SetADCNoiseBlankerThreshold(uint16_t Threshold);

Parameters

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 IG69DDCDevice::SetADCNoiseBlanker method.

Return value

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

Remarks

Use the IG69DDCDevice::GetADCNoiseBlankerThreshold method to retrieve the current threshold of the noise blanker.

IG69DDCDevice::GetADCNoiseBlankerThreshold

Determines ADC noise blanker threshold.

C/C++ declaration

int GetADCNoiseBlankerThreshold(uint16_t *Threshold);

Parameters

Threshold
[out] Pointer to a variable which receives the threshold of ADC noise blanker. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::StartADCSnapshots

Starts sending ADC snapshots.

C/C++ declaration

int StartADCSnapshots(uint16_t Period,uint32_t SamplesPerSnapshot);

Parameters

Period
[in] Specifies the time interval in milliseconds for how often the IF snapshots are sent to the IG69DDCDeviceCallback::G69DDC_ADCSnapshotCallback callback.
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 IG69DDCDeviceCallback::G69DDC_ADCSnapshotCallback callback. It can be one of the following:

ValueNumber of samples per snapshot
G69DDC_ADC_SAMPLES_PER_SNAPSHOT_64K65536
G69DDC_ADC_SAMPLES_PER_SNAPSHOT_128K131072
G69DDC_ADC_SAMPLES_PER_SNAPSHOT_256K262144

Return value

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

Remarks

The G69DDC device has to be turned on using the IG69DDCDevice::SetPower method before use of StartADCSnapshots, otherwise the StartADCSnapshots method fails.

Too low a value of the Period parameter can dramatically increase data flow through the USB/LAN connection which could cause failure of the active streaming.


IG69DDCDevice::StopADCSnapshots

Stops sending ADC snapshots.

C/C++ declaration

int StopADCSnapshots(void);

Parameters

None

Return value

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

Remarks

The IG69DDCDeviceCallback::G69DDC_ADCSnapshotCallback callback is not called after StopADCSnapshots returns.


IG69DDCDevice::GetDDCInfo

Retrieves information about the DDC format.

C/C++ declaration

int GetDDCInfo(uint32_t DDCTypeIndex,G69DDC_DDC_INFO *DDCInfo);

Parameters

DDCTypeIndex
[in] Specifies the index of DDC type. For more information, see remarks.
DDCInfo
[out] Pointer to a G69DDC_DDC_INFO structure to be filled with information about DDC type.

Return value

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

Remarks

Use the IG69DDCDevice::GetDDCCount method 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 IG69DDCDevice::GetDDCCount.

Use the IG69DDCDevice::GetDDC method 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 IG69DDCDevice::CreateDDC1 method and the DDC2 channel can be created using the IG69DDCDevice::CreateDDC2 method.


IG69DDCDevice::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(uint32_t *DDC1ChannelId);

Parameters

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 the sum of values of the MaxDDC1ChannelCount and MaxDDC2ChannelCount members of the G69DDC_DEVICE_INFO structure. This parameter cannot be NULL.

Return value

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

Remarks

The maximum number of DDC1 channels which can be created with the CreateDDC1 method, is determined by the MaxDDC1ChannelCount member of the G69DDC_DEVICE_INFO structure.

Use the IG69DDCDevice::DeleteDDC method to delete the DDC1 channel created by CreateDDC1.


IG69DDCDevice::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(uint32_t DDC1ChannelId,uint32_t *DDC2ChannelId);

Parameters

DDC1ChannelId
[in] Identification number of the DDC1 channel created by the IG69DDCDevice::CreateDDC1 method. 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 the sum of values of the MaxDDC1ChannelCount and MaxDDC2ChannelCount members of the G69DDC_DEVICE_INFO structure. This parameter cannot be NULL.

Return value

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

Remarks

The maximum number of DDC2 channels, which can be created with the CreateDDC2 method, is determined by the MaxDDC2ChannelCount member of the G69DDC_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 G69DDC_DEVICE_INFO structure.

Use the IG69DDCDevice::DeleteDDC method to delete the DDC2 channel created by CreateDDC2.


IG69DDCDevice::DeleteDDC

Deletes the DDC (DDC1 or DDC2) channel previously created by the IG69DDCDevice::CreateDDC1 or IG69DDCDevice::CreateDDC2 method.

C/C++ declaration

int DeleteDDC(uint32_t DDCChannelId);

Parameters

DDCChannelId
[in] Identification number of the DDC channel created by the IG69DDCDevice::CreateDDC1 or IG69DDCDevice::CreateDDC2 method.

Return value

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

Remarks

If DDCChannelId is the identification number of the DDC1 channel (primary DDC), the DeleteDDC method 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.


IG69DDCDevice::GetDDCCount

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

C/C++ declaration

int GetDDCCount(uint32_t DDCChannelId,uint32_t *Count);

Parameters

DDCChannelId
[in] Identification number of the DDC channel created by the IG69DDCDevice::CreateDDC1 or IG69DDCDevice::CreateDDC2 function.
Count
[out] Pointer to a variable which receives the number of DDC types supported by given DDC. This parameter cannot be NULL.

Return value

If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, 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 G69DDC_DEVICE_INFO structure. This number can be affected by the type of interface used for connection of the G69DDC device to computer. The G69DDC 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 G69DDC_DEVICE_INFO structure, but it cannot be greater than the current DDC type index of the connected DDC1 channel + 1.


IG69DDCDevice::SetDDC

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

C/C++ declaration

int SetDDC(uint32_t DDCChannelId,uint32_t DDCTypeIndex);

Parameters

DDCChannelId
[in] Identification number of the DDC channel created by the IG69DDCDevice::CreateDDC1 or IG69DDCDevice::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 the number of supported DDC types of the DDC channel.

Return value

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

Remarks

Use the IG69DDCDevice::GetDDCCount method 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 IG69DDCDevice::StartDDC function has to be stopped using the IG69DDCDevice::StopDDC method before calling of SetDDC, otherwise SetDDC fails. The SetDDC method 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 IG69DDCDevice::GetDDC for DDC2 channels connected to the given DDC1 and IG69DDCDevice::GetDemodulatorFilterBandwidth methods immediately after SetDDC to determine the current DDC type of DDC2 channels and current bandwidth of demodulator filters.

Use the IG69DDCDevice::GetDDC method to determine the current DDC type of the DDC channel.


IG69DDCDevice::GetDDC

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

C/C++ declaration

int GetDDC(uint32_t DDCChannelId,uint32_t *DDCTypeIndex,G69DDC_DDC_INFO *DDCInfo);

Parameters

DDCChannelId
[in] Identification number of the DDC channel created by the IG69DDCDevice::CreateDDC1 or IG69DDCDevice::CreateDDC2 method.
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 G69DDC_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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

Remarks

The BitsPerSample member of the G69DDC_DDC_INFO structure is not used and it can be ignored for DDC2 channels (if the DDCChannelId is the identification number of the DDC2 channel). I and Q samples in buffers passed to the IG69DDCDeviceCallback::G69DDC_DDC2StreamCallback and IG69DDCDeviceCallback::G69DDC_DDC2PreprocessedStreamCallback callbacks are always in IEEE float (32 bit, little endian) format.


IG69DDCDevice::SetDDCFrequency

Sets center frequency of the DDC1 or DDC2.

C/C++ declaration

int SetDDCFrequency(uint32_t DDCChannelId,int32_t Frequency);

Parameters

DDCChannelId
[in] Identification number of the DDC channel created by the IG69DDCDevice::CreateDDC1 or IG69DDCDevice::CreateDDC2 method.
Frequency
[in] Specifies the new center frequency of the DDC in Hz.

Return value

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

Remarks

If the value of the DDCChannelId parameter is the identification number of the DDC1 channel, the Frequency parameter specifies a new center frequency of the given DDC1 channel relative to the front-end frequency. The value can be negative if the front-end frequency is greater than zero. The absolute center frequency of the DDC1 channel is given by the following formula:

faDDC1 = fFE + frDDC1

Where faDDC1 is the absolute center frequency of the DDC1 channel in Hz, fFE is front-end frequency and frDDC1 is the relative center frequency of the given DDC1 channel in Hz.

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 = fFE + frDDC1 + frDDC2

Where faDDC2 is the absolute center frequency of the DDC2 channel in Hz, fFE is front-end frequency, frDDC1 is the relative 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 IG69DDCDevice::GetDDCFrequency method 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 60.01 MHz:

IG69DDCDevice *Device; //Interface of G69DDC device object, created by the CreateInstance function
uint32_t DDC1Id; //Identifier of the DDC1 channel created by the IG69DDCDevice::CreateDDC1 method: Device->CreateDDC1(&DDC1Id)
uint32_t DDC2Id; //Identifier of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method: Device->CreateDDC2(DDC1Id,&DDC2Id)

//1. method (in range 1)
Device->SetFrontEndFrequency(0); //Set active receiver's input to the range 1 (0 - 80 MHz)
Device->SetDDCFrequency(DDC1Id,60010000);
Device->SetDDCFrequency(DDC2Id,0);

//2. method (in range 1), it can be used if bandwidth of DDC2 is less than bandwidth of DDC1
Device->SetFrontEndFrequency(0);
Device->SetDDCFrequency(DDC1Id,60000000);
Device->SetDDCFrequency(DDC2Id,10000);

//3. method (in range 2 - 60.01 MHz can be tuned in range as well as in range 2), it can be used if bandwidth of DDC2 is less than bandwidth of DDC1
Device->SetFrontEndFrequency(60000000);
Device->SetDDCFrequency(DDC1Id,20000);
Device->SetDDCFrequency(DDC2Id,-10000);

IG69DDCDevice::GetDDCFrequency

Retrieves the current center frequency of DDC1 or DDC2.

C/C++ declaration

int GetDDCFrequency(uint32_t DDCChannelId,int32_t *Frequency);

Parameters

DDCChannelId
[in] Identification number of the DDC channel created by the IG69DDCDevice::CreateDDC1 or IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method 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 center frequency of the DDC1 channel relative to the front-end frequency.

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.


IG69DDCDevice::StartDDC

Starts DDC1 or DDC2 streaming.

C/C++ declaration

int StartDDC(uint32_t DDCChannelId,uint32_t SampleSetsPerBuffer);

Parameters

DDCChannelId
[in] Identification number of the DDC channel created by the IG69DDCDevice::CreateDDC1 or IG69DDCDevice::CreateDDC2 method.
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 IG69DDCDeviceCallback::G69DDC_DDC1StreamCallback callback. 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 IG69DDCDeviceCallback::G69DDC_DDC2StreamCallback and IG69DDCDeviceCallback::G69DDC_DDC2StreamCallback callbacks. If the current DDC type index (specified by the IG69DDCDevice::SetDDC method) 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 method rounds it up to the nearest multiple of 64/1024. If it is zero, StartDDC fails.

Return value

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

Remarks

The G69DDC device has to be turned on using the IG69DDCDevice::SetPower method 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 IG69DDCDevice::StartDDC1Playback method) before starting the DDC2 streaming.

Use the IG69DDCDevice::StopDDC method 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.


IG69DDCDevice::StopDDC

Stops DDC1 or DDC2 streaming.

C/C++ declaration

int StopDDC(uint32_t DDCChannelId);

Parameters

DDCChannelId
[in] Identification number of the DDC channel created by the IG69DDCDevice::CreateDDC1 or IG69DDCDevice::CreateDDC2 method.

Return value

If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, 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 method 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 IG69DDCDevice::StartDDC1Playback) before use of StopDDC, the StopDDC method stops it.

The IG69DDCDeviceCallback::G69DDC_DDC1StreamCallback and IG69DDCDeviceCallback::G69DDC_DDC1PlaybackStreamCallback callbacks are not called after StopDDC returns.

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

The IG69DDCDeviceCallback::G69DDC_DDC2StreamCallback and IG69DDCDeviceCallback::G69DDC_DDC2PreprocessedStreamCallback callbacks are not called after StopDDC returns.


IG69DDCDevice::StartDDC1Playback

Starts DDC1 playback allows the 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(uint32_t DDC1ChannelId,uint32_t SampleSetsPerBuffer,uint32_t BitsPerSample);

Parameters

DDCChannelId
[in] Identification number of the DDC channel created by the IG69DDCDevice::CreateDDC1 or IG69DDCDevice::CreateDDC2 method.
SampleSetsPerBuffer
[in] Specifies the number of I/Q sample sets in each buffer passed to the IG69DDCDeviceCallback::G69DDC_DDC1PlaybackStreamCallback callback to fill the buffer by the application and to the IG69DDCDeviceCallback::G69DDC_DDC1StreamCallback callback. If the current DDC type index (specified by the IG69DDCDevice::SetDDC method) 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 StartDDC1Playback method fails.
BitsPerSample
[in] Specifies the number of bits per I and Q samples. It is used for both IG69DDCDeviceCallback::G69DDC_DDC1PlaybackStreamCallback and IG69DDCDeviceCallback::G69DDC_DDC1StreamCallback callbacks. The possible value is one of the following:

ValueMeaning
0I and Q samples have a default number of bits. It is given by the BitsPerSample member of the G69DDC_DDC_INFO structure which can be retrieved using the IG69DDCDevice::GetDDC or IG69DDCDevice::GetDDCInfo method. 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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

Remarks

The G69DDC device has to be turned on using the IG69DDCDevice::SetPower method before use of StartDDC1Playback.

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

Use the IG69DDCDevice::StopDDC method to stop DDC1 playback.


IG69DDCDevice::PauseDDC1Playback

Pauses DDC1 playback.

C/C++ declaration

int PauseDDC1Playback(uint32_t DDC1ChannelId);

Parameters

DDC1ChannelId
[in] Identification number of the DDC1 channel created by the IG69DDCDevice::CreateDDC1 method.

Return value

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

Remarks

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

The IG69DDCDeviceCallback::G69DDC_DDC1PlaybackStreamCallback and IG69DDCDeviceCallback::G69DDC_DDC1StreamCallback callbacks can be called once, after PauseDDC1Playback returns. Then they are not called until playback is resumed using the IG69DDCDevice::ResumeDDC1Playback method.


IG69DDCDevice::ResumeDDC1Playback

Resumes paused DDC1 playback.

C/C++ declaration

int ResumeDDC1Playback(uint32_t DDC1ChannelId);

Parameters

DDC1ChannelId
[in] Identification number of the DDC1 channel created by the IG69DDCDevice::CreateDDC1 method.

Return value

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

Remarks

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


IG69DDCDevice::SetDDC2NoiseBlanker

Enables or disables the noise blanker on the DDC2 stream.

C/C++ declaration

int SetDDC2NoiseBlanker(uint32_t DDC2ChannelId,int Enabled);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

Use the IG69DDCDevice::GetDDC2NoiseBlanker method to determine the current state of the noise blanker.

IG69DDCDevice::GetDDC2NoiseBlanker

Retrieves the current DDC2 noise blanker state.

C/C++ declaration

int GetDDC2NoiseBlanker(uint32_t DDC2ChannelId,int *Enabled);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::SetDDC2NoiseBlankerThreshold

Specifies the DDC2 noise blanker threshold.

C/C++ declaration

 int SetDDC2NoiseBlankerThreshold(uint32_t DDC2ChannelId,double Threshold);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Threshold
[in] Specifies the threshold in %.

Return value

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

Remarks

Use the IG69DDCDevice::GetDDC2NoiseBlankerThreshold method to retrieve the current threshold of the noise blanker.

IG69DDCDevice::GetDDC2NoiseBlankerThreshold

Retrieves the DDC2 noise blanker threshold.

C/C++ declaration

int GetDDC2NoiseBlankerThreshold(uint32_t DDC2ChannelId,double *Threshold);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Threshold
[out] Pointer to a variable which receives the threshold of the noise blanker. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::GetDDC2NoiseBlankerExcessValue

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

C/C++ declaration

int GetDDC2NoiseBlankerExcessValue(uint32_t DDC2ChannelId,double *Value);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Value
[out] Pointer to a variable which receives the current excess value in %. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::GetSignalLevel

Determines the current RF signal level for the given channel.

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

Remarks

DDC2 streaming has to be active (started using the IG69DDCDevice::StartDDC method) before calling of GetSignalLevel, otherwise the returned peak and RMS signal levels are zero.

The signal level is evaluated from the signal after the demodulator filter and before the notch filter (see the block diagram), the signal is selected by the demodulator filter.

The 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 IG69DDCDevice::StartDDC method.

The IG69DDCDeviceCallback::G69DDC_DDC2PreprocessedStreamCallback callback method 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 G69DDC 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 the DDC2 channel:

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

IG69DDCDevice *Device; //Interface of G69DDC device object, created using the CreateInstance function
uint32_t DDC1Id; //Identifier of the DDC1 channel created by the IG69DDCDevice::CreateDDC1 method: Device->CreateDDC1(&DDC1Id)
uint32_t DDC2Id; //Identifier of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method: Device->CreateDDC2(DDC1Id,&DDC2Id)
float P_dBm,V_RMS;

Device->GetSignalLevel(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);

IG69DDCDevice::SetNotchFilter

Enables or disables the notch filter for the given channel.

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

Remarks

Use the IG69DDCDevice::GetNotchFilter method to determine whether the filter is enabled or disabled.

IG69DDCDevice::GetNotchFilter

Retrieves the current notch filter state for the given channel.

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::SetNotchFilterFrequency

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

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method 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 IG69DDCDevice::SetDDCFrequency method). The value can be negative.

Use the IG69DDCDevice::GetNotchFilterFrequency method to retrieve the current center frequency of the notch filter.


IG69DDCDevice::GetNotchFilterFrequency

Retrieves the current relative center frequency of the notch filter.

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::SetNotchFilterBandwidth

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

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 the range 1 - 5000 Hz.

Return value

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

Remarks

Use the IG69DDCDevice::GetNotchFilterBandwidth method to retrieve the current bandwidth of the notch filter.


IG69DDCDevice::GetNotchFilterBandwidth

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

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::SetNotchFilterLength

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

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method rounds it up to the nearest multiple of 8.

Return value

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

Remarks

The given DDC2 channel has to be idle (streaming is not started using the IG69DDCDevice::StartDDC method) when calling the SetNotchFilterLength method, otherwise it fails.

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

Use the IG69DDCDevice::GetNotchFilterLength method to determine the current length of the notch filter.


IG69DDCDevice::GetNotchFilterLength

Retrieves the current notch filter length for the given channel.

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::SetAGC

Enables or disables the AGC for the given channel.

C/C++ declaration

int SetAGC(uint32_t DDC2ChannelId,int Enabled);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method 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 IG69DDCDevice::SetGain method.

Use the IG69DDCDevice::GetAGC method to determine the current state of the AGC.


IG69DDCDevice::GetAGC

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

C/C++ declaration

int GetAGC(uint32_t DDC2ChannelId,int *Enabled);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::SetAGCParams

Sets parameters of the AGC for the given channel.

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

Remarks

Use the IG69DDCDevice::GetAGCParams method to determine the current parameters of the AGC.


IG69DDCDevice::GetAGCParams

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

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::SetMaxAGCGain

Sets the maximum gain of the AGC for the given channel.

C/C++ declaration

int SetMaxAGCGain(uint32_t DDC2ChannelId,double MaxGain);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
MaxGain
[in] Specifies the new maximum gain of the AGC in dB.

Return value

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

Remarks

Use the IG69DDCDevice::GetMaxAGCGain method to determine the maximum gain of the AGC.


IG69DDCDevice::GetMaxAGCGain

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

C/C++ declaration

int GetMaxAGCGain(uint32_t DDC2ChannelId,double *MaxGain);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::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(uint32_t DDC2ChannelId,double Gain);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Gain
[in] Specifies the new fixed gain in dB.

Return value

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

Remarks

Use the IG69DDCDevice::GetGain method to determine the current fixed gain.


IG69DDCDevice::GetGain

Retrieves the current fixed gain for the given channel.

C/C++ declaration

int GetGain(uint32_t DDC2ChannelId,double *Gain);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Gain
[out] Pointer to a variable which receives the current fixed gain in dB. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::GetCurrentGain

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

C/C++ declaration

int GetCurrentGain(uint32_t DDC2ChannelId,double *CurrentGain);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
CurrentGain
[out] Pointer to a variable which receives the current gain in dB. This parameter cannot be NULL.

Return value

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

Remarks

If the AGC is enabled (using the IG69DDCDevice::SetAGC method), the variable pointed to by the CurrentGain parameter is filled by the current gain of the AGC. If the AGC is disabled, the variable pointed to by the CurrentGain parameter is filled by fixed gain that is specified using the IG69DDCDevice::SetGain method.

IG69DDCDevice::SetDemodulatorFilterBandwidth

Sets the bandwidth of the demodulator filter for the given channel.

C/C++ declaration

int SetDemodulatorFilterBandwidth(uint32_t DDC2ChannelId,uint32_t Bandwidth);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 IG69DDCDevice::GetDDC method to retrieve information about the current DDC type of DDC2.

Return value

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

Remarks

The demodulator filter bandwidth can be changed by changing the DDC type of the corresponding DDC1 channel (using the IG69DDCDevice::SetDDC method). 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 IG69DDCDevice::GetDemodulatorFilterBandwidth method immediately after IG69DDCDevice::SetDDC.

IG69DDCDevice::GetDemodulatorFilterBandwidth

Retrieves the current demodulator filter bandwidth for the given channel.

C/C++ declaration

int GetDemodulatorFilterBandwidth(uint32_t DDC2ChannelId,uint32_t *Bandwidth);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Bandwidth
[out] Pointer to a variable which receives the current demodulator filter bandwidth. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::SetDemodulatorFilterShift

Sets the demodulator filter shift for the given channel.

C/C++ declaration

int SetDemodulatorFilterShift(uint32_t DDC2ChannelId,int32_t Shift);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Shift
[in] Specifies the new shift of the demodulator filter in Hz.

Return value

If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, 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 method does not change the demodulator frequency, it just shifts the filter from the demodulator's center.

Use the IG69DDCDevice::GetDemodulatorFilterShift method to determine the current demodulator filter shift.


IG69DDCDevice::GetDemodulatorFilterShift

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

C/C++ declaration

int GetDemodulatorFilterShift(uint32_t DDC2ChannelId,int32_t *Shift);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Shift
[out] Pointer to a variable which receives the current shift of the demodulator. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::SetDemodulatorFilterLength

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

C/C++ declaration

int SetDemodulatorFilterLength(uint32_t DDC2ChannelId,uint32_t Length);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method rounds it up to nearest multiple of 8.

Return value

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

Remarks

The given DDC2 channel has to be idle (streaming is not started using the IG69DDCDevice::StartDDC method) when calling the SetDemodulatorFilterLength method, otherwise it fails.

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

Use the IG69DDCDevice::GetDemodulatorFilterLength method to determine the current length of the demodulator filter.


IG69DDCDevice::GetDemodulatorFilterLength

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

C/C++ declaration

int GetDemodulatorFilterLength(uint32_t DDC2ChannelId,uint32_t *Length);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Length
[out] Pointer to a variable which receives the current demodulator filter length. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::SetDemodulatorMode

Sets the demodulator mode for the given channel.

C/C++ declaration

int SetDemodulatorMode(uint32_t DDC2ChannelId,uint32_t Mode);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Mode
[in] Specifies the new demodulator mode. This value can be one of the following:

ValueMeaning
G69DDC_MODE_AMAmplitude modulation
G69DDC_MODE_AMSAmplitude modulation
G69DDC_MODE_LSBLower sideband modulation
G69DDC_MODE_USBUpper sideband modulation
G69DDC_MODE_DSBDouble sideband modulation
G69DDC_MODE_ISBIndependent sideband modulation
G69DDC_MODE_CWContinuous wave
G69DDC_MODE_FMFrequency modulation
G69DDC_MODE_FMWWide-band frequency modulation

Return value

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

Remarks

Use the IG69DDCDevice::GetDemodulatorMode method to retrieve the current demodulator mode.


IG69DDCDevice::GetDemodulatorMode

Retrieves the current demodulator mode for the given channel.

C/C++ declaration

int GetDemodulatorMode(uint32_t DDC2ChannelId,uint32_t *Mode);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Mode
[out] Pointer to a variable which receives the current demodulator mode. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::SetDemodulatorFrequency

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

C/C++ declaration

int SetDemodulatorFrequency(uint32_t DDC2ChannelId,int32_t Frequency);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 = fFE + frDDC1 + frDDC2 + frDEM

Where faDEM is the absolute center frequency of the demodulator in Hz, fFE is front-end frequency in Hz (see the IG69DDCDevice::SetFrontEndFrequency method)frDDC1 is the relative center frequency of the DDC1 in Hz (set using the IG69DDCDevice::SetDDCFrequency function), frDDC2 is the relative center frequency of DDC2 in Hz (set using the IG69DDCDevice::SetDDCFrequency) and frDEM is relative center frequency of the demodulator in Hz (set using SetDemodulatorFrequency).

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

Use the IG69DDCDevice::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 60.01 MHz:

IG69DDCDevice *Device; //Interface of G69DDC device object, created by the CreateInstance function
uint32_t DDC1Id; //Identifier of the DDC1 channel created by the IG69DDCDevice::CreateDDC1 method: Device->CreateDDC1(&DDC1Id)
uint32_t DDC2Id; //Identifier of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method: Device->CreateDDC2(DDC1Id,&DDC2Id)

//1. method (in range 1)
Device->SetFrontEndFrequency(0); //Set active receiver's input to the range 1 (0 - 80 MHz)
Device->SetDDCFrequency(DDC1Id,60010000);
Device->SetDDCFrequency(DDC2Id,0);
Device->SetDemodulatorFrequency(DDC2Id,0);

//2. method (in range 1)
Device->SetFrontEndFrequency(0);
Device->SetDDCFrequency(DDC1Id,60000000);
Device->SetDDCFrequency(DDC2Id,10000);
Device->SetDemodulatorFrequency(DDC2Id,0);

//3. method (in range 2)
Device->SetFrontEndFrequency(60000000);
Device->SetDDCFrequency(DDC1Id,20000);
Device->SetDDCFrequency(DDC2Id,-5000);
Device->SetDemodulatorFrequency(DDC2Id,-5000);

//4. method
Device->SetFrequency(DDC2Id,60010000); 
//The IG69DDCDevice::SetFrequency method selects proper receiver's input range and sets sets front-end, DDC1, DDC2 and demodulator
//center frequencies so that demodulator's absolute frequency is set to the required frequency

IG69DDCDevice::GetDemodulatorFrequency

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

C/C++ declaration

int GetDemodulatorFrequency(uint32_t Channel,int32_t *Frequency);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Frequency
[out] Pointer to a variable which receives the current center frequency of the demodulator. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::SetDemodulatorParam

Sets a parameter of the demodulation for the given channel.

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Code
[in] Specifies the code of the demodulator parameter to be set by this method. The code can be one of the following:

ValueMeaning
G69DDC_DEMODULATOR_PARAM_AMS_SIDE_BAND

Side band for synchronous AM demodulation.

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

The value of the variable pointed to by the Buffer parameter can be one of the following:

G69DDC_SIDE_BAND_LOWER
AMS demodulator will use lower sideband

G69DDC_SIDE_BAND_UPPER
AMS demodulator will use upper sideband

G69DDC_SIDE_BAND_BOTH
AMS demodulator will use both side bands.

G69DDC_DEMODULATOR_PARAM_AMS_CAPTURE_RANGE

Capture range of synchronous AM demodulator.

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

G69DDC_DEMODULATOR_PARAM_CW_FREQUENCY

CW tone frequency

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

The value of the variable pointed to by the Buffer parameter is CW tone frequency in Hz.

G69DDC_DEMODULATOR_PARAM_DSB_SIDE_BAND

Side band for DSB demodulation.

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

The value of the variable pointed to by the Buffer parameter can be one of the following:

G69DDC_SIDE_BAND_LOWER
DSB demodulator will use lower sideband

G69DDC_SIDE_BAND_UPPER
DSB demodulator will use upper sideband

G69DDC_SIDE_BAND_BOTH
DSB demodulator will use both side bands.

G69DDC_DEMODULATOR_PARAM_ISB_SIDE_BAND

Side band for ISB demodulation.

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

The value of the variable pointed to by the Buffer parameter can be one of the following:

G69DDC_SIDE_BAND_LOWER
ISB demodulator will use lower sideband

G69DDC_SIDE_BAND_UPPER
ISB demodulator will use upper sideband

G69DDC_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 method will set. This parameter cannot be NULL.
BufferSize
[in] Specifies the size of the buffer.

Return value

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

IG69DDCDevice::GetDemodulatorParam

Retrieves a parameter of the demodulation for the given channel.

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Code
[in] Specifies the code of the demodulator parameter to be retrieved. For detailed information about available codes see IG69DDCDevice::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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::GetDemodulatorState

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

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Code
[in] Specifies the code of the demodulator state to be retrieved. The code can be one of the following:

ValueMeaning
G69DDC_DEMODULATOR_STATE_AMS_LOCK

Lock state of synchronous AM demodulation.

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

The received value is non-zero if the synchronous AM demodulator is locked to a signal, and zero if it is not locked.

G69DDC_DEMODULATOR_STATE_AMS_FREQUENCY

Frequency in Hz which the synchronous AM demodulator is locked to. It is relative to the center of the demodulator. It can be negative.

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

G69DDC_DEMODULATOR_STATE_AM_DEPTH

Depth of AM modulation in %.

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

G69DDC_DEMODULATOR_STATE_DSB_LOCK

Lock state of DSB demodulation.

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

The received value is non-zero if the DSB demodulator is locked to a signal, and zero if it is not locked.

G69DDC_DEMODULATOR_STATE_DSB_FREQUENCY

Frequency in Hz which the DSB demodulator is locked to. It is relative to the center of the demodulator. It can be negative.

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

G69DDC_DEMODULATOR_STATE_TUNE_ERROR

Estimated tune error in Hz.

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

The received value is the difference between the demodulator frequency and the frequency of received signal. Subtract the returned tune error from the demodulator frequency to get the frequency of the received signal. Tune error is relative to the center of the demodulator and it can be negative.

G69DDC_DEMODULATOR_STATE_FM_DEVIATION

Estimated frequency deviation in Hz.

The Buffer parameter has to be a 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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::GetAudioSampleRateCount

Retrieves the number of audio sample rates supported by the G69DDC.

C/C++ declaration

int GetAudioSampleRateCount(uint32_t *Count);

Parameters

Count
[out] Pointer to a variable which receives the number of audio sample rates supported by the G69DDC. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::GetAudioSampleRate

Retrieves the audio sample rate by its index.

C/C++ declaration

int GetAudioSampleRate(uint32_t SampleRateIndex,uint32_t *SampleRate);

Parameters

SampleRateIndex
[in] Specifies the audio sample rate index. This value can vary from 0 to the value retrieved by the IG69DDCDevice::GetAudioSampleRateCount - 1.
SampleRate
[out] Pointer to a variable which receives the audio sample rate. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::SetAudio

Sets the output audio sample rate.

C/C++ declaration

int SetAudio(uint32_t DDC2ChannelId,uint32_t SampleRateIndex);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
SampleRateIndex
[in] Specifies the audio sample rate index.

Return value

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

Remarks

Use the IG69DDCDevice::GetAudioSampleRateCount method to determine the number of possible audio sample rates. The SampleRateIndex parameter can vary from zero to one less than the number determined by IG69DDCDevice::GetAudioSampleRateCount.

Audio streaming must not run when calling IG69DDCDevice::SetAudio. In other words, audio streaming which is started using the IG69DDCDevice::StartAudio method has to be stopped using the IG69DDCDevice::StopAudio method before calling of IG69DDCDevice::SetAudio, otherwise IG69DDCDevice::SetAudio fails. The IG69DDCDevice::SetAudio method does not start and stop audio streaming, but changes the current audio sample rate.

Use the IG69DDCDevice::GetAudio function to determine the current audio sample rate and the corresponding sample rate index.


IG69DDCDevice::GetAudio

Retrieves the current audio sample rate and the corresponding sample rate index.

C/C++ declaration

int GetAudio(uint32_t DDC2ChannelId,uint32_t *SampleRateIndex,uint32_t *SampleRate);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
SampleRateIndex
[out] Pointer to a variable which receives the current audio sample rate index. This parameter can be NULL if the application does not require this information.
SampleRate
[out] Pointer to a variable which receives the current audio sample rate in Hz. This parameter can be NULL if the application does not require this information.

Return value

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

IG69DDCDevice::StartAudio

Starts audio streaming for given the channel.

C/C++ declaration

int StartAudio(uint32_t DDC2ChannelId,uint32_t SampleSetsPerBuffer);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
SampleSetsPerBuffer
[in] Specifies the number of sample sets in each buffer passed to the IG69DDCDeviceCallback::G69DDC_AudioStreamCallback callback method (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 method fails. If it is not a multiple of 64, the method rounds it up to nearest multiple of 64.

Return value

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

Remarks

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

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

Use the IG69DDCDevice::StopAudio method to stop audio streaming.

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.


IG69DDCDevice::StopAudio

Stops audio streaming for the given channel.

C/C++ declaration

int StopAudio(uint32_t DDC2ChannelId);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.

Return value

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

Remarks

If audio streaming is not active, StopAudio does nothing.

If audio playback (started using the IG69DDCDevice::StartAudioPlayback method) is active, StopAudio stops it.

The IG69DDCDeviceCallback::G69DDC_AudioStreamCallback and IG69DDCDeviceCallback::G69DDC_AudioPlaybackStreamCallback callback methods are not called after StopAudio returns.


IG69DDCDevice::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(uint32_t DDC2ChannelId,uint32_t SampleSetsPerBuffer);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
SampleSetsPerBuffer
[in] Specifies the number of sample sets in each buffer passed to the IG69DDCDeviceCallback::G69DDC_AudioPlaybackStreamCallback callback to fill the buffer by the application and to the IG69DDCDeviceCallback::G69DDC_AudioStreamCallback callback method (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 method fails. If it is not a multiple of 64, the method rounds it up to nearest multiple of 64.

Return value

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

Remarks

The G69DDC device has to be turned on using IG69DDCDevice::SetPower method before use of StartAudioPlayback.

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

Use the IG69DDCDevice::StopAudio method to stop audio playback.


IG69DDCDevice::PauseAudioPlayback

Pauses audio playback for the given channel.

C/C++ declaration

int PauseAudioPlayback(uint32_t DDC2ChannelId);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.

Return value

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

Remarks

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

The IG69DDCDeviceCallback::G69DDC_AudioPlaybackStreamCallback and IG69DDCDeviceCallback::G69DDC_AudioStreamCallback callback methods can be called once after PauseAudioPlayback returns. Then they are not called until playback is resumed using the IG69DDCDevice::ResumeAudioPlayback method.


IG69DDCDevice::ResumeAudioPlayback

Resumes paused audio playback for the given channel.

C/C++ declaration

int ResumeAudioPlayback(uint32_t DDC2ChannelId);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.

Return value

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

Remarks

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


IG69DDCDevice::SetAudioGain

Sets fixed audio gain for the given channel.

C/C++ declaration

int SetAudioGain(uint32_t DDC2ChannelId,double Gain);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Gain
[in] Specifies a new fixed audio gain in dB.

Return value

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

Remarks

Use the IG69DDCDevice::GetAudioGain method to retrieve the current audio gain.

IG69DDCDevice::GetAudioGain

Retrieves the current fixed audio gain for the given channel.

C/C++ declaration

int GetAudioGain(uint32_t DDC2ChannelId,double *Gain);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Gain
[out] Pointer to a variable that receives the current fixed gain in dB. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::SetAudioFilter

Enables or disables the audio filter for the given channel.

C/C++ declaration

int SetAudioFilter(uint32_t DDC2ChannelId,int Enabled);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

Remarks

Use the IG69DDCDevice::GetAudioFiler method to retrieve the current state of the audio filter.

IG69DDCDevice::GetAudioFilter

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

C/C++ declaration

int GetAudioFilter(uint32_t DDC2ChannelId,int *Enabled);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::SetAudioFilterParams

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

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 one less than the half of the current audio sample rate (see the IG69DDCDevice::GetAudio). 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 the half of the current audio sample rate (see the IG69DDCDevice::GetAudio). 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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

Remarks

Use the IG69DDCDevice::GetAudioFilerParams method to retrieve the current parameters of the audio filter.

IG69DDCDevice::GetAudioFilterParams

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

C/C++ declaration

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

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

IG69DDCDevice::SetAudioFilterLength

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

C/C++ declaration

int SetAudioFilterLength(uint32_t DDC2ChannelId,uint32_t Length);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method rounds it up to nearest multiple of 8.

Return value

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

Remarks

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

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

Use the IG69DDCDevice::GetAudioFilterLength method to determine the current length of the audio filter.


IG69DDCDevice::GetAudioFilterLength

Retrieves the current audio filter length for the given channel.

C/C++ declaration

int GetAudioFilterLength(uint32_t DDC2ChannelId,uint32_t *Length);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Length
[out] Pointer to a variable which receives the current length of the audio filter. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::SetVolume

Sets the audio volume for the given channel.

C/C++ declaration

int SetVolume(uint32_t DDC2ChannelId,uint8_t Volume);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Volume
[in] Specifies the new volume. The value can vary from 0 to 31, where 31 means maximum volume.

Return value

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

Remarks

Use the IG69DDCDevice::GetVolume method to retrieve the current volume.


IG69DDCDevice::GetVolume

Retrieve the current volume for the given channel.

C/C++ declaration

int GetVolume(uint32_t DDC2ChannelId,uint8_t *Volume);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Volume
[out] Pointer to a variable which receives the current volume. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::SetMute

Mutes or unmutes the audio.

C/C++ declaration

int SetMute(uint32_t DDC2ChannelId,int Mute);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.

Remarks

Use the IG69DDCDevice::GetMute method to retrieve the current mute state.


IG69DDCDevice::GetMute

Retrieves the current mute state for the given channel.

C/C++ declaration

int GetMute(uint32_t DDC2ChannelId,int *Mute);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Mute
[out] Pointer to a variable which receives the current mute state. This parameter cannot be NULL.

Return value

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

IG69DDCDevice::SetFrequency

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

C/C++ declaration

int SetFrequency(uint32_t DDC2ChannelId,uint32_t Frequency);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Frequency
[in] Specifies the new absolute frequency of the demodulator in Hz.

Return value

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

Remarks

The method selects the correct receiver input range and sets front-end, DDC1, DDC2 and demodulator frequencies so that the new absolute frequency of the demodulator is the requested one.

Absolute frequency of the demodulator is given by the following formula:

faDEM = fFE + frDDC1 + frDDC2 + frDEM

Where faDEM is the absolute center frequency of the demodulator in Hz, fFE is the front-end frequency (see IG69DDCDevice::SetFrontEndFrequency method),frDDC1 is the relative center frequency of the DDC1 in Hz (set using the IG69DDCDevice::SetDDCFrequency method), frDDC2 is the relative center frequency of DDC2 in Hz (set using the IG69DDCDevice::SetDDCFrequency) and frDEM is the relative center frequency of the demodulator in Hz (set using the IG69DDCDevice::SetDemodulatorFrequency method).

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

When changing the front-end frequency or DDC1 center frequency, the method can affect the absolute center frequency of other DDC2 channels (demodulators) which are connected to the same DDC1 as the given DDC2 channel.

Use the IG69DDCDevice::GetFrequency method to retrieve the current absolute frequency of the demodulator.


IG69DDCDevice::GetFrequency

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

C/C++ declaration

int GetFrequency(uint32_t DDC2ChannelId,uint32_t *Frequency);

Parameters

DDC2ChannelId
[in] Identification number of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method.
Frequency
[out] Pointer to a variable which receives the current absolute frequency of the demodulator. This parameter cannot be NULL.

Return value

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

Remarks

The returned value of the variable pointed to by the Frequency parameter is the sum of the front-end frequency and relative frequencies of the DDC1, DDC2 and demodulator. For more information, see the remarks for the IG69DDCDevice::SetFrequency method.

IG69DDCDevice::StartSweeper

Starts the sweeper.

C/C++ declaration

int StartSweeper(uint64_t BeginFrequency,uint64_t EndFrequency,uint64_t StartFrequency,
                            uint32_t Step,int Forward,uint32_t Repeat,uint32_t SamplesPerSnapshot);

Parameters

BeginFrequency
[in] Specifies the start frequency of the sweeping range in Hz.
EndFrequency
[in] Specifies the end frequency of the sweeping range in Hz.
StartFrequency
[in] Specifies the frequency to start sweeping from. It must be within sweeping range given by the BeginFrequency and EndFrequency parameters. Use the same value as for BeginFrequency to start sweeping from the beginning of the sweeping range.
Step
[in] Specified sweeper tuning step in Hz. The value can be one of the following:

ValueTuning step
G69DDC_SWEEPER_STEP_2MHZ2 MHz
G69DDC_SWEEPER_STEP_6MHZ6 MHz
G69DDC_SWEEPER_STEP_10MHZ10 MHz
G69DDC_SWEEPER_STEP_30MHZ30 MHz
Forward
[in] Specifies the sweeper direction. If the value is non-zero, the sweeper runs in a loop from the BeginFrequency to the EndFrequency. If the value is zero, the sweeper runs in a loop from the EndFrequency to BeginFrequency.
Repeat
[in] Specifies how many additional snapshots will be taken at the same front-end frequency. If this parameter is zero, a single snapshot is taken on each tuned front-end frequency. If this parameter is non-zero then Repeat+1 snapshots are taken at the same front-end frequency. This can be useful for frequency spectrum averaging during sweeping.
SamplesPerSnapshot
[in] Specifies the number of 16-bit samples per single ADC snapshot during sweeping. In other words, it is the number of samples per buffer passed to the IG69DDCDeviceCallback::SweeperCallback callback. It can be one of the following:

ValueNumber of samples per snapshot
G69DDC_ADC_SAMPLES_PER_SNAPSHOT_64K65536
G69DDC_ADC_SAMPLES_PER_SNAPSHOT_128K131072
G69DDC_ADC_SAMPLES_PER_SNAPSHOT_256K262144

Return value

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

Remarks

The G69DDC device has to be turned on using the IG69DDCDevice::SetPower method before StartSweeper is used, otherwise StartSweeper fails.

DDC streams (IG69DDCDevice::StartDDC, IG69DDCDevice::StartDDC1Playback) and ADC snapshots (IG69DDCDevice::StartADCSnapshots) must not be running before StartSweeper is used, otherwise StartSweeper fails.

When the sweeper runs, the receiver is tuned sequentially to frequencies within the range given by the BeginFrequency and EndFrequency parameters. The tuning direction is given by the Forward parameter. Tuning step is specified by the Step parameter.

The BeginFrequency has to be less than the EndFrequency.

Values of the BeginFrequency and EndFrequency can be within range given by the Range2.MinFrequency and Range2.MaxFrequency members of the G69DDC_DEVICE_INFO structure. Zero can be used as BeginFrequency, as well. This indicates that range 1 is included in the sweeper loop.

The IG69DDCDeviceCallback::G69DDC_SweeperCallback callback is invoked N times for each tuned frequency to pass N ADC snapshots to the application during sweeping, where N = Repeat + 1. The ADC snapshots are made sequentially in different times.

Use the IG69DDCDevice::StopSweeper method to stop the sweeper.


IG69DDCDevice::StopSweeper

Stops the sweeper which was previously started using the IG69DDCDevice::StartSweeper method.

C/C++ declaration

int StopSweeper(void);

Parameters

None

Return value

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

IG69DDCDevice::GetSpectrumCompensation

Determines the 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(uint64_t FrontEndFrequency,int32_t Shift,uint32_t Bandwidth,float *Buffer,uint32_t Count);

Parameters

FrontEndFrequency
[in] Specifies the front-end frequency in Hz.
Shift
[in] Specifies the relative center frequency (in Hz) of the bandwidth given by the Bandwidth parameter. It is relative to the front-end frequency given by the FrontEndFrequency parameter. It can be negative.
Bandwidth
[in] Specifies the width of the requested compensation data in Hz.
Buffer
[out] Pointer to a buffer to be filled with compensation data. This parameter cannot be NULL.
Count
[in] Specifies the number of float items in the buffer pointed to by the Buffer parameter.

Return value

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

Remarks

The following example shows how to use the GetSpectrumCompensation method in the IG69DDCDeviceCallback::G69DDC_DDC2StreamCallback callback:


//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);

IG69DDCDevice *Device; //Interface of G69DDC device object, created by the CreateInstance function
uint32_t DDC1Id; //Identifier of the DDC1 channel created by the IG69DDCDevice::CreateDDC1 method: Device->CreateDDC1(&DDC1Id)
uint32_t DDC2Id; //Identifier of the DDC2 channel created by the IG69DDCDevice::CreateDDC2 method: Device->CreateDDC2(DDC1Id,&DDC2Id)
uint64_t FrontEndFrequency; //Front-end frequency
int32_t RelDDC1Frequency; //Relative frequency of the DDC1 - relative to front-end frequency
int32_t RelDDC2Frequency; //Relative frequency of the DDC2
G69DDC_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
MY_CALLBACK_OBJECT MyCallbackObject; //User defined callback object which implements methods of IG69DDCDeviceCallback interface

Code before...

//Retrieve front-end frequency
Device->GetFrontEndFrequency(&FrontEndFrequency);

//Retrieve relative frequency of the DDC1
Device->GetDDCFrequency(DDC1Id,&RelDDC1Frequency);

//Retrieve relative frequency of the DDC2
Device->GetDDC2Frequency(DDC2Id,&RelDDC2Frequency);

//Retrieve DDC type information of the DDC2
Device->GetDDC2(DDC2Id,NULL,&DDC2Info);

//Retrieve compensation data
Device->GetSpectrumCompensation(FrontEndFrequency,RelDDC1Frequency+RelDDC2Frequency,DDC2Info.SampleRate,Compensation,2048);
//In this case the Width 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 
//front-end frequency, 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;

//Register callback object
Device->SetCallback(&MyCallbackObject);

//Start DDC2 streaming for channel 0
//The SampleSetsPerBuffer parameter is set to 2048 which is size of the FFT to simplify
//the example.
Device->StartDDC(DDC2Id,2048);

Code after...
    
void MY_CALLBACK_OBJECT::G69DDC_DDC2StreamCallback(IG69DDCDevice *Device,uint32_t DDC2ChannelId,const float *Buffer,uint32_t NumberOfSamples)
{
 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.
}


IG69DDCDevice::SetCallback

Registers a user-defined callback object given by its interface. The API calls 'methods' of the object to pass samples to the application. The object has to implement methods of the IG69DDCDeviceCallback interface.

C/C++ declaration

int SetCallback(IG69DDCDeviceCallback *Callback);

Parameters

Callback
[in] Interface to a user-defined object to be registered as a callback object. If this parameter is NULL, the current callback object is unregistered, the API will not call any callback after SetCallback returns.

Return value

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

IG69DDCDevice::GetCallback

Returns a pointer to the current user-defined callback object.

C/C++ declaration

IG69DDCDeviceCallback* GetCallback(void);

Parameters

None

Return value

This method returns a pointer to the current user-defined callback object, previously set by the IG69DDCDevice::SetCallback method.

IG69DDCDeviceCallback interface

The IG69DDCDeviceCallback interface is an interface of the application-defined object that implements methods of the interface. The object is used to receive streamed buffers from the G69DDC device object. See IG69DDCDevice::SetCallback.

Each method of the interface is called in context of the thread created by the API. If some shared data is accessed inside callback methods, it is recommended that a mutual-exclusion synchronization method is used. The application should not call any G69DDC API function/method from inside the method of this interface, otherwise the function/method fails. The only exception is the IG69DDCDevice::GetSpectrumCompensation method which can be called from inside the callbacks.


IG69DDCDeviceCallback::G69DDC_ADCSnapshotCallback

This is called by the API to pass ADC snapshots to the application. Sending of ADC snapshots is started using the IG69DDCDevice::StartADCSnapshots method.

C/C++ declaration

void G69DDC_ADCSnapshotCallback(IG69DDCDevice *Device,const short *Buffer,uint32_t Count,uint32_t CenterFrequencyuint16_t ADCLevel);

Parameters

Device
Interface of the device object which called the method.
Buffer
Pointer to the buffer which contains samples directly received from the ADC. The sample rate is 200 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 100 MHz wide snapshot. Not all of the 100 MHz band of the snapshot is usable. The usable bandwidth depends on the selected receiver's input range. If range 1 is active, the bandwidth is given by the Range1.Bandwidth member of the G69DDC_DEVICE_INFO structure. For range 2, the bandwidth is given by the Range2.Bandwidth member of the G69DDC_DEVICE_INFO structure. The active receiver input can be determined using the GetFrontEndFrequency function.
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.

IG69DDCDeviceCallback::G69DDC_DDC1StreamCallback

This is called by the API to pass I/Q samples from DDC1 to the application. The DDC1 streaming can be started using the IG69DDCDevice::StartDDC or IG69DDCDevice::StartDDC1Playback method.

C/C++ declaration

void G69DDC_DDC1StreamCallback(IG69DDCDevice *Device,uint32_t DDC1ChannelId,const void *Buffer,uint32_t Count,uint32_t BitsPerSample);

Parameters

Device
Interface of the device object which called the method.
DDC1ChannelId
Specifies the identification number of the DDC1 channel. See IG69DDCDevice::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 IG69DDCDevice::SetDDC method. 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 IG69DDCDevice::StartDDC or IG69DDCDevice::StartDDC1Playback method.
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.

IG69DDCDeviceCallback::G69DDC_DDC1PlaybackStreamCallback

This is called by the API to fill the buffer with I/Q samples by the application. The DDC1 playback can be started using the IG69DDCDevice::StartDDC1Playback method.

C/C++ declaration

int G69DDC_DDC1PlaybackStreamCallback(IG69DDCDevice *Device,uint32_t DDC1ChannelId,void *Buffer,uint32_t Count,uint32_t BitsPerSample);

Parameters

Device
Interface of the device object which called the method.
DDC1ChannelId
Specifies the identification number of the DDC1 channel. See IG69DDCDevice::CreateDDC1.
Buffer
Pointer to the buffer to be filled with I/Q sample sets. The sample rate and bits per sample are given by the used DDC type, see the IG69DDCDevice::SetDDC method.
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 IG69DDCDevice::StartDDC1Playback method. 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.

Return value

The application should return non-zero to continue playback. The application should return zero to stop the API from calling the G69DDC_DDC1PlaybackStreamCallback again. This does not stop DDC1 playback, it has to be done explicitly by the application calling the IG69DDCDevice::StopDDC method from the thread in which the device object was created using the CreateInstance function. IG69DDCDevice::StopDDC must not be called from inside the callback.

IG69DDCDeviceCallback::G69DDC_DDC2StreamCallback

This is called by the API to pass I/Q samples from DDC2 to the application. The DDC2 streaming can be started using the IG69DDCDevice::StartDDC method.

C/C++ declaration

void G69DDC_DDC2StreamCallback(IG69DDCDevice *Device,uint32_t DDC2ChannelId,const float *Buffer,uint32_t Count);

Parameters

Device
Interface of the device object which called the method.
DDC2ChannelId
Specifies the identification number of the DDC2 channel. See IG69DDCDevice::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 IG69DDCDevice::GetDDC method to determine the current DDC type of the DDC2. Sample is 32-bit IEEE float from the range of -1.0 to 1.0. One I/Q sample set consists of two samples.
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 IG69DDCDevice::StartDDC method.

IG69DDCDeviceCallback::G69DDC_DDC2PreprocessedStreamCallback

This 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 IG69DDCDevice::StartDDC method.

C/C++ declaration

void G69DDC_DDC2PreprocessedStreamCallback(IG69DDCDevice *Device,uint32_t DDC2ChannelId,const float *Buffer,
    uint32_t Count,float SlevelPeak,float SlevelRMS);

Parameters

Device
Interface of the device object which called the method.
DDC2ChannelId
Specifies the identification number of the DDC2 channel. See IG69DDCDevice::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 IG69DDCDevice::GetDDC method to determine the current DDC type of the DDC2. Sample is 32-bit IEEE float from the range of -1.0 to 1.0. One I/Q sample set consists of two samples.
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 IG69DDCDevice::StartDDC method.
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 on how to convert RMS signal level to dBm, see the remarks of the IG69DDCDevice::GetSignalLevel method.

IG69DDCDeviceCallback::G69DDC_AudioStreamCallback

This is called by the API to pass audio samples to the application. The audio streaming can be started using the IG69DDCDevice::StartAudio or IG69DDCDevice::StartAudioPlayback method.

C/C++ declaration

void G69DDC_AudioStreamCallback(IG69DDCDevice *Device,uint32_t DDC2ChannelId,uint32_t Stage,const float *Buffer,uint32_t Count);

Parameters

Device
Interface of the device object which called the method.
DDC2ChannelId
Specifies the identification number of the DDC2 channel. See IG69DDCDevice::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
G69DDC_AUDIO_STREAM_CALLBACK_STAGE_0The buffer contains audio samples affected by the audio gain (see IG69DDCDevice::SetAudioGain).
G69DDC_AUDIO_STREAM_CALLBACK_STAGE_1The buffer contains audio samples affected by the audio gain and audio filter (see IG69DDCDevice::SetAudioGain and IG69DDCDevice::SetAudioFilter).
G69DDC_AUDIO_STREAM_CALLBACK_STAGE_2The buffer contains audio samples affected by the audio gain, audio filter and volume (see IG69DDCDevice::SetAudioGain, IG69DDCDevice::SetAudioFilter, IG69DDCDevice::SetVolume and IG69DDCDevice::SetMute).
Buffer
Pointer to the buffer which contains samples of the audio signal. The 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 IG69DDCDevice::StartAudio or IG69DDCDevice::StartAudioPlayback method.

IG69DDCDeviceCallback::G69DDC_AudioPlaybackStreamCallback

This is called by the API to fill the buffer with audio samples by the application. The audio playback can be started using the IG69DDCDevice::StartAudioPlayback method.

C/C++ declaration

int G69DDC_AudioPlaybackStreamCallback(IG69DDCDevice *Device,uint32_t DDC2ChannelId,float *Buffer,uint32_t Count);

Parameters

Device
Interface of the device object which called the method.
DDC2ChannelId
Specifies the identification number of the DDC2 channel. See IG69DDCDevice::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. This value is equal to value of the SampleSetsPerBuffer parameter of the IG69DDCDevice::StartAudioPlayback method. If the application does not have requested number of samples, the application has to fill the buffer with zeros.

Return value

The application should return non-zero to continue playback. The application should return zero to stop the API from calling the G69DDC_AudioPlaybackStreamCallback again. This does not stop audio playback, it has to be done explicitly by the application calling the IG69DDCDevice::StopAudio method from the thread in which the device object was created using the CreateInstance function. IG69DDCDevice::StopAudio must not be called from inside the callback.

IG69DDCDeviceCallback::G69DDC_SweeperCallback

It is called by the API to pass ADC snapshots to the application during sweeping. The sweeper is started using the IG69DDCDevice::StartSweeper method.

C/C++ declaration

int G69DDC_SweeperCallback(IG69DDCDevice *Device,const short *Buffer,uint32_t Count,uint32_t CenterFrequency,uint64_t FrontEndFrequency,uint32_t Repeat);

Parameters

Device
Interface of the device object which called the callback.
Buffer
Pointer to the buffer which contains samples directly received from ADC. The sample rate is 200 MHz, sample is 16 bit signed little endian (values are from range -32768 to +32767).
Count
Specifies the number of samples in the buffer pointed to by the Buffer parameter. The value is equal to the SamplesPerSnapshot parameter passed to the IG69DDCDevice::StartSweeper method when starting the sweeper.
CenterFrequency
Specifies the center frequency of the useful band in the received 100 MHz wide snapshot. Not all of the 100 MHz band of the snapshot is usable. Usable bandwidth depends on the selected receiver's input range. For range 1 (the FrontEndFrequency parameter is zero), the bandwidth is given by the Range1.Bandwidth member of the G69DDC_DEVICE_INFO structure. For range 2 (the FrontEndFrequency parameter is non-zero) the bandwidth is given by the Range2.Bandwidth member of the G69DDC_DEVICE_INFO structure.
FrontEndFrequency
Front-end frequency (in Hz) at the time when the snapshot was made.
Repeat
Specifies how many snapshots will be made on the current front-end frequency before the sweeper tunes the receiver to the next frequency. This depends on the Repeat parameter passed to the IG69DDCDevice::StartSweeper method when starting the sweeper.

Return value

The application should return non-zero to continue sweeping. The application should return zero to stop API to call G69DDC_SweepingCallback again. This does not stop the sweeper, it has to be done explicitly by the application calling the IG69DDCDevice::StopSweeper method from the thread in which the device object was created using the CreateInstance function. IG69DDCDevice::StopSweeper must not be called from inside the callback.

IG69DDCNetworkEnumeratorCallback interface

The IG69DDCNetworkEnumeratorCallback interface is an interface of 'application-defined object' that implements the method of the interface. The object is used to receive information about discovered G69DDC devices in the computer's subnet. See IG69DDCNetworkEnumerator::Start..


IG69DDCNetworkEnumeratorCallback::G69DDC_DeviceFound

This is called by the API to pass information about discovered G69DDC device to the application. The method is called in context of the thread created by the API.

C/C++ declaration

void G69DDC_DeviceFound(uint32_t IpAddress,uint16_t Port,const char *SerialNumber,uint32_t Flags);

Parameters

IpAddress
IP address of discovered G69DDC device in network byte order.
Port
IP port number in network byte order.
SerialNumber
Device's 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 software client.

Structures

G69DDC_DEVICE_INFO

Contains information about the G69DDC device.

C/C++ declaration

#pragma pack(push,1)

typedef struct
{
    char          DevicePath[MAX_PATH];
    uint8_t       InterfaceType;
    char          SerialNumber[9];
    uint16_t      HWVersion;
    uint16_t      FWVersion[3];
    uint8_t       EEPROMVersion;
        
    struct
    {
        uint32_t  Bandwidth;
    }             Range1;

    struct
    {
        uint32_t  MinFrequency;
        uint64_t  MaxFrequency;
        uint32_t  Step;
        uint32_t  Bandwidth;        
    }             Range2;

    uint32_t      MaxDDC1ChannelCount;    
    uint32_t      MaxDDC2ChannelCount;
    uint32_t      MaxDDC1TypeCount;
    uint32_t      MaxDDC2TypeCount;   
    uint32_t      MaxDDC2ChannelsPerDDC1Channel;
    uint32_t      Flags;
    uint8_t       MACAddress[6];
} G69DDC_DEVICE_INFO;

#pragma pack(pop)

Members

DevicePath
The device system path in a null-terminated string. It is used to open the device using the object interface.

If the device information structure is obtained from an already open device using the IG69DDCDevice::GetDeviceInfo method, 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
G69DDC_INTERFACE_TYPE_PCIEThe device is connected to the computer via PCI express.
G69DDC_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.
G69DDC_INTERFACE_TYPE_USB3The device is connected to the computer via USB3.
G69DDC_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.
G69DDC_INTERFACE_TYPE_DEMODemo G69DDC device.
SerialNumber
Serial number in null-terminated string.
HWVersion
Version of the hardware.
FWVersion[3]
Version of the firmwares.
EEPROMVersion
EEPROM structure version.
Range1.Bandwidth
Specifies the useful bandwidth (in Hz) of the signal passed to the IG69DDCDeviceCallback::G69DDC_ADCSnapshotCallback and IG69DDCDeviceCallback::G69DDC_SweeperCallback callbacks in range 1.
Range2.MinFrequency
Minimum front-end frequency (in Hz) which can be used in the IG69DDCDevice::SetFrontEndFrequency and IG69DDCDevice::StartSweeper methods in range 2.
Range2.MaxFrequency
Maximum front-end frequency (in Hz) which can be used in the IG69DDCDevice::SetFrontEndFrequency and IG69DDCDevice::StartSweeper methods in range 2.
Range2.Step
Tuning step (in Hz) of the front-end in range 2. The frequencies used in the IG69DDCDevice::SetFrontEndFrequency and IG69DDCDevice::StartSweeper methods have to be multiple of this value.
Range2.Bandwidth
Specifies the useful bandwidth (in Hz) of the signal passed to the IG69DDCDeviceCallback::G69DDC_ADCSnapshotCallback and IG69DDCDeviceCallback::G69DDC_SweeperCallback callbacks in range 2.
MaxDDC1ChannelCount
Maximum number of DDC1 channels which can be created by the IG69DDCDevice::CreateDDC1 method per single device.
MaxDDC2ChannelCount
Maximum number of DDC2 channels which can be created by the IG69DDCDevice::CreateDDC2 method 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 IG69DDCDevice::GetDDCCount method because it is also limited by the currently selected DDC type of the 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
G69DDC_FLAGS_EXTERNAL_REFERENCE_INThe device includes an external reference oscillator input.
G69DDC_FLAGS_COHERENTThe device supports coherent mode.
G69DDC_FLAGS_EXTERNAL_REFERENCE_OUTThe device includes a reference oscillator output.
MACAddress
Physical Ethernet address of the devices.

G69DDC_DEVICE_STATE

Contains information about the device state.

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;
} G69DDC_DEVICE_STATE;

#pragma pack(pop)

Members

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

ValueMeaning
G69DDC_DEVICE_STATE_HIGH_TEMPERATURECritical temperature is detected and the device is turned off automatically. In this case the application should call IG69DDCDevice::SetPower to turn off explicitly.
Temperatures
Internal device's temperatures in °C. If temperature is not available or it is unknown the value is equal to G69DDC_TEMPERATURE_UNKNOWN.
FanRPM
Device's fan rotations per minute. Zero value means the fan is off.
DataTransferred
Total number of bytes transferred from/to device since it 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.

G69DDC_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;
} G69DDC_DDC_INFO;

#pragma pack(pop)

Members

SampleRate
Sample rate of the 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.

G69DDC_AMS_CAPTURE_RANGE

Contains information about the AMS capture range.

C/C++ declaration

#pragma pack(push,1)

typedef struct
{
    uint32_t  Tune;
    uint32_t  Lock;
} G69DDC_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.