2012-12-03 15:36:03 +00:00
|
|
|
'''FakeTransport implements dummy interface for Transport.'''
|
|
|
|
|
|
|
|
# Local serial port loopback: socat PTY,link=COM8 PTY,link=COM9
|
|
|
|
|
2013-01-05 14:42:09 +00:00
|
|
|
from transport import Transport, NotImplementedException
|
2012-12-03 15:36:03 +00:00
|
|
|
|
|
|
|
class FakeTransport(Transport):
|
|
|
|
def __init__(self, device, *args, **kwargs):
|
|
|
|
super(FakeTransport, self).__init__(device, *args, **kwargs)
|
|
|
|
|
|
|
|
def _open(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def _close(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def ready_to_read(self):
|
|
|
|
return False
|
|
|
|
|
|
|
|
def _write(self, msg):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def _read(self):
|
2013-01-05 14:42:09 +00:00
|
|
|
raise NotImplementedException("Not implemented")
|