Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
19647652
Commit
19647652
authored
Apr 13, 2011
by
lm
Browse files
Improved debug output
parent
a7383a1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/comm/UDPLink.cc
View file @
19647652
...
...
@@ -140,20 +140,21 @@ void UDPLink::removeHost(const QString& hostname)
void
UDPLink
::
writeBytes
(
const
char
*
data
,
qint64
size
)
{
// Broadcast to all connected systems
//QList<QHostAddress>::iterator h;
// for (h = hosts->begin(); h != hosts->end(); ++h)
for
(
int
h
=
0
;
h
<
hosts
.
size
();
h
++
)
{
for
(
int
h
=
0
;
h
<
hosts
.
size
();
h
++
)
{
QHostAddress
currentHost
=
hosts
.
at
(
h
);
quint16
currentPort
=
ports
.
at
(
h
);
qDebug
()
<<
"WRITING TO"
<<
currentHost
.
toIPv4Address
()
<<
currentPort
;
QString
bytes
;
QString
ascii
;
//qDebug() << "WRITING DATA TO" << currentHost.toString() << currentPort;
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
unsigned
char
v
=
data
[
i
];
qDebug
(
"%02x "
,
v
);
unsigned
char
v
=
data
[
i
];
bytes
.
append
(
QString
().
sprintf
(
"%02x "
,
v
));
ascii
.
append
(
data
[
i
]);
}
qDebug
()
<<
"Sent to "
<<
currentHost
.
toString
()
<<
":"
<<
currentPort
;
qDebug
()
<<
"Sent"
<<
size
<<
"bytes to"
<<
currentHost
.
toString
()
<<
":"
<<
currentPort
<<
"data:"
;
qDebug
()
<<
bytes
;
qDebug
()
<<
"ASCII:"
<<
ascii
;
socket
->
writeDatagram
(
data
,
size
,
currentHost
,
currentPort
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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