From 83516bb6bd95d1a865c44bc7f33f70426e1143dc Mon Sep 17 00:00:00 2001 From: ManikandanC Date: Fri, 16 Jun 2017 16:39:55 +0530 Subject: Injection: New callback with private data Added new injection callback with private data as argument Signed-off-by: ManikandanC --- include/dlt/dlt_user.h | 2 ++ include/dlt/dlt_user_macros.h | 10 ++++++++++ 2 files changed, 12 insertions(+) (limited to 'include') diff --git a/include/dlt/dlt_user.h b/include/dlt/dlt_user.h index 8e676c6..f8691d7 100644 --- a/include/dlt/dlt_user.h +++ b/include/dlt/dlt_user.h @@ -127,6 +127,8 @@ typedef struct { uint32_t service_id; int (*injection_callback)(uint32_t service_id, void *data, uint32_t length); + int (*injection_callback_with_id)(uint32_t service_id, void *data, uint32_t length, void *priv_data); + void *data; } DltUserInjectionCallback; typedef struct diff --git a/include/dlt/dlt_user_macros.h b/include/dlt/dlt_user_macros.h index e1b1267..74dea64 100644 --- a/include/dlt/dlt_user_macros.h +++ b/include/dlt/dlt_user_macros.h @@ -164,6 +164,16 @@ #define DLT_REGISTER_INJECTION_CALLBACK(CONTEXT, SERVICEID, CALLBACK) do{\ (void)dlt_register_injection_callback(&(CONTEXT),SERVICEID, CALLBACK);} while(0) +/** + * Register callback function called when injection message was received + * @param CONTEXT object containing information about one special logging context + * @param SERVICEID service id of the injection message + * @param CALLBACK function pointer to callback function + * @param PRIV_DATA data specific to context + */ +#define DLT_REGISTER_INJECTION_CALLBACK_WITH_ID(CONTEXT, SERVICEID, CALLBACK, PRIV_DATA) do{\ + (void)dlt_register_injection_callback_with_id(&(CONTEXT),SERVICEID, CALLBACK, PRIV_DATA);} while(0) + /** * Register callback function called when log level of context was changed * @param CONTEXT object containing information about one special logging context -- cgit v1.2.1