RIOT: make use od module for hexdump#187
Conversation
| #define dtls_debug_hexdump(name, buf, length) dtls_dsrv_hexdump_log(DTLS_LOG_DEBUG, name, buf, length, 1) | ||
| #define dtls_debug_dump(name, buf, length) dtls_dsrv_hexdump_log(DTLS_LOG_DEBUG, name, buf, length, 0) | ||
| #define dtls_debug_hexdump(name, buf, length) { if (LOG_DEBUG <= LOG_LEVEL) { LOG_DEBUG("%s (%zu bytes):", name, length); od_hex_dump(buf, length, 0); }} | ||
| #define dtls_debug_dump(name, buf, length) { if (LOG_DEBUG <= LOG_LEVEL) { LOG_DEBUG("%s (%zu bytes):", name, length); od_hex_dump(buf, length, 0); }} |
There was a problem hiding this comment.
For tinydtls the difference of dtls_debug_hexdump and dtls_debug_dump is, that the first logs multiple lines (suitable for larger messages), while the second logs a single line.
In zephyr I didn't found something to achieve that behavior.
For RIOT it may be possible, using "\n" at the end of the LOG_DEBUG and then use a proper width for each instead of the 0. If you don't feel well with that proposal, the current version will also do it for me.
There was a problem hiding this comment.
od_hex_dump() will already split the buffer into multiple lines on it's own. A width of 0 will just select the default width.
I added a newline to dtls_debug_hexdump().
d89497e to
14c1911
Compare
|
Just to mention: don't care about the ECA error. The eclipse admin are already on it. It's a general issue. |
|
Looks like it's resolved :) |
|
Yes, from my side LGTM. |
14c1911 to
921c4d5
Compare
While trying to figure out why tinydtls still requires
gettimeofday()even thoughdtls_ticks()uses ZTimer now, I found that it's still used viatime()indtls_dsrv_hexdump_log().Replace it with a native hexdump function as it was done for Zephyr.
This allows us to drop the
gettimeofdaycompat modules that was so far needed to build tinydtls with RIOT.before
with this patch