aleitner commented on code in PR #610:
URL: https://github.com/apache/guacamole-server/pull/610#discussion_r2677572633


##########
src/libguac/guacamole/user-fntypes.h:
##########
@@ -499,5 +499,93 @@ 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 user
+ *     The user that connected the USB device.
+ *
+ * @param device_id
+ *     The unique identifier for the USB device.
+ *
+ * @param vendor_id
+ *     The vendor ID of the USB device.
+ *
+ * @param product_id
+ *     The product ID of the USB device.
+ *
+ * @param device_name
+ *     The human-readable name of the device.
+ *
+ * @param serial_number
+ *     The serial number of the device, if available.
+ *
+ * @param device_class
+ *     The USB device class.
+ *
+ * @param device_subclass
+ *     The USB device subclass.
+ *
+ * @param device_protocol
+ *     The USB device protocol.
+ *
+ * @param interface_data
+ *     Encoded string containing interface and endpoint information in the
+ *     format: "iface_num:class:subclass:protocol:ep_num:dir:type:size,..."
+ *
+ * @return
+ *     Zero if the USB connect event was handled successfully, or non-zero if 
+ *     an error occurred.
+ */
+typedef int guac_user_usbconnect_handler(guac_user* user, const char* 
device_id,
+    int vendor_id, int product_id, const char* device_name, 
+    const char* serial_number, int device_class, int device_subclass,
+    int device_protocol, const char* interface_data);

Review Comment:
   Currently serial_number is the only optional parameter (can be NULL or 
empty). All others are required at the moment. Will update the documentation.



-- 
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]

Reply via email to