(self)
return result
Return a list of USB language identifiers (as integers) supported by
        current device for its string descriptors.

        Note: language identifiers seem (I didn't check them all...) very
        similar to windows language identifiers, so you may want to use
        locales.windows_locale to get an rfc3066 representation. The 5 standard
        HID language codes are missing though.
Return a list of USB language identifiers (as integers) supported by
        current device for its string descriptors.
Return a list of USB language identifiers ( as integers ) supported by current device for its string descriptors .
def getSupportedLanguageList(self):
        """
        Return a list of USB language identifiers (as integers) supported by
        current device for its string descriptors.

        Note: language identifiers seem (I didn't check them all...) very
        similar to windows language identifiers, so you may want to use
        locales.windows_locale to get an rfc3066 representation. The 5 standard
        HID language codes are missing though.
        """
        descriptor_string = create_binary_buffer(STRING_LENGTH)
        result = libusb1.libusb_get_string_descriptor(self.__handle,
            0, 0, descriptor_string, sizeof(descriptor_string))
        if result < 0:
            if result == libusb1.LIBUSB_ERROR_PIPE:
                # From libusb_control_transfer doc:
                # control request not supported by the device
                return []
            raise libusb1.USBError(result)
        length = cast(descriptor_string, POINTER(c_ubyte))[0]
        langid_list = cast(descriptor_string, POINTER(c_uint16))
        result = []
        append = result.append
        for offset in xrange(1, length / 2):
            append(libusb1.libusb_le16_to_cpu(langid_list[offset]))
        return result
def getSupportedLanguageList ( self ) : descriptor_string = create_binary_buffer ( STRING_LENGTH ) result = libusb1 . libusb_get_string_descriptor ( self . __handle , 0 , 0 , descriptor_string , sizeof ( descriptor_string ) ) if result < 0 : if result == libusb1 . LIBUSB_ERROR_PIPE : # From libusb_control_transfer doc: # control request not supported by the device return [ ] raise libusb1 . USBError ( result ) length = cast ( descriptor_string , POINTER ( c_ubyte ) ) [ 0 ] langid_list = cast ( descriptor_string , POINTER ( c_uint16 ) ) result = [ ] append = result . append for offset in xrange ( 1 , length / 2 ) : append ( libusb1 . libusb_le16_to_cpu ( langid_list [ offset ] ) ) return result