Common functions and Configurations

Base.closeMethod

Close the USRP device (Rx or Tx mode) and release all associated objects

–- Syntax

close(uhd)

–- Input parameters

  • uhd : UHD object [UHDBinding]

–- Output parameters

  • []
source
Base.printFunction

Print the radio configuration

–- Syntax

print(radio,chan=0)

–- Input parameters

  • radio : UHD object [Union{UHDBinding,UHDTx,UHDRx}]
  • chan : Channel index to display (default 0)

–- Output parameters

  • []
source
UHDBindings.openUHDMethod

Init the core parameter of the radio in Tx or in Rx mode and initiate RF parameters

–- Syntax

openUHD(mode,sysImage,carrierFreq,samplingRate,txGain,antenna="RX2")

–- Input parameters

  • mode : String to open radio in "Tx" (transmitter) or in "Rx" (receive) mode
  • carrierFreq : Desired Carrier frequency [Union{Int,Float64}]
  • samplingRate : Desired bandwidth [Union{Int,Float64}]
  • gain : Desired Gain [Union{Int,Float64}]
  • antenna : Desired Antenna alias Dict{Symbol,Vector[String]} (e.g. Dict(:Rx=>["RX2"],:Tx=>["TRX"]))

Keywords=

  • args : String with the additionnal load parameters (for instance, path to the FPHGA image) [String]

–- Output parameters

  • uhd : UHD object [UHDBinding]
source
UHDBindings.set_lib_pathMethod

Set the path for the UHD shared library (e.g /Documents/Program/UHD/libuhd.dll or /opt/local/uhd/uhd.lib") Usefull for custom installation without messing up the PATHs Example= setlibpath("C://Program/UHD/bin/libUHD.dll")

source
UHDBindings.set_providerMethod

Change UHD driver provider. Support "yggdrasil" to use shipped jll file or "local" to use custom installed library setprovider("yggdrasil") or setprovider("local")

source
UHDBindings.updateCarrierFreq!Function

Update carrier frequency of current radio device, and update radio object with the new obtained carrier frequency. If the input parameter is the UHDBinding object, the desired carrier frequency will be applied on both Rx and Tx sides. If the input is a [UHDRx] or a [UHDTx] object, it updates only the Rx or Tx carrier frequency

–- Syntax

updateCarrierFreq!(radio,carrierFreq)

–- Input parameters

  • radio : UHD device [Union{UHDBinding,UHDRx,UHDTx}]
  • carrierFreq : New desired carrier frequency
  • chan : Channel index to use (default 0)

–- Output parameters

source
UHDBindings.updateGain!Function

Update gain of current radio device, and update radio object with the new obtained gain. If the input parameter is the UHDBinding object, the desired gain will be applied on both Rx and Tx sides. If the input is a [UHDRx] or a [UHDTx] object, it updates only the Rx or Tx gain

–- Syntax

updateGain!(radio,gain)

–- Input parameters

  • radio : UHD device [Union{UHDBinding,UHDRx,UHDTx}]
  • gain : New desired gain
  • chan : Channel index to use (default 0)

–- Output parameters

source
UHDBindings.updateSamplingRate!Function

Update sampling rate of current radio device, and update radio object with the new obtained sampling frequency. If the input parameter is the UHDBinding object, the desired sampling frequency will be applied on both Rx and Tx sides. If the input is a [UHDRx] or a [UHDTx] object, it updates only the Rx or Tx sampling frequency

–- Syntax

updateSamplingRate!(radio,samplingRate,chan=0)

–- Input parameters

  • radio : UHD device [Union{UHDBinding,UHDRx,UHDTx}]
  • samplingRate : New desired sampling rate
  • chan : Channel index to use (default 0)

–- Output parameters

source

Receiver functions

UHDBindings.getErrorMethod

Returns the Error flag of the current UHD burst

–- Syntax

flag = getError(radio)

–- Input parameters

  • radio : UHD object [UHDRx]

–- Output parameters

  • err : Error Flag [errorcodet]
source
UHDBindings.getTimestampMethod

Return the timestamp of the last UHD burst

–- Syntax

(second,fracSecond) = getTimestamp(radio)

–- Input parameters

  • radio : UHD UHD object [UHDRx]

–- Output parameters

  • second : Second value for the flag [Int]
  • fracSecond : Fractional second value [Float64]
source
UHDBindings.populateBuffer!Function

Calling UHD function wrapper to fill a buffer. It is preferable to cal this function though the use of recv or recv!

–- Syntax

recv!(sig,radio,nbSamples)

–- Input parameters

  • radio : UHD object [UHDRx]
  • ptr : Writable memory position [Ref{Ptr{Cvoid}}]
  • nbSamples : Number of samples to acquire

–- Output parameters

  • nbSamp : Number of samples fill in buffer [Csize_t]
source
UHDBindings.recv!Method

Get a single buffer from the USRP device, using the Buffer structure

–- Syntax

recv!(sig,radio,nbSamples)

–- Input parameters

  • sig : Complex signal to populate [Array{Complex{Cfloat}}]
  • radio : UHD object [UHDRx]
  • buffer : Buffer object (obtained with setBuffer(radio)) [Buffer]

–- Output parameters

source
UHDBindings.recvMethod

Get a single buffer from the USRP device, and create all the necessary ressources

–- Syntax

sig = recv(radio,nbSamples)

–- Input parameters

  • radio : UHD object [UHDRx]
  • nbSamples : Desired number of samples [Int]

–- Output parameters

  • sig : baseband signal from radio [Array{Complex{CFloat}},radio.packetSize]
source
UHDBindings.restartStreamerMethod

Restart the USRP streamer. In some cases (especially macOS) we have an issue with streamer congestion and we need to restart it. By now, we have added the restart function in recv! method.

source

Transmitter functions

UHDBindings.sendFunction

Send a buffer though the radio device. It is possible to force a cyclic buffer send (the radio uninterruply send the same buffer) by setting the cyclic parameter to true

–- Syntax

send(radio,buffer,cyclic=false)

–- Input parameters

  • radio : UHD device [UHDRx]
  • buffer : Buffer to be send [Union{Array{Complex{Cfloat}},Array{Cfloat}}]
  • cyclic : Send same buffer multiple times (default false) [Bool]

–- Output parameters

  • nbEch : Number of samples effectively send [Csize_t]. It corresponds to the number of complex samples sent.
source