Skip to content

A bit of documentation details on callback API#784

Closed
Youw wants to merge 1 commit into
connection-callbackfrom
connection-doc
Closed

A bit of documentation details on callback API#784
Youw wants to merge 1 commit into
connection-callbackfrom
connection-doc

Conversation

@Youw

@Youw Youw commented Mar 30, 2026

Copy link
Copy Markdown
Member

No description provided.

@mcuee mcuee added the documentation Improvements or additions to documentation label Mar 31, 2026
Comment thread hidapi/hidapi.h
Comment thread hidapi/hidapi.h
@@ -358,6 +365,9 @@ extern "C" {

This function is safe to call from within a hotplug callback.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently, not really, here is one unresolved issue: #674 (comment)

@Youw

Youw commented Apr 24, 2026

Copy link
Copy Markdown
Member Author

Opened #790 to expand this doc patch — keeps the intent (document the callback contract) but reworks the wording to match the Multi-threading Notes wiki style, enumerates what is safe to call, fixes the device->next / return-value wording, and spins off implementation follow-ups into #792, #793, #794, #795. Suggest closing this one in favour of #790.


Drafted with Claude Code.

@Youw

Youw commented Apr 24, 2026

Copy link
Copy Markdown
Member Author

I already asked Claude to mark all messages as "generated" when thsose are posted on my behalf.

@Youw Youw closed this Apr 24, 2026
@Youw Youw deleted the connection-doc branch April 24, 2026 20:06
Youw added a commit that referenced this pull request Jul 13, 2026
)

Document the full hotplug API contract in hidapi.h: thread-safety rules
(re-entrant hotplug mutex, safe-to-call list inside callbacks), execution
context (callbacks only ever run on HIDAPI's internal event context),
HID_API_HOTPLUG_ENUMERATE redefined as an asynchronous initial pass from a
registration-time snapshot (exactly-once, delivered before live events,
return value honoured), device lifetime rules (device->next == NULL,
cached DEVICE_LEFT info), deregistration post-conditions, handle
non-reuse, argument validation, and Since-version annotations.

Implementation gaps vs this contract are tracked as follow-up issues
(see PR description). Supersedes #784.

Assisted-by: claude-code:claude-fable-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants