Read a handle from the device.

        You must be connected to do this.
191915
def read_handle(self, handle: int) -> bytes:
        
        if self._peripheral is None:
            raise BluetoothBackendException('not connected to backend')
        return self._peripheral.readCharacteristic(handle)
1137823
def read(self, device=None, offset=0, bs=None, count=1):
        
        volume = self.get_volume(device)
        block_size = bs or BLOCK_SIZE

        offset = int(offset) * block_size
        count = int(count)
        print("Offset: ", offset)

        total = 0
        with directio.open(volume['path'], buffered=block_size) as file:
            file.seek(offset)
            for i in range(0, count):
                total += os.write(sys.stdout.fileno(), file.read(block_size))
        os.write(sys.stdout.fileno(), "\nRead: %d Bytes\n" % total)
1301899
function (deviceHandle, functionName, errorCallback) {
			var device = winble.deviceManager.deviceList[deviceHandle];
			if (device == null) {
				var msg = "Could not find the requested device handle '" + deviceHandle + "'";
				winble.logger.logError(functionName, msg);
				errorCallback(winble.DEVICE_NOT_FOUND);
			}
			return (device);
		}
241413
def read(self):
        """"""
        try:
            return self.reader.recv(1)
        except socket.error:
            ex = exception().exception
            if ex.args[0] == errno.EWOULDBLOCK:
                raise IOError
            raise
1010435
def read
      handle  = File.open(@path, 'r')
      content = handle.read

      handle.close

      content
    end
707021
def read(self, sensors):
        """"""
        payload = {'destDev': [], 'keys': list(set([s.key for s in sensors]))}
        if self.sma_sid is None:
            yield from self.new_session()
            if self.sma_sid is None:
                return False
        body = yield from self._fetch_json(URL_VALUES, payload=payload)

        # On the first 401 error we close the session which will re-login
        if body.get('err') == 401:
            _LOGGER.warning("401 error detected, closing session to force "
                            "another login attempt")
            self.close_session()
            return False

        _LOGGER.debug(json.dumps(body))
        for sen in sensors:
            if sen.extract_value(body):
                _LOGGER.debug("%s\t= %s %s",
                              sen.name, sen.value, sen.unit)
        return True
1306416
def ReadUntil(self, *expected_cmds):
        """"""
        cmd, remote_id, local_id, data = AdbMessage.Read(
            self.usb, expected_cmds, self.timeout_ms)
        if local_id != 0 and self.local_id != local_id:
            raise InterleavedDataError("We don't support multiple streams...")
        if remote_id != 0 and self.remote_id != remote_id:
            raise InvalidResponseError(
                'Incorrect remote id, expected %s got %s' % (
                    self.remote_id, remote_id))
        # Ack write packets.
        if cmd == b'WRTE':
            self.Okay()
        return cmd, data
1180187
def read(device):
        
        response = None
        bytes_avail = bytes_available(device)

        if isinstance(device, alarmdecoder.devices.SerialDevice):
            response = device._device.read(bytes_avail)
        elif isinstance(device, alarmdecoder.devices.SocketDevice):
            response = device._device.recv(bytes_avail)

        return response
751630
def __read_device(self):
        """"""
        state = XinputState()
        res = self.manager.xinput.XInputGetState(
            self.__device_number, ctypes.byref(state))
        if res == XINPUT_ERROR_SUCCESS:
            return state
        if res != XINPUT_ERROR_DEVICE_NOT_CONNECTED:
            raise RuntimeError(
                "Unknown error %d attempting to get state of device %d" % (
                    res, self.__device_number))
        # else (device is not connected)
        return None
1265306
def read_object(ctx, pin, object_id):
    

    controller = ctx.obj['controller']

    def do_read_object(retry=True):
        try:
            click.echo(controller.get_data(object_id))
        except APDUError as e:
            if e.sw == SW.NOT_FOUND:
                ctx.fail('No data found.')
            elif e.sw == SW.SECURITY_CONDITION_NOT_SATISFIED:
                _verify_pin(ctx, controller, pin)
                do_read_object(retry=False)
            else:
                raise

    do_read_object()
1189811
def _read_data(self):
        
        while True:
            try:
                data = yield from self._socket.recv()
            except asyncio.CancelledError:
                break
            except ConnectionClosed:
                break

            self._push_packet(data)

        self._loop.call_soon(self.close)
704143
def handle_read(self):
        """"""
        if self.state == STATE_DEAD:
            return
        global nr_handle_read
        nr_handle_read += 1
        new_data = self._handle_read_chunk()
        if self.debug:
            self.print_debug(b'==> ' + new_data)
        if self.handle_read_fast_case(self.read_buffer):
            return
        lf_pos = new_data.find(b'\n')
        if lf_pos >= 0:
            # Optimization: we knew there were no '\n' in the previous read
            # buffer, so we searched only in the new_data and we offset the
            # found index by the length of the previous buffer
            lf_pos += len(self.read_buffer) - len(new_data)
        elif self.state is STATE_NOT_STARTED and \
                options.password is not None and \
                b'password:' in self.read_buffer.lower():
            self.dispatch_write('{}\n'.format(options.password).encode())
            self.read_buffer = b''
            return
        while lf_pos >= 0:
            # For each line in the buffer
            line = self.read_buffer[:lf_pos + 1]
            if callbacks.process(line):
                pass
            elif self.state in (STATE_IDLE, STATE_RUNNING):
                self.print_lines(line)
            elif self.state is STATE_NOT_STARTED:
                self.read_in_state_not_started += line
                if b'The authenticity of host' in line:
                    msg = line.strip(b'\n') + b' Closing connection.'
                    self.disconnect()
                elif b'REMOTE HOST IDENTIFICATION HAS CHANGED' in line:
                    msg = b'Remote host identification has changed.'
                else:
                    msg = None

                if msg:
                    self.print_lines(msg + b' Consider manually connecting or '
                                     b'using ssh-keyscan.')

            # Go to the next line in the buffer
            self.read_buffer = self.read_buffer[lf_pos + 1:]
            if self.handle_read_fast_case(self.read_buffer):
                return
            lf_pos = self.read_buffer.find(b'\n')
        if self.state is STATE_NOT_STARTED and not self.init_string_sent:
            self.dispatch_write(self.init_string)
            self.init_string_sent = True
565024
def read(self):
        
        ret = None

        try:
            ret = self._device.read_data(1)

        except (usb.core.USBError, FtdiError) as err:
            raise CommError('Error reading from device: {0}'.format(str(err)), err)

        return ret
1268787
def read(self):
        
        self.reset()
        for dic in self.datamodel.camera_collection.get(): # TODO: search directly for RTSPCameraRow
            if (self.verbose): print(self.pre, "read : dic", dic)
            
            if (dic["classname"] == DataModel.RTSPCameraRow.__name__):
                affinity = -1
                if self.cpu_scheme:
                    affinity = self.cpu_scheme.getAV()
                
                dic.pop("classname")
                device = DataModel.RTSPCameraDevice(**dic) # a neat object with useful methods
                
                print("FilterChainGroup : read : slot    =", device.getLiveMainSlot())
                print("FilterChainGroup : read : address =", device.getMainAddress())
                print("FilterChainGroup : read : _id     =", device._id)
                
                # chain = ManagedFilterchain( # decoding and branching the stream happens here
                # chain = ManagedFilterchain2( # decoding and branching the stream happens here
                chain = LiveManagedFilterchain( # decoding and branching the stream happens here
                    livethread  = self.livethread,
                    openglthreads
                                = self.gpu_handler.openglthreads,
                    address     = device.getMainAddress(),
                    slot        = device.getLiveMainSlot(),
                    _id         = device._id,
                    affinity    = affinity,
                    msreconnect = 10000,
                    # verbose     = True,
                    verbose     =False,
                    
                    shmem_image_dimensions = constant.shmem_image_dimensions,
                    shmem_n_buffer = constant.shmem_n_buffer,
                    shmem_image_interval = constant.shmem_image_interval
                )
                self.chains.append(chain) # important .. otherwise chain will go out of context and get garbage collected
                
            elif (dic["classname"] == DataModel.USBCameraRow.__name__):
                affinity = -1
                if self.cpu_scheme:
                    affinity = self.cpu_scheme.getAV()
                
                dic.pop("classname")
                device = DataModel.USBCameraDevice(**dic) # a neat object with useful methods
                
                print("FilterChainGroup : read : slot    =", device.getLiveMainSlot())
                print("FilterChainGroup : read : address =", device.getMainAddress())
                print("FilterChainGroup : read : _id     =", device._id)
                
                chain = USBManagedFilterchain( # decoding and branching the stream happens here
                    usbthread   = self.usbthread,
                    openglthreads
                                = self.gpu_handler.openglthreads,
                    address     = device.getMainAddress(),
                    slot        = device.getLiveMainSlot(),
                    _id         = device._id,
                    affinity    = affinity,
                    msreconnect = 10000,
                    # verbose     = True,
                    verbose     =False,
                    
                    shmem_image_dimensions = constant.shmem_image_dimensions,
                    shmem_n_buffer = constant.shmem_n_buffer,
                    shmem_image_interval = constant.shmem_image_interval
                )
                self.chains.append(chain)
865692
def write_handle(self, handle: int, value: bytes):
        """"""
        if not self.is_connected():
            raise BluetoothBackendException('Not connected to device!')
        self._device.char_write_handle(handle, value, True)
        return True
778570
def scan(self):
        """"""

        self._logger.info("iface '%s' scans", self.name())

        self._wifi_ctrl.scan(self._raw_obj)
852497
def read(self):
        """"""
        if self._process and self._process.poll() is not None:
            ip = get_ipython()
            err = ip.user_ns['error'].read().decode()
            out = ip.user_ns['output'].read().decode()
        else:
            out = ''
            err = ''
        return out, err