Browse Source

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!
QGC4.4
Don Gagne 11 years ago
parent
commit
dc0c3f3db3
  1. 7
      src/comm/LinkInterface.h
  2. 8
      src/comm/MAVLinkSimulationLink.cc
  3. 1
      src/comm/MAVLinkSimulationLink.h
  4. 12
      src/comm/OpalLink.cc
  5. 2
      src/comm/OpalLink.h
  6. 15
      src/comm/SerialLink.cc
  7. 1
      src/comm/SerialLink.h
  8. 10
      src/comm/TCPLink.cc
  9. 1
      src/comm/TCPLink.h
  10. 11
      src/comm/UDPLink.cc
  11. 1
      src/comm/UDPLink.h
  12. 5
      src/comm/XbeeLink.cpp
  13. 1
      src/comm/XbeeLink.h

7
src/comm/LinkInterface.h

@ -147,13 +147,6 @@ public: @@ -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:
/**

8
src/comm/MAVLinkSimulationLink.cc

@ -632,14 +632,6 @@ void MAVLinkSimulationLink::mainloop() @@ -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

1
src/comm/MAVLinkSimulationLink.h

@ -51,7 +51,6 @@ public: @@ -51,7 +51,6 @@ public:
MAVLinkSimulationLink(QString readFile="", QString writeFile="", int rate=5);
~MAVLinkSimulationLink();
bool isConnected() const;
qint64 bytesAvailable();
void run();
void requestReset() { }

12
src/comm/OpalLink.cc

@ -58,18 +58,6 @@ OpalLink::OpalLink() : @@ -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 */

2
src/comm/OpalLink.h

@ -83,8 +83,6 @@ public: @@ -83,8 +83,6 @@ public:
bool disconnect();
qint64 bytesAvailable();
void run();
int getOpalInstID() {

15
src/comm/SerialLink.cc

@ -390,21 +390,6 @@ void SerialLink::readBytes() @@ -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.
*

1
src/comm/SerialLink.h

@ -78,7 +78,6 @@ public: @@ -78,7 +78,6 @@ public:
void requestReset();
bool isConnected() const;
qint64 bytesAvailable();
/**
* @brief The port handle

10
src/comm/TCPLink.cc

@ -177,16 +177,6 @@ void TCPLink::readBytes() @@ -177,16 +177,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.
*
* @return True if connection has been disconnected, false if connection couldn't be disconnected.

1
src/comm/TCPLink.h

@ -67,7 +67,6 @@ public: @@ -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

11
src/comm/UDPLink.cc

@ -267,17 +267,6 @@ void UDPLink::readBytes() @@ -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.
*

1
src/comm/UDPLink.h

@ -52,7 +52,6 @@ public: @@ -52,7 +52,6 @@ public:
void requestReset() { }
bool isConnected() const;
qint64 bytesAvailable();
int getPort() const {
return port;
}

5
src/comm/XbeeLink.cpp

@ -189,11 +189,6 @@ bool XbeeLink::disconnect() @@ -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;

1
src/comm/XbeeLink.h

@ -36,7 +36,6 @@ public: // virtual functions from LinkInterface @@ -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;

Loading…
Cancel
Save