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 interfaces to control the G69DDC device. This document describes the non-object-oriented interface. The libg69ddcapi.so library exports several functions 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.
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 handles to G69DDC devices returned by the OpenDevice function must be closed by the CloseDevice function, otherwise the application may enter an unpredictable state.
The following source code shows how to load the API.
#include <stdio.h> #include <dlfcn.h> #include "g69ddcapi.h" G69DDC_OPEN_DEVICE OpenDevice; G69DDC_CLOSE_DEVICE CloseDevice; void *API; void main(void) { //Loading the API API=dlopen("libg69ddcapi.so",RTLD_LAZY); if(API!=NULL) { //Retrieving addresses of used API functions OpenDevice=(G69DDC_OPEN_DEVICE)dlsym(API,"OpenDevice"); CloseDevice=(G69DDC_CLOSE_DEVICE)dlsym(API,"CloseDevice"); //Here place code that uses the API dlclose(API); } else { //If the dlopen fails printf("Failed to load libg69ddcapi.so. %s\n",dlerror()); } }
The G69DDC API provides the GetDeviceList function which returns list of locally available G69DDC devices which can be opened by the OpenDevice function.
The following source code produces a list of serial numbers for the available G69DDC devices.
#include <stdio.h> #include <stdint.h> #include <dlfcn.h> #include <stdlib.h> #include <errno.h> #include "g69ddcapi.h" G69DDC_GET_DEVICE_LIST GetDeviceList; G69DDC_FREE_DEVICE_LIST FreeDeviceList; void *API; int main(void) { uint32_t Count,i; G69DDC_DEVICE_INFO *DeviceList; //Loading the API API=dlopen("libg69ddcapi.so",RTLD_LAZY); if(API!=NULL) { //Retrieving address of the GetDeviceList function GetDeviceList=(G69DDC_GET_DEVICE_LIST)dlsym(API,"GetDeviceList"); FreeDeviceList=(G69DDC_FREE_DEVICE_LIST)dlsym(API,"FreeDeviceList"); //Retrieving information about available devices if(GetDeviceList(&DeviceList,&Count)) { if(Count!=0) { printf("Available G69DDC devices count=%d:\n",Count); for(i=0;i<Count;i++) { printf("%d. SN: %s\n",i,DeviceList[i].SerialNumber); } FreeDeviceList(DeviceList); } else { printf("No available G69DDC device found.\n"); } } else { printf("GetDeviceList failed with error %d\n",errno); } dlclose(API); } else { printf("Failed to load libg69ddcapi.so. %s\n",dlerror()); } printf("Press enter to exit\n"); getchar(); return 0; }
The G69DDC device has to be opened before it can be controlled. The API provides the OpenDevice function to open the device.
The following source code shows how to open the first available G69DDC device.
#include <stdio.h> #include <dlfcn.h> #include <errno.h> #include "g69ddcapi.h" G69DDC_OPEN_DEVICE OpenDevice; G69DDC_CLOSE_DEVICE CloseDevice; void *API; int main(void) { int32_t hDevice; //Loading the API API=dlopen("libg69ddcapi.so",RTLD_LAZY); if(API!=NULL) { //Retrieving addresses of the OpenDevice and CloseDevice API functions OpenDevice=(G69DDC_OPEN_DEVICE)dlsym(API,"OpenDevice"); CloseDevice=(G69DDC_CLOSE_DEVICE)dlsym(API,"CloseDevice"); //Opening the first available G69DDC device using predefined G69DDC_OPEN_FIRST constant hDevice=OpenDevice(G69DDC_OPEN_FIRST); if(hDevice>=0) { //Here place code that works with the open G69DDC device //Closing handle to opened G69DDC device CloseDevice(hDevice); } else { printf("OpenDevice failed with error %d.\n",errno); } dlclose(API); } else { //If the dlopen fails printf("Failed to load libg69ddcapi.so. %s\n",dlerror()); } return 0; }
The GetDeviceList function returns information about the locally available G69DDC devices which can be opened.
C/C++ declaration
int GetDeviceList(G69DDC_DEVICE_INFO **DeviceList,uint32_t *Count);
Address retrieval
G69DDC_GET_DEVICE_LIST GetDeviceList=(G69DDC_GET_DEVICE_LIST)dlsym(hAPI,"GetDeviceList");
Parameters
DeviceList[out] Pointer to a variable which receives a pointer to an array of G69DDC_DEVICE_INFO structures to be filled with information about available G69DDC devices. The array does not contain information about G69DDC devices connected via their LAN interface. The number of the structures in the array is equal to the number of available G69DDC devices.When the array is no longer required, use the FreeDeviceList function, to free the used memory.
If no available G69DDC device is found, the received value is equal to NULL.
Count[in] Pointer to a variable which receives the number of available G69DDC devices.
Return value
If the function succeeds, the return value is non-zero. If the function fails, the return value is zero. To get extended error information, check errno.
The FreeDeviceList function frees the memory previously allocated by the GetDeviceList function.
C/C++ declaration
void FreeDeviceList(G69DDC_DEVICE_INFO *DeviceList);
Address retrieval
G69DDC_FREE_DEVICE_LIST GetDeviceList=(G69DDC_FREE_DEVICE_LIST)dlsym(hAPI,"FreeDeviceList");
Parameters
DeviceList[out] Pointer to an array of G69DDC_DEVICE_INFO structures provided by the GetDeviceList function.This parameter can be NULL, in this case the function does nothing.
No return value
SearchNetworkDevices
The SearchNetworkDevices function searches for 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.
C/C++ declaration
int SearchNetworkDevices(G69DDC_SEARCH_NETWORK_DEVICES_CALLBACK Callback,uintptr_t UserData,uint32_t Timeout);Address retrieval
G69DDC_SEARCH_NETWORK_DEVICES SearchNetworkDevices=(G69DDC_SEARCH_NETWORK_DEVICES)dlsym(hAPI,"SearchNetworkDevices");Parameters
Callback[in] Pointer to an application-defined callback function. It is called every time that a new remote G69DDC device is discovered.C/C++ declaration
int SearchNetworkDevicesCallback(uint32_t IpAddress,uint16_t Port,const char *SerialNumber,uint32_t Flags,uintptr_t UserData);Parameters
IpAddressIPv4 address of the discovered G69DDC device in network byte order.PortIP port number in network byte order.SerialNumberSerial number in null-terminated string.FlagsFlags 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.UserDataUser-defined data. It is the value passed to the SearchNetworkDevices function as the UserData parameter.Return value
To continue searching, the callback function has to return a non-zero value, to stop searching, it has to return zero.UserData[in] Specifies a user-defined value which is passed to the callback function.Timeout[in] Timeout interval in milliseconds. The function stops searching for the G69DDC devices and returns if the interval elapses. If the Timeout is zero, the function returns immediately.Return value
If the function succeeds, the return value is non-zero. If the function fails, the return value is zero. To get extended error information, check errno.
OpenDevice
Opens the G69DDC device by its serial number or network address.
C/C++ declaration
int32_t OpenDevice(const char *SerialNumber);Address retrieval
G69DDC_OPEN_DEVICE OpenDevice=(G69DDC_OPEN_DEVICE)dlsym(hAPI,"OpenDevice");Parameters
SerialNumber[in] Pointer to a null-terminated string which specifies the serial number of the G69DDC device to open.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").
One of the following values can be used instead of the serial number and remote address:
Value Meaning G69DDC_OPEN_FIRST This function opens the first available G69DDC device. G69DDC_OPEN_DEMO This function opens a demo G69DDC device. This allows developers to work with the API without a physical G69DDC device. Return value
If the function succeeds, the return value is a handle to the specified G69DDC device. This handle can only be used with functions of G69DDC API.
If the function fails, the return value is negative. To get extended error information, check errno.Remarks
The OpenDevice function can be called from any user thread, the returned handle can only be used in the same thread, otherwise the application can enter an unpredictable state.
Use the CloseDevice function to close the G69DDC device handle returned by the OpenDevice function.
CloseDevice
Closes the G69DDC device.
C/C++ declaration
int CloseDevice(int32_t hDevice);Address retrieval
G69DDC_CLOSE_DEVICE CloseDevice=(G69DDC_CLOSE_DEVICE)dlsym(hAPI,"CloseDevice");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
IsDeviceConnected
Checks whether the device is still connected to the computer.
C/C++ declaration
int IsDeviceConnected(int32_t hDevice,int *Connected);Address retrieval
G69DDC_IS_DEVICE_CONNECTED IsDeviceConnected=(G69DDC_IS_DEVICE_CONNECTED)dlsym(hAPI,"IsDeviceConnected");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Connected[out] Pointer to a variable which receives the current connection status. If the received value is non-zero, the device is still connected and available. If the device is disconnected, the received value is zero.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
If it is determined that the device is disconnected, the corresponding device handle is no longer usable, so it should be closed using the CloseDevice function.
GetDeviceInfo
Retrieves information about the G69DDC device.
C/C++ declaration
int GetDeviceInfo(int32_t hDevice,G69DDC_DEVICE_INFO *Info);Address retrieval
G69DDC_GET_DEVICE_INFO GetDeviceInfo=(G69DDC_GET_DEVICE_INFO)dlsym(hAPI,"GetDeviceInfo");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Info[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 function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetLED
Sets the front panel LED flashing mode of the G69DDCe device.
C/C++ declaration
int SetLED(int32_t hDevice,uint32_t LEDMode);Address retrieval
G69DDC_SET_LED SetLED=(G69DDC_SET_LED)dlsym(hAPI,"SetLED");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.LEDMode[in] Specifies the front panel LED flashing mode, which can be one of the following:
Value Meaning G69DDC_FRONT_PANEL_LED_MODE_DIAG Diagnostic flashing. G69DDC_FRONT_PANEL_LED_MODE_ON Always on. G69DDC_FRONT_PANEL_LED_MODE_OFF Always off. Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetLED function to determine the current flashing mode of the front panel LED.
A complete list of the diagnostic flashing patterns and their meaning is as follows:
No. Pattern Description Mode 1
Off No power 2
Fading No connection to 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
GetLED
Determines the current flashing mode of device's front panel LED.
C/C++ declaration
int GetLED(int32_t hDevice,uint32_t *LEDMode);Address retrieval
G69DDC_GET_LED GetLED=(G69DDC_GET_LED)dlsym(hAPI,"GetLED");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.LEDMode[out] Pointer to a variable which receives the current flashing mode of device's front panel LED. For a list of possible values, see SetLED. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetPower
Turns the G69DDC device on or off.
C/C++ declaration
int SetPower(int32_t hDevice,int Power);Address retrieval
G69DDC_SET_POWER SetPower=(G69DDC_SET_POWER)dlsym(hAPI,"SetPower");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Power[in] Specifies whether to turn on or off the device. If this parameter is non-zero the device is turned on, if it is zero the device is turned off.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
If SetPower turns the device off, all the running streams are stopped.
Use the GetPower function to determine the current power state of the device.
GetPower
The GetPower function determines whether the device is turned on or off.
C/C++ declaration
int GetPower(int32_t hDevice,int *Power);Address retrieval
G69DDC_GET_POWER GetPower=(G69DDC_GET_POWER)dlsym(hAPI,"GetPower");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Power[out] Pointer to a variable which receives the current power state of the device. If it is non-zero, the device is turned on. If it is zero the device is turned off. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
GetDeviceState
Retrieves the current state of the G69DDC device, like internal temperatures, error state, data transfer counters.
C/C++ declaration
int GetDeviceState(int32_t hDevice,G69DDC_DEVICE_STATE *State);Address retrieval
G69DDC_GET_DEVICE_STATE GetDeviceState=(G69DDC_GET_DEVICE_STATE)dlsym(hAPI,"GetDeviceState");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.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 function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetExternalReference
Enables or disables the use of an external reference as the clock source.
C/C++ declaration
int SetExternalReference(int32_t hDevice,int Enabled);Address retrieval
G69DDC_SET_EXTERNAL_REFERENCE SetExternalReference=(G69DDC_SET_EXTERNAL_REFERENCE)dlsym(hAPI,"SetExternalReference");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Enabled[in] Specifies the desired clock source: nonzero - external reference, zero - internal.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
External reference input is optional. If the receiver does not support external reference, SetExternalReference fails. The following example shows how to determine whether the receiver supports an external reference:
G69DDC_DEVICE_INFO DeviceInfo; int32_t hDevice; //handle to open G69DDC device GetDeviceInfo(hDevice,&DeviceInfo); if(DeviceInfo.Flags & G69DDC_FLAGS_EXTERNAL_REFERENCE_IN) { //the receiver has external reference input } else { //the receiver does not have external reference input }
GetExternalReference
Retrieves the current clock source.
C/C++ declaration
int GetExternalReference(int32_t hDevice,int *Enabled);Address retrieval
G69DDC_GET_EXTERNAL_REFERENCE GetExternalReference=(G69DDC_GET_EXTERNAL_REFERENCE)dlsym(hAPI,"GetExternalReference");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Enabled[out] Pointer to a variable which receives information about the current clock source. If it is non-zero, external reference is used, if it is zero, internal reference is used. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, int
SetBuiltInTest
Enables or disables the test signal at the receiver's input, which allows testing of the entire signal and processing path.
C/C++ declaration
int SetBuiltInTest(int32_t hDevice,int Enabled);Address retrieval
G69DDC_SET_BUILT_IN_TEST SetBuiltInTest=(G69DDC_SET_BUILT_IN_TEST)dlsym(hAPI,"SetBuiltInTest");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Enabled[in] Specifies whether to enable or disable the built-in test. If this parameter is non-zero, the test signal is enabled. If the parameter is zero, the test signal is disabled.Test signal parameters:
Range Frequency Level 1 65 MHz ± 5 MHz -53 dBm ± 5 dB 2 340 MHz ± 8 MHz -70 dBm ± 5 dB Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
GetBuiltInTest
Retrieves information about whether the test signal is enabled or not.
C/C++ declaration
int GetBuiltInTest(int32_t hDevice,int *Enabled);Address retrieval
G69DDC_GET_BUILT_IN_TEST GetBuiltInTest=(G69DDC_GET_BUILT_IN_TEST)dlsym(hAPI,"GetBuiltInTest");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Enabled[out] Pointer to a variable which receives information about the test signal state. If it is non-zero, test signal is enabled, if it is zero, test signal is not enabled. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetAttenuator
Sets the input attenuator.
C/C++ declaration
int SetAttenuator(int32_t hDevice,uint32_t Attenuator);Address retrieval
G69DDC_SET_ATTENUATOR SetAttenuator=(G69DDC_SET_ATTENUATOR)dlsym(hAPI,"SetAttenuator");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Attenuator[in] Value that specifies the attenuation level in dB. Possible values are: 0, 3, 6, 9, 12, 15, 18, 21. If the value is not from this list, the SetAttenuator function rounds the value to the nearest lower one.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetAttenuator function to determine the current setting of the attenuator.
GetAttenuator
Retrieves the current setting of the attenuator.
C/C++ declaration
int GetAttenuator(int32_t hDevice,uint32_t *Attenuator);Address retrieval
G69DDC_GET_ATTENUATOR GetAttenuator=(G69DDC_GET_ATTENUATOR)dlsym(hAPI,"GetAttenuator");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Attenuator[out] Pointer to a variable which receives the current attenuation level. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetMWFilter
Enables or disables the MW filter (medium wave filter).
C/C++ declaration
int SetMWFilter(int32_t hDevice,int Enabled);Address retrieval
G69DDC_SET_MW_FILTER SetPreselectors=(G69DDC_SET_MW_FILTER)dlsym(hAPI,"SetMWFilter");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.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 function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetMWFilter function to determine the current state of the MW filter.
GetMWFilter
Retrieves the current state of the MW filter.
C/C++ declaration
int GetMWFilter(int32_t hDevice,int *Enabled);Address retrieval
G69DDC_GET_MW_FILTER GetMWFilter=(G69DDC_GET_MW_FILTER)dlsym(hAPI,"GetMWFilter");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Low[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 function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetPreamplifier
Enables or disables the RF input preamplifier.
C/C++ declaration
int SetPreamplifier(int32_t hDevice,int Preamp);Address retrieval
G69DDC_SET_PREAMPLIFIER SetPreamplifier=(G69DDC_SET_PREAMPLIFIER)dlsym(hAPI,"SetPreamplifier");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Preamp[in] Specifies whether to enable or disable the RF preamplifier. If this parameter is non-zero, the preamplifier is enabled. If the parameter is zero, the preamplifier is disabled.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The preamplifier is only available in the RF frequency range 2.
Use the GetPreamplifier function to determine the current state of the preamplifier.
GetPreamplifier
Retrieves the current state of the RF input preamplifier.
C/C++ declaration
int GetPreamplifier(int32_t hDevice,int *Preamp);Address retrieval
G69DDC_GET_PREAMPLIFIER GetPreamplifier=(G69DDC_GET_PREAMPLIFIER)dlsym(hAPI,"GetPreamplifier");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Preamp[out] Pointer to a variable which receives the current state of the preamplifier. The value is non-zero if the preamplifier is enabled and zero if it is disabled. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetInverted
Enables or disables frequency spectrum inversion.
C/C++ declaration
int SetInverted(int32_t hDevice,int Inverted);Address retrieval
G69DDC_SET_INVERTED SetInverted=(G69DDC_SET_INVERTED)dlsym(hAPI,"SetInverted");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Inverted[in] Specifies whether to enable or disable frequency spectrum inversion. If this parameter is non-zero, IF spectrum is inverted.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
GetInverted
Retrieves the current frequency spectrum inversion setting.
C/C++ declaration
int GetInverted(int32_t hDevice,int *Inverted);Address retrieval
G69DDC_GET_INVERTED GetInverted=(G69DDC_GET_INVERTED)dlsym(hAPI,"GetInverted");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Inverted[out] Pointer to a variable which receives a non-zero value if the frequency spectrum inversion is enabled, and zero if the inversion is disabled. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
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(int32_t hDevice,uint64_t Frequency);Address retrieval
G69DDC_SET_FRONT_END_FREQUENCY SetFrontEndFrequency=(G69DDC_SET_FRONT_END_FREQUENCY)dlsym(hAPI,"SetFrontEndFrequency");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.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 function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetFrontEndFrequency function to determine the current front-end frequency.
GetFrontEndFrequency
Retrieves the current front-end frequency and active receiver's RF input.
C/C++ declaration
int GetFrontEndFrequency(int32_t hDevice,uint64_t *Frequency);Address retrieval
G69DDC_GET_FRONT_END_FREQUENCY GetFrontEndFrequency=(G69DDC_GET_FRONT_END_FREQUENCY)dlsym(hAPI,"GetFrontEndFrequency");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.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 function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetADCNoiseBlanker
Enables or disables the noise blanker on the ADC stream.
C/C++ declaration
int SetADCNoiseBlanker(int32_t hDevice,int Enabled);Address retrieval
G69DDC_SET_ADC_NOISE_BLANKER SetADCNoiseBlanker=(G69DDC_SET_ADC_NOISE_BLANKER)dlsym(hAPI,"SetADCNoiseBlanker");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Enabled[in] Specifies whether to enable or disable the noise blanker. If this parameter is non-zero, the noise blanker is enabled. If the parameter is zero, the noise blanker is disabled.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetADCNoiseBlanker function to determine the current state of the noise blanker.
GetADCNoiseBlanker
Retrieves the current ADC noise blanker state.
C/C++ declaration
int GetADCNoiseBlanker(int32_t hDevice,int *Enabled);Address retrieval
G69DDC_GET_ADC_NOISE_BLANKER GetADCNoiseBlanker=(G69DDC_GET_ADC_NOISE_BLANKER)dlsym(hAPI,"GetADCNoiseBlanker");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Enabled[out] Pointer to a variable which receives the current state of the noise blanker. The value is non-zero if noise blanker is enabled and zero if it is disabled. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetADCNoiseBlankerThreshold
Specifies the ADC noise blanker threshold.
C/C++ declaration
int SetADCNoiseBlankerThreshold(int32_t hDevice,uint16_t Threshold);Address retrieval
G69DDC_SET_ADC_NOISE_BLANKER_THRESHOLD SetADCNoiseBlankerThreshold= (G69DDC_SET_ADC_NOISE_BLANKER_THRESHOLD)dlsym(hAPI,"SetADCNoiseBlankerThreshold");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Threshold[in] Specifies the maximum acceptable input signal. The maximum possible value of threshold is 32767, in this case the noise blanker has no effect even if it is enabled using the SetADCNoiseBlanker function.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetADCNoiseBlankerThreshold function to retrieve the current threshold of the noise blanker.
GetADCNoiseBlankerThreshold
Determines the ADC noise blanker threshold.
C/C++ declaration
int GetADCNoiseBlankerThreshold(int32_t hDevice,uint16_t *Threshold);Address retrieval
G69DDC_GET_ADC_NOISE_BLANKER_THRESHOLD GetADCNoiseBlankerThreshold= (G69DDC_GET_ADC_NOISE_BLANKER_THRESHOLD)dlsym(hAPI,"GetADCNoiseBlankerThreshold");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Threshold[out] Pointer to a variable which receives the threshold of ADC noise blanker. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
StartADCSnapshots
Starts sending ADC snapshots.
C/C++ declaration
int StartADCSnapshots(int32_t hDevice,uint16_t Interval,uint32_t SamplesPerSnapshot);Address retrieval
G69DDC_START_ADC_SNAPSHOTS StartADCSnapshots=(G69DDC_START_ADC_SNAPSHOTS)dlsym(hAPI,"StartADCSnapshots");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Interval[in] Specifies the time interval in milliseconds for how often the ADC snapshots are sent to the ADCSnapshotCallback callback function.SamplesPerSnapshot[in] Specifies the number of 16-bit samples per single ADC snapshot. In other words, it is the number of samples per buffer passed to the ADCSnapshotCallback callback function. It can be one of the following:
Value Number of samples per snapshot G69DDC_ADC_SAMPLES_PER_SNAPSHOT_64K 65536 G69DDC_ADC_SAMPLES_PER_SNAPSHOT_128K 131072 G69DDC_ADC_SAMPLES_PER_SNAPSHOT_256K 262144 Return value
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 G69DDC device has to be turned on using the SetPower function before use of StartADCSnapshots, otherwise the StartADCSnapshots function fails.
Too low a value of the Interval parameter and high number of samples per snapshot can dramatically increase data flow through USB/LAN which could cause failure of active streaming.
StopADCSnapshots
Stops sending ADC snapshots.
C/C++ declaration
int StopADCSnapshots(int32_t hDevice);Address retrieval
G69DDC_STOP_ADC_SNAPSHOTS StopADCSnapshots=(G69DDC_STOP_ADC_SNAPSHOTS)dlsym(hAPI,"StopADCSnapshots");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The ADCSnapshotCallback callback function is not called after StopADCSnapshots returns.
GetDDCInfo
Retrieves information about the DDC format.
C/C++ declaration
int GetDDCInfo(int32_t hDevice,uint32_t DDCTypeIndex,G69DDC_DDC_INFO *DDCInfo);Address retrieval
G69DDC_GET_DDC_INFO GetDDCInfo=(G69DDC_GET_DDC_INFO)dlsym(hAPI,"GetDDCInfo");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.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 function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetDDCCount function to determine the number of possible DDC types of DDC channel (DDC1 or DDC2). In this case the DDCTypeIndex parameter can vary from zero to one less than the number determined by the GetDDCCount.
Use the GetDDC function to determine the current DDC type index of DDC channel (DDC1 or DDC2).
DDC channels are created dynamically during run time when they are required. The DDC1 channel can be created using the CreateDDC1 function and the DDC2 channel can be created using the CreateDDC2 function.
CreateDDC1
Creates the primary digital down-converter (DDC1) channel. The DDC1 makes the down-conversion of the signal produced by the ADC.
C/C++ declaration
int CreateDDC1(int32_t hDevice,uint32_t *DDC1ChannelId);Address retrieval
G69DDC_CREATE_DDC1 CreateDDC1=(G69DDC_CREATE_DDC1)dlsym(hAPI,"CreateDDC1");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC1ChannelId[out] Pointer to a variable which receives the identification number of a newly created DDC1 channel. The value of the identification number can vary from 0 to one less than 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 function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The maximum number of DDC1 channels which can be created with the CreateDDC1 function, is determined by the MaxDDC1ChannelCount member of the G69DDC_DEVICE_INFO structure.
Use the DeleteDDC function to delete the DDC1 channel created by CreateDDC1.
CreateDDC2
Creates the secondary digital down-converter (DDC2) channel. The DDC2 channel makes the down-conversion of the signal produced by the primary digital down-converter (DDC1) and subsequently other signal processing like AGC, filtering, demodulation, etc.
C/C++ declaration
int CreateDDC2(int32_t hDevice,uint32_t DDC1ChannelId,uint32_t *DDC2ChannelId);Address retrieval
G69DDC_CREATE_DDC2 CreateDDC2=(G69DDC_CREATE_DDC2)dlsym(hAPI,"CreateDDC2");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC1ChannelId[in] Identification number of the DDC1 channel created by the CreateDDC1 function. The signal from this DDC1 will be subsequently processed by a newly create DDC2 channel.DDC2ChannelId[out] Pointer to a variable which receives the identification number of a newly created DDC2 channel. The value of the identification number can vary from 0 to one less than 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 function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The maximum number of DDC2 channels which can be created with the CreateDDC2 function, is determined by the MaxDDC2ChannelCount member of the 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 DeleteDDC function to delete the DDC2 channel created by CreateDDC2.
DeleteDDC
Deletes the DDC (DDC1 or DDC2) channel previously created by the CreateDDC1 or CreateDDC2 function.
C/C++ declaration
int DeleteDDC(int32_t hDevice,uint32_t DDCChannelId);Address retrieval
G69DDC_DELETE_DDC DeleteDDC=(G69DDC_DELETE_DDC)dlsym(hAPI,"DeleteDDC");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDCChannelId[in] Identification number of the DDC channel created by the CreateDDC1 or CreateDDC2 function.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
If DDCChannelId is the identification number of the DDC1 channel (primary DDC), the DeleteDDC function deletes this DDC1 channel including all the DDC2 (secondary DDC) channels connected to the deleted DDC1 channel. When the DeleteDDC returns, identification numbers of these DDC channels will be invalid and no longer usable.
GetDDCCount
Retrieves the number of DDC types supported by the given DDC channel (DDC1 or DDC2).
C/C++ declaration
int GetDDCCount(int32_t hDevice,uint32_t DDCChannelId,uint32_t *Count);Address retrieval
G69DDC_GET_DDC_COUNT GetDDCCount=(G69DDC_GET_DDC_COUNT)dlsym(hAPI,"GetDDCCount");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDCChannelId[in] Identification number of the DDC channel created by the CreateDDC1 or CreateDDC2 function.Count[out] Pointer to a variable which receives the number of DDC types supported by the given DDC channel. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Different DDC channels can support a different number of DDC types.
The maximum number of DDC types supported by the DDC1 channel is determined by the MaxDDC1TypeCount member of the 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.
SetDDC
Sets the current DDC type in the given DDC channel (DDC1 or DDC2).
C/C++ declaration
int SetDDC(int32_t hDevice,uint32_t DDCChannelId,uint32_t DDCTypeIndex);Address retrieval
G69DDC_SET_DDC SetDDC=(G69DDC_SET_DDC)dlsym(hAPI,"SetDDC");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDCChannelId[in] Identification number of the DDC channel created by the CreateDDC1 or CreateDDC2 function.DDCTypeIndex[in] Specifies the index of DDC type to be used in the specified DDC channel. It can vary from zero to one less than the number of supported DDC types of the DDC channel.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetDDCCount function to determine the number of possible DDC types of DDC channel. The DDCTypeIndex parameter can vary from zero to one less than the number determined by GetDDCCount.
The specified DDC channel must be idle, DDC streaming must not run when calling SetDDC. In other words, DDC streaming which is started using the StartDDC function has to be stopped using the StopDDC function before calling of SetDDC, otherwise SetDDC fails. The SetDDC function does not start and stop DDC streaming, it just changes the DDC type of the DDC channel.
Calling of SetDDC on the DDC1 channel can change the current DDC type of its DDC2 channels and current bandwidth of demodulator filters, so it is useful to call the GetDDC for DDC2 channels connected to the given DDC1 and GetDemodulatorFilterBandwidth functions immediately after SetDDC to determine the current DDC type of DDC2 channels and current bandwidth of demodulator filters.
Use the GetDDC function to determine the current DDC type of the DDC channel.
GetDDC
Retrieves information about the current DDC type of the DDC1 or DDC2 channel.
C/C++ declaration
int GetDDC(int32_t hDevice,uint32_t DDCChannelId,uint32_t *DDCTypeIndex,G69DDC_DDC_INFO *DDCInfo);Address retrieval
G69DDC_GET_DDC GetDDC=(G69DDC_GET_DDC)dlsym(hAPI,"GetDDC");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDCChannelId[in] Identification number of the DDC channel created by the CreateDDC1 or CreateDDC2 function.DDCTypeIndex[out] Pointer to a variable which receives the index of current DDC type of the specified DDC channel. This parameter can be NULL if the application does not require this information.DDCInfo[out] Pointer to a 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 function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The BitsPerSample member of the 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 DDC2StreamCallback and DDC2PreprocessedStreamCallback callback functions are always in IEEE float (32 bit, little endian) format.
SetDDCFrequency
Sets center frequency of the DDC1 or DDC2.
C/C++ declaration
int SetDDCFrequency(int32_t hDevice,uint32_t DDCChannelId,int32_t Frequency);Address retrieval
G69DDC_SET_DDC_FREQUENCY SetDDCFrequency=(G69DDC_SET_DDC_FREQUENCY)dlsym(hAPI,"SetDDCFrequency");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDCChannelId[in] Identification number of DDC channel created by the CreateDDC1 or CreateDDC2 function.Frequency[in] Specifies the new center frequency of the DDC in Hz.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
If the value of the DDCChannelId parameter is the identification number of the DDC1 channel, the Frequency parameter specifies a new 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 GetDDCFrequency function to determine the current center frequency of the DDC1 or DDC2 channel.
The following example shows three methods of how it is possible to set the absolute DDC2 center frequency to 60.01 MHz:
int32_t hDevice; //Handle to G69DDC device returned by the OpenDevice function uint32_t DDC1Id; //Identifier of the DDC1 channel created by the CreateDDC1 function: CreateDDC1(hDevice,&DDC1Id) uint32_t DDC2Id; //Identifier of the DDC2 channel created by the CreateDDC2 function: CreateDDC2(hDevice,DDC1Id,&DDC2Id) //1. method (in range 1) SetFrontEndFrequency(hDevice,0); //Set active receiver's input to the range 1 (0 - 80 MHz) SetDDCFrequency(hDevice,DDC1Id,60010000); SetDDCFrequency(hDevice,DDC2Id,0); //2. method (in range 1), it can be used if bandwidth of DDC2 is less than bandwidth of DDC1 SetFrontEndFrequency(hDevice,0); SetDDCFrequency(hDevice,DDC1Id,60000000); SetDDCFrequency(hDevice,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 SetFrontEndFrequency(hDevice,60000000); SetDDCFrequency(hDevice,DDC1Id,20000); SetDDCFrequency(hDevice,DDC2Id,-10000);
GetDDCFrequency
Retrieves the current center frequency of DDC1 or DDC2.
C/C++ declaration
int GetDDCFrequency(int32_t hDevice,uint32_t DDCChannelId,int32_t *Frequency);Address retrieval
G69DDC_GET_DDC_FREQUENCY GetDDCFrequency=(G69DDC_GET_DDC_FREQUENCY)dlsym(hAPI,"GetDDCFrequency");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDCChannelId[in] Identification number of the DDC channel created by the CreateDDC1 or CreateDDC2 function.Frequency[out] Pointer to a variable which receives the current center frequency of the DDC1 or DDC2 channel in Hz. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
If the value of the DDCChannelId parameter is the identification number of the DDC1 channel, the received frequency is the center frequency of the given 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.
StartDDC
Starts DDC1 or DDC2 streaming.
C/C++ declaration
int StartDDC(int32_t hDevice,uint32_t DDCChannelId,uint32_t SampleSetsPerBuffer);Address retrieval
G69DDC_START_DDC StartDDC=(G69DDC_START_DDC)dlsym(hAPI,"StartDDC");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDCChannelId[in] Identification number of the DDC channel created by the CreateDDC1 or CreateDDC2 function.SampleSetsPerBuffer[in] If the DDCChannelId is the identification number of the DDC1 channel, this parameter specifies the number of I/Q sample sets in each buffer passed to the DDC1StreamCallback callback function. If the DDCChannelId parameter is the identification number of the DDC2, the SampleSetsPerBuffer specifies the number of I/Q sample sets in each buffer passed to the DDC2StreamCallback and DDC2StreamCallback callback functions. If the current DDC type index (specified by the SetDDC function) is less than or equal to 24 (DDC bandwidth <= 5 MHz) the value of the SampleSetsPerBuffer has to be a multiple of 64. If the current DDC type index is greater than 24 (DDC bandwidth > 5 MHz), the SampleSetsPerBuffer has to be a multiple of 1024. If the value of the SampleSetsPerBuffer is not a multiple of 64/1024, the function rounds it up to the nearest multiple of 64/1024. If it is zero, the StartDDC function fails.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The G69DDC device has to be turned on using the SetPower function before StartDDC is used otherwise StartDDC fails.
If the DDC streaming is already running before use of StartDDC, StartDDC fails.
If the DDCChannelId is the identification number of the DDC2 channel, streaming in the connected DDC1 channel has to be already started (using StartDDC or the StartDDC1Playback function) before starting the DDC2 streaming.
Use the StopDDC function to stop streaming in the given DDC channel.
Decreasing the value of the SampleSetsPerBuffer parameter decreases latency and may increase CPU usage. Increasing the value of the SampleSetsPerBuffer parameter increases latency and may decrease CPU usage.
StopDDC
Stops DDC1 or DDC2 streaming.
C/C++ declaration
int StopDDC(int32_t hDevice,uint32_t DDCChannelId);Address retrieval
G69DDC_STOP_DDC StopDDC=(G69DDC_STOP_DDC)dlsym(hAPI,"StopDDC");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDCChannelId[in] Identification number of the DDC channel created by the CreateDDC1 or CreateDDC2 function.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
If streaming is not active in the given DDC channel, StopDDC does nothing.
If the DDCChannelId parameter specifies the identification number of the DDC1 channel, the StopDDC function also stops all the streaming beyond this DDC channel in the processing chain (DDC2 and audio streaming in all the connected channels).
If DDC1 playback is running (started using StartDDC1Playback) before use of StopDDC, the StopDDC function stops it.
The DDC1StreamCallback and DDC1PlaybackStreamCallback callback functions are not called after StopDDC returns.
If the DDCChannelId parameter specifies the identification number of the DDC2 channel, the StopDDC function also stops the corresponding audio streaming.
The DDC2StreamCallback and DDC2PreprocessedStreamCallback callback functions are not called after StopDDC returns.
StartDDC1Playback
Starts DDC1 playback 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(int32_t hDevice,uint32_t DDC1ChannelId,uint32_t SampleSetsPerBuffer,uint32_t BitsPerSample);Address retrieval
G69DDC_START_DDC1_PLAYBACK StartDDC1Playback=(G69DDC_START_DDC1_PLAYBACK)dlsym(hAPI,"StartDDC1Playback");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC1ChannelId[in] Identification number of the DDC1 channel created by the CreateDDC1 function.SampleSetsPerBuffer[in] Specifies the number of I/Q sample sets in each buffer passed to the DDC1PlaybackStreamCallback callback to fill the buffer by the application and to the DDC1StreamCallback callback function. If the current DDC type index (specified by the SetDDC function) is less than or equal to 24 (DDC bandwidth <= 5 MHz) the value of the SampleSetsPerBuffer has to be a multiple of 64. If the current the DDC type index is greater than 24 (DDC bandwidth > 5 MHz), the SampleSetsPerBuffer has to be a multiple of 1024. If the value of the SampleSetsPerBuffer is not a multiple of 64/1024, the function rounds it up to the nearest multiple of 64/1024. If it is zero, the StartDDC1Playback function fails.BitsPerSample[in] Specifies the number of bits per I and Q samples. It is used for both DDC1PlaybackStreamCallback and DDC1StreamCallback callback functions. The possible value is one of the following:
Value Meaning 0 I 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 GetDDC or GetDDCInfo function. Possible values are 16 or 32 bits per sample, signed, little endian. 16 I and Q samples have 16 bit (16 bits per I, 16 bits per Q), signed, little endian. 32 I and Q samples have 32 bit (32 bits per I, 32 bits per Q), signed, little endian. Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The G69DDC device has to be turned on using the SetPower function before use of StartDDC1Playback.
If the DDC streaming is already running before use of StartDDC1Playback, StartDDC1Playback fails.
Use the StopDDC function to stop DDC1 playback.
PauseDDC1Playback
Pauses DDC1 playback.
C/C++ declaration
int PauseDDC1Playback(int32_t hDevice,uint32_t DDC1ChannelId);Address retrieval
G69DDC_PAUSE_DDC1_PLAYBACK PauseDDC1Playback=(G69DDC_PAUSE_DDC1_PLAYBACK)dlsym(hAPI,"PauseDDC1Playback");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC1ChannelId[in] Identification number of the DDC1 channel created by the CreateDDC1 function.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
If DDC1 playback is not active or is already paused, PauseDDC1Playback does nothing.
The DDC1PlaybackStreamCallback and DDC1StreamCallback callback functions can be called once, after PauseDDC1Playback returns. Then they are not called until playback is resumed using the ResumeDDC1Playback function.
ResumeDDC1Playback
Resumes paused DDC1 playback.
C/C++ declaration
int ResumeDDC1Playback(int32_t hDevice,uint32_t DDC1ChannelId);Address retrieval
G69DDC_RESUME_DDC1_PLAYBACK ResumeDDC1Playback=(G69DDC_RESUME_DDC1_PLAYBACK)dlsym(hAPI,"ResumeDDC1Playback");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC1ChannelId[in] Identification number of the DDC1 channel created by the CreateDDC1 function.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
If DDC1 playback is not active or is not paused, ResumeDDC1Playback does nothing.
SetDDC2NoiseBlanker
Enables or disables the noise blanker on the DDC2 stream.
C/C++ declaration
int SetDDC2NoiseBlanker(int32_t hDevice,uint32_t DDC2ChannelId,int Enabled);Address retrieval
G69DDC_SET_DDC2_NOISE_BLANKER SetDDC2NoiseBlanker=(G69DDC_SET_DDC2_NOISE_BLANKER)dlsym(hAPI,"SetDDC2NoiseBlanker");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Enabled[in] Specifies whether to enable or disable the noise blanker. If this parameter is non-zero, the noise blanker is enabled. If the parameter is zero, the noise blanker is disabled.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetDDC2NoiseBlanker function to determine the current state of the noise blanker.
GetDDC2NoiseBlanker
Retrieves the current DDC2 noise blanker state.
C/C++ declaration
int GetDDC2NoiseBlanker(int32_t hDevice,uint32_t DDC2ChannelId,int *Enabled);Address retrieval
G69DDC_GET_DDC2_NOISE_BLANKER GetDDC2NoiseBlanker=(G69DDC_GET_DDC2_NOISE_BLANKER)dlsym(hAPI,"GetDDC2NoiseBlanker");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Enabled[out] Pointer to a variable which receives the current state of the noise blanker. The value is non-zero if the noise blanker is enabled and zero if it is disabled. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetDDC2NoiseBlankerThreshold
Specifies the DDC2 noise blanker threshold.
C/C++ declaration
int SetDDC2NoiseBlankerThreshold(int32_t hDevice,uint32_t DDC2ChannelId,double Threshold);Address retrieval
G69DDC_SET_DDC2_NOISE_BLANKER_THRESHOLD SetDDC2NoiseBlankerThreshold= (G69DDC_SET_DDC2_NOISE_BLANKER_THRESHOLD)dlsym(hAPI,"SetDDC2NoiseBlankerThreshold");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Threshold[in] Specifies the threshold in %.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetDDC2NoiseBlankerThreshold function to retrieve the current threshold of the noise blanker.
GetDDC2NoiseBlankerThreshold
Retrieves the DDC2 noise blanker threshold.
C/C++ declaration
int GetDDC2NoiseBlankerThreshold(int32_t hDevice,uint32_t DDC2ChannelId,double *Threshold);Address retrieval
G69DDC_GET_DDC2_NOISE_BLANKER_THRESHOLD GetDDC2NoiseBlankerThreshold= (G69DDC_GET_DDC2_NOISE_BLANKER_THRESHOLD)dlsym(hAPI,"GetDDC2NoiseBlankerThreshold");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Threshold[out] Pointer to a variable which receives the threshold of the noise blanker. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
GetDDC2NoiseBlankerExcessValue
Determines a value which indicates the percentage ratio between the 'short time average signal level' and 'maximum level'.
C/C++ declaration
int GetDDC2NoiseBlankerExcessValue(int32_t hDevice,uint32_t DDC2ChannelId,double *Value);Address retrieval
G69DDC_GET_DDC2_NOISE_BLANKER_EXCESS_VALUE GetDDC2NoiseBlankerExcessValue= (G69DDC_GET_DDC2_NOISE_BLANKER_EXCESS_VALUE)dlsym(hAPI,"GetDDC2NoiseBlankerExcessValue");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Value[out] Pointer to a variable which receives the current excess value in %. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
GetSignalLevel
Determines the current RF signal level for the given channel.
C/C++ declaration
int GetSignalLevel(int32_t hDevice,uint32_t DDC2ChannelId,float *Peak,float *RMS);Address retrieval
G69DDC_GET_SIGNAL_LEVEL GetSignalLevel=(G69DDC_GET_SIGNAL_LEVEL)dlsym(hAPI,"GetSignalLevel");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Peak[out] Pointer to a variable which receives the current signal level (peak) in Volts. This parameter can be NULL if the application does not require this information.RMS[out] Pointer to a variable which receives the current signal level (RMS) in Volts. This parameter can be NULL if the application does not require this information.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
DDC2 streaming has to be active (started using the StartDDC function) before calling of GetSignalLevel, otherwise the returned peak and RMS signal level values are invalid.
The signal level is evaluated from the signal before 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 StartDDC function.
The DDC2PreprocessedStreamCallback callback function provides the signal level for each buffer passed to the callback, i.e. for each buffer used in the signal level evaluation. This provides a way to get the signal level from each processed buffer without the need to poll it using GetSignalLevel.
To convert RMS signal level in Volts to power in dBm use the following formulas:
P[W] = (VRMS)2 / R = (VRMS)2 / 50
P[dBm]= 10 * log10( P[W] * 1000 )
Where VRMS is the RMS signal level in Volts obtained by GetSignalLevel, R is the 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> int32_t hDevice; //Handle to G69DDC device returned by the OpenDevice function uint32_t DDC1Id; //Identifier of the DDC1 channel created by the CreateDDC1 function: CreateDDC1(hDevice,&DDC1Id) uint32_t DDC2Id; //Identifier of the DDC2 channel created by the CreateDDC2 function: CreateDDC2(hDevice,DDC1Id,&DDC2Id) float P_dBm,V_RMS; GetSignalLevel(hDevice,DDC2Id,NULL,&V_RMS); P_dBm=10.0*log10(V_RMS*V_RMS*(1000.0/50.0)); printf("Current signal level [RMS]: %.1f dBm\n",P_dBm);
SetNotchFilter
Enables or disables the notch filter for the given channel.
C/C++ declaration
int SetNotchFilter(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,int Enabled);Address retrieval
G69DDC_SET_NOTCH_FILTER SetNotchFilter=(G69DDC_SET_NOTCH_FILTER)dlsym(hAPI,"SetNotchFilter");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Enabled[in] Specifies whether to enable or disable the notch filter. If this parameter is non-zero, the filter is enabled. If the parameter is zero, the filter is disabled.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetNotchFilter function to determine whether the filter is enabled or disabled.
GetNotchFilter
Retrieves the current notch filter state for the given channel.
C/C++ declaration
int GetNotchFilter(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,int *Enabled);Address retrieval
G69DDC_SET_NOTCH_FILTER SetNotchFilter=(G69DDC_SET_NOTCH_FILTER)dlsym(hAPI,"SetNotchFilter");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Enabled[out] Pointer to a variable which receives the current state of the notch filter. The value is non-zero if the filter is enabled and zero if it is disabled. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetNotchFilterFrequency
Specifies the relative center frequency of the notch filter for the given channel.
C/C++ declaration
int SetNotchFilterFrequency(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,int32_t Frequency);Address retrieval
G69DDC_SET_NOTCH_FILTER_FREQUENCY SetNotchFilterFrequency= (G69DDC_SET_NOTCH_FILTER_FREQUENCY)dlsym(hAPI,"SetNotchFilterFrequency");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Frequency[in] Specifies the new center frequency of the notch filter in Hz.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The value of the Frequency parameter is the new center frequency of the notch filter relative to center of the DDC2 (see the SetDDCFrequency function). The value can be negative.
Use the GetNotchFilterFrequency function to retrieve the current center frequency of the notch filter.
GetNotchFilterFrequency
Retrieves the current relative center frequency of the notch filter.
C/C++ declaration
int GetNotchFilterFrequency(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,int32_t *Frequency);Address retrieval
G69DDC_GET_NOTCH_FILTER_FREQUENCY GetNotchFilterFrequency= (G69DDC_GET_NOTCH_FILTER_FREQUENCY)dlsym(hAPI,"GetNotchFilterFrequency");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Frequency[out] Pointer to a variable which receives the current center frequency of the notch filter. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetNotchFilterBandwidth
Specifies the bandwidth of the notch filter for the given channel.
C/C++ declaration
int SetNotchFilterBandwidth(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,uint32_t Bandwidth);Address retrieval
G69DDC_SET_NOTCH_FILTER_BANDWIDTH SetNotchFilterBandwidth= (G69DDC_SET_NOTCH_FILTER_BANDWIDTH)dlsym(hAPI,"SetNotchFilterBandwidth");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Bandwidth[in] Specifies the new bandwidth of the notch filter in Hz. The bandwidth can be from the range 1 - 5000 Hz.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetNotchFilterBandwidth function to retrieve the current bandwidth of the notch filter.
GetNotchFilterBandwidth
Retrieves the current bandwidth of the notch filter for the given channel.
C/C++ declaration
int GetNotchFilterBandwidth(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,uint32_t *Bandwidth);Address retrieval
G69DDC_GET_NOTCH_FILTER_BANDWIDTH GetNotchFilterBandwidth= (G69DDC_GET_NOTCH_FILTER_BANDWIDTH)dlsym(hAPI,"GetNotchFilterBandwidth");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Bandwidth[out] Pointer to a variable which receives the current bandwidth of the notch filter. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetNotchFilterLength
Specifies the notch filter length for the given channel. The notch filter is implemented as an FIR filter. This function specifies the number of coefficients used in the filtration procedure.
C/C++ declaration
int SetNotchFilterLength(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,uint32_t Length);Address retrieval
G69DDC_SET_NOTCH_FILTER_LENGTH SetNotchFilterLength= (G69DDC_SET_NOTCH_FILTER_LENGTH)dlsym(hAPI,"SetNotchFilterLength");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Length[in] Specifies the length of the notch filter. The value has to be multiple of 8, greater than or equal to 64 and less than or equal to 32768. If it is not multiple of 8, the function rounds it up to the nearest multiple of 8.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The given DDC2 channel has to be idle (streaming is not started using the StartDDC function) when calling the SetNotchFilterLength function, otherwise it fails.
Increasing the filter length increases the filter steepness and may increase CPU usage.
Use the GetNotchFilterLength function to determine the current length of the notch filter.
GetNotchFilterLength
Retrieves the current notch filter length for the given channel.
C/C++ declaration
int GetNotchFilterLength(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t NotchFilterIndex,uint32_t *Length);Address retrieval
G69DDC_GET_NOTCH_FILTER_LENGTH GetNotchFilterLength= (G69DDC_GET_NOTCH_FILTER_LENGTH)dlsym(hAPI,"GetNotchFilterLength");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Length[out] Pointer to a variable which receives the current length of the notch filter. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetAGC
Enables or disables the AGC for the given channel.
C/C++ declaration
int SetAGC(int32_t hDevice,uint32_t DDC2ChannelId,int Enabled);Address retrieval
G69DDC_SET_AGC SetAGC=(G69DDC_SET_AGC)dlsym(hAPI,"SetAGC");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Enabled[in] Specifies whether to enable or disable the AGC. If this parameter is non-zero, the AGC is enabled. If the parameter is zero, the AGC is disabled.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
If the AGC is disabled, the signal is affected by the 'fixed gain' specified using the SetGain function.
Use the GetAGC function to determine the current state of the AGC.
GetAGC
Retrieves the current state of the AGC for the given channel.
C/C++ declaration
int GetAGC(int32_t hDevice,uint32_t DDC2ChannelId,int *Enabled);Address retrieval
G69DDC_GET_AGC GetAGC=(G69DDC_GET_AGC)dlsym(hAPI,"GetAGC");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Enabled[out] Pointer to a variable which receives the current state of the AGC. The value is non-zero if the AGC is enabled and zero if it is disabled. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetAGCParams
Sets parameters of the AGC for the given channel.
C/C++ declaration
int SetAGCParams(int32_t hDevice,uint32_t DDC2ChannelId,double AttackTime,double DecayTime,double ReferenceLevel);Address retrieval
G69DDC_SET_AGC_PARAMS SetAGCParams=(G69DDC_SET_AGC_PARAMS)dlsym(hAPI,"SetAGCParams");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.AttackTime[in] Specifies the new attack time of the AGC in seconds.DecayTime[in] Specifies the new decay time of the AGC in seconds.ReferenceLevel[in] Specifies the new reference level of the AGC in dB.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetAGCParams function to determine the current parameters of the AGC.
GetAGCParams
Retrieves the current parameters of the AGC for the given channel.
C/C++ declaration
int GetAGCParams(int32_t hDevice,uint32_t DDC2ChannelId,double *AttackTime,double *DecayTime,double *ReferenceLevel);Address retrieval
G69DDC_GET_AGC_PARAMS GetAGCParams=(G69DDC_GET_AGC_PARAMS)dlsym(hAPI,"GetAGCParams");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.AttackTime[out] Pointer to a variable which receives the current attack time of the AGC in seconds. This parameter can be NULL if the application does not require this information.DecayTime[out] Pointer to a variable which receives the current decay time of the AGC in seconds. This parameter can be NULL if the application does not require this information.ReferenceLevel[out] Pointer to a variable which receives the current reference level of the AGC in dB. This parameter can be NULL if the application does not require this information.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetMaxAGCGain
Sets the maximum gain of the AGC for the given channel.
C/C++ declaration
int SetMaxAGCGain(int32_t hDevice,uint32_t DDC2ChannelId,double MaxGain);Address retrieval
G69DDC_SET_MAX_AGC_GAIN SetMaxAGCGain=(G69DDC_SET_MAX_AGC_GAIN)dlsym(hAPI,"SetMaxAGCGain");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.MaxGain[in] Specifies the new maximum gain of the AGC in dB.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetMaxAGCGain function to determine the maximum gain of the AGC.
GetMaxAGCGain
Retrieves the current maximum gain of the AGC for the given channel.
C/C++ declaration
int GetMaxAGCGain(int32_t hDevice,uint32_t DDC2ChannelId,double *MaxGain);Address retrieval
G69DDC_GET_MAX_AGC_GAIN GetMaxAGCGain=(G69DDC_GET_MAX_AGC_GAIN)dlsym(hAPI,"GetMaxAGCGain");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.MaxGain[out] Pointer to a variable which receives the current maximum gain of the AGC in dB. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetGain
Sets fixed gain for the given channel. This gain is applied to the I/Q signal if the AGC is disabled, otherwise it is not used.
C/C++ declaration
int SetGain(int32_t hDevice,uint32_t DDC2ChannelId,double Gain);Address retrieval
G69DDC_SET_GAIN SetGain=(G69DDC_SET_GAIN)dlsym(hAPI,"SetGain");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Gain[in] Specifies the new fixed gain in dB.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetGain function to determine the current fixed gain.
GetGain
Retrieves the current fixed gain for the given channel.
C/C++ declaration
int GetGain(int32_t hDevice,uint32_t DDC2ChannelId,double *Gain);Address retrieval
G69DDC_GET_GAIN GetGain=(G69DDC_GET_GAIN)dlsym(hAPI,"GetGain");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Gain[out] Pointer to a variable which receives the current fixed gain in dB. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
GetCurrentGain
Retrieves the current gain that is applied to the I/Q signal.
C/C++ declaration
int GetCurrentGain(int32_t hDevice,uint32_t DDC2ChannelId,double *CurrentGain);Address retrieval
G69DDC_GET_CURRENT_GAIN GetCurrentGain=(G69DDC_GET_CURRENT_GAIN)dlsym(hAPI,"GetCurrentGain");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.CurrentGain[out] Pointer to a variable which receives the current gain in dB. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
If the AGC is enabled (using the SetAGC function), the variable pointed to by the CurrentGain parameter is filled by the current gain of the AGC. If the AGC is disabled, the variable pointed to by the CurrentGain parameter is filled by a fixed gain that is specified using the SetGain function.
SetDemodulatorFilterBandwidth
Sets the bandwidth of the demodulator filter for the given channel.
C/C++ declaration
int SetDemodulatorFilterBandwidth(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Bandwidth);Address retrieval
G69DDC_SET_DEMODULATOR_FILTER_BANDWIDTH SetDemodulatorFilterBandwidth= (G69DDC_SET_DEMODULATOR_FILTER_BANDWIDTH)dlsym(hAPI,"SetDemodulatorFilterBandwidth");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Bandwidth[in] Specifies the new bandwidth of the demodulator filter in Hz. Possible values range from 1 Hz to the current DDC2 bandwidth. Use the GetDDC function to retrieve information about the current DDC type of DDC2.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The demodulator filter bandwidth can be changed by changing the DDC type of the corresponding DDC1 channel (using the SetDDC function). It can change DDC type of DDC2 and if the current demodulator filter bandwidth is greater than the new bandwidth of DDC2, the demodulator filter bandwidth is reduced. So it is useful to call the GetDemodulatorFilterBandwidth function immediately after SetDDC.
GetDemodulatorFilterBandwidth
Retrieves the current demodulator filter bandwidth for the given channel.
C/C++ declaration
int GetDemodulatorFilterBandwidth(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t *Bandwidth);Address retrieval
G69DDC_GET_DEMODULATOR_FILTER_BANDWIDTH GetDemodulatorFilterBandwidth= (G69DDC_GET_DEMODULATOR_FILTER_BANDWIDTH)dlsym(hAPI,"GetDemodulatorFilterBandwidth");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Bandwidth[out] Pointer to a variable which receives the current demodulator filter bandwidth. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.SetDemodulatorFilterShift
Sets the demodulator filter shift for the given channel.
C/C++ declaration
int SetDemodulatorFilterShift(int32_t hDevice,uint32_t DDC2ChannelId,int32_t Shift);Address retrieval
G69DDC_SET_DEMODULATOR_FILTER_SHIFT SetDemodulatorFilterShift= (G69DDC_SET_DEMODULATOR_FILTER_SHIFT)dlsym(hAPI,"SetDemodulatorFilterShift");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Shift[in] Specifies the new shift of the demodulator filter in Hz.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The value of the Shift parameter is the shift in Hz relative to center of the demodulator. This value can be negative.
This function does not change the demodulator frequency, it just shifts the filter from the demodulator's center.
Use the GetDemodulatorFilterShift function to determine the current demodulator filter shift.
GetDemodulatorFilterShift
Retrieves the current shift of the demodulator filter for the given channel.
C/C++ declaration
int GetDemodulatorFilterShift(int32_t hDevice,uint32_t DDC2ChannelId,int32_t *Shift);Address retrieval
G69DDC_GET_DEMODULATOR_FILTER_SHIFT GetDemodulatorFilterShift= (G69DDC_GET_DEMODULATOR_FILTER_SHIFT)dlsym(hAPI,"GetDemodulatorFilterShift");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Shift[out] Pointer to a variable which receives the current shift of the demodulator. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.SetDemodulatorFilterLength
Specifies the demodulator filter length for the given channel. The demodulator filter is implemented as an FIR filter. This function specifies the number of coefficients used in the filtration procedure.
C/C++ declaration
int SetDemodulatorFilterLength(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Length);Address retrieval
G69DDC_SET_DEMODULATOR_FILTER_LENGTH SetDemodulatorFilterLength= (G69DDC_SET_DEMODULATOR_FILTER_LENGTH)dlsym(hAPI,"SetDemodulatorFilterLength");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Length[in] Specifies the length of the demodulator filter. The value has to be multiple of 8, greater than or equal to 64 and less than or equal to 32768. If it is not a multiple of 8, the function rounds it up to nearest multiple of 8.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The given DDC2 channel has to be idle (streaming is not started using the StartDDC function) when calling the SetDemodulatorFilterLength function, otherwise it fails.
Increasing the filter length increases the filter steepness and may increase CPU usage.
Use the GetDemodulatorFilterLength function to determine the current length of the demodulator filter.
GetDemodulatorFilterLength
Retrieves the current length of the demodulator filter for the given channel.
C/C++ declaration
int GetDemodulatorFilterLength(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t *Length);Address retrieval
G69DDC_GET_DEMODULATOR_FILTER_LENGTH GetDemodulatorFilterLength= (G69DDC_GET_DEMODULATOR_FILTER_LENGTH)dlsym(hAPI,"GetDemodulatorFilterLength");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Length[out] Pointer to a variable which receives the current demodulator filter length. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.SetDemodulatorMode
Sets the demodulator mode for the given channel.
C/C++ declaration
int SetDemodulatorMode(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Mode);Address retrieval
G69DDC_SET_DEMODULATOR_MODE SetDemodulatorMode=(G69DDC_SET_DEMODULATOR_MODE)dlsym(hAPI,"SetDemodulatorMode");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Mode[in] Specifies new the demodulator mode. This value can be one of the following:
Value Meaning G69DDC_MODE_AM Amplitude modulation G69DDC_MODE_AMS Amplitude modulation G69DDC_MODE_LSB Lower sideband modulation G69DDC_MODE_USB Upper sideband modulation G69DDC_MODE_DSB Double sideband modulation G69DDC_MODE_ISB Independent sideband modulation G69DDC_MODE_CW Continuous wave G69DDC_MODE_FM Frequency modulation G69DDC_MODE_FMW Wide-band frequency modulation Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetDemodulatorMode function to retrieve the current demodulator mode.
GetDemodulatorMode
Retrieves the current demodulator mode for the given channel.
C/C++ declaration
int GetDemodulatorMode(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t *Mode);Address retrieval
G69DDC_GET_DEMODULATOR_MODE GetDemodulatorMode=(G69DDC_GET_DEMODULATOR_MODE)dlsym(hAPI,"GetDemodulatorMode");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Mode[out] Pointer to a variable which receives the current demodulator mode. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetDemodulatorFrequency
Sets the relative center frequency of the demodulator for the given channel.
C/C++ declaration
int SetDemodulatorFrequency(int32_t hDevice,uint32_t DDC2ChannelId,int32_t Frequency);Address retrieval
G69DDC_SET_DEMODULATOR_FREQUENCY SetDemodulatorFrequency= (G69DDC_SET_DEMODULATOR_FREQUENCY)dlsym(hAPI,"SetDemodulatorFrequency");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Frequency[in] Specifies the new center frequency of the demodulator in Hz.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The value of the Frequency parameter is the center frequency of the demodulator relative to the center of the DDC2. The value can be negative.
The absolute frequency of the demodulator is given by the following formula:
faDEM = 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 SetFrontEndFrequency function), frDDC1 is the relative center frequency of the DDC1 in Hz (set using the SetDDCFrequency function), frDDC2 is the relative center frequency of DDC2 in Hz (set using the SetDDCFrequency) and frDEM is relative center frequency of the demodulator in Hz (set using SetDemodulatorFrequency).
The absolute center frequency of the demodulator is the real-world frequency which you are listening to.
Use the GetDemodulatorFrequency function to determine the current relative center frequency of the demodulator for the given channel.
The following example shows four methods of how to set the absolute demodulator center frequency to 60.01 MHz:
int32_t hDevice; //Handle to G69DDC device returned by the OpenDevice function uint32_t DDC1Id; //Identifier of the DDC1 channel created by the CreateDDC1 function: CreateDDC1(hDevice,&DDC1Id) uint32_t DDC2Id; //Identifier of the DDC2 channel created by the CreateDDC2 function: CreateDDC2(hDevice,DDC1Id,&DDC2Id) //1. method (in range 1) SetFrontEndFrequency(hDevice,0); //Set active receiver's input to the range 1 (0 - 80 MHz) SetDDCFrequency(hDevice,DDC1Id,60010000); SetDDCFrequency(hDevice,DDC2Id,0); SetDemodulatorFrequency(hDevice,DDC2Id,0); //2. method (in range 1) SetFrontEndFrequency(hDevice,0); SetDDCFrequency(hDevice,DDC1Id,60000000); SetDDCFrequency(hDevice,DDC2Id,10000); SetDemodulatorFrequency(hDevice,DDC2Id,0); //3. method (in range 2) SetFrontEndFrequency(hDevice,60000000); SetDDCFrequency(hDevice,DDC1Id,20000); SetDDCFrequency(hDevice,DDC2Id,-5000); SetDemodulatorFrequency(hDevice,DDC2Id,-5000); //4. method SetFrequency(hDevice,DDC2Id,60010000); //The SetFrequency function selects proper receiver's input range and sets front-end, DDC1, DDC2 and demodulator //frequencies so that demodulator's absolute frequency is set to the required frequency
GetDemodulatorFrequency
Retrieves the current relative center frequency of the demodulator for the given channel.
C/C++ declaration
int GetDemodulatorFrequency(int32_t hDevice,uint32_t DDC2ChannelId,int32_t *Frequency);Address retrieval
G69DDC_GET_DEMODULATOR_FREQUENCY GetDemodulatorFrequency= (G69DDC_GET_DEMODULATOR_FREQUENCY)dlsym(hAPI,"GetDemodulatorFrequency");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Frequency[out] Pointer to a variable which receives the current center frequency of the demodulator. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetDemodulatorParam
Sets a parameter of the demodulation for the given channel.
C/C++ declaration
int SetDemodulatorParam(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Code,const void *Buffer,uint32_t BufferSize);Address retrieval
G69DDC_SET_DEMODULATOR_PARAM SetDemodulatorParam= (G69DDC_SET_DEMODULATOR_PARAM)dlsym(hAPI,"SetDemodulatorParam");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Code[in] Specifies the code of the demodulator parameter to be set by this function. The code can be one of the following:
Value Meaning 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 sidebandG69DDC_SIDE_BAND_UPPER
AMS demodulator will use upper sidebandG69DDC_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 sidebandG69DDC_SIDE_BAND_UPPER
DSB demodulator will use upper sidebandG69DDC_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 sidebandG69DDC_SIDE_BAND_UPPER
ISB demodulator will use upper sidebandG69DDC_SIDE_BAND_BOTH
ISB demodulator will use both side bands.Buffer[in] Pointer to a buffer containing the value of the demodulator parameter which this function will set. This parameter cannot be NULL.BufferSize[in] Specifies the size of the buffer.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
GetDemodulatorParam
Retrieves a parameter of the demodulation for the given channel.
C/C++ declaration
int GetDemodulatorParam(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Code,void *Buffer,uint32_t BufferSize);Address retrieval
G69DDC_GET_DEMODULATOR_PARAM GetDemodulatorParam= (G69DDC_GET_DEMODULATOR_PARAM)dlsym(hAPI,"GetDemodulatorParam");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Code[in] Specifies the code of the demodulator parameter to be retrieved. For detailed information about available codes see SetDemodulatorParam.Buffer[out] Pointer to a buffer which receives the requested parameter. This parameter cannot be NULL.BufferSize[in] Specifies the size of the buffer.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
GetDemodulatorState
Retrieves information about the current demodulator state for the given channel.
C/C++ declaration
int GetDemodulatorState(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Code,void *Buffer,uint32_t BufferSize);Address retrieval
G69DDC_GET_DEMODULATOR_STATE GetDemodulatorState= (G69DDC_GET_DEMODULATOR_STATE)dlsym(hAPI,"GetDemodulatorState");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Code[in] Specifies the code of the demodulator state to be retrieved. The code can be one of the following:
Value Meaning G69DDC_DEMODULATOR_STATE_AMS_LOCK Lock state of synchronous AM demodulation.
The Buffer parameter has to be a pointer to an 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 an 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 function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
GetAudioSampleRateCount
Retrieves the number of audio sample rates supported by the G69DDC.
C/C++ declaration
int GetAudioSampleRateCount(int32_t hDevice,uint32_t *Count);Address retrieval
G69DDC_GET_AUDIO_SAMPLE_RATE_COUNT GetAudioSampleRateCount= (G69DDC_GET_AUDIO_SAMPLE_RATE_COUNT)dlsym(hAPI,"GetAudioSampleRateCount");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.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 function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
GetAudioSampleRate
Retrieves the audio sample rate by its index.
C/C++ declaration
int GetAudioSampleRate(int32_t hDevice,uint32_t SampleRateIndex,uint32_t *SampleRate);Address retrieval
G69DDC_GET_AUDIO_SAMPLE_RATE GetAudioSampleRate= (G69DDC_GET_AUDIO_SAMPLE_RATE)dlsym(hAPI,"GetAudioSampleRate");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.SampleRateIndex[in] Specifies the audio sample rate index. This value can vary from 0 to the value retrieved by the GetAudioSampleRateCount - 1.SampleRate[out] Pointer to a variable which receives the audio sample rate. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetAudio
Sets the output audio sample rate.
C/C++ declaration
int SetAudio(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t SampleRateIndex);Address retrieval
G69DDC_SET_AUDIO SetAudio=(G69DDC_SET_AUDIO)dlsym(hAPI,"SetAudio");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.SampleRateIndex[in] Specifies the audio sample rate index.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetAudioSampleRateCount function to determine the number of possible audio sample rates. The SampleRateIndex parameter can vary from zero to one less than the number determined by GetAudioSampleRateCount.
Audio streaming must not run when calling SetAudio. In other words, audio streaming which is started using the StartAudio function has to be stopped using the StopAudio function before calling SetAudio, otherwise SetAudio fails. The SetAudio function does not start and stop audio streaming, but changes the current audio sample rate.
Use the GetAudio function to determine the current audio sample rate and the corresponding sample rate index.
GetAudio
Retrieves the current audio sample rate and the corresponding sample rate index.
C/C++ declaration
int GetAudio(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t *SampleRateIndex,uint32_t *SampleRate);Address retrieval
G69DDC_GET_AUDIO GetAudio=(G69DDC_GET_AUDIO)dlsym(hAPI,"GetAudio");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.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 function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
StartAudio
Starts audio streaming for the given channel.
C/C++ declaration
int StartAudio(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t SampleSetsPerBuffer);Address retrieval
G69DDC_START_AUDIO StartAudio=(G69DDC_START_AUDIO)dlsym(hAPI,"StartAudio");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.SampleSetsPerBuffer[in] Specifies the number of sample sets in each buffer passed to the AudioStreamCallback callback function (the sample set consists of two samples). The value has to be a multiple of 64 greater than zero. If it is zero, the StartAudio function fails. If it is not a multiple of 64, the function rounds it up to nearest multiple of 64.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Before StartAudio is used, the G69DDC device has to be turned on using the SetPower function, DDC1 streaming has to be started using the StartDDC or StartDDC1Playback function and DDC2 streaming has to be started using the StartDDC function, otherwise StartAudio fails.
If the audio streaming for the given DDC2 channel is already running, StartAudio fails.
Use the StopAudio function to stop audio streaming.
Decreasing the value of the SampleSetsPerBuffer parameter decreases latency and may increase CPU usage. Increasing the value of the SampleSetsPerBuffer parameter increases latency and may decrease CPU usage.
StopAudio
Stops audio streaming for the given channel.
C/C++ declaration
int StopAudio(int32_t hDevice,uint32_t DDC2ChannelId);Address retrieval
G69DDC_STOP_AUDIO StopAudio=(G69DDC_STOP_AUDIO)dlsym(hAPI,"StopAudio");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
If audio streaming is not active, StopAudio does nothing.
If audio playback (started using the StartAudioPlayback function) is active, StopAudio stops it.
The AudioStreamCallback and AudioPlaybackStreamCallback callback functions are not called after StopAudio returns.
StartAudioPlayback
Starts audio playback for the given channel. It passes previously recorded audio samples to the processing chain instead of the samples from the demodulator.
C/C++ declaration
int StartAudioPlayback(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t SampleSetsPerBuffer);Address retrieval
G69DDC_START_AUDIO_PLAYBACK StartAudioPlayback=(G69DDC_START_AUDIO_PLAYBACK)dlsym(hAPI,"StartAudioPlayback");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.SampleSetsPerBuffer[in] Specifies the number of sample sets in each buffer passed to the AudioPlaybackStreamCallback callback to fill the buffer by the application and to the AudioStreamCallback callback function (the sample set consists of two samples). The value has to be a multiple of 64 greater than zero. If it is zero, the StartAudioPlayback function fails. If it is not a multiple of 64, the function rounds it up to nearest multiple of 64.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The G69DDC device has to be turned on using SetPower function before use of StartAudioPlayback.
If the audio streaming for the given DDC2 channel is already running, StartAudioPlayback fails.
Use the StopAudio function to stop audio playback.
PauseAudioPlayback
Pauses audio playback for the given channel.
C/C++ declaration
int PauseAudioPlayback(int32_t hDevice,uint32_t DDC2ChannelId);Address retrieval
G69DDC_PAUSE_AUDIO_PLAYBACK PauseAudioPlayback=(G69DDC_PAUSE_AUDIO_PLAYBACK)dlsym(hAPI,"PauseAudioPlayback");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
If audio playback is not active or is already paused, PauseAudioPlayback does nothing.
The AudioPlaybackStreamCallback and AudioStreamCallback callback functions can be called once after PauseAudioPlayback returns. Then they are not called until playback is resumed using the ResumeAudioPlayback function.
ResumeAudioPlayback
Resumes paused audio playback for the given channel.
C/C++ declaration
int ResumeAudioPlayback(int32_t hDevice,uint32_t DDC2ChannelId);Address retrieval
G69DDC_RESUME_AUDIO_PLAYBACK ResumeAudioPlayback=(G69DDC_RESUME_AUDIO_PLAYBACK)dlsym(hAPI,"ResumeAudioPlayback");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
If audio playback is not active or not paused, ResumeAudioPlayback does nothing.
SetAudioGain
Sets fixed audio gain for the given channel.
C/C++ declaration
int SetAudioGain(int32_t hDevice,uint32_t DDC2ChannelId,double Gain);Address retrieval
G69DDC_SET_AUDIO_GAIN SetAudioGain=(G69DDC_SET_AUDIO_GAIN)dlsym(hAPI,"SetAudioGain");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Gain[in] Specifies a new fixed audio gain in dB.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetAudioGain function to retrieve the current audio gain.
GetAudioGain
Retrieves the current fixed audio gain for the given channel.
C/C++ declaration
int GetAudioGain(int32_t hDevice,uint32_t DDC2ChannelId,double *Gain);Address retrieval
G69DDC_GET_AUDIO_GAIN GetAudioGain=(G69DDC_GET_AUDIO_GAIN)dlsym(hAPI,"GetAudioGain");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Gain[out] Pointer to a variable that receives the current fixed gain in dB. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetAudioFilter
Enables or disables the audio filter for the given channel.
C/C++ declaration
int SetAudioFilter(int32_t hDevice,uint32_t DDC2ChannelId,int Enabled);Address retrieval
G69DDC_SET_AUDIO_FILTER SetAudioFilter=(G69DDC_SET_AUDIO_FILTER)dlsym(hAPI,"SetAudioFilter");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Enabled[in] Specifies whether to enable or disable the audio filter. If this parameter is non-zero, the filter is enabled. If the parameter is zero, the filter is disabled.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetAudioFiler function to retrieve the current state of the audio filter.
GetAudioFilter
Retrieves the current state of the audio filter for the given channel.
C/C++ declaration
int GetAudioFilter(int32_t hDevice,uint32_t DDC2ChannelId,int *Enabled);Address retrieval
G69DDC_GET_AUDIO_FILTER GetAudioFilter=(G69DDC_GET_AUDIO_FILTER)dlsym(hAPI,"GetAudioFilter");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Enabled[out] Pointer to a variable which receives the current state of the audio filter. The value is non-zero if the filter is enabled and zero if it is disabled. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetAudioFilterParams
Sets the parameters of the audio filter for the given channel.
C/C++ declaration
int SetAudioFilterParams(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t CutOffLow,uint32_t CutOffHigh,double Deemphasis);Address retrieval
G69DDC_SET_AUDIO_FILTER_PARAMS SetAudioFilterParams= (G69DDC_SET_AUDIO_FILTER_PARAMS)dlsym(hAPI,"SetAudioFilterParams");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.CutOffLow[in] Specifies the cut-off low frequency of the filter in Hz. This is the start frequency of the filter's passband, it can range from 0 to one less than the half of the current audio sample rate (see the 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 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 function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Use the GetAudioFilerParams function to retrieve the current parameters of the audio filter.
GetAudioFilterParams
Retrieves the current parameters of the audio filter for the given channel.
C/C++ declaration
int GetAudioFilterParams(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t *CutOffLow,uint32_t *CutOffHigh,double *Deemphasis);Address retrieval
G69DDC_GET_AUDIO_FILTER_PARAMS GetAudioFilterParams= (G69DDC_GET_AUDIO_FILTER_PARAMS)dlsym(hAPI,"GetAudioFilterParams");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.CutOffLow[out] Pointer to a variable which receives the current cut-off low frequency of the filter. This parameter can be NULL if the application does not require this information.CutOffHigh[out] Pointer to a variable which receives the current cut-off high frequency of the filter. This parameter can be NULL if the application does not require this information.Deemphasis[out] Pointer to a variable which receives the current de-emphasis setting of the filter. This parameter can be NULL if the application does not require this information.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetAudioFilterLength
Specifies the audio filter length for the given channel. The audio filter is implemented as an FIR filter. This function specifies the number of coefficients used in the filtration procedure.
C/C++ declaration
int SetAudioFilterLength(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Length);Address retrieval
G69DDC_SET_AUDIO_FILTER_LENGTH SetAudioFilterLength= (G69DDC_SET_AUDIO_FILTER_LENGTH)dlsym(hAPI,"SetAudioFilterLength");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Length[in] Specifies the length of the audio filter. The value has to be a multiple of 8, greater than or equal to 64 and less than or equal to 32768. If it is not a multiple of 8, the function rounds it up to nearest multiple of 8.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
Audio streaming in the given DDC2 channel has to be idle (streaming is not started using the StartAudio or StartAudioPlayback function) when calling the SetAudioFilterLength function, otherwise it fails.
Increasing the filter length increases the filter steepness and may increase CPU usage.
Use the GetAudioFilterLength function to determine the current length of the audio filter.
GetAudioFilterLength
Retrieves the current audio filter length for the given channel.
C/C++ declaration
int GetAudioFilterLength(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t *Length);Address retrieval
G69DDC_GET_AUDIO_FILTER_LENGTH GetAudioFilterLength= (G69DDC_GET_AUDIO_FILTER_LENGTH)dlsym(hAPI,"GetAudioFilterLength");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Length[out] Pointer to a variable which receives the current length of the audio filter. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetVolume
Sets the audio volume for the given channel.
C/C++ declaration
int SetVolume(int32_t hDevice,uint32_t DDC2ChannelId,uint8_t Volume);Address retrieval
G69DDC_SET_VOLUME SetVolume=(G69DDC_SET_VOLUME)dlsym(hAPI,"SetVolume");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Volume[in] Specifies the new volume. The value can vary from 0 to 31, where 31 means maximum volume.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
GetVolume
Retrieve the current volume for the given channel.
C/C++ declaration
int GetVolume(int32_t hDevice,uint32_t DDC2ChannelId,uint8_t *Volume);Address retrieval
G69DDC_GET_VOLUME GetVolume=(G69DDC_GET_VOLUME)dlsym(hAPI,"GetVolume");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Volume[out] Pointer to a variable which receives the current volume. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetMute
Mutes or unmutes the audio.
C/C++ declaration
int SetMute(int32_t hDevice,uint32_t DDC2ChannelId,int Mute);Address retrieval
G69DDC_SET_MUTE SetMute=(G69DDC_SET_MUTE)dlsym(hAPI,"SetMute");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Mute[in] Specifies whether to mute or unmute audio. If this parameter is non-zero, the audio is muted. If the parameter is zero, the audio is unmuted.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
GetMute
Retrieves the current mute state for the given channel.
C/C++ declaration
int GetMute(int32_t hDevice,uint32_t DDC2ChannelId,int *Mute);Address retrieval
G69DDC_GET_MUTE GetMute=(G69DDC_GET_MUTE)dlsym(hAPI,"GetMute");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Mute[out] Pointer to a variable which receives the current mute state. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
SetFrequency
Sets the absolute frequency of the demodulator for the given channel.
C/C++ declaration
int SetFrequency(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t Frequency);Address retrieval
G69DDC_SET_FREQUENCY SetFrequency=(G69DDC_SET_FREQUENCY)dlsym(hAPI,"SetFrequency");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Frequency[in] Specifies the new absolute frequency of the demodulator in Hz.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The function 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.
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 the front-end frequency (see SetFrontEndFrequency function), frDDC1 is the relative center frequency of the DDC1 in Hz (set using the SetDDCFrequency function), frDDC2 is the relative center frequency of DDC2 in Hz (set using the SetDDCFrequency) and frDEM[i] is the relative center frequency of the demodulator in Hz (set using the SetDemodulatorFrequency function).
The absolute center frequency of the demodulator is the real-world frequency which you are listening to.
When changing the front-end frequency or DDC1 center frequency, the function 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 GetFrequency function to retrieve the current absolute frequency of the demodulator.
GetFrequency
Determines the absolute frequency of the demodulator for the given channel.
C/C++ declaration
int GetFrequency(int32_t hDevice,uint32_t DDC2ChannelId,uint32_t *Frequency);Address retrieval
G69DDC_GET_FREQUENCY GetFrequency=(G69DDC_GET_FREQUENCY)dlsym(hAPI,"GetFrequency");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.DDC2ChannelId[in] Identification number of the DDC2 channel created by the CreateDDC2 function.Frequency[out] Pointer to a variable which receives the current absolute frequency of the demodulator. This parameter cannot be NULL.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The returned value of the variable pointed to by the Frequency parameter is the sum of the front-end frequency and relative frequencies of the DDC1, DDC2 and demodulator. For more information, see the remarks for the SetFrequency function.
StartSweeper
Starts the sweeper.
C/C++ declaration
int StartSweeper(int32_t hDevice,uint64_t BeginFrequency,uint64_t EndFrequency,uint64_t StartFrequency, uint32_t Step,int Forward,uint32_t Repeat,uint32_t SamplesPerSnapshot);Address retrieval
G69DDC_START_SWEEPER StartSweeper=(G69DDC_START_SWEEPER)dlsym(hAPI,"StartSweeper");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.BeginFrequency[in] Specifies the start frequency of the sweeping range in Hz.EndFrequency[in] Specifies the end frequency of the sweeping range in Hz.StartFrequency[in] Specifies the frequency to start sweeping from. It must be 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:
Value Tuning step G69DDC_SWEEPER_STEP_2MHZ 2 MHz G69DDC_SWEEPER_STEP_6MHZ 6 MHz G69DDC_SWEEPER_STEP_10MHZ 10 MHz G69DDC_SWEEPER_STEP_30MHZ 30 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 SweeperCallback callback function. It can be one of the following:
Value Number of samples per snapshot G69DDC_ADC_SAMPLES_PER_SNAPSHOT_64K 65536 G69DDC_ADC_SAMPLES_PER_SNAPSHOT_128K 131072 G69DDC_ADC_SAMPLES_PER_SNAPSHOT_256K 262144 Return value
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 G69DDC device has to be turned on using the SetPower function before StartSweeper is used, otherwise StartSweeper fails.
DDC streams (StartDDC, StartDDC1Playback) and ADC snapshots (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 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 StopSweeper function to stop the sweeper.
StopSweeper
Stops the sweeper which was previously started using the StartSweeper function.
C/C++ declaration
int StopSweeper(int32_t hDevice);Address retrieval
G69DDC_STOP_SWEEPER StopSweeper=(G69DDC_STOP_SWEEPER)dlsym(hAPI,"StopSweeper");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
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(int32_t hDevice,uint64_t FrontEndFrequency,int32_t Shift,uint32_t Bandwidth,float *Buffer,uint32_t Count);Address retrieval
G69DDC_GET_SPECTRUM_COMPENSATION GetSpectrumCompensation= (G69DDC_GET_SPECTRUM_COMPENSATION)dlsym(hAPI,"GetSpectrumCompensation");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.FrontEndFrequency[in] Specifies the front-end frequency in Hz.Shift[in] Specifies the relative center frequency (in Hz) of the bandwidth given by the Bandwidth parameter. It is relative to 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 function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
The following example shows how to use the GetSpectrumCompensation function in the DDC2StreamCallback callback function:
//Let the following is prototype of a function which computes FFT from I/Q signal stored in //the buffer pointed to be the Input parameter. Result is stored in complex form in the buffer //pointed to by the Output parameter. Size of the FFT is given be the Size parameter. //The example uses 2048 bins FFT. void FFT(float *Output,const float *Input,int Size); int32_t hDevice; //handle to G69DDC device uint32_t DDC1Id; //Identifier of the DDC1 channel created by the CreateDDC1 function: CreateDDC1(hDevice,&DDC1Id) uint32_t DDC2Id; //Identifier of the DDC2 channel created by the CreateDDC2 function: CreateDDC2(hDevice,DDC1Id,&DDC2Id) 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 - relative to DDC1 center G69DDC_DDC_INFO DDC2Info; //Information about the 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 G69DDC_CALLBACKS Callbacks; //Structure which contains pointer to callback functions Code before... //Retrieve front-end frequency GetFrontEndFrequency(hDevice,&FrontEndFrequency); //Retrieve relative frequency of the DDC1 GetDDCFrequency(hDevice,DDC1Id,&RelDDC1Frequency); //Retrieve relative frequency of the DDC2 GetDDCFrequency(hDevice,DDC2Id,&RelDDC2Frequency); //Retrieve DDC type information of the DDC2 GetDDC(hDevice,DDC2Id,NULL,&DDC2Info); //Retrieve compensation data GetSpectrumCompensation(hDevice,FrontEndFrequency,RelDDC1Frequency+RelDDC2Frequency,DDC2Info.SampleRate,Compensation,2048); //In this case the Bandwidth parameter is equal to sample rate, because we need compensation data //for whole DDC2 band. //Compensation data have to be updated after change of absolute DDC2 frequency changing //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; //Set callback function for DDC2 streaming //Pointers to callback function which should not be called by the API have to be set to NULL. Callbacks.DDC2StreamCallback=MyDDC2StreamCallback; //Start DDC2 streaming //The SampleSetsPerBuffer parameter is set to 2048 which is size of the FFT to simplify //the example. StartDDC(hDevice,DDC2Id,2048); Code after... void MyDDC2StreamCallback(uint32_t DDC2ChannelId,const float *Buffer,uint32_t NumberOfSamples,uintptr_t UserData) { uint32_t i; //Compute FFT FFT(FFTBuffer,Buffer,2048); //Converts complex FFT result to dB for(i=0;i<2048;i++) { FFTBuffer[i]=(float)(10.0*log10(FFTBuffer[i*2]*FFTBuffer[i*2]+FFTBuffer[i*2+1]*FFTBuffer[i*2+1])); } //Apply compensation data to get amplitudes in frequency spectrum in dBm for(i=0;i<2048;i++) { FFTBuffer[i]+=Compensation[i]; } //now the FFTBuffer contains amplitudes in dBm //Useful band starts at the bin given by the FirstBin variable //and ends at the bin given by the LastBin variable. }
SetCallbacks
Registers user-defined functions as callback functions called by the API.
C/C++ declaration
int SetCallbacks(int32_t hDevice,const G69DDC_CALLBACKS *Callbacks,uintptr_t UserData);Address retrieval
G69DDC_SET_CALLBACKS SetCallbacks=(G69DDC_SET_CALLBACKS)dlsym(hAPI,"SetCallbacks");Parameters
hDevice[in] Handle to G69DDC device returned by the OpenDevice function.Callbacks[in] Pointer to a G69DDC_CALLBACKS structure which contains pointers to the user-defined functions to be registered as callback functions.UserData[in] Specifies a user-defined value which is passed to callback functions.Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.Remarks
If the application does not require that the API calls some callback function, set the related member of the G69DDC_CALLBACKS structure to NULL.
If the value of the Callbacks parameter is NULL, all the callback functions are unregistered, the API will not call any callback function.
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
DevicePathThe device system path in a null-terminated string.If the device information structure is obtained from an already open device using the GetDeviceInfo function, the DevicePath can contain a remote address/port of the device, if it is connected via its LAN interface.
InterfaceTypeDevice interface type. The value can be one of the following:
Value Meaning G69DDC_INTERFACE_TYPE_PCIE The device is connected to the computer via PCI express. G69DDC_INTERFACE_TYPE_USB2 The 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_USB3 The device is connected to the computer via USB3. G69DDC_INTERFACE_TYPE_LAN The 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_DEMO Demo G69DDC device. SerialNumberSerial number in null-terminated string.HWVersionVersion of the hardware.FWVersion[3]Version of the firmwares.EEPROMVersionEEPROM structure version.Range1.BandwidthSpecifies the useful bandwidth (in Hz) of the signal passed to the ADCSnapshotCallback and SweeperCallback callbacks in range 1.Range2.MinFrequencyMinimum front-end frequency (in Hz) which can be used in the SetFrontEndFrequency and StartSweeper functions in range 2.Range2.MaxFrequencyMaximum front-end frequency (in Hz) which can be used in the SetFrontEndFrequency and StartSweeper functions in range 2.Range2.StepTuning step (in Hz) of the front-end in range 2. The frequencies used in the SetFrontEndFrequency and StartSweeper functions have to be multiple of this value.Range2.BandwidthSpecifies the useful bandwidth (in Hz) of the signal passed to the ADCSnapshotCallback and SweeperCallback callbacks in range 2.MaxDDC1ChannelCountMaximum number of DDC1 channels which can be created by the CreateDDC1 function per single device.MaxDDC2ChannelCountMaximum number of DDC2 channels which can be created by the CreateDDC2 function per single device.MaxDDC1TypeCountMaximum number of DDC types supported by the DDC1 channel.MaxDDC2TypeCountMaximum number of DDC types supported by the DDC2 channel. The current maximum can be determined using the GetDDCCount function because it is also limited by the currently selected DDC type of the related DDC1 channel.MaxDDC2ChannelsPerDDC1ChannelMaximum number of DDC2 channels per DDC1 channel.FlagsHardware configuration flags can be a combination of the following values:
Value Meaning G69DDC_FLAGS_EXTERNAL_REFERENCE_IN The device includes an external reference oscillator input. G69DDC_FLAGS_COHERENT The device supports coherent mode. G69DDC_FLAGS_EXTERNAL_REFERENCE_OUT The device includes a reference oscillator output. MACAddressPhysical 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
FlagsA set of bits flags. This member can be a combination of the following flags:
Value Meaning G69DDC_DEVICE_STATE_HIGH_TEMPERATURE Critical temperature is detected and the device is turned off automatically. In this case the application should call SetPower to turn off explicitly. TemperaturesInternal device's temperatures in °C. If temperature is not available or it is unknown the value is equal to G69DDC_TEMPERATURE_UNKNOWN.FanRPMDevice's fan rotations per minute. Zero value means the fan is off.DataTransferredTotal number of bytes transferred from/to device since it has been open.DataLostTotal 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
SampleRateSample rate of the I/Q signal in Hz.BandwidthUseful bandwidth in Hz.BitsPerSampleNumber 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
TuneInitial capture range in Hz.LockCapture range (in Hz) used when the AMS demodulator is locked.
G69DDC_CALLBACKS
Contains pointers to user-defined functions to be registered as callback functions.
Each callback function is called in context of the thread created by the API. If some shared data is to be accessed inside callback functions, it is recommended to use a mutual-exclusion synchronization method. The application should not call any G69DDC API function from the inside of callback functions, otherwise the function fails. The only exception is the GetSpectrumCompensation function which can be called from the inside of callback functions.
C/C++ declaration
#pragma pack(push,1) typedef struct { G69DDC_ADC_SNAPSHOT_CALLBACK ADCSnapshotCallback; G69DDC_DDC1_STREAM_CALLBACK DDC1StreamCallback; G69DDC_DDC1_PLAYBACK_STREAM_CALLBACK DDC1PlaybackStreamCallback; G69DDC_DDC2_STREAM_CALLBACK DDC2StreamCallback; G69DDC_DDC2_PREPROCESSED_STREAM_CALLBACK DDC2PreprocessedStreamCallback; G69DDC_AUDIO_STREAM_CALLBACK AudioStreamCallback; G69DDC_AUDIO_PLAYBACK_STREAM_CALLBACK AudioPlaybackStreamCallback; G69DDC_SWEEPER_CALLBACK SweeperCallback; } G69DDC_CALLBACKS; #pragma pack(pop)Members
Pointer to a user-defined function to be registered as an ADC snapshot callback. It is called by the API to pass ADC snapshots to the application. Sending of ADC snapshots is started using the StartADCSnapshots function.
C/C++ declaration
void ADCSnapshotCallback(const short *Buffer,uint32_t Count,uint32_t CenterFrequency,uint16_t ADCLevel,uintptr_t UserData);Parameters
BufferPointer 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.CountSpecifies the number of samples in the buffer pointed to by the Buffer parameter. This depends on the SamplesPerSnapshot parameter of the StartADCSnapshots function.CenterFrequencySpecifies 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.ADCLevelSpecifies 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.UserDataUser-defined data. It is a value passed to the SetCallbacks function as the UserData parameter.Pointer to a user-defined function to be registered as a DDC1 stream callback. It is called by the API to pass I/Q samples from DDC1 to the application. The DDC1 streaming can be started using the StartDDC or StartDDC1Playback function.
C/C++ declaration
void DDC1StreamCallback(uint32_t DDC1ChannelId,const void *Buffer,uint32_t Count,uint32_t BitsPerSample,uintptr_t UserData);Parameters
DDC1ChannelIdSpecifies the identification number of the DDC1 channel. See CreateDDC1.BufferPointer to the buffer which contains I/Q sample sets from DDC1. Sample rate and bits per sample is given by the used DDC type, see the SetDDC function. One I/Q sample set consists of two samples.CountSpecifies the number of I/Q sample sets in the buffer pointed to by the Buffer parameter. This value is equal to the value of the SampleSetsPerBuffer parameter of the StartDDC or StartDDC1Playback function.BitsPerSampleSpecifies 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.UserDataUser-defined data. It is a value passed to the SetCallbacks function as the UserData parameter.Pointer to a user-defined function to be registered as a DDC1 playback stream callback. It is called by the API to fill the buffer with I/Q samples by the application. The DDC1 playback can be started using the StartDDC1Playback function.
C/C++ declaration
int DDC1PlaybackStreamCallback(uint32_t DDC1ChannelId,void *Buffer,uint32_t Count,uint32_t BitsPerSample,uintptr_t UserData);Parameters
DDC1ChannelIdSpecifies the identification number of the DDC1 channel. See CreateDDC1.BufferPointer to the buffer to be filled with I/Q sample sets. Sample rate and bits per sample are given by the used DDC type, see the SetDDC function.CountSpecifies the number of I/Q sample sets to be stored to the buffer pointed to by the Buffer parameter. This value is equal to the value of the SampleSetsPerBuffer parameter of the StartDDC1Playback function. If the application does not have the requested number of sample sets, it has to fill the buffer with zeros. One I/Q sample set consists of two samples.BitsPerSampleSpecifies 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.UserDataUser-defined data. It is a value passed to the SetCallbacks function as the UserData parameter.Return value
The application should return non-zero to continue playback. The application should return zero to stop the API from calling the DDC1PlaybackStreamCallback again. This does not stop DDC1 playback, it has to be done explicitly by the application calling the StopDDC function from the thread in which the device was opened using the OpenDevice function. StopDDC must not be called from inside the callback function.Pointer to a user-defined function to be registered as a DDC2 stream callback. It is called by the API to pass I/Q samples from DDC2 to the application. The DDC2 streaming can be started using the StartDDC function.
C/C++ declaration
void DDC2StreamCallback(uint32_t DDC2ChannelId,const float *Buffer,uint32_t Count,uintptr_t UserData);Parameters
DDC2ChannelIdSpecifies the identification number of the DDC2 channel. See CreateDDC2.BufferPointer to the buffer which contains I/Q sample sets from DDC2. Sample rate is given by the DDC type of the DDC2. Use the GetDDC function to determine current DDC type of the DDC2. The sample is 32-bit IEEE float from the range of -1.0 to 1.0. One I/Q sample set consists of two samples.CountSpecifies the number of I/Q sample sets in the buffer pointed to by the Buffer parameter. This value is equal to value of the SampleSetsPerBuffer parameter of the StartDDC function.UserDataUser-defined data. It is a value passed to the SetCallbacks function as the UserData parameter.Pointer to a user-defined function to be registered as pre-processed DDC2 stream callback. It is called by the API to pass pre-processed I/Q samples from DDC2 to the application. The samples are filtered by the demodulator filter, notch filter and affected by AGC or fixed gain. The DDC2 streaming can be started using the StartDDC function.
C/C++ declaration
void DDC2PreprocessedStreamCallback(uint32_t DDC2ChannelId,const float *Buffer,uint32_t Count, float SlevelPeak,float SlevelRMS,uintptr_t UserData);Parameters
DDC2ChannelIdSpecifies the identification number of the DDC2 channel. See CreateDDC2.BufferPointer to the buffer which contains pre-processed I/Q sample sets from DDC2. Sample rate is given by the DDC type of the DDC2. Use the GetDDC function to determine current DDC type of the DDC2. Sample is 32-bit IEEE float from the range of -1.0 to 1.0. One I/Q sample set consists of two samples.NumberOfSamplesSpecifies the number of I/Q sample sets in the buffer pointed to by the Buffer parameter. This value is equal to value of the SampleSetsPerBuffer parameter of the StartDDC function.SlevelPeakSpecifies the peak signal level in Volts evaluated from samples stored in the buffer pointed to by the Buffer parameter.SlevelRMSSpecifies the RMS signal level in Volts evaluated from samples stored in the buffer pointed to by the Buffer parameter. For detailed information on how to convert RMS signal level to dBm, see the remarks of the GetSignalLevel function.UserDataUser-defined data. It is a value passed to the SetCallbacks function as the UserData parameter.Pointer to a user-defined function to be registered as an audio stream callback. It is called by the API to pass audio samples to the application. The audio streaming can be started using the StartAudio or StartAudioPlayback function. The callback is invoked three times for each audio buffer (see the description of the Stage parameter).
C/C++ declaration
void AudioStreamCallback(uint32_t DDC2ChannelId,uint32_t Stage,const float *Buffer,uint32_t Count,uintptr_t UserData);Parameters
DDC2ChannelIdSpecifies the identification number of the DDC2 channel. See CreateDDC2.StageSpecifies 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:
Value Meaning G69DDC_AUDIO_STREAM_CALLBACK_STAGE_0 The buffer contains audio samples affected by the audio gain (see SetAudioGain). G69DDC_AUDIO_STREAM_CALLBACK_STAGE_1 The buffer contains audio samples affected by the audio gain and audio filter (see SetAudioGain and SetAudioFilter). G69DDC_AUDIO_STREAM_CALLBACK_STAGE_2 The buffer contains audio samples affected by the audio gain, audio filter and volume (see SetAudioGain, SetAudioFilter, SetVolume and SetMute). BufferPointer to the buffer which contains samples of the audio signal. The audio signal consists of two channels (interleaved), the sample rate is 48000 Hz, each sample is 32-bit IEEE float from the range of -1.0 to 1.0.CountSpecifies the number of sample sets stored in the buffer pointed to by the Buffer parameter (the sample set consists of two samples). This value is equal to the value of the SampleSetsPerBuffer parameter of the StartAudio or StartAudioPlayback function.UserDataUser-defined data. It is a value passed to the SetCallbacks function as the UserData parameter.Pointer to a user-defined function to be registered as an audio playback stream callback. It is called by the API to fill the buffer with audio samples by the application. The audio playback can be started using the StartAudioPlayback function.
C/C++ declaration
int AudioPlaybackStreamCallback(uint32_t DDC2ChannelId,float *Buffer,uint32_t Count,uintptr_t UserData);Parameters
DDC2ChannelIdSpecifies the identification number of the DDC2 channel. See CreateDDC2.BufferPointer 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.CountSpecifies the number of sample sets in the buffer pointed to by the Buffer parameter (the sample set consists of two samples). This value is equal to value of the SampleSetsPerBuffer parameter of the StartAudioPlayback function. If the application does not have the requested number of samples, the application has to fill the buffer with zeros.UserDataUser-defined data. It is a value passed to the SetCallbacks function as the UserData parameter.Return value
The application should return non-zero to continue playback. The application should return zero to stop the API from calling the AudioPlaybackStreamCallback again. This does not stop audio playback, it has to be done explicitly by the application calling the StopAudio function from the thread in which the device was opened using the OpenDevice function. StopAudio must not be called from inside the callback function.Pointer to a user-defined function to be registered as a sweeper callback. It is called by the API to pass ADC snapshots to the application during sweeping. The sweeper is started using the StartSweeper function.
int SweeperCallback(const short *Buffer,uint32_t Count,uint32_t CenterFrequency,uint64_t FrontEndFrequency,uint32_t Repeat,uintptr_t UserData);Parameters
BufferPointer 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).CountSpecifies the number of samples in the buffer pointed to by the Buffer parameter. The value is equal to the SamplesPerSnapshot parameter passed to the StartSweeper function when starting the sweeper.CenterFrequencySpecifies 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.FrontEndFrequencyFront-end frequency (in Hz) at the time when the snapshot was made.RepeatSpecifies 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 StartSweeper function when starting the sweeper.UserDataUser-defined data. It is a value passed to the SetCallbacks function as the UserData parameter.Return value
The application should return non-zero to continue sweeping. The application should return zero to stop the API from calling SweeperCallback again. This does not stop the sweeper, it has to be done explicitly by the application calling the StopSweeper function from the thread in which the device was opened using the OpenDevice function. StopSweeper must not be called from inside the callback function.