hidapi
hidapi copied to clipboard
v1: Add hidapi_context
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.