RadioTestLibrary
1.34.0
|
#include <rtl_device.h>
Data Structures | |
struct | DeviceInfo_t |
struct | PacketData_t |
struct | TestConfig_t |
struct | TestResult_t |
Public Types | |
enum | TEST_MODE { TM_CONT_TX, TM_CONT_RX, TM_PACKET_TX, TM_PACKET_RX } |
enum | TEST_RESULT { TST_OK, TST_FAILED, TST_PKT_RECEIVED, TST_PKT_RX_BUF_OVERFLOW, TST_UNKNOWN } |
enum | TEST_STATE { STATE_DAL, STATE_FPL } |
Public Member Functions | |
RTLDevice (void) | |
virtual | ~RTLDevice (void) |
virtual int | addDynamicOverride (const QString &devId, const QString &type, const QString &value, const QString &id)=0 |
virtual int | removeDynamicOverride (const QString &devId, const QString &id)=0 |
virtual void | appendError (const QString &error) |
Append error. More... | |
virtual void | clearAllErrors (void) |
Clear errors. More... | |
virtual int | connect (const QString rfDevName, const QString &devId) |
Connect to target device. More... | |
virtual int | deleteFileObject (FPLFile *pFplFile) |
Delete file Object. More... | |
virtual int | disconnect (const QString &devId) |
Disconnect target device. More... | |
virtual int | doLinkTest (const QString &txId, const QString &rxId, TestResult_t *pTestResult)=0 |
virtual QStringList | enumerateEbs (bool enableXdsDev=false) |
Enumerate EB devices. More... | |
virtual QString | getRfDevNameFromDevId (const QString devId) |
Get RF Device name from Device ID. More... | |
virtual int | eraseFlash (const QString &devName, const QString &devId, EraseInfo_t *pEraseInfo=NULL, FPLFile *pFile=NULL)=0 |
virtual int | executeCmd (const QString &devId, const QString &cmdName) |
Execute command. More... | |
virtual int | getAverageRssi (void) |
virtual QString | getLastError (void) |
Get last error. More... | |
virtual QString | getRfState (const QString &devId) |
Get RF State. More... | |
virtual int | getRssi (const QString &devId, QString *pRssiInDbm, QString *pRssiRaw) |
Get RSSI. More... | |
virtual int | initPacketTx (const QString rfDevName, const QString &devId) |
Initialize Packet TX. More... | |
virtual bool | isConnected (const QString &devId) |
virtual int | isPacketReceived (const QString rfDevName, const QString &devId) |
Is Packet Received. More... | |
virtual int | programFlash (const QString &devName, const QString &devId, FPLFile *pFplFile, ProgramInfo_t *pProgInfo=NULL)=0 |
virtual int | programFlash (const QString &devName, const QString &devId, const quint32 &address, const quint32 &length, quint8 *pBuffer)=0 |
virtual int | readCmdSettingsFromFile (const QString &devId, TestConfig_t &testConfig)=0 |
virtual FPLFile * | readFile (const QString &devName, const QString &devId, const QString &fileName, const quint32 &startAddress=0) |
Read File. More... | |
virtual int | readFrequencyOffset (const QString &devId, TestResult_t *pTestResult) |
virtual int | readFrequencyOffsetCW (const QString &devId, TestResult_t *pTestResult) |
virtual int | readPacket (const QString rfDevName, const QString &devId, PacketData_t *pPacketData) |
Read Packet. More... | |
virtual int | readMcuReg (const QString &devId, const quint32 &address, quint32 *pValue)=0 |
virtual int | readMemory (const QString &devName, const QString &devId, const quint32 &address, quint32 *pLength, quint8 *pBuffer)=0 |
virtual int | readRfReg (const QString &devId, const quint32 &address, quint32 *pValue)=0 |
virtual int | resetTarget (const QString rfDevName, const QString &devId, RESET_MODE mode) |
Reset Target device. More... | |
virtual int | sendPacket (const QString rfDevName, const QString &devId) |
Send Packet. More... | |
virtual int | setParameter (const QString &devId, const QString &parName, const QString &parValue) |
Set Parameter. More... | |
virtual void | setPacketData (char *pPayload, int len) |
Set packet Data. More... | |
virtual int | setPacketInterval (const QString &devId, const int &interval) |
Set Packet interval. More... | |
virtual void | setNbrOfPackets (int n) |
virtual int | setIdle (const QString rfDevName, const QString &devId) |
Set device in Idle. More... | |
virtual int | startContTx (const QString rfDevName, const QString &devId, TestResult_t *pTestResult) |
Start continuous TX. More... | |
virtual int | startContRx (const QString rfDevName, const QString &devId, TestResult_t *pTestResult) |
Start continuous RX. More... | |
virtual int | startPacketRx (const QString rfDevName, const QString &devId) |
Start Packet RX. More... | |
virtual int | verifyFlash (const QString &devName, const QString &devId, FPLFile *pFplFile, ProgramInfo_t *pProgInfo=NULL)=0 |
virtual int | writeMcuReg (const QString &devId, const quint32 &address, const quint32 &value)=0 |
virtual int | writeMemory (const QString &devName, const QString &devId, const quint32 &address, const quint32 &length, quint8 *pBuffer)=0 |
virtual int | writeRfReg (const QString &devId, const quint32 &address, const quint32 &value)=0 |
virtual int | runCpu (const QString &devName, const QString &devId, bool debugMode)=0 |
virtual int | haltCpu (const QString &devName, const QString &devId)=0 |
virtual int | writeCpuReg (const QString &devName, const QString &devId, const CM3_CPU_REGISTERS ®Number, const uint32_t &value)=0 |
virtual int | readCpuReg (const QString &devName, const QString &devId, const CM3_CPU_REGISTERS ®Number, uint32_t *pValue)=0 |
virtual int | setCapArrayDelta (const QString &devId, const qint16 &value)=0 |
Static Public Member Functions | |
static void | initEraseInfo (EraseInfo_t *pEraseInfo) |
static void | initProgramInfo (ProgramInfo_t *pProgInfo) |
static void | setCallBackProgressFunction (_PROGRESS_FUNC_PTR pPf) |
Protected Member Functions | |
QString | normDeviceName (const QString &rfDevName) |
Function to normalize the device name for use in DAL. More... | |
virtual int | initDALApi (const QString &devId)=0 |
Function used to initiate DAL API. This is required after the FPL API has been used. More... | |
RTLFlashHandler * | getFlashHandler (const QString &devName, const QString &devId) |
Get Flash Handler. More... | |
bool | fwUpdateRequired (const QString &devId) |
The function will return true if FW updated is required. More... | |
Protected Attributes | |
int | m_averageRssi |
Used to keep the average RSSI value calculated during a link test. More... | |
QByteArray | m_packetData |
Buffer used for packet data during link test. More... | |
int | m_nbrOfPackets |
Number of packets that will be sent during the link test. More... | |
QList< DeviceInfo_t > | m_ebList |
List of connected EB devices (XDS serial number) returned from DALEbDevice::enumEB() More... | |
QMap< QString, DALEbDevice * > | m_mapConDevices |
Map of connected devices. More... | |
QMultiMap< char, int > | m_mapFreqOffset |
List used to average the frequency offset value. The offset value is used as key and the packet number as value. More... | |
QMap< QString, RTLFlashHandler * > | m_mapFlashHandlers |
Mapped list of Flash handler objects. More... | |
Static Protected Attributes | |
static _PROGRESS_FUNC_PTR | sm_pProgressFunction = NULL |
Static function pointer used to give feedback on progress. More... | |
enum RTLDevice::TEST_MODE |
RTLDevice::RTLDevice | ( | void | ) |
References m_averageRssi, and m_nbrOfPackets.
|
virtual |
References m_mapConDevices, and m_mapFlashHandlers.
|
pure virtual |
Implemented in RTLDevice26_13xx.
|
pure virtual |
Implemented in RTLDevice26_13xx.
|
virtual |
Append error.
Should be called to get a detailed description of the error when a function returns with an error code.
[in] | error | A string describing the error |
Referenced by connect(), RTLDevice26_13xx::eraseFlash(), executeCmd(), getFlashHandler(), getRssi(), initPacketTx(), RTLFlashHandler::initProgramInfo(), isPacketReceived(), RTLDevice26_13xx::programFlash(), RTLDevice26_13xx::readCmdSettingsFromFile(), RTLDevice26_13xx::readFrequencyOffsetCW(), readPacket(), sendPacket(), RTLDevice26_13xx::setCapArrayDelta(), setIdle(), setPacketInterval(), setParameter(), startContRx(), startContTx(), startPacketRx(), RTLDevice26_13xx::startPacketTx(), and RTLDevice26_13xx::verifyFlash().
|
virtual |
|
virtual |
Connect to target device.
This function should be called to setup a connection with given target. If the target doesn't exist in the list of devices, enum in DAL must be called. If DAL object for given device already exist, it will be delete and a new object created.
[in] | rfDevName | RF Device name like "CC2650" |
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
Reimplemented in RTLDevice26_13xx.
References appendError(), enumerateEbs(), fwUpdateRequired(), m_ebList, m_mapConDevices, m_mapFlashHandlers, normDeviceName(), TST_FAILED, and TST_OK.
Referenced by RTLDevice26_13xx::connect().
|
virtual |
Delete file Object.
Delete given File Object.
[in] | pFplFile | Pointer to FPL file object |
References RTLFlashHandler::deleteFileObject().
|
virtual |
Disconnect target device.
Called to end connection and delete device object.
[in] | devId | USB Device ID. E.g.: "XDS-L2000010" |
References m_mapConDevices, m_mapFlashHandlers, TST_FAILED, and TST_OK.
|
pure virtual |
Implemented in RTLDevice26_13xx.
|
virtual |
Enumerate EB devices.
Returns a list of connected EB devices. The following emulators are supported: XDS100v3, XDS110 and XDS200
References RTLDevice::DeviceInfo_t::deviceId, RTLDevice::DeviceInfo_t::fwUpdateReq, and m_ebList.
Referenced by connect(), and getRfDevNameFromDevId().
|
virtual |
Get RF Device name from Device ID.
This function returns the device name (E.g CC2650) that corresponds to the device id (E.g.: "XDS-06EB12100472A"). If the device is not in the list, it will call enumerateEbs(), to get the list.
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
References enumerateEbs().
|
pure virtual |
Implemented in RTLDevice26_13xx.
|
virtual |
Execute command.
The command that should be executed must have been populated with the configure method before this method is called.
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
[in] | name | Name of the command |
References appendError(), initDALApi(), m_mapConDevices, TST_FAILED, and TST_OK.
|
inlinevirtual |
References getLastError(), getRfState(), getRssi(), initPacketTx(), and m_averageRssi.
|
virtual |
Get last error.
Should be called to get a detailed description of the error when a function returns with an error code. The error will be removed from the list of errors.
Referenced by getAverageRssi(), getFlashHandler(), and printLastError().
|
virtual |
Get RF State.
Note: Not yet supported in DAL
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
References initDALApi(), and m_mapConDevices.
Referenced by getAverageRssi().
|
virtual |
Get RSSI.
Prior to calling this function the device must be put in RX mode.
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
[out] | pRssiInDbm | RSSI value given in dBm |
[out] | pRssiRaw | The RSSI value as read from the device register. |
References appendError(), initDALApi(), m_mapConDevices, TST_FAILED, and TST_OK.
Referenced by getAverageRssi().
|
virtual |
Initialize Packet TX.
This function should be called to initialize Packet TX. The configuration function must be called before this function.
[in] | rfDevName | RF Device name like "CC2650" |
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
References appendError(), initDALApi(), m_mapConDevices, TST_FAILED, and TST_OK.
Referenced by getAverageRssi().
|
inlinevirtual |
References isPacketReceived(), m_mapConDevices, programFlash(), readCmdSettingsFromFile(), and readFile().
|
virtual |
Is Packet Received.
This function should be called after startPacketRx() to check if a packet has been received or not.
[in] | rfDevName | RF Device name like "CC2650" |
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
References appendError(), m_mapConDevices, TST_FAILED, TST_OK, and TST_PKT_RECEIVED.
Referenced by isConnected().
|
pure virtual |
Implemented in RTLDevice26_13xx.
Referenced by isConnected().
|
pure virtual |
Implemented in RTLDevice26_13xx.
|
pure virtual |
Implemented in RTLDevice26_13xx.
Referenced by isConnected(), and rssiTest().
|
virtual |
Read File.
Read given file and create FPL File object.
[in] | devName | Device name |
[in] | devId | USB Device ID |
[in] | fileName | File name with relative or absolute path |
[in] | startAddress | The start address is required if the input file is a binary file (.bin) |
References getFlashHandler().
Referenced by isConnected().
|
inlinevirtual |
Reimplemented in RTLDevice26_13xx.
References RTLDevice::TestResult_t::qsError.
|
inlinevirtual |
Reimplemented in RTLDevice26_13xx.
References RTLDevice::TestResult_t::qsError, readMcuReg(), readMemory(), readPacket(), readRfReg(), resetTarget(), sendPacket(), setPacketData(), setPacketInterval(), and setParameter().
|
virtual |
Read Packet.
This function should be called when isPacketReceived() has returned TST_PKT_RECEIVED. The packet data structure is used as both input and output. A data buffer with a maximum length must be created before calling this function.
[in] | rfDevName | RF Device name like "CC2650" |
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
[in,out] | pPacketData | Pointer to a packet data structure. |
References appendError(), RTLDevice::PacketData_t::crcOk, m_mapConDevices, RTLDevice::PacketData_t::maxLength, RTLDevice::PacketData_t::pData, rssi(), RTLDevice::PacketData_t::rssi, TST_FAILED, TST_OK, and TST_PKT_RX_BUF_OVERFLOW.
Referenced by readFrequencyOffsetCW().
|
pure virtual |
Implemented in RTLDevice26_13xx.
Referenced by configureIOPinsForRangeExtender(), and readFrequencyOffsetCW().
|
pure virtual |
Implemented in RTLDevice26_13xx.
Referenced by readFrequencyOffsetCW().
|
pure virtual |
Implemented in RTLDevice26_13xx.
Referenced by readFrequencyOffsetCW().
|
virtual |
Reset Target device.
Reset target device.
The connection to the target device will be lost after a reset.
[in] | rfDevName | RF Device name like "CC2650" |
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
[in] | mode | Reset mode |
References getFlashHandler(), and TST_FAILED.
Referenced by readFrequencyOffsetCW().
|
virtual |
Send Packet.
This function should be called to send one packet. The setPacketData() and initPacketTx() functions must be called before this function.
[in] | rfDevName | RF Device name like "CC2650" |
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
References appendError(), initDALApi(), m_mapConDevices, m_packetData, TST_FAILED, and TST_OK.
Referenced by readFrequencyOffsetCW().
|
virtual |
Set Parameter.
Called to set parameter value for given device. This is an overload function of setParameter and should be used for CC26xx and CC13xx.
The supported parameter names are given per device type in the param_definition.xml file.
Below is a list of parameter names and values. The list is divided in CC26xx and CC13xx devices.
-- CC26xx -- | |
channel | 0 - 39 |
frequency | Decimal value depending on the target device. |
whitening | "true" of "false" |
txPower | See SmartRF Studio for validated values. |
modulated | "true" of "false". |
accessAddress | Hex value of 4 bytes. Default: "8e89bed6" |
-- CC13xx -- | |
carrier_frequency | A decimal Value depending on the target device. E.g.: "868.3" |
symbolRate | Decimal value.E.g.: "34.8" |
deviation | Decimal value.E.g.: "25.0" |
rxFilterBw | See SmartRF Studio for valid values. |
txPower | See SmartRF Studio for validated values. |
whitening | "true" of "false" |
modulated | "true" of "false". |
dataFormat | See SmartRF Studio for valid values. |
preambleCount | See SmartRF Studio for valid values. |
preambleMode | See SmartRF Studio for valid values. |
syncWord | Hex value of 4 bytes. E.g.: "0x930b51de" |
syncWordLength | 1 - 32 |
packetLengthConfig | "Variable" or "Fixed" |
packetLengthTx | Integer value depending on the target device. |
packetLengthRx | Integer value depending on the target device. |
fixedPacketLength | Integer value depending on the target device. |
address | Hex value of 1 byte. E.g.: "0A". |
addressMode | See SmartRF Studio for valid values. |
Note: The listed parameters is not valid for all device types. The applicable parameters for the selected device type can be seen from the param_definition.xml file. Or, by using SmartRF Studio in off line mode for the required device.
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
[in] | parName | Name of the parameter |
[in] | parValue | Parameter value |
References appendError(), m_mapConDevices, TST_FAILED, and TST_OK.
Referenced by readFrequencyOffsetCW(), and rssiTest().
|
virtual |
Set packet Data.
The data will be used to setup the packet buffer sent by the transmitter. For the link test, the receiver will also use the data to compare with the data received over the air.
[in] | pData | Buffer with payload data. |
[in] | len | Length of the buffer |
References m_packetData.
Referenced by readFrequencyOffsetCW().
|
virtual |
Set Packet interval.
[in] | devId | Device ID |
[in] | interval | Packet interval given in ms |
References appendError(), m_mapConDevices, TST_FAILED, and TST_OK.
Referenced by readFrequencyOffsetCW().
|
inlinevirtual |
|
virtual |
Set device in Idle.
This function should be called to set device in IDLE
[in] | rfDevName | RF Device name like "CC2650" |
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
References appendError(), initDALApi(), m_mapConDevices, TST_FAILED, and TST_OK.
Referenced by setNbrOfPackets().
|
virtual |
Start continuous TX.
This function should be called to start cont. TX. The configuration function must be called before this function.
[in] | rfDevName | RF Device name like "CC2650" |
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
[out] | pTestResult | Pointer to structure with test results. |
References appendError(), initDALApi(), m_mapConDevices, TST_FAILED, and TST_OK.
Referenced by setNbrOfPackets().
|
virtual |
Start continuous RX.
This function should be called to start cont. RX. The configuration function must be called before this function.
[in] | rfDevName | RF Device name like "CC2650" |
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
[out] | pTestResult | Pointer to structure with test results. |
References appendError(), initDALApi(), m_mapConDevices, TST_FAILED, and TST_OK.
Referenced by setNbrOfPackets().
|
virtual |
Start Packet RX.
This function should be called to start Packet RX. The configuration function must be called before this function.
[in] | rfDevName | RF Device name like "CC2650" |
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
References appendError(), initDALApi(), m_mapConDevices, TST_FAILED, and TST_OK.
Referenced by setNbrOfPackets().
|
pure virtual |
Implemented in RTLDevice26_13xx.
Referenced by setNbrOfPackets().
|
pure virtual |
Implemented in RTLDevice26_13xx.
Referenced by configureIOPinsForRangeExtender(), and setNbrOfPackets().
|
pure virtual |
Implemented in RTLDevice26_13xx.
Referenced by setNbrOfPackets().
|
pure virtual |
Implemented in RTLDevice26_13xx.
Referenced by setNbrOfPackets().
|
pure virtual |
Implemented in RTLDevice26_13xx.
Referenced by setNbrOfPackets().
|
pure virtual |
Implemented in RTLDevice26_13xx.
Referenced by setNbrOfPackets().
|
pure virtual |
Implemented in RTLDevice26_13xx.
Referenced by setNbrOfPackets().
|
pure virtual |
Implemented in RTLDevice26_13xx.
Referenced by setNbrOfPackets().
|
pure virtual |
Implemented in RTLDevice26_13xx.
Referenced by setCapArrayTuning(), and setNbrOfPackets().
|
inlinestatic |
References RTLFlashHandler::initEraseInfo().
|
inlinestatic |
References RTLFlashHandler::initProgramInfo().
|
inlinestatic |
References sm_pProgressFunction.
|
protected |
Function to normalize the device name for use in DAL.
Normalize device name.
Some of the device names need to be changed in order to be recognized by the DAL library.
[in] | rfDevName | RF Device name like "CC2650" |
Referenced by connect().
|
protectedpure virtual |
Function used to initiate DAL API. This is required after the FPL API has been used.
Referenced by executeCmd(), getRfState(), getRssi(), initPacketTx(), sendPacket(), setIdle(), startContRx(), startContTx(), and startPacketRx().
|
protected |
Get Flash Handler.
Get pointer to the Flash Handler object.
[in] | devName | Device name |
[in] | devId | Device ID |
References appendError(), getLastError(), m_mapConDevices, and m_mapFlashHandlers.
Referenced by RTLDevice26_13xx::eraseFlash(), RTLDevice26_13xx::haltCpu(), RTLDevice26_13xx::programFlash(), RTLDevice26_13xx::readCpuReg(), readFile(), RTLDevice26_13xx::readMemory(), resetTarget(), RTLDevice26_13xx::runCpu(), RTLDevice26_13xx::verifyFlash(), RTLDevice26_13xx::writeCpuReg(), and RTLDevice26_13xx::writeMemory().
|
protected |
|
protected |
Used to keep the average RSSI value calculated during a link test.
Referenced by RTLDevice26_13xx::doLinkTest(), getAverageRssi(), and RTLDevice().
|
protected |
Buffer used for packet data during link test.
Referenced by RTLDevice26_13xx::doLinkTest(), sendPacket(), setPacketData(), and RTLDevice26_13xx::startPacketTx().
|
protected |
Number of packets that will be sent during the link test.
Referenced by RTLDevice26_13xx::doLinkTest(), RTLDevice(), setNbrOfPackets(), and RTLDevice26_13xx::startPacketTx().
|
protected |
List of connected EB devices (XDS serial number) returned from DALEbDevice::enumEB()
Referenced by connect(), enumerateEbs(), and fwUpdateRequired().
|
protected |
Map of connected devices.
Referenced by RTLDevice26_13xx::addDynamicOverride(), connect(), disconnect(), RTLDevice26_13xx::doLinkTest(), RTLDevice26_13xx::executeCmd(), executeCmd(), getFlashHandler(), getRfState(), getRssi(), initPacketTx(), isConnected(), isPacketReceived(), RTLDevice26_13xx::readCmdSettingsFromFile(), RTLDevice26_13xx::readFrequencyOffset(), RTLDevice26_13xx::readFrequencyOffsetCW(), RTLDevice26_13xx::readMcuReg(), readPacket(), RTLDevice26_13xx::readRfReg(), RTLDevice26_13xx::removeDynamicOverride(), sendPacket(), RTLDevice26_13xx::setCapArrayDelta(), setIdle(), setPacketInterval(), setParameter(), startContRx(), startContTx(), startPacketRx(), RTLDevice26_13xx::startPacketTx(), RTLDevice26_13xx::writeMcuReg(), RTLDevice26_13xx::writeRfReg(), ~RTLDevice(), and RTLDevice26_13xx::~RTLDevice26_13xx().
|
protected |
List used to average the frequency offset value. The offset value is used as key and the packet number as value.
Referenced by RTLDevice26_13xx::doLinkTest(), and RTLDevice26_13xx::readFrequencyOffsetCW().
|
staticprotected |
Static function pointer used to give feedback on progress.
Referenced by RTLDevice26_13xx::doLinkTest(), setCallBackProgressFunction(), and RTLDevice26_13xx::startPacketTx().
|
protected |
Mapped list of Flash handler objects.
Referenced by connect(), disconnect(), getFlashHandler(), ~RTLDevice(), and RTLDevice26_13xx::~RTLDevice26_13xx().