Commit a61aead3 authored by Don Gagne's avatar Don Gagne

New LinkManager::[connect|disconnect]Link usage

parent 4d92b1d3
......@@ -853,7 +853,7 @@ void MAVLinkSimulationLink::readBytes()
* @return True if connection has been disconnected, false if connection
* couldn't be disconnected.
**/
bool MAVLinkSimulationLink::disconnect()
bool MAVLinkSimulationLink::_disconnect(void)
{
if(isConnected())
......@@ -877,7 +877,7 @@ bool MAVLinkSimulationLink::disconnect()
* @return True if connection has been established, false if connection
* couldn't be established.
**/
bool MAVLinkSimulationLink::connect()
bool MAVLinkSimulationLink::_connect(void)
{
_isConnected = true;
emit connected();
......@@ -892,36 +892,6 @@ bool MAVLinkSimulationLink::connect()
return true;
}
/**
* Connect the link.
*
* @param connect true connects the link, false disconnects it
* @return True if connection has been established, false if connection
* couldn't be established.
**/
void MAVLinkSimulationLink::connectLink()
{
this->connect();
}
/**
* Connect the link.
*
* @param connect true connects the link, false disconnects it
* @return True if connection has been established, false if connection
* couldn't be established.
**/
bool MAVLinkSimulationLink::connectLink(bool connect)
{
_isConnected = connect;
if(connect) {
this->connect();
}
return true;
}
/**
* Check if connection is active.
*
......
......@@ -54,8 +54,6 @@ public:
void run();
void requestReset() { }
bool connect();
bool disconnect();
// Extensive statistics for scientific purposes
qint64 getConnectionSpeed() const;
......@@ -70,14 +68,17 @@ public:
int getParityType() const;
int getDataBitsType() const;
int getStopBitsType() const;
// These are left unimplemented in order to cause linker errors which indicate incorrect usage of
// connect/disconnect on link directly. All connect/disconnect calls should be made through LinkManager.
bool connect(void);
bool disconnect(void);
public slots:
void writeBytes(const char* data, qint64 size);
void readBytes();
/** @brief Mainloop simulating the mainloop of the MAV */
virtual void mainloop();
bool connectLink(bool connect);
void connectLink();
void sendMAVLinkMessage(const mavlink_message_t* msg);
......@@ -129,7 +130,11 @@ protected:
signals:
void valueChanged(int uasId, QString curve, double value, quint64 usec);
void messageReceived(const mavlink_message_t& message);
private:
// From LinkInterface
virtual bool _connect(void);
virtual bool _disconnect(void);
};
#endif // MAVLINKSIMULATIONLINK_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment