qcodes/instrument_drivers/Minicircuits/USBHIDMixin.py
def _pack_string(self, cmd: str) -> bytes:
        """
        Pack a string to a binary format such that it can be sent to the HID.

        Args:
            cmd: a SCPI command to send
        """
        str_len = len(cmd)

        # "-1" is here because we need to compensate for the first byte in
        # the packet which is always the usb interrupt code of the command
        # (in this case the command tell the device that we are querying a
        # SCPI command)
        pad_len = self.packet_size - str_len - 1

        if pad_len < 0:
            raise ValueError(f"Length of data exceeds {self.packet_size} B")

        packed_data = struct.pack(
            f"BB{str_len}s{pad_len}x",
            self._usb_endpoint,
            self._sending_scpi_cmds_code,
            cmd.encode("ascii")
        )

        return packed_data

        Pack a string to a binary format such that it can be sent to the HID.

        Args:
            cmd: a SCPI command to send
        
Pack a string to a binary format such that it can be sent to the HID.
Pack a string to a binary format such that it can be sent to the HID .
def _pack_string(self, cmd: str) -> bytes:
        str_len = len(cmd)
        pad_len = self.packet_size - str_len - 1
        if pad_len < 0:
            raise ValueError(f"Length of data exceeds {self.packet_size} B")
        packed_data = struct.pack(
            f"BB{str_len}s{pad_len}x",
            self._usb_endpoint,
            self._sending_scpi_cmds_code,
            cmd.encode("ascii")
        )
        return packed_data
def _pack_string ( self , cmd : str ) -> bytes : str_len = len ( cmd ) pad_len = self . packet_size - str_len - 1 if pad_len < 0 : raise ValueError ( f"Length of data exceeds {self.packet_size} B" ) packed_data = struct . pack ( f"BB{str_len}s{pad_len}x" , self . _usb_endpoint , self . _sending_scpi_cmds_code , cmd . encode ( "ascii" ) ) return packed_data
Pack a string to a binary format such that it can be sent to the HID.
Pack a string to a binary format such that it can be sent to the HID .
"""
        Pack a string to a binary format such that it can be sent to the HID.

        Args:
            cmd: a SCPI command to send
        """ # "-1" is here because we need to compensate for the first byte in # the packet which is always the usb interrupt code of the command # (in this case the command tell the device that we are querying a # SCPI command)
self
cmd
str
a SCPI command to send
a SCPI command to send