necouchman commented on code in PR #610:
URL: https://github.com/apache/guacamole-server/pull/610#discussion_r2682370524
##########
src/libguac/guacamole/user-fntypes.h:
##########
@@ -499,5 +499,95 @@ typedef int guac_user_get_handler(guac_user* user,
guac_object* object,
typedef int guac_user_put_handler(guac_user* user, guac_object* object,
guac_stream* stream, char* mimetype, char* name);
-#endif
+/**
+ * Handler for Guacamole USB connect events, invoked when a "usbconnect"
+ * instruction has been received from a user. This indicates that the user
+ * has connected a USB device via WebUSB and it is available for redirection.
+ *
+ * @param device_id
+ * The unique identifier for the USB device. Required.
+ *
+ * @param vendor_id
+ * The vendor ID of the USB device. Required.
+ *
+ * @param product_id
+ * The product ID of the USB device. Required.
+ *
+ * @param device_name
+ * The human-readable name of the device. Required (may be empty string).
+ *
+ * @param serial_number
+ * The serial number of the device. Optional (may be NULL or empty string
+ * if not available).
+ *
+ * @param device_class
+ * The USB device class. Required.
+ *
+ * @param device_subclass
+ * The USB device subclass. Required.
+ *
+ * @param device_protocol
+ * The USB device protocol. Required.
+ *
+ * @param interface_data
+ * Encoded string containing interface and endpoint information. Required.
+ * Format:
"ifaceNum:class:subclass:protocol:ep1Num:ep1Dir:ep1Type:ep1Size;ep2...,iface2..."
+ * where multiple endpoints within an interface are separated by semicolons
+ * and multiple interfaces are separated by commas.
Review Comment:
A couple of more question from me, here, regarding this...
First, are the format and fields of this `interface_data` parameter
something standard an well-known/documented when dealing with USB devices? Is
this data that will be provided automatically by the web browser, or something
that it would be expected that someone would know how and what to assemble for
it? I can kind of guess what each of the fields means, but a few are a bit
obscure.
Somewhat related, it looks like some of the data in this `interface_data`
field is the same as the other parameters to the function (class, subclass,
protocol). How does that work out between the parameters provided in the
function and the interface data? Should they always be identical? Or are there
situations where the individual interfaces will differ from the overall
"device" being connected?
I ask for two reasons:
1. Curiosity, so I understand better how it works.
2. To make sure we're not sending duplicate data, both for efficiency but
also because of the risk that it'll be mis-matched.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]