Commit dc0c3f3d authored by Don Gagne's avatar Don Gagne

LinkInterface::bytesAvailable api removal

This api doesn’t make any sense given the fact that LinkInterface
signals bytesReceived with the bytes in the signal. Also the reason why
it is never called!
parent 25c1168c
......@@ -147,13 +147,6 @@ public:
**/
virtual bool disconnect() = 0;
/**
* @brief Get the current number of bytes in buffer.
*
* @return The number of bytes ready to read
**/
virtual qint64 bytesAvailable() = 0;
public slots:
/**
......
......@@ -632,14 +632,6 @@ void MAVLinkSimulationLink::mainloop()
}
qint64 MAVLinkSimulationLink::bytesAvailable()
{
readyBufferMutex.lock();
qint64 size = readyBuffer.size();
readyBufferMutex.unlock();
return size;
}
void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size)
{
// Parse bytes
......
......@@ -51,7 +51,6 @@ public:
MAVLinkSimulationLink(QString readFile="", QString writeFile="", int rate=5);
~MAVLinkSimulationLink();
bool isConnected() const;
qint64 bytesAvailable();
void run();
void requestReset() { }
......
......@@ -58,18 +58,6 @@ OpalLink::OpalLink() :
QObject::connect(getSignalsTimer, SIGNAL(timeout()), this, SLOT(getSignals()));
}
/*
*
Communication
*
*/
qint64 OpalLink::bytesAvailable()
{
return 0;
}
void OpalLink::writeBytes(const char *bytes, qint64 length)
{
/* decode the message */
......
......@@ -83,8 +83,6 @@ public:
bool disconnect();
qint64 bytesAvailable();
void run();
int getOpalInstID() {
......
......@@ -390,21 +390,6 @@ void SerialLink::readBytes()
}
}
/**
* @brief Get the number of bytes to read.
*
* @return The number of bytes to read
**/
qint64 SerialLink::bytesAvailable()
{
if (m_port) {
return m_port->bytesAvailable();
} else {
return 0;
}
}
/**
* @brief Disconnect the connection.
*
......
......@@ -78,7 +78,6 @@ public:
void requestReset();
bool isConnected() const;
qint64 bytesAvailable();
/**
* @brief The port handle
......
......@@ -176,16 +176,6 @@ void TCPLink::readBytes()
}
}
/**
* @brief Get the number of bytes to read.
*
* @return The number of bytes to read
**/
qint64 TCPLink::bytesAvailable()
{
return _socket->bytesAvailable();
}
/**
* @brief Disconnect the connection.
*
......
......@@ -67,7 +67,6 @@ public:
virtual bool isConnected(void) const;
virtual bool connect(void);
virtual bool disconnect(void);
virtual qint64 bytesAvailable(void);
virtual void requestReset(void) {};
// Extensive statistics for scientific purposes
......
......@@ -267,17 +267,6 @@ void UDPLink::readBytes()
}
}
/**
* @brief Get the number of bytes to read.
*
* @return The number of bytes to read
**/
qint64 UDPLink::bytesAvailable()
{
return socket->pendingDatagramSize();
}
/**
* @brief Disconnect the connection.
*
......
......@@ -52,7 +52,6 @@ public:
void requestReset() { }
bool isConnected() const;
qint64 bytesAvailable();
int getPort() const {
return port;
}
......
......@@ -189,11 +189,6 @@ bool XbeeLink::disconnect()
return true;
}
qint64 XbeeLink::bytesAvailable()
{
return 0;
}
void XbeeLink::writeBytes(const char *bytes, qint64 length) // TO DO: delete the data array
{
char *data;
......
......@@ -36,7 +36,6 @@ public: // virtual functions from LinkInterface
bool isConnected() const;
bool connect();
bool disconnect();
qint64 bytesAvailable();
// Extensive statistics for scientific purposes
qint64 getConnectionSpeed() const;
......
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