Skip to content

Cellular: Enable AT debug also when mbed-trace is disabled #7084

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

Merged
merged 1 commit into from
Jun 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions features/cellular/framework/AT/ATHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1086,23 +1086,27 @@ void ATHandler::flush()

void ATHandler::debug_print(char *p, int len)
{
#if MBED_CONF_MBED_TRACE_ENABLE
#if MBED_CONF_CELLULAR_DEBUG_AT
if (_debug_on) {
#if MBED_CONF_MBED_TRACE_ENABLE
mbed_cellular_trace::mutex_wait();
#endif
for (ssize_t i = 0; i < len; i++) {
char c = *p++;
if (!isprint(c)) {
if (c == '\r') {
debug("\n");
} else if (c == '\n') {
debug("%c", c);
} else {
debug("[%d]", c);
}
} else {
debug("%c", c);
}
}
#if MBED_CONF_MBED_TRACE_ENABLE
mbed_cellular_trace::mutex_release();
}
#endif
}
#endif // MBED_CONF_CELLULAR_DEBUG_AT
}