Common functions and Configurations
Base.close — Method
Close the USRP device (Rx or Tx mode) and release all associated objects
–- Syntax
close(uhd)
–- Input parameters
- uhd : UHD object [UHDBinding]
–- Output parameters
- []
Base.print — Function
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
- []
UHDBindings.getBufferSize — Method
" Returns the internal radio buffer size
UHDBindings.openUHD — Method
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]
UHDBindings.set_lib_path — Method
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")
UHDBindings.set_provider — Method
Change UHD driver provider. Support "yggdrasil" to use shipped jll file or "local" to use custom installed library setprovider("yggdrasil") or setprovider("local")
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
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
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
Receiver functions
UHDBindings.getError — Method
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]
UHDBindings.getTimestamp — Method
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]
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]
UHDBindings.recv! — Method
Get a single buffer from the USRP device, using the Buffer structure
–- Syntax
recv!(sig,radio;nbSamples=0,offset=0)
–- Input parameters
- sig : Complex signal to populate. One vector with a single Rx antenna [Array{Complex{Cfloat}}], one vector per antenna otherwise [Array{Array{Complex{Cfloat}}}]
- radio : UHD object [UHDRx]
- nbSamples : Number of samples to acquire (0 to fill the buffer)
- offset : Position in the buffer of the first written sample
–- Output parameters
- Position in the buffer after the last written sample
recv! does not allocate. A radio is read by one task at a time.
UHDBindings.recv — Method
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]
UHDBindings.restartStreamer — Method
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.
UHDBindings.uhd_usrp_create_stream — Method
Create and launch a streamer with dedicated parameters
Transmitter functions
UHDBindings.send — Function
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.