aio_adb_shell.handle.base_handle module

A base class for handles used to communicate with a device.

class aio_adb_shell.handle.base_handle.BaseHandle[source]

Bases: abc.ABC

A base handle class.

_abc_impl = <_abc_data object>
abstract async bulk_read(numbytes, timeout_s=None)[source]

Read data from the device.

Parameters
  • numbytes (int) – The maximum amount of data to be received

  • timeout_s (float, None) – A timeout for the read operation

Returns

The received data

Return type

bytes

abstract async bulk_write(data, timeout_s=None)[source]

Send data to the device.

Parameters
  • data (bytes) – The data to be sent

  • timeout_s (float, None) – A timeout for the write operation

Returns

The number of bytes sent

Return type

int

abstract async close()[source]

Close the connection.

abstract async connect(timeout_s=None)[source]

Create a connection to the device.

Parameters

timeout_s (float, None) – A connection timeout