v1: Add hidapi_context #623

Open
opened 2023-09-04 04:43:26 -05:00 by Youw · 0 comments
Youw commented 2023-09-04 04:43:26 -05:00 (Migrated from github.com)

Instead of having a single hid_init()/hid_exit() we need to have independent HIDAPI contexts, so that HIDAPI can be used by different threads/modules independently.

e.g.:

struct hidapi_context;

int hidapi_initialize(struct hidapi_context** ctx);
int hidapi_exit(struct hidapi_context* ctx);

struct hidapi_dev_info* hidapi_enumerate(struct hidapi_context* ctx, hidapi_enumerate_filter* filter);
struct hidapi_device* hidapi_open(struct hidapi_context* ctx, const char* dev_path);

Details to be refined/updated.

Instead of having a single `hid_init()`/`hid_exit()` we need to have independent HIDAPI contexts, so that HIDAPI can be used by different threads/modules independently. e.g.: ```c struct hidapi_context; int hidapi_initialize(struct hidapi_context** ctx); int hidapi_exit(struct hidapi_context* ctx); struct hidapi_dev_info* hidapi_enumerate(struct hidapi_context* ctx, hidapi_enumerate_filter* filter); struct hidapi_device* hidapi_open(struct hidapi_context* ctx, const char* dev_path); ``` Details to be refined/updated.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi#623
No description provided.