The G35DDC API SDK is implemented as a dynamic library (libg35ddcapi.so) for 32-bit i386 and 64-bit x86_64 platforms. It provides object-oriented and non-object-oriented interface to control the G35DDC device. This document describes the object-oriented interface. The libg35ddcapi.so library provides several object types which makes it possible to control G35DDC 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 G35DDC receiver can be controlled from a single user thread only.
A C/C++ header file g35ddcapi.h is a part of the SDK.
The lib35ddcapi.so library can be loaded to the application using the dlopen function of dynamic linking loader (link with -ldl). After the library is loaded, it is necessary to get addresses of exported functions. When the API is no longer required in the memory, the dlclose function can be used to unload the API. Before the dlclose is called, all the objects created using CreateInstance function must be freed releasing their interfaces using the Release method, otherwise the application can enter an unpredictable state. The following source code shows how to load the API:
#include <stdio.h> #include <dlfcn.h> #include "g35ddcapi.h" G35DDCAPI_CREATE_INSTANCE CreateInstance; void *API; int main(void) { //Loading the API API=dlopen("libg35ddcapi.so",RTLD_LAZY); if(API!=NULL) { //Retrieving addresses of CreateInstance functions CreateInstance=(G35DDCAPI_CREATE_INSTANCE)dlsym(API,"CreateInstance"); //Here place code that uses the API dlclose(API); } else { //If the dlopen fails printf("Failed to load libg35ddcapi.so. %s\n",dlerror()); } return 0; }
To enumerate available G35DDC devices the API provides an enumeration object. The object has to be created using the CreateInstance function. The following source code in C++ produces a list of serial numbers of the available G35DDC devices:
#include <stdio.h> #include <dlfcn.h> #include <errno.h> #include "g35ddcapi.h" int main(void) { G35DDCAPI_CREATE_INSTANCE CreateInstance; void *API; IG35DDCDeviceEnumerator *Enumerator=NULL; G35DDC_DEVICE_INFO DevInfo; uint32_t Index; uint32_t Count; API=dlopen("libg35ddcapi.so",RTLD_LAZY); if(API!=NULL) { CreateInstance=(G35DDCAPI_CREATE_INSTANCE)dlsym(API,"CreateInstance"); if(CreateInstance(G35DDC_CLASS_ID_DEVICE_ENUMERATOR,(void**)&Enumerator)) { Enumerator->Enumerate(); Count=Enumerator->GetCount(); if(Count!=0) { printf("Available G35DDC devices count=%d:\n",Count); for(Index=0;Index<Count;Index++) { Enumerator->GetDeviceInfo(Index,&DevInfo,sizeof(DevInfo)); printf("%d. SN: %s\n",Index,DevInfo.SerialNumber); } } else { printf("No available G35DDC device found.\n"); } Enumerator->Release(); } else { printf("Failed to create enumerator object. Error code=%d\n",errno); } dlclose(API); } else { printf("Failed to load libg35ddcapi.so. %s\n",dlerror()); } printf("Press enter to exit\n"); getchar(); return 0; }
The API provides an object to control the G35DDC device. Before the device is open, the object has to be created using the CreateInstance function. The following source code in C++ shows how to open the first available G35DDC device.
#include <stdio.h> #include <dlfcn.h> #include <errno.h> #include "g35ddcapi.h" int main(void) { G35DDCAPI_CREATE_INSTANCE CreateInstance; void *API; IG35DDCDevice *Device; //Loading the API API=dlopen("libg35ddcapi.so",RTLD_LAZY); if(API!=NULL) { //Retrieving address of the CreateInstance API functions CreateInstance=(G35DDCAPI_CREATE_INSTANCE)dlsym(API,"CreateInstance"); //Creating instance of the device object if(CreateInstance(G35DDC_CLASS_ID_DEVICE,(void**)&Device)) { //Opening the first available G35DDC device using predefined G3XDDC_OPEN_FIRST constant if(Device->Open(G3XDDC_OPEN_FIRST)) { //Here place code that works with the open G35DDC device //Closing device Device->Close(); } else { printf("Failed to open device. Error code=%d\n",errno); } //Release interface of device object Device->Release(); } else { printf("Failed to create device object. Error code=%d\n",errno); } dlclose(API); } else { //If the dlopen fails printf("Failed to load libg35ddcapi.so. %s\n",dlerror()); } return 0; }
Creates single object of the specified class and returns interface of the object.
C/C++ declaration
int32_t CreateInstance(uint32_t ClassId,Pvoid *Interface);
Address retrieval
G35DDCAPI_CREATE_INSTANCE CreateInstance=(G35DDCAPI_CREATE_INSTANCE)dlsym(API,"CreateInstance");
Parameters
ClassId[in] Specifies class identifier of the object to be created. This parameter must be one of the following:
Value Meaning G35DDC_CLASS_ID_DEVICE_ENUMERATOR Class identifier of the enumerator object. When the function finished successfully, IG35DDCDeviceEnumerator interface is stored to a variable pointed to by the Interface parameter. G35DDC_CLASS_ID_DEVICE Class identifier of the device object. When the function finished successfully, IG35DDCDevice interface is stored to variable pointed to by the Interface parameter. Interface[out] Pointer to a variable that receives interface to newly created object of specified class. This parameter cannot be NULL.
Return value
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero. To get extended error information, check errno.
Remarks
All the objects created using CreateInstance must be freed releasing their interfaces using the Release method before the API is unloaded using the FreeLibrary function.
The CreateInstance function can be called in any user-thread. Returned interface can be used only in the same thread in which its object was created, otherwise the application can enter an unpredictable state.
IG35DDCDeviceEnumerator interface is the interface of the enumerator object that is created using the CreateInstance function which provides an enumeration mechanism of available G35DDC devices.
Increases the reference count to the enumerator object.
C/C++ declaration
uint32_t AddRef(void);
Parameters
None
Return value
The method returns resulting reference count.
Remarks
Initial reference count of an object created using the CreateInstance function is 1.
Decrements the reference count of the object. When the reference count reaches zero, the object and all the resources allocated by them are freed and the interface is no longer usable.
C/C++ declaration
uint32_t Release(void);
Parameters
None
Return value
The method returns the resulting reference count. If the return value is zero, the object was freed.
Performs enumeration of available G35DDC devices.
C/C++ declaration
int Enumerate(void);
Parameters
None
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Retrieves the number of available G35DDC devices enumerated using the IG35DDCDeviceEnumerator::Enumerate method.
C/C++ declaration
uint32_t GetCount(void);
Parameters
None
Return value
The method returns number of available G35DDC devices.
Retrieves information about the available G35DDC device.
C/C++ declaration
int GetDeviceInfo(uint32_t DeviceIndex,G35DDC_DEVICE_INFO *DeviceInfo,uint32_t BufferLength);
Parameters
DeviceIndex[in] Specifies index of the device. It can vary from zero to 'one less' than the value returned by the IG35DDCDeviceEnumerator::GetCount method.DeviceInfo[out] Pointer to a G35DDC_DEVICE_INFO structure to be filled with information about the device.BufferLength[in] Size, in bytes, of the G35DDC_DEVICE_INFO structure.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
IG35DDCDevice interface is an interface of the device object that is created using the CreateInstance function. This interface allows to control of the selected G35DDC device.
Increases the reference count to the device object.
C/C++ declaration
uint32_t AddRef(void);
Parameters
None
Return value
The method returns resulting reference count.
Remarks
Initial reference count of an object created using the CreateInstance function is 1.
Decrements the reference count of the object. When the reference count reaches zero, the object and all the resources allocated by them are freed and the interface is no longer usable.
C/C++ declaration
uint32_t Release(void);
Parameters
None
Return value
The method returns resulting reference count. If the return value is zero, the object was freed.
Opens G35DDC device by its system path and associates the device with the device object given by its interface pointer.
C/C++ declaration
int Open(const char *DevicePath);
Parameters
DevicePath[in] Pointer to a null-terminated string that specifies the system path of the G35DDC device to open. The system device path of the device can be obtained from the G35DDC_DEVICE_INFO structure filled by the IG35DDCDeviceEnumerator::GetDeviceInfo method. Instead of the system path, it can be used one of the following values:
Value Meaning G3XDDC_OPEN_FIRST This method opens the first available G35DDC device. G3XDDC_OPEN_DEMO This method opens a demo G35DDC device. This allows developers to work with the API without physical G35DDC device.
Return value
If the method succeeds, the return value non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::Close method to close currently open G35DDC device associated with the device object.
Closes currently open G35DDC device associated with the device object; and makes the object available for use with another G35DDC device.
C/C++ declaration
void Close(void);
Parameters
None
Return value
None
Remarks
If no 'open' G35DDC device is associated with the object, the Close method does nothing.
Checks if a device is associated with the device object.
C/C++ declaration
int IsOpen(void);
Parameters
None
Return value
This method returns a non-zero value if a device is associated with the device object (using the IG35DDCDevice::Open method) and it can be controlled using methods of the device object interface.
The method returns zero if no device is associated with the device object.
Checks if the device is still connected to the computer.
C/C++ declaration
int IsConnected(void);
Parameters
None
Return value
This method returns a non-zero value if the device is still connected.
If the device is disconnected or the method fails, the return value is zero. To determine if the method failed, check errno. errno returns 0 if the device is disconnected or another error code if IsConnected failed.
Remarks
If it is determined the device is disconnected, the IG35DDCDevice::Close should be used.
Retrieves information about the G35DDC device.
C/C++ declaration
int GetDeviceInfo(G35DDC_DEVICE_INFO *Info,uint32_t BufferLength);
Parameters
Info[out] Pointer to a G35DDC_DEVICE_INFO structure to be filled with information about the device. This parameter cannot be NULL.BufferLength[in] Size in bytes of the G35DDC_DEVICE_INFO structure.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Turns the G35DDC device on or off.
C/C++ declaration
int SetPower(int Power);
Parameters
Power[in] Specifies whether to turn on or off the device. If this parameter is non-zero the device is turned on, if it is zero the device is turned off.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
If SetPower turns the device off, all the running streams are stopped.
Use the IG35DDCDevice::GetPower method to determine the current power state of the device.
Determines whether the device is turned on or off.
C/C++ declaration
int GetPower(int *Power);
Parameters
Power[out] Pointer to a variable that receives current power state of the device. If it is non-zero, the device is turned on. If it is zero the device is turned off. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Enables or disables the use of external reference as the clock source.
C/C++ declaration
int SetExternalReference(int Enabled);
Parameters
Enabled[in] Specifies the desired clock source: nonzero - external reference, zero - internal.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
External reference is optional. If the receiver does not support external reference, IG35DDCDevice::SetExternalReference fails. The following example shows how to determine that the receiver supports external reference:
G35DDC_DEVICE_INFO DeviceInfo; IG35DDCDevice *Device; //Interface of G35DDC device object, created using the CreateInstance function Device->GetDeviceInfo(&DeviceInfo,sizeof(DeviceInfo)); if(DeviceInfo.Flags & G35DDC_FLAGS_EXTERNAL_REFERENCE) { //the receiver supports external reference } else { //the receiver does not support external reference }
Retrieves the current clock source.
C/C++ declaration
int GetExternalReference(int *Enabled);
Parameters
Enabled[out] Pointer to a variable that receives information about the current clock source. If it is non-zero, external reference is used, if it is zero, internal reference is used. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets the input attenuator.
C/C++ declaration
int SetAttenuator(uint32_t Attenuator);
Parameters
Attenuator[in] Value that specifies attenuation level in dB. Possible values are: 0, 3, 6, 9, 12, 15, 18, 21. If the value is not from the list, the SetAttenuator method rounds the value to the nearest lower one.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetAttenuator method to determine the current setting of the attenuator.
Retrieves the current setting of the attenuator.
C/C++ declaration
int GetAttenuator(uint32_t *Attenuator);
Parameters
Attenuator[out] Pointer to a variable that receives the current attenuation level. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Controls the band pass filter at RF input.
C/C++ declaration
int SetPreselectors(uint32_t Low,uint32_t High);
Parameters
Low[in] Specifies the cut-off low frequency of the filter in Hz. Possible values are: 0, 850000, 2400000, 5400000,11800000. If the value is not from the list, the method rounds it to the nearest one.High[in] Specifies the cut-off high frequency of the filter in Hz. Possible values are: 3100000, 5400000, 11800000, 23300000, 50000000. If the value is not from the list, the method rounds it to the nearest one.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Value of the Low parameter must not be higher than the value of the High parameter, otherwise the method fails.
Use the IG35DDCDevice::GetPreselectors method to determine the current setting of the preselectors.
Retrieves the current setting of the RF input band pass filter.
C/C++ declaration
int GetPreselectors(uint32_t *Low,uint32_t *High);
Parameters
Low[out] Pointer to a variable that receives the current cut-off low frequency of the filter in Hz. This parameter can be NULL if the application does not require this information.High[out] Pointer to a variable that receives the current cut-off high frequency of the filter in Hz. This parameter can be NULL if the application does not require this information.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Enables or disables the RF input preamplifier.
C/C++ declaration
int SetPreamp(int Preamp);
Parameters
Preamp[in] Specifies whether to enable or disable the RF preamplifier. If this parameter is non-zero, the preamplifier is enabled. If the parameter is zero, the preamplifier is disabled.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetPreamp method to determine the current state of the preamplifier.
Retrieves the current state of the RF input preamplifier.
C/C++ declaration
int GetPreamp(int *Preamp);
Parameters
Preamp[out] Pointer to a variable that receives the current state of the preamplifier. The value is non-zero if the preamplifier is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Enables or disables the noise blanker on ADC stream.
C/C++ declaration
int SetADCNoiseBlanker(int Enabled);
Parameters
Enabled[in] Specifies whether to enable or disable the noise blanker. If this parameter is non-zero, noise blanker is enabled. If the parameter is zero, noise blanker is disabled.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetADCNoiseBlanker method to determine the current state of the noise blanker.
Retrieves the current ADC noise blanker state.
C/C++ declaration
int GetADCNoiseBlanker(int *Enabled);
Parameters
Enabled[out] Pointer to a variable that receives the current state of the noise blanker. The value is non-zero if noise blanker is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Specifies the ADC noise blanker threshold.
C/C++ declaration
int SetADCNoiseBlankerThreshold(uint16_t Threshold);
Parameters
Threshold[in] Specifies the maximum acceptable input signal. The maximum possible value of threshold is 32767, in this case the noise blanker has no effect even if it is enabled using the IG35DDCDevice::SetADCNoiseBlanker method.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetADCNoiseBlankerThreshold method to retrieve the current threshold of the noise blanker.
Determines the ADC noise blanker threshold.
C/C++ declaration
int GetADCNoiseBlankerThreshold(uint16_t *Threshold);
Parameters
Threshold[out] Pointer to a variable that receives the threshold of ADC noise blanker. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Starts sending of IF snapshots.
C/C++ declaration
int StartIF(uint16_t Period);
Parameters
Period[in] Specifies the time interval in milliseconds for how often the IF snapshots are sent to the IG35DDCDeviceCallback::G35DDC_IFCallback callback.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The G35DDC device has to be turned on using the IG35DDCDevice::SetPower method before use of StartIF, otherwise the StartIF method fails.
Too low value of the Period parameter can dramatically increase data flow through USB wich could cause breaking of running streaming.
Stops sending of IF snapshots.
C/C++ declaration
int StopIF(void);
Parameters
None
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The IG35DDCDeviceCallback::G35DDC_IFCallback callback is not called after StopIF returns.
Enables or disables frequency spectrum inversion.
C/C++ declaration
int SetInverted(int Inverted);
Parameters
Inverted[in] Specifies whether to enable or disable frequency spectrum inversion. If this parameter is non-zero, IF spectrum is inverted.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Retrieves current frequency spectrum inversion setting.
C/C++ declaration
int GetInverted(int *Inverted);
Parameters
Inverted[out] Pointer to a variable that receives a non-zero value if the frequency spectrum inversion is enabled, and zero if the inversion is disabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Retrieves information about DDC format.
C/C++ declaration
int GetDDCInfo(uint32_t DDCTypeIndex,G3XDDC_DDC_INFO *Info);
Parameters
DDCTypeIndex[in] Specifies index of DDC type. For more information, see remarks.Info[out] Pointer to a G3XDDC_DDC_INFO structure to be filled with information about DDC type.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetDDC1Count method to determine the number of possible DDC types of DDC1. In this case the DDCTypeIndex parameter can vary from zero to 'one less' than the number determined by IG35DDCDevice::GetDDC1Count.
Use the IG35DDCDevice::GetDDC1 method to determine the current DDC type index of DDC1 and the IG35DDCDevice::GetDDC2 method to determine current DDC type of DDC2.
Retrieves the number of DDC types supported by DDC1.
C/C++ declaration
int GetDDC1Count(uint32_t *Count);
Parameters
Count[out] Pointer to a variable that receives the number of DDC types supported by the DDC1. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets current DDC type of DDC1.
C/C++ declaration
int SetDDC1(uint32_t DDCTypeIndex);
Parameters
DDCTypeIndex[in] Specifies index of DDC type to be used in DDC1. It can vary from zero to 'one less than the number of DDC types' of the DDC1.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetDDC1Count method to determine the number of possible DDC types of DDC1. The DDCTypeIndex parameter can vary from zero to one less than the number determined by IG35DDCDevice::GetDDC1Count.
DDC1 streaming must not run when calling SetDDC1. In other words, DDC1 streaming which is started using the IG35DDCDevice::StartDDC1 method has to be stopped using the IG35DDCDevice::StopDDC1 method before calling of SetDDC1, otherwise SetDDC1 fails. The SetDDC1 method does not start and stop DDC1 streaming, just changes the DDC type of DDC1.
Calling of SetDDC1 can change the current DDC type of DDC2 and current bandwidth of demodulator filter, so it is useful to call the IG35DDCDevice::GetDDC2 and IG35DDCDevice::GetDemodulatorFilterBandwidth methods immediately after SetDDC1 to determine the current DDC type of DDC2 and current bandwidth of the demodulator filter.
Use the IG35DDCDevice::GetDDC1 method to determine current DDC type of the DDC1.
Retrieves information about the current DDC type of the DDC1.
C/C++ declaration
int GetDDC1(uint32_t *DDCTypeIndex,G3XDDC_DDC_INFO *DDCInfo);
Parameters
DDCTypeIndex[out] Pointer to a variable that receives index of current DDC type of the DDC1. This parameter can be NULL if the application does not require this information.DDCInfo[out] Pointer to a G3XDDC_DDC_INFO structure to be filled with information about the current DDC type of the DDC1. This parameter can be NULL if the application does not require this information.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Returned DDCTypeIndex can be passed to the IG35DDCDevice::GetDDCInfo method.
Sets DDC1 center frequency.
C/C++ declaration
int SetDDC1Frequency(uint32_t Frequency);
Parameters
Frequency[in] Specifies the new center frequency of DDC1 in Hz.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Changing of DDC1 frequency causes change of absolute frequency of the DDC2 and demodulator in each channel.
Use the IG35DDCDevice::GetDDC1Frequency method to determine the current center frequency of DDC1.
Retrieves the current center frequency of DDC1.
C/C++ declaration
int GetDDC1Frequency(uint32_t *Frequency);
Parameters
Frequency[out] Pointer to a variable that receives the current center frequency of DDC1 in Hz. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Starts DDC1 streaming.
C/C++ declaration
int StartDDC1(uint32_t SamplesPerBuffer);
Parameters
SamplesPerBuffer[in] Specifies the number of I/Q sample sets in each buffer passed to the IG35DDCDeviceCallback::G35DDC_DDC1StreamCallback callback. If the current DDC1 type index (specified by the IG35DDCDevice::SetDDC1 method) is less than or equal to 23 (DDC1 bandwidth <= 4 MHz) the value of the SamplesPerBuffer has to be a multiple of 64. If the current the DDC1 type index is greater than 23 (DDC1 bandwidth > 4 MHz), the SamplesPerBuffers has to be a multiple of 1024. If it is zero, the IG35DDCDevice::StartDDC1 method fails.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The G35DDC device has to be turned on using the IG35DDCDevice::SetPower method before StartDDC1 is used. Otherwise StartDDC1 fails.
If the DDC1 streaming is already running before use of StartDDC1, StartDDC1 restarts the streaming except it was previously started with the same SamplesPerBuffer parameter. In this case StartDDC1 does nothing. Restart of DDC1 streaming stops DDC2 and audio streaming in each channel. StartDDC1 does not restart DDC2 and audio streaming.
If DDC1 playback is running (started using IG35DDCDevice::StartDDC1Playback method) before use of StartDDC1, StartDDC1 stops it and starts DDC1 streaming from the device.
Use the IG35DDCDevice::StopDDC1 method to stop DDC1 streaming.
Decreasing the value of the SamplesPerBuffer parameter decreases latency and may increase CPU usage. Increasing the value of the SamplesPerBuffer parameter increases latency and it may decrease CPU usage.
Stops DDC1 streaming.
C/C++ declaration
int StopDDC1(void);
Parameters
None
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
If DDC1 playback is running (started using IG35DDCDevice::StartDDC1Playback) before use of StopDDC1, the StopDDC1 method stops it.
The StopDDC1 method stops all the streaming beyond the DDC1 in the processing chain (DDC2 and audio streaming in all the channels).
The IG35DDCDeviceCallback::G35DDC_DDC1StreamCallback and IG35DDCDeviceCallback::G35DDC_DDC1PlaybackStreamCallback callback methods are not called after StopDDC1 returns.
Starts DDC1 playback. It allows to pass previously recorded DDC1 I/Q samples to the processing chain instead of the samples received from the device.
C/C++ declaration
int StartDDC1Playback(uint32_t SamplesPerBuffer,uint32_t BitsPerSample);
Parameters
SamplesPerBuffer[in] Specifies the number of I/Q sample sets in each buffer passed to the IG35DDCDeviceCallback::G35DDC_DDC1PlaybackStreamCallback callback to fill the buffer by the application and to the IG35DDCDeviceCallback::G35DDC_DDC1StreamCallback callback. The value has to be a multiple of 64 greater than zero. If it is zero, the StartDDC1Playback method fails. If it is not a multiple of 64 the method rounds it up to nearest a multiple of 64.BitsPerSample[in] Specifies the number of bits per I and Q samples. It is used for both IG35DDCDeviceCallback::G35DDC_DDC1PlaybackStreamCallback and IG35DDCDeviceCallback::G35DDC_DDC1StreamCallback callback methods. The possible value is one of the following:
Value Meaning 0 I and Q samples have default number of bits. It is given by by BitsPerSample member of the G3XDDC_DDC_INFO structure which can be retrieved using the GetDDC1 or IG35DDCDevice::GetDDCInfo method. 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 method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The G35DDC device has to be turned on using IG35DDCDevice::SetPower method before use of StartDDC1Playback.
The StartDDC1Playback method stops DDC1 streaming that was previously started by the IG35DDCDevice::StartDDC1 or StartDDC1Playback methods and starts DDC1 playback with new parameters. Stopping of DDC1 streaming stops DDC2 and audio steaming in each channel. StartDDC1Playback does not restart DDC2 and audio streaming.
Use the IG35DDCDevice::StopDDC1 method to stop DDC1 playback.
Pauses DDC1 playback.
C/C++ declaration
int PauseDDC1Playback(void);
Parameters
None
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
If DDC1 playback is not active or it is already paused, PauseDDC1Playback does nothing.
The IG35DDCDeviceCallback::G35DDC_DDC1PlaybackStreamCallback and IG35DDCDeviceCallback::G35DDC_DDC1StreamCallback callback methods can be called by the API once after PauseDDC1Playback returns. Then they are not called until playback is resumed using the IG35DDCDevice::ResumeDDC1Playback method.
Resumes paused DDC1 playback.
C/C++ declaration
int ResumeDDC1Playback(void);
Parameters
None
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
If DDC1 playback is not active or it is not paused, ResumeDDC1Playback does nothing.
Retrieves information about current DDC type of the DDC2.
C/C++ declaration
int GetDDC2(uint32_t *DDCTypeIndex,G3XDDC_DDC_INFO *DDCInfo);
Parameters
DDCTypeIndex[out] Pointer to a variable that receives an index of the current DDC type of the DDC2. This parameter can be NULL if the application does not require this information.DDCInfo[out] Pointer to a G3XDDC_DDC_INFO structure to be filled with information about the current DDC type of the DDC2. This parameter can be NULL if the application does not require this information.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Each channel has its own DDC2, see the block diagram. DDC type of each DDC2 is the same and depends upon DDC type of DDC1, it cannot be changed by the application directly. The DDC type of DDC2 is equal to the DDC type of DDC1 if DDC type index of DDC1 is less than or equal to 5 (sample rate: 80 kHz, bandwidth: 64 kHz, bits per sample: 32). If the DDC type index of DDC1 is above 5, the DDC type index of DDC2 is always 5. Changing of DDC type of DDC1 can cause a change of DDC type of DDC2, so it is useful to call GetDDC2 immediately after the SetDDC1 method to determine the current DDC type of DDC2 - if the application needs to know parameters of DDC2.
The BitsPerSample member of the G3XDDC_DDC_INFO structure is not used and it can be ignored for DDC2. I and Q samples in buffers passed to the IG35DDCDeviceCallback::G35DDC_DDC2StreamCallback and IG35DDCDeviceCallback::G35DDC_DDC2PreprocessedStreamCallback DDC2 callback methods are always in IEEE float (32 bit, little endian) format.
Returned DDCTypeIndex can be passed to the IG35DDCDevice::GetDDCInfo method.
Sets the relative center frequency of DDC2 for given channel.
C/C++ declaration
int SetDDC2Frequency(uint32_t Channel,int32_t Frequency);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Frequency[in] Specifies the new center frequency of DDC2 in Hz.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The value of the Frequency parameter is center frequency of the DDC2 relative to center of the DDC1. The value can be negative.
The absolute frequency of the DDC2 is given by the following formula:
faDDC2[i] = fDDC1 + frDDC2[i]
Where faDDC2[i] is the absolute center frequency of DDC2 of i-th channel in Hz, fDDC1 is the center frequency of the DDC1 in Hz (set using the IG35DDCDevice::SetDDC1Frequency method) and frDDC2[i] is the relative center frequency of DDC2 of i-th channel in Hz (set using SetDDC2Frequency).
Changing of DDC2 'relative frequency' changes the 'absolute frequency' of the DDC2 and demodulator in the specified channel.
Use the IG35DDCDevice::GetDDC2Frequency method to determine the current relative center frequency of the DDC2 for given channel.
The following example shows three methods how it is possible to set the absolute DDC2 center frequency of channel 0 to 11.01 MHz:
IG35DDCDevice *Device; //Interface of the G35DDC device object, created using CreateInstance function //1. method Device->SetDDC1Frequency(11010000); Device->SetDDC2Frequency(0,0); //2. method, it can be used if bandwidth of DDC2 is less than bandwidth of DDC1 Device->SetDDC1Frequency(11000000); Device->SetDDC2Frequency(0,10000); //3. method, it can be used if bandwidth of DDC2 is less than bandwidth of DDC1 Device->SetDDC1Frequency(11020000); Device->SetDDC2Frequency(0,-10000);
Retrieves the current relative center frequency of DDC2.
C/C++ declaration
int GetDDC2Frequency(uint32_t Channel,int32_t *Frequency);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Frequency[out] Pointer to a variable that receives the current relative center frequency of DDC2 in Hz. The returned value can be negative. See remarks of the SetDDC2Frequency for information how to calculate the absolute center frequency of DDC2. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Starts DDC2 streaming for given channel.
C/C++ declaration
int StartDDC2(uint32_t Channel,uint32_t SamplesPerBuffer);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.SamplesPerBuffer[in] Specifies the number of I/Q sample sets in each buffer passed to the IG35DDCDeviceCallback::G35DDC_DDC2StreamCallback and IG35DDCDeviceCallback::G35DDC_DDC2PreprocessedStreamCallback callback methods. The value has to be a multiple of 64 greater than zero. If it is zero, the StartDDC2 method fails. If it is not a multiple of 64, the method rounds it up to nearest a multiple of 64.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Before StartDDC2 is used, the G35DDC device has to be turned on using the IG35DDCDevice::SetPower method and DDC1 streaming has to be started using the IG35DDCDevice::StartDDC1 or IG35DDCDevice::StartDDC1Playback method, otherwise StartDDC2 fails.
If the DDC2 streaming for a given channel is already running, StartDDC2 restarts it except the streaming was previously started with the same SamplesPerBuffer parameter. In this case StartDDC2 does nothing. Restart of the DDC2 streaming stops audio streaming for the given channel. StartDDC2 does not restart audio streaming.
Use the IG35DDCDevice::StopDDC2 method to stop DDC2 streaming.
Decreasing the value of the SamplesPerBuffer parameter decreases latency and may increase CPU usage. Increasing the value of the SamplesPerBuffer parameter increases latency and may decrease CPU usage.
Stops DDC2 streaming for given channel.
C/C++ declaration
int StopDDC2(uint32_t Channel);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
If audio streaming for a given channel is running, it is stopped too.
If DDC2 streaming is not active, StopDDC2 does nothing.
The IG35DDCDeviceCallback::G35DDC_DDC2StreamCallback and IG35DDCDeviceCallback::G35DDC_DDC2PreprocessedStreamCallback callback methods are not called after StopDDC2 returns.
Enables or disables the noise blanker on DDC2 stream.
C/C++ declaration
int SetDDC2NoiseBlanker(uint32_t Channel,int Enabled);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Enabled[in] Specifies whether to enable or disable the noise blanker. If this parameter is non-zero, the noise blanker is enabled. If the parameter is zero, the noise blanker is disabled.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetDDC2NoiseBlanker method to determine current state of the noise blanker.
Retrieves the current DDC2 noise blanker state.
C/C++ declaration
int GetDDC2NoiseBlanker(uint32_t Channel,int *Enabled);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Enabled[out] Pointer to a variable that receives current state of noise blanker. The value is non-zero if noise blanker is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Specifies the DDC2 noise blanker threshold.
C/C++ declaration
int SetDDC2NoiseBlankerThreshold(uint32_t Channel,double Threshold);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Threshold[in] Specifies threshold in %.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetDDC2NoiseBlankerThreshold method to retrieve current threshold of the noise blanker.
Retrieves the DDC2 noise blanker threshold.
C/C++ declaration
int GetDDC2NoiseBlankerThreshold(uint32_t Channel,double *Threshold);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Threshold[out] Pointer to a variable that receives the threshold of the noise blanker. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Determines a value which indicates the percentage ratio between 'short time average signal level' and 'maximum level'.
C/C++ declaration
int GetDDC2NoiseBlankerExcessValue(uint32_t Channel,double *Value);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Value[out] Pointer to a variable that receives current excess value in %. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Determines the current signal level for given channel.
C/C++ declaration
int GetSignalLevel(uint32_t Channel,float *Peak,float *RMS);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Peak[out] Pointer to a variable that 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 that receives the current signal level (RMS) in Volts. This parameter can be NULL if the application does not require this information.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
DDC2 streaming has to be active (started using the IG35DDCDevice::StartDDC2 method) before calling of GetSignalLevel, otherwise the returned peak and RMS signal levels are zero.
Signal level is evaluated from the signal after the demodulator filter and before the notch filter (see block diagram), the signal is selected by the demodulator filter.
Signal level is evaluated for each buffer that processed by the demoduletor filter. Buffer size (signal level evaluation rate) is given by the SamplesPerBuffer parameter of the IG35DDCDevice::StartDDC2 method.
The IG35DDCDeviceCallback::G35DDC_DDC2PreprocessedStreamCallback callback method provides signal level for each buffer passed the callback, i.e. for each buffer used in signal level evaluation. This provides a way to get signal level from each processed buffer without the need for pulling it using GetSignalLevel.
To convert RMS signal level in Volts to power in dBm use the following formulas:
P[W] = (VRMS)2 / R = (VRMS)2 / 50
P[dBm]= 10 * log10( P[W] * 1000 )
Where VRMS is RMS signal level in Volts obtained by GetSignalLevel, R is G35DDC 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 channel 0:
#include <stdio.h> #include <math.h> IG35DDCDevice *Device; //Interface of G35DDC device object, created using the CreateInstance function float P_dBm,V_RMS; Device->GetSignalLevel(0,NULL,&V_RMS); P_dBm=10.0*log10(V_RMS*V_RMS*(1000.0/50.0)); printf("Current signal level [RMS]: %.1f dBm\n",P_dBm);
Enables or disables the notch filter for given channel.
C/C++ declaration
int SetNotchFilter(uint32_t Channel,uint32_t NotchFilterIndex,int Enabled);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Enabled[in] Specifies whether to enable or disable the notch filter. If this parameter is non-zero, the filter is enabled. If the parameter is zero, the filter is disabled.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetNotchFilter method to determine whether the filter is enabled or disabled.
Retrieves the current notch filter state for given channel.
C/C++ declaration
int GetNotchFilter(uint32_t Channel,uint32_t NotchFilterIndex,int *Enabled);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Enabled[out] Pointer to a variable that receives the current state of the notch filter. The value is non-zero if the filter is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Specifies the relative center frequency of the notch filter for given channel.
C/C++ declaration
int SetNotchFilterFrequency(uint32_t Channel,uint32_t NotchFilterIndex,int32_t Frequency);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Frequency[in] Specifies the new center frequency of the notch filter in Hz.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The value of the Frequency parameter is the new center frequency of the notch filter relative to center of the DDC2 (see the IG35DDCDevice::SetDDC2Frequency method). The value can be negative.
Use the IG35DDCDevice::GetNotchFilterFrequency method to retrieve the current center frequency of the notch filter.
Retrieves the current relative center frequency of the notch filter.
C/C++ declaration
int GetNotchFilterFrequency(uint32_t Channel,uint32_t NotchFilterIndex,int32_t *Frequency);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Frequency[out] Pointer to a variable that receives the current center frequency of the notch filter. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Specifies the bandwidth of the notch filter for given channel.
C/C++ declaration
int SetNotchFilterBandwidth(uint32_t Channel,uint32_t NotchFilterIndex,uint32_t Bandwidth);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.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 in the range of 1 - 3000 Hz.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetNotchFilterBandwidth method to retrieve the current bandwidth of the notch filter.
Retrieves the current bandwidth of the notch filter for given channel.
C/C++ declaration
int GetNotchFilterBandwidth(uint32_t Channel,uint32_t NotchFilterIndex,uint32_t *Bandwidth);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Bandwidth[out] Pointer to a variable that receives the current bandwidth of the notch filter. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Specifies the notch filter length for the given channel. The notch filter is implemented as an FIR filter. This method specifies the number of coefficients used in the filtration procedure.
C/C++ declaration
int SetNotchFilterLength(uint32_t Channel,uint32_t NotchFilterIndex,uint32_t Length);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.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 a multiple of 64, greater than or equal to 64 and less than or equal to 32768. If it is not a multiple of 64, the method rounds it up to the nearest a multiple of 64.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Increasing the filter length increases the filter steepness and may increase CPU usage.
Use the IG35DDCDevice::GetNotchFilterLength method to determine the current length of the notch filter.
Retrieves the current notch filter length for given channel.
C/C++ declaration
int GetNotchFilterLength(uint32_t Channel,uint32_t NotchFilterIndex,uint32_t *Length);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.NotchFilterIndex[in] Specifies the notch filter index. Possible values are: 0, 1.Length[out] Pointer to a variable that receives the current length of the notch filter. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Enables or disables the AGC for the given channel.
C/C++ declaration
int SetAGC(uint32_t Channel,int Enabled);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Enabled[in] Specifies whether to enable or disable the AGC. If this parameter is non-zero, the AGC is enabled. If the parameter is zero, the AGC is disabled.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
If the AGC is disabled, the signal is affected by fixed gain specified using the IG35DDCDevice::SetGain method.
Use the IG35DDCDevice::GetAGC method to determine the current state of the AGC.
Retrieves the current state of the AGC for given channel.
C/C++ declaration
int GetAGC(uint32_t Channel,int *Enabled);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Enabled[out] Pointer to a variable that receives the current state of the AGC. The value is non-zero if the AGC is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets parameters of the AGC for given channel.
C/C++ declaration
int SetAGCParams(uint32_t Channel,double AttackTime,double DecayTime,double ReferenceLevel);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.AttackTime[in] Specifies the new attack time of the AGC in seconds.DecayTime[in] Specifies the new decay time of the AGC in seconds.ReferenceLevel[in] Specifies the new reference level of the AGC in dB.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetAGCParams method to determine the current parameters of the AGC.
Retrieves the current parameters of the AGC for given channel.
C/C++ declaration
int GetAGCParams(uint32_t Channel,double *AttackTime,double *DecayTime,double *ReferenceLevel);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.AttackTime[out] Pointer to a variable that 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 that 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 that receives the current reference level of the AGC in dB. This parameter can be NULL if the application does not require this information.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets maximum gain of the AGC for given channel.
C/C++ declaration
int SetMaxAGCGain(uint32_t Channel,double MaxGain);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.MaxGain[in] Specifies the new maximum gain of the AGC in dB.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetMaxAGCGain method to determine the maximum gain of the AGC.
Retrieves the current maximum gain of the AGC for given channel.
C/C++ declaration
int GetMaxAGCGain(uint32_t Channel,double *MaxGain);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.MaxGain[out] Pointer to a variable that receives the current maximum gain of the AGC in dB. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets fixed gain for the given channel. This gain is applied to the I/Q signal if the AGC is disabled, otherwise it is not used.
C/C++ declaration
int SetGain(uint32_t Channel,double Gain);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Gain[in] Specifies the new fixed gain in dB.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetGain method to determine the current fixed gain.
Retrieves the current fixed gain for given channel.
C/C++ declaration
int GetGain(uint32_t Channel,double *Gain);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Gain[out] Pointer to a variable that receives the current fixed gain in dB. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Retrieves the current gain that is applied to the I/Q signal.
C/C++ declaration
int GetCurrentGain(uint32_t Channel,double *CurrentGain);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.CurrentGain[out] Pointer to a variable that receives the current gain in dB. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
If the AGC is enabled (using the IG35DDCDevice::SetAGC method), the variable pointed to by the CurrentGain parameter is filled by the current gain of the AGC. If the AGC is disabled, the variable pointed to by the CurrentGain parameter is filled by fixed gain that is specified using the IG35DDCDevice::SetGain method.
Sets bandwidth of the demodulator filter for given channel.
C/C++ declaration
int SetDemodulatorFilterBandwidth(uint32_t Channel,uint32_t Bandwidth);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Bandwidth[in] Specified the new bandwidth of the demodulator filter in Hz. Possible values are from the range of 1 Hz to the current DDC2 bandwidth. Use the IG35DDCDevice::GetDDC2 method to retrieve information about the current DDC type of DDC2.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The demodulator filter bandwidth can be changed using the IG35DDCDevice::SetDDC1 method. It can change DDC type of DDC2 and if the current demodulator filter bandwidth is greater than the new bandwidth of DDC2, the demodulator filter bandwidth is reduced. So it is useful to call the IG35DDCDevice::GetDemodulatorFilterBandwidth method immediately after IG35DDCDevice::SetDDC1.
Retrieves the current demodulator filter bandwidth for given channel.
C/C++ declaration
int GetDemodulatorFilterBandwidth(uint32_t Channel,uint32_t *Bandwidth);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Bandwidth[out] Pointer to a variable that receives the current demodulator filter bandwidth. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets the demodulator filter shift for given channel.
C/C++ declaration
int SetDemodulatorFilterShift(uint32_t Channel,int32_t Shift);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Shift[in] Specified the new shift of the demodulator filter in Hz.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Value of the Shift parameter is shift in Hz relative to center of the demodulator. This value can be negative.
This method does not change demodulator frequency, just shifts the filter from the demodulator's centre.
Use the IG35DDCDevice::GetDemodulatorFilterShift method to determine the current demodulator filter shift.
Retrieves the current shift of the demodulator filter for given channel.
C/C++ declaration
int GetDemodulatorFilterShift(uint32_t Channel,int32_t *Shift);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Shift[out] Pointer to a variable that receives the current shift of the demodulator. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Specifies the demodulator filter length for given channel. The demodulator filter is implemented as an FIR filter. This method specifies the number of coefficients used in the filtration procedure.
C/C++ declaration
int SetDemodulatorFilterLength(uint32_t Channel,uint32_t Length);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Length[in] Specifies the length of the demodulator filter. The value has to be a multiple of 64, greater than or equal to 64 and less than or equal to 32768. If it is not a multiple of 64, the method rounds it up to nearest a multiple of 64.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Increasing the filter length increases the filter steepness and may increase CPU usage.
Use the IG35DDCDevice::GetDemodulatorFilterLength method to determine the current length of the demodulator filter.
Retrieves the current length of the demodulator filter for given channel.
C/C++ declaration
int GetDemodulatorFilterLength(uint32_t Channel,uint32_t *Length);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Length[out] Pointer to a variable that receives the current demodulator filter length. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets the demodulator mode for given channel.
C/C++ declaration
int SetDemodulatorMode(uint32_t Channel,uint32_t Mode);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Mode[in] Specifies the new demodulator mode. This value can be one of the following:
Value Meaning G3XDDC_MODE_CW Continuous wave G3XDDC_MODE_AM Amplitude modulation G3XDDC_MODE_FM Frequency modulation G3XDDC_MODE_LSB Lower sideband modulation G3XDDC_MODE_USB Upper sideband modulation G3XDDC_MODE_AMS Amplitude modulation G3XDDC_MODE_DSB Double sideband modulation G3XDDC_MODE_ISB Independent sideband modulation
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Retrieves the current demodulator mode for given channel.
C/C++ declaration
int GetDemodulatorMode(uint32_t Channel,uint32_t *Mode);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Mode[out] Pointer to a variable that receives the current demodulator mode. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets the relative center frequency of the demodulator for given channel.
C/C++ declaration
int SetDemodulatorFrequency(uint32_t Channel,int32_t Frequency);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Frequency[in] Specifies the new center frequency of the demodulator in Hz.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The 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[i] = fDDC1 + frDDC2[i] + frDEM[i]
Where faDEM[i] is the absolute center frequency of the demodulator of i-th channel in Hz, fDDC1 is the center frequency of the DDC1 in Hz (set using the IG35DDCDevice::SetDDC1Frequency method), frDDC2[i] is the relative center frequency of DDC2 of i-th channel in Hz (set using the IG35DDCDevice::SetDDC2Frequency) and frDEM[i] is relative center frequency of the demodulator of i-th channel in Hz (set using SetDemodulatorFrequency).
The absolute center frequency of the demodulator is the real-world frequency that you are listening to.
Use the IG35DDCDevice::GetDemodulatorFrequency method to determine the current relative center frequency of the demodulator for given channel.
The following example shows four methods of how to set absolute demodulator center frequency of the channel 0 to 11.01 MHz:
IG35DDCDevice *Device; //Interface of G35DDC device object, created using the CreateInstance function //1. method Device->SetDDC1Frequency(11010000); Device->SetDDC2Frequency(0,0); Device->SetDemodulatorFrequency(0,0); //2. method, usable if DDC2 bandwidth is less than DDC1 bandwidth Device->SetDDC1Frequency(11000000); Device->SetDDC2Frequency(0,10000); Device->SetDemodulatorFrequency(0,0); //3. method, usable if DDC2 bandwidth is less than DDC1 bandwidth, //and demodulator filter bandwidth is less than DDC2 bandwidth Device->SetDDC1Frequency(11020000); Device->SetDDC2Frequency(0,-5000); Device->SetDemodulatorFrequency(0,-5000); //4. method Device->SetFrequency(0,11010000); //The SetFrequency method sets DDC1, DDC2 and demodulator //center frequencies so that demodulator's absolute frequency is set to the required frequency
Retrieves the current relative center frequency of the demodulator for given channel.
C/C++ declaration
int GetDemodulatorFrequency(uint32_t Channel,int32_t *Frequency);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Frequency[out] Pointer to a variable that receives the current center frequency of the demodulator. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets a parameter of the demodulation for given channel.
C/C++ declaration
int SetDemodulatorParam(uint32_t Channel,uint32_t Code,const void *Buffer,uint32_t BufferSize);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Code[in] Specifies the code of the demodulator parameter to be set by this method. The code can be one of the following:
Value Meaning G3XDDC_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).
Value of the variable pointed to by the Buffer parameter can be one of the following:
G3XDDC_SIDE_BAND_LOWER
AMS demodulator will use lower sidebandG3XDDC_SIDE_BAND_UPPER
AMS demodulator will use upper sidebandG3XDDC_SIDE_BAND_BOTH
AMS demodulator will use both side bands.G3XDDC_DEMODULATOR_PARAM_AMS_CAPTURE_RANGE Capture range of synchronous AM demodulator.
The Buffer parameter has to be a pointer to a G3XDDC_AMS_CAPTURE_RANGE structure, and the BufferSize parameter has to be sizeof(G3XDDC_AMS_CAPTURE_RANGE).
G3XDDC_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).
Value of the variable pointed to by the Buffer parameter is CW tone frequency in Hz.
G3XDDC_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).
Value of the variable pointed to by the Buffer parameter can be one of the following:
G3XDDC_SIDE_BAND_LOWER
DSB demodulator will use lower sidebandG3XDDC_SIDE_BAND_UPPER
DSB demodulator will use upper sidebandG3XDDC_SIDE_BAND_BOTH
DSB demodulator will use both side bands.G3XDDC_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).
Value of the variable pointed to by the Buffer parameter can be one of the following:
G3XDDC_SIDE_BAND_LOWER
ISB demodulator will use lower sidebandG3XDDC_SIDE_BAND_UPPER
ISB demodulator will use upper sidebandG3XDDC_SIDE_BAND_BOTH
ISB demodulator will use both side bands.Buffer[in] Pointer to a buffer containing the value of the demodulator parameter which this method will set. This parameter cannot be NULL.BufferSize[in] Specifies the size of the buffer.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Retrieves a parameter of the demodulation for given channel.
C/C++ declaration
int GetDemodulatorParam(uint32_t Channel,uint32_t Code,void *Buffer,uint32_t BufferSize);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Code[in] Specifies the code of the demodulator parameter to be retrieved. For detailed information about available codes see IG35DDCDevice::SetDemodulatorParam.Buffer[out] Pointer to a buffer that receives the requested parameter. This parameter cannot be NULL.BufferSize[in] Specifies the size of the buffer.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Retrieves information about the current demodulator state for given channel.
C/C++ declaration
int GetDemodulatorState(uint32_t Channel,uint32_t Code,void *Buffer,uint32_t BufferSize);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Code[in] Specifies the code of the demodulator state to be retrieved. The code can be one of the following:
Value Meaning G3XDDC_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).
Received value is non-zero if synchronous AM demodulator is locked to signal, and zero if it is not locked.
G3XDDC_DEMODULATOR_STATE_AMS_FREQUENCY Frequency in Hz which synchronous AM demodulator is locked to. It is relative to center of the demodulator. It can be negative.
The Buffer parameter has to be a pointer to a double variable, and the BufferSize parameter has to be sizeof(double).
G3XDDC_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).
G3XDDC_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).
Received value is non-zero if DSB demodulator is locked to signal, and zero if it is not locked.
G3XDDC_DEMODULATOR_STATE_DSB_FREQUENCY Frequency in Hz which DSB demodulator is locked to. It is relative to center of the demodulator. It can be negative.
The Buffer parameter has to be a pointer to a double variable, and the BufferSize parameter has to be sizeof(double).
G3XDDC_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).
Received value is difference between demodulator frequency and frequency of received signal. Subtract the returned tune error from demodulator frequency to get frequency of the received signal. Tune error is relative to center of the demodulator and it can be negative.
G3XDDC_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 that receives the requested information. This parameter cannot be NULL.BufferSize[in] Specifies the size of the buffer.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Starts audio streaming for given channel.
C/C++ declaration
int StartAudio(uint32_t Channel,uint32_t SamplesPerBuffer);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.SamplesPerBuffer[in] Specifies the number of samples in each buffer passed to the IG35DDCDeviceCallback::G35DDC_AudioStreamCallback callback method. The value has to be a multiple of 64 greater than zero. If it is zero, the StartAudio method fails. If it is not a multiple of 64, the method rounds it up to nearest a multiple of 64.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Before StartAudio is used, the G35DDC device has to be turned on using the IG35DDCDevice::SetPower method and DDC1 streaming has to be started using the IG35DDCDevice::StartDDC1 or IG35DDCDevice::StartDDC1Playback method and DDC2 streaming has to be started using the IG35DDCDevice::StartDDC2 method, otherwise StartAudio fails.
If the audio streaming for given channel is already running, StartAudio restarts it except the streaming was previously started with the same SamplesPerBuffer parameter. In this case StartAudio does nothing.
Use the IG35DDCDevice::StopAudio method to stop audio streaming.
Decreasing the value of the SamplesPerBuffer parameter decreases latency and may increase CPU usage. Increasing the value of the SamplesPerBuffer parameter increases latency and may decrease CPU usage.
Stops audio streaming for given channel.
C/C++ declaration
int StopAudio(uint32_t Channel);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
If audio streaming is not active, StopAudio does nothing.
If audio playback (started using the IG35DDCDevice::StartAudioPlayback method) is active, StopAudio stops it.
The IG35DDCDeviceCallback::G35DDC_AudioStreamCallback and IG35DDCDeviceCallback::G35DDC_AudioPlaybackStreamCallback callback methods are not called after StopAudio returns.
Starts audio playback for given channel. It allows to pass previously recorded audio samples to the processing chain instead of the samples from the demodulator.
C/C++ declaration
int StartAudioPlayback(uint32_t Channel,uint32_t SamplesPerBuffer);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.SamplesPerBuffer[in] Specifies the number of samples in each buffer passed to the IG35DDCDeviceCallback::G35DDC_AudioPlaybackStreamCallback callback to fill the buffer by the application and to the IG35DDCDeviceCallback::G35DDC_AudioStreamCallback callback methods. The value has to be a multiple of 64 greater than zero. If it is zero, the StartAudioPlayback method fails. If it is not a multiple of 64, the method rounds it up to nearest a multiple of 64.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The G35DDC device has to be turned on using IG35DDCDevice::SetPower method before use of StartDDC1Playback.
The StartDDC1Playback method stops audio streaming that was previously started by the IG35DDCDevice::StartAudio or IG35DDCDevice::StartAudioPlayback method and starts audio playback with new parameters.
Use the IG35DDCDevice::StopAudio method to stop audio playback.
Pauses audio playback for given channel.
C/C++ declaration
int PauseAudioPlayback(UINT23 Channel);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
If audio playback is not active or it is already paused, PauseAudioPlayback does nothing.
The IG35DDCDeviceCallback::G35DDC_AudioPlaybackStreamCallback and IG35DDCDeviceCallback::G35DDC_AudioStreamCallback callback methods can be called once after PauseAudioPlayback returns. Then they are not called until playback is resumed using the IG35DDCDevice::ResumeAudioPlayback method.
Resumes paused audio playback for given channel.
C/C++ declaration
int ResumeAudioPlayback(uint32_t Channel);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
If audio playback is not active or it is not paused, ResumeAudioPlayback does nothing.
Sets fixed audio gain for given channel.
C/C++ declaration
int SetAudioGain(uint32_t Channel,double Gain);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Gain[in] Specifies a new fixed audio gain in dB.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetAudioGain method to retrieve the current audio gain.
Retrieves the current fixed audio gain for given channel.
C/C++ declaration
int GetAudioGain(uint32_t Channel,double *Gain);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Gain[out] Pointer to a variable that receives the current fixed gain in dB. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Enabled or disables the audio filter for given channel.
C/C++ declaration
int SetAudioFilter(uint32_t Channel,int Enabled);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Enabled[in] Specifies whether to enable or disable the audio filter. If this parameter is non-zero, the filter is enabled. If the parameter is zero, the filter is disabled.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetAudioFiler method to retrieve the current state of the audio filter.
Retrieves the current state of the audio filter for given channel.
C/C++ declaration
int GetAudioFilter(uint32_t Channel,int *Enabled);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Enabled[out] Pointer to a variable that receives the current state of the audio filter. The value is non-zero if the filter is enabled and zero if it is disabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets the parameters of the audio filter for given channel.
C/C++ declaration
int SetAudioFilterParams(uint32_t Channel,uint32_t CutOffLow,uint32_t CutOffHigh,double Deemphasis);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.CutOffLow[in] Specifies the cut-off low frequency of the filter in Hz. This is the start frequency of filter's passband, it can be in the range of 0 to 23999 Hz. The value has to be less then the cut-off high frequency specified by the CutOffHigh parameter.CutOffHigh[in] Specifies the cut-off high frequency of the filter in Hz. This is the end frequency of filter's passband it can be in the range of 1 - 24000 Hz. The value has to be greater than the cut-off low frequency specified by the CutOffLow parameter.Deemphasis[in] Specifies the de-emphasis the filter in dB per octave. De-emphasis starts at cut-off low frequency of the filter. This value can be in the range -9.9 to 0.0 dB/octave. Zero means the de-emphasis is disabled.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Use the IG35DDCDevice::GetAudioFilerParams method to retrieve the current parameters of the audio filter.
Retrieves the current parameters of the audio filter for given channel.
C/C++ declaration
int GetAudioFilterParams(uint32_t Channel,uint32_t *CutOffLow,uint32_t *CutOffHigh,double *Deemphasis);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.CutOffLow[out] Pointer to a variable that 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 that 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 that receives the current de-emphasis setting of the filter. This parameter can be NULL if the application does not require this information.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Specifies the audio filter length for given channel. The audio filter is implemented as an FIR filter. This method specifies the number of coefficients used in the filtration procedure.
C/C++ declaration
int SetAudioFilterLength(uint32_t Channel,uint32_t Length);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Length[in] Specifies the length of the audio filter. The value has to be a multiple of 64, greater than or equal to 64 and less than or equal to 32768. If it is not a multiple of 64, the method rounds it up to nearest a multiple of 64.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Increasing the filter length increases the filter steepness and may increase CPU usage.
Use the IG35DDCDevice::GetAudioFilterLength method to determine the current length of the audio filter.
Retrieves the current audio filter length for given channel.
C/C++ declaration
int GetAudioFilterLength(uint32_t Channel,uint32_t *Length);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Length[out] Pointer to a variable that receives the current length of the audio filter. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets the audio volume for given channel.
C/C++ declaration
int SetVolume(uint32_t Channel,uint8_t Volume);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Volume[in] Specifies the new volume. The value can vary from 0 to 31, where 31 means maximum volume.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The G35DDC receiver has an audio output connector, the IG35DDCDevice::SetVolume method affects the audio signal level at this output (see also IG35DDCDevice::SetDAC).
Use the IG35DDCDevice::GetVolume method to retrieve the current volume.
Retrieve the current volume for given channel.
C/C++ declaration
int GetVolume(uint32_t Channel,uint8_t *Volume);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Volume[out] Pointer to a variable that receives the current volume. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Mutes or unmutes audio.
C/C++ declaration
int SetMute(uint32_t Channel,int Mute);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Mute[in] Specifies whether to mute or unmute audio. If this parameter is non-zero, the audio is muted. If the parameter is zero, the audio is unmuted.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The G35DDC receiver has an audio output connector, the IG35DDCDevice::SetMute method affects the audio signal at this output (see also IG35DDCDevice::SetDAC).
Use the IG35DDCDevice::GetMute method to retrieve the current mute state.
Retrieves the current mute state for given channel.
C/C++ declaration
int GetMute(uint32_t Channel,int *Mute);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Mute[out] Pointer to a variable that receives the current mute state. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Allows routing audio output of each channel to a DAC (Digital-to-analog converter). The DAC output is connected to the audio output connector of the receiver.
C/C++ declaration
int SetDAC(uint32_t DAC);
Parameters
DAC[in] Specifies which channel should be routed to the audio output connector.
Bit Meaning 0 If it is set, audio output of the channel 0 is routed to left channel of the audio output connector. 1 If it is set, audio output of the channel 0 is routed to right channel of the audio output connector. 2 If it is set, audio output of the channel 1 is routed to left channel of the audio output connector. 3 If it is set, audio output of the channel 1 is routed to right channel of the audio output connector. 4 If it is set, audio output of the channel 2 is routed to left channel of the audio output connector. 5 If it is set, audio output of the channel 2 is routed to right channel of the audio output connector. 6 - 31 Reserved. Must be zero. If several bits or all the bits (0 to 5) are set, audio outputs of selected channels are mixed and routed to the audio output connector.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Determines which channel (its audio output) is routed to audio output connector.
C/C++ declaration
int GetDAC(uint32_t *DAC);
Parameters
DAC[out] Pointer to a variable that receives a bitwise array which specifies which channel is routed to the audio output connector. For more information, see IG35DDCDevice::SetDAC. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Sets the absolute frequency of the demodulator for given channel.
C/C++ declaration
int SetFrequency(uint32_t Channel,uint32_t Frequency);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Frequency[in] Specifies the new absolute frequency of the demodulator in Hz.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The method sets DDC1, DDC2 and demodulator frequencies so that new absolute frequency of the demodulator is the required one.
The absolute frequency of the demodulator is given by the following formula:
faDEM[i] = fDDC1 + frDDC2[i] + frDEM[i]
Where faDEM[i] is the absolute center frequency of the demodulator of i-th channel in Hz, fDDC1 is the center frequency of the DDC1 in Hz (set using the IG35DDCDevice::SetDDC1Frequency method), frDDC2[i] is the relative center frequency of DDC2 of i-th channel in Hz (set using the IG35DDCDevice::SetDDC2Frequency) and frDEM[i] is relative center frequency of the demodulator of i-th channel in Hz (set using the IG35DDCDevice::SetDemodulatorFrequency method).
The absolute center frequency of the demodulator is the real-world frequency that you are listening to.
Use the IG35DDCDevice::GetFrequency method to retrieve the current absolute frequency of the demodulator.
Determines the absolute frequency of the demodulator for given channel.
C/C++ declaration
int GetFrequency(uint32_t Channel,uint32_t *Frequency);
Parameters
Channel[in] Specifies channel index. Possible values are: 0, 1, 2.Frequency[out] Pointer to a variable that receives the current absolute frequency of the demodulator. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Returned value of the variable pointed to by the Frequency parameter is sum of DDC1, DDC2 and demodulator relative frequency. For more information, see remarks of the IG35DDCDevice::SetFrequency method.
Determines compensation data for the frequency spectrum computed from DDC1 or DDC2 signal. It is used to convert relative amplitudes in dB to absolutes ones in dBm.
C/C++ declaration
int GetSpectrumCompensation(uint32_t CenterFrequency,uint32_t Width,float *Buffer,uint32_t Count);
Parameters
CenterFrequency[in] Specifies the absolute center frequency of requested compensation data in Hz.Width[in] Specifies the width of the requested compensation data in Hz.Buffer[out] Pointer to a buffer to be filled with compensation data. This parameter cannot be NULL.Count[in] Specifies the number of float items in the buffer pointed to by the Buffer parameter.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The following example shows how to use the GetSpectrumCompensation method in IG35DDCDeviceCallback::G35DDC_DDC2StreamCallback callback:
//Let the following is prototype of a function which computes FFT from I/Q signal stored in //the buffer pointed to be the Input parameter. Result is stored in complex form in the buffer //pointed to by the Output parameter. Size of the FFT is given be the Size parameter. //The example uses 2048 bins FFT. void FFT(float *Output,const float *Input,int Size); IG35DDCDevice *Device; //Interface to G35DDC device object uint32_t AbsDDC2Frequency; //Absolute frequency of the DDC2 int32_t RelDDC2Frequency; //Relative frequency of the DDC2 uint32_t DDC1Frequency; //DDC1 frequency G3XDDC_DDC_INFO DDC2Info; //Information about current DDC type of the DDC2 float FFTBuffer[2*2048]; //Buffer for FFT result float Compensation[2048]; //Buffer for compensation data uint32_t FirstBin,LastBin; //the first and last bins in the FFT of useful DDC2 band MY_CALLBACK_OBJECT MyCallbackObject; //User defined callback object implementing methods of IG35DDCDeviceCallback interface Code before... //Retrieve frequency of the DDC1 Device->GetDDC1Frequency(&DDC1Frequency); //Retrieve relative frequency of the DDC2 for channel 0 Device->GetDDC2Frequency(0,&RelDDC2Frequency); //Calculate absolute frequency of the DDC2 AbsDDC2Frequency=(int32_t)DDC1Frequency+RelDDC2Frequency; //Retrieve DDC type information of the DDC2 Device->GetDDC2(NULL,&DDC2Info); //Retrieve compensation data Device->GetSpectrumCompensation(AbsDDC2Frequency,DDC2Info.SampleRate,Compensation,2048); //In this case the Width parameter is equal to sample rate, because we need compensation data //for whole DDC2 band. //Compensation data have to be updated after change of absolute DDC2 frequency using //the IG35DDCDevice::SetDDC1Frequency or IG35DDCDevice::SetDDC2Frequency method. //In this case a mutual-exclusion synchronization method (for example critical section) should be used //if the Compensation buffer would be modified outside the G35DDC_DDC2StreamCallback callback. FirstBin=2048*(DDC2Info.SampleRate-DDC2Info.Bandwidth)/2/DDC2Info.SampleRate; LastBin=2048*(DDC2Info.SampleRate+DDC2Info.Bandwidth)/2/DDC2Info.SampleRate; //Register callback object Device->SetCallback(&MyCallbackObject); //Start DDC2 streaming for channel 0 //The SamplesPerBuffer parameter is set to 2048 which is size of the FFT to simplify //the example. Device->StartDDC2(0,2048); Code after... void MY_CALLBACK_OBJECT::G35DDC_DDC2StreamCallback(IG35DDCDevice *Device,uint32_t Channel,const float *Buffer,uint32_t NumberOfSamples) { uint32_t i; //Compute FFT FFT(FFTBuffer,Buffer,2048); //Converts complex FFT result to dB for(i=0;i<2048;i++) { FFTBuffer[i]=(float)(10.0*log10(FFTBuffer[i*2]*FFTBuffer[i*2]+FFTBuffer[i*2+1]*FFTBuffer[i*2+1])); } //Apply compensation data to get amplitudes in frequency spectrum in dBm for(i=0;i<2048;i++) { FFTBuffer[i]+=Compensation[i]; } //now the FFTBuffer contains amplitudes in dBm //Useful band starts at the bin given by the FirstBin variable //and ends at the bin given by the LastBin variable. }
Registers a user-defined callback object given by its interface. The API calls methods of the object to pass samples to the application. The object has to implement methods of the IG35DDCDeviceCallback interface.
C/C++ declaration
int SetCallback(IG35DDCDeviceCallback *Callback);
Parameters
Callback[in] Interface to a user-defined object to be registered as a callback object. If this parameter is NULL, the current callback object is unregistered, the API will not call any callback after SetCallback returns.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Returns a pointer to the current user-defined callback object.
C/C++ declaration
IG35DDCDeviceCallback* GetCallback(void);
Parameters
None
Return value
This method returns a pointer to the current user-defined callback object, previously set by the IG35DDCDevice::SetCallback method.
Retrieves the current internal temperature of the G35DDC device.
C/C++ declaration
int GetTemperature(uint32_t *Temperature);
Parameters
Temperature[out] Pointer to a variable that receives the current internal temperature in degrees of Celsius. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
The G35DDC device has to be turned on using the IG35DDCDevice::SetPower method before IG35DDCDevice::GetTemperature is used. Otherwise IG35DDCDevice::GetTemperature fails.
Retrieves the current error state of the G35DDC device.
C/C++ declaration
int GetDeviceState(uint32_t *State);
Parameters
State[out] Pointer to a variable that receives the current error state of the device. This parameter cannot be NULL. The value can be zero or G3XDDC_DEVICE_STATE_ERROR_HIGH_TEMP if critical temperature is detected and the device is turned off. In this case the application should call IG35DDCDevice::SetPower to turn off explicitly.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Enables or disables the test signal at the receiver's input, which allows testing of the entire signal and processing path.
C/C++ declaration
int SetBuiltInTest(int Enabled);
Parameters
Enabled[in] Specifies whether to enable or disable the built-in test. If this parameter is non-zero, the test signal is enabled. If the parameter is zero, the test signal is disabled.Test signal parameters:
Frequency Level 25 MHz ± 2 kHz -40 dBm ± 5 dB
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
Remarks
Built-in test is optional. If the receiver does not support built-in test, SetBuiltInTest fails. The following example shows how to determine that receiver supports built-in test:
G35DDC_DEVICE_INFO DeviceInfo; IG35DDCDevice *Device; //Interface of G35DDC device object, created using the CreateInstance function Device->GetDeviceInfo(&DeviceInfo,sizeof(DeviceInfo)); if(DeviceInfo.Flags & G35DDC_FLAGS_BIT) { //the receiver supports built-in test } else { //the receiver does not support built-in test }
Retrieves information about whether the test signal is enabled or not.
C/C++ declaration
int GetBuiltInTest(int *Enabled);
Parameters
Enabled[out] Pointer to a variable which receives information about the test signal state. If it is non-zero, test signal is enabled, if it is zero, test signal is not enabled. This parameter cannot be NULL.
Return value
If the method succeeds, the return value is non-zero.
If the method fails, the return value is zero. To get extended error information, check errno.
IG35DDCDeviceCallback interface is an interface of application-defined object that implements methods of the interface. The object is used to receive streamed buffers from the G35DDC device object. See IG35DDCDevice::SetCallback.
Each method of the interface is called in context of thread created by the API. If some shared data are accessed inside callback methods, it is recommended to use a mutual-exclusion synchronization method. The application should not call any G35DDC API function/method from the inside method of this interface, otherwise it can cause deadlock or the application can enter an unpredictable state.
It is called by the API to pass IF snapshots to the application. Sending of IF snapshots is started using the IG35DDCDevice::StartIF method.
C/C++ declaration
void G35DDC_IFCallback(IG35DDCDevice *Device,const int16_t *Buffer,uint32_t NumberOfSamples,uint16_t MaxADCAmplitude,uint32_t ADCSamplingRate);
Parameters
DeviceInterface of the device object which called the method.BufferPointer to the buffer which contains samples directly received from the ADC. Sample rate is 100 MHz, the sample is 16bit signed little endian.NumberOfSamplesSpecifies the number of samples in the buffer pointed to by the Buffer parameter. This is usually 65536.MaxADCAmplitudeSpecifies the maximum amplitude. Measurement of the maximum is started at the end of the previous snapshot to the current one. The possible value is 0 to 32767.ADCSamplingRateSpecifies the sample rate of the ADC in Hz. It can vary a little bit because of temperature instability.
It is called by the API to pass I/Q samples from DDC1 to the application. The DDC1 streaming can be started using the IG35DDCDevice::StartDDC1 or IG35DDCDevice::StartDDC1Playback method.
C/C++ declaration
void G35DDC_DDC1StreamCallback(IG35DDCDevice *Device,const void *Buffer,uint32_t NumberOfSamples,uint32_t BitsPerSample);
Parameters
DeviceInterface of the device object which called the method.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 IG35DDCDevice::SetDDC1 method. One I/Q sample set consists of two samples.NumberOfSamplesSpecifies the number of I/Q sample sets in the buffer pointed to by the Buffer parameter. This value is equal to value of the SamplesPerBuffer parameter of the IG35DDCDevice::StartDDC1 or IG35DDCDevice::StartDDC1Playback method.BitsPerSampleSpecifies the number of bits per sample. It is given by DDC type used for DDC1 and it can be 16 or 32. If it is 16, the sample is 16bit integer (32bits per I/Q sample set), signed, little endian, in the range of -32768 to 32767. If it is 32, the sample is 32bit integer (64bits per I/Q sample set), signed, little endian, in the range -2147483648 to 2147483647.
It is called by the API to fill the buffer with I/Q samples by the applcation. The DDC1 playback can be started using the IG35DDCDevice::StartDDC1Playback method.
C/C++ declaration
int G35DDC_DDC1PlaybackStreamCallback(IG35DDCDevice *Device,void *Buffer,uint32_t NumberOfSamples,uint32_t BitsPerSample);
Parameters
DeviceInterface of the device object which called the method.BufferPointer to the buffer to be filled with I/Q sample sets. Sample rate and bits per sample is given by used DDC type, see the IG35DDCDevice::SetDDC1 method.NumberOfSamplesSpecifies the number of I/Q sample sets to be stored to the buffer pointed to by the Buffer parameter. This value is equal to value of the SamplesPerBuffer parameter of the IG35DDCDevice::StartDDC1Playback method. If the application does not have requested number of sample sets, it has to fill the buffer with zeros. One I/Q sample set consists of two samples.BitsPerSampleSpecifies the number of bits per sample. It is given by DDC type used for DDC1 and it can be 16 or 32. If it is 16, the sample is 16bit integer (32bits per I/Q sample set), signed, little endian, in the range -32768 to 32767. If it is 32, the sample is 32bit integer (64bits per I/Q sample set), signed, little endian, in the range -2147483648 to 2147483647.
Return value
The application should return non-zero to continue playback. The application should return zero to stop the API to call G35DDC_DDC1PlaybackStreamCallback again. This does not stop DDC1 playback, it has to be done explicitly by the application calling the IG35DDCDevice::StopDDC1 method from the thread in which the device object was created using the CreateInstance function. IG35DDCDevice::StopDDC1 must not be called from inside the 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 IG35DDCDevice::StartDDC2 method.
C/C++ declaration
void G35DDC_DDC2StreamCallback(IG35DDCDevice *Device,uint32_t Channel,const float *Buffer,uint32_t NumberOfSamples);
Parameters
DeviceInterface of the device object which called the method.ChannelSpecifies channel index. It can be 0, 1, 2.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 IG35DDCDevice::GetDDC2 method to determine the current DDC type of the DDC2. Sample is 32bit IEEE float in the range -1.0 to 1.0. One I/Q sample set consists of two samples.NumberOfSamplesSpecifies the number of I/Q sample sets in the buffer pointed to by the Buffer parameter. This value is equal to value of the SamplesPerBuffer parameter of the IG35DDCDevice::StartDDC2 method.
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 IG35DDCDevice::StartDDC2 method.
C/C++ declaration
void G35DDC_DDC2PreprocessedStreamCallback(IG35DDCDevice *Device,uint32_t Channel,const float *Buffer, uint32_t NumberOfSamples,float SlevelPeak,float SlevelRMS);
Parameters
DeviceInterface of the device object which called the method.ChannelSpecifies channel index. It can be 0, 1, 2.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 IG35DDCDevice::GetDDC2 method to determine the current DDC type of the DDC2. Sample is 32bit IEEE float in the range -1.0 to 1.0. One I/Q sample set consists of two samples.NumberOfSamplesSpecifies the number of I/Q sample sets in the buffer pointed to by the Buffer parameter. This value is equal to value of the SamplesPerBuffer parameter of the IG35DDCDevice::StartDDC2 method.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 IG35DDCDevice::GetSignalLevel method.
It is called by the API to pass audio samples to the application. The audio streaming can be started using the IG35DDCDevice::StartAudio or IG35DDCDevice::StartAudioPlayback method.
C/C++ declaration
void G35DDC_AudioStreamCallback(IG35DDCDevice *Device,uint32_t Channel,uint32_t Type,const float *Buffer,uint32_t NumberOfSamples);
Parameters
DeviceInterface of the device object which called the method.ChannelSpecifies channel index. It can be 0, 1, 2.TypeSpecifies the type (stage) of audio samples stored in the buffer pointed to by the Buffer parameter. The value of this parameter can be one of the following:
Value Meaning 0 The buffer contains audio samples affected by audio gain (see IG35DDCDevice::SetAudioGain). 1 The buffer contains audio samples affected by audio gain and audio filter (see IG35DDCDevice::SetAudioGain and IG35DDCDevice::SetAudioFilter). 2 The buffer contains audio samples affected by audio gain, audio filter and volume (see IG35DDCDevice::SetAudioGain, IG35DDCDevice::SetAudioFilter, IG35DDCDevice::SetVolume and IG35DDCDevice::SetMute). BufferPointer to the buffer which contains samples of the audio signal. The signal is mono, sample rate is 48000 Hz, sample is 32bit IEEE float in the range -1.0 to 1.0.NumberOfSamplesSpecifies the number of samples stored in the buffer pointed to by the Buffer parameter. This value is equal to the value of the SamplesPerBuffer parameter of the IG35DDCDevice::StartAudio or IG35DDCDevice::StartAudioPlayback method.
It is called by the API to fill the buffer with audio samples by the application. The audio playback can be started using the IG35DDCDevice::StartAudioPlayback method.
C/C++ declaration
int G35DDC_AudioPlaybackStreamCallback(IG35DDCDevice *Device,uint32_t Channel,float *Buffer,uint32_t NumberOfSamples);
Parameters
DeviceInterface of the device object which called the method.ChannelSpecifies channel index. It can be 0, 1, 2.BufferPointer to the buffer to by filled with audio samples. The audio signal is mono, sample rate is 48000 Hz, sample is 32bit IEEE float in the range -1.0 to 1.0.NumberOfSamplesSpecifies the number of samples in the buffer pointed to by the Buffer parameter. This value is equal to the value of the SamplesPerBuffer parameter of the IG35DDCDevice::StartAudioPlayback method. If the application does not have requested number of samples, the application has to fill the buffer with zeros.
Return value
The application should return non-zero to continue playback. The application should return zero to stop the API to call G35DDC_AudioPlaybackStreamCallback again. This does not stop audio playback, it has to be done explicitly by the application calling the IG35DDCDevice::StopAudio method from the thread in which the device object was created using the CreateInstance function. IG35DDCDevice::StopAudio must not be called from inside the callback.
Contains information about the G35DDC 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; uint8_t EEPROMVersion; uint32_t Flags; uint32_t ChannelCount; uint32_t DDCTypeCount; } G35DDC_DEVICE_INFO; #pragma pack(pop
Members
DevicePathDevice system path in a null-terminated string. It is used to open the device using the object interface.InterfaceTypeDevice interface type. The value can be one of the following:
G3XDDC_INTERFACE_TYPE_PCIE
The device is connected to the computer via PCI express.G3XDDC_INTERFACE_TYPE_USB
The device is connected to the computer via USB.SerialNumberSerial number in null-terminated string.HWVersionVersion of the hardware.FWVersionVersion of the firmware.EEPROMVersionEEPROM structure version.FlagsHardware configuration flags can be a combination of the following values:
Value Meaning G35DDC_FLAGS_EXTERNAL_REFERENCE The device supports external reference. G35DDC_FLAGS_AUDIO_OUTPUT The device has an audio output connector. G35DDC_FLAGS_COHERENT The device supports coherent mode. G35DDC_FLAGS_BIT The device supports built-in test. ChannelCountNumber of channels.DDCTypeCountNumber of DDC types supported by the DDC1.
Contains information about the DDC type.
C/C++ declaration
#pragma pack(push,1) typedef struct { uint32_t SampleRate; uint32_t Bandwidth; uint32_t BitsPerSample; } G3XDDC_DDC_INFO; #pragma pack(pop
Members
SampleRateSample rate of 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.
Contains information about the AMS capture range.
C/C++ declaration
#pragma pack(push,1) typedef struct { uint32_t Tune; uint32_t Lock; } G3XDDC_AMS_CAPTURE_RANGE; #pragma pack(pop
Members
TuneInitial capture range in Hz.LockCapture range (in Hz) used when the AMS demodulator is locked.