• Home
  • History
  • Annotate
  • Raw
  • Download

Lines Matching refs:t

101 void handle_online(atransport *t)  in handle_online()  argument
104 t->online = 1; in handle_online()
107 void handle_offline(atransport *t) in handle_offline() argument
111 t->online = 0; in handle_offline()
115 close_all_sockets(t); in handle_offline()
117 t->RunDisconnects(); in handle_offline()
161 static void send_ready(unsigned local, unsigned remote, atransport *t) in send_ready() argument
168 send_packet(p, t); in send_ready()
171 static void send_close(unsigned local, unsigned remote, atransport *t) in send_close() argument
178 send_packet(p, t); in send_close()
207 void send_connect(atransport* t) { in send_connect() argument
211 cp->msg.arg0 = t->get_protocol_version(); in send_connect()
212 cp->msg.arg1 = t->get_max_payload(); in send_connect()
225 send_packet(cp, t); in send_connect()
237 void parse_banner(const std::string& banner, atransport* t) { in parse_banner() argument
246 t->SetFeatures(""); in parse_banner()
260 qual_overwrite(&t->product, value); in parse_banner()
262 qual_overwrite(&t->model, value); in parse_banner()
264 qual_overwrite(&t->device, value); in parse_banner()
266 t->SetFeatures(value); in parse_banner()
274 t->connection_state = kCsBootloader; in parse_banner()
278 t->connection_state = kCsDevice; in parse_banner()
282 t->connection_state = kCsRecovery; in parse_banner()
286 t->connection_state = kCsSideload; in parse_banner()
290 t->connection_state = kCsHost; in parse_banner()
294 static void handle_new_connection(atransport* t, apacket* p) { in handle_new_connection() argument
295 if (t->connection_state != kCsOffline) { in handle_new_connection()
296 t->connection_state = kCsOffline; in handle_new_connection()
297 handle_offline(t); in handle_new_connection()
300 t->update_version(p->msg.arg0, p->msg.arg1); in handle_new_connection()
303 parse_banner(banner, t); in handle_new_connection()
306 handle_online(t); in handle_new_connection()
309 handle_online(t); in handle_new_connection()
310 send_connect(t); in handle_new_connection()
312 send_auth_request(t); in handle_new_connection()
317 void handle_packet(apacket *p, atransport *t) in handle_packet() argument
330 send_packet(p, t); in handle_packet()
332 send_connect(t); in handle_packet()
335 t->connection_state = kCsOffline; in handle_packet()
336 handle_offline(t); in handle_packet()
337 send_packet(p, t); in handle_packet()
342 handle_new_connection(t, p); in handle_packet()
347 t->connection_state = kCsUnauthorized; in handle_packet()
348 t->key = adb_auth_nextkey(t->key); in handle_packet()
349 if (t->key) { in handle_packet()
350 send_auth_response(p->data, p->msg.data_length, t); in handle_packet()
353 send_auth_publickey(t); in handle_packet()
356 if (adb_auth_verify(t->token, p->data, p->msg.data_length)) { in handle_packet()
357 adb_auth_verified(t); in handle_packet()
358 t->failed_auth_attempts = 0; in handle_packet()
360 if (t->failed_auth_attempts++ > 10) in handle_packet()
362 send_auth_request(t); in handle_packet()
365 adb_auth_confirm_key(p->data, p->msg.data_length, t); in handle_packet()
370 if (t->online && p->msg.arg0 != 0 && p->msg.arg1 == 0) { in handle_packet()
373 s = create_local_service_socket(name, t); in handle_packet()
375 send_close(0, p->msg.arg0, t); in handle_packet()
377 s->peer = create_remote_socket(p->msg.arg0, t); in handle_packet()
379 send_ready(s->id, s->peer->id, t); in handle_packet()
386 if (t->online && p->msg.arg0 != 0 && p->msg.arg1 != 0) { in handle_packet()
390 s->peer = create_remote_socket(p->msg.arg0, t); in handle_packet()
398 p->msg.arg0, p->msg.arg1, s->peer->id, p->msg.arg1, t->serial); in handle_packet()
404 send_close(p->msg.arg1, p->msg.arg0, t); in handle_packet()
410 if (t->online && p->msg.arg1 != 0) { in handle_packet()
422 if (p->msg.arg0 == 0 && s->peer && s->peer->transport != t) { in handle_packet()
424 p->msg.arg1, t->serial, s->peer->transport->serial); in handle_packet()
433 if (t->online && p->msg.arg0 != 0 && p->msg.arg1 != 0) { in handle_packet()
440 send_ready(s->id, rid, t); in handle_packet()
1038 atransport* t = acquire_one_transport(type, serial, nullptr, &error); in handle_host_request() local
1039 if (t != nullptr) { in handle_host_request()
1040 s->transport = t; in handle_host_request()
1062 atransport* t = acquire_one_transport(type, serial, nullptr, &error); in handle_host_request() local
1063 if (t != nullptr) { in handle_host_request()
1064 SendOkay(reply_fd, FeatureSetToString(t->features())); in handle_host_request()
1087 atransport* t = find_transport(serial.c_str()); in handle_host_request() local
1088 if (t == nullptr) { in handle_host_request()
1092 kick_transport(t); in handle_host_request()
1104 atransport* t = acquire_one_transport(type, serial, nullptr, &error); in handle_host_request() local
1105 if (t) { in handle_host_request()
1106 return SendOkay(reply_fd, t->serial ? t->serial : "unknown"); in handle_host_request()
1113 atransport* t = acquire_one_transport(type, serial, nullptr, &error); in handle_host_request() local
1114 if (t) { in handle_host_request()
1115 return SendOkay(reply_fd, t->devpath ? t->devpath : "unknown"); in handle_host_request()
1122 atransport* t = acquire_one_transport(type, serial, nullptr, &error); in handle_host_request() local
1123 if (t) { in handle_host_request()
1124 return SendOkay(reply_fd, t->connection_state_name()); in handle_host_request()