Home | History | Annotate | Download | only in adb

Lines Matching defs:error

49 static bool ReadProtocolString(int fd, std::string* s, std::string* error) {
52 *error = perror_str("protocol fault (couldn't read status length)");
60 *error = perror_str("protocol fault (couldn't read status message)");
92 // take it. If there are more than one, that's an error.
94 std::string error;
95 if (!adb_query("host:devices", &devices, &error)) {
96 printf("no emulator connected: %s\n", error.c_str());
113 static int switch_socket_transport(int fd, std::string* error) {
139 *error = perror_str("write failure during connection");
145 if (!adb_status(fd, error)) {
147 D("Switch transport failed: %s\n", error->c_str());
154 bool adb_status(int fd, std::string* error) {
157 *error = perror_str("protocol fault (couldn't read status)");
166 *error = android::base::StringPrintf("protocol fault (status %02x %02x %02x %02x?!)",
171 ReadProtocolString(fd, error, error);
175 int _adb_connect(const std::string& service, std::string* error) {
178 *error = android::base::StringPrintf("bad service name length (%d)",
190 *error = perror_str("cannot connect to daemon");
194 if (memcmp(&service[0],"host",4) != 0 && switch_socket_transport(fd, error)) {
199 *error = perror_str("write failure during connection");
204 if (!adb_status(fd, error)) {
213 int adb_connect(const std::string& service, std::string* error) {
215 int fd = _adb_connect("host:version", error);
241 if (!ReadProtocolString(fd, &version_string, error)) {
242 goto error;
248 goto error;
253 if (*error == "unknown host service") {
260 fd = _adb_connect("host:kill", error);
274 fd = _adb_connect(service, error);
276 D("_adb_connect error: %s", error->c_str());
283 error:
289 int adb_command(const std::string& service, std::string* error) {
290 int fd = adb_connect(service, error);
292 fprintf(stderr, "error: %s\n", error->c_str());
296 if (!adb_status(fd, error)) {
304 bool adb_query(const std::string& service, std::string* result, std::string* error) {
306 int fd = adb_connect(service, error);
308 fprintf(stderr,"error: %s\n", error->c_str());
313 if (!ReadProtocolString(fd, result, error)) {