reduce spam on info log of cellular sockets

pull/15521/head
Lukas Karel 2024-07-11 14:42:25 +02:00
parent 20340d7941
commit 46e8545b55
2 changed files with 8 additions and 3 deletions

View File

@ -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);

View File

@ -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;
}