hidapi icon indicating copy to clipboard operation
hidapi copied to clipboard

v1: Add hidapi_context

Open Youw opened this issue 2 years ago • 0 comments

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.

Youw avatar Sep 04 '23 09:09 Youw