Logo Search packages:      
Sourcecode: calibre version File versions

def calibre::devices::prs500::driver::PRS500::_send_command (   self,
  command,
  response_type = Response,
  timeout = 1000 
) [private]

Send L{command<Command>} to device and return its L{response<Response>}.

@param command:       an object of type Command or one of its derived classes
@param response_type: an object of type 'type'. The return packet
from the device is returned as an object of type response_type.
@param timeout:       The time to wait for a response from the
device, in milliseconds. If there is no response, a L{usb.USBError} is raised.

Definition at line 305 of file driver.py.

00305                                                                           :
        """
        Send L{command<Command>} to device and return its L{response<Response>}.

        @param command:       an object of type Command or one of its derived classes
        @param response_type: an object of type 'type'. The return packet
        from the device is returned as an object of type response_type.
        @param timeout:       The time to wait for a response from the
        device, in milliseconds. If there is no response, a L{usb.USBError} is raised.
        """
        if self.log_packets:
            self.log_packet(command, "Command")
        bytes_sent = self.handle.control_msg(0x40, 0x80, command)
        if bytes_sent != len(command):
            raise ControlError(desc="Could not send control request to device\n"\
                                + str(command))
        response = response_type(self.handle.control_msg(0xc0, 0x81, \
                                Response.SIZE, timeout=timeout))
        if self.log_packets:
            self.log_packet(response, "Response")
        return response

    def send_validated_command(self, command, cnumber=None, \


Generated by  Doxygen 1.6.0   Back to index