|
Yate
|
Generic radio interface. More...
#include <yateradio.h>
Public Types | |
| enum | ErrorCode { NoError = 0 , Failure = (1 << 1) , HardwareIOError = (1 << 2) , NotInitialized = (1 << 3) , NotSupported = (1 << 4) , NotCalibrated = (1 << 5) , TooEarly = (1 << 6) , TooLate = (1 << 7) , OutOfRange = (1 << 8) , NotExact = (1 << 9) , DataLost = (1 << 10) , Saturation = (1 << 11) , RFHardwareFail = (1 << 12) , RFHardwareChange = (1 << 13) , EnvironmentalFault = (1 << 14) , InvalidPort = (1 << 15) , Pending = (1 << 16) , Cancelled = (1 << 17) , Timeout = (1 << 18) , HardwareNotAvailable = (1 << 19) , InsufficientSpeed = (1 << 20) , NoAutoRestartMask = HardwareNotAvailable | InsufficientSpeed , FatalErrorMask , ClearErrorMask , LocalErrorMask } |
| enum | Operation { PendingInitialize = 0 , PendingCount } |
Public Member Functions | |
| unsigned int | pollPending (unsigned int oper, unsigned int waitMs=0) |
| virtual unsigned int | getInterface (String &devicePath) const |
| virtual const RadioCapability * | capabilities () const |
| virtual unsigned int | initialize (const NamedList ¶ms=NamedList::empty())=0 |
| virtual unsigned int | setLoopback (const char *name=0) |
| virtual unsigned int | setParams (NamedList ¶ms, bool shareFate=true)=0 |
| virtual unsigned int | setDataDump (int dir=0, int level=0, const NamedList *params=0)=0 |
| virtual unsigned int | calibrate () |
| virtual unsigned int | setPorts (unsigned count)=0 |
| virtual unsigned int | status (int port=-1) const =0 |
| virtual void | clearErrors () |
| virtual unsigned int | send (uint64_t when, float *samples, unsigned size, float *powerScale=0)=0 |
| virtual unsigned int | recv (uint64_t &when, float *samples, unsigned &size)=0 |
| virtual unsigned int | read (uint64_t &when, RadioReadBufs &bufs, unsigned int &skippedBufs) |
| virtual unsigned int | getRxTime (uint64_t &when) const =0 |
| virtual unsigned int | getTxTime (uint64_t &when) const =0 |
| virtual unsigned int | setFreqOffset (float offs, float *newVal=0)=0 |
| virtual unsigned int | setSampleRate (uint64_t hz)=0 |
| virtual unsigned int | getSampleRate (uint64_t &hz) const =0 |
| virtual unsigned int | setFilter (uint64_t hz)=0 |
| virtual unsigned int | getFilterWidth (uint64_t &hz) const =0 |
| virtual unsigned int | setTxFreq (uint64_t hz)=0 |
| virtual unsigned int | getTxFreq (uint64_t &hz) const =0 |
| virtual unsigned int | setTxPower (unsigned dBm)=0 |
| virtual unsigned int | setRxFreq (uint64_t hz)=0 |
| virtual unsigned int | getRxFreq (uint64_t &hz) const =0 |
| virtual unsigned int | setTxGain1 (int val, unsigned port) |
| virtual unsigned int | setTxGain2 (int val, unsigned port) |
| virtual unsigned int | setRxGain1 (int val, unsigned port) |
| virtual unsigned int | setRxGain2 (int val, unsigned port) |
| virtual unsigned int | setGain (bool tx, int val, unsigned int port, int *newVal=0) const |
| virtual const String & | toString () const |
| virtual void | completeDevInfo (NamedList &p, bool full=false, bool retData=false) |
| virtual void | setError (NamedList &p, unsigned int code, const char *str=0) |
Public Member Functions inherited from RefObject | |
| RefObject () | |
| virtual | ~RefObject () |
| virtual void * | getObject (const String &name) const |
| virtual bool | alive () const |
| bool | ref () |
| bool | deref () |
| int | refcount () const |
| virtual void | destruct () |
Public Member Functions inherited from GenObject | |
| GenObject () | |
| virtual | ~GenObject () |
| virtual const String & | traceId () const |
| NamedCounter * | getObjCounter () const |
| NamedCounter * | setObjCounter (NamedCounter *counter) |
Public Member Functions inherited from DebugEnabler | |
| DebugEnabler (int level=TelEngine::debugLevel(), bool enabled=true) | |
| int | debugLevel () const |
| int | debugLevel (int level) |
| bool | debugEnabled () const |
| void | debugEnabled (bool enable) |
| const char * | debugName () const |
| bool | debugAt (int level) const |
| bool | debugChained () const |
| void | debugChain (const DebugEnabler *chain=0) |
| void | debugCopy (const DebugEnabler *original=0) |
Static Public Member Functions | |
| static const char * | errorName (int code, const char *defVal=0) |
| static const TokenDict * | errorNameDict () |
Static Public Member Functions inherited from RefObject | |
| static bool | alive (const RefObject *obj) |
| static bool | efficientIncDec () |
Static Public Member Functions inherited from GenObject | |
| static void * | getObject (const String &name, const GenObject *obj) |
| static bool | getObjCounting () |
| static void | setObjCounting (bool enable) |
| static NamedCounter * | getObjCounter (const String &name, bool create=true) |
| static ObjList & | getObjCounters () |
Protected Member Functions | |
| RadioInterface (const char *name) | |
| void | setPending (unsigned int oper, unsigned int code=Pending) |
Protected Member Functions inherited from RefObject | |
| virtual void | zeroRefs () |
| bool | resurrect () |
| virtual void | destroyed () |
Protected Member Functions inherited from DebugEnabler | |
| void | debugName (const char *name) |
Protected Attributes | |
| unsigned int | m_lastErr |
| unsigned int | m_totalErr |
| RadioCapability * | m_radioCaps |
Generic radio interface.
| enum ErrorCode |
Error code bit positions in the error code mask.
| enum Operation |
Operations Used to handle pending state
|
protected |
Constructor
| name | Interface name |
|
inlinevirtual |
Run internal calibration procedures and/or load calibration parmameters
|
inlinevirtual |
Retrieve radio capabilities
|
inlinevirtual |
Clear all error codes that can be cleared. Note the not all codes are clearable, like HW failures for example.
|
virtual |
Complete device info parameters
| p | Destination list |
| full | Put full device info |
| retData | True to set out pointer in destination, false to add name only |
|
inlinestatic |
Retrieve the error string associated with a specific code
| code | Error code |
| defVal | Optional default value to retrieve if not found |
References errorNameDict().
|
static |
|
pure virtual |
Get the actual anti-aliasing filter BW
| hz | Anti-aliasing filter value in Hertz |
|
inlinevirtual |
Retrieve the radio device path
| devicePath | Destination buffer |
|
pure virtual |
Readback actual receive frequency
| hz | Receive frequency value |
|
pure virtual |
Get the time of the data currently being received from the radio
| when | Destination buffer for requested radio time |
|
pure virtual |
Get the actual sample rate
| hz | Sample rate value in Hertz |
|
pure virtual |
Readback actual transmit frequency
| hz | Transmit frequency value |
|
pure virtual |
Get the time of the the data currently being sent to the radio
| when | Destination buffer for requested radio time |
|
pure virtual |
Initialize the radio interface. Any attempt to transmit or receive prior to this operation will return NotInitialized.
| params | Optional parameters list |
References NamedList::empty().
| unsigned int pollPending | ( | unsigned int | oper, |
| unsigned int | waitMs = 0 ) |
Poll for a pending operation
| oper | Operation to check |
| waitMs | Optional time (in milliseconds) to wait for operation completion |
|
virtual |
Receive the next available samples and associated timestamp. Compensate timestamp difference. Copy any valid data in the future to auxiliary buffers. Adjust the timestamp (no need for the caller to do it). Handles buffer rotation also. All sample counters (length/offset) are expected in sample periods.
| when | Input: current timestamp. Output: next read data timestamp |
| bufs | Buffers to use |
| skippedBufs | The number of skipped full buffers |
|
pure virtual |
Receive the next available samples and associated timestamp. All ports are received together in interleaved format. e.g: I0 Q0 I1 Q1 I2 Q2 I0 Q0 I1 Q1 I2 Q2, etc for a 3-port system. The method will wait for proper timestamp (to be at least requested timestamp). The caller must increase the timestamp after succesfull read. The method may return less then requested size.
| when | Input: current timestamp. Output: read data timestamp |
| samples | Destination buffer (array of 2 * size * ports floats, interleaved IQ) |
| size | Input: requested number of samples. Output: actual number of read samples |
|
pure virtual |
Send a frame of complex samples at a given time, interleaved IQ format. If there are gaps in the sample stream, the RadioInterface must zero-fill. All ports are sent together in interleaved format; example: I0 Q0 I1 Q1 I2 Q2 I0 Q0 I1 Q1 I2 Q2, etc for a 3-port system Block until the send is complete. Return TooEarly if the blocking time would be too long. Return TooLate if any of the block is in the past.
| when | Time to schedule the transmission |
| samples | Data to send (array of 2 * size * ports floats, interleaved IQ) |
| size | The number of sample periods in the samples array |
| powerScale | Optional pointer to power scale value |
|
pure virtual |
Update (set/reset) interface data dump
| dir | Direction to update. 0: both, negative: RX only, positive: TX only |
| level | Dump level to update. 0: both, negative: interface level (data sent/received by the upper layer), positive: device level (data sent to or read from radio device) |
| params | Optional parameters |
|
virtual |
Fill (set) error related parameters
| p | Destination list |
| code | Error code |
| str | Optional error string (not error name) |
|
pure virtual |
Set the anti-aliasing filter BW
| hz | Anti-aliasing filter value in Hertz |
|
pure virtual |
Set the frequency offset
| offs | Frequency offset to set |
| newVal | Optional pointer to value set by interface (requested value may be adjusted to fit specific device value) |
|
inlinevirtual |
Automatic tx/rx gain setting Set post mixer value. Return a value to be used by upper layer
| tx | Direction |
| val | Value to set |
| port | Port to use |
| newVal | Optional pointer to value to use for calculation by the upper layer |
|
inlinevirtual |
Set radio loopback
| name | Loopback name (NULL for none) |
|
pure virtual |
Set multiple interface parameters. Each command must start with 'cmd:' to allow the code to detect unhandled commands. Command sub-params should not start with the prefix
| params | Parameters list |
| shareFate | True to indicate all parameters share the fate (return on first error, except for Pending), false to process all |
|
inlineprotected |
Set pending state
| oper | Operation to set |
| code | Status code |
|
pure virtual |
Set the number of ports to be used
| count | The number of ports to be used |
|
pure virtual |
Set the receive frequency in Hz
| hz | Receive frequency value |
|
inlinevirtual |
Set the receive pre-mixer gain in dB wrt max
|
inlinevirtual |
Set the receive post-mixer gain in dB wrt max
|
pure virtual |
Set the sample rate
| hz | Sample rate value in Hertz |
|
pure virtual |
Set the transmit frequency in Hz
| hz | Transmit frequency value |
|
inlinevirtual |
Set the transmit pre-mixer gain in dB wrt max
|
inlinevirtual |
Set the transmit post-mixer gain in dB wrt max
|
pure virtual |
Set the output power in dBm. This is power per active port, compensating for internal gain differences.
| dBm | The output power to set |
|
pure virtual |
Return any persistent error codes. ("Persistent" means a condition of the radio interface itself, as opposed to a status code related to a specific method call)
| port | Port number to check, or -1 for all ports OR'd together |
|
virtual |