-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy pathHotplugCallback.java
More file actions
46 lines (44 loc) · 1.44 KB
/
HotplugCallback.java
File metadata and controls
46 lines (44 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* Copyright 2013 Luca Longinotti <[email protected]>
* See LICENSE.md for licensing information.
*/
package org.usb4java;
/**
* Hotplug callback.
*
* When requesting hotplug event notifications, you pass a callback of this
* type.
*
* @author Luca Longinotti ([email protected])
*/
public interface HotplugCallback
{
/**
* Process a hotplug event.
*
* This callback may be called by an internal event thread and as such it
* is recommended the callback do minimal processing before returning.
*
* libusb will call this function later, when a matching event had happened
* on a matching device.
*
* It is safe to call either
* {@link LibUsb#hotplugRegisterCallback(Context, int, int, int, int, int,
* HotplugCallback, Object, HotplugCallbackHandle)} or
* {@link LibUsb#hotplugDeregisterCallback(Context, HotplugCallbackHandle)}
* from within a callback.
*
* @param context
* Context of this notification.
* @param device
* Device this event occurred on.
* @param event
* Event that occurred.
* @param userData
* user data provided when this callback was registered
* @return Whether this callback is finished processing events. Returning 1
* will cause this callback to be deregistered.
*/
int processEvent(Context context, Device device, int event,
Object userData);
}