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
|
|
|
|
|
2016-05-05 01:16:17 +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)
|
2016-02-10 15:46:58 +00:00
|
|
|
|
2012-12-03 15:36:03 +00:00
|
|
|
def _open(self):
|
|
|
|
pass
|
2016-02-10 15:46:58 +00:00
|
|
|
|
2012-12-03 15:36:03 +00:00
|
|
|
def _close(self):
|
|
|
|
pass
|
2016-02-10 15:46:58 +00:00
|
|
|
|
2012-12-03 15:36:03 +00:00
|
|
|
def ready_to_read(self):
|
|
|
|
return False
|
2016-02-10 15:46:58 +00:00
|
|
|
|
2014-07-26 14:27:28 +00:00
|
|
|
def _write(self, msg, protobuf_msg):
|
2012-12-03 15:36:03 +00:00
|
|
|
pass
|
2016-02-10 15:46:58 +00:00
|
|
|
|
2012-12-03 15:36:03 +00:00
|
|
|
def _read(self):
|
2014-07-26 14:27:28 +00:00
|
|
|
raise NotImplementedException("Not implemented")
|