diff options
author | Jens Bocklage <jens_bocklage@mentor.com> | 2015-03-02 16:28:03 +0100 |
---|---|---|
committer | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2015-03-12 14:34:41 +0100 |
commit | f90a5069f569aefa1c768ec7a336d982073f8ee2 (patch) | |
tree | c037ca7558ed60720298441f450b10278b4d1504 /examples | |
parent | 06b4012535e0b8bb5ad31001601e78fd9b53e8d3 (diff) | |
download | DLT-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 'examples')
-rw-r--r-- | examples/example4/example4.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/examples/example4/example4.c b/examples/example4/example4.c index 0614c2e..4b7d862 100644 --- a/examples/example4/example4.c +++ b/examples/example4/example4.c @@ -65,23 +65,36 @@ int main() DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_STRING("DLT_RAW")); DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_RAW(buffer,256)); + uint8_t uint8data = 0x2a; + DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_STRING("DLT_UINT8")); + DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_UINT8(uint8data)); + + uint8_t hex8data = 0x1a; DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_STRING("DLT_HEX8")); - DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_HEX8(buffer,256)); + DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_HEX8(hex8data)); + uint16_t hex16data = 0x1ad3; DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_STRING("DLT_HEX16")); - DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_HEX16(buffer,256)); + DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_HEX16(hex16data)); + uint32_t hex32data = 0x1abcd3e4; DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_STRING("DLT_HEX32")); - DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_HEX32(buffer,256)); + DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_HEX32(hex32data)); + uint64_t hex64data = 0x17b4ddcf34eabb2a; DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_STRING("DLT_HEX64")); - DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_HEX64(buffer,256)); + DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_HEX64(hex64data)); - DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_STRING("DLT_BIN8")); - DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_BIN8(buffer,256)); + uint8_t bin8data = 0xe2; + DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_STRING("DLT_BIN8")); + DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_BIN8(bin8data)); + bin8data = 0x01; + DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_STRING("DLT_BIN8")); + DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_BIN8(bin8data)); + uint16_t bin16data = 0x1234; DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_STRING("DLT_BIN16")); - DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_BIN16(buffer,256)); + DLT_LOG(con_exa1,DLT_LOG_INFO,DLT_BIN16(bin16data)); usleep(1000); |