|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <MockLink.h>
Inheritance diagram for MockLink:
Collaboration diagram for MockLink:Signals | |
| void | writeBytesQueuedSignal (const QByteArray &bytes) |
| void | highLatencyTransmissionEnabledChanged (bool highLatencyTransmissionEnabled) |
Signals inherited from LinkInterface | |
| void | bytesReceived (LinkInterface *link, const QByteArray &data) |
| void | bytesSent (LinkInterface *link, const QByteArray &data) |
| void | connected () |
| void | disconnected () |
| void | communicationError (const QString &title, const QString &error) |
Public Member Functions | |
| MockLink (SharedLinkConfigurationPtr &config, QObject *parent=nullptr) | |
| virtual | ~MockLink () |
| void | run1HzTasks () |
| void | run10HzTasks () |
| void | run500HzTasks () |
| void | sendStatusTextMessages () |
| bool | shouldSendStatusText () const |
| bool | isConnected () const final |
| void | disconnect () final |
| void | setCommLost (bool commLost) |
| void | simulateConnectionRemoved () |
| int | vehicleId () const |
| MAV_AUTOPILOT | getFirmwareType () const |
| double | vehicleLatitude () const |
| double | vehicleLongitude () const |
| double | vehicleAltitudeAMSL () const |
| void | respondWithMavlinkMessage (const mavlink_message_t &msg) |
| Sends the specified mavlink message to QGC. | |
| MockLinkFTP * | mockLinkFTP () const |
| void | setMissionItemFailureMode (MockLinkMissionItemHandler::FailureMode_t failureMode, MAV_MISSION_RESULT failureAckResult) const |
| void | sendUnexpectedMissionAck (MAV_MISSION_RESULT ackType) const |
| Called to send a MISSION_ACK message while the MissionManager is in idle state. | |
| void | sendUnexpectedMissionItem () const |
| Called to send a MISSION_ITEM message while the MissionManager is in idle state. | |
| void | sendUnexpectedMissionRequest () const |
| Called to send a MISSION_REQUEST message while the MissionManager is in idle state. | |
| void | sendUnexpectedCommandAck (MAV_CMD command, MAV_RESULT ackResult) |
| void | resetMissionItemHandler () const |
| Reset the state of the MissionItemHandler to no items, no transactions in progress. | |
| QString | logDownloadFile () const |
| Returns the filename for the simulated log file. Only available after a download is requested. | |
| void | clearReceivedMavCommandCounts () |
| int | receivedMavCommandCount (MAV_CMD command) const |
| int | receivedMavCommandCount (MAV_CMD command, int compId) const |
| int | receivedRequestMessageCount (int compId, int messageId) const |
| void | clearReceivedRequestMessageCounts () |
| int | receivedRequestMessageCount (uint32_t messageId) const |
| void | clearReceivedMavlinkMessageCounts () |
| int | receivedMavlinkMessageCount (uint32_t messageId) const |
| void | setRequestMessageFailureMode (RequestMessageFailureMode_t failureMode) |
| void | setRequestMessageNoResponse (uint32_t messageId, bool noResponse=true) |
| void | setParamSetFailureMode (ParamSetFailureMode_t mode) |
| void | setParamRequestReadFailureMode (ParamRequestReadFailureMode_t mode) |
| void | setHashCheckNoResponse (bool noResponse) |
| int | hashCheckRequestCount () const |
| Returns the number of standalone PARAM_REQUEST_READ requests for _HASH_CHECK received. | |
| void | setMockParamValue (int componentId, const QString ¶mName, float value) |
| Change a float parameter value directly on MockLink (for testing cache invalidation) | |
Public Member Functions inherited from LinkInterface | |
| virtual | ~LinkInterface () |
| virtual bool | isLogReplay () const |
| virtual bool | isSecureConnection () const |
| Returns true if the connection is secure (e.g. USB, wired ethernet) | |
| SharedLinkConfigurationPtr | linkConfiguration () |
| const SharedLinkConfigurationPtr | linkConfiguration () const |
| uint8_t | mavlinkChannel () const |
| bool | mavlinkChannelIsSet () const |
| bool | decodedFirstMavlinkPacket () const |
| void | setDecodedFirstMavlinkPacket (bool decodedFirstMavlinkPacket) |
| void | writeBytesThreadSafe (const char *bytes, int length) |
| void | addVehicleReference () |
| void | removeVehicleReference () |
| bool | initMavlinkSigning () |
| void | setSigningSignatureFailure (bool failure) |
| void | reportMavlinkV1Traffic () |
Static Public Member Functions | |
| static MockLink * | startPX4MockLink (bool sendStatusText, bool enableCamera, bool enableGimbal, MockConfiguration::FailureMode_t failureMode=MockConfiguration::FailNone) |
| static MockLink * | startGenericMockLink (bool sendStatusText, bool enableCamera, bool enableGimbal, MockConfiguration::FailureMode_t failureMode=MockConfiguration::FailNone) |
| static MockLink * | startNoInitialConnectMockLink (bool sendStatusText, bool enableCamera, bool enableGimbal, MockConfiguration::FailureMode_t failureMode=MockConfiguration::FailNone) |
| static MockLink * | startAPMArduCopterMockLink (bool sendStatusText, bool enableCamera, bool enableGimbal, MockConfiguration::FailureMode_t failureMode=MockConfiguration::FailNone) |
| static MockLink * | startAPMArduPlaneMockLink (bool sendStatusText, bool enableCamera, bool enableGimbal, MockConfiguration::FailureMode_t failureMode=MockConfiguration::FailNone) |
| static MockLink * | startAPMArduSubMockLink (bool sendStatusText, bool enableCamera, bool enableGimbal, MockConfiguration::FailureMode_t failureMode=MockConfiguration::FailNone) |
| static MockLink * | startAPMArduRoverMockLink (bool sendStatusText, bool enableCamera, bool enableGimbal, MockConfiguration::FailureMode_t failureMode=MockConfiguration::FailNone) |
Static Public Attributes | |
| static constexpr MAV_CMD | MAV_CMD_MOCKLINK_ALWAYS_RESULT_ACCEPTED = MAV_CMD_USER_1 |
| static constexpr MAV_CMD | MAV_CMD_MOCKLINK_ALWAYS_RESULT_FAILED = MAV_CMD_USER_2 |
| static constexpr MAV_CMD | MAV_CMD_MOCKLINK_SECOND_ATTEMPT_RESULT_ACCEPTED = MAV_CMD_USER_3 |
| static constexpr MAV_CMD | MAV_CMD_MOCKLINK_SECOND_ATTEMPT_RESULT_FAILED = MAV_CMD_USER_4 |
| static constexpr MAV_CMD | MAV_CMD_MOCKLINK_NO_RESPONSE = MAV_CMD_USER_5 |
| static constexpr MAV_CMD | MAV_CMD_MOCKLINK_NO_RESPONSE_NO_RETRY = static_cast<MAV_CMD>(MAV_CMD_USER_5 + 1) |
| static constexpr MAV_CMD | MAV_CMD_MOCKLINK_RESULT_IN_PROGRESS_ACCEPTED = static_cast<MAV_CMD>(MAV_CMD_USER_5 + 2) |
| static constexpr MAV_CMD | MAV_CMD_MOCKLINK_RESULT_IN_PROGRESS_FAILED = static_cast<MAV_CMD>(MAV_CMD_USER_5 + 3) |
| static constexpr MAV_CMD | MAV_CMD_MOCKLINK_RESULT_IN_PROGRESS_NO_ACK = static_cast<MAV_CMD>(MAV_CMD_USER_5 + 4) |
Additional Inherited Members | |
Protected Member Functions inherited from LinkInterface | |
| LinkInterface (SharedLinkConfigurationPtr &config, QObject *parent=nullptr) | |
| Links are only created by LinkManager so constructor is not public. | |
| void | _connectionRemoved () |
Protected Attributes inherited from LinkInterface | |
| SharedLinkConfigurationPtr | _config |
Definition at line 27 of file MockLink.h.
Definition at line 120 of file MockLink.h.
| Enumerator | |
|---|---|
| FailParamSetNone | Normal behavior. |
| FailParamSetNoAck | Do not send PARAM_VALUE ack. |
| FailParamSetFirstAttemptNoAck | Skip ack on first attempt, respond to retry. |
Definition at line 110 of file MockLink.h.
| Enumerator | |
|---|---|
| FailRequestMessageNone | |
| FailRequestMessageCommandAcceptedMsgNotSent | |
| FailRequestMessageCommandUnsupported | |
| FailRequestMessageCommandNoResponse | |
Definition at line 91 of file MockLink.h.
|
explicit |
Definition at line 48 of file MockLink.cc.
References MockLinkWorker::startWork(), and writeBytesQueuedSignal().
|
virtual |
Definition at line 118 of file MockLink.cc.
References disconnect().
|
inline |
Definition at line 82 of file MockLink.h.
|
inline |
Definition at line 88 of file MockLink.h.
|
inline |
Definition at line 86 of file MockLink.h.
|
finalvirtual |
Implements LinkInterface.
Definition at line 152 of file MockLink.cc.
References LinkInterface::disconnected(), and MockLinkMissionItemHandler::shutdown().
Referenced by QGroundControlQmlGlobal::stopOneMockLink(), and ~MockLink().
|
inline |
Definition at line 49 of file MockLink.h.
|
inline |
Returns the number of standalone PARAM_REQUEST_READ requests for _HASH_CHECK received.
Definition at line 133 of file MockLink.h.
|
signal |
|
inlinefinalvirtual |
Implements LinkInterface.
Definition at line 42 of file MockLink.h.
|
inline |
Returns the filename for the simulated log file. Only available after a download is requested.
Definition at line 80 of file MockLink.h.
| MockLinkFTP * MockLink::mockLinkFTP | ( | ) | const |
Definition at line 2054 of file MockLink.cc.
|
inline |
Definition at line 83 of file MockLink.h.
|
inline |
Definition at line 84 of file MockLink.h.
|
inline |
Definition at line 89 of file MockLink.h.
|
inline |
Definition at line 85 of file MockLink.h.
|
inline |
Definition at line 87 of file MockLink.h.
|
inline |
Reset the state of the MissionItemHandler to no items, no transactions in progress.
Definition at line 77 of file MockLink.h.
| void MockLink::respondWithMavlinkMessage | ( | const mavlink_message_t & | msg | ) |
Sends the specified mavlink message to QGC.
Definition at line 558 of file MockLink.cc.
References LinkInterface::bytesReceived().
Referenced by MockLinkFTP::mavlinkMessageReceived(), MockLinkCamera::sendCameraHeartbeats(), and sendUnexpectedCommandAck().
| void MockLink::run10HzTasks | ( | ) |
Definition at line 219 of file MockLink.cc.
References LinkInterface::linkConfiguration(), LinkInterface::mavlinkChannelIsSet(), and MockLinkCamera::run10HzTasks().
| void MockLink::run1HzTasks | ( | ) |
Definition at line 173 of file MockLink.cc.
References LinkInterface::linkConfiguration(), LinkInterface::mavlinkChannelIsSet(), qgcApp, MockLinkGimbal::run1HzTasks(), and MockLinkCamera::sendCameraHeartbeats().
| void MockLink::run500HzTasks | ( | ) |
Definition at line 244 of file MockLink.cc.
References LinkInterface::linkConfiguration(), and LinkInterface::mavlinkChannelIsSet().
| void MockLink::sendStatusTextMessages | ( | ) |
Definition at line 257 of file MockLink.cc.
| void MockLink::sendUnexpectedCommandAck | ( | MAV_CMD | command, |
| MAV_RESULT | ackResult | ||
| ) |
Definition at line 1362 of file MockLink.cc.
References LinkInterface::mavlinkChannel(), and respondWithMavlinkMessage().
|
inline |
Called to send a MISSION_ACK message while the MissionManager is in idle state.
Definition at line 66 of file MockLink.h.
|
inline |
Called to send a MISSION_ITEM message while the MissionManager is in idle state.
Definition at line 69 of file MockLink.h.
|
inline |
Called to send a MISSION_REQUEST message while the MissionManager is in idle state.
Definition at line 72 of file MockLink.h.
|
inline |
Definition at line 45 of file MockLink.h.
|
inline |
Definition at line 130 of file MockLink.h.
|
inline |
Sets a failure mode for unit testingqgcm
| failureMode | Type of failure to simulate |
| failureAckResult | Error to send if one the ack error modes |
Definition at line 63 of file MockLink.h.
| void MockLink::setMockParamValue | ( | int | componentId, |
| const QString & | paramName, | ||
| float | value | ||
| ) |
Change a float parameter value directly on MockLink (for testing cache invalidation)
Definition at line 790 of file MockLink.cc.
|
inline |
Definition at line 125 of file MockLink.h.
|
inline |
Definition at line 115 of file MockLink.h.
|
inline |
Definition at line 97 of file MockLink.h.
|
inline |
Block or unblock REQUEST_MESSAGE responses for a specific message ID. When blocked, MockLink silently drops the request (no ACK, no message).
Definition at line 101 of file MockLink.h.
|
inline |
Definition at line 40 of file MockLink.h.
Referenced by MockLinkWorker::startWork().
| void MockLink::simulateConnectionRemoved | ( | ) |
Definition at line 2048 of file MockLink.cc.
References LinkInterface::_connectionRemoved().
|
static |
Definition at line 1656 of file MockLink.cc.
Referenced by QGroundControlQmlGlobal::startAPMArduCopterMockLink().
|
static |
Definition at line 1661 of file MockLink.cc.
Referenced by QGroundControlQmlGlobal::startAPMArduPlaneMockLink().
|
static |
Definition at line 1671 of file MockLink.cc.
Referenced by QGroundControlQmlGlobal::startAPMArduRoverMockLink().
|
static |
Definition at line 1666 of file MockLink.cc.
Referenced by QGroundControlQmlGlobal::startAPMArduSubMockLink().
|
static |
Definition at line 1646 of file MockLink.cc.
Referenced by QGroundControlQmlGlobal::startGenericMockLink().
|
static |
Definition at line 1651 of file MockLink.cc.
|
static |
Definition at line 1641 of file MockLink.cc.
Referenced by QGroundControlQmlGlobal::startPX4MockLink().
|
inline |
Definition at line 53 of file MockLink.h.
|
inline |
Definition at line 48 of file MockLink.h.
Referenced by MockLinkCamera::sendCameraHeartbeats().
|
inline |
Definition at line 51 of file MockLink.h.
|
inline |
Definition at line 52 of file MockLink.h.
|
signal |
Referenced by MockLink().
|
staticconstexpr |
Definition at line 147 of file MockLink.h.
Referenced by Vehicle::_sendMavCommandShouldRetry().
|
staticconstexpr |
Definition at line 148 of file MockLink.h.
Referenced by Vehicle::_sendMavCommandShouldRetry().
|
staticconstexpr |
Definition at line 151 of file MockLink.h.
Referenced by Vehicle::_sendMavCommandShouldRetry().
|
staticconstexpr |
Definition at line 152 of file MockLink.h.
|
staticconstexpr |
Definition at line 153 of file MockLink.h.
|
staticconstexpr |
Definition at line 154 of file MockLink.h.
|
staticconstexpr |
Definition at line 155 of file MockLink.h.
|
staticconstexpr |
Definition at line 149 of file MockLink.h.
Referenced by Vehicle::_sendMavCommandShouldRetry().
|
staticconstexpr |
Definition at line 150 of file MockLink.h.
Referenced by Vehicle::_sendMavCommandShouldRetry().