diff options
author | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2014-06-17 16:23:49 +0200 |
---|---|---|
committer | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2014-09-09 14:50:50 +0200 |
commit | f1442dd3619c6478862b52f6ee022b8799a55bfe (patch) | |
tree | 04d28ce1c10c10d003013a950a7047cc342e4c60 /src/lib/dlt_user.c | |
parent | 87936e5249b2c22eefac0acfc21696e209ee6d35 (diff) | |
download | DLT-daemon-f1442dd3619c6478862b52f6ee022b8799a55bfe.tar.gz |
New macros for Format of Hex and Binary.
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Diffstat (limited to 'src/lib/dlt_user.c')
-rw-r--r-- | src/lib/dlt_user.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c index bf63ed7..1ad4335 100644 --- a/src/lib/dlt_user.c +++ b/src/lib/dlt_user.c @@ -1302,6 +1302,11 @@ int dlt_user_log_write_finish(DltContextData *log) int dlt_user_log_write_raw(DltContextData *log,void *data,uint16_t length) { + return dlt_user_log_write_raw_formated(log,data,length,DLT_FORMAT_DEFAULT); +} + +int dlt_user_log_write_raw_formated(DltContextData *log,void *data,uint16_t length,DltFormatType type) +{ uint16_t arg_size; uint32_t type_info; @@ -1325,6 +1330,17 @@ int dlt_user_log_write_raw(DltContextData *log,void *data,uint16_t length) /* Transmit type information */ type_info = DLT_TYPE_INFO_RAWD; + if(type>=DLT_FORMAT_HEX8 && type<=DLT_FORMAT_HEX64) + { + type_info |= DLT_SCOD_HEX; + type_info += type; + } + else if(type>=DLT_FORMAT_BIN8 && type<=DLT_FORMAT_BIN16) + { + type_info |= DLT_SCOD_BIN; + type_info += type - DLT_FORMAT_BIN8 + 1; + } + memcpy((log->buffer)+log->size,&(type_info),sizeof(uint32_t)); log->size += sizeof(uint32_t); |