def connect_to_rig(reactor, port, baudrate=38400): """ Connect to Elecraft radio over a serial port. port: Serial port device name. baudrate: Serial data rate; must match that set on the radio. """ endpoint = SerialPortEndpoint(port, reactor, baudrate=baudrate) factory = FactoryWithArgs.forProtocol(_ElecraftClientProtocol, reactor) protocol = yield endpoint.connect(factory) proxy = protocol._proxy() defer.returnValue( Device(vfo_cell=proxy.iq_center_cell(), components={'rig': proxy}))
def connect_to_rig(reactor, port, baudrate=38400): """ Connect to Elecraft radio over a serial port. port: Serial port device name. baudrate: Serial data rate; must match that set on the radio. """ endpoint = SerialPortEndpoint(port, reactor, baudrate=baudrate) factory = FactoryWithArgs.forProtocol(_ElecraftClientProtocol, reactor) protocol = yield endpoint.connect(factory) proxy = protocol._proxy() defer.returnValue(Device( vfo_cell=proxy.iq_center_cell(), components={'rig': proxy}))
def test_smoke(self): endpoint = SerialPortEndpoint('NOTAREALSERIALPORT', the_reactor, baudrate=115200) IStreamClientEndpoint(endpoint)