Tizen(Headed) Native API
6.5
|
This API is used to register callbacks to be called when devices are connected or disconnected.
Overview
Functions described here can be used to register callbacks to be called on events such as device connection or disconnection.
Functions | |
int | usb_host_set_hotplug_cb (usb_host_context_h ctx, usb_host_hotplug_cb cb, usb_host_hotplug_event_e event, void *user_data, usb_host_hotplug_h *handle) |
Sets a callback function to be invoked when a device is connected or disconnected. | |
int | usb_host_unset_hotplug_cb (usb_host_hotplug_h handle) |
Unsets the hotplug callback function. | |
Typedefs | |
typedef struct usb_host_hotplug_s * | usb_host_hotplug_h |
USB hotplug callback handle. | |
typedef void(* | usb_host_hotplug_cb )(usb_host_device_h dev, void *user_data) |
Device connected/disconnected event handler. |
Typedef Documentation
typedef void(* usb_host_hotplug_cb)(usb_host_device_h dev, void *user_data) |
Device connected/disconnected event handler.
The device handle should be unreffed with usb_host_unref_device() when no longer needed.
- Since :
- 4.0
- Parameters:
-
[in] dev Device which was connected/disconnected [in] user_data User data pointer passed on callback registration
typedef struct usb_host_hotplug_s* usb_host_hotplug_h |
USB hotplug callback handle.
This handle is used for managing registered hotplug callbacks.
- Since :
- 4.0
Enumeration Type Documentation
Function Documentation
int usb_host_set_hotplug_cb | ( | usb_host_context_h | ctx, |
usb_host_hotplug_cb | cb, | ||
usb_host_hotplug_event_e | event, | ||
void * | user_data, | ||
usb_host_hotplug_h * | handle | ||
) |
Sets a callback function to be invoked when a device is connected or disconnected.
- Since :
- 4.0
- Parameters:
-
[in] ctx Context handle [in] cb The callback function to be registered [in] event Event that will trigger registered callback [in] user_data The user data to be passed to the callback function [out] handle Handle of the registered callback
- Returns:
- 0 on success, negative error code on error
- Return values:
-
USB_HOST_ERROR_NONE Successful USB_HOST_ERROR_NOT_SUPPORTED Not supported USB_HOST_ERROR_INVALID_PARAMETER Invalid parameter was passed USB_HOST_ERROR_OUT_OF_MEMORY Out of memory
int usb_host_unset_hotplug_cb | ( | usb_host_hotplug_h | handle | ) |
Unsets the hotplug callback function.
- Since :
- 4.0
- Parameters:
-
[in] handle Handle of the callback to be unregistered
- Returns:
- 0 on success, negative error code on error
- Return values:
-
USB_HOST_ERROR_NONE Successful USB_HOST_ERROR_INVALID_PARAMETER Invalid parameter was passed USB_HOST_ERROR_NOT_SUPPORTED Not supported