3 /// JDWP USB message implementation
7 Copyright (C) 2009, Nicolas VIVIEN
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
22 #include "j_message.h"
27 namespace Barry
{ namespace JDWP
{
30 JDWMessage::JDWMessage(int socket
)
36 JDWMessage::~JDWMessage()
41 void JDWMessage::RawSend(Data
&send
, int timeout
)
43 bool ret
= m_jdwp
.Write(m_socket
, send
, timeout
);
46 barryverbose("JDWMessage::RawSend: Socket ID " << m_socket
47 << "\nSent:\n" << send
);
51 bool JDWMessage::RawReceive(Data
&receive
, int timeout
)
55 ret
= m_jdwp
.Read(m_socket
, receive
, timeout
);
58 barryverbose("JDWMessage::RawReceive: Socket ID " << m_socket
59 << "\nReceived:\n" << receive
);
65 void JDWMessage::Send(Data
&send
, int timeout
)
67 RawSend(send
, timeout
);
71 void JDWMessage::Send(Data
&send
, Data
&receive
, int timeout
)
73 RawSend(send
, timeout
);
74 RawReceive(receive
, timeout
);
78 bool JDWMessage::Receive(Data
&receive
, int timeout
)
80 return RawReceive(receive
, timeout
);
83 }} // namespace Barry::JDWP