Examples of DeviceList


Examples of org.cybergarage.upnp.DeviceList

  public Device findDevice(String udn, Device dev) {
    /*
     * look for the device if it exist, starting from the root on
     * cyberlink struct
     */
    DeviceList devList = dev.getDeviceList();
    Device aux = null;
    for (int i = 0; i < devList.size(); i++) {
      if (devList.getDevice(i).getUDN().equals(udn)) {
        return devList.getDevice(i);
      } else {
        if((aux = findDevice(udn, devList.getDevice(i))) != null)
          return aux;
      }
    }
    return null;
  }
View Full Code Here

Examples of org.usb4java.DeviceList

     *
     * @return The test device or null if none.
     */
    private Device findTestDevice()
    {
        final DeviceList list = new DeviceList();
        if (LibUsb.getDeviceList(this.context, list) <= 0)
        {
            return null;
        }
        try
View Full Code Here

Examples of org.usb4java.DeviceList

    @Test
    public void testGetParent()
    {
        assumeUsbTestsEnabled();
        assumeNotNull(this.device);
        final DeviceList list = new DeviceList();
        LibUsb.getDeviceList(this.context, list);
        try
        {
            final Device parent = LibUsb.getParent(this.device);
View Full Code Here

Examples of org.usb4java.DeviceList

     */
    @Test
    public void testGetAndFreeDeviceList()
    {
        assumeUsbTestsEnabled();
        final DeviceList list = new DeviceList();
        assertTrue(LibUsb.getDeviceList(this.context, list) >= 0);
        LibUsb.freeDeviceList(list, true);

        try
        {
View Full Code Here

Examples of org.usb4java.DeviceList

     */
    @Test
    public void testGetAndFreeDeviceListWithDefaultContext()
    {
        assumeUsbTestsEnabled();
        final DeviceList list = new DeviceList();
        assertEquals(0, LibUsb.init(null));
        try
        {
            assertTrue(LibUsb.getDeviceList(null, list) >= 0);
            LibUsb.freeDeviceList(list, true);
View Full Code Here

Examples of org.usb4java.DeviceList

    @Test(expected = IllegalStateException.class)
    public void testGetDeviceListWithUninitializedContext()
    {
        assumeUsbTestsEnabled();
        final Context context = new Context();
        LibUsb.getDeviceList(context, new DeviceList());
    }
View Full Code Here

Examples of org.usb4java.DeviceList

     */
    @Test(expected = IllegalStateException.class)
    public void testFreeDeviceListWithUninitializedList()
    {
        assumeUsbTestsEnabled();
        LibUsb.freeDeviceList(new DeviceList(), true);
    }
View Full Code Here

Examples of org.usb4java.DeviceList

     */
    @Test
    public void testDeviceList()
    {
        assumeUsbTestsEnabled();
        final DeviceList list = new DeviceList();
        final int result = LibUsb.getDeviceList(this.context, list);
        assertTrue(
            "At least one USB device must be present for the simple unit tests",
            result > 0);
        assertEquals(result, list.getSize());
        int i = 0;
        for (final Device device : list)
        {
            assertNotNull(device);
            assertEquals(device, list.get(i));
            assertEquals(Device.class, device.getClass());
            i++;
        }
        LibUsb.freeDeviceList(list, true);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.