Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Institute of Technical Acoustics (ITA)
ITADataSources
Commits
45473e1f
Commit
45473e1f
authored
Jan 24, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Something is running.
parent
7a5b48e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/ITANetAudioMessage.cpp
src/ITANetAudioMessage.cpp
+6
-6
No files found.
src/ITANetAudioMessage.cpp
View file @
45473e1f
...
@@ -198,19 +198,18 @@ void CITANetAudioMessage::ReadAnswer()
...
@@ -198,19 +198,18 @@ void CITANetAudioMessage::ReadAnswer()
{
{
#if NET_AUDIO_SHOW_TRAFFIC
#if NET_AUDIO_SHOW_TRAFFIC
vstr
::
out
()
<<
"CITANetAudioMessage [ Reading] yet unkown answer from message "
<<
m_nMessageType
<<
" (id="
<<
std
::
setw
(
4
)
<<
m_nMessageId
<<
") OK"
<<
std
::
endl
;
vstr
::
out
()
<<
"CITANetAudioMessage [ Reading] yet unkown answer from
initial
message
type
"
<<
m_nMessageType
<<
" (id="
<<
std
::
setw
(
4
)
<<
m_nMessageId
<<
") OK"
<<
std
::
endl
;
#endif
#endif
VistaType
::
sint32
nMessagePayloadSize
;
VistaType
::
sint32
nMessagePayloadSize
;
int
nReturn
;
int
nReturn
;
nReturn
=
m_pConnection
->
ReadInt32
(
nMessagePayloadSize
);
nReturn
=
m_pConnection
->
ReadInt32
(
nMessagePayloadSize
);
assert
(
nReturn
==
sizeof
(
VistaType
::
sint32
)
);
#if NET_AUDIO_SHOW_TRAFFIC
#if NET_AUDIO_SHOW_TRAFFIC
vstr
::
out
()
<<
"CITANetAudioMessage [ Reading]
1. return is
"
<<
nReturn
<<
" (id="
<<
std
::
setw
(
4
)
<<
m_nMessageId
<<
") OK"
<<
std
::
endl
;
vstr
::
out
()
<<
"CITANetAudioMessage [ Reading]
Answer type
"
<<
nReturn
<<
" (id="
<<
std
::
setw
(
4
)
<<
m_nMessageId
<<
") OK"
<<
std
::
endl
;
#endif
#endif
if
(
nReturn
!=
sizeof
(
VistaType
::
sint32
)
)
ITA_EXCEPT1
(
UNKNOWN
,
"Protokoll error, was expecting 4 bytes to read message size, but received "
+
std
::
to_string
(
nReturn
)
);
//
w
e need at least the
two protocol types
//
W
e need at least the
message type and message id in payload
assert
(
nMessagePayloadSize
>=
2
*
sizeof
(
VistaType
::
sint32
)
);
assert
(
nMessagePayloadSize
>=
2
*
sizeof
(
VistaType
::
sint32
)
);
if
(
nMessagePayloadSize
>
(
int
)
m_vecIncomingBuffer
.
size
()
)
if
(
nMessagePayloadSize
>
(
int
)
m_vecIncomingBuffer
.
size
()
)
...
@@ -233,8 +232,9 @@ void CITANetAudioMessage::ReadAnswer()
...
@@ -233,8 +232,9 @@ void CITANetAudioMessage::ReadAnswer()
ITA_EXCEPT1
(
UNKNOWN
,
"Protokoll error, Received less bytes than expected when trying to receive answer"
);
ITA_EXCEPT1
(
UNKNOWN
,
"Protokoll error, Received less bytes than expected when trying to receive answer"
);
// Swap data to deserialization buffer
// Swap data to deserialization buffer
m_oIncoming
.
SetBuffer
(
&
m_vecIncomingBuffer
[
0
],
n
Return
);
m_oIncoming
.
SetBuffer
(
&
m_vecIncomingBuffer
[
0
],
n
MessagePayloadSize
,
false
);
// Take out the two protocol variables type and message id from deserialization buffer
m_nAnswerType
=
ReadInt
();
m_nAnswerType
=
ReadInt
();
int
nMessageID
=
ReadInt
();
int
nMessageID
=
ReadInt
();
assert
(
nMessageID
==
m_nMessageId
);
assert
(
nMessageID
==
m_nMessageId
);
...
...
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