Skip to content

Expand CP callback context#304

Draft
Powerbyte7 wants to merge 3 commits into
goToMain:masterfrom
Powerbyte7:improve_event_ctx
Draft

Expand CP callback context#304
Powerbyte7 wants to merge 3 commits into
goToMain:masterfrom
Powerbyte7:improve_event_ctx

Conversation

@Powerbyte7
Copy link
Copy Markdown
Contributor

This PR allows accessing the CP context from inside CP event handlers, which is useful for querying PD info like the device vendor code. For more details, see #303.

The C implementation is fairly straight-forward. For the C++ implementation I've added a new ControlPanelEventHandler class to avoid having to pass callback data with void*, give access to ControlPanel instead of osdp_t. This does add some indirection.

For now I've only addressed the event callback, but it might be worth modifying other callbacks (logging, command/event completion) as well.

@Powerbyte7 Powerbyte7 force-pushed the improve_event_ctx branch 2 times, most recently from 86bfec9 to 7666d71 Compare May 14, 2026 22:34
@Powerbyte7 Powerbyte7 force-pushed the improve_event_ctx branch from 7666d71 to 43231f5 Compare May 16, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant