Skip to content

Commit d723bf9

Browse files
authored
Merge pull request #15521 from world-direct/feature/cellspam
reduce spam on info log of cellular sockets
2 parents d84a97a + 46e8545 commit d723bf9

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

connectivity/cellular/source/framework/AT/AT_CellularStack.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ nsapi_size_or_error_t AT_CellularStack::socket_sendto(nsapi_socket_t handle, con
310310
_at.unlock();
311311

312312
if (ret_val >= 0) {
313-
tr_info("Socket %d sent %d bytes to %s port %d", find_socket_index(socket), ret_val, addr.get_ip_address(), addr.get_port());
313+
tr_debug("Socket %d sent %d bytes to %s port %d", find_socket_index(socket), ret_val, addr.get_ip_address(), addr.get_port());
314314
} else if (ret_val != NSAPI_ERROR_WOULD_BLOCK) {
315315
tr_error("Socket %d sendto %s error %d", find_socket_index(socket), addr.get_ip_address(), ret_val);
316316
}
@@ -362,9 +362,9 @@ nsapi_size_or_error_t AT_CellularStack::socket_recvfrom(nsapi_socket_t handle, S
362362

363363
if (ret_val >= 0) {
364364
if (addr) {
365-
tr_info("Socket %d recv %d bytes from %s port %d", find_socket_index(socket), ret_val, addr->get_ip_address(), addr->get_port());
365+
tr_debug("Socket %d recv %d bytes from %s port %d", find_socket_index(socket), ret_val, addr->get_ip_address(), addr->get_port());
366366
} else {
367-
tr_info("Socket %d recv %d bytes", find_socket_index(socket), ret_val);
367+
tr_debug("Socket %d recv %d bytes", find_socket_index(socket), ret_val);
368368
}
369369
} else if (ret_val != NSAPI_ERROR_WOULD_BLOCK) {
370370
tr_error("Socket %d recv error %d", find_socket_index(socket), ret_val);

connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularContext.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,22 @@ nsapi_error_t QUECTEL_BG96_CellularContext::do_user_authentication()
7474
type = 1;
7575
}
7676

77+
auto debug = _at.get_debug();
78+
_at.set_debug(false);
7779
if (_pwd && _uname) {
7880
if (_at.at_cmd_discard("+QICSGP", "=", "%d%d%s%s%s%d", _cid, type,
7981
_apn, _uname, _pwd, _authentication_type) != NSAPI_ERROR_OK) {
82+
_at.set_debug(debug);
8083
return NSAPI_ERROR_AUTH_FAILURE;
8184
}
8285
} else {
8386
if (_at.at_cmd_discard("+QICSGP", "=", "%d%d%s", _cid, type,
8487
_apn) != NSAPI_ERROR_OK) {
88+
_at.set_debug(debug);
8589
return NSAPI_ERROR_AUTH_FAILURE;
8690
}
8791
}
92+
_at.set_debug(debug);
8893

8994
return NSAPI_ERROR_OK;
9095
}

0 commit comments

Comments
 (0)