public Usc(DeviceListItem deviceListItem) : base(deviceListItem) { // Determine the number of servos from the product id. switch(getProductID()) { case 0x89: servoCount = 6; break; case 0x8A: servoCount = 12; break; case 0x8B: servoCount = 18; break; case 0x8C: servoCount = 24; break; default: throw new Exception("Unknown product id " + getProductID().ToString("x2") + "."); } }
public Jrk(DeviceListItem deviceListItem) : base(deviceListItem) { switch (getProductID()) { case 0x0083: product = jrkProduct.umc01a; break; case 0x0085: product = jrkProduct.umc02a; break; default: product = jrkProduct.UNKNOWN; break; } }
/// <summary> /// Create a usb device from a deviceListItem /// </summary> /// <param name="handles"></param> protected UsbDevice(DeviceListItem deviceListItem) { LibUsb.throwIfError(libusbOpen(deviceListItem.devicePointer,out privateDeviceHandle), "Error connecting to device."); }
/// <summary> /// true if the devices are the same /// </summary> /// <param name="item"></param> /// <returns></returns> public bool isSameDeviceAs(DeviceListItem item) { return (libusbGetDevice(deviceHandle) == item.devicePointer); }
/// <summary> /// true if the devices are the same /// </summary> /// <param name="item"></param> /// <returns></returns> public bool isSameDeviceAs(DeviceListItem item) { return (devicePointer == item.devicePointer); }
/// <summary> /// Creates an item that doesn't actually refer to a device; just for populating the list with things like "Disconnected" /// </summary> /// <param name="text"></param> public static DeviceListItem CreateDummyItem(String text) { var item = new DeviceListItem(IntPtr.Zero,text,"",0); return item; }
public Programmer(DeviceListItem deviceListItem) : base(deviceListItem) { }
/// <summary> /// Opens (connects to) the selected device, constructing an object that /// we can use to communicate with the device over its native USB interface. /// </summary> public Smc(DeviceListItem deviceListItem) : base(deviceListItem) { this.productId = getProductID(); }
/// <summary> /// This function defines how we will display lists of these devices/bootloaders, both /// in SmcCmd and in the Simple Motor Control Center and in the Firmware Upgrade form. /// </summary> public static void setDeviceListItemText(DeviceListItem dli) { dli.text = productIdToShortModelString(dli.productId) + " #" + dli.serialNumber; }