hidd_connect()
Connect to HID stack
Synopsis:
#include <sys/hiddi.h>
int hidd_connect( hidd_connect_parm_t *parm,
struct hidd_connection **connection );Arguments:
- parm
- The hidd_connect_parm_t structure containing connection parameters describing how to connect to the HID stack and how you intend to operate with it.
- connection
-
An opaque handle returned on a successful connection; it's used to pass into other routines to identify the connection.
Description:
The hidd_connect() function connects to a HIDD device and provides insertion and removal callbacks (in the hidd_connect_parm_t data structure).
Returns:
- EOK
- Success.
- EINVAL
- One of the arguments is NULL.
- EPROGRAMISMATCH
- The library version doesn't match the server version.
- EFAULT
- A fault occurred when the kernel tried to access an internal mutex.
- ENOMEM
- No memory for internal connect structures.
- ESRCHHID
- The server isn't running.
- EACCESS
- Permission was denied to the HID server.
- EAGAIN
- Can't create an async or callback thread.
Classification:
QNX OS
| Safety: | |
|---|---|
| Cancellation point | Yes |
| Signal handler | No |
| Thread | Yes |
Caveats:
The hidd_connect() function creates a thread on your behalf that's used by the library to monitor the HIDD stack for device insertion or removal. Since your insertion and removal callback functions are called by this new thread, you must ensure that any common resources used between that thread and any other thread(s) in your class driver are properly protected (e.g., via a mutex).
