/ C type : Device**
967493
@Field(1)
	protected DeviceList devices(Pointer<Pointer<Device>> devices) {
		this.io.setPointerField(this, 1, devices);
		return this;
	}
143203
function deviceFound(device)
	{
		// For debugging, print advertisement data.
		//console.log(JSON.stringify(device.advertisementData))

		/*
		// Alternative way to identify the device by advertised service UUID.
		if (device.advertisementData.kCBAdvDataServiceUUIDs.indexOf(
			'0000aa10-0000-1000-8000-00805f9b34fb') > -1)
		{
			showMessage('Found the TI SensorTag!')
		}
		*/

		if (device.getName() == 'CC2650 SensorTag')
		{
			showMessage('Found the TI SensorTag!')

			// Stop scanning.
			evothings.easyble.stopScan()

			// Connect.
			connectToDevice(device)
		}
	}
715282
function(me, deviceType, connectionType) {
        if (!self.hasOpenAll) {
            throw new DriverInterfaceError(
                'openAll is not loaded. Use ListAll and Open functions instead.'
            );
        }

        if (deviceType === undefined || connectionType === undefined) {
            throw 'Insufficient parameters for OpenAll - DeviceType and ConnectionType required';
        }

        me.numOpened = new ref.alloc('int', 0);
        me.aHandles = new Buffer(ARCH_INT_NUM_BYTES * LJM_LIST_ALL_SIZE);
        me.aHandles.fill(0);
        me.numErrors = new ref.alloc('int', 0);
        me.errorHandle = new ref.alloc('int', 0);
        me.errors = new Buffer(ARCH_POINTER_SIZE);
        me.errors.fill(0);

        me.devType = driver_const.deviceTypes[deviceType];
        me.deviceType = deviceType;
        me.connType = driver_const.connectionTypes[connectionType];
        me.connectionType = connectionType;
    }
1129368
def devices(self):
        ''''''
        out = self.raw_cmd("devices").communicate()[0].decode("utf-8")
        match = "List of devices attached"
        index = out.find(match)
        if index < 0:
            raise EnvironmentError("adb is not working.")
        return dict([s.split("\t") for s in out[index + len(match):].strip().splitlines() if s.strip()])
876789
def is_char_device(self):
        
        try:
            return S_ISCHR(self.stat().st_mode)
        except OSError as e:
            if e.errno != ENOENT:
                raise
            # Path doesn't exist or is a broken symlink
            # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
            return False
226826
def devices(self):
        """"""
        self.verify_integrity()

        if session.get('u2f_device_management_authorized', False):
            if request.method == 'GET':
                return jsonify(self.get_devices()), 200

            elif request.method == 'DELETE':
                response = self.remove_device(request.json)

                if response['status'] == 'ok':
                    return jsonify(response), 200
                else:
                    return jsonify(response), 404

        return jsonify({'status': 'failed', 'error': 'Unauthorized!'}), 401
286994
def main(device_type):
    """"""
    args = create_agent_parser(device_type=device_type).parse_args()
    util.setup_logging(verbosity=args.verbose, filename=args.log_file)

    public_keys = None
    filename = None
    if args.identity.startswith('/'):
        filename = args.identity
        contents = open(filename, 'rb').read().decode('utf-8')
        # Allow loading previously exported SSH public keys
        if filename.endswith('.pub'):
            public_keys = list(import_public_keys(contents))
        identities = list(parse_config(contents))
    else:
        identities = [device.interface.Identity(
            identity_str=args.identity, curve_name=args.ecdsa_curve_name)]
    for index, identity in enumerate(identities):
        identity.identity_dict['proto'] = u'ssh'
        log.info('identity #%d: %s', index, identity.to_string())

    # override default PIN/passphrase entry tools (relevant for TREZOR/Keepkey):
    device_type.ui = device.ui.UI(device_type=device_type, config=vars(args))
    device_type.ui.cached_passphrase_ack = util.ExpiringCache(
        args.cache_expiry_seconds)

    conn = JustInTimeConnection(
        conn_factory=lambda: client.Client(device_type()),
        identities=identities, public_keys=public_keys)

    sock_path = _get_sock_path(args)
    command = args.command
    context = _dummy_context()
    if args.connect:
        command = ['ssh'] + ssh_args(conn) + args.command
    elif args.mosh:
        command = ['mosh'] + mosh_args(conn) + args.command
    elif args.daemonize:
        out = 'SSH_AUTH_SOCK={0}; export SSH_AUTH_SOCK;\n'.format(sock_path)
        sys.stdout.write(out)
        sys.stdout.flush()
        context = daemon.DaemonContext()
        log.info('running the agent as a daemon on %s', sock_path)
    elif args.foreground:
        log.info('running the agent on %s', sock_path)

    use_shell = bool(args.shell)
    if use_shell:
        command = os.environ['SHELL']
        sys.stdin.close()

    if command or args.daemonize or args.foreground:
        with context:
            return run_server(conn=conn, command=command, sock_path=sock_path,
                              debug=args.debug, timeout=args.timeout)
    else:
        for pk in conn.public_keys():
            sys.stdout.write(pk)
        return 0
625242
function _getDeviceType() {
  let ua = navigator.userAgent;

  // Tablets must be checked before phones.
  if ((/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i).test(ua)) {
    return 5; // "tablet"
  }
  if ((/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/).test(ua)) {
    return 4; // "phone"
  }
  // Consider that all other devices are personal computers
  return 2;
}
1043815
public com.google.protobuf.ByteString
      getDeviceTypeBytes() {
    java.lang.Object ref = deviceType_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      deviceType_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
1169533
def devices():
    
    udids = [udid.strip() for udid in idevice('_id', '-l').splitlines() if udid.strip()]
    return {udid: idevice('name', '-u', udid).decode('utf-8').strip() for udid in udids}
328463
def _getdevicetuple(iobtdevice):
    
    addr = _macutil.formatdevaddr(iobtdevice.getAddressString())
    name = iobtdevice.getName()
    cod = iobtdevice.getClassOfDevice()
    return (addr, name, cod)
734484
def device_info(self):
        """"""
        return {
            'family': self.family,
            'platform': self.platform,
            'os_type': self.os_type,
            'os_version': self.os_version,
            'udi': self.udi,
            # TODO(klstanie): add property to make driver automatically
            'driver_name': self.driver.platform,
            'mode': self.mode,
            'is_console': self.is_console,
            'is_target': self.is_target,
            # 'prompt': self.driver.base_prompt(self.prompt),
            'hostname': self.hostname,
        }
333040
def listDevices(self, interface_id):
        """"""
        LOG.debug("RPCFunctions.listDevices: interface_id = %s, _devices_raw = %s" % (
            interface_id, str(self._devices_raw)))
        remote = interface_id.split('-')[-1]
        if remote not in self._devices_raw:
            self._devices_raw[remote] = []
        if self.systemcallback:
            self.systemcallback('listDevices', interface_id)
        return self._devices_raw[remote]
495334
public void connectDevice(Device device) throws ShanksException {
        if (this.linkedDevices.size() < deviceCapacity) {
            if (!this.linkedDevices.contains(device)) {
                this.linkedDevices.add(device);
                device.connectToLink(this);
                logger.finer("Link " + this.getID() + " has Device "
                        + device.getID() + " in its linked device list.");
            } else {
                logger.finer("Link " + this.getID() + " already has Device "
                        + device.getID() + " in its linked device list.");
            }
        } else {
            if (!this.linkedDevices.contains(device)) {
                logger.warning("Link " + this.getID()
                        + " is full of its capacity. Device " + device.getID()
                        + " was not included in its linked device list.");
                throw new TooManyConnectionException(this);
            } else {
                logger.finer("Link " + this.getID() + " already has Device "
                        + device.getID() + " in its linked device list.");
            }
        }
    }
123589
def get_devices(device_type: DeviceType) -> Iterator[str]:
    
    for device in BASE_PATH.iterdir():
        with open(str(Path(device, 'type'))) as type_file:
            if type_file.readline().strip() == device_type.value:
                yield device.name
842695
def _is_device(path):
    '''
    
    '''
    out = __salt__['cmd.run_all']('file -i {0}'.format(path))
    _verify_run(out)

    # Always [device, mime, charset]. See (file --help)
    return re.split(r'\s+', out['stdout'])[1][:-1] == 'inode/blockdevice'
1094830
function getDevices(): Array<string> {
  try {
    const devicesResult = child_process.execSync('adb devices');
    return parseDevicesResult(devicesResult.toString());
  } catch (e) {
    return [];
  }


}