L-Acoustics / avdecc

A set of open source libraries for controlling AVB entities using the AVDECC (IEEE 1722.1) protocol compliant to Avnu Milan Specifications
GNU Lesser General Public License v3.0
90 stars 21 forks source link

API for associating application-specific data with handles #137

Closed lhoward closed 11 months ago

lhoward commented 1 year ago

It would be useful for all the handle-related APIs in the C bindings to allow the associated of application-specific data that can then be retrieved in the callbacks.

e.g.

LA_AVDECC_BINDINGS_C_API avdecc_local_entity_error_t LA_AVDECC_BINDINGS_C_CALL_CONVENTION 
LA_AVDECC_LocalEntity_setApplicationData(LA_AVDECC_LOCAL_ENTITY_HANDLE const handle, void *data);
LA_AVDECC_BINDINGS_C_API avdecc_local_entity_error_t LA_AVDECC_BINDINGS_C_CALL_CONVENTION 
LA_AVDECC_LocalEntity_getApplicationData(LA_AVDECC_LOCAL_ENTITY_HANDLE const handle, void **data);

(Actually I'd prefer LA_AVDECC_LocalEntity_getApplicationData() to just return a void * as it makes casting easier but, perhaps you want to return an error in case of invalid handle etc.)

lhoward commented 1 year ago

I have an implemented which I'll file a PR for shortly.

lhoward commented 1 year ago

Ready for review :)

christophe-calmejane commented 1 year ago

Thank you, I'll take a deeper look shortly, have important 1722.1-2021 stuff to add first.

christophe-calmejane commented 11 months ago

Merged. Thanks.