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 119 of file AdbClient.cpp.
|
virtualdefault |
|
private |
Definition at line 129 of file AdbClient.cpp.
References error(), and m_conn.
Referenced by SendMessage().
Definition at line 91 of file AdbClient.cpp.
References error(), GetDevices(), and SetDeviceID().
Referenced by lldb_private::platform_android::PlatformAndroid::ConnectRemote(), and ForwardPortWithAdb().
Status AdbClient::DeletePortForwarding | ( | const uint16_t | local_port | ) |
Definition at line 201 of file AdbClient.cpp.
References error(), ReadResponseStatus(), and SendDeviceMessage().
Referenced by DeleteForwardPortWithAdb().
const std::string & AdbClient::GetDeviceID | ( | ) | const |
Definition at line 127 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 142 of file AdbClient.cpp.
References error(), m_conn, ReadMessage(), ReadResponseStatus(), and SendMessage().
Referenced by CreateByDeviceID().
|
private |
Definition at line 300 of file AdbClient.cpp.
References error(), kFAIL, and ReadMessage().
Referenced by ReadResponseStatus().
|
virtual |
Definition at line 417 of file AdbClient.cpp.
References error(), m_conn, and StartSync().
|
private |
Definition at line 349 of file AdbClient.cpp.
References error(), lldb_private::StreamString::GetString(), lldb_private::Stream::Printf(), ReadMessageStream(), ReadResponseStatus(), SendMessage(), and SwitchDeviceTransport().
Referenced by Shell(), and ShellToFile().
|
private |
Definition at line 345 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 240 of file AdbClient.cpp.
References error(), and ReadAllBytes().
Referenced by GetDevices(), and GetResponseError().
|
private |
Definition at line 261 of file AdbClient.cpp.
References lldb::eConnectionStatusSuccess, elapsed(), error(), and m_conn.
Referenced by internalShell().
|
private |
Definition at line 284 of file AdbClient.cpp.
References error(), GetResponseError(), kOKAY, and ReadAllBytes().
Referenced by DeletePortForwarding(), GetDevices(), internalShell(), SetPortForwarding(), SwitchDeviceTransport(), and Sync().
|
private |
Definition at line 234 of file AdbClient.cpp.
References m_device_id, and SendMessage().
Referenced by DeletePortForwarding(), and SetPortForwarding().
|
private |
Definition at line 212 of file AdbClient.cpp.
References Connect(), error(), and m_conn.
Referenced by GetDevices(), internalShell(), SendDeviceMessage(), SwitchDeviceTransport(), and Sync().
|
private |
Definition at line 123 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 169 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 183 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 384 of file AdbClient.cpp.
References error(), and internalShell().
|
virtual |
Definition at line 396 of file AdbClient.cpp.
References error(), lldb_private::FileSpec::GetPath(), and internalShell().
|
private |
Definition at line 324 of file AdbClient.cpp.
References error(), 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 337 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().