![]() |
PCR4200 API
|
API functions for the PCR4200 spectrum analyzers. More...
Go to the source code of this file.
Data Structures | |
struct | PCRDeviceDiagnostics |
Functions | |
PCR_API PCRStatus | pcrConnectDevice (int *handle, const char *hostAddr, const char *deviceAddr, uint16_t port) |
PCR_API PCRStatus | pcrPairDevice (int handle, const char *hostAddr, const char *deviceAddr, uint16_t port) |
PCR_API PCRStatus | pcrCloseDevice (int handle) |
PCR_API PCRStatus | pcrGetSerialNumber (int handle, int *serialNumber) |
PCR_API PCRStatus | pcrGetFirmwareVersion (int handle, int *major, int *minor, int *revision) |
PCR_API PCRStatus | pcrGetCalDate (int handle, uint32_t *lastCalDate) |
PCR_API PCRStatus | pcrGetDeviceDiagnostics (int handle, float *voltage, float *current, float *temperature) |
PCR_API PCRStatus | pcrGetFullDeviceDiagnostics (int handle, PCRDeviceDiagnostics *diagnostics) |
PCR_API PCRStatus | pcrSetLowPowerState (int handle) |
PCR_API PCRStatus | pcrSetReference (int handle, PCRReference reference) |
PCR_API PCRStatus | pcrGetReference (int handle, PCRReference *reference) |
PCR_API PCRStatus | pcrSetGPSTimebaseUpdate (int handle, PCRBool enabled) |
PCR_API PCRStatus | pcrGetGPSTimebaseUpdate (int handle, PCRBool *enabled) |
PCR_API PCRStatus | pcrGetGPSHoldoverInfo (int handle, PCRBool *usingGPSHoldover, uint64_t *lastHoldoverTime) |
PCR_API PCRStatus | pcrGetGPSState (int handle, PCRGPSState *state) |
pcrGetGPSState Determine the GPS lock state of the PCR4200. More... | |
PCR_API PCRStatus | pcrGetGPSInfo (int handle, PCRBool refresh, PCRBool *updated, int64_t *secSinceEpoch, double *latitude, double *longitude, double *altitude) |
PCR_API PCRStatus | pcrSetFanEnabled (int handle, PCRBool enabled) |
PCR_API PCRStatus | pcrGetFanEnabled (int handle, PCRBool *enabled) |
PCR_API PCRStatus | pcrSetFanSetPoint (int handle, float setPoint) |
PCR_API PCRStatus | pcrGetFanSetPoint (int handle, float *setPoint) |
PCR_API PCRStatus | pcrGetChannelCount (int handle, int *channelCount) |
PCR_API PCRStatus | pcrSetChannelConfig (int handle, int *enabled, int sweepChannel) |
PCR_API PCRStatus | pcrGetChannelConfig (int handle, int *enabled, int *sweepChannel) |
PCR_API PCRStatus | pcrSetChannelShared (int handle, int channel, PCRBool useSharedLO) |
PCR_API PCRStatus | pcrGetChannelShared (int handle, int channel, PCRBool *useSharedLO) |
PCR_API PCRStatus | pcrSetChannelFreq (int handle, int channel, double freqHz) |
PCR_API PCRStatus | pcrGetChannelFreq (int handle, int channel, double *freqHz) |
PCR_API PCRStatus | pcrSetChannelPhaseOffset (int handle, int channel, double phaseOffset) |
PCR_API PCRStatus | pcrGetChannelPhaseOffset (int handle, int channel, double *phaseOffset) |
PCR_API PCRStatus | pcrSetChannelDelay (int handle, int channel, double delay) |
PCR_API PCRStatus | pcrGetChannelDelay (int handle, int channel, double *delay) |
PCR_API PCRStatus | pcrSetSharedFreq (int handle, double freqHz) |
PCR_API PCRStatus | pcrGetSharedFreq (int handle, double *freqHz) |
PCR_API PCRStatus | pcrSetStreamDataType (int handle, PCRDataType dataType) |
PCR_API PCRStatus | pcrSetStreamFullScale (int handle, PCRBool fullScale) |
PCR_API PCRStatus | pcrSetStreamRefLevel (int handle, double refLevel) |
PCR_API PCRStatus | pcrSetStreamAtten (int handle, int atten) |
PCR_API PCRStatus | pcrSetStreamSampleRate (int handle, int decimation) |
PCR_API PCRStatus | pcrSetStreamBandwidth (int handle, double bandwidth) |
PCR_API PCRStatus | pcrSetStreamTriggerEdge (int handle, PCRTriggerEdge edge) |
PCR_API PCRStatus | pcrSetStreamMode (int handle, PCRStreamMode mode) |
PCR_API PCRStatus | pcrSetStreamLocalAddr (int handle, uint16_t port) |
PCR_API PCRStatus | pcrSetStreamVrtAddr (int handle, int channel, const char *dstAddr, uint16_t dstPort, uint64_t dstMACAddr) |
PCR_API PCRStatus | pcrSetStreamVrtChannelID (int handle, int channel, int streamID) |
PCR_API PCRStatus | pcrSetStreamVrtCntxInterval (int handle, PCRBool enabled, int interval) |
PCR_API PCRStatus | pcrSetStreamVrtEndianness (int handle, PCREndianness endianness) |
PCR_API PCRStatus | pcrSetSweepRefLevel (int handle, double refLevel) |
PCR_API PCRStatus | pcrSetSweepAtten (int handle, int atten) |
PCR_API PCRStatus | pcrSetSweepCenterSpan (int handle, double centerHz, double spanHz) |
PCR_API PCRStatus | pcrSetSweepStartStop (int handle, double startHz, double stopHz) |
PCR_API PCRStatus | pcrSetSweepCoupling (int handle, double rbw, double vbw, double sweepTime) |
PCR_API PCRStatus | pcrSetSweepDetector (int handle, PCRSweepDetector detector, PCRSweepVideoUnits videoUnits) |
PCR_API PCRStatus | pcrSetSweepScale (int handle, PCRSweepScale scale) |
PCR_API PCRStatus | pcrSetSweepWindow (int handle, PCRSweepWindow window) |
PCR_API PCRStatus | pcrSetVSGEnabled (int handle, PCRBool enabled) |
PCR_API PCRStatus | pcrSetVSGLevel (int handle, double level) |
PCR_API PCRStatus | pcrSetVSGPattern (int handle, void *iq, int len, PCRDataType dataType) |
PCR_API PCRStatus | pcrInitiate (int handle) |
PCR_API PCRStatus | pcrAbort (int handle) |
PCR_API PCRStatus | pcrStreamParameters (int handle, int *channelCount, double *sampleRate, double *bandwidth) |
PCR_API PCRStatus | pcrStreamCorrection (int handle, int channel, float *correction) |
PCR_API PCRStatus | pcrStreamRecv (int handle, void **buffers, int samples, int64_t *nsSinceEpoch, PCRBool purge, int *sampleLoss, int *samplesRemaining, double *triggers, int triggerBufSize) |
PCR_API PCRStatus | pcrSweepGetParameters (int handle, double *actualRBW, double *actualVBW, double *actualStartFreq, double *binSize, int *sweepSize) |
PCR_API PCRStatus | pcrGetSweep (int handle, float *sweep) |
PCR_API PCRStatus | pcrSweepStart (int handle) |
PCR_API PCRStatus | pcrSweepFinish (int handle, float *sweep) |
PCR_API PCRStatus | pcrNetworkConfigGetDeviceList (int *serials, int *deviceCount) |
PCR_API PCRStatus | pcrNetworkConfigOpenDevice (int *handle, int serialNumber) |
PCR_API PCRStatus | pcrNetworkConfigCloseDevice (int handle) |
PCR_API PCRStatus | pcrNetworkConfigGetMAC (int handle, char *mac) |
PCR_API PCRStatus | pcrNetworkConfigSetIP (int handle, const char *addr, PCRBool nonVolatile) |
PCR_API PCRStatus | pcrNetworkConfigGetIP (int handle, char *addr) |
PCR_API PCRStatus | pcrNetworkConfigSetPort (int handle, int port, PCRBool nonVolatile) |
PCR_API PCRStatus | pcrNetworkConfigGetPort (int handle, int *port) |
PCR_API const char * | pcrGetAPIVersion () |
PCR_API const char * | pcrGetErrorString (PCRStatus status) |
PCR_API PCRStatus | pcrWriteMessageToGPS (int handle, uint32_t key, uint64_t value, int valueSizeBytes) |
API functions for the PCR4200 spectrum analyzers.
This is the main file for user accessible functions for controlling the PCR4200 reciever.
#define PCR_MAX_DEVICES (4) |
Maximum number of device that can be interfaced by the API
#define PCR_DEFAULT_HOST_ADDR ("192.168.2.2") |
Convenience host address
#define PCR_DEFAULT_DEVICE_ADDR ("192.168.2.10") |
Default PCR IP address
#define PCR_DEFAULT_PORT (51665) |
Default PCR port
#define PCR_DEFAULT_STREAM_PORT (4991) |
Default streaming port
#define PCR_SWEEP_CHANNEL_DISABLED (-1) |
Used in pcrSetChannelConfig to indicate no sweep channel
#define PCR_AUTO_ATTEN (-1) |
Indicates the API should use the reference level to control sensitivity. Default
#define PCR_MAX_ATTEN (6) |
Valid attenuation values between [0, 6], or -1 for auto
#define PCR_MIN_FREQ (100.0e3) |
Minimum configurable frequency
#define PCR_MAX_FREQ (20.0e9) |
Maximum configurable frequency
#define PCR_SWEEP_MIN_SPAN (100.0) |
Minimum configurable sweep span
#define PCR_SWEEP_MIN_RBW (100.0) |
Minimum configurable sweep RBW
#define PCR_SWEEP_MAX_RBW (10.0e6) |
Maximum configurable sweep RBW
#define PCR_MIN_SWEEP_TIME (1.0e-6) |
Minimum configurable sweep time
#define PCR_MAX_SWEEP_TIME (1.0) |
Maximum configurable sweep time
#define PCR_MIN_REF_LVL (-130.0) |
Minimum configurable reference level, for sweeps and I/Q streaming
#define PCR_MAX_REF_LVL (20.0) |
Maximum configurable reference level, for sweeps and I/Q streaming
#define PCR_STREAM_SR (50.0e6) |
The maximum I/Q stream sample rate, decimation = 1
#define PCR_STREAM_MIN_DECIMATION (1) |
Minimum configurable I/Q stream decimation
#define PCR_STREAM_MAX_DECIMATION (256) |
Maximum configurable I/Q stream decimation
#define PCR_STREAM_MIN_BW (20.0e3) |
Minimum configurable I/Q stream bandwidth
#define PCR_STREAM_MAX_BW (40.0e6) |
Maximum configurable I/Q stream bandwidth
#define PCR_MIN_CNTX_INTERVAL (3) |
Minimum Vita49 stream mode context interval
#define PCR_MAX_CNTX_INTERVAL (4095) |
Maximum Vita49 stream mode context interval
#define PCR_VSG_MIN_LEVEL (-80.0) |
Minimum VSG output level (dBm)
#define PCR_VSG_MAX_LEVEL (10.0) |
Maximum VSG output level (dBm)
#define PCR_VSG_MAX_BUF_LEN (4096) |
Maximum VSG pattern buffer length (complex samples)
#define PCR_MIN_FAN_SETPOINT (5.0) |
Minimum fan setpoint in C
#define PCR_MAX_FAN_SETPOINT (60.0) |
Maximum fan setpoint in C
enum PCRBool |
enum PCRDataType |
Controls the I/Q data type returned from the pcrStreamRecv function.
Enumerator | |
---|---|
PCRDataType16sc | 16-bit interleaved complex integers. |
PCRDataType32fc | 32-bit interleaved complex floating point. |
enum PCRReference |
enum PCRGPSState |
enum PCREndianness |
enum PCRSweepDetector |
enum PCRSweepVideoUnits |
enum PCRSweepScale |
enum PCRSweepWindow |
enum PCRTriggerEdge |
enum PCRStreamMode |
Controls the I/Q stream mode. See I/Q Streaming Mode.
enum PCRStatus |
Status code returned from all PCR API functions.
PCR_API PCRStatus pcrConnectDevice | ( | int * | handle, |
const char * | hostAddr, | ||
const char * | deviceAddr, | ||
uint16_t | port | ||
) |
Attempts to connect to a device. If the device is opened successfully, a handle to the function will be returned through the device pointer. This handle can then be used to refer to this device for all future API calls. The device takes approximately 12 seconds to boot up after applying power. Until the device is booted, this function will return device not found. The PCR API does not set the SO_REUSEADDR socket option. For customers connecting multiple networked devices, we recommend specifying the hostAddr explicitly instead of using '0.0.0.0'. Especially for configurations that involve multiple subnets. If not done, devices beyond the first will likely not be found and this function will return an error.
[out] | handle | Returns handle that can be used to interface the device. Handle is only valid if this function returns successfully. |
[in] | hostAddr | Host interface IP on which the networked device is connected, provided as a string. An example parameter is '192.168.2.2'. |
[in] | deviceAddr | Target device IP provided as a string. If more than one device with this IP is connected to the host interface, the behavior is undefined. |
[in] | port | Target device port. |
PCR_API PCRStatus pcrPairDevice | ( | int | handle, |
const char * | hostAddr, | ||
const char * | deviceAddr, | ||
uint16_t | port | ||
) |
Pairs a secondary device to a primary device to create a multi-receiver system. The network parameters specified in this function are for the secondary device. The secondary device should not be connected by the API before calling this funciton. After this function returns successfully, the secondary device should not be opened separately via the pcrConnectDevice function, or be paired again.
See Multi-Receiver Operation for more information.
[in] | handle | Device on which the secondary unit will be paired. |
[in] | hostAddr | Host interface IP on which the networked device is connected, provided as a string. An example parameter is '192.168.2.2'. |
[in] | deviceAddr | Target device IP provided as a string. If more than one device with this IP is connected to the host interface, the behavior is undefined. |
[in] | port | Target device port. |
PCR_API PCRStatus pcrCloseDevice | ( | int | handle | ) |
Closes an open device. This function will release all resources for an open device. When this function completes the handle parameter will no longer point to a valid device. The device needs to be opened again to continue using. All devices should be closed prior to the process exiting, but is not strictly necessary.
If the handle refers to a primary device in a multi-receiver configuration, all devices in that system are closed.
[in] | handle | Device handle. |
PCR_API PCRStatus pcrGetSerialNumber | ( | int | handle, |
int * | serialNumber | ||
) |
Retreive the device serial number.
[in] | handle | Device handle. |
serialNumber | Pointer to integer which will contain 8 digit serial number if this function returns successfully. |
PCR_API PCRStatus pcrGetFirmwareVersion | ( | int | handle, |
int * | major, | ||
int * | minor, | ||
int * | revision | ||
) |
Get the firmware version of the device. The version is of the form 'major.minor.revision'.
[in] | handle | Device handle. |
[out] | major | Version return as integer. Can be NULL. |
[out] | minor | Version return as integer.. Can be NULL. |
[out] | revision | Version return as integer. Can be NULL. |
PCR_API PCRStatus pcrGetCalDate | ( | int | handle, |
uint32_t * | lastCalDate | ||
) |
Returns the calibration date of the device. This is the date the unit was factory adjusted. This value is primarily used for troubleshooting.
[in] | handle | Device handle. |
lastCalDate | Calibration date returned as seconds since epoch. |
PCR_API PCRStatus pcrGetDeviceDiagnostics | ( | int | handle, |
float * | voltage, | ||
float * | current, | ||
float * | temperature | ||
) |
Returns diagnostic information about a device.
[in] | handle | Device handle. |
[out] | voltage | Voltage returned in Volts. Can be NULL . |
[out] | current | Current returned in Amps. Can be NULL . |
[out] | temperature | Temperature returned as Celcius. Can be NULL . |
PCR_API PCRStatus pcrGetFullDeviceDiagnostics | ( | int | handle, |
PCRDeviceDiagnostics * | diagnostics | ||
) |
Returns extended diagnostic information.
[in] | handle | Device handle. |
diagnostics | Pointer to extended diagnostic struct. |
PCR_API PCRStatus pcrSetLowPowerState | ( | int | handle | ) |
Set the device into a lower power state. The device will typically consume ~30W in the low power state.
The device should be idle before calling this function. This function will fail silently otherwise.
See Low Power State for more information.
[in] | handle | Device handle. |
PCR_API PCRStatus pcrSetReference | ( | int | handle, |
PCRReference | reference | ||
) |
Set the receiver to use either the internal time base reference or use a 10MHz reference present on the 10MHz input port. The device must be in the idle state (call pcrAbort) for this function to take effect. If the function returns successfully, verify the new state with the pcrGetReference function.
[in] | handle | Device handle. |
[in] | reference | New reference state. |
PCR_API PCRStatus pcrGetReference | ( | int | handle, |
PCRReference * | reference | ||
) |
Get the current reference state.
[in] | handle | Device handle. |
[out] | reference | Current reference configuration. |
Set whether the GPS is allowed to discipline the timebased of the PCR. Disabled by default. This function must be called in an idle state. See Automatic GPS Timebase Discipline for more information.
[in] | handle | Device handle. |
[in] | enabled | True to enable GPS disciplining. |
Get the current auto GPS disciplining state.
handle | Device handle. |
enabled | Returns true if GPS disciplining enabled. |
PCR_API PCRStatus pcrGetGPSHoldoverInfo | ( | int | handle, |
PCRBool * | usingGPSHoldover, | ||
uint64_t * | lastHoldoverTime | ||
) |
Return information about the GPS holdover correction. Determine if a correction exists and when it was generated.
[in] | handle | Device handle. |
[out] | usingGPSHoldover | Returns whether the GPS holdover value is newer than the factory calibration value. To determine whether the holdover value is actively in use, you will need to use this function in combination with pcrGetGPSState. This parameter can be NULL. |
[out] | lastHoldoverTime | If a GPS holdover value exists on the system, return the timestamp of the value. Value is seconds since epoch. This parameter can be NULL. |
PCR_API PCRStatus pcrGetGPSState | ( | int | handle, |
PCRGPSState * | state | ||
) |
pcrGetGPSState Determine the GPS lock state of the PCR4200.
[in] | handle | Device handle |
[out] | state | Pointer to instance of PCRGPSState. |
PCR_API PCRStatus pcrGetGPSInfo | ( | int | handle, |
PCRBool | refresh, | ||
PCRBool * | updated, | ||
int64_t * | secSinceEpoch, | ||
double * | latitude, | ||
double * | longitude, | ||
double * | altitude | ||
) |
Acquire the latest GPS information. The GPS info is updated once per second at the PPS interval. This function can be called while measurements are active.
[in] | handle | Device handle. |
[in] | refresh | When set to true and the device is not in a streaming mode, the API will request the latest GPS information. Otherwise the last retrieved data is returned. |
[out] | updated | Will be set to true if the NMEA data has been updated since the last time the user called this function. Can be set to NULL. |
[out] | secSinceEpoch | Number of seconds since epoch as reported by the GPS NMEA sentences. Last reported value by the GPS. If the GPS is not locked, this value will be set to zero. Can be NULL. |
[out] | latitude | Latitude in decimal degrees. If the GPS is not locked, this value will be set to zero. Can be NULL. |
[out] | longitude | Longitude in decimal degrees. If the GPS is not locked, this value will be set to zero. Can be NULL. |
[out] | altitude | Altitude in meters. If the GPS is not locked, this value will be set to zero. Can be NULL. |
Enable the fan. See Fan Control.
[in] | handle | Device handle. |
[in] | enabled | True to enable fan. |
Return whether the fan is enabled.
[in] | handle | Device handle. |
[out] | enabled | Returns true if enabled. |
PCR_API PCRStatus pcrSetFanSetPoint | ( | int | handle, |
float | setPoint | ||
) |
Configures the temperature/fan setpoint. See Fan Control. The setpoint is clamped to PCR_MIN_FAN_SETPOINT and PCR_MAX_FAN_SETPOINT.
[in] | handle | Device handle. |
setPoint | New fan setpoint in C. |
PCR_API PCRStatus pcrGetFanSetPoint | ( | int | handle, |
float * | setPoint | ||
) |
Returns the configured fan setpoint.
[in] | handle | Device handle. |
[out] | setPoint | Returns the current fan setpoint in C. |
PCR_API PCRStatus pcrGetChannelCount | ( | int | handle, |
int * | channelCount | ||
) |
Helper function which returns the number of channels that can be configured. This is equal to the number of devices in the system * 4.
[in] | handle | Device handle. |
[out] | channelCount | Number of channels in system. |
PCR_API PCRStatus pcrSetChannelConfig | ( | int | handle, |
int * | enabled, | ||
int | sweepChannel | ||
) |
Configure the receiver channels. This function configures whether a channel will be enabled for measurements, and whether one of those channels will be used for sweeps.
[in] | handle | Device handle. |
[in] | enabled | An array of integers equal in length to the number of channels in the system. For each index in the array, a 0 or 1 indicates whether that channel will be enabled in the measurements. |
For example, enabling channels (zero-based) 0,2,3 or (one-based) 1,3,4, the array you provide to this parameter will look like [1,0,1,1]. If a channel is designated as the sweep channel, it must also be enabled in this list. Every channel enabled but not designated as the sweep channel will be an I/Q streaming channel.
[in] | sweepChannel | Specify a channel on which to perform sweeps. If no channel is to perform sweeps, pass PCR_SWEEP_CHANNEL_DISABLED(-1) to this parameter. |
PCR_API PCRStatus pcrGetChannelConfig | ( | int | handle, |
int * | enabled, | ||
int * | sweepChannel | ||
) |
Returns the current channel configuration.
[in] | handle | Device handle. |
[out] | enabled | A pointer to an array of integers, equal in size to the number of channels in the system. For each enabled channel, a 1 will be set in that index, otherwise if that channel is disabled, a zero will be set. For example, if channels (one-based) 1 & 2 are enabled, the array will be set to {1,1,0,0}. |
[out] | sweepChannel | Returns which channel (if enabled) is set as the sweeping channel. If no channel is set to sweep, -1 is returned. |
Set whether a specific channel should use the shared LO. This configuration is independent of whether or not the channel is enabled. This setting only affects channels enabled for I/Q streaming. A sweeping channel cannot use the shared LO.
[in] | handle | Device handle. |
[in] | channel | Channel between [0, channelCount-1]. |
[in] | useSharedLO | True to use shared LO. |
Returns whether a channel is configured to use the shared LO.
[in] | handle | Device handle. |
[in] | channel | Channel between [0, channelCount-1]. |
[out] | useSharedLO | Returns true if the specified channel is configured to use the shared LO. |
PCR_API PCRStatus pcrSetChannelFreq | ( | int | handle, |
int | channel, | ||
double | freqHz | ||
) |
Set a channel frequency. This frequency affects a channel that is configured for I/Q streaming and to use the independent LO (not shared). This setting persists independently of the other channel settings.
[in] | handle | Device handle. |
[in] | channel | Channel between [0, channelCount-1]. |
[in] | freqHz | Frequency of specified channel in Hz. |
PCR_API PCRStatus pcrGetChannelFreq | ( | int | handle, |
int | channel, | ||
double * | freqHz | ||
) |
Returns a channels configured frequency. This is the frequency of a channel that is configured for I/Q streaming and to use the independent LO.
[in] | handle | Device handle. |
[in] | channel | Channel between [0, channelCount-1]. |
[out] | freqHz | Returns the frequency of the specified channel in Hz. |
PCR_API PCRStatus pcrSetChannelPhaseOffset | ( | int | handle, |
int | channel, | ||
double | phaseOffset | ||
) |
Sets a fixed phase offset for a single channel. This offset is applied as a complex phase rotation on each sample. This offset can be used to provide phase alignment between multiple channels. The default offset for each channel is 0 radians.
See Phase Coherence and the Shared LO for more information.
[in] | handle | Device handle. |
[in] | channel | Channel between [0, channelCount-1]. |
[in] | phaseOffset | Sets a fixed phase offset to apply to the specified channel. This offset is only applied when streaming I/Q data. This offset is specified in radians. |
PCR_API PCRStatus pcrGetChannelPhaseOffset | ( | int | handle, |
int | channel, | ||
double * | phaseOffset | ||
) |
Get the phase offset current applied to a channel.
See Phase Coherence and the Shared LO for more information.
[in] | handle | Device handle. |
[in] | channel | Channel between [0, channelCount-1]. |
[out] | phaseOffset | Returns the phase offset set for the specified channel as radians. |
PCR_API PCRStatus pcrSetChannelDelay | ( | int | handle, |
int | channel, | ||
double | delay | ||
) |
Set a channels timing delay. This delay is specified as a fraction of a sample, and is applied as part of an interpolating FIR filter. This delay can be used as part of a system requiring high precision phase alignment between multiple channels.
See Phase Coherence and the Shared LO for more information.
[in] | handle | Device handle. |
[in] | channel | Channel between [0, channelCount-1]. |
[in] | delay | Delay specified as fraction of a sample. |
PCR_API PCRStatus pcrGetChannelDelay | ( | int | handle, |
int | channel, | ||
double * | delay | ||
) |
Retrieve a configured channels timing delay.
See Phase Coherence and the Shared LO for more information.
[in] | handle | Device handle. |
[in] | channel | Channel between [0, channelCount-1]. |
[out] | delay | Returns the delay as a fraction of a sample. |
PCR_API PCRStatus pcrSetSharedFreq | ( | int | handle, |
double | freqHz | ||
) |
Sets the frequency of the measurement to be used for all streaming I/Q channels that are using the shared LO. This frequency is also shared with the VSG.
[in] | handle | Device handle. |
[in] | freqHz | Frequency specified in Hz. |
PCR_API PCRStatus pcrGetSharedFreq | ( | int | handle, |
double * | freqHz | ||
) |
Retrieve the frequency of channels using the shared LO.
[in] | handle | Device handle. |
[out] | freqHz | Returns the frequency specified in Hz. |
PCR_API PCRStatus pcrSetStreamDataType | ( | int | handle, |
PCRDataType | dataType | ||
) |
Sets the I/Q stream data type. See I/Q Data Types for more information.
[in] | handle | Device handle. |
[in] | dataType | Data type. |
Sets whether the data returned is in the units of dBm or dBFS. This only applies for local streaming mode and 32-bit data types. 16-bit data types are always returned as full scale. Full scale is disabled by default.
[in] | handle | Device handle. |
[in] | fullScale | True if data should be returned as full scale. |
PCR_API PCRStatus pcrSetStreamRefLevel | ( | int | handle, |
double | refLevel | ||
) |
Set the reference level of the I/Q data streams. This reference level is used for all streaming channels. See Reference Level and Sensitivity for more information. If attenuation is not set to auto, this value is ignored.
[in] | handle | Device handle. |
[in] | refLevel | Reference level specified as dBm. |
PCR_API PCRStatus pcrSetStreamAtten | ( | int | handle, |
int | atten | ||
) |
Set the attenuation for the I/Q data streams. This applies to all streaming channels. See Reference Level and Sensitivity for more information. Attenuation is set to auto by default.
[in] | handle | Device handle. |
[in] | atten | Attenuation between [0,6], or -1 for auto (use reference level). |
PCR_API PCRStatus pcrSetStreamSampleRate | ( | int | handle, |
int | decimation | ||
) |
Set the sample rate for the I/Q data streams. This applies to all streaming channels. See I/Q Sample Rates for more information.
[in] | handle | Device handle. |
[in] | decimation | Sets the sample rate to 50MS/s / decimation. Decimation must be a power of 2, and must be between 1 and 256. |
PCR_API PCRStatus pcrSetStreamBandwidth | ( | int | handle, |
double | bandwidth | ||
) |
Set the streaming bandwidth. This setting applies to all streaming channels. See I/Q Sample Rates for more information.
[in] | handle | Device handle. |
[in] | bandwidth | Bandwidth specified in Hz. |
PCR_API PCRStatus pcrSetStreamTriggerEdge | ( | int | handle, |
PCRTriggerEdge | edge | ||
) |
Set the streaming external trigger edge. External triggers will appear only for the specified edges.
[in] | handle | Device handle. |
[in] | edge | Trigger edge. |
PCR_API PCRStatus pcrSetStreamMode | ( | int | handle, |
PCRStreamMode | mode | ||
) |
Set the I/Q stream mode. See I/Q Streaming Mode for more information.
[in] | handle | Device handle. |
[in] | mode | Mode. |
PCR_API PCRStatus pcrSetStreamLocalAddr | ( | int | handle, |
uint16_t | port | ||
) |
Set the I/Q streaming port used for local streaming. By default, it's set to
For multi-PCR systems, incrementing port values are used, for example, Primary Device : port N Secondary Device 1 : port N + 1 Secondary Device 2 : port N + 2 Etc.
See I/Q Streaming Mode for more information.
[in] | handle | Device handle. |
[in] | port | Network port. |
PCR_API PCRStatus pcrSetStreamVrtAddr | ( | int | handle, |
int | channel, | ||
const char * | dstAddr, | ||
uint16_t | dstPort, | ||
uint64_t | dstMACAddr | ||
) |
Set the destination network addess for the I/Q data in Vita49 streaming mode for all channels.
See I/Q Streaming Mode for more information.
[in] | handle | Device handle. |
[in] | channel | Channel between [0, channelCount-1]. |
[in] | dstAddr | IP address specified as a string, for example "192.168.3.10". |
[in] | dstPort | Network port. |
[in] | dstMACAddr | MAC address. |
PCR_API PCRStatus pcrSetStreamVrtChannelID | ( | int | handle, |
int | channel, | ||
int | streamID | ||
) |
Set the stream ID of the Vita49 stream. This is the ID returned in the streams context packet. Each channel will have it's own stream ID.
[in] | handle | Device handle. |
[in] | channel | Channel between [0, channelCount-1]. |
[in] | streamID | StreamID. |
Sets the interval for the context packets sent in Vita49 stream mode. All channels will adhere to the context interval.
[in] | handle | Device handle. |
[in] | enabled | Enables context packets. Enabled by default. |
[in] | interval | Sets the interval. 64 by default. |
PCR_API PCRStatus pcrSetStreamVrtEndianness | ( | int | handle, |
PCREndianness | endianness | ||
) |
Set the endianness of the Vita49 data. Vita49 data is big endian by default. Many modern PCs are little endian. A PC that is receiving and processing the Vita49 data may want to eliminate the need to change the byte ordering.
[in] | handle | Device handle. |
[in] | endianness | The endianness to use. |
PCR_API PCRStatus pcrSetSweepRefLevel | ( | int | handle, |
double | refLevel | ||
) |
The reference level controls the sensitivity of the receiver by setting the attenuation to optimize measurements for signals at or below the reference level. See Reference Level and Sensitivity for more information. Attenuation must be set to automatic (-1) to set reference level.
This function sets the reference level for sweeps only.
[in] | handle | Device handle. |
[in] | refLevel | Set the reference level of the receiver in dBm. |
PCR_API PCRStatus pcrSetSweepAtten | ( | int | handle, |
int | atten | ||
) |
Set the device attenuation. See Reference Level and Sensitivity for more information. Valid values for attenuation are between [0,6] representing between [0,30] dB of attenuation (5dB steps). Setting the attenuation to -1 tells the receiver to automatically choose the best attenuation value for the specified reference level selected. Setting attenuation to a non-auto value overrides the reference level selection. The header file provides the PCR_AUTO_ATTEN macro for -1.
This function sets the attenuation for sweeps only.
[in] | handle | Device handle. |
[in] | atten | Attenuation value between [-1,6]. |
PCR_API PCRStatus pcrSetSweepCenterSpan | ( | int | handle, |
double | centerHz, | ||
double | spanHz | ||
) |
Set the sweep center and span frequencies. The new configuration cannot cause the sweep to exceed the frequency range of the instrument. If that occurs, the settings will be clamped to the range of the instrument.
[in] | handle | Device handle. |
[in] | centerHz | Center frequency in Hz. |
[in] | spanHz | Span in Hz. |
PCR_API PCRStatus pcrSetSweepStartStop | ( | int | handle, |
double | startHz, | ||
double | stopHz | ||
) |
Set the sweep start and stop frequency. The new configuration cannot cause the sweep to exceed the frequency range of the instrument. If that occurs, the settings will be clamped to the range of the instrument.
[in] | handle | Device handle. |
[in] | startHz | Start frequency in Hz. |
[in] | stopHz | Stop frequency in Hz. |
PCR_API PCRStatus pcrSetSweepCoupling | ( | int | handle, |
double | rbw, | ||
double | vbw, | ||
double | sweepTime | ||
) |
Set sweep resolution and video bandwidth.
[in] | handle | Device handle. |
[in] | rbw | Resolution bandwidth in Hz. |
[in] | vbw | Video bandwidth in Hz. Cannot be greater than RBW. |
[in] | sweepTime | Suggest the total acquisition time of the sweep. Specified in seconds. This parameter is a suggestion and will ensure RBW and VBW are first met before increasing sweep time. |
PCR_API PCRStatus pcrSetSweepDetector | ( | int | handle, |
PCRSweepDetector | detector, | ||
PCRSweepVideoUnits | videoUnits | ||
) |
Set sweep detector.
[in] | handle | Device handle. |
[in] | detector | Sweep detector. |
[in] | videoUnits | Video processing units. |
PCR_API PCRStatus pcrSetSweepScale | ( | int | handle, |
PCRSweepScale | scale | ||
) |
Set the sweep mode output unit type.
[in] | handle | Device handle. |
[in] | scale | Sweep units. |
PCR_API PCRStatus pcrSetSweepWindow | ( | int | handle, |
PCRSweepWindow | window | ||
) |
Set sweep mode window function.
[in] | handle | Device handle. |
[in] | window | Window function. |
Enable/disable the VSG output. See VSG for more information.
[in] | handle | Device handle. |
[in] | enabled | True to enable. |
PCR_API PCRStatus pcrSetVSGLevel | ( | int | handle, |
double | level | ||
) |
Set the VSG output level.
[in] | handle | Device handle. |
[in] | level | Output level in dBm. |
PCR_API PCRStatus pcrSetVSGPattern | ( | int | handle, |
void * | iq, | ||
int | len, | ||
PCRDataType | dataType | ||
) |
Set the VSG output pattern. See VSG for more information
[in] | handle | Device handle. |
[in] | iq | The pattern supplied as complex values in the data type specified by dataType. |
[in] | len | The length of the pattern in complex samples. |
[in] | dataType | Specifies the data type of the provided pattern. Choices are 16-bit interleaved complex integers and 32-bit complex interleaved floating point values. |
PCR_API PCRStatus pcrInitiate | ( | int | handle | ) |
Start the measurement. At this point, all configuration routines must be completed. Any change to the measurement configuration after calling this function will not affect the measurement until the measurement is restarted.
This function can be called while the measurements are active, and it will have the affect of calling pcrAbort and pcrInitiate.
[in] | handle | Device handle. |
PCR_API PCRStatus pcrAbort | ( | int | handle | ) |
Stops the active measurement. All function calls to request data must be completed before calling this function. When this function returns, the device will be in an idle state.
[in] | handle | Device handle. |
PCR_API PCRStatus pcrStreamParameters | ( | int | handle, |
int * | channelCount, | ||
double * | sampleRate, | ||
double * | bandwidth | ||
) |
Retrieve the I/Q measurement parameters for an active I/Q stream. This function can only be called if the measurement is active.
[in] | handle | Device handle. |
[out] | channelCount | Returns the number of streaming channels. Can be NULL. |
[out] | sampleRate | The sample rate in Hz. Can be NULL. |
[out] | bandwidth | The bandwidth of the I/Q capture in Hz. Can be NULL. |
PCR_API PCRStatus pcrStreamCorrection | ( | int | handle, |
int | channel, | ||
float * | correction | ||
) |
Retrieve the I/Q correction factor for an active I/Q stream. Each channel will have it's own correction factor. See I/Q Data Types for more information.
[in] | handle | Device handle. |
[in] | channel | Channel between [0, channelCount-1]. |
[out] | correction | Amplitude correction used by the API to convert from full scale I/Q to amplitude corrected I/Q. |
PCR_API PCRStatus pcrStreamRecv | ( | int | handle, |
void ** | buffers, | ||
int | samples, | ||
int64_t * | nsSinceEpoch, | ||
PCRBool | purge, | ||
int * | sampleLoss, | ||
int * | samplesRemaining, | ||
double * | triggers, | ||
int | triggerBufSize | ||
) |
Retrieve one block of I/Q data as specified by the user. This function blocks until the data requested is available.
This function should only be used when in local I/Q stream mode.
[in] | handle | Device handle. |
[out] | buffers | Pointer to user allocated buffers to recieve data. buffers should point to an array of pointers, and that array should be equal to the number of active I/Q channels. Each pointer in that buffer should point to an array large enough to received the I/Q data specified by both the iqBufSize and iqDataType parameter. |
[in] | samples | Specifies the number of I/Q samples, per channel, to be retrieved. Must be greater than zero. |
[out] | nsSinceEpoch | Nanoseconds since epoch. The time of the first I/Q sample returned. Can be NULL. See GPS I/Q Time Stamping for more information. |
[in] | purge | When set to true, any buffered I/Q data in the API is purged before returned beginning the I/Q block acquisition. |
[out] | sampleLoss | Set by the API when a sample loss condition occurs. If enough I/Q data has accumulated in the internal API circular buffer, the buffer is cleared and the sample loss flag is set. If purge is set to true, the sample flag will always be set to false. Can be NULL. |
[out] | samplesRemaining | Set by the API, returns the number of samples remaining in the internal I/Q circular buffer. Can be NULL. |
[out] | triggers | Pointer to user allocated array of trigger indices. The buffer must be at least triggerBufSize contiguous doubles. The pointer can also be NULL to indicate you do not wish to receive external trigger information. See I/Q Streaming section for more information on triggers. |
[in] | triggerBufSize | Specifies the size of the triggersr array. If the triggers array is NULL, this value should be zero. |
PCR_API PCRStatus pcrSweepGetParameters | ( | int | handle, |
double * | actualRBW, | ||
double * | actualVBW, | ||
double * | actualStartFreq, | ||
double * | binSize, | ||
int * | sweepSize | ||
) |
Retrieves the sweep parameters for an active sweep measurement. This function can only be called if the measurement is active.
[in] | handle | Device handle. |
[out] | actualRBW | Returns the RBW being used in Hz. Can be NULL. |
[out] | actualVBW | Returns the VBW being used in Hz. Can be NULL. |
[out] | actualStartFreq | Returns the frequency of the first bin in Hz. Can be NULL. |
[out] | binSize | Returns the frequency spacing between each frequency bin in the sweep in Hz. |
[out] | sweepSize | Returns the length of the sweep (number of frequency bins). Can be NULL. |
PCR_API PCRStatus pcrGetSweep | ( | int | handle, |
float * | sweep | ||
) |
Perform a single sweep. Block until the sweep completes. Internally, this function is implemented as calling pcrSweepStart followed by pcrSweepFinish. Do not mix calls to this function and the asynchronous versions.
[in] | handle | Device handle. |
[out] | sweep | Pointer to array equal in length to the sweep size. |
PCR_API PCRStatus pcrSweepStart | ( | int | handle | ) |
Start a sweep. If successful, this function returns immediately.
[in] | handle | Device handle. |
PCR_API PCRStatus pcrSweepFinish | ( | int | handle, |
float * | sweep | ||
) |
Finish a previously started queued sweep. Blocks until the sweep completes.
[in] | handle | Device handle. |
[out] | sweep | Pointer to array equal in length to the sweep size. |
PCR_API PCRStatus pcrNetworkConfigGetDeviceList | ( | int * | serials, |
int * | deviceCount | ||
) |
This function is part of a group of functions used to configure the network settings of the device over the USB 2.0 port. The handle used for these functions can only be used with the other network config functions.
[out] | serials | Array of ints. Must be as big as deviceCount. Returns a list of all PCR devices connected to the PC over USB. |
[in,out] | deviceCount | Point to int that contains the size of the serials array. When the function returns it will contain the number of devices returned. |
PCR_API PCRStatus pcrNetworkConfigOpenDevice | ( | int * | handle, |
int | serialNumber | ||
) |
This function is part of a group of functions used to configure the network settings of the device over the USB 2.0 port. The handle used for these functions can only be used with the other network config functions.
[out] | handle | If successful, handle will return an integer handle that can be used to configure the network configuration through the pcrNetworkConfig*** functions. |
[in] | serialNumber | Serial number of the device to open. A list of connected serial numbers can be retrieved from the pcrNetworkConfigGetDeviceList function. |
PCR_API PCRStatus pcrNetworkConfigCloseDevice | ( | int | handle | ) |
This function is part of a group of functions used to configure the network settings of the device over the USB 2.0 port. The handle used for these functions can only be used with the other network config functions.
Closes the device and frees any resources. The handle should be closed before interfacing the device through the main API interface.
[in] | handle | Device handle returned from pcrNetworkConfigOpenDevice. |
PCR_API PCRStatus pcrNetworkConfigGetMAC | ( | int | handle, |
char * | mac | ||
) |
This function is part of a group of functions used to configure the network settings of the device over the USB 2.0 port. The handle used for these functions can only be used with the other network config functions.
Retrieve the device MAC address.
[in] | handle | Device handle returned from pcrNetworkConfigOpenDevice. |
[out] | mac | Pointer to char buffer, to contain the null terminated MAC address string of the unit, with the following format “XX-XX-XX-XX-XX-XX”. Must be large enough to accommodate this string including null termination. |
This function is part of a group of functions used to configure the network settings of the device over the USB 2.0 port. The handle used for these functions can only be used with the other network config functions.
Set device IP address.
[in] | handle | Device handle returned from pcrNetworkConfigOpenDevice. |
[in] | addr | pointer to char buffer, to contain the null terminated IP address string of the form “xxx.xxx.xxx.xxx”. For functions retrieving the IP address, the buffer must be large enough to hold this string including null termination. |
[in] | nonVolatile | When set to true, setting applied will be written to internal flash, which will persist through a device power cycle. |
PCR_API PCRStatus pcrNetworkConfigGetIP | ( | int | handle, |
char * | addr | ||
) |
This function is part of a group of functions used to configure the network settings of the device over the USB 2.0 port. The handle used for these functions can only be used with the other network config functions.
Get the device IP address.
[in] | handle | Device handle returned from pcrNetworkConfigOpenDevice. |
[out] | addr | pointer to char buffer, to contain the null terminated IP address string of the form “xxx.xxx.xxx.xxx”. For functions retrieving the IP address, the buffer must be large enough to hold this string including null termination. |
This function is part of a group of functions used to configure the network settings of the device over the USB 2.0 port. The handle used for these functions can only be used with the other network config functions.
Set the device network port number.
[in] | handle | Device handle returned from pcrNetworkConfigOpenDevice. |
[out] | port | Port number. |
[in] | nonVolatile | When set to true, setting applied will be written to internal flash, which will persist through a device power cycle. |
PCR_API PCRStatus pcrNetworkConfigGetPort | ( | int | handle, |
int * | port | ||
) |
This function is part of a group of functions used to configure the network settings of the device over the USB 2.0 port. The handle used for these functions can only be used with the other network config functions.
Get the device network port number.
[in] | handle | Device handle returned from pcrNetworkConfigOpenDevice. |
[out] | port | Port number. |
PCR_API const char * pcrGetAPIVersion | ( | ) |
Get the API version.
major.minor.revision
Ascii periods ('.') separate positive integers. Major/minor/revision are not guaranteed to be a single decimal digit. The string is null terminated. The string should not be modified or freed by the user. An example string is below…
['3' | '.' | '0' | '.' | '1' | '1' | '\0'] = "3.0.11"
PCR_API const char * pcrGetErrorString | ( | PCRStatus | status | ) |
Retrieve a descriptive string of a SmStatus enumeration. Useful for debugging and diagnostic purposes.
[in] | status | Status code returned from any API function. |
PCR_API PCRStatus pcrWriteMessageToGPS | ( | int | handle, |
uint32_t | key, | ||
uint64_t | value, | ||
int | valueSizeBytes | ||
) |
Set a custom key value pair for the U-blox F9 GPS Reciever
[in] | handle | Device handle returned from pcrNetworkConfigOpenDevice. |
[in] | key | Key used for configuring the F9 GPS Reciever |
[in] | value | Value used for configuring the F9 GPS Reciever |
[in] | valueSizeBytes | Size of the field being configured in bytes |