summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJens Bocklage <jens_bocklage@mentor.com>2015-03-02 16:28:03 +0100
committerAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2015-03-12 14:34:41 +0100
commitf90a5069f569aefa1c768ec7a336d982073f8ee2 (patch)
treec037ca7558ed60720298441f450b10278b4d1504 /include
parent06b4012535e0b8bb5ad31001601e78fd9b53e8d3 (diff)
downloadDLT-daemon-f90a5069f569aefa1c768ec7a336d982073f8ee2.tar.gz
adding support for new macros to the daemon. new macros: DLT_HEX8(VAR) 8bits variable displayed in hexadecimal with "0x" prefix DLT_HEX16(VAR) 16bits displayed in hexadecimal with "0x" prefix DLT_HEX32(VAR) 32bits displayed in hexadecimal with "0x" prefix DLT_HEX64(VAR) 64bits displayed in hexadecimal with "0x" prefix DLT_BIN8(VAR) 8bits variable displayed in binary with "0b" prefix DLT_BIN16(VAR) 16bits variable displayed in binary with "0b" prefix
plus typo fix Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Diffstat (limited to 'include')
-rw-r--r--include/dlt/dlt_user.h17
-rw-r--r--include/dlt/dlt_user_macros.h24
2 files changed, 28 insertions, 13 deletions
diff --git a/include/dlt/dlt_user.h b/include/dlt/dlt_user.h
index 8b088a8..10de203 100644
--- a/include/dlt/dlt_user.h
+++ b/include/dlt/dlt_user.h
@@ -361,6 +361,21 @@ int dlt_user_log_write_uint8(DltContextData *log, uint8_t data);
int dlt_user_log_write_uint16(DltContextData *log, uint16_t data);
int dlt_user_log_write_uint32(DltContextData *log, uint32_t data);
int dlt_user_log_write_uint64(DltContextData *log, uint64_t data);
+
+/**
+ * Write a uint parameter into a DLT log message. The output will be formatted as given by the parameter type.
+ * dlt_user_log_write_start has to be called before adding any attributes to the log message.
+ * Finish sending log message by calling dlt_user_log_write_finish.
+ * @param log pointer to an object containing information about logging context data
+ * @param data unsigned int parameter written into log message.
+ * @param type The formatting type of the string output.
+ * @return negative value if there was an error
+ */
+int dlt_user_log_write_uint8_formatted(DltContextData *log, uint8_t data, DltFormatType type);
+int dlt_user_log_write_uint16_formatted(DltContextData *log, uint16_t data, DltFormatType type);
+int dlt_user_log_write_uint32_formatted(DltContextData *log, uint32_t data, DltFormatType type);
+int dlt_user_log_write_uint64_formatted(DltContextData *log, uint64_t data, DltFormatType type);
+
/**
* Write a int parameter into a DLT log message.
* dlt_user_log_write_start has to be called before adding any attributes to the log message.
@@ -426,7 +441,7 @@ int dlt_user_log_write_raw(DltContextData *log,void *data,uint16_t length);
* @param type the format information.
* @return negative value if there was an error
*/
-int dlt_user_log_write_raw_formated(DltContextData *log,void *data,uint16_t length,DltFormatType type);
+int dlt_user_log_write_raw_formatted(DltContextData *log,void *data,uint16_t length,DltFormatType type);
/**
* Trace network message
diff --git a/include/dlt/dlt_user_macros.h b/include/dlt/dlt_user_macros.h
index 484350e..600b33a 100644
--- a/include/dlt/dlt_user_macros.h
+++ b/include/dlt/dlt_user_macros.h
@@ -294,18 +294,18 @@ extern DltContext CONTEXT;
*/
#define DLT_RAW(BUF,LEN) \
dlt_user_log_write_raw(&log,BUF,LEN)
-#define DLT_HEX8(BUF,LEN) \
- dlt_user_log_write_raw_formated(&log,BUF,LEN,DLT_FORMAT_HEX8)
-#define DLT_HEX16(BUF,LEN) \
- dlt_user_log_write_raw_formated(&log,BUF,LEN,DLT_FORMAT_HEX16)
-#define DLT_HEX32(BUF,LEN) \
- dlt_user_log_write_raw_formated(&log,BUF,LEN,DLT_FORMAT_HEX32)
-#define DLT_HEX64(BUF,LEN) \
- dlt_user_log_write_raw_formated(&log,BUF,LEN,DLT_FORMAT_HEX64)
-#define DLT_BIN8(BUF,LEN) \
- dlt_user_log_write_raw_formated(&log,BUF,LEN,DLT_FORMAT_BIN8)
-#define DLT_BIN16(BUF,LEN) \
- dlt_user_log_write_raw_formated(&log,BUF,LEN,DLT_FORMAT_BIN16)
+#define DLT_HEX8(UINT_VAR) \
+ dlt_user_log_write_uint8_formatted(&log,UINT_VAR,DLT_FORMAT_HEX8)
+#define DLT_HEX16(UINT_VAR) \
+ dlt_user_log_write_uint16_formatted(&log,UINT_VAR,DLT_FORMAT_HEX16)
+#define DLT_HEX32(UINT_VAR) \
+ dlt_user_log_write_uint32_formatted(&log,UINT_VAR,DLT_FORMAT_HEX32)
+#define DLT_HEX64(UINT_VAR) \
+ dlt_user_log_write_uint64_formatted(&log,UINT_VAR,DLT_FORMAT_HEX64)
+#define DLT_BIN8(UINT_VAR) \
+ dlt_user_log_write_uint8_formatted(&log,UINT_VAR,DLT_FORMAT_BIN8)
+#define DLT_BIN16(UINT_VAR) \
+ dlt_user_log_write_uint16_formatted(&log,UINT_VAR,DLT_FORMAT_BIN16)
/**
* Trace network message