Client API: add custom callback for asynchronous services
Description
Add an API SOPC_ClientHelper_ServiceAsyncCustom / SOPC_ClientHelper_DiscoveryServiceAsyncCustom to run services on server and allow to provide a custom callback that will be used as response callback for this particular service request.
Code version identification
Current behavior
When calling asynchronous services with SOPC_ClientHelper_ServiceAsync / SOPC_ClientHelper_DiscoveryServiceAsync, the previously registered callback SOPC_ClientConfigHelper_SetServiceAsyncResponse is used to receive responses.
This implies to filter responses in a unique callback for application code which might lead to complex implementation.
Expected behavior
Define a new API SOPC_ClientHelper_ServiceAsyncCustom / SOPC_ClientHelper_DiscoveryServiceAsyncCustom which allow to provide a custom callback with the service request that will be called on response. Thus the provided callback might be specialized for this particular request (or a group of request) in application code which simplifies the application implementation.
Security impact
No security impact.
Implementation
Add an SOPC_ClientHelper_ServiceAsyncCustom / SOPC_ClientHelper_DiscoveryServiceAsyncCustom API and records the callback in the request context. On any response reception, check if the custom callback is defined in context and use it, otherwise the default callback registered with SOPC_ClientConfigHelper_SetServiceAsyncResponse is used instead.