示例#1
-1
def getHandleToLowSpeedDevice(vencor_id, device_id):

  # find the device
  device = LibUSB.get_device_with_vid_pid(vendor_id, device_id)
  if device is None:
    raise Exception("unable to find X10 device")
  LOGGER.debug("found X10 device")

  # the cm15 is a low speed device (1.5MBit/s) which means that its
  # maximum data payload is 8 bytes per transfer
  assert(device.device_speed() == LibUSB.SPEED_LOW)

  # open the device:
  dh = device.open()
  LOGGER.debug("opened a handle to the device")

  return dh