blob: 382e30455da79ca574bc92cfcfef2a9101353989 [file] [log] [blame]
Oleksiy Vyalov05a55de2015-03-23 21:03:02 +00001//===-- AdbClient.h ---------------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_AdbClient_h_
11#define liblldb_AdbClient_h_
12
13// C Includes
14
15// C++ Includes
16
17#include <list>
18#include <string>
19
20// Other libraries and framework includes
21// Project includes
22
23#include "lldb/Core/Error.h"
24
25namespace lldb_private {
26
27class AdbClient
28{
29public:
30 using DeviceIDList = std::list<std::string>;
31
32 AdbClient () = default;
33 explicit AdbClient (const std::string &device_id);
34
35 void
36 SetDeviceID (const std::string& device_id);
37
38 Error
39 GetDevices (DeviceIDList &device_list);
40
41 Error
42 SetPortForwarding (const uint16_t port);
43
44 Error
45 DeletePortForwarding (const uint16_t port);
46
47private:
48 Error
49 Connect ();
50
51 Error
52 SendMessage (const std::string &packet);
53
54 Error
55 SendDeviceMessage (const std::string &packet);
56
57 Error
58 ReadMessage (std::string &message);
59
60 Error
61 ReadResponseStatus ();
62
63 std::string m_device_id;
64 ConnectionFileDescriptor m_conn;
65};
66
67} // namespace lldb_private
68
69#endif // liblldb_AdbClient_h_