|
|
|
@ -30,15 +30,19 @@ class TransportIOError(Exception):
|
|
|
|
|
class Transport(abc.ABC): |
|
|
|
|
''' Abstract transport layer for DebugMux ''' |
|
|
|
|
|
|
|
|
|
@abc.abstractmethod |
|
|
|
|
def connect(self, opts: dict) -> None: |
|
|
|
|
''' Establish connection to the target and enter DebugMux mode ''' |
|
|
|
|
|
|
|
|
|
@abc.abstractmethod |
|
|
|
|
def disconnect(self) -> None: |
|
|
|
|
''' Escape DebugMux mode and terminate connection with the target ''' |
|
|
|
|
|
|
|
|
|
@abc.abstractmethod |
|
|
|
|
def write(self, data: bytes) -> int: |
|
|
|
|
''' Write the given data bytes ''' |
|
|
|
|
|
|
|
|
|
@abc.abstractmethod |
|
|
|
|
def read(self, length: int = 0) -> bytes: |
|
|
|
|
''' Read the given number of bytes ''' |
|
|
|
|
|
|
|
|
|