Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
fe8ff69e
Commit
fe8ff69e
authored
Mar 25, 2016
by
Nate Weibley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor writeBytes to _writeBytes
parent
a2a20353
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
24 additions
and
24 deletions
+24
-24
BluetoothLink.cc
src/comm/BluetoothLink.cc
+1
-1
BluetoothLink.h
src/comm/BluetoothLink.h
+1
-1
LinkInterface.h
src/comm/LinkInterface.h
+2
-2
LogReplayLink.cc
src/comm/LogReplayLink.cc
+1
-1
LogReplayLink.h
src/comm/LogReplayLink.h
+1
-1
MockLink.cc
src/comm/MockLink.cc
+1
-1
MockLink.h
src/comm/MockLink.h
+1
-1
QGCFlightGearLink.cc
src/comm/QGCFlightGearLink.cc
+1
-1
QGCFlightGearLink.h
src/comm/QGCFlightGearLink.h
+1
-1
QGCHilLink.h
src/comm/QGCHilLink.h
+2
-2
QGCJSBSimLink.cc
src/comm/QGCJSBSimLink.cc
+1
-1
QGCJSBSimLink.h
src/comm/QGCJSBSimLink.h
+1
-1
QGCXPlaneLink.cc
src/comm/QGCXPlaneLink.cc
+1
-1
QGCXPlaneLink.h
src/comm/QGCXPlaneLink.h
+1
-1
SerialLink.cc
src/comm/SerialLink.cc
+1
-1
SerialLink.h
src/comm/SerialLink.h
+1
-1
TCPLink.cc
src/comm/TCPLink.cc
+1
-1
TCPLink.h
src/comm/TCPLink.h
+1
-1
UDPLink.cc
src/comm/UDPLink.cc
+1
-1
UDPLink.h
src/comm/UDPLink.h
+1
-1
XbeeLink.cpp
src/comm/XbeeLink.cpp
+1
-1
XbeeLink.h
src/comm/XbeeLink.h
+1
-1
No files found.
src/comm/BluetoothLink.cc
View file @
fe8ff69e
...
@@ -89,7 +89,7 @@ QString BluetoothLink::getName() const
...
@@ -89,7 +89,7 @@ QString BluetoothLink::getName() const
return
_config
->
name
();
return
_config
->
name
();
}
}
void
BluetoothLink
::
writeBytes
(
const
QByteArray
bytes
)
void
BluetoothLink
::
_
writeBytes
(
const
QByteArray
bytes
)
{
{
if
(
_targetSocket
)
if
(
_targetSocket
)
{
{
...
...
src/comm/BluetoothLink.h
View file @
fe8ff69e
...
@@ -193,7 +193,7 @@ private:
...
@@ -193,7 +193,7 @@ private:
void
_restartConnection
();
void
_restartConnection
();
private
slots
:
private
slots
:
void
writeBytes
(
const
QByteArray
bytes
);
void
_writeBytes
(
const
QByteArray
bytes
);
private:
private:
void
_createSocket
();
void
_createSocket
();
...
...
src/comm/LinkInterface.h
View file @
fe8ff69e
...
@@ -163,7 +163,7 @@ public slots:
...
@@ -163,7 +163,7 @@ public slots:
}
}
private
slots
:
private
slots
:
virtual
void
writeBytes
(
const
QByteArray
)
=
0
;
virtual
void
_
writeBytes
(
const
QByteArray
)
=
0
;
signals:
signals:
void
autoconnectChanged
(
bool
autoconnect
);
void
autoconnectChanged
(
bool
autoconnect
);
...
@@ -220,7 +220,7 @@ protected:
...
@@ -220,7 +220,7 @@ protected:
memset
(
_outDataWriteAmounts
,
0
,
sizeof
(
_outDataWriteAmounts
));
memset
(
_outDataWriteAmounts
,
0
,
sizeof
(
_outDataWriteAmounts
));
memset
(
_outDataWriteTimes
,
0
,
sizeof
(
_outDataWriteTimes
));
memset
(
_outDataWriteTimes
,
0
,
sizeof
(
_outDataWriteTimes
));
QObject
::
connect
(
this
,
&
LinkInterface
::
_invokeWriteBytes
,
this
,
&
LinkInterface
::
writeBytes
);
QObject
::
connect
(
this
,
&
LinkInterface
::
_invokeWriteBytes
,
this
,
&
LinkInterface
::
_
writeBytes
);
qRegisterMetaType
<
LinkInterface
*>
(
"LinkInterface*"
);
qRegisterMetaType
<
LinkInterface
*>
(
"LinkInterface*"
);
}
}
...
...
src/comm/LogReplayLink.cc
View file @
fe8ff69e
...
@@ -151,7 +151,7 @@ void LogReplayLink::_replayError(const QString& errorMsg)
...
@@ -151,7 +151,7 @@ void LogReplayLink::_replayError(const QString& errorMsg)
}
}
/// Since this is log replay, we just drops writes on the floor
/// Since this is log replay, we just drops writes on the floor
void
LogReplayLink
::
writeBytes
(
const
QByteArray
bytes
)
void
LogReplayLink
::
_
writeBytes
(
const
QByteArray
bytes
)
{
{
Q_UNUSED
(
bytes
);
Q_UNUSED
(
bytes
);
}
}
...
...
src/comm/LogReplayLink.h
View file @
fe8ff69e
...
@@ -99,7 +99,7 @@ public:
...
@@ -99,7 +99,7 @@ public:
bool
disconnect
(
void
);
bool
disconnect
(
void
);
private
slots
:
private
slots
:
virtual
void
writeBytes
(
const
QByteArray
bytes
);
virtual
void
_
writeBytes
(
const
QByteArray
bytes
);
signals:
signals:
void
logFileStats
(
bool
logTimestamped
,
int
logDurationSecs
,
int
binaryBaudRate
);
void
logFileStats
(
bool
logTimestamped
,
int
logDurationSecs
,
int
binaryBaudRate
);
...
...
src/comm/MockLink.cc
View file @
fe8ff69e
...
@@ -313,7 +313,7 @@ void MockLink::respondWithMavlinkMessage(const mavlink_message_t& msg)
...
@@ -313,7 +313,7 @@ void MockLink::respondWithMavlinkMessage(const mavlink_message_t& msg)
}
}
/// @brief Called when QGC wants to write bytes to the MAV
/// @brief Called when QGC wants to write bytes to the MAV
void
MockLink
::
writeBytes
(
const
QByteArray
bytes
)
void
MockLink
::
_
writeBytes
(
const
QByteArray
bytes
)
{
{
if
(
_inNSH
)
{
if
(
_inNSH
)
{
_handleIncomingNSHBytes
(
bytes
.
constData
(),
bytes
.
count
());
_handleIncomingNSHBytes
(
bytes
.
constData
(),
bytes
.
count
());
...
...
src/comm/MockLink.h
View file @
fe8ff69e
...
@@ -151,7 +151,7 @@ public:
...
@@ -151,7 +151,7 @@ public:
static
MockLink
*
startAPMArduPlaneMockLink
(
bool
sendStatusText
);
static
MockLink
*
startAPMArduPlaneMockLink
(
bool
sendStatusText
);
private
slots
:
private
slots
:
virtual
void
writeBytes
(
const
QByteArray
bytes
);
virtual
void
_
writeBytes
(
const
QByteArray
bytes
);
private
slots
:
private
slots
:
void
_run1HzTasks
(
void
);
void
_run1HzTasks
(
void
);
...
...
src/comm/QGCFlightGearLink.cc
View file @
fe8ff69e
...
@@ -244,7 +244,7 @@ void QGCFlightGearLink::updateControls(quint64 time, float rollAilerons, float p
...
@@ -244,7 +244,7 @@ void QGCFlightGearLink::updateControls(quint64 time, float rollAilerons, float p
}
}
}
}
void
QGCFlightGearLink
::
writeBytes
(
const
QByteArray
data
)
void
QGCFlightGearLink
::
_
writeBytes
(
const
QByteArray
data
)
{
{
//#define QGCFlightGearLink_DEBUG
//#define QGCFlightGearLink_DEBUG
#ifdef QGCFlightGearLink_DEBUG
#ifdef QGCFlightGearLink_DEBUG
...
...
src/comm/QGCFlightGearLink.h
View file @
fe8ff69e
...
@@ -129,7 +129,7 @@ private slots:
...
@@ -129,7 +129,7 @@ private slots:
* @param data Pointer to the data byte array
* @param data Pointer to the data byte array
* @param size The size of the bytes array
* @param size The size of the bytes array
**/
**/
void
writeBytes
(
const
QByteArray
data
);
void
_
writeBytes
(
const
QByteArray
data
);
public
slots
:
public
slots
:
bool
connectSimulation
();
bool
connectSimulation
();
...
...
src/comm/QGCHilLink.h
View file @
fe8ff69e
...
@@ -73,7 +73,7 @@ public slots:
...
@@ -73,7 +73,7 @@ public slots:
virtual
bool
disconnectSimulation
()
=
0
;
virtual
bool
disconnectSimulation
()
=
0
;
private
slots
:
private
slots
:
virtual
void
writeBytes
(
const
QByteArray
)
=
0
;
virtual
void
_
writeBytes
(
const
QByteArray
)
=
0
;
protected:
protected:
virtual
void
setName
(
QString
name
)
=
0
;
virtual
void
setName
(
QString
name
)
=
0
;
...
@@ -81,7 +81,7 @@ protected:
...
@@ -81,7 +81,7 @@ protected:
QGCHilLink
()
:
QGCHilLink
()
:
QThread
()
QThread
()
{
{
connect
(
this
,
&
QGCHilLink
::
_invokeWriteBytes
,
this
,
&
QGCHilLink
::
writeBytes
);
connect
(
this
,
&
QGCHilLink
::
_invokeWriteBytes
,
this
,
&
QGCHilLink
::
_
writeBytes
);
}
}
signals:
signals:
...
...
src/comm/QGCJSBSimLink.cc
View file @
fe8ff69e
...
@@ -255,7 +255,7 @@ void QGCJSBSimLink::updateControls(quint64 time, float rollAilerons, float pitch
...
@@ -255,7 +255,7 @@ void QGCJSBSimLink::updateControls(quint64 time, float rollAilerons, float pitch
//qDebug() << "Updated controls" << state;
//qDebug() << "Updated controls" << state;
}
}
void
QGCJSBSimLink
::
writeBytes
(
const
QByteArray
data
)
void
QGCJSBSimLink
::
_
writeBytes
(
const
QByteArray
data
)
{
{
//#define QGCJSBSimLink_DEBUG
//#define QGCJSBSimLink_DEBUG
#ifdef QGCJSBSimLink_DEBUG
#ifdef QGCJSBSimLink_DEBUG
...
...
src/comm/QGCJSBSimLink.h
View file @
fe8ff69e
...
@@ -122,7 +122,7 @@ private slots:
...
@@ -122,7 +122,7 @@ private slots:
* @param data Pointer to the data byte array
* @param data Pointer to the data byte array
* @param size The size of the bytes array
* @param size The size of the bytes array
**/
**/
void
writeBytes
(
const
QByteArray
data
);
void
_
writeBytes
(
const
QByteArray
data
);
public
slots
:
public
slots
:
bool
connectSimulation
();
bool
connectSimulation
();
...
...
src/comm/QGCXPlaneLink.cc
View file @
fe8ff69e
...
@@ -448,7 +448,7 @@ Eigen::Matrix3f euler_to_wRo(double yaw, double pitch, double roll) {
...
@@ -448,7 +448,7 @@ Eigen::Matrix3f euler_to_wRo(double yaw, double pitch, double roll) {
return
wRo
;
return
wRo
;
}
}
void
QGCXPlaneLink
::
writeBytes
(
const
QByteArray
data
)
void
QGCXPlaneLink
::
_
writeBytes
(
const
QByteArray
data
)
{
{
if
(
data
.
isEmpty
())
return
;
if
(
data
.
isEmpty
())
return
;
...
...
src/comm/QGCXPlaneLink.h
View file @
fe8ff69e
...
@@ -134,7 +134,7 @@ private slots:
...
@@ -134,7 +134,7 @@ private slots:
* @param data Pointer to the data byte array
* @param data Pointer to the data byte array
* @param size The size of the bytes array
* @param size The size of the bytes array
**/
**/
void
writeBytes
(
const
QByteArray
data
);
void
_
writeBytes
(
const
QByteArray
data
);
public
slots
:
public
slots
:
bool
connectSimulation
();
bool
connectSimulation
();
...
...
src/comm/SerialLink.cc
View file @
fe8ff69e
...
@@ -82,7 +82,7 @@ bool SerialLink::_isBootloader()
...
@@ -82,7 +82,7 @@ bool SerialLink::_isBootloader()
return
false
;
return
false
;
}
}
void
SerialLink
::
writeBytes
(
const
QByteArray
data
)
void
SerialLink
::
_
writeBytes
(
const
QByteArray
data
)
{
{
if
(
_port
&&
_port
->
isOpen
())
{
if
(
_port
&&
_port
->
isOpen
())
{
_logOutputDataRate
(
data
.
size
(),
QDateTime
::
currentMSecsSinceEpoch
());
_logOutputDataRate
(
data
.
size
(),
QDateTime
::
currentMSecsSinceEpoch
());
...
...
src/comm/SerialLink.h
View file @
fe8ff69e
...
@@ -164,7 +164,7 @@ private slots:
...
@@ -164,7 +164,7 @@ private slots:
* @param data Pointer to the data byte array
* @param data Pointer to the data byte array
* @param size The size of the bytes array
* @param size The size of the bytes array
**/
**/
void
writeBytes
(
const
QByteArray
data
);
void
_
writeBytes
(
const
QByteArray
data
);
public
slots
:
public
slots
:
void
linkError
(
QSerialPort
::
SerialPortError
error
);
void
linkError
(
QSerialPort
::
SerialPortError
error
);
...
...
src/comm/TCPLink.cc
View file @
fe8ff69e
...
@@ -88,7 +88,7 @@ void TCPLink::_writeDebugBytes(const QByteArray data)
...
@@ -88,7 +88,7 @@ void TCPLink::_writeDebugBytes(const QByteArray data)
}
}
#endif
#endif
void
TCPLink
::
writeBytes
(
const
QByteArray
data
)
void
TCPLink
::
_
writeBytes
(
const
QByteArray
data
)
{
{
#ifdef TCPLINK_READWRITE_DEBUG
#ifdef TCPLINK_READWRITE_DEBUG
_writeDebugBytes
(
data
);
_writeDebugBytes
(
data
);
...
...
src/comm/TCPLink.h
View file @
fe8ff69e
...
@@ -154,7 +154,7 @@ public:
...
@@ -154,7 +154,7 @@ public:
private
slots
:
private
slots
:
// From LinkInterface
// From LinkInterface
void
writeBytes
(
const
QByteArray
data
);
void
_
writeBytes
(
const
QByteArray
data
);
public
slots
:
public
slots
:
void
waitForBytesWritten
(
int
msecs
);
void
waitForBytesWritten
(
int
msecs
);
...
...
src/comm/UDPLink.cc
View file @
fe8ff69e
...
@@ -147,7 +147,7 @@ void UDPLink::removeHost(const QString& host)
...
@@ -147,7 +147,7 @@ void UDPLink::removeHost(const QString& host)
_config
->
removeHost
(
host
);
_config
->
removeHost
(
host
);
}
}
void
UDPLink
::
writeBytes
(
const
QByteArray
data
)
void
UDPLink
::
_
writeBytes
(
const
QByteArray
data
)
{
{
if
(
!
_socket
)
if
(
!
_socket
)
return
;
return
;
...
...
src/comm/UDPLink.h
View file @
fe8ff69e
...
@@ -208,7 +208,7 @@ private slots:
...
@@ -208,7 +208,7 @@ private slots:
* @param data Pointer to the data byte array
* @param data Pointer to the data byte array
* @param size The size of the bytes array
* @param size The size of the bytes array
**/
**/
void
writeBytes
(
const
QByteArray
data
);
void
_
writeBytes
(
const
QByteArray
data
);
protected:
protected:
...
...
src/comm/XbeeLink.cpp
View file @
fe8ff69e
...
@@ -172,7 +172,7 @@ void XbeeLink::_disconnect(void)
...
@@ -172,7 +172,7 @@ void XbeeLink::_disconnect(void)
emit
disconnected
();
emit
disconnected
();
}
}
void
XbeeLink
::
writeBytes
(
const
QByteArray
bytes
)
void
XbeeLink
::
_
writeBytes
(
const
QByteArray
bytes
)
{
{
if
(
!
xbee_nsenddata
(
this
->
m_xbeeCon
,
const_cast
<
char
*>
(
bytes
.
data
()),
bytes
.
size
()))
// return value of 0 is successful written
if
(
!
xbee_nsenddata
(
this
->
m_xbeeCon
,
const_cast
<
char
*>
(
bytes
.
data
()),
bytes
.
size
()))
// return value of 0 is successful written
{
{
...
...
src/comm/XbeeLink.h
View file @
fe8ff69e
...
@@ -46,7 +46,7 @@ public:
...
@@ -46,7 +46,7 @@ public:
qint64
getCurrentInDataRate
()
const
;
qint64
getCurrentInDataRate
()
const
;
private
slots
:
// virtual functions from LinkInterface
private
slots
:
// virtual functions from LinkInterface
void
writeBytes
(
const
QByteArray
bytes
);
void
_
writeBytes
(
const
QByteArray
bytes
);
protected
slots
:
// virtual functions from LinkInterface
protected
slots
:
// virtual functions from LinkInterface
void
readBytes
();
void
readBytes
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment