From 2617c67f8126a560ba4ef1b51744c7d23fbe4af9 Mon Sep 17 00:00:00 2001 From: Lukas Karel Date: Thu, 11 Jul 2024 14:42:25 +0200 Subject: [PATCH] reduce spam on info log of cellular sockets --- .../cellular/source/framework/AT/AT_CellularStack.cpp | 6 +++--- .../cellular/QUECTEL/BG96/QUECTEL_BG96_CellularContext.cpp | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/connectivity/cellular/source/framework/AT/AT_CellularStack.cpp b/connectivity/cellular/source/framework/AT/AT_CellularStack.cpp index 961d101c9b5..82f3676fc5e 100644 --- a/connectivity/cellular/source/framework/AT/AT_CellularStack.cpp +++ b/connectivity/cellular/source/framework/AT/AT_CellularStack.cpp @@ -310,7 +310,7 @@ nsapi_size_or_error_t AT_CellularStack::socket_sendto(nsapi_socket_t handle, con _at.unlock(); if (ret_val >= 0) { - tr_info("Socket %d sent %d bytes to %s port %d", find_socket_index(socket), ret_val, addr.get_ip_address(), addr.get_port()); + tr_debug("Socket %d sent %d bytes to %s port %d", find_socket_index(socket), ret_val, addr.get_ip_address(), addr.get_port()); } else if (ret_val != NSAPI_ERROR_WOULD_BLOCK) { tr_error("Socket %d sendto %s error %d", find_socket_index(socket), addr.get_ip_address(), ret_val); } @@ -362,9 +362,9 @@ nsapi_size_or_error_t AT_CellularStack::socket_recvfrom(nsapi_socket_t handle, S if (ret_val >= 0) { if (addr) { - tr_info("Socket %d recv %d bytes from %s port %d", find_socket_index(socket), ret_val, addr->get_ip_address(), addr->get_port()); + tr_debug("Socket %d recv %d bytes from %s port %d", find_socket_index(socket), ret_val, addr->get_ip_address(), addr->get_port()); } else { - tr_info("Socket %d recv %d bytes", find_socket_index(socket), ret_val); + tr_debug("Socket %d recv %d bytes", find_socket_index(socket), ret_val); } } else if (ret_val != NSAPI_ERROR_WOULD_BLOCK) { tr_error("Socket %d recv error %d", find_socket_index(socket), ret_val); diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularContext.cpp b/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularContext.cpp index 0aecff511b5..09424db4b8f 100644 --- a/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularContext.cpp +++ b/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularContext.cpp @@ -74,17 +74,22 @@ nsapi_error_t QUECTEL_BG96_CellularContext::do_user_authentication() type = 1; } + auto debug = _at.get_debug(); + _at.set_debug(false); if (_pwd && _uname) { if (_at.at_cmd_discard("+QICSGP", "=", "%d%d%s%s%s%d", _cid, type, _apn, _uname, _pwd, _authentication_type) != NSAPI_ERROR_OK) { + _at.set_debug(debug); return NSAPI_ERROR_AUTH_FAILURE; } } else { if (_at.at_cmd_discard("+QICSGP", "=", "%d%d%s", _cid, type, _apn) != NSAPI_ERROR_OK) { + _at.set_debug(debug); return NSAPI_ERROR_AUTH_FAILURE; } } + _at.set_debug(debug); return NSAPI_ERROR_OK; }