adbwp.header¶
Object representation of a message header.
-
class
adbwp.header.
Header
(command, arg0, arg1, data_length, data_checksum, magic)¶ Represents the header of an ADB protocol message.
A header is 24 bytes consisting of 6 32-bit words in little-endian format.
Create new instance of Header(command, arg0, arg1, data_length, data_checksum, magic)
-
property
connect
¶ Indicates whether or not this header represents a connect message.
- Returns
Bool indicating if it is a connect message or not.
- Return type
-
property
auth
¶ Indicates whether or not this header represents an auth message.
- Returns
Bool indicating if it is an auth message or not.
- Type
-
property
open
¶ Indicates whether or not this header represents a open message.
- Returns
Bool indicating if it is a open message or not.
- Return type
-
property
ready
¶ Indicates whether or not this header represents a ready message.
- Returns
Bool indicating if it is a ready message or not.
- Return type
-
property
write
¶ Indicates whether or not this header represents a write message.
- Returns
Bool indicating if it is a write message or not.
- Return type
-
property
close
¶ Indicates whether or not this header represents a close message.
- Returns
Bool indicating if it is a close message or not.
- Return type
-
property
sync
¶ Indicates whether or not this header represents a sync message.
- Returns
Bool indicating if it is a sync message or not.
- Return type
-
property
okay
¶ Indicates whether or not this header represents an okay response.
- Returns
Bool indicating if it is an okay response or not.
- Return type
-
property
fail
¶ Indicates whether or not this header represents a fail response.
- Returns
Bool indicating if it is a fail response or not.
- Return type
-
property
arg0
¶ Alias for field number 1
-
property
arg1
¶ Alias for field number 2
-
property
command
¶ Alias for field number 0
-
count
(value, /)¶ Return number of occurrences of value.
-
property
data_checksum
¶ Alias for field number 4
-
property
data_length
¶ Alias for field number 3
-
index
(value, start=0, stop=9223372036854775807, /)¶ Return first index of value.
Raises ValueError if the value is not present.
-
property
magic
¶ Alias for field number 5
-
property
-
adbwp.header.
new
(command: Union[int, adbwp.enums.Command], arg0: int = 0, arg1: int = 0, data_length: int = 0, data_checksum: int = 0, magic: int = 0) → adbwp.header.Header¶ Create a new
Header
instance with optional default values.- Parameters
- Returns
Header instance created from values
- Return type
-
adbwp.header.
to_bytes
(header: adbwp.header.Header) → bytes¶
-
adbwp.header.
from_bytes
(header: bytes) → adbwp.header.Header¶ Create a
Header
from the givenbytes
.- Parameters
header (
bytes
) – Message header in bytes- Returns
Bytes converted to a header
- Return type
- Raises
UnpackError – When unable to unpack instance from bytes