LLDB mainline
|
#include <AdbClient.h>
Classes | |
class | SyncService |
Public Types | |
enum | UnixSocketNamespace { UnixSocketNamespaceAbstract , UnixSocketNamespaceFileSystem } |
using | DeviceIDList = std::list< std::string > |
Public Member Functions | |
AdbClient () | |
AdbClient (const std::string &device_id) | |
virtual | ~AdbClient () |
const std::string & | GetDeviceID () const |
Status | GetDevices (DeviceIDList &device_list) |
Status | SetPortForwarding (const uint16_t local_port, const uint16_t remote_port) |
Status | SetPortForwarding (const uint16_t local_port, llvm::StringRef remote_socket_name, const UnixSocketNamespace socket_namespace) |
Status | DeletePortForwarding (const uint16_t local_port) |
Status | Shell (const char *command, std::chrono::milliseconds timeout, std::string *output) |
virtual Status | ShellToFile (const char *command, std::chrono::milliseconds timeout, const FileSpec &output_file_spec) |
virtual std::unique_ptr< SyncService > | GetSyncService (Status &error) |
Status | SwitchDeviceTransport () |
Static Public Member Functions | |
static Status | CreateByDeviceID (const std::string &device_id, AdbClient &adb) |
Private Member Functions | |
Status | Connect () |
void | SetDeviceID (const std::string &device_id) |
Status | SendMessage (const std::string &packet, const bool reconnect=true) |
Status | SendDeviceMessage (const std::string &packet) |
Status | ReadMessage (std::vector< char > &message) |
Status | ReadMessageStream (std::vector< char > &message, std::chrono::milliseconds timeout) |
Status | GetResponseError (const char *response_id) |
Status | ReadResponseStatus () |
Status | Sync () |
Status | StartSync () |
Status | internalShell (const char *command, std::chrono::milliseconds timeout, std::vector< char > &output_buf) |
Status | ReadAllBytes (void *buffer, size_t size) |
Private Attributes | |
std::string | m_device_id |
std::unique_ptr< Connection > | m_conn |
Definition at line 26 of file AdbClient.h.
using lldb_private::platform_android::AdbClient::DeviceIDList = std::list<std::string> |
Definition at line 33 of file AdbClient.h.
Enumerator | |
---|---|
UnixSocketNamespaceAbstract | |
UnixSocketNamespaceFileSystem |
Definition at line 28 of file AdbClient.h.
|
default |
|
explicit |
Definition at line 120 of file AdbClient.cpp.
|
virtualdefault |
|
private |
Definition at line 130 of file AdbClient.cpp.
References error(), and m_conn.
Referenced by SendMessage().
Definition at line 91 of file AdbClient.cpp.
References error(), lldb_private::Status::FromErrorStringWithFormat(), GetDevices(), and SetDeviceID().
Referenced by lldb_private::platform_android::PlatformAndroid::ConnectRemote(), and ForwardPortWithAdb().
Status AdbClient::DeletePortForwarding | ( | const uint16_t | local_port | ) |
Definition at line 202 of file AdbClient.cpp.
References error(), ReadResponseStatus(), and SendDeviceMessage().
Referenced by DeleteForwardPortWithAdb().
const std::string & AdbClient::GetDeviceID | ( | ) | const |
Definition at line 128 of file AdbClient.cpp.
References m_device_id.
Referenced by lldb_private::platform_android::PlatformAndroid::ConnectRemote(), and ForwardPortWithAdb().
Status AdbClient::GetDevices | ( | DeviceIDList & | device_list | ) |
Definition at line 143 of file AdbClient.cpp.
References error(), m_conn, ReadMessage(), ReadResponseStatus(), and SendMessage().
Referenced by CreateByDeviceID().
|
private |
Definition at line 301 of file AdbClient.cpp.
References error(), lldb_private::Status::FromErrorStringWithFormat(), kFAIL, and ReadMessage().
Referenced by ReadResponseStatus().
|
virtual |
Definition at line 421 of file AdbClient.cpp.
References error(), m_conn, and StartSync().
|
private |
Definition at line 350 of file AdbClient.cpp.
References error(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::StreamString::GetString(), lldb_private::Stream::Printf(), ReadMessageStream(), ReadResponseStatus(), SendMessage(), and SwitchDeviceTransport().
Referenced by Shell(), and ShellToFile().
|
private |
Definition at line 346 of file AdbClient.cpp.
References m_conn.
Referenced by lldb_private::platform_android::AdbClient::SyncService::internalPushFile(), lldb_private::platform_android::AdbClient::SyncService::internalStat(), lldb_private::platform_android::AdbClient::SyncService::PullFileChunk(), ReadMessage(), ReadResponseStatus(), and lldb_private::platform_android::AdbClient::SyncService::ReadSyncHeader().
|
private |
Definition at line 241 of file AdbClient.cpp.
References error(), and ReadAllBytes().
Referenced by GetDevices(), and GetResponseError().
|
private |
Definition at line 262 of file AdbClient.cpp.
References lldb::eConnectionStatusSuccess, elapsed(), error(), lldb_private::Status::FromErrorString(), and m_conn.
Referenced by internalShell().
|
private |
Definition at line 285 of file AdbClient.cpp.
References error(), GetResponseError(), kOKAY, and ReadAllBytes().
Referenced by DeletePortForwarding(), GetDevices(), internalShell(), SetPortForwarding(), SwitchDeviceTransport(), and Sync().
|
private |
Definition at line 235 of file AdbClient.cpp.
References m_device_id, and SendMessage().
Referenced by DeletePortForwarding(), and SetPortForwarding().
|
private |
Definition at line 213 of file AdbClient.cpp.
References Connect(), error(), and m_conn.
Referenced by GetDevices(), internalShell(), SendDeviceMessage(), SwitchDeviceTransport(), and Sync().
|
private |
Definition at line 124 of file AdbClient.cpp.
References m_device_id.
Referenced by CreateByDeviceID().
Status AdbClient::SetPortForwarding | ( | const uint16_t | local_port, |
const uint16_t | remote_port | ||
) |
Definition at line 170 of file AdbClient.cpp.
References error(), ReadResponseStatus(), and SendDeviceMessage().
Referenced by ForwardPortWithAdb().
Status AdbClient::SetPortForwarding | ( | const uint16_t | local_port, |
llvm::StringRef | remote_socket_name, | ||
const UnixSocketNamespace | socket_namespace | ||
) |
Definition at line 184 of file AdbClient.cpp.
References error(), kSocketNamespaceAbstract, kSocketNamespaceFileSystem, PATH_MAX, ReadResponseStatus(), SendDeviceMessage(), and UnixSocketNamespaceAbstract.
Status AdbClient::Shell | ( | const char * | command, |
std::chrono::milliseconds | timeout, | ||
std::string * | output | ||
) |
Definition at line 386 of file AdbClient.cpp.
References error(), and internalShell().
|
virtual |
Definition at line 398 of file AdbClient.cpp.
References error(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::FileSpec::GetPath(), and internalShell().
|
private |
Definition at line 324 of file AdbClient.cpp.
References error(), lldb_private::Status::FromErrorStringWithFormat(), SwitchDeviceTransport(), and Sync().
Referenced by GetSyncService().
Status AdbClient::SwitchDeviceTransport | ( | ) |
Definition at line 313 of file AdbClient.cpp.
References error(), m_device_id, ReadResponseStatus(), and SendMessage().
Referenced by internalShell(), and StartSync().
|
private |
Definition at line 338 of file AdbClient.cpp.
References error(), ReadResponseStatus(), and SendMessage().
Referenced by StartSync().
|
private |
Definition at line 137 of file AdbClient.h.
Referenced by Connect(), lldb_private::platform_android::AdbClient::SyncService::executeCommand(), GetDevices(), GetSyncService(), lldb_private::platform_android::AdbClient::SyncService::IsConnected(), lldb_private::platform_android::AdbClient::SyncService::ReadAllBytes(), ReadAllBytes(), ReadMessageStream(), SendMessage(), and lldb_private::platform_android::AdbClient::SyncService::SendSyncRequest().
|
private |
Definition at line 136 of file AdbClient.h.
Referenced by GetDeviceID(), SendDeviceMessage(), SetDeviceID(), and SwitchDeviceTransport().