Skip to content

v1: Add hidapi_context #623

@Youw

Description

@Youw

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CoreRelated to common codes like hidapi.henhancementNew feature or request

    Type

    No type

    Projects

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions