-
Notifications
You must be signed in to change notification settings - Fork 4
Add Mbed trace support #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@paul-szczepanek-arm Please review |
@@ -95,8 +95,9 @@ def _input_thread(self): | |||
log.warning('{}: Invalid bytes read: {}'.format(self.name, line)) | |||
continue | |||
plain_line.rstrip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, that looks like a nop
@@ -25,7 +25,8 @@ | |||
"target.printf_lib": "std", | |||
"platform.stdio-flush-at-exit": false, | |||
"platform.stdio-baud-rate": 115200, | |||
"cordio.desired-att-mtu": 80 | |||
"cordio.desired-att-mtu": 80, | |||
"mbed-trace.enable": null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why null?
mbed_trace_init(); | ||
mbed_trace_prefix_function_set([](size_t) { | ||
// This is the prefix added before any trace, the new line is used to | ||
// ensure the trace is not rendered inside a line containing a json | ||
// payload. The test tool filter out traces based on this pattern. | ||
static char prefix[] = "\n~~~"; | ||
return prefix; | ||
}); | ||
mbed_trace_print_function_set([](const char* str) { | ||
get_serial().write(str, strlen(str)); | ||
// Note: line return in mbed_trace somehow doesn't work if color support | ||
// is deactivated. | ||
get_serial().write("\n", 1); | ||
}); | ||
// Disable color support and carriage return support | ||
mbed_trace_config_set(TRACE_ACTIVE_LEVEL_ALL); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be in #if MBED_CONF_MBED_TRACE_ENABLE
This PR adds support for mbed trace in ble-cliapp and the appropriate filters in the test runtime.
Please review, we can merge when the trace branch on Mbed OS has been merged.