Skip to content

Commit

Permalink
Fix documentation ('connect' doesn't return 'banner')
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffLIrion committed Jun 27, 2020
1 parent 9d1e871 commit 649cc0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions adb_shell/adb_device.py
Expand Up @@ -176,7 +176,7 @@ def connect(self, rsa_keys=None, transport_timeout_s=None, auth_timeout_s=consta
1. If the last ``arg0`` was not :const:`adb_shell.constants.AUTH_TOKEN`, raise an exception
2. Sign the last ``banner`` and send it in an ``b'AUTH'`` message
3. Unpack the ``cmd``, ``arg0``, and ``banner`` fields from the response via :func:`adb_shell.adb_message.unpack`
4. If ``cmd`` is ``b'CNXN'``, set transfer maxdata and return ``banner``
4. If ``cmd`` is ``b'CNXN'``, set transfer maxdata and return ``True``
7. None of the keys worked, so send ``rsa_keys[0]``'s public key; if the response does not time out, we must have connected successfully
Expand Down Expand Up @@ -247,7 +247,7 @@ def connect(self, rsa_keys=None, transport_timeout_s=None, auth_timeout_s=consta
# 6.3. Unpack the ``cmd``, ``arg0``, and ``banner`` fields from the response via :func:`adb_shell.adb_message.unpack`
cmd, arg0, arg1, banner = self._read([constants.CNXN, constants.AUTH], adb_info)

# 6.4. If ``cmd`` is ``b'CNXN'``, return ``banner``
# 6.4. If ``cmd`` is ``b'CNXN'``, we are done
if cmd == constants.CNXN:
self._maxdata = arg1 # CNXN maxdata
self._available = True
Expand Down
4 changes: 2 additions & 2 deletions adb_shell/adb_device_async.py
Expand Up @@ -169,7 +169,7 @@ async def connect(self, rsa_keys=None, transport_timeout_s=None, auth_timeout_s=
1. If the last ``arg0`` was not :const:`adb_shell.constants.AUTH_TOKEN`, raise an exception
2. Sign the last ``banner`` and send it in an ``b'AUTH'`` message
3. Unpack the ``cmd``, ``arg0``, and ``banner`` fields from the response via :func:`adb_shell.adb_message.unpack`
4. If ``cmd`` is ``b'CNXN'``, set transfer maxdata size and return ``banner``
4. If ``cmd`` is ``b'CNXN'``, set transfer maxdata size and return ``True``
7. None of the keys worked, so send ``rsa_keys[0]``'s public key; if the response does not time out, we must have connected successfully
Expand Down Expand Up @@ -240,7 +240,7 @@ async def connect(self, rsa_keys=None, transport_timeout_s=None, auth_timeout_s=
# 6.3. Unpack the ``cmd``, ``arg0``, and ``banner`` fields from the response via :func:`adb_shell.adb_message.unpack`
cmd, arg0, arg1, banner = await self._read([constants.CNXN, constants.AUTH], adb_info)

# 6.4. If ``cmd`` is ``b'CNXN'``, return ``banner``
# 6.4. If ``cmd`` is ``b'CNXN'``, we are done
if cmd == constants.CNXN:
self._maxdata = arg1 # CNXN maxdata
self._available = True
Expand Down

0 comments on commit 649cc0d

Please sign in to comment.