Commit 9ebd8821 authored by George Nash's avatar George Nash Committed by Kishen Maloor

Fix DEBUG output for Windows

Currently on windows the mbedtls_debug output prints large
blocks of unreadable text. Eeading the debug log is quite
difficult.

By seting the snprintf function for mbedtls the debug output
prints properly.

Change-Id: I9fdf2a6754b49f136cc07d2f52ced6905a701dda
Signed-off-by: George Nash's avatarGeorge Nash <george.nash@intel.com>
parent 55de9c39
......@@ -33,6 +33,7 @@
#ifdef OC_DEBUG
#include "mbedtls/debug.h"
#include "mbedtls/error.h"
#include "mbedtls/platform.h"
#endif /* OC_DEBUG */
#include "api/oc_events.h"
......@@ -1126,6 +1127,10 @@ oc_tls_init_context(void)
#endif /* !OC_DYNAMIC_ALLOCATION */
#ifdef OC_DEBUG
#if defined(_WIN32) || defined(_WIN64)
// mbedtls debug logs fail if snprintf is not specified
mbedtls_platform_set_snprintf(snprintf);
#endif /* _WIN32 or _WIN64 */
mbedtls_debug_set_threshold(4);
#endif /* OC_DEBUG */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment