Skip to content

Commit 2e19bd1

Browse files
committed
Updating adb documentation with minor word-smithing.
Bug: 202323776 Test: Not applicable. Signed-off-by: Shaju Mathew <[email protected]> Change-Id: I1bec5a7635395aeb70da96ba0efffbf64d941ee5
1 parent f2d06db commit 2e19bd1

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

OVERVIEW.TXT

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ As a whole, everything works through the following components:
6262
Host Services:
6363
These services run within the ADB Server and thus do not need to
6464
communicate with a device at all. A typical example is "adb devices"
65-
which is used to return the list of currently known devices and their
66-
states. They are a few other services though.
65+
that is used to return the list of currently known devices and their
66+
states. There are a few other services, though.
6767

6868
Local Services:
6969
These services either run within the adbd daemon, or are started by
@@ -77,7 +77,7 @@ II. Protocol details:
7777

7878
1. Client <-> Server protocol:
7979

80-
This details the protocol used between ADB clients and the ADB
80+
This section details the protocol used between ADB clients and the ADB
8181
server itself. The ADB server listens on TCP:localhost:5037.
8282

8383
A client sends a request using the following format:

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ The Client and the Server are contained in the same executable and both run on t
3333

3434
A smart socket is a simple TCP socket with a smart protocol built on top of it. This is what Clients connect onto from the Host side. The Client must always initiate communication via a human readable request but the response format varies. The smart protocol is documented in [SERVICES.TXT](SERVICES.TXT).
3535

36-
On the other side, the Server communicate with a device via a Transport. adb initially targeted devices connecting over USB, which is restricted to a fixed number of data streams. Therefore, adb multiplexes multiple byte streams over a single pipe via Transport. When devices connecting over other mechanisms (e.g. emulators over TCP) were introduced, the existing transport protocol was maintained.
36+
On the other side, the Server communicates with a device via a Transport. adb initially targeted devices connecting over USB, which is restricted to a fixed number of data streams. Therefore, adb multiplexes multiple byte streams over a single pipe via Transport. When devices connecting over other mechanisms (e.g. emulators over TCP) were introduced, the existing transport protocol was maintained.
3737

3838
## THREADING MODEL and FDEVENT system
3939

40-
At the heart of both the Server and Daemon is a main thread running an fdevent loop, which is an platform-independent abstraction over poll/epoll/WSAPoll monitoring file descriptors events. Requests and services are usually server from the main thread but some service requests result in new threads being spawned.
40+
At the heart of both the Server and Daemon is a main thread running an fdevent loop, which is a platform-independent abstraction over poll/epoll/WSAPoll monitoring file descriptors events. Requests and services are usually served from the main thread but some service requests result in new threads being spawned.
4141

4242
To allow for operations to run on the Main thread, fdevent features a RunQueue combined with an interrupt fd to force polling to return.
4343

@@ -61,7 +61,7 @@ To allow for operations to run on the Main thread, fdevent features a RunQueue c
6161

6262
The asocket, apacket, and amessage constructs exist only to wrap data while it transits on a Transport. An asocket handles a stream of apackets. An apacket consists in a amessage header featuring a command (`A_SYNC`, `A_OPEN`, `A_CLSE`, `A_WRTE`, `A_OKAY`, ...) followed by a payload (find more documentation in [protocol.txt](protocol.txt). There is no `A_READ` command because an asocket is unidirectional. To model a bi-directional stream, asocket have a peer which go in the opposite direction.
6363

64-
An asocket features a buffer where the elemental unit is an apacket. Is traffic is inbound, the buffer stores apacket until they are consumed. If the traffic is oubound, the buffer store apackets until they are sent down the wire (with `A_WRTE` commands).
64+
An asocket features a buffer where the elemental unit is an apacket. If traffic is inbound, the buffer stores the apacket until it is consumed. If the traffic is oubound, the buffer stores apackets until they are sent down the wire (with `A_WRTE` commands).
6565

6666
```
6767
+---------------------ASocket------------------------+

SYNC.TXT

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ SERVICES.TXT sets the connection in sync mode. This mode is a binary mode that
1111
differs from the regular adb protocol. The connection stays in sync mode until
1212
explicitly terminated (see below).
1313

14-
After the initial "sync:" command is sent the server must respond with either
15-
"OKAY" or "FAIL" as per usual.
14+
After the initial "sync:" command is sent, the server must respond with either
15+
"OKAY" or "FAIL" as per the usual protocol.
1616

1717
In sync mode both the server and the client will frequently use eight-byte
1818
packets to communicate. In this document these are called sync requests and sync
19-
responses. The first four bytes are an id that specifies the sync request. It is
20-
represented by four utf-8 characters. The last four bytes are a Little-Endian
21-
integer, with various uses. This number will be called "length" below. In fact
22-
all binary integers are Little-Endian in the sync mode. Sync mode is
23-
implicitly exited after each sync request, and normal adb communication
24-
follows as described in SERVICES.TXT.
19+
responses. The first four bytes constitute an id that specifies the sync request.
20+
It is represented by four ASCII bytes in order to make them more human-readable
21+
when debugging. The last four bytes are a Little-Endian integer, with various
22+
uses. This number shall be called "length" below. In fact, all binary integers
23+
are Little-Endian in the sync mode. Sync mode is implicitly exited after each
24+
sync request, and normal adb communication follows as described in SERVICES.TXT.
2525

2626
The following sync requests are accepted:
2727
LIST - List the files in a folder

0 commit comments

Comments
 (0)