Impose log length restrictions
For stm_log() (strings) logging impose a maximum of 1024 bytes of
user data (forced truncation and NULL termination). For stm_logbin()
(binary) logging split logs larger than 2048 bytes of user data
into individual log packets of up to 2KB of user data per log.
Change-Id: I0be9a1788e54f41a3d675552cb2f81b79a0e5ab8
diff --git a/stm-log.txt b/stm-log.txt
index 78a51f4..c229aa7 100644
--- a/stm-log.txt
+++ b/stm-log.txt
@@ -73,7 +73,7 @@
parameters are valid.
Parameters:
- Refer to man pages for printf() for details.
+ Same parameters as printf(). Refer to man pages for printf() for details.
Examples:
stm_log("event X");
@@ -81,7 +81,12 @@
3.2) stm_logbin(int length, void *data)
Description:
- Generate a binary via STM using the default entity/protocol ID and options.
+ Generate a binary log via STM using the default entity/protocol ID and
+ options.
+
+ Parameters:
+ length: Length of binary log data in bytes
+ data: Binary data
3.3) stm_log_ex(uint8_t entity_id,
uint8_t proto_id,
@@ -95,10 +100,33 @@
entity_id: Specify the default entity ID
proto_id: Specify the default protocol ID
options: Specify the default options
- ...: Same as stmlog()
+ ...: Same as stm_log()
3.4) stm_logbin_ex(uint8_t entity_id,
uint8_t proto_id,
uint32_t options,
int length,
void *data)
+ Description:
+ Generate a binary log via STM using the specified entity/protocol ID and
+ options.
+
+ Parameters:
+ entity_id: Specify the default entity ID
+ proto_id: Specify the default protocol ID
+ options: Specify the default options
+ ...: Same as stm_logbin()
+
+
+4) Limitations:
+~~~~~~~~~~~~~~~
+
+4.1) stm_log() and stm_log_ex()
+ Log strings via stm_log() or stm_log_ex() are automatically truncated to a
+ maximum of 1024 bytes including the terminating NULL character.
+
+4.2) stm_logbin() and stm_logbin_ex()
+ A single log via stm_logbin() or stm_logbin_ex() that is greater than 2048
+ bytes are broken down into individual packets up to 2048 bytes before
+ sending over the underlying STM transport. The header is replicated for
+ each log.