def get_plugin_for_remote_dev(self, speed, dport, cport):
     from vmc.common.plugin import UnknownDevicePlugin
     dev = UnknownDevicePlugin()
     dev.custom = Customizer()
     dev.dport, dev.cport, dev.baudrate = dport, cport, speed
     port = cport and cport or dport
     return identify_device(port)
def get_unknown_device_plugin(dataport, controlport=None, baudrate=115200,
                              name='Unknown Device'):
    """
    Returns a C{UnknownDevicePlugin} instance configured with the given params
    """
    from vmc.common.hardware.base import Customizer
    plugin = UnknownDevicePlugin()
    plugin.custom = Customizer()
    plugin.dport = dataport
    plugin.cport = controlport
    plugin.baudrate = baudrate
    plugin.name = name
    def identify_device_cb(model):
        plugin.__remote_name__ = model
        return plugin

    from vmc.common.hardware.base import identify_device
    d = identify_device(plugin)
    d.addCallback(identify_device_cb)
    return d
Esempio n. 3
0
def get_unknown_device_plugin(dataport,
                              controlport=None,
                              baudrate=115200,
                              name='Unknown Device'):
    """
    Returns a C{UnknownDevicePlugin} instance configured with the given params
    """
    from vmc.common.hardware.base import Customizer
    plugin = UnknownDevicePlugin()
    plugin.custom = Customizer()
    plugin.dport = dataport
    plugin.cport = controlport
    plugin.baudrate = baudrate
    plugin.name = name

    def identify_device_cb(model):
        plugin.__remote_name__ = model
        return plugin

    from vmc.common.hardware.base import identify_device
    d = identify_device(plugin)
    d.addCallback(identify_device_cb)
    return d