Examples of Device


Examples of ch.ntb.inf.libusbJava.Device

    System.out.println();
  }

  public static void main(String[] args) {
    // get a device instance with vendor id and product id
    Device dev = USB.getDevice((short) 0x8235, (short) 0x0100);
    try {
      // data to write to the device
      byte[] data = new byte[] { 0, 1, 2, 3 };
      // data read from the device
      byte[] readData = new byte[data.length];

      // open the device with configuration 1, interface 0 and without
      // altinterface
      // this will initialise Libusb for you
      dev.open(1, 0, -1);
      // write some data to the device
      // 0x03 is the endpoint address of the OUT endpoint 3 (from PC to
      // device)
      dev.writeInterrupt(0x02, data, data.length, 2000, false);
      // read some data from the device
      // 0x84 is the endpoint address of the IN endpoint 4 (from PC to
      // device)
      // bit 7 (0x80) is set in case of an IN endpoint
      dev.readInterrupt(0x86, readData, readData.length, 2000, false);
      // log the data from the device
      logData(readData);
      // close the device
      dev.close();
    } catch (USBException e) {
      // if an exception occures during connect or read/write an exception
      // is thrown
      e.printStackTrace();
    }
View Full Code Here

Examples of ch.rakudave.jnetmap.model.device.Device

  @Override
  public void statusChanged(DeviceEvent e, Map m) {
    boolean match = filter.matches(e);
    Logger.debug("Attempting to create log-entry, filtered: " + !match);
    if (!match) return;
    Device d = e.getItem();
    StringBuffer sb = new StringBuffer();
    sb.append(new Date().toString()).append(" [");
    sb.append(m.getFileName()).append("] - ");
    if (Type.INTERFACE_STATUS_CHANGED.equals(e.getType())) {
      NetworkIF nif = (NetworkIF) e.getSubject();
      sb.append(nif.getName()).append(" ");
      sb.append(nif.getAddress()).append(": ");
      sb.append(nif.getStatus().getMessage());
      sb.append(" (").append(d.getName()).append(")");
    } else {
      sb.append(d.getName()).append(": ");
      sb.append(d.getStatus().getMessage());
    }
    if (writer != null) writer.println(sb.toString());
  }
View Full Code Here

Examples of com.aelitis.azureus.core.devices.Device

         
          if (isWritableUSB) {
            addDevice(name, id, root, new File(root, "videos"), true);
          } else {
            //Fixup old bug where we were adding Samsung hard drives as devices
            Device existingDevice = getDeviceMediaRendererByClassification(id);
            if (existingDevice != null) {
              existingDevice.remove();
            }
          }
          return;
        } else if (isWritableUSB && sVendor.toLowerCase().equals("rim")) {
          String name = sVendor;
View Full Code Here

Examples of com.aelitis.azureus.core.devices.Device

    if ( auto ){
     
      throw( new DeviceManagerException( "Device can't be added manually" ));
    }
   
    Device res = manager.createDevice( Device.DT_MEDIA_RENDERER, uid, classification, name, manual );
   
    return( res );
  }
View Full Code Here

Examples of com.aelitis.azureus.core.devices.Device

    TranscodeFile tf = (TranscodeFile) cell.getDataSource();
    if (tf == null) {
      return;
    }
   
    Device d = tf.getDevice();
   
    String value = null;
   
    if ( d instanceof DeviceMediaRenderer ){
     
View Full Code Here

Examples of com.aelitis.azureus.core.devices.Device

         
          for ( DeviceTemplate template: templates ){
           
            if ( !template.isAuto()){
         
              Device device = template.createInstance( template.getName() + " test!" );
         
              device.requestAttention();
             
              break;
            }
          }
         
View Full Code Here

Examples of com.alibaba.jstorm.container.cgroup.Device

    List<String> strings = CgroupUtils.readFileByLine(Constants.getDir(
        this.dir, BLKIO_WEIGHT_DEVICE));
    Map<Device, Integer> result = new HashMap<Device, Integer>();
    for (String string : strings) {
      String[] strArgs = string.split(" ");
      Device device = new Device(strArgs[0]);
      Integer weight = Integer.valueOf(strArgs[1]);
      result.put(device, weight);
    }
    return result;
  }
View Full Code Here

Examples of com.jbidwatcher.util.db.Device

    JConfig.log().logMessage("Returning: " + json);
    return (new StringBuffer(json));
  }

  public StringBuffer register(String device) {
    Device d = Device.findByDevice(device);
    if(d == null) {
      d = new Device(device);
    } else {
      d.refreshKey();
    }

    JConfig.log().logMessage("Registered device: " + device);

    MQFactory.getConcrete("Swing").enqueue("SECURITY " + d.getString("security_key"));
    return new StringBuffer("Enter the security digits");
  }
View Full Code Here

Examples of com.jdroid.javaweb.push.Device

      MulticastResult multicastResult = sender.send(message, Lists.newArrayList(registrationIds), 10);
     
      // analyze the results
      for (int i = 0; i < registrationIds.size(); i++) {
        Result result = multicastResult.getResults().get(i);
        Device device = devices.get(i);
        if (result.getMessageId() != null) {
          LOGGER.info("Sent GCM message to " + device);
          String canonicalRegId = result.getCanonicalRegistrationId();
          if (canonicalRegId != null) {
            // same device has more than on registration id: update it
            device.updateRegistrationId(canonicalRegId);
            pushResponse.addDeviceToUpdate(device);
            LOGGER.info("Updated registration id of device " + device);
          }
        } else {
          String error = result.getErrorCodeName();
View Full Code Here

Examples of com.joshondesign.arduino.common.Device

            @Override
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
                Component comp = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
                if(comp instanceof JLabel && value instanceof Device) {
                    JLabel label = (JLabel) comp;
                    Device device = (Device) value;
                    label.setText(device.getName());
                }
                return comp;
            }
        });
       
        deviceList.addListSelectionListener(new ListSelectionListener() {
            @Override
            public void valueChanged(ListSelectionEvent e) {
                if(e.getValueIsAdjusting()) return;
                Device device = (Device) deviceList.getSelectedValue();
                deviceName.setText(device.getName());
                deviceMaxSize.setText(""+device.getMaxSize());
                deviceMaxSpeed.setText(""+device.getUploadSpeed());
                deviceCPUName.setText(device.getMCU());
            }
        });
    }
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.