summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMartin Willers <M.Willers@gmx.net>2020-05-02 13:00:10 +0200
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2020-05-18 08:21:27 +0900
commite0be134ced32c8ee5e0955e8fecbdf0d74cd7d30 (patch)
tree5134ed1ca617417f900b72c4890f32a573d5a069 /include
parent09a0a665162b69d11d5b433e83d20e0c1cb53dda (diff)
downloadDLT-daemon-e0be134ced32c8ee5e0955e8fecbdf0d74cd7d30.tar.gz
Add macro wrappers for new sized string functions
Signed-off-by: Martin Willers <M.Willers@gmx.net>
Diffstat (limited to 'include')
-rw-r--r--include/dlt/dlt_user_macros.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/dlt/dlt_user_macros.h b/include/dlt/dlt_user_macros.h
index 2c0135e..f1a531b 100644
--- a/include/dlt/dlt_user_macros.h
+++ b/include/dlt/dlt_user_macros.h
@@ -322,6 +322,17 @@
(void)dlt_user_log_write_string(&log_local, TEXT)
/**
+ * Add string parameter with given length to the log messsage.
+ * The string in @a TEXT does not need to be null-terminated, but
+ * the copied string will be null-terminated at its destination
+ * in the message buffer.
+ * @param TEXT ASCII string
+ * @param LEN length in bytes to take from @a TEXT
+ */
+#define DLT_SIZED_STRING(TEXT, LEN) \
+ (void)dlt_user_log_write_sized_string(&log_local, TEXT, LEN)
+
+/**
* Add constant string parameter to the log messsage.
* @param TEXT Constant ASCII string
*/
@@ -329,6 +340,17 @@
(void)dlt_user_log_write_constant_string(&log_local, TEXT)
/**
+ * Add constant string parameter with given length to the log messsage.
+ * The string in @a TEXT does not need to be null-terminated, but
+ * the copied string will be null-terminated at its destination
+ * in the message buffer.
+ * @param TEXT Constant ASCII string
+ * @param LEN length in bytes to take from @a TEXT
+ */
+#define DLT_SIZED_CSTRING(TEXT, LEN) \
+ (void)dlt_user_log_write_sized_constant_string(&log_local, TEXT, LEN)
+
+/**
* Add utf8-encoded string parameter to the log messsage.
* @param TEXT UTF8-encoded string
*/
@@ -336,6 +358,17 @@
(void)dlt_user_log_write_utf8_string(&log_local, TEXT)
/**
+ * Add utf8-encoded string parameter with given length to the log messsage.
+ * The string in @a TEXT does not need to be null-terminated, but
+ * the copied string will be null-terminated at its destination
+ * in the message buffer.
+ * @param TEXT UTF8-encoded string
+ * @param LEN length in bytes to take from @a TEXT
+ */
+#define DLT_SIZED_UTF8(TEXT, LEN) \
+ (void)dlt_user_log_write_sized_utf8_string(&log_local, TEXT, LEN)
+
+/**
* Add boolean parameter to the log messsage.
* @param BOOL_VAR Boolean value (mapped to uint8)
*/