From 4f82a753e0124e2b8cd3075f80b44caee6319cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E5=8F=B6=E5=8F=B6?= Date: Mon, 11 Aug 2025 10:30:04 +0800 Subject: [PATCH] fix:modify the failed in logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯叶叶 --- .../ble/src/ble_protocol_interface_factory.c | 4 +- .../ble/src/softbus_conn_ble_client.c | 128 +++++------ .../ble/src/softbus_conn_ble_connection.c | 142 ++++++------ .../ble/src/softbus_conn_ble_manager.c | 206 +++++++++--------- .../ble/src/softbus_conn_ble_send_queue.c | 12 +- .../ble/src/softbus_conn_ble_server.c | 146 ++++++------- .../ble/src/softbus_conn_ble_snapshot.c | 10 +- .../ble/src/softbus_conn_ble_trans.c | 56 ++--- .../br/src/softbus_conn_br_connection.c | 116 +++++----- .../br/src/softbus_conn_br_manager.c | 110 +++++----- .../br/src/softbus_conn_br_pending_packet.c | 16 +- .../br/src/softbus_conn_br_send_queue.c | 4 +- .../br/src/softbus_conn_br_snapshot.c | 10 +- .../connection/br/src/softbus_conn_br_trans.c | 62 +++--- .../common/src/softbus_base_listener.c | 106 ++++----- .../common/src/softbus_conn_async_helper.c | 4 +- .../common/src/softbus_conn_bytes_delivery.c | 26 +-- .../common/src/softbus_conn_common.c | 4 +- .../src/softbus_conn_fair_priority_queue.c | 36 +-- .../src/softbus_epoll_event_implement.c | 16 +- .../common/src/softbus_htp_socket.c | 22 +- .../common/src/softbus_mintp_socket.c | 40 ++-- .../common/src/softbus_rc_collection.c | 14 +- .../connection/common/src/softbus_rc_object.c | 6 +- .../src/softbus_select_event_implement.c | 6 +- core/connection/common/src/softbus_socket.c | 36 +-- .../common/src/softbus_tcp_socket.c | 50 ++--- .../common/src/softbus_usb_tcp_socket.c | 14 +- .../general/softbus_conn_general_connection.c | 134 ++++++------ .../softbus_conn_general_negotiation.c | 12 +- ...neral_connection_client_proxy_standard.cpp | 28 +-- .../manager/softbus_conn_flow_control.c | 10 +- core/connection/manager/softbus_conn_init.c | 4 +- core/connection/manager/softbus_conn_ipc.c | 4 +- .../connection/manager/softbus_conn_manager.c | 46 ++-- core/connection/proxy/proxy_connection.c | 24 +- core/connection/proxy/proxy_manager.c | 90 ++++---- core/connection/proxy/proxy_observer.cpp | 2 +- .../tcp/src/softbus_tcp_connect_manager.c | 52 ++--- .../wifi_direct_cpp/adapter/p2p_adapter.cpp | 56 ++--- .../channel/auth_negotiate_channel.cpp | 28 +-- .../channel/proxy_negotiate_channel.cpp | 8 +- .../wifi_direct_cpp/data/inner_link.cpp | 8 +- .../wifi_direct_cpp/data/ipv4_info.cpp | 4 +- .../wifi_direct_cpp/data/link_manager.cpp | 2 +- .../data/negotiate_message.cpp | 2 +- .../wifi_direct_cpp/data/wifi_config_info.cpp | 4 +- .../dbinder/wifi_direct_init.cpp | 78 +++---- .../dfx/wifi_direct_hidumper.cpp | 2 +- .../entity/p2p_available_state.cpp | 4 +- .../entity/p2p_connect_state.cpp | 4 +- .../entity/p2p_create_group_state.cpp | 2 +- .../entity/p2p_destroy_group_state.cpp | 2 +- .../wifi_direct_cpp/entity/p2p_entity.cpp | 14 +- .../processor/p2p_v1_processor.cpp | 174 +++++++-------- .../protocol/json_protocol.cpp | 2 +- .../utils/wifi_direct_utils.cpp | 68 +++--- .../wifi_direct_ip_manager.cpp | 48 ++-- .../wifi_direct_cpp/wifi_direct_manager.cpp | 4 +- .../wifi_direct_role_option.cpp | 4 +- .../wifi_direct_cpp/wifi_direct_scheduler.cpp | 8 +- .../wifi_direct_cpp/wifi_direct_scheduler.h | 2 +- 62 files changed, 1168 insertions(+), 1168 deletions(-) diff --git a/core/connection/ble/src/ble_protocol_interface_factory.c b/core/connection/ble/src/ble_protocol_interface_factory.c index 6044efa761..21fc68daad 100644 --- a/core/connection/ble/src/ble_protocol_interface_factory.c +++ b/core/connection/ble/src/ble_protocol_interface_factory.c @@ -175,7 +175,7 @@ static void ConnCocInit(void) const BleUnifyInterface *ConnBleGetUnifyInterface(BleProtocolType type) { if (type != BLE_GATT && type != BLE_COC) { - CONN_LOGE(CONN_BLE, "Failed to return type."); + CONN_LOGE(CONN_BLE, "Fail to return type."); return NULL; } ConnCocInit(); @@ -190,7 +190,7 @@ const BleUnifyInterface *ConnBleGetUnifyInterface(BleProtocolType type) g_bleUnifyInterface[BLE_COC].bleClientInitModule == NULL || g_bleUnifyInterface[BLE_COC].bleServerInitModule == NULL) { if (type == BLE_COC) { - CONN_LOGE(CONN_BLE, "Failed to return type, ble_coc not register."); + CONN_LOGE(CONN_BLE, "Fail to return type, ble_coc not register."); return NULL; } } diff --git a/core/connection/ble/src/softbus_conn_ble_client.c b/core/connection/ble/src/softbus_conn_ble_client.c index 784f7041e8..c5d098f778 100644 --- a/core/connection/ble/src/softbus_conn_ble_client.c +++ b/core/connection/ble/src/softbus_conn_ble_client.c @@ -80,7 +80,7 @@ static int32_t UpdateBleConnectionStateInOrder( { int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "lock failed, connId=%{public}u, err=%{public}d", connection->connectionId, status); + CONN_LOGE(CONN_BLE, "lock fail, connId=%{public}u, err=%{public}d", connection->connectionId, status); return SOFTBUS_LOCK_ERR; } @@ -99,7 +99,7 @@ static int32_t SetConnectionHandleAndState(ConnBleConnection *connection, int32_ { int32_t ret = SoftBusMutexLock(&connection->lock); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "client connection lock failed, connectionId=%{public}u, err=%{public}d", + CONN_LOGE(CONN_BLE, "client connection lock fail, connectionId=%{public}u, err=%{public}d", connection->connectionId, ret); (void)SoftbusGattcUnRegister(underlayerHandle); return SOFTBUS_LOCK_ERR; @@ -116,23 +116,23 @@ static int32_t SetConnectionHandleAndState(ConnBleConnection *connection, int32_ int32_t ConnGattClientConnect(ConnBleConnection *connection) { CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, SOFTBUS_CONN_BLE_INTERNAL_ERR, CONN_BLE, - "ble client connect failed: invalid param, connection is null"); + "ble client connect fail: invalid param, connection is null"); SoftBusBtAddr binaryAddr = { 0 }; int32_t status = ConvertBtMacToBinary(connection->addr, BT_MAC_LEN, binaryAddr.addr, BT_ADDR_LEN); - CONN_CHECK_AND_RETURN_RET_LOGW(status == SOFTBUS_OK, status, CONN_BLE, "client connect failed: convert string mac " + CONN_CHECK_AND_RETURN_RET_LOGW(status == SOFTBUS_OK, status, CONN_BLE, "client connect fail: convert string mac " "to binary fail, connectionId=%{public}u, err=%{public}d", connection->connectionId, status); int32_t underlayerHandle = SoftbusGattcRegister(); CONN_CHECK_AND_RETURN_RET_LOGW(underlayerHandle != INVALID_GATTC_ID, SOFTBUS_CONN_BLE_UNDERLAY_CLIENT_REGISTER_ERR, - CONN_BLE, "ble client connect failed: underlayer register failed, underlayerHandle=%{public}d", + CONN_BLE, "ble client connect fail: underlayer register fail, underlayerHandle=%{public}d", underlayerHandle); status = SoftbusGattcRegisterCallback(&g_gattcCallback, underlayerHandle); - CONN_CHECK_AND_RETURN_RET_LOGW(status == SOFTBUS_OK, status, CONN_BLE, "client connect %{public}u failed:register " + CONN_CHECK_AND_RETURN_RET_LOGW(status == SOFTBUS_OK, status, CONN_BLE, "client connect %{public}u fail:register " "callback fail, err=%{public}d", connection->connectionId, status); bool setFastestConn = true; if (connection->fastestConnectEnable && SoftbusGattcSetFastestConn(underlayerHandle) != SOFTBUS_OK) { setFastestConn = false; - CONN_LOGW(CONN_BLE, "enable ble fastest connection failed, it is not a big deal, go ahead"); + CONN_LOGW(CONN_BLE, "enable ble fastest connection fail, it is not a big deal, go ahead"); } ConnEventExtra extra = { .peerBleMac = connection->addr, @@ -145,14 +145,14 @@ int32_t ConnGattClientConnect(ConnBleConnection *connection) status = ConnPostMsgToLooper(&g_bleGattClientAsyncHandler, MSG_CLIENT_WAIT_FAST_CONNECT_TIMEOUT, connection->connectionId, 0, 0, BLE_FAST_CONNECT_TIMEOUT); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "post msg to looper failed: connection id=%{public}u, " + CONN_LOGE(CONN_BLE, "post msg to looper fail: connection id=%{public}u, " "underlayer handler handle=%{public}d, error=%{public}d", connection->connectionId, underlayerHandle, status); } } status = SoftbusGattcConnect(underlayerHandle, &binaryAddr); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "client connect failed: underlayer connect failed, connectionId=%{public}u, err=%{public}d", + CONN_LOGE(CONN_BLE, "client connect fail: underlayer connect fail, connectionId=%{public}u, err=%{public}d", connection->connectionId, status); (void)SoftbusGattcUnRegister(underlayerHandle); return SOFTBUS_CONN_BLE_UNDERLAY_CLIENT_CONNECT_ERR; @@ -172,13 +172,13 @@ static void BleGattcConnStateCallback(int32_t underlayerHandle, int32_t state, i ConnBleConnection *connection = ConnBleGetConnectionByHandle(underlayerHandle, CONN_SIDE_CLIENT, BLE_GATT); if (connection == NULL) { CONN_LOGE(CONN_BLE, - "ble client connected msg handler failed: connection not exist, " + "ble client connected msg handler fail: connection not exist, " "underlayer handle=%{public}d", underlayerHandle); (void)SoftbusGattcUnRegister(underlayerHandle); return; } if (state == SOFTBUS_BT_DISCONNECT && connection->state == BLE_CONNECTION_STATE_CONNECTING) { - CONN_LOGI(CONN_BLE, "unable to scan broadcast for 3 seconds during ble connection, failed. Waiting for retry, " + CONN_LOGI(CONN_BLE, "unable to scan broadcast for 3 seconds during ble connection, fail. Waiting for retry, " "connId=%{public}u", connection->connectionId); connection->underlayerFastConnectFailedScanFailure = true; } @@ -187,14 +187,14 @@ static void BleGattcConnStateCallback(int32_t underlayerHandle, int32_t state, i ConnBleReturnConnection(&connection); CommonStatusContext *ctx = (CommonStatusContext *)SoftBusCalloc(sizeof(CommonStatusContext)); - CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_BLE, "connection state changed handle failed: calloc failed, " + CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_BLE, "connection state changed handle fail: calloc fail, " "handle=%{public}d, status=%{public}d", underlayerHandle, status); ctx->underlayerHandle = underlayerHandle; ctx->status = status; enum ClientLoopMsgType what = state == SOFTBUS_BT_CONNECT ? MSG_CLIENT_CONNECTED : MSG_CLIENT_DISCONNECTED; int32_t rc = ConnPostMsgToLooper(&g_bleGattClientAsyncHandler, what, 0, 0, ctx, 0); if (rc != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "connection state changed handle failed: post msg to looper failed: handle=%{public}d, " + CONN_LOGW(CONN_BLE, "connection state changed handle fail: post msg to looper fail: handle=%{public}d, " "state=%{public}d, status=%{public}d, err=%{public}d", underlayerHandle, state, status, rc); SoftBusFree(ctx); } @@ -219,14 +219,14 @@ static void ConnectedMsgHandler(const CommonStatusContext *ctx) rc = UpdateBleConnectionStateInOrder( connection, BLE_CONNECTION_STATE_CONNECTING, BLE_CONNECTION_STATE_CONNECTED); if (rc != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "update connection state failed, connId=%{public}u, handle=%{public}d, err=%{public}d", + CONN_LOGW(CONN_BLE, "update connection state fail, connId=%{public}u, handle=%{public}d, err=%{public}d", connection->connectionId, ctx->underlayerHandle, rc); break; } rc = SoftbusGattcSearchServices(ctx->underlayerHandle); if (rc != SOFTBUS_OK) { CONN_LOGW(CONN_BLE, - "underlay search service failed, connId=%{public}u, handle=%{public}d, status=%{public}d", + "underlay search service fail, connId=%{public}u, handle=%{public}d, status=%{public}d", connection->connectionId, ctx->underlayerHandle, rc); if (RetrySearchService(connection, BLE_CLIENT_SEARCH_SERVICE_ERR) == SOFTBUS_OK) { rc = SOFTBUS_OK; @@ -239,7 +239,7 @@ static void ConnectedMsgHandler(const CommonStatusContext *ctx) connection, BLE_CONNECTION_STATE_CONNECTED, BLE_CONNECTION_STATE_SERVICE_SEARCHING); if (rc != SOFTBUS_OK) { CONN_LOGW(CONN_BLE, - "update connection state failed, connId=%{public}u, underlayerHandle=%{public}d, err=%{public}d", + "update connection state fail, connId=%{public}u, underlayerHandle=%{public}d, err=%{public}d", connection->connectionId, ctx->underlayerHandle, rc); break; } @@ -255,12 +255,12 @@ static void ClientWaitFastConnectTimeoutMsgHandler(uint32_t connectionId) { ConnBleConnection *connection = ConnBleGetConnectionById(connectionId); CONN_CHECK_AND_RETURN_LOGE(connection != NULL, CONN_BLE, "connection not exist, connId=%{public}u", connectionId); - CONN_LOGI(CONN_BLE, "connect failed, connId=%{public}u", connectionId); + CONN_LOGI(CONN_BLE, "connect fail, connId=%{public}u", connectionId); int32_t rc = SOFTBUS_CONN_BLE_CONNECT_TIMEOUT_ERR; do { int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, connId=%{public}u, error=%{public}d", connectionId, status); + CONN_LOGE(CONN_BLE, "try to lock fail, connId=%{public}u, error=%{public}d", connectionId, status); rc = SOFTBUS_LOCK_ERR; break; } @@ -275,7 +275,7 @@ static int32_t RetrySearchService(ConnBleConnection *connection, enum RetrySearc { int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, connId=%{public}u, reason=%{public}d, err=%{public}d", + CONN_LOGE(CONN_BLE, "try to lock fail, connId=%{public}u, reason=%{public}d, err=%{public}d", connection->connectionId, reason, status); return SOFTBUS_LOCK_ERR; } @@ -300,20 +300,20 @@ static int32_t RetrySearchService(ConnBleConnection *connection, enum RetrySearc status = SoftbusGattcRefreshServices(underlayerHandle); if (status != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "fresh service failed, connId=%{public}u, handle=%{public}d, reason=%{public}d, " + CONN_LOGW(CONN_BLE, "fresh service fail, connId=%{public}u, handle=%{public}d, reason=%{public}d, " "err=%{public}d", connection->connectionId, underlayerHandle, reason, status); return status; } status = SoftbusGattcSearchServices(underlayerHandle); if (status != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "search service failed, connId=%{public}u, handle=%{public}d, reason=%{public}d, " + CONN_LOGW(CONN_BLE, "search service fail, connId=%{public}u, handle=%{public}d, reason=%{public}d, " "err=%{public}d", connection->connectionId, underlayerHandle, reason, status); return status; } status = UpdateBleConnectionStateInOrder( connection, BLE_CONNECTION_STATE_CONNECTED, BLE_CONNECTION_STATE_SERVICE_SEARCHING); if (status != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, " update connection state failed, connId=%{public}u, underlayerHandle=%{public}d, " + CONN_LOGW(CONN_BLE, " update connection state fail, connId=%{public}u, underlayerHandle=%{public}d, " "reason=%{public}d, error=%{public}d", connection->connectionId, underlayerHandle, reason, status); return status; } @@ -329,7 +329,7 @@ static void BleGattcSearchServiceCallback(int32_t underlayerHandle, int32_t stat CommonStatusContext *ctx = (CommonStatusContext *)SoftBusCalloc(sizeof(CommonStatusContext)); if (ctx == NULL) { - CONN_LOGE(CONN_BLE, "service searched handle failed: calloc failed, handle=%{public}d, status=%{public}d", + CONN_LOGE(CONN_BLE, "service searched handle fail: calloc fail, handle=%{public}d, status=%{public}d", underlayerHandle, status); return; } @@ -337,7 +337,7 @@ static void BleGattcSearchServiceCallback(int32_t underlayerHandle, int32_t stat ctx->status = status; int32_t rc = ConnPostMsgToLooper(&g_bleGattClientAsyncHandler, MSG_CLIENT_SERVICE_SEARCHED, 0, 0, ctx, 0); if (rc != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "post msg to looper failed: handle=%{public}d, status=%{public}d, err=%{public}d", + CONN_LOGW(CONN_BLE, "post msg to looper fail: handle=%{public}d, status=%{public}d, err=%{public}d", underlayerHandle, status, rc); SoftBusFree(ctx); } @@ -351,7 +351,7 @@ static int32_t GattcGetServiceAndRegisterNotification(ConnBleConnection *connect }; int32_t rc = SoftbusGattcGetService(ctx->underlayerHandle, &serviceUuid); if (rc != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "underlay get service failed, connId=%{public}u, handle=%{public}d, error=%{public}d", + CONN_LOGW(CONN_BLE, "underlay get service fail, connId=%{public}u, handle=%{public}d, error=%{public}d", connection->connectionId, ctx->underlayerHandle, rc); if (RetrySearchService(connection, BLE_CLIENT_GET_SERVICE_ERR) == SOFTBUS_OK) { rc = SOFTBUS_OK; @@ -371,7 +371,7 @@ static int32_t GattcGetServiceAndRegisterNotification(ConnBleConnection *connect rc = SoftbusGattcRegisterNotification( ctx->underlayerHandle, &serviceUuid, &connCharacteristicUuid, &descriptorUuid); if (rc != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "underlay register conn characteristic notification failed, connId=%{public}u, " + CONN_LOGW(CONN_BLE, "underlay register conn characteristic notification fail, connId=%{public}u, " "handle=%{public}d, err=%{public}d", connection->connectionId, ctx->underlayerHandle, rc); if (RetrySearchService(connection, BLE_CLIENT_REGISTER_NOTIFICATION_ERR) == SOFTBUS_OK) { rc = SOFTBUS_OK; @@ -383,7 +383,7 @@ static int32_t GattcGetServiceAndRegisterNotification(ConnBleConnection *connect rc = UpdateBleConnectionStateInOrder( connection, BLE_CONNECTION_STATE_SERVICE_SEARCHED, BLE_CONNECTION_STATE_CONN_NOTIFICATING); if (rc != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "update connection state failed, connId=%{public}u, handle=%{public}d, err=%{public}d", + CONN_LOGW(CONN_BLE, "update connection state fail, connId=%{public}u, handle=%{public}d, err=%{public}d", connection->connectionId, ctx->underlayerHandle, rc); return rc; } @@ -401,7 +401,7 @@ static void SearchedMsgHandler(const CommonStatusContext *ctx) int32_t rc = SOFTBUS_OK; do { if (ctx->status != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "search service failed, connId=%{public}u, handle=%{public}d, status=%{public}d", + CONN_LOGW(CONN_BLE, "search service fail, connId=%{public}u, handle=%{public}d, status=%{public}d", connection->connectionId, ctx->underlayerHandle, ctx->status); rc = SOFTBUS_CONN_BLE_UNDERLAY_CLIENT_SEARCH_SERVICE_FAIL; break; @@ -409,7 +409,7 @@ static void SearchedMsgHandler(const CommonStatusContext *ctx) rc = UpdateBleConnectionStateInOrder( connection, BLE_CONNECTION_STATE_SERVICE_SEARCHING, BLE_CONNECTION_STATE_SERVICE_SEARCHED); if (rc != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "update connection state failed, connId=%{public}u, handle=%{public}d, err=%{public}d", + CONN_LOGW(CONN_BLE, "update connection state fail, connId=%{public}u, handle=%{public}d, err=%{public}d", connection->connectionId, ctx->underlayerHandle, rc); break; } @@ -429,7 +429,7 @@ static void BleGattcRegisterNotificationCallback(int32_t underlayerHandle, int32 CommonStatusContext *ctx = (CommonStatusContext *)SoftBusCalloc(sizeof(CommonStatusContext)); if (ctx == NULL) { - CONN_LOGE(CONN_BLE, "calloc failed, handle=%{public}d, status=%{public}d", underlayerHandle, status); + CONN_LOGE(CONN_BLE, "calloc fail, handle=%{public}d, status=%{public}d", underlayerHandle, status); return; } ctx->underlayerHandle = underlayerHandle; @@ -437,7 +437,7 @@ static void BleGattcRegisterNotificationCallback(int32_t underlayerHandle, int32 int32_t rc = ConnPostMsgToLooper(&g_bleGattClientAsyncHandler, MSG_CLIENT_NOTIFICATED, 0, 0, ctx, 0); if (rc != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "post msg to looper failed: handle=%{public}d, status=%{public}d, err=%{public}d", + CONN_LOGW(CONN_BLE, "post msg to looper fail: handle=%{public}d, status=%{public}d, err=%{public}d", underlayerHandle, status, rc); SoftBusFree(ctx); } @@ -477,7 +477,7 @@ static void NotificatedMsgHandler(const CommonStatusContext *ctx) int32_t rc = SOFTBUS_OK; do { if (ctx->status != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "register notification failed, connId=%{public}u, handle=%{public}d, status=%{public}d", + CONN_LOGW(CONN_BLE, "register notification fail, connId=%{public}u, handle=%{public}d, status=%{public}d", connection->connectionId, ctx->underlayerHandle, ctx->status); if (RetrySearchService(connection, BLE_CLIENT_REGISTER_NOTIFICATION_FAIL) == SOFTBUS_OK) { rc = SOFTBUS_OK; @@ -488,7 +488,7 @@ static void NotificatedMsgHandler(const CommonStatusContext *ctx) } rc = SoftBusMutexLock(&connection->lock); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "lock failed, connId=%{public}u, err=%{public}d", connection->connectionId, rc); + CONN_LOGE(CONN_BLE, "lock fail, connId=%{public}u, err=%{public}d", connection->connectionId, rc); rc = SOFTBUS_LOCK_ERR; break; } @@ -508,7 +508,7 @@ static int32_t NotificatedConnHandler(int32_t underlayerHandle, ConnBleConnectio int32_t status = UpdateBleConnectionStateInOrder( connection, BLE_CONNECTION_STATE_CONN_NOTIFICATING, BLE_CONNECTION_STATE_CONN_NOTIFICATED); if (status != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "update connection state failed, connId=%{public}u, handle=%{public}d, err=%{public}d", + CONN_LOGW(CONN_BLE, "update connection state fail, connId=%{public}u, handle=%{public}d, err=%{public}d", connection->connectionId, underlayerHandle, status); return status; } @@ -528,14 +528,14 @@ static int32_t NotificatedConnHandler(int32_t underlayerHandle, ConnBleConnectio status = SoftbusGattcRegisterNotification(underlayerHandle, &serviceUuid, &netUuid, &descriptorUuid); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "register conn characteristic notification failed, connId=%{public}u, handle=%{public}d, err=%{public}d", + "register conn characteristic notification fail, connId=%{public}u, handle=%{public}d, err=%{public}d", connection->connectionId, underlayerHandle, status); return SOFTBUS_CONN_BLE_UNDERLAY_CLIENT_REGISTER_NOTIFICATION_ERR; } status = UpdateBleConnectionStateInOrder( connection, BLE_CONNECTION_STATE_CONN_NOTIFICATED, BLE_CONNECTION_STATE_NET_NOTIFICATING); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update connection state failed, connId=%{public}u, handle=%{public}d, err=%{public}d", + CONN_LOGE(CONN_BLE, "update connection state fail, connId=%{public}u, handle=%{public}d, err=%{public}d", connection->connectionId, underlayerHandle, status); } return status; @@ -546,20 +546,20 @@ static int32_t NotificatedNetHandler(int32_t underlayerHandle, ConnBleConnection int32_t status = UpdateBleConnectionStateInOrder( connection, BLE_CONNECTION_STATE_NET_NOTIFICATING, BLE_CONNECTION_STATE_NET_NOTIFICATED); if (status != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "update connection state failed, connId=%{public}u, handle=%{public}d, err=%{public}d", + CONN_LOGW(CONN_BLE, "update connection state fail, connId=%{public}u, handle=%{public}d, err=%{public}d", connection->connectionId, underlayerHandle, status); return status; } status = SoftbusGattcConfigureMtuSize(underlayerHandle, DEFAULT_MTU_SIZE); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "configure mtu failed, connId=%{public}u, handle=%{public}d, err=%{public}d", + CONN_LOGE(CONN_BLE, "configure mtu fail, connId=%{public}u, handle=%{public}d, err=%{public}d", connection->connectionId, underlayerHandle, status); return SOFTBUS_CONN_BLE_UNDERLAY_CLIENT_CONFIGURE_MTU_ERR; } status = UpdateBleConnectionStateInOrder( connection, BLE_CONNECTION_STATE_NET_NOTIFICATED, BLE_CONNECTION_STATE_MTU_SETTING); if (status != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "update connection state failed, connId=%{public}u, handle=%{public}d, error=%{public}d", + CONN_LOGW(CONN_BLE, "update connection state fail, connId=%{public}u, handle=%{public}d, error=%{public}d", connection->connectionId, underlayerHandle, status); } return status; @@ -571,7 +571,7 @@ static void BleGattcConfigureMtuSizeCallback(int32_t underlayerHandle, int32_t m underlayerHandle, mtuSize, status); MtuConfiguredContext *ctx = (MtuConfiguredContext *)SoftBusCalloc(sizeof(MtuConfiguredContext)); if (ctx == NULL) { - CONN_LOGE(CONN_BLE, "calloc mtu failed, handle=%{public}d, mtu=%{public}d, status=%{public}d", underlayerHandle, + CONN_LOGE(CONN_BLE, "calloc mtu fail, handle=%{public}d, mtu=%{public}d, status=%{public}d", underlayerHandle, mtuSize, status); return; } @@ -581,7 +581,7 @@ static void BleGattcConfigureMtuSizeCallback(int32_t underlayerHandle, int32_t m int32_t rc = ConnPostMsgToLooper(&g_bleGattClientAsyncHandler, MSG_CLIENT_MTU_SETTED, 0, 0, ctx, 0); if (rc != SOFTBUS_OK) { CONN_LOGW(CONN_BLE, - "post msg to looper failed: handle=%{public}d, mtu=%{public}d, status=%{public}d, err=%{public}d", + "post msg to looper fail: handle=%{public}d, mtu=%{public}d, status=%{public}d, err=%{public}d", underlayerHandle, mtuSize, status, rc); SoftBusFree(ctx); } @@ -600,7 +600,7 @@ static void MtuSettedMsgHandler(const MtuConfiguredContext *ctx) int32_t rc = SOFTBUS_OK; do { if (status != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "register notification failed, connId=%{public}u, handle=%{public}d, status=%{public}d", + CONN_LOGW(CONN_BLE, "register notification fail, connId=%{public}u, handle=%{public}d, status=%{public}d", connection->connectionId, underlayerHandle, status); rc = SOFTBUS_CONN_BLE_UNDERLAY_CLIENT_CONFIGURE_MTU_FAIL; break; @@ -609,13 +609,13 @@ static void MtuSettedMsgHandler(const MtuConfiguredContext *ctx) rc = UpdateBleConnectionStateInOrder( connection, BLE_CONNECTION_STATE_MTU_SETTING, BLE_CONNECTION_STATE_MTU_SETTED); if (rc != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "update connection state failed, connId=%{public}u, handle=%{public}d, err=%{public}d", + CONN_LOGW(CONN_BLE, "update connection state fail, connId=%{public}u, handle=%{public}d, err=%{public}d", connection->connectionId, underlayerHandle, status); break; } rc = SoftBusMutexLock(&connection->lock); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "lock failed, connId=%{public}u, err=%{public}d", connection->connectionId, rc); + CONN_LOGE(CONN_BLE, "lock fail, connId=%{public}u, err=%{public}d", connection->connectionId, rc); rc = SOFTBUS_LOCK_ERR; break; } @@ -634,10 +634,10 @@ static void MtuSettedMsgHandler(const MtuConfiguredContext *ctx) int32_t ConnGattClientDisconnect(ConnBleConnection *connection, bool grace, bool refreshGatt) { CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, SOFTBUS_CONN_BLE_INTERNAL_ERR, CONN_BLE, - "ble client connection disconnect failed: invalid param, connection is null"); + "ble client connection disconnect fail: invalid param, connection is null"); int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "lock failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "lock fail, err=%{public}d", status); return SOFTBUS_LOCK_ERR; } int32_t underlayerHandle = connection->underlayerHandle; @@ -681,7 +681,7 @@ static void DisconnectedMsgHandler(const CommonStatusContext *ctx) do { int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "lock failed, connId=%{public}u, err=%{public}d", connectionId, status); + CONN_LOGE(CONN_BLE, "lock fail, connId=%{public}u, err=%{public}d", connectionId, status); rc = SOFTBUS_LOCK_ERR; break; } @@ -701,12 +701,12 @@ static void ClientWaitDiconnetTimeoutMsgHandler(uint32_t connectionId) { ConnBleConnection *connection = ConnBleGetConnectionById(connectionId); CONN_CHECK_AND_RETURN_LOGW(connection != NULL, CONN_BLE, - "ble client wait disconnect timeout handler failed: connection not exist, connId=%{public}u", connectionId); + "ble client wait disconnect timeout handler fail: connection not exist, connId=%{public}u", connectionId); CONN_LOGI(CONN_BLE, "ble client disconnect wait timeout, connId=%{public}u", connectionId); do { int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "lock failed, connId=%{public}u, error=%{public}d", connectionId, status); + CONN_LOGE(CONN_BLE, "lock fail, connId=%{public}u, error=%{public}d", connectionId, status); break; } int32_t underlayerHandle = connection->underlayerHandle; @@ -736,7 +736,7 @@ static void BleGattcNotificationReceiveCallback(int32_t underlayerHandle, SoftBu isConnCharacteristic = false; } else { CONN_LOGE(CONN_BLE, - "notification receive failed: not NET or CONN characteristic, connId=%{public}u, handle=%{public}d", + "notification receive fail: not NET or CONN characteristic, connId=%{public}u, handle=%{public}d", connection->connectionId, underlayerHandle); ConnAuditExtra extra = { .auditType = AUDIT_EVENT_MSG_ERROR, @@ -770,15 +770,15 @@ static char *GetBleAttrUuid(int32_t module) int32_t ConnGattClientSend(ConnBleConnection *connection, const uint8_t *data, uint32_t dataLen, int32_t module) { CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble client send data failed, invalia param, connection is null"); + "ble client send data fail, invalia param, connection is null"); CONN_CHECK_AND_RETURN_RET_LOGW( - data != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, "ble client send data failed, invalia param, data is null"); + data != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, "ble client send data fail, invalia param, data is null"); CONN_CHECK_AND_RETURN_RET_LOGW( - dataLen != 0, SOFTBUS_INVALID_PARAM, CONN_BLE, "ble client send data failed, invalia param, data len is 0"); + dataLen != 0, SOFTBUS_INVALID_PARAM, CONN_BLE, "ble client send data fail, invalia param, data len is 0"); int32_t status = SoftBusMutexLock(&connection->lock); CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_BLE, - "ble client send data failed, try to get connection lock failed, connId=%{public}u, err=%{public}d", + "ble client send data fail, try to get connection lock fail, connId=%{public}u, err=%{public}d", connection->connectionId, status); int32_t underlayerHandle = connection->underlayerHandle; (void)SoftBusMutexUnlock(&connection->lock); @@ -803,11 +803,11 @@ int32_t ConnGattClientSend(ConnBleConnection *connection, const uint8_t *data, u int32_t ConnGattClientUpdatePriority(ConnBleConnection *connection, ConnectBlePriority priority) { CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble client update priority failed, invalia param, connection is null"); + "ble client update priority fail, invalia param, connection is null"); int32_t status = SoftBusMutexLock(&connection->lock); CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_BLE, - "ble client update priority failed, try to get connection lock failed, " + "ble client update priority fail, try to get connection lock fail, " "connectionId=%{public}u, error=%{public}d", connection->connectionId, status); int32_t underlayerHandle = connection->underlayerHandle; @@ -899,7 +899,7 @@ static int BleCompareGattClientLooperEventFunc(const SoftBusMessage *msg, void * } if (ctx->arg1 != 0 || ctx->arg2 != 0 || ctx->obj != NULL) { CONN_LOGE(CONN_BLE, - "compare failed to avoid fault silence, what=%{public}d, arg1=%{public}" PRIu64 ", arg2=%{public}" PRIu64 + "compare fail to avoid fault silence, what=%{public}d, arg1=%{public}" PRIu64 ", arg2=%{public}" PRIu64 ", objIsNull=%{public}d", ctx->what, ctx->arg1, ctx->arg2, ctx->obj == NULL); return COMPARE_FAILED; @@ -910,20 +910,20 @@ static int BleCompareGattClientLooperEventFunc(const SoftBusMessage *msg, void * int32_t ConnGattInitClientModule(SoftBusLooper *looper, const ConnBleClientEventListener *listener) { CONN_CHECK_AND_RETURN_RET_LOGW( - looper != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, "init ble client failed: invalid param, looper is null"); + looper != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, "init ble client fail: invalid param, looper is null"); CONN_CHECK_AND_RETURN_RET_LOGW( - listener != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, "init ble client failed: invalid param, listener is null"); + listener != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, "init ble client fail: invalid param, listener is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onClientConnected != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init ble client failed: invalid param, listener onClientConnected is null"); + "init ble client fail: invalid param, listener onClientConnected is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onClientFailed != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init ble client failed: invalid param, listener onClientFailed is null"); + "init ble client fail: invalid param, listener onClientFailed is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onClientDataReceived != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init ble client failed: invalid param, listener onClientDataReceived is null"); + "init ble client fail: invalid param, listener onClientDataReceived is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onClientConnectionClosed != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init ble client failed: invalid param, listener onClientConnectionClosed is null"); + "init ble client fail: invalid param, listener onClientConnectionClosed is null"); int32_t status = InitSoftbusAdapterClient(); CONN_CHECK_AND_RETURN_RET_LOGW(status == SOFTBUS_OK, status, CONN_INIT, - "init softbus adapter failed, err=%{public}d", status); + "init softbus adapter fail, err=%{public}d", status); g_bleGattClientAsyncHandler.handler.looper = looper; g_clientEventListener = *listener; diff --git a/core/connection/ble/src/softbus_conn_ble_connection.c b/core/connection/ble/src/softbus_conn_ble_connection.c index 89e2a67d81..2b77a6c7dc 100644 --- a/core/connection/ble/src/softbus_conn_ble_connection.c +++ b/core/connection/ble/src/softbus_conn_ble_connection.c @@ -108,7 +108,7 @@ ConnBleConnection *ConnBleCreateConnection( CONN_CHECK_AND_RETURN_RET_LOGW(addr != NULL, NULL, CONN_BLE, "invalid parameter: ble addr is NULL"); ConnBleConnection *connection = (ConnBleConnection *)SoftBusCalloc(sizeof(ConnBleConnection)); - CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, NULL, CONN_BLE, "calloc ble connection failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, NULL, CONN_BLE, "calloc ble connection fail"); ListInit(&connection->node); // the final connectionId value is allocate on saving global connection->connectionId = 0; @@ -116,7 +116,7 @@ ConnBleConnection *ConnBleCreateConnection( connection->side = side; connection->fastestConnectEnable = fastestConnectEnable; if (strcpy_s(connection->addr, BT_MAC_LEN, addr) != EOK) { - CONN_LOGE(CONN_BLE, "copy address failed"); + CONN_LOGE(CONN_BLE, "copy address fail"); SoftBusFree(connection); return NULL; } @@ -126,7 +126,7 @@ ConnBleConnection *ConnBleCreateConnection( ListInit(&connection->buffer.packets); if (SoftBusMutexInit(&connection->lock, NULL) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "init lock failed"); + CONN_LOGE(CONN_BLE, "init lock fail"); SoftBusFree(connection); return NULL; } @@ -145,7 +145,7 @@ ConnBleConnection *ConnBleCreateConnection( connection->isNeedSetIdleTimeout = true; SoftBusList *list = CreateSoftBusList(); if (list == NULL) { - CONN_LOGE(CONN_BLE, "create softbus list failed"); + CONN_LOGE(CONN_BLE, "create softbus list fail"); SoftBusMutexDestroy(&connection->lock); SoftBusFree(connection); return NULL; @@ -178,7 +178,7 @@ void ConnBleFreeConnection(ConnBleConnection *connection) int32_t ConnBleStartServer(void) { CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_serverCoordination.lock) == SOFTBUS_OK, SOFTBUS_LOCK_ERR, - CONN_BLE, "ble start server failed, try to lock failed"); + CONN_BLE, "ble start server fail, try to lock fail"); g_serverCoordination.expect = BLE_SERVER_STATE_STARTED; enum BleServerState actual = g_serverCoordination.actual; (void)SoftBusMutexUnlock(&g_serverCoordination.lock); @@ -201,7 +201,7 @@ int32_t ConnBleStartServer(void) } } CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_serverCoordination.lock) == SOFTBUS_OK, SOFTBUS_LOCK_ERR, - CONN_BLE, "ble start server failed, try to lock failed"); + CONN_BLE, "ble start server fail, try to lock fail"); g_serverCoordination.actual = BLE_SERVER_STATE_STARTING; (void)SoftBusMutexUnlock(&g_serverCoordination.lock); return SOFTBUS_OK; @@ -210,7 +210,7 @@ int32_t ConnBleStartServer(void) int32_t ConnBleStopServer(void) { CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_serverCoordination.lock) == SOFTBUS_OK, SOFTBUS_LOCK_ERR, - CONN_BLE, "ble stop server failed, try to lock failed"); + CONN_BLE, "ble stop server fail, try to lock fail"); g_serverCoordination.expect = BLE_SERVER_STATE_STOPPED; enum BleServerState actual = g_serverCoordination.actual; (void)SoftBusMutexUnlock(&g_serverCoordination.lock); @@ -233,7 +233,7 @@ int32_t ConnBleStopServer(void) } } CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_serverCoordination.lock) == SOFTBUS_OK, SOFTBUS_LOCK_ERR, - CONN_BLE, "ble close server failed, try to lock failed"); + CONN_BLE, "ble close server fail, try to lock fail"); g_serverCoordination.actual = BLE_SERVER_STATE_STOPPING; (void)SoftBusMutexUnlock(&g_serverCoordination.lock); return SOFTBUS_OK; @@ -242,10 +242,10 @@ int32_t ConnBleStopServer(void) int32_t ConnBleConnect(ConnBleConnection *connection) { CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble connection connect failed, invalid param, connection is null"); + "ble connection connect fail, invalid param, connection is null"); const BleUnifyInterface *interface = ConnBleGetUnifyInterface(connection->protocol); CONN_CHECK_AND_RETURN_RET_LOGW(interface != NULL, SOFTBUS_CONN_BLE_INTERNAL_ERR, CONN_BLE, - "ble connection connect failed, protocol not support"); + "ble connection connect fail, protocol not support"); return interface->bleClientConnect(connection); } @@ -275,10 +275,10 @@ static bool ShoudRefreshGatt(enum ConnBleDisconnectReason reason) int32_t ConnBleDisconnectNow(ConnBleConnection *connection, enum ConnBleDisconnectReason reason) { CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble connection disconnect failed, invalid param, connection is null"); + "ble connection disconnect fail, invalid param, connection is null"); const BleUnifyInterface *interface = ConnBleGetUnifyInterface(connection->protocol); CONN_CHECK_AND_RETURN_RET_LOGW(interface != NULL, SOFTBUS_CONN_BLE_INTERNAL_ERR, CONN_BLE, - "ble connection disconnect failed, protocol not support"); + "ble connection disconnect fail, protocol not support"); CONN_LOGI(CONN_BLE, "receive ble disconnect now, connId=%{public}u, side=%{public}d, reason=%{public}d", connection->connectionId, connection->side, reason); @@ -300,7 +300,7 @@ static void OnDisconnectedDataFinished(uint32_t connectionId, int32_t error) int32_t status = ConnPostMsgToLooper(&g_bleConnectionAsyncHandler, MSG_CONNECTION_WAIT_NEGOTIATION_CLOSING_TIMEOUT, connectionId, 0, NULL, WAIT_NEGOTIATION_CLOSING_TIMEOUT_MILLIS); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "post closing timeout event failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "post closing timeout event fail, err=%{public}d", status); } } @@ -324,7 +324,7 @@ static int32_t ConnPackCtlMsgRcSendDeltaData(RcPackCtlMsgPara *rcMsgPara) uint32_t dataLen = 0; int64_t seq = ConnBlePackCtlMessage(ctx, &data, &dataLen); if (seq < 0) { - CONN_LOGE(CONN_BLE, "ble pack notify request message failed, " + CONN_LOGE(CONN_BLE, "ble pack notify request message fail, " "connId=%{public}u, underlayerHandle=%{public}d, error=%{public}d", rcMsgPara->connId, rcMsgPara->underlayerHandle, (int32_t)seq); return (int32_t)seq; @@ -349,7 +349,7 @@ static bool NeedProccessOccupy(ConnBleConnection *connection, int32_t delta, uin CONN_LOGI(CONN_BLE, "is occupied, process later, connId=%{public}u", connection->connectionId); BleReferenceContext *referenceContext = (BleReferenceContext *)SoftBusMalloc(sizeof(BleReferenceContext)); CONN_CHECK_AND_RETURN_RET_LOGE(referenceContext != NULL, false, CONN_BLE, - "malloc buffer failed, connectionId=%{public}u", connection->connectionId); + "malloc buffer fail, connectionId=%{public}u", connection->connectionId); referenceContext->delta = delta; referenceContext->challengeCode = challengeCode; referenceContext->isActiveUpdateLocalRc = isActiveUpdateLocalRc; @@ -358,7 +358,7 @@ static bool NeedProccessOccupy(ConnBleConnection *connection, int32_t delta, uin connection->connectionId, 0, referenceContext, WAIT_TIMEOUT_TRY_AGAIN); if (status != SOFTBUS_OK) { SoftBusFree(referenceContext); - CONN_LOGE(CONN_BLE, "post msg failed, connectionId=%{public}u, error=%{public}d", + CONN_LOGE(CONN_BLE, "post msg fail, connectionId=%{public}u, error=%{public}d", connection->connectionId, status); return false; } @@ -430,7 +430,7 @@ static int32_t BleOnReferenceRequest(ConnBleConnection *connection, BleReference } int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, connId=%{public}u, err=%{public}d", connection->connectionId, status); + CONN_LOGE(CONN_BLE, "try to lock fail, connId=%{public}u, err=%{public}d", connection->connectionId, status); return SOFTBUS_LOCK_ERR; } connection->connectionRc += delta; @@ -475,7 +475,7 @@ int32_t ConnBleOnReferenceRequest(ConnBleConnection *connection, const cJSON *js if (!GetJsonObjectSignedNumberItem(json, CTRL_MSG_KEY_DELTA, &delta) || !GetJsonObjectSignedNumberItem(json, CTRL_MSG_KEY_REF_NUM, &peerRc)) { CONN_LOGE(CONN_BLE, - "parse delta or reference number fields failed, connId=%{public}u, delta=%{public}d, peerRc=%{public}d", + "parse delta or reference number fields fail, connId=%{public}u, delta=%{public}d, peerRc=%{public}d", connection->connectionId, delta, peerRc); return SOFTBUS_PARSE_JSON_ERR; } @@ -494,27 +494,27 @@ int32_t ConnBleOnReferenceRequest(ConnBleConnection *connection, const cJSON *js int32_t ConnBleUpdateConnectionPriority(ConnBleConnection *connection, ConnectBlePriority priority) { CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble connection update connection priority failed, invalid param, connection is null"); + "ble connection update connection priority fail, invalid param, connection is null"); if (connection->side == CONN_SIDE_SERVER) { return SOFTBUS_FUNC_NOT_SUPPORT; } const BleUnifyInterface *interface = ConnBleGetUnifyInterface(connection->protocol); CONN_CHECK_AND_RETURN_RET_LOGW(interface != NULL, SOFTBUS_CONN_BLE_INTERNAL_ERR, CONN_BLE, - "ble connection update connection priority failed, protocol not support"); + "ble connection update connection priority fail, protocol not support"); return interface->bleClientUpdatePriority(connection, priority); } int32_t ConnBleSend(ConnBleConnection *connection, const uint8_t *data, uint32_t dataLen, int32_t module) { CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble connection send data failed, invalid param, connection is null"); + "ble connection send data fail, invalid param, connection is null"); CONN_CHECK_AND_RETURN_RET_LOGW(data != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble connection send data failed, invalid param, data is null"); + "ble connection send data fail, invalid param, data is null"); CONN_CHECK_AND_RETURN_RET_LOGW(dataLen != 0, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble connection send data failed, invalid param, data len is 0"); + "ble connection send data fail, invalid param, data len is 0"); const BleUnifyInterface *interface = ConnBleGetUnifyInterface(connection->protocol); CONN_CHECK_AND_RETURN_RET_LOGW(interface != NULL, SOFTBUS_CONN_BLE_INTERNAL_ERR, CONN_BLE, - "ble connection send data failed, protocol not support"); + "ble connection send data fail, protocol not support"); return connection->side == CONN_SIDE_SERVER ? interface->bleServerSend(connection, data, dataLen, module) : interface->bleClientSend(connection, data, dataLen, module); @@ -532,7 +532,7 @@ void ConnBleRefreshIdleTimeout(ConnBleConnection *connection) void ConnBleCancelIdleTimeout(ConnBleConnection *connection) { - CONN_CHECK_AND_RETURN_LOGE(connection != NULL, CONN_BLE, "cancel failed, connection is null"); + CONN_CHECK_AND_RETURN_LOGE(connection != NULL, CONN_BLE, "cancel fail, connection is null"); ConnRemoveMsgFromLooper( &g_bleConnectionAsyncHandler, MSG_CONNECTION_IDLE_DISCONNECT_TIMEOUT, connection->connectionId, 0, NULL); int32_t status = SoftBusMutexLock(&connection->lock); @@ -591,7 +591,7 @@ static int32_t SendBasicInfo(ConnBleConnection *connection) status = LnnGetLocalStrInfo(STRING_KEY_DEV_UDID, devId, DEVID_BUFF_LEN); } if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "get devid from net ledger failed, connId=%{public}u, protocol=%{public}d, err=%{public}d", + CONN_LOGE(CONN_BLE, "get devid from net ledger fail, connId=%{public}u, protocol=%{public}d, err=%{public}d", connection->connectionId, connection->protocol, status); return status; } @@ -600,14 +600,14 @@ static int32_t SendBasicInfo(ConnBleConnection *connection) status = LnnGetLocalNumInfo(NUM_KEY_DEV_TYPE_ID, &deviceType); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "get device type from net ledger failed, connId=%{public}u, err=%{public}d", + "get device type from net ledger fail, connId=%{public}u, err=%{public}d", connection->connectionId, status); return status; } cJSON *json = cJSON_CreateObject(); if (json == NULL) { - CONN_LOGE(CONN_BLE, "create json object failed, connId=%{public}u", connection->connectionId); + CONN_LOGE(CONN_BLE, "create json object fail, connId=%{public}u", connection->connectionId); return SOFTBUS_CREATE_JSON_ERR; } char *payload = NULL; @@ -617,7 +617,7 @@ static int32_t SendBasicInfo(ConnBleConnection *connection) !AddNumberToJsonObject(json, BASIC_INFO_KEY_ROLE, connection->side) || !AddNumberToJsonObject(json, BASIC_INFO_KEY_DEVTYPE, deviceType) || !AddNumberToJsonObject(json, BASIC_INFO_KEY_FEATURE, featureBitSet)) { - CONN_LOGE(CONN_BLE, "add json info failed, connId=%{public}u", connection->connectionId); + CONN_LOGE(CONN_BLE, "add json info fail, connId=%{public}u", connection->connectionId); status = SOFTBUS_CREATE_JSON_ERR; break; } @@ -628,7 +628,7 @@ static int32_t SendBasicInfo(ConnBleConnection *connection) uint8_t *buf = (uint8_t *)SoftBusCalloc(bufLen); if (buf == NULL) { CONN_LOGE(CONN_BLE, - "malloc buf failed, connId=%{public}u, bufLen=%{public}u", connection->connectionId, bufLen); + "malloc buf fail, connId=%{public}u, bufLen=%{public}u", connection->connectionId, bufLen); status = SOFTBUS_MALLOC_ERR; break; } @@ -644,7 +644,7 @@ static int32_t SendBasicInfo(ConnBleConnection *connection) offset += NET_CTRL_MSG_TYPE_HEADER_SIZE; if (memcpy_s(buf + offset, bufLen - offset, payload, payloadLen) != EOK) { CONN_LOGE(CONN_BLE, - "memcpy_s buf failed, connId=%{public}u, bufLen=%{public}u, paylaodLen=%{public}u", + "memcpy_s buf fail, connId=%{public}u, bufLen=%{public}u, paylaodLen=%{public}u", connection->connectionId, bufLen, payloadLen); status = SOFTBUS_MEM_ERR; SoftBusFree(buf); @@ -694,7 +694,7 @@ static int32_t ParsePeerBasicInfoInner(ConnBleConnection *connection, const uint offset += NET_CTRL_MSG_TYPE_HEADER_SIZE; cJSON *json = cJSON_ParseWithLength((char *)(data + offset), dataLen - offset); if (json == NULL) { - CONN_LOGI(CONN_BLE, "parse json failed, connId=%{public}u", connection->connectionId); + CONN_LOGI(CONN_BLE, "parse json fail, connId=%{public}u", connection->connectionId); return SOFTBUS_PARSE_JSON_ERR; } // mandatory fields @@ -723,24 +723,24 @@ static int32_t ParseBasicInfo(ConnBleConnection *connection, const uint8_t *data { BaseInfo baseInfo = {0}; int32_t ret = ParsePeerBasicInfoInner(connection, data, dataLen, &baseInfo); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_BLE, "ble parse data failed, error=%{public}d", ret); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_BLE, "ble parse data fail, error=%{public}d", ret); bool isSupportNetWorkIdExchange = ((uint32_t)(baseInfo.feature) & (1 << BLE_FEATURE_SUPPORT_SUPPORT_NETWORKID_BASICINFO_EXCAHNGE)) != 0; ret = SoftBusMutexLock(&connection->lock); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_BLE, - "try to lock failed, connId=%{public}u, err=%{public}d", connection->connectionId, ret); + "try to lock fail, connId=%{public}u, err=%{public}d", connection->connectionId, ret); if (connection->protocol == BLE_COC || isSupportNetWorkIdExchange) { if (memcpy_s(connection->networkId, NETWORK_ID_BUF_LEN, baseInfo.devId, DEVID_BUFF_LEN) != EOK) { (void)SoftBusMutexUnlock(&connection->lock); - CONN_LOGE(CONN_BLE, "memcpy_s network id failed, connId=%{public}u", connection->connectionId); + CONN_LOGE(CONN_BLE, "memcpy_s network id fail, connId=%{public}u", connection->connectionId); return SOFTBUS_MEM_ERR; } ConnBleInnerComplementDeviceId(connection); } else if (connection->protocol == BLE_GATT) { if (memcpy_s(connection->udid, UDID_BUF_LEN, baseInfo.devId, DEVID_BUFF_LEN) != EOK) { (void)SoftBusMutexUnlock(&connection->lock); - CONN_LOGE(CONN_BLE, "memcpy_s udid failed, connId=%{public}u", connection->connectionId); + CONN_LOGE(CONN_BLE, "memcpy_s udid fail, connId=%{public}u", connection->connectionId); return SOFTBUS_MEM_ERR; } } @@ -781,7 +781,7 @@ void BleOnClientConnected(uint32_t connectionId) do { status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, connId=%{public}u, err=%{public}d", connectionId, status); + CONN_LOGE(CONN_BLE, "try to lock fail, connId=%{public}u, err=%{public}d", connectionId, status); break; } connection->state = BLE_CONNECTION_STATE_EXCHANGING_BASIC_INFO; @@ -790,14 +790,14 @@ void BleOnClientConnected(uint32_t connectionId) connectionId, 0, NULL, BASIC_INFO_EXCHANGE_TIMEOUT); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "post basic info exchange timeout event failed, connId=%{public}u, err=%{public}d", + "post basic info exchange timeout event fail, connId=%{public}u, err=%{public}d", connectionId, status); break; } status = SendBasicInfo(connection); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "send basic info message failed, connId=%{public}u, err=%{public}d", connectionId, status); + "send basic info message fail, connId=%{public}u, err=%{public}d", connectionId, status); break; } } while (false); @@ -819,7 +819,7 @@ void BleOnClientFailed(uint32_t connectionId, int32_t error) int32_t status = SoftBusMutexLock(&connection->connectStatus->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "lock failed, connId=%{public}u", connectionId); + CONN_LOGE(CONN_BLE, "lock fail, connId=%{public}u", connectionId); ConnBleReturnConnection(&connection); return; } @@ -841,7 +841,7 @@ static void HandleBasicInfo(ConnBleConnection *connection, uint8_t *data, uint32 int32_t ret = ParseBasicInfo(connection, data, dataLen); SoftBusFree(data); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "parse basic info failed, connId=%{public}u, side=%{public}d, handle=%{public}d, " + CONN_LOGE(CONN_BLE, "parse basic info fail, connId=%{public}u, side=%{public}d, handle=%{public}d, " "err=%{public}d", connection->connectionId, connection->side, connection->underlayerHandle, ret); if (connection->side == CONN_SIDE_CLIENT) { g_connectionListener.onConnectFailed(connection->connectionId, ret); @@ -855,7 +855,7 @@ static void HandleBasicInfo(ConnBleConnection *connection, uint8_t *data, uint32 if (connection->side == CONN_SIDE_SERVER) { ret = SendBasicInfo(connection); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "send server side basic info failed, connId=%{public}u, handle=%{public}d, " + CONN_LOGE(CONN_BLE, "send server side basic info fail, connId=%{public}u, handle=%{public}d, " "err=%{public}d", connection->connectionId, connection->underlayerHandle, ret); interface->bleServerDisconnect(connection); return; @@ -902,7 +902,7 @@ void BleOnDataReceived(uint32_t connectionId, bool isConnCharacteristic, uint8_t SoftBusFree(data); // NOT notify client 'onConnectFailed' or server disconnect as it can not get state safely here, // connection will fail after basic info change timeout, all resouces will cleanup in timeout handle method - CONN_LOGE(CONN_BLE, "try to lock failed, connId=%{public}u, err=%{public}d", connectionId, status); + CONN_LOGE(CONN_BLE, "try to lock fail, connId=%{public}u, err=%{public}d", connectionId, status); break; } enum ConnBleConnectionState state = connection->state; @@ -931,7 +931,7 @@ void BleOnServerStarted(BleProtocolType protocol, int32_t status) CONN_LOGD(CONN_BLE, "receive ble server started event, status=%{public}d", status); CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&g_serverCoordination.lock) == SOFTBUS_OK, CONN_BLE, - "on server start event handle failed, try to lock failed"); + "on server start event handle fail, try to lock fail"); g_serverCoordination.status[protocol] = status; g_serverCoordination.actual = (g_serverCoordination.status[BLE_GATT] == SOFTBUS_OK && g_serverCoordination.status[BLE_COC] == SOFTBUS_OK) ? @@ -948,7 +948,7 @@ void BleOnServerClosed(BleProtocolType protocol, int32_t status) CONN_LOGD(CONN_BLE, "receive ble server closed event, status=%{public}d", status); CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&g_serverCoordination.lock) == SOFTBUS_OK, CONN_BLE, - "on server close event handle failed, try to lock failed"); + "on server close event handle fail, try to lock fail"); g_serverCoordination.status[protocol] = status; g_serverCoordination.actual = (g_serverCoordination.status[BLE_GATT] == SOFTBUS_OK && g_serverCoordination.status[BLE_COC] == SOFTBUS_OK ? @@ -966,12 +966,12 @@ void BleOnServerAccepted(uint32_t connectionId) CONN_CHECK_AND_RETURN_LOGW(connection != NULL, CONN_BLE, "connection not exist, connId=%{public}u", connectionId); const BleUnifyInterface *interface = ConnBleGetUnifyInterface(connection->protocol); CONN_CHECK_AND_RETURN_LOGW(interface != NULL, CONN_BLE, - "ble server accepted failed, interface not support, connId=%{public}u", connectionId); + "ble server accepted fail, interface not support, connId=%{public}u", connectionId); int32_t status = SOFTBUS_OK; do { status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, connId=%{public}u, err=%{public}d", connectionId, status); + CONN_LOGE(CONN_BLE, "try to lock fail, connId=%{public}u, err=%{public}d", connectionId, status); break; } connection->state = BLE_CONNECTION_STATE_EXCHANGING_BASIC_INFO; @@ -980,7 +980,7 @@ void BleOnServerAccepted(uint32_t connectionId) connectionId, 0, NULL, BASIC_INFO_EXCHANGE_TIMEOUT); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "post basic info exchange timeout event failed, connId=%{public}u, err=%{public}d", + "post basic info exchange timeout event fail, connId=%{public}u, err=%{public}d", connectionId, status); break; } @@ -1021,10 +1021,10 @@ void ConnBleOccupy(ConnBleConnection *connection) &g_bleConnectionAsyncHandler, MSG_CONNECTION_OCCUPY_RELEASE, connection->connectionId, 0, NULL); int32_t ret = ConnPostMsgToLooper(&g_bleConnectionAsyncHandler, MSG_CONNECTION_OCCUPY_RELEASE, connection->connectionId, 0, NULL, WAIT_TIMEOUT_OCCUPY); - CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_BLE, "post msg failed, connId=%{public}u, err=%{public}d", + CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_BLE, "post msg fail, connId=%{public}u, err=%{public}d", connection->connectionId, ret); CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&connection->lock) == SOFTBUS_OK, CONN_BLE, - "lock failed, connId=%{public}u", connection->connectionId); + "lock fail, connId=%{public}u", connection->connectionId); connection->isOccupied = true; (void)SoftBusMutexUnlock(&connection->lock); } @@ -1032,7 +1032,7 @@ void ConnBleOccupy(ConnBleConnection *connection) static void RetryServerStatConsistentHandler(void) { CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&g_serverCoordination.lock) == SOFTBUS_OK, CONN_BLE, - "retry server state consistent msg handle, try to lock failed"); + "retry server state consistent msg handle, try to lock fail"); enum BleServerState expect = g_serverCoordination.expect; enum BleServerState actual = g_serverCoordination.actual; (void)SoftBusMutexUnlock(&g_serverCoordination.lock); @@ -1053,7 +1053,7 @@ static void RetryServerStatConsistentHandler(void) return; } CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&g_serverCoordination.lock) == SOFTBUS_OK, CONN_BLE, - "retry server state consistent msg handle, try to lock failed"); + "retry server state consistent msg handle, try to lock fail"); g_serverCoordination.actual = (expect == BLE_SERVER_STATE_STARTED ? BLE_SERVER_STATE_STARTING : BLE_SERVER_STATE_STOPPING); (void)SoftBusMutexUnlock(&g_serverCoordination.lock); @@ -1063,10 +1063,10 @@ static void BasicInfoExchangeTimeoutHandler(uint32_t connectionId) { ConnBleConnection *connection = ConnBleGetConnectionById(connectionId); CONN_CHECK_AND_RETURN_LOGW(connection != NULL, CONN_BLE, - "ble basic info exchange timeout handle failed, connection not exist, connId=%{public}u", connectionId); + "ble basic info exchange timeout handle fail, connection not exist, connId=%{public}u", connectionId); const BleUnifyInterface *interface = ConnBleGetUnifyInterface(connection->protocol); CONN_CHECK_AND_RETURN_LOGW(interface != NULL, CONN_BLE, - "ble basic info exchange timeout handle failed, protocol not support, connId=%{public}u", connectionId); + "ble basic info exchange timeout handle fail, protocol not support, connId=%{public}u", connectionId); CONN_LOGW(CONN_BLE, "ble basic info exchange timeout, connId=%{public}u, side=%{public}s", connectionId, connection->side == CONN_SIDE_CLIENT ? "client" : "server"); if (connection->side == CONN_SIDE_CLIENT) { @@ -1081,10 +1081,10 @@ static void WaitNegotiationClosingTimeoutHandler(uint32_t connectionId) { ConnBleConnection *connection = ConnBleGetConnectionById(connectionId); CONN_CHECK_AND_RETURN_LOGW(connection != NULL, CONN_BLE, - "ble wait negotiation closing timeout handler failed: connection not exist, connId=%{public}u", connectionId); + "ble wait negotiation closing timeout handler fail: connection not exist, connId=%{public}u", connectionId); int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, connId=%{public}u", connectionId); + CONN_LOGE(CONN_BLE, "try to lock fail, connId=%{public}u", connectionId); ConnBleReturnConnection(&connection); return; } @@ -1102,7 +1102,7 @@ static void ConnectionIdleDisconnectTimeoutHandler(uint32_t connectionId) { ConnBleConnection *connection = ConnBleGetConnectionById(connectionId); CONN_CHECK_AND_RETURN_LOGW(connection != NULL, CONN_BLE, - "connection idle disconnect timeout handler failed: connection not exist, connId=%{public}u", connectionId); + "connection idle disconnect timeout handler fail: connection not exist, connId=%{public}u", connectionId); CONN_LOGW(CONN_BLE, "connection idle disconnect timeout handler, connection idle exceed forgot call " "disconnect? disconnect now, timeoutMillis=%{public}ums, connId=%{public}u", @@ -1117,7 +1117,7 @@ static void BleOnOccupyRelease(uint32_t connectionId) CONN_CHECK_AND_RETURN_LOGE(connection != NULL, CONN_BLE, "conn not exist, id=%{public}u", connectionId); int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "lock failed, connectionId=%{public}u, error=%{public}d", connectionId, status); + CONN_LOGE(CONN_BLE, "lock fail, connectionId=%{public}u, error=%{public}d", connectionId, status); ConnBleReturnConnection(&connection); return; } @@ -1191,7 +1191,7 @@ static int BleCompareConnectionLooperEventFunc(const SoftBusMessage *msg, void * } if (ctx->arg1 != 0 || ctx->arg2 != 0 || ctx->obj != NULL) { CONN_LOGE(CONN_BLE, "there is compare context value not use, forgot implement? " - "compare failed to avoid fault silence, what=%{public}d, arg1=%{public}" PRIu64 + "compare fail to avoid fault silence, what=%{public}d, arg1=%{public}" PRIu64 ", arg2=%{public}" PRIu64 ", objIsNull=%{public}d", ctx->what, ctx->arg1, ctx->arg2, ctx->obj == NULL); return COMPARE_FAILED; @@ -1202,28 +1202,28 @@ static int BleCompareConnectionLooperEventFunc(const SoftBusMessage *msg, void * static int32_t CheckBleInitConnectionPara(SoftBusLooper *looper, ConnBleConnectionEventListener *listener) { CONN_CHECK_AND_RETURN_RET_LOGW(looper != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init ble connection failed: invalid param, looper is null"); + "init ble connection fail: invalid param, looper is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init ble connection failed: invalid param, listener is null"); + "init ble connection fail: invalid param, listener is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onServerAccepted != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init ble connection failed: invalid param, listener onServerAccepted is null"); + "init ble connection fail: invalid param, listener onServerAccepted is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onConnected != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init ble connection failed: invalid param, listener onConnected is null"); + "init ble connection fail: invalid param, listener onConnected is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onConnectFailed != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init ble connection failed: invalid param, listener onConnectFailed is null"); + "init ble connection fail: invalid param, listener onConnectFailed is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onDataReceived != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init ble connection failed: invalid param, listener onDataReceived is null"); + "init ble connection fail: invalid param, listener onDataReceived is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onConnectionClosed != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init ble connection failed: invalid param, listener onConnectionClosed is null"); + "init ble connection fail: invalid param, listener onConnectionClosed is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onConnectionResume != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init ble connection failed: invalid param, listener onConnectionResume is null"); + "init ble connection fail: invalid param, listener onConnectionResume is null"); return SOFTBUS_OK; } int32_t ConnBleInitConnectionMudule(SoftBusLooper *looper, ConnBleConnectionEventListener *listener) { int32_t ret = CheckBleInitConnectionPara(looper, listener); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_INIT, "ConnServerPartInit init failed."); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_INIT, "ConnServerPartInit init fail."); ConnBleClientEventListener clientEventListener = { .onClientConnected = BleOnClientConnected, .onClientFailed = BleOnClientFailed, @@ -1246,14 +1246,14 @@ int32_t ConnBleInitConnectionMudule(SoftBusLooper *looper, ConnBleConnectionEven } ret = interface->bleClientInitModule(looper, &clientEventListener); CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_INIT, - "init ble connection failed: init ble client failed, i=%{public}d, err=%{public}d", i, ret); + "init ble connection fail: init ble client fail, i=%{public}d, err=%{public}d", i, ret); ret = interface->bleServerInitModule(looper, &serverEventListener); CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_INIT, - "init ble connection failed: init ble server failed, i=%{public}d, err=%{public}d", i, ret); + "init ble connection fail: init ble server fail, i=%{public}d, err=%{public}d", i, ret); } ret = SoftBusMutexInit(&g_serverCoordination.lock, NULL); CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_INIT, - "init ble connection failed: init server coordination lock failed, err=%{public}d", ret); + "init ble connection fail: init server coordination lock fail, err=%{public}d", ret); g_bleConnectionAsyncHandler.handler.looper = looper; g_connectionListener = *listener; return SOFTBUS_OK; diff --git a/core/connection/ble/src/softbus_conn_ble_manager.c b/core/connection/ble/src/softbus_conn_ble_manager.c index 81f13a20f1..d2f3908e72 100644 --- a/core/connection/ble/src/softbus_conn_ble_manager.c +++ b/core/connection/ble/src/softbus_conn_ble_manager.c @@ -258,7 +258,7 @@ static int32_t NewDevice(ConnBleDevice **outDevice, const ConnBleConnectRequestC device->retryCount = 0; uint64_t feature = 0; if (LnnGetConnSubFeatureByUdidHashStr(ctx->udid, &feature) != SOFTBUS_OK) { - CONN_LOGD(CONN_BLE, "get connSubFeature failed"); + CONN_LOGD(CONN_BLE, "get connSubFeature fail"); } device->isSupportNetworkIdExchange = (feature & (1 << CONN_FEATURE_SUPPORT_NETWORKID_EXCAHNGE)) != 0; ListInit(&device->requests); @@ -283,7 +283,7 @@ static int32_t ConvertCtxToDevice(ConnBleDevice **outDevice, const ConnBleConnec ConnBleRequest *request = NULL; int32_t status = NewRequest(&request, ctx); CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, status, CONN_BLE, - "newrequest is failed, err=%{public}d", status); + "newrequest is fail, err=%{public}d", status); ConnBleDevice *device = NULL; status = NewDevice(&device, ctx); @@ -313,7 +313,7 @@ static int32_t BleConvert2ConnectionInfo(ConnBleConnection *connection, Connecti info->bleInfo.psm = connection->psm; ConnBleInnerComplementDeviceId(connection); if (strlen(connection->udid) == 0) { - CONN_LOGW(CONN_BLE, "generate udid hash failed: device is not lnn online, connId=%{public}d", + CONN_LOGW(CONN_BLE, "generate udid hash fail: device is not lnn online, connId=%{public}d", connection->connectionId); // it will be complement later on lnn online listener return SOFTBUS_OK; @@ -322,7 +322,7 @@ static int32_t BleConvert2ConnectionInfo(ConnBleConnection *connection, Connecti status = SoftBusGenerateStrHash( (unsigned char *)connection->udid, strlen(connection->udid), (unsigned char *)info->bleInfo.deviceIdHash); CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, status, CONN_BLE, - "convert ble connection info failed: generate udid hash failed, connId=%{public}u, err=%{public}d", + "convert ble connection info fail: generate udid hash fail, connId=%{public}u, err=%{public}d", connection->connectionId, status); return SOFTBUS_OK; } @@ -337,7 +337,7 @@ static void BleNotifyDeviceConnectResult(const ConnBleDevice *device, ConnBleCon if (connection == NULL) { LIST_FOR_EACH_ENTRY(it, &device->requests, ConnBleRequest, node) { CONN_LOGI(CONN_BLE, - "ble notify connect requestfailed, requestId=%{public}u, addr=%{public}s, protocol=%{public}d, " + "ble notify connect request fail, requestId=%{public}u, addr=%{public}s, protocol=%{public}d, " "reason=%{public}d", it->requestId, anomizeAddress, device->protocol, reason); DfxRecordBleConnectFail(it->requestId, DEFAULT_PID, (ConnBleDevice *)device, &it->statistics, reason); @@ -350,7 +350,7 @@ static void BleNotifyDeviceConnectResult(const ConnBleDevice *device, ConnBleCon int32_t status = BleConvert2ConnectionInfo(connection, &info); if (status != SOFTBUS_OK) { CONN_LOGE( - CONN_BLE, "convert ble connection info failed, It cann't backoff now, just ahead. err=%{public}d", status); + CONN_BLE, "convert ble connection info fail, It cann't backoff now, just ahead. err=%{public}d", status); } LIST_FOR_EACH_ENTRY(it, &device->requests, ConnBleRequest, node) { ConnBleUpdateConnectionRc(connection, it->challengeCode, 1); @@ -369,7 +369,7 @@ static void BleNotifyDeviceConnectResult(const ConnBleDevice *device, ConnBleCon static bool BleReuseConnection(ConnBleDevice *device, ConnBleConnection *connection) { CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&connection->lock) == SOFTBUS_OK, false, CONN_BLE, - "ATTENTION UNEXPECTED ERROR! ble reuse connection failed: try to lock failed, connId=%{public}u", + "ATTENTION UNEXPECTED ERROR! ble reuse connection fail: try to lock fail, connId=%{public}u", connection->connectionId); enum ConnBleConnectionState state = connection->state; (void)SoftBusMutexUnlock(&connection->lock); @@ -383,7 +383,7 @@ static bool BleReuseConnection(ConnBleDevice *device, ConnBleConnection *connect static bool BleCheckPreventing(const char *udid) { CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_bleManager.prevents->lock) == SOFTBUS_OK, false, CONN_BLE, - "ATTENTION UNEXPECTED ERROR! ble check preventing failed: try to lock failed"); + "ATTENTION UNEXPECTED ERROR! ble check preventing fail: try to lock fail"); bool preventing = false; BlePrevent *it = NULL; LIST_FOR_EACH_ENTRY(it, &g_bleManager.prevents->list, BlePrevent, node) { @@ -476,7 +476,7 @@ static int32_t BleConnectDeviceDirectly(ConnBleDevice *device, const char *anomi address = (char *)SoftBusCalloc(BT_MAC_LEN); if (address == NULL || strcpy_s(address, BT_MAC_LEN, device->addr) != EOK) { CONN_LOGE(CONN_BLE, - "copy ble address for connect timeout event failed, requestAddress=%{public}s, udid=%{public}s", + "copy ble address for connect timeout event fail, requestAddress=%{public}s, udid=%{public}s", anomizeAddress, anomizeUdid); status = SOFTBUS_MEM_ERR; break; @@ -494,7 +494,7 @@ static int32_t BleConnectDeviceDirectly(ConnBleDevice *device, const char *anomi status = ConnPostMsgToLooper(&g_bleManagerSyncHandler, BLE_MGR_MSG_CONNECT_TIMEOUT, connection->connectionId, 0, address, BLE_CONNECT_TIMEOUT_MILLIS); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "post msg failed, requestAddress=%{public}s, udid=%{public}s, error=%{public}d", + CONN_LOGE(CONN_BLE, "post msg fail, requestAddress=%{public}s, udid=%{public}s, error=%{public}d", anomizeAddress, anomizeUdid, status); break; } @@ -557,7 +557,7 @@ static int32_t PendingDevice(ConnBleDevice *device, const char *anomizeAddress, if (strlen(target->udid) == 0 && strlen(device->udid) != 0) { if (strcpy_s(target->udid, UDID_BUF_LEN, device->udid) != EOK) { CONN_LOGE(CONN_BLE, - "copy ble connect request udid to previous request failed, it is not a big deal, just " + "copy ble connect request udid to previous request fail, it is not a big deal, just " "ahead, addr=%{public}s", anomizeAddress); } @@ -573,7 +573,7 @@ static void BleConnectRequestOnAvailableState(const ConnBleConnectRequestContext int32_t status = ConvertCtxToDevice(&device, ctx); if (status != SOFTBUS_OK) { CONN_LOGE( - CONN_BLE, "convert ble connect request failed, reqId=%{public}u, err=%{public}d", ctx->requestId, status); + CONN_BLE, "convert ble connect request fail, reqId=%{public}u, err=%{public}d", ctx->requestId, status); DfxRecordBleConnectFail(ctx->requestId, DEFAULT_PID, device, &ctx->statistics, status); ctx->result.OnConnectFailed(ctx->requestId, status); return; @@ -593,7 +593,7 @@ static void BleConnectRequestOnConnectingState(const ConnBleConnectRequestContex int32_t status = ConvertCtxToDevice(&device, ctx); if (status != SOFTBUS_OK) { CONN_LOGE( - CONN_BLE, "convert ble connect request failed, reqId=%{public}u, err=%{public}d", ctx->requestId, status); + CONN_BLE, "convert ble connect request fail, reqId=%{public}u, err=%{public}d", ctx->requestId, status); DfxRecordBleConnectFail(ctx->requestId, DEFAULT_PID, device, &ctx->statistics, status); ctx->result.OnConnectFailed(ctx->requestId, status); return; @@ -690,7 +690,7 @@ static int32_t BleTryReuseServerOrRetryConnect(ConnBleConnection *connection, Co ConnBleConnection *serverConnection = ConnBleGetConnectionByAddr(connection->addr, CONN_SIDE_SERVER, connectingDevice->protocol); if (serverConnection != NULL && BleReuseConnection(connectingDevice, serverConnection)) { - CONN_LOGI(CONN_BLE, "ble client connect failed, but there is a server connection connected, reuse it, " + CONN_LOGI(CONN_BLE, "ble client connect fail, but there is a server connection connected, reuse it, " "connId=%{public}u, addr=%{public}s", serverConnection->connectionId, anomizeAddress); ConnBleReturnConnection(&serverConnection); FreeDevice(connectingDevice); @@ -717,7 +717,7 @@ static void BleClientConnectFailed(uint32_t connectionId, int32_t error) char anomizeAddress[BT_MAC_LEN] = { 0 }; ConvertAnonymizeMacAddress(anomizeAddress, BT_MAC_LEN, connection->addr, BT_MAC_LEN); - CONN_LOGI(CONN_BLE, "ble client connect failed, connId=%{public}u, addr=%{public}s, err=%{public}d", connectionId, + CONN_LOGI(CONN_BLE, "ble client connect fail, connId=%{public}u, addr=%{public}s, err=%{public}d", connectionId, anomizeAddress, error); ConnBleDisconnectNow(connection, BLE_DISCONNECT_REASON_INTERNAL_ERROR); @@ -772,7 +772,7 @@ static bool IsSameDevice(const char *leftIdentifier, const char *rightIdentifier unsigned char rightHash[UDID_HASH_LEN] = { 0 }; if (SoftBusGenerateStrHash((const unsigned char *)leftIdentifier, leftLen, leftHash) != SOFTBUS_OK || SoftBusGenerateStrHash((const unsigned char *)rightIdentifier, rightLen, rightHash) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "generate hash failed"); + CONN_LOGE(CONN_BLE, "generate hash fail"); return false; } // only compare first 8 bytes of hash @@ -782,7 +782,7 @@ static bool IsSameDevice(const char *leftIdentifier, const char *rightIdentifier SOFTBUS_OK || ConvertBytesToHexString(rightHashStr, HEXIFY_LEN(SHORT_UDID_HASH_LEN), rightHash, SHORT_UDID_HASH_LEN) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "convert bytes to array failed"); + CONN_LOGE(CONN_BLE, "convert bytes to array fail"); return false; } if (leftLen == UDID_BUF_LEN - 1) { @@ -808,13 +808,13 @@ static void BleServerAccepted(uint32_t connectionId) int32_t status = BleConvert2ConnectionInfo(connection, &info); if (status != SOFTBUS_OK) { CONN_LOGE( - CONN_BLE, "convert connection info failed. It can not backoff now, just ahead. err=%{public}d", status); + CONN_BLE, "convert connection info fail. It can not backoff now, just ahead. err=%{public}d", status); } char udidHashStr[HEXIFY_LEN(SHORT_UDID_HASH_LEN)] = { 0 }; status = ConvertBytesToHexString( udidHashStr, HEXIFY_LEN(SHORT_UDID_HASH_LEN), (unsigned char *)info.bleInfo.deviceIdHash, SHORT_UDID_HASH_LEN); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "convert peerUdidHash to string failed, connectionId=%{public}u, err=%{public}d.", + CONN_LOGE(CONN_BLE, "convert peerUdidHash to string fail, connectionId=%{public}u, err=%{public}d.", connectionId, status); } char anomizeUdid[UDID_BUF_LEN] = { 0 }; @@ -835,7 +835,7 @@ static void BleServerAccepted(uint32_t connectionId) ConnBleDevice *connectingDevice = g_bleManager.connecting; if (connectingDevice != NULL && StrCmpIgnoreCase(connectingDevice->addr, connection->addr) == 0) { CONN_LOGW(CONN_BLE, - "both ends request establish connection at the same time, it will reused after connect failed, " + "both ends request establish connection at the same time, it will reused after connect fail, " "connId=%{public}u, peerAddr=%{public}s", connectionId, anomizeAddress); } @@ -869,14 +869,14 @@ static void BleConnectionClosed(uint32_t connectionId, int32_t error) int32_t status = BleConvert2ConnectionInfo(connection, &info); if (status != SOFTBUS_OK) { CONN_LOGE( - CONN_BLE, "convert ble connection info failed. It cann't backoff now, just ahead. err=%{public}d", status); + CONN_BLE, "convert ble connection info fail. It cann't backoff now, just ahead. err=%{public}d", status); } char udidHashStr[HEXIFY_LEN(UDID_HASH_LEN)] = { 0 }; status = ConvertBytesToHexString( udidHashStr, HEXIFY_LEN(UDID_HASH_LEN), (unsigned char *)info.bleInfo.deviceIdHash, UDID_HASH_LEN); if (status != SOFTBUS_OK) { CONN_LOGE( - CONN_BLE, "convert udid hash to string failed, It cann't backoff now, just ahead. err=%{public}d", status); + CONN_BLE, "convert udid hash to string fail, It cann't backoff now, just ahead. err=%{public}d", status); } if (connection->protocol == BLE_GATT) { SoftbusBleConflictNotifyDisconnectPacked(connection->addr, udidHashStr); @@ -892,7 +892,7 @@ static void BleConnectionResume(uint32_t connectionId) { ConnBleConnection *connection = ConnBleGetConnectionById(connectionId); CONN_CHECK_AND_RETURN_LOGW(connection != NULL, CONN_BLE, - "ble connection resume handle failed: connection not exist, connId=%{public}u", connectionId); + "ble connection resume handle fail: connection not exist, connId=%{public}u", connectionId); ConnBleDevice *it = NULL; ConnBleDevice *next = NULL; @@ -969,13 +969,13 @@ static void ReceivedControlData(ConnBleConnection *connection, const uint8_t *da { cJSON *json = cJSON_ParseWithLength((const char *)data, dataLen); if (json == NULL) { - CONN_LOGE(CONN_BLE, "parse json failed. connId=%{public}u", connection->connectionId); + CONN_LOGE(CONN_BLE, "parse json fail. connId=%{public}u", connection->connectionId); return; } int32_t method = 0; if (!GetJsonObjectNumberItem(json, CTRL_MSG_KEY_METHOD, &method)) { - CONN_LOGE(CONN_BLE, "parse method failed. connId=%{public}u", connection->connectionId); + CONN_LOGE(CONN_BLE, "parse method fail. connId=%{public}u", connection->connectionId); cJSON_Delete(json); return; } @@ -1007,7 +1007,7 @@ static int32_t BleReuseConnectionCommon(const char *udid, const char *anomizeAdd } if (SoftBusMutexLock(&connection->lock) != SOFTBUS_OK) { CONN_LOGE( - CONN_BLE, "try to lock failed, connId=%{public}u, addr=%{public}s", + CONN_BLE, "try to lock fail, connId=%{public}u, addr=%{public}s", connection->connectionId, anomizeAddress); ConnBleReturnConnection(&connection); return SOFTBUS_LOCK_ERR; @@ -1082,7 +1082,7 @@ static int32_t BleReuseConnectionRequestOnConnectingState(const ConnBleReuseConn static void BlePreventTimeout(const char *udid) { CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&g_bleManager.prevents->lock) == SOFTBUS_OK, CONN_BLE, - "ATTENTION UNEXPECTED ERROR! ble prevent timeout handle failed: try to lock failed"); + "ATTENTION UNEXPECTED ERROR! ble prevent timeout handle fail: try to lock fail"); do { size_t udidLen = strlen(udid); BlePrevent *it = NULL; @@ -1122,7 +1122,7 @@ static void BleReset(int32_t reason) int32_t status = SoftBusMutexLock(&g_bleManager.prevents->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock prevents failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "try to lock prevents fail, err=%{public}d", status); return; } BlePrevent *preventIt = NULL; @@ -1137,7 +1137,7 @@ static void BleReset(int32_t reason) status = SoftBusMutexLock(&g_bleManager.connections->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock connections failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "try to lock connections fail, err=%{public}d", status); return; } ConnBleConnection *connectionIt = NULL; @@ -1156,7 +1156,7 @@ static void BleKeepAliveTimeout(uint32_t connectionId, uint32_t requestId) "connection not exist, connectionId=%{public}u", connectionId); int32_t status = ConnBleUpdateConnectionRc(connection, 0, -1); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update rc failed, status=%{public}d, connectionId=%{public}u, requestId=%{public}u", + CONN_LOGE(CONN_BLE, "update rc fail, status=%{public}d, connectionId=%{public}u, requestId=%{public}u", status, connectionId, requestId); } ConnBleReturnConnection(&connection); @@ -1182,7 +1182,7 @@ int32_t ConnBleSaveConnection(ConnBleConnection *connection) int32_t status = SoftBusMutexLock(&g_bleManager.connections->lock); if (status != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "try to get ble manager connections lock failed, err=%{public}d", status); + CONN_LOGW(CONN_BLE, "try to get ble manager connections lock fail, err=%{public}d", status); return status; } uint32_t connectionId = 0; @@ -1201,7 +1201,7 @@ void ConnBleRemoveConnection(ConnBleConnection *connection) { CONN_CHECK_AND_RETURN_LOGW(connection != NULL, CONN_BLE, "invalid param, connection is null"); CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&g_bleManager.connections->lock) == SOFTBUS_OK, CONN_BLE, - "try to get ble manager connections lock failed"); + "try to get ble manager connections lock fail"); bool exist = false; ConnBleConnection *it = NULL; LIST_FOR_EACH_ENTRY(it, &g_bleManager.connections->list, ConnBleConnection, node) { @@ -1299,7 +1299,7 @@ static ConnBleConnection *GetConnectionByOption(const BleConnectionCompareOption } int32_t status = SoftBusMutexLock(&g_bleManager.connections->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to get manager connections lock failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "try to get manager connections lock fail, err=%{public}d", status); return NULL; } ConnBleConnection *it = NULL; @@ -1313,7 +1313,7 @@ static ConnBleConnection *GetConnectionByOption(const BleConnectionCompareOption if (target != NULL) { status = SoftBusMutexLock(&target->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to get connection lock failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "try to get connection lock fail, err=%{public}d", status); SoftBusMutexUnlock(&g_bleManager.connections->lock); return NULL; } @@ -1391,7 +1391,7 @@ void ConnBleReturnConnection(ConnBleConnection **connection) ConnBleConnection *underlayer = *connection; CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&underlayer->lock) == SOFTBUS_OK, CONN_BLE, - "ble connection lock failed. connectionId=%{public}u", underlayer->connectionId); + "ble connection lock fail. connectionId=%{public}u", underlayer->connectionId); underlayer->objectRc -= 1; int32_t objectRc = underlayer->objectRc; SoftBusMutexUnlock(&underlayer->lock); @@ -1411,7 +1411,7 @@ void NotifyReusedConnected(uint32_t connectionId, uint16_t challengeCode) int32_t status = BleConvert2ConnectionInfo(connection, &info); if (status != SOFTBUS_OK) { CONN_LOGE( - CONN_BLE, "convert connection info failed. It can not backoff now, just ahead. err=%{public}d", status); + CONN_BLE, "convert connection info fail. It can not backoff now, just ahead. err=%{public}d", status); } info.bleInfo.challengeCode = challengeCode; g_connectCallback.OnReusedConnected(connectionId, &info); @@ -1426,7 +1426,7 @@ int32_t ConnBleKeepAlive(uint32_t connectionId, uint32_t requestId, uint32_t tim "connection not exist, connectionId=%{public}u", connectionId); int32_t status = ConnBleUpdateConnectionRc(connection, 0, 1); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update rc failed, status=%{public}d, connectionId=%{public}u, requestId=%{public}u", + CONN_LOGE(CONN_BLE, "update rc fail, status=%{public}d, connectionId=%{public}u, requestId=%{public}u", status, connectionId, requestId); ConnBleReturnConnection(&connection); return SOFTBUS_CONN_BLE_INTERNAL_ERR; @@ -1453,7 +1453,7 @@ int32_t ConnBleRemoveKeepAlive(uint32_t connectionId, uint32_t requestId) } status = ConnBleUpdateConnectionRc(connection, 0, -1); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update rc failed, status=%{public}d, connectionId=%{public}u, requestId=%{public}u", + CONN_LOGE(CONN_BLE, "update rc fail, status=%{public}d, connectionId=%{public}u, requestId=%{public}u", status, connectionId, requestId); break; } @@ -1707,7 +1707,7 @@ static int BleCompareManagerLooperEventFunc(const SoftBusMessage *msg, void *arg if (ctx->arg1 != 0 || ctx->arg2 != 0 || ctx->obj != NULL) { CONN_LOGE(CONN_BLE, "there is compare context value not use, forgot implement? " - "compare failed to avoid fault silence, what=%{public}d, arg1=%{public}" PRIu64 ", arg2=%{public}" PRIu64 + "compare fail to avoid fault silence, what=%{public}d, arg1=%{public}" PRIu64 ", arg2=%{public}" PRIu64 ", objIsNull=%{public}d", ctx->what, ctx->arg1, ctx->arg2, ctx->obj == NULL); return COMPARE_FAILED; @@ -1718,22 +1718,22 @@ static int BleCompareManagerLooperEventFunc(const SoftBusMessage *msg, void *arg static int32_t BleConnectDevice(const ConnectOption *option, uint32_t requestId, const ConnectResult *result) { CONN_CHECK_AND_RETURN_RET_LOGW(option != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble connect device failed: option is null, reqId=%{public}u", requestId); + "ble connect device fail: option is null, reqId=%{public}u", requestId); CONN_CHECK_AND_RETURN_RET_LOGW(option->type == CONNECT_BLE, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble connect device failed: not ble connect type, reqId=%{public}u, type=%{public}d", requestId, option->type); + "ble connect device fail: not ble connect type, reqId=%{public}u, type=%{public}d", requestId, option->type); CONN_CHECK_AND_RETURN_RET_LOGW(result != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble connect device failed: result callback is null, reqId=%{public}u", requestId); + "ble connect device fail: result callback is null, reqId=%{public}u", requestId); CONN_CHECK_AND_RETURN_RET_LOGW(result->OnConnectSuccessed != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble connect device failed: result callback OnConnectSuccessed is null, reqId=%{public}u", requestId); + "ble connect device fail: result callback OnConnectSuccessed is null, reqId=%{public}u", requestId); CONN_CHECK_AND_RETURN_RET_LOGW(result->OnConnectFailed != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble connect device failed: result callback onConnectFailed is null, reqId=%{public}u", requestId); + "ble connect device fail: result callback onConnectFailed is null, reqId=%{public}u", requestId); // only use first SHORT_UDID_HASH_LEN bytes hash, keep same with share char udidHashStr[HEXIFY_LEN(SHORT_UDID_HASH_LEN)] = { 0 }; int32_t status = ConvertBytesToHexString(udidHashStr, HEXIFY_LEN(SHORT_UDID_HASH_LEN), (unsigned char *)option->bleOption.deviceIdHash, SHORT_UDID_HASH_LEN); CONN_CHECK_AND_RETURN_RET_LOGW(status == SOFTBUS_OK, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble connect device failed: convert device id hash to string failed, reqId=%{public}u, err=%{public}d", + "ble connect device fail: convert device id hash to string fail, reqId=%{public}u, err=%{public}d", requestId, status); char anomizeAddress[BT_MAC_LEN] = { 0 }; @@ -1744,7 +1744,7 @@ static int32_t BleConnectDevice(const ConnectOption *option, uint32_t requestId, ConnBleConnectRequestContext *ctx = (ConnBleConnectRequestContext *)SoftBusCalloc(sizeof(ConnBleConnectRequestContext)); CONN_CHECK_AND_RETURN_RET_LOGE(ctx != NULL, SOFTBUS_MEM_ERR, CONN_BLE, - "calloc connect request context object failed: reqId=%{public}u, addr=%{public}s, udid=%{public}s", + "calloc connect request context object fail: reqId=%{public}u, addr=%{public}s, udid=%{public}s", requestId, anomizeAddress, anomizeUdid); ctx->statistics.startTime = SoftBusGetSysTimeMs(); ctx->statistics.connectTraceId = SoftbusGetConnectTraceId(); @@ -1752,7 +1752,7 @@ static int32_t BleConnectDevice(const ConnectOption *option, uint32_t requestId, if (strcpy_s(ctx->addr, BT_MAC_LEN, option->bleOption.bleMac) != EOK || strcpy_s(ctx->udid, UDID_BUF_LEN, udidHashStr) != EOK) { CONN_LOGE(CONN_BLE, - "strcpy_s address or device identifier failed, reqId=%{public}u, addr=%{public}s, udid=%{public}s", + "strcpy_s address or device identifier fail, reqId=%{public}u, addr=%{public}s, udid=%{public}s", requestId, anomizeAddress, anomizeUdid); SoftBusFree(ctx); return SOFTBUS_STRCPY_ERR; @@ -1779,7 +1779,7 @@ static int32_t BleConnectDevice(const ConnectOption *option, uint32_t requestId, status = ConnPostMsgToLooper(&g_bleManagerSyncHandler, BLE_MGR_MSG_CONNECT_REQUEST, 0, 0, ctx, 0); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "post connect msg to manager looper failed, " + "post connect msg to manager looper fail, " "reqId=%{public}u, addr=%{public}s, udid=%{public}s, err=%{public}d", requestId, anomizeAddress, anomizeUdid, status); SoftBusFree(ctx); @@ -1807,7 +1807,7 @@ static int32_t BleDisconnectDevice(uint32_t connectionId) { ConnBleConnection *connection = ConnBleGetConnectionById(connectionId); CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, SOFTBUS_CONN_BLE_CONNECTION_NOT_EXIST_ERR, CONN_BLE, - "ble disconnect device failed: connection is not exist, reqId=%{public}u", connectionId); + "ble disconnect device fail: connection is not exist, reqId=%{public}u", connectionId); char animizeAddress[BT_MAC_LEN] = { 0 }; ConvertAnonymizeMacAddress(animizeAddress, BT_MAC_LEN, connection->addr, BT_MAC_LEN); ConnBleReturnConnection(&connection); @@ -1822,16 +1822,16 @@ static int32_t BleDisconnectDevice(uint32_t connectionId) static int32_t BleDisconnectDeviceNow(const ConnectOption *option) { CONN_CHECK_AND_RETURN_RET_LOGW(option != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble disconnect device now failed: invaliad param, option is null"); + "ble disconnect device now fail: invaliad param, option is null"); CONN_CHECK_AND_RETURN_RET_LOGW(option->type == CONNECT_BLE, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble disconnect device now failed: invaliad param, not ble connect type. type=%{public}d", option->type); + "ble disconnect device now fail: invaliad param, not ble connect type. type=%{public}d", option->type); char animizeAddress[BT_MAC_LEN] = { 0 }; ConvertAnonymizeMacAddress(animizeAddress, BT_MAC_LEN, option->bleOption.bleMac, BT_MAC_LEN); char hashStr[HEXIFY_LEN(SHORT_UDID_HASH_LEN)] = { 0 }; if (ConvertBytesToHexString(hashStr, HEXIFY_LEN(SHORT_UDID_HASH_LEN), (unsigned char *)option->bleOption.deviceIdHash, SHORT_UDID_HASH_LEN) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "convert bytes to array failed"); + CONN_LOGE(CONN_BLE, "convert bytes to array fail"); } char anomizeUdid[UDID_BUF_LEN] = { 0 }; ConvertAnonymizeSensitiveString(anomizeUdid, UDID_BUF_LEN, hashStr); @@ -1841,7 +1841,7 @@ static int32_t BleDisconnectDeviceNow(const ConnectOption *option) if (connection == NULL) { connection = ConnBleGetConnectionByAddr(option->bleOption.bleMac, CONN_SIDE_ANY, option->bleOption.protocol); CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, SOFTBUS_CONN_BLE_CONNECTION_NOT_EXIST_ERR, CONN_BLE, - "ble disconnect device now failed: connection is not exist"); + "ble disconnect device now fail: connection is not exist"); } int32_t status = ConnBleDisconnectNow(connection, BLE_DISCONNECT_REASON_FORCELY); @@ -1882,7 +1882,7 @@ static bool BleCheckActiveConnection(const ConnectOption *option, bool needOccup char hashStr[HEXIFY_LEN(SHORT_UDID_HASH_LEN)] = { 0 }; if (ConvertBytesToHexString(hashStr, HEXIFY_LEN(SHORT_UDID_HASH_LEN), (unsigned char *)option->bleOption.deviceIdHash, SHORT_UDID_HASH_LEN) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "convert bytes to array failed"); + CONN_LOGE(CONN_BLE, "convert bytes to array fail"); return false; } char anomizeUdid[UDID_BUF_LEN] = { 0 }; @@ -1928,15 +1928,15 @@ static void OnConnected(uint32_t connectionId) static void OnConnectFailed(uint32_t connectionId, int32_t error) { CONN_LOGW(CONN_BLE, - "receive ble client connect failed notify, connId=%{public}u, err=%{public}d", connectionId, error); + "receive ble client connect fail notify, connId=%{public}u, err=%{public}d", connectionId, error); BleStatusContext *ctx = (BleStatusContext *)SoftBusCalloc(sizeof(BleStatusContext)); - CONN_CHECK_AND_RETURN_LOGW(ctx != NULL, CONN_BLE, "on connect failed failed, calloc error context failed"); + CONN_CHECK_AND_RETURN_LOGW(ctx != NULL, CONN_BLE, "on connect failed fail, calloc error context fail"); ctx->connectionId = connectionId; ctx->status = error; int32_t ret = ConnPostMsgToLooper(&g_bleManagerSyncHandler, BLE_MGR_MSG_CONNECT_FAIL, 0, 0, ctx, 0); if (ret != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "post msg to looper failed, connectionId=%{public}u, error=%{public}d", connectionId, ret); + "post msg to looper fail, connectionId=%{public}u, error=%{public}d", connectionId, ret); SoftBusFree(ctx); } } @@ -1946,7 +1946,7 @@ static void OnDataReceived(uint32_t connectionId, bool isConnCharacteristic, uin ConnBleDataReceivedContext *ctx = (ConnBleDataReceivedContext *)SoftBusCalloc(sizeof(ConnBleDataReceivedContext)); if (ctx == NULL) { CONN_LOGE(CONN_BLE, - "calloc data received context failed, " + "calloc data received context fail, " "connectionId=%{public}u, isConnCharacteristic=%{public}d, dataLen=%{public}u", connectionId, isConnCharacteristic, dataLen); SoftBusFree(data); @@ -1959,7 +1959,7 @@ static void OnDataReceived(uint32_t connectionId, bool isConnCharacteristic, uin int32_t status = ConnPostMsgToLooper(&g_bleManagerSyncHandler, BLE_MGR_MSG_DATA_RECEIVED, 0, 0, ctx, 0); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "post msg to looper failed, connectionId=%{public}u, isConnCharacteristic=%{public}d, dataLen=%{public}u", + "post msg to looper fail, connectionId=%{public}u, isConnCharacteristic=%{public}d, dataLen=%{public}u", connectionId, isConnCharacteristic, dataLen); SoftBusFree(data); SoftBusFree(ctx); @@ -1969,13 +1969,13 @@ static void OnDataReceived(uint32_t connectionId, bool isConnCharacteristic, uin static void OnConnectionClosed(uint32_t connectionId, int32_t status) { BleStatusContext *ctx = (BleStatusContext *)SoftBusCalloc(sizeof(BleStatusContext)); - CONN_CHECK_AND_RETURN_LOGW(ctx != NULL, CONN_BLE, "on connect failed failed, calloc error context failed"); + CONN_CHECK_AND_RETURN_LOGW(ctx != NULL, CONN_BLE, "on connect closed fail, calloc error context fail"); ctx->connectionId = connectionId; ctx->status = status; int32_t ret = ConnPostMsgToLooper(&g_bleManagerSyncHandler, BLE_MGR_MSG_CONNECTION_CLOSED, 0, 0, ctx, 0); if (ret != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "post msg to looper failed, connectionId=%{public}u, error=%{public}d", connectionId, ret); + "post msg to looper fail, connectionId=%{public}u, error=%{public}d", connectionId, ret); SoftBusFree(ctx); } } @@ -1997,7 +1997,7 @@ static void onPostBytesFinished( ConnBleConnection *connection = ConnBleGetConnectionById(connectionId); if (connection == NULL) { // maybe fail reason is that connection not exist, so log level is warning - CONN_LOGW(CONN_BLE, "ble post bytes finished, send failed, connection not exist, connId=%{public}u", + CONN_LOGW(CONN_BLE, "ble post bytes finished, send fail, connection not exist, connId=%{public}u", connectionId); return; } @@ -2022,14 +2022,14 @@ static void OnBtStateChanged(int listenerId, int state) BleStatusContext *ctx = (BleStatusContext *)SoftBusCalloc(sizeof(BleStatusContext)); if (ctx == NULL) { CONN_LOGE(CONN_BLE, - "ble manager receive bt off event, send reset event failed: calloc ctx object failed"); + "ble manager receive bt off event, send reset event fail: calloc ctx object fail"); return; } ctx->status = SOFTBUS_CONN_BLUETOOTH_OFF; status = ConnPostMsgToLooper(&g_bleManagerSyncHandler, BLE_MGR_MSG_RESET, 0, 0, ctx, 0); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "ble manager receive bt off event, send reset event failed: post msg to looper failed"); + "ble manager receive bt off event, send reset event fail: post msg to looper fail"); SoftBusFree(ctx); } return; @@ -2040,9 +2040,9 @@ static void OnBtStateChanged(int listenerId, int state) static int32_t ConflictReuseConnection(const char *address, const char *udid, uint32_t requestId) { CONN_CHECK_AND_RETURN_RET_LOGW(address != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "conflict reuse connection failed: invalid param, address is null"); + "conflict reuse connection fail: invalid param, address is null"); CONN_CHECK_AND_RETURN_RET_LOGW( - udid != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, "conflict reuse connection failed: invalid param, udid is null"); + udid != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, "conflict reuse connection fail: invalid param, udid is null"); char anomizeAddress[BT_MAC_LEN] = { 0 }; ConvertAnonymizeMacAddress(anomizeAddress, BT_MAC_LEN, address, BT_MAC_LEN); @@ -2058,7 +2058,7 @@ static int32_t ConflictReuseConnection(const char *address, const char *udid, ui if (memcpy_s(ctx.addr, BT_MAC_LEN - 1, address, addressLen) != EOK || memcpy_s(ctx.udid, UDID_BUF_LEN - 1, udid, udidLen) != EOK) { CONN_LOGE(CONN_BLE, - "memcpy_s address or udid failed, " + "memcpy_s address or udid fail, " "addressLen=%{public}zu, udidLen=%{public}zu, reqId=%{public}u, addr=%{public}s, udid=%{public}s", addressLen, udidLen, requestId, anomizeAddress, anomizeUdid); return SOFTBUS_MEM_ERR; @@ -2081,19 +2081,19 @@ static bool ConflictPostBytes(int32_t underlayHandle, uint8_t *data, uint32_t da { static int64_t conflictSeqGenerator = 0; - CONN_CHECK_AND_RETURN_RET_LOGW(data != NULL, false, CONN_BLE, "conflict post bytes failed: data is null"); - CONN_CHECK_AND_RETURN_RET_LOGW(dataLen != 0, false, CONN_BLE, "conflict post bytes failed: data length is 0"); + CONN_CHECK_AND_RETURN_RET_LOGW(data != NULL, false, CONN_BLE, "conflict post bytes fail: data is null"); + CONN_CHECK_AND_RETURN_RET_LOGW(dataLen != 0, false, CONN_BLE, "conflict post bytes fail: data length is 0"); ConnBleConnection *connection = ConnBleGetConnectionByHandle(underlayHandle, CONN_SIDE_ANY, BLE_GATT); CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, false, CONN_BLE, - "conflict post bytes failed: connection not exist, underlayHandle=%{public}d", underlayHandle); + "conflict post bytes fail: connection not exist, underlayHandle=%{public}d", underlayHandle); uint32_t connectionId = connection->connectionId; ConnBleReturnConnection(&connection); uint32_t payloadLen = ConnGetHeadSize() + dataLen; uint8_t *payload = (uint8_t *)SoftBusCalloc(payloadLen); CONN_CHECK_AND_RETURN_RET_LOGE(payload != NULL, false, CONN_BLE, - "conflict post bytes failed: alloc payload failed, underlayHandle=%{public}d", underlayHandle); + "conflict post bytes fail: alloc payload fail, underlayHandle=%{public}d", underlayHandle); uint32_t seq = conflictSeqGenerator++; ConnPktHead *head = (ConnPktHead *)payload; @@ -2116,7 +2116,7 @@ static void ConflictDisconnect(int32_t handle, bool isForce) "conflict disconnect, receive disconnect request, handle=%{public}d, isForce=%{public}d", handle, isForce); ConnBleConnection *connection = ConnBleGetConnectionByHandle(handle, CONN_SIDE_ANY, BLE_GATT); CONN_CHECK_AND_RETURN_LOGW( - connection != NULL, CONN_BLE, "conflict disconnect failed: connection not exist, handle=%{public}d", handle); + connection != NULL, CONN_BLE, "conflict disconnect fail: connection not exist, handle=%{public}d", handle); if (isForce) { ConnBleDisconnectNow(connection, BLE_DISCONNECT_REASON_CONFLICT); } else { @@ -2127,26 +2127,26 @@ static void ConflictDisconnect(int32_t handle, bool isForce) static void ConflictOccupy(const char *udid, int32_t timeout) { - CONN_CHECK_AND_RETURN_LOGW(udid != NULL, CONN_BLE, "conflict occupy failed: invalid param, udid is null"); + CONN_CHECK_AND_RETURN_LOGW(udid != NULL, CONN_BLE, "conflict occupy fail: invalid param, udid is null"); CONN_CHECK_AND_RETURN_LOGW(timeout > 0, CONN_BLE, - "conflict occupy failed: invalid param, timeout=%{public}d", timeout); + "conflict occupy fail: invalid param, timeout=%{public}d", timeout); char anomizeUdid[UDID_BUF_LEN] = { 0 }; ConvertAnonymizeSensitiveString(anomizeUdid, UDID_BUF_LEN, udid); CONN_LOGW(CONN_BLE, "receive conflict occupy, udid=%{public}s, timeout=%{public}d", anomizeUdid, timeout); CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&g_bleManager.prevents->lock) == SOFTBUS_OK, CONN_BLE, - "ATTENTION UNEXPECTED ERROR! conflict occupy failed: try to lock failed, udid=%{public}s", anomizeUdid); + "ATTENTION UNEXPECTED ERROR! conflict occupy fail: try to lock fail, udid=%{public}s", anomizeUdid); do { char *copyUdid = (char *)SoftBusCalloc(UDID_BUF_LEN); if (copyUdid == NULL) { - CONN_LOGE(CONN_BLE, "calloc udid failed, udid=%{public}s", anomizeUdid); + CONN_LOGE(CONN_BLE, "calloc udid fail, udid=%{public}s", anomizeUdid); break; } size_t udidLen = strlen(udid); if (memcpy_s(copyUdid, UDID_BUF_LEN - 1, udid, udidLen) != EOK) { CONN_LOGE(CONN_BLE, - "memcpy_s udid failed, sourceLen=%{public}zu, destinationLen=%{public}u, udid=%{public}s", + "memcpy_s udid fail, sourceLen=%{public}zu, destinationLen=%{public}u, udid=%{public}s", udidLen, UDID_BUF_LEN, anomizeUdid); SoftBusFree(copyUdid); break; @@ -2166,7 +2166,7 @@ static void ConflictOccupy(const char *udid, int32_t timeout) ConnRemoveMsgFromLooper(&g_bleManagerSyncHandler, BLE_MGR_MSG_PREVENT_TIMEOUT, 0, 0, copyUdid); ret = ConnPostMsgToLooper(&g_bleManagerSyncHandler, BLE_MGR_MSG_PREVENT_TIMEOUT, 0, 0, copyUdid, timeout); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "post msg to looper failed, udid=%{public}s, error=%{public}d", anomizeUdid, ret); + CONN_LOGE(CONN_BLE, "post msg to looper fail, udid=%{public}s, error=%{public}d", anomizeUdid, ret); SoftBusFree(copyUdid); } break; @@ -2174,12 +2174,12 @@ static void ConflictOccupy(const char *udid, int32_t timeout) BlePrevent *prevent = (BlePrevent *)SoftBusCalloc(sizeof(BlePrevent)); if (prevent == NULL) { SoftBusFree(copyUdid); - CONN_LOGE(CONN_BLE, "calloc prevent object failed, udid=%{public}s", anomizeUdid); + CONN_LOGE(CONN_BLE, "calloc prevent object fail, udid=%{public}s", anomizeUdid); break; } if (memcpy_s(prevent->udid, UDID_BUF_LEN - 1, udid, udidLen) != EOK) { CONN_LOGE(CONN_BLE, - "memcpy_s udid to prevent object failed, sourceLen=%{public}zu, destinationLen=%{public}u, " + "memcpy_s udid to prevent object fail, sourceLen=%{public}zu, destinationLen=%{public}u, " "udid=%{public}s", udidLen, UDID_BUF_LEN, anomizeUdid); SoftBusFree(copyUdid); SoftBusFree(prevent); @@ -2189,7 +2189,7 @@ static void ConflictOccupy(const char *udid, int32_t timeout) g_bleManager.prevents->cnt++; ret = ConnPostMsgToLooper(&g_bleManagerSyncHandler, BLE_MGR_MSG_PREVENT_TIMEOUT, 0, 0, copyUdid, timeout); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "post msg to looper failed, udid=%{public}s, error=%{public}d", anomizeUdid, ret); + CONN_LOGE(CONN_BLE, "post msg to looper fail, udid=%{public}s, error=%{public}d", anomizeUdid, ret); ListDelete(&prevent->node); SoftBusFree(copyUdid); SoftBusFree(prevent); @@ -2203,14 +2203,14 @@ static void ConflictOccupy(const char *udid, int32_t timeout) static void ConflictCancelOccupy(const char *udid) { - CONN_CHECK_AND_RETURN_LOGW(udid != NULL, CONN_BLE, "conflict cancel occupy failed: invalid param, udid is null"); + CONN_CHECK_AND_RETURN_LOGW(udid != NULL, CONN_BLE, "conflict cancel occupy fail: invalid param, udid is null"); char anomizeUdid[UDID_BUF_LEN] = { 0 }; ConvertAnonymizeSensitiveString(anomizeUdid, UDID_BUF_LEN, udid); CONN_LOGI(CONN_BLE, "conflict cancel occupy, udid=%{public}s", anomizeUdid); CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&g_bleManager.prevents->lock) == SOFTBUS_OK, CONN_BLE, - "ATTENTION UNEXPECTED ERROR! conflict cancel occupy failed: try to lock failed, udid=%{public}s", anomizeUdid); + "ATTENTION UNEXPECTED ERROR! conflict cancel occupy fail: try to lock fail, udid=%{public}s", anomizeUdid); size_t udidLen = strlen(udid); BlePrevent *it = NULL; BlePrevent *next = NULL; @@ -2229,7 +2229,7 @@ static void ConflictCancelOccupy(const char *udid) static int32_t ConflictGetConnection(const char *udid) { CONN_CHECK_AND_RETURN_RET_LOGW( - udid != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, "conflict get connection failed: invalid param, udid is null"); + udid != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, "conflict get connection fail: invalid param, udid is null"); char anomizeUdid[UDID_BUF_LEN] = { 0 }; ConvertAnonymizeSensitiveString(anomizeUdid, UDID_BUF_LEN, udid); @@ -2237,11 +2237,11 @@ static int32_t ConflictGetConnection(const char *udid) ConnBleConnection *connection = ConnBleGetClientConnectionByUdid(udid, BLE_GATT); CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, SOFTBUS_CONN_BLE_CONNECTION_NOT_EXIST_ERR, CONN_BLE, - "conflict get connection failed: connection not exist, udid=%{public}s", anomizeUdid); + "conflict get connection fail: connection not exist, udid=%{public}s", anomizeUdid); int32_t result = SOFTBUS_CONN_BLE_INTERNAL_ERR; do { if (SoftBusMutexLock(&connection->lock) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, connId=%{public}u, udid=%{public}s", connection->connectionId, + CONN_LOGE(CONN_BLE, "try to lock fail, connId=%{public}u, udid=%{public}s", connection->connectionId, anomizeUdid); result = SOFTBUS_LOCK_ERR; break; @@ -2259,7 +2259,7 @@ static int32_t BleInitLooper(void) { g_bleManagerSyncHandler.handler.looper = GetLooper(LOOP_TYPE_CONN); if (g_bleManagerSyncHandler.handler.looper == NULL) { - CONN_LOGE(CONN_INIT, "init conn ble looper failed"); + CONN_LOGE(CONN_INIT, "init conn ble looper fail"); return SOFTBUS_NO_INIT; } return SOFTBUS_OK; @@ -2280,7 +2280,7 @@ static int32_t InitBleManager(const ConnectCallback *callback) SoftBusList *prevents = CreateSoftBusList(); CONN_CHECK_AND_RETURN_RET_LOGE( connections != NULL && prevents != NULL, SOFTBUS_CREATE_LIST_ERR, - CONN_INIT, "init ble manager failed: create list failed"); + CONN_INIT, "init ble manager fail: create list fail"); g_bleManager.connections = connections; g_bleManager.prevents = prevents; ListInit(&g_bleManager.waitings); @@ -2294,7 +2294,7 @@ static int32_t InitBleManager(const ConnectCallback *callback) int32_t listenerId = -1; int32_t ret = SoftBusAddBtStateListener(&btStateListener, &listenerId); CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, SOFTBUS_INVALID_NUM, CONN_INIT, - "int ble manager failed: add bluetooth state change listener failed, invalid listener id=%{public}d", + "int ble manager fail: add bluetooth state change listener fail, invalid listener id=%{public}d", listenerId); SoftbusBleConflictRegisterListenerPacked(&bleConflictListener); @@ -2307,17 +2307,17 @@ static int32_t InitBleManager(const ConnectCallback *callback) ConnectFuncInterface *ConnInitBle(const ConnectCallback *callback) { CONN_CHECK_AND_RETURN_RET_LOGW( - callback != NULL, NULL, CONN_INIT, "conn init ble failed: invalid param, callback is null"); + callback != NULL, NULL, CONN_INIT, "conn init ble fail: invalid param, callback is null"); CONN_CHECK_AND_RETURN_RET_LOGW(callback->OnConnected != NULL, NULL, CONN_INIT, - "conn init ble failed: invalid param, callback OnConnected is null"); + "conn init ble fail: invalid param, callback OnConnected is null"); CONN_CHECK_AND_RETURN_RET_LOGW(callback->OnDataReceived != NULL, NULL, CONN_INIT, - "conn init ble failed: invalid param, callback OnDataReceived is null"); + "conn init ble fail: invalid param, callback OnDataReceived is null"); CONN_CHECK_AND_RETURN_RET_LOGW(callback->OnDisconnected != NULL, NULL, CONN_INIT, - "conn init ble failed: invalid param, callback OnDisconnected is null"); + "conn init ble fail: invalid param, callback OnDisconnected is null"); int32_t status = BleInitLooper(); CONN_CHECK_AND_RETURN_RET_LOGW( - status == SOFTBUS_OK, NULL, CONN_INIT, "conn init ble failed: init ble manager looper failed, err=%{public}d", + status == SOFTBUS_OK, NULL, CONN_INIT, "conn init ble fail: init ble manager looper fail, err=%{public}d", status); ConnBleConnectionEventListener connectionEventListener = { @@ -2330,17 +2330,17 @@ ConnectFuncInterface *ConnInitBle(const ConnectCallback *callback) }; status = ConnBleInitConnectionMudule(g_bleManagerSyncHandler.handler.looper, &connectionEventListener); CONN_CHECK_AND_RETURN_RET_LOGW(status == SOFTBUS_OK, NULL, CONN_INIT, - "conn init ble failed: init ble connection mudule failed, err=%{public}d", status); + "conn init ble fail: init ble connection mudule fail, err=%{public}d", status); ConnBleTransEventListener transEventListener = { .onPostBytesFinished = onPostBytesFinished, }; status = ConnBleInitTransModule(&transEventListener); CONN_CHECK_AND_RETURN_RET_LOGW(status == SOFTBUS_OK, NULL, CONN_INIT, - "conn init ble failed: init ble trans mudule failed, err=%{public}d", status); + "conn init ble fail: init ble trans mudule fail, err=%{public}d", status); status = InitBleManager(callback); CONN_CHECK_AND_RETURN_RET_LOGW(status == SOFTBUS_OK, NULL, CONN_INIT, - "conn init ble failed: init ble manager failed, err=%{public}d", status); + "conn init ble fail: init ble manager fail, err=%{public}d", status); static ConnectFuncInterface bleFuncInterface = { .ConnectDevice = BleConnectDevice, @@ -2369,7 +2369,7 @@ static void LnnOnlineEventListener(const LnnEventBasicInfo *info) CONN_LOGI(CONN_BLE, "receive lnn online event, start auto-complementation coc connection udid"); int32_t status = SoftBusMutexLock(&g_bleManager.connections->lock); CONN_CHECK_AND_RETURN_LOGE(status == SOFTBUS_OK, CONN_BLE, - "complementation coc connection udid failed: try to lock connections failed, err=%{public}d", status); + "complementation coc connection udid fail: try to lock connections fail, err=%{public}d", status); do { ConnBleConnection *it = NULL; @@ -2379,8 +2379,8 @@ static void LnnOnlineEventListener(const LnnEventBasicInfo *info) } status = SoftBusMutexLock(&it->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "complementation coc connection udid failed: try to get connection " - "lock failed, connId=%{public}u, err=%{public}d", it->connectionId, status); + CONN_LOGE(CONN_BLE, "complementation coc connection udid fail: try to get connection " + "lock fail, connId=%{public}u, err=%{public}d", it->connectionId, status); continue; } ConnBleInnerComplementDeviceId(it); @@ -2400,7 +2400,7 @@ static void DelayRegisterLnnOnlineListener(void) int32_t status = LnnRegisterEventHandler(LNN_EVENT_NODE_ONLINE_STATE_CHANGED, LnnOnlineEventListener); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "delay register lnn online listener failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "delay register lnn online listener fail, err=%{public}d", status); return; } registered = true; @@ -2413,13 +2413,13 @@ int32_t ConnBleDumper(ListNode *connectionSnapshots) int32_t ret = SoftBusMutexLock(&g_bleManager.connections->lock); CONN_CHECK_AND_RETURN_RET_LOGE( - ret == SOFTBUS_OK, ret, CONN_BLE, "lock ble connections failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_BLE, "lock ble connections fail, error=%{public}d", ret); ConnBleConnection *it = NULL; LIST_FOR_EACH_ENTRY(it, &g_bleManager.connections->list, ConnBleConnection, node) { ConnBleConnectionSnapshot *snapshot = ConnBleCreateConnectionSnapshot(it); if (snapshot == NULL) { - CONN_LOGE(CONN_BLE, "ble hidumper constructor snapshot failed"); + CONN_LOGE(CONN_BLE, "ble hidumper constructor snapshot fail"); continue; } ListAdd(connectionSnapshots, &snapshot->node); diff --git a/core/connection/ble/src/softbus_conn_ble_send_queue.c b/core/connection/ble/src/softbus_conn_ble_send_queue.c index 72d134d408..9174e57647 100644 --- a/core/connection/ble/src/softbus_conn_ble_send_queue.c +++ b/core/connection/ble/src/softbus_conn_ble_send_queue.c @@ -84,7 +84,7 @@ int32_t ConnBleEnqueueNonBlock(const void *msg) SendQueueNode *queueNode = (SendQueueNode *)msg; int32_t priority = GetPriority(queueNode->flag); if (SoftBusMutexLock(&g_bleQueueLock) != EOK) { - CONN_LOGE(CONN_BLE, "Lock failed"); + CONN_LOGE(CONN_BLE, "Lock fail"); return SOFTBUS_LOCK_ERR; } bool isListEmpty = true; @@ -109,7 +109,7 @@ int32_t ConnBleEnqueueNonBlock(const void *msg) if (lockFreeQueue == NULL) { ConnectionQueue *newQueue = CreateBleQueue(queueNode->pid); if (newQueue == NULL) { - CONN_LOGE(CONN_BLE, "ConnBleEnqueueNonBlock CreateBleQueue failed"); + CONN_LOGE(CONN_BLE, "ConnBleEnqueueNonBlock CreateBleQueue fail"); goto END; } ListTailInsert(&g_bleQueueList, &(newQueue->node)); @@ -138,7 +138,7 @@ int32_t ConnBleDequeueBlock(void **msg) ConnectionQueue *next = NULL; SoftBusSysTime waitTime = {0}; int32_t ret = SoftBusGetTime(&waitTime); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, SOFTBUS_INVALID_PARAM, CONN_BLE, "softbus get time failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, SOFTBUS_INVALID_PARAM, CONN_BLE, "softbus get time fail"); waitTime.sec += BLE_WAIT_TIME_SEC; CONN_CHECK_AND_RETURN_RET_LOGE(msg != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, "msg is null"); @@ -189,11 +189,11 @@ int32_t ConnBleDequeueBlock(void **msg) int32_t ConnBleInitSendQueue(void) { if (SoftBusMutexInit(&g_bleQueueLock, NULL) != 0) { - CONN_LOGE(CONN_INIT, "Mutex Init failed"); + CONN_LOGE(CONN_INIT, "Mutex Init fail"); return SOFTBUS_NO_INIT; } if (SoftBusCondInit(&g_sendWaitCond) != SOFTBUS_OK) { - CONN_LOGE(CONN_INIT, "cond Init failed"); + CONN_LOGE(CONN_INIT, "cond Init fail"); (void)SoftBusMutexDestroy(&g_bleQueueLock); return SOFTBUS_NO_INIT; } @@ -204,7 +204,7 @@ int32_t ConnBleInitSendQueue(void) } g_innerQueue = CreateBleQueue(0); if (g_innerQueue == NULL) { - CONN_LOGE(CONN_INIT, "BleQueueInit CreateBleQueue(0) failed"); + CONN_LOGE(CONN_INIT, "BleQueueInit CreateBleQueue(0) fail"); (void)SoftBusMutexDestroy(&g_bleQueueLock); (void)SoftBusCondDestroy(&g_sendWaitCond); (void)SoftBusCondDestroy(&g_sendCond); diff --git a/core/connection/ble/src/softbus_conn_ble_server.c b/core/connection/ble/src/softbus_conn_ble_server.c index 310198a400..135cca8d61 100644 --- a/core/connection/ble/src/softbus_conn_ble_server.c +++ b/core/connection/ble/src/softbus_conn_ble_server.c @@ -132,13 +132,13 @@ static int32_t UpdateBleServerStateInOrder(enum GattServerState expectedState, e { int32_t status = SoftBusMutexLock(&g_serverState.lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to get lock failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "try to get lock fail, err=%{public}d", status); return SOFTBUS_LOCK_ERR; } if (g_serverState.state != expectedState) { CONN_LOGW(CONN_BLE, - "update server state failed: actualState=%{public}d, expectedState=%{public}d, nextState=%{public}d", + "update server state fail: actualState=%{public}d, expectedState=%{public}d, nextState=%{public}d", g_serverState.state, expectedState, nextState); (void)SoftBusMutexUnlock(&g_serverState.lock); return SOFTBUS_CONN_BLE_SERVER_STATE_UNEXPECTED_ERR; @@ -151,7 +151,7 @@ static int32_t UpdateBleServerStateInOrder(enum GattServerState expectedState, e static void ResetServerState() { CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&g_serverState.lock) == SOFTBUS_OK, CONN_BLE, - "ATTENTION UNEXPECTED ERROR! ble reset server state failed, try to lock failed"); + "ATTENTION UNEXPECTED ERROR! ble reset server state fail, try to lock fail"); int32_t serviceHandle = g_serverState.serviceHandle; g_serverState.state = BLE_SERVER_STATE_INITIAL; g_serverState.serviceHandle = -1; @@ -174,7 +174,7 @@ static void ResetServerState() int32_t ConnGattServerStartService(void) { CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_serverState.lock) == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_BLE, - "ATTENTION UNEXPECTED ERROR! ble server start service failed: try to lock failed"); + "ATTENTION UNEXPECTED ERROR! ble server start service fail: try to lock fail"); enum GattServerState state = g_serverState.state; (void)SoftBusMutexUnlock(&g_serverState.lock); if (state == BLE_SERVER_STATE_SERVICE_STARTED) { @@ -184,12 +184,12 @@ int32_t ConnGattServerStartService(void) int32_t status = BleRegisterGattServerCallback(); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "register underlayer callback failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "register underlayer callback fail, err=%{public}d", status); return SOFTBUS_CONN_BLE_UNDERLAY_SERVER_REGISTER_CALLBACK_ERR; } status = UpdateBleServerStateInOrder(BLE_SERVER_STATE_INITIAL, BLE_SERVER_STATE_SERVICE_ADDING); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update server state failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "update server state fail, err=%{public}d", status); return status; } SoftBusBtUuid uuid = { @@ -198,7 +198,7 @@ int32_t ConnGattServerStartService(void) }; status = SoftBusGattsAddService(uuid, true, MAX_SERVICE_CHAR_NUM); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "underlayer add service failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "underlayer add service fail, err=%{public}d", status); ResetServerState(); return SOFTBUS_CONN_BLE_UNDERLAY_SERVER_ADD_SERVICE_ERR; } @@ -213,19 +213,19 @@ static void BleServiceAddCallback(int32_t status, SoftBusBtUuid *uuid, int32_t s "gatt server callback, server added, srvcHandle=%{public}u, status=%{public}d", srvcHandle, status); ServiceAddMsgContext *ctx = (ServiceAddMsgContext *)SoftBusCalloc(sizeof(ServiceAddMsgContext) + uuid->uuidLen); CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_BLE, - "receive gatt server callback, server added handle failed: calloc service add msg context failed"); + "receive gatt server callback, server added handle fail: calloc service add msg context fail"); ctx->status = status; ctx->srvcHandle = srvcHandle; ctx->uuid.uuidLen = uuid->uuidLen; char *copyUuid = (char *)(ctx + 1); if (memcpy_s(copyUuid, uuid->uuidLen, uuid->uuid, uuid->uuidLen) != EOK) { - CONN_LOGE(CONN_BLE, "memcpy_s uuid failed"); + CONN_LOGE(CONN_BLE, "memcpy_s uuid fail"); SoftBusFree(ctx); return; } ctx->uuid.uuid = copyUuid; if (ConnPostMsgToLooper(&g_bleGattServerAsyncHandler, MSG_SERVER_SERVICE_ADDED, 0, 0, ctx, 0) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "post message to looper failed"); + CONN_LOGE(CONN_BLE, "post message to looper fail"); SoftBusFree(ctx); } } @@ -247,7 +247,7 @@ static int32_t CheckUuidAndSetServiceHandle(const ServiceAddMsgContext *ctx) rc = SoftBusMutexLock(&g_serverState.lock); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "try to lock fail, err=%{public}d", rc); rc = SOFTBUS_LOCK_ERR; return rc; } @@ -266,7 +266,7 @@ static void BleServiceAddMsgHandler(const ServiceAddMsgContext *ctx) rc = UpdateBleServerStateInOrder(BLE_SERVER_STATE_SERVICE_ADDING, BLE_SERVER_STATE_SERVICE_ADDED); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update server state failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "update server state fail, err=%{public}d", rc); break; } SoftBusBtUuid uuid = { @@ -279,13 +279,13 @@ static void BleServiceAddMsgHandler(const ServiceAddMsgContext *ctx) SOFTBUS_GATT_CHARACTER_PROPERTY_BIT_INDICATE, SOFTBUS_GATT_PERMISSION_READ | SOFTBUS_GATT_PERMISSION_WRITE); if (rc != SOFTBUS_OK) { - CONN_LOGW(CONN_BLE, "underlayer add characteristic failed, err=%{public}d", rc); + CONN_LOGW(CONN_BLE, "underlayer add characteristic fail, err=%{public}d", rc); rc = SOFTBUS_CONN_BLE_UNDERLAY_CHARACTERISTIC_ADD_ERR; break; } rc = UpdateBleServerStateInOrder(BLE_SERVER_STATE_SERVICE_ADDED, BLE_SERVER_STATE_NET_CHARACTERISTIC_ADDING); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update server state failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "update server state fail, err=%{public}d", rc); break; } } while (false); @@ -305,13 +305,13 @@ static void BleCharacteristicAddCallback( srvcHandle, characteristicHandle, status); CharacteristicAddMsgContext *ctx = (CharacteristicAddMsgContext *)SoftBusCalloc(sizeof(CharacteristicAddMsgContext) + uuid->uuidLen); - CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_BLE, "calloc characteristic add msg failed"); + CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_BLE, "calloc characteristic add msg fail"); ctx->status = status; ctx->srvcHandle = srvcHandle; ctx->uuid.uuidLen = uuid->uuidLen; char *copyUuid = (char *)(ctx + 1); if (memcpy_s(copyUuid, uuid->uuidLen, uuid->uuid, uuid->uuidLen) != EOK) { - CONN_LOGE(CONN_BLE, "memcpy_s uuid failed"); + CONN_LOGE(CONN_BLE, "memcpy_s uuid fail"); SoftBusFree(ctx); return; } @@ -319,7 +319,7 @@ static void BleCharacteristicAddCallback( ctx->characteristicHandle = characteristicHandle; if (ConnPostMsgToLooper(&g_bleGattServerAsyncHandler, MSG_SERVER_CHARACTERISTIC_ADDED, 0, 0, ctx, 0) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "post message to looper failed"); + CONN_LOGE(CONN_BLE, "post message to looper fail"); SoftBusFree(ctx); } } @@ -376,12 +376,12 @@ static void BleCharacteristicAddMsgHandler(const CharacteristicAddMsgContext *ct CharacterisicHandleServerState serverState = {0}; rc = IsConnCharacterisicAndSetHandle(ctx, &serverState); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "IsConnCharacterisicAndSetHandle failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "IsConnCharacterisicAndSetHandle fail, err=%{public}d", rc); break; } rc = UpdateBleServerStateInOrder(serverState.expect, serverState.next); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update server state failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "update server state fail, err=%{public}d", rc); break; } @@ -392,13 +392,13 @@ static void BleCharacteristicAddMsgHandler(const CharacteristicAddMsgContext *ct rc = SoftBusGattsAddDescriptor( ctx->srvcHandle, uuid, SOFTBUS_GATT_PERMISSION_READ | SOFTBUS_GATT_PERMISSION_WRITE); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "underlayer add decriptor failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "underlayer add decriptor fail, err=%{public}d", rc); rc = SOFTBUS_CONN_BLE_UNDERLAY_DESCRIPTOR_ADD_ERR; break; } rc = UpdateBleServerStateInOrder(serverState.next, serverState.nextNext); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update server state failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "update server state fail, err=%{public}d", rc); break; } } while (false); @@ -415,20 +415,20 @@ static void BleDescriptorAddCallback(int32_t status, SoftBusBtUuid *uuid, int32_ "status=%{public}d", srvcHandle, descriptorHandle, status); DescriptorAddMsgContext *ctx = (DescriptorAddMsgContext *)SoftBusCalloc(sizeof(DescriptorAddMsgContext) + uuid->uuidLen); - CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_BLE, "calloc descriptor add msg failed"); + CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_BLE, "calloc descriptor add msg fail"); ctx->status = status; ctx->srvcHandle = srvcHandle; ctx->uuid.uuidLen = uuid->uuidLen; char *copyUuid = (char *)(ctx + 1); if (memcpy_s(copyUuid, uuid->uuidLen, uuid->uuid, uuid->uuidLen) != EOK) { - CONN_LOGE(CONN_BLE, "memcpy_s uuid failed"); + CONN_LOGE(CONN_BLE, "memcpy_s uuid fail"); SoftBusFree(ctx); return; } ctx->uuid.uuid = copyUuid; ctx->descriptorHandle = descriptorHandle; if (ConnPostMsgToLooper(&g_bleGattServerAsyncHandler, MSG_SERVER_DESCRIPTOR_ADDED, 0, 0, ctx, 0) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "post message to looper failed"); + CONN_LOGE(CONN_BLE, "post message to looper fail"); SoftBusFree(ctx); } } @@ -445,7 +445,7 @@ static void BleDescriptorAddMsgHandler(DescriptorAddMsgContext *ctx) } rc = SoftBusMutexLock(&g_serverState.lock); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "try to lock fail, err=%{public}d", rc); rc = SOFTBUS_LOCK_ERR; break; } @@ -479,14 +479,14 @@ static int32_t BleNetDescriptorAddMsgHandler(DescriptorAddMsgContext *ctx) } int32_t rc = SoftBusMutexLock(&g_serverState.lock); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "try to lock fail, err=%{public}d", rc); return SOFTBUS_LOCK_ERR; } g_serverState.netDescriptorHandle = ctx->descriptorHandle; (void)SoftBusMutexUnlock(&g_serverState.lock); rc = UpdateBleServerStateInOrder(BLE_SERVER_STATE_NET_DISCRIPTOR_ADDING, BLE_SERVER_STATE_NET_DISCRIPTOR_ADDED); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update server state failed, err=%{public}d", ctx->status); + CONN_LOGE(CONN_BLE, "update server state fail, err=%{public}d", ctx->status); return rc; } SoftBusBtUuid uuid = { @@ -499,13 +499,13 @@ static int32_t BleNetDescriptorAddMsgHandler(DescriptorAddMsgContext *ctx) SOFTBUS_GATT_CHARACTER_PROPERTY_BIT_INDICATE, SOFTBUS_GATT_PERMISSION_READ | SOFTBUS_GATT_PERMISSION_WRITE); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "underlayer add characteristic failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "underlayer add characteristic fail, err=%{public}d", rc); return SOFTBUS_CONN_BLE_UNDERLAY_CHARACTERISTIC_ADD_ERR; } rc = UpdateBleServerStateInOrder( BLE_SERVER_STATE_NET_DISCRIPTOR_ADDED, BLE_SERVER_STATE_CONN_CHARACTERISTIC_ADDING); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update server state failed, err=%{public}d", ctx->status); + CONN_LOGE(CONN_BLE, "update server state fail, err=%{public}d", ctx->status); return rc; } return SOFTBUS_OK; @@ -519,24 +519,24 @@ static int32_t BleConnDescriptorAddMsgHandler(DescriptorAddMsgContext *ctx) } int32_t rc = SoftBusMutexLock(&g_serverState.lock); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "try to lock fail, err=%{public}d", rc); return SOFTBUS_LOCK_ERR; } g_serverState.connDescriptorHandle = ctx->descriptorHandle; (void)SoftBusMutexUnlock(&g_serverState.lock); rc = UpdateBleServerStateInOrder(BLE_SERVER_STATE_CONN_DISCRIPTOR_ADDING, BLE_SERVER_STATE_CONN_DISCRIPTOR_ADDED); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update server state failed, err=%{public}d", ctx->status); + CONN_LOGE(CONN_BLE, "update server state fail, err=%{public}d", ctx->status); return rc; } rc = SoftBusGattsStartService(ctx->srvcHandle); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "underlayer start service failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "underlayer start service fail, err=%{public}d", rc); return SOFTBUS_CONN_BLE_UNDERLAY_SERVICE_START_ERR; } rc = UpdateBleServerStateInOrder(BLE_SERVER_STATE_CONN_DISCRIPTOR_ADDED, BLE_SERVER_STATE_SERVICE_STARTING); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update server state failed, err=%{public}d", ctx->status); + CONN_LOGE(CONN_BLE, "update server state fail, err=%{public}d", ctx->status); return rc; } return SOFTBUS_OK; @@ -547,11 +547,11 @@ static void BleServiceStartCallback(int32_t status, int32_t srvcHandle) CONN_LOGI(CONN_BLE, "gatt server callback, service start, srvcHandle=%{public}u, status=%{public}d", srvcHandle, status); CommonStatusMsgContext *ctx = (CommonStatusMsgContext *)SoftBusCalloc(sizeof(CommonStatusMsgContext)); - CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_BLE, "calloc service start status msg failed"); + CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_BLE, "calloc service start status msg fail"); ctx->srvcHandle = srvcHandle; ctx->status = status; if (ConnPostMsgToLooper(&g_bleGattServerAsyncHandler, MSG_SERVER_SERVICE_STARTED, 0, 0, ctx, 0) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "post message to looper failed"); + CONN_LOGE(CONN_BLE, "post message to looper fail"); SoftBusFree(ctx); } } @@ -567,7 +567,7 @@ static void BleServiceStartMsgHandler(const CommonStatusMsgContext *ctx) } rc = SoftBusMutexLock(&g_serverState.lock); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "try to lock fail, err=%{public}d", rc); rc = SOFTBUS_LOCK_ERR; break; } @@ -580,7 +580,7 @@ static void BleServiceStartMsgHandler(const CommonStatusMsgContext *ctx) } rc = UpdateBleServerStateInOrder(BLE_SERVER_STATE_SERVICE_STARTING, BLE_SERVER_STATE_SERVICE_STARTED); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update server state failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "update server state fail, err=%{public}d", rc); break; } } while (false); @@ -625,7 +625,7 @@ static void BleConnectServerCallback(int32_t underlayerHandle, const SoftBusBtAd int32_t status = ConvertBtMacToStr(address, BT_MAC_LEN, btAddr->addr, BT_ADDR_LEN); if (status != SOFTBUS_OK) { CONN_LOGW(CONN_BLE, - "convert binary mac address to string failed, " + "convert binary mac address to string fail, " "address=%{public}02X:*:*:*:%{public}02X:%{public}02X, error=%{public}d", status, btAddr->addr[0], btAddr->addr[4], btAddr->addr[5]); return; @@ -643,13 +643,13 @@ static void BleConnectServerCallback(int32_t underlayerHandle, const SoftBusBtAd } connection = ConnBleCreateConnection(address, BLE_GATT, CONN_SIDE_SERVER, underlayerHandle, false); if (connection == NULL) { - CONN_LOGI(CONN_BLE, "create connection failed,disconnect this connection,address=%{public}s", anomizeAddress); + CONN_LOGI(CONN_BLE, "create connection fail,disconnect this connection,address=%{public}s", anomizeAddress); SoftBusGattsDisconnect(*btAddr, underlayerHandle); return; } status = ConnBleSaveConnection(connection); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "save connection failed, disconnect this connection, address=%{public}s, err=%{public}d", + CONN_LOGE(CONN_BLE, "save connection fail, disconnect this connection, address=%{public}s, err=%{public}d", anomizeAddress, status); ConnBleReturnConnection(&connection); SoftBusGattsDisconnect(*btAddr, underlayerHandle); @@ -666,14 +666,14 @@ static void BleMtuChangeCallback(int32_t underlayerHandle, int32_t mtu) underlayerHandle, mtu); ConnBleConnection *connection = ConnBleGetConnectionByHandle(underlayerHandle, CONN_SIDE_SERVER, BLE_GATT); if (connection == NULL) { - CONN_LOGE(CONN_BLE, "mtu changed failed, connection not exist, underlayer handle=%{public}d", underlayerHandle); + CONN_LOGE(CONN_BLE, "mtu changed fail, connection not exist, underlayer handle=%{public}d", underlayerHandle); return; } ConnRemoveMsgFromLooper( &g_bleGattServerAsyncHandler, MSG_SERVER_WAIT_MTU_TIMEOUT, connection->connectionId, 0, NULL); int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, connId=%{public}u, err=%{public}d", connection->connectionId, status); + CONN_LOGE(CONN_BLE, "try to lock fail, connId=%{public}u, err=%{public}d", connection->connectionId, status); if (ConnGattServerDisconnect(connection) != SOFTBUS_OK) { g_serverEventListener.onServerConnectionClosed( connection->connectionId, SOFTBUS_CONN_BLE_DISCONNECT_DIRECTLY_ERR); @@ -691,7 +691,7 @@ static void BleMtuChangeCallback(int32_t underlayerHandle, int32_t mtu) static void BleServerWaitMtuTimeoutHandler(uint32_t connectionId) { ConnBleConnection *connection = ConnBleGetConnectionById(connectionId); - CONN_CHECK_AND_RETURN_LOGE(connection != NULL, CONN_BLE, "ble server wait mtu timeout handle failed:connection " + CONN_CHECK_AND_RETURN_LOGE(connection != NULL, CONN_BLE, "ble server wait mtu timeout handle fail:connection " "not exist, connId=%{public}u", connectionId); int32_t status = ConnGattServerDisconnect(connection); CONN_LOGI(CONN_BLE, "ble server wait mtu timeout, disconnect connection, connId=%{public}u, status=%{public}d", @@ -702,7 +702,7 @@ static void BleServerWaitMtuTimeoutHandler(uint32_t connectionId) int32_t ConnGattServerStopService(void) { CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_serverState.lock) == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_BLE, - "ATTENTION UNEXPECTED ERROR! ble server stop service failed, try to lock failed"); + "ATTENTION UNEXPECTED ERROR! ble server stop service fail, try to lock fail"); enum GattServerState state = g_serverState.state; int32_t serviceHandle = g_serverState.serviceHandle; (void)SoftBusMutexUnlock(&g_serverState.lock); @@ -718,20 +718,20 @@ int32_t ConnGattServerStopService(void) if (state == BLE_SERVER_STATE_SERVICE_STARTED) { status = SoftBusGattsStopService(serviceHandle); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "underlayer stop service failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "underlayer stop service fail, err=%{public}d", status); status = SOFTBUS_CONN_BLE_UNDERLAY_SERVICE_STOP_ERR; break; } status = UpdateBleServerStateInOrder( BLE_SERVER_STATE_SERVICE_STARTED, BLE_SERVER_STATE_SERVICE_STOPPING); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update server state failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "update server state fail, err=%{public}d", status); break; } } else { status = SoftBusGattsDeleteService(serviceHandle); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "underlayer delete service failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "underlayer delete service fail, err=%{public}d", status); break; } } @@ -753,11 +753,11 @@ static void BleServiceStopCallback(int32_t status, int32_t srvcHandle) "gatt server callback, service stop, srvcHandle=%{public}u, status=%{public}d", srvcHandle, status); CommonStatusMsgContext *ctx = (CommonStatusMsgContext *)SoftBusCalloc(sizeof(CommonStatusMsgContext)); CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_BLE, - "receive gatt server callback, service stop handle failed: calloc service stop status msg failed"); + "receive gatt server callback, service stop handle fail: calloc service stop status msg fail"); ctx->srvcHandle = srvcHandle; ctx->status = status; if (ConnPostMsgToLooper(&g_bleGattServerAsyncHandler, MSG_SERVER_SERVICE_STOPED, 0, 0, ctx, 0) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "post message to looper failed"); + CONN_LOGE(CONN_BLE, "post message to looper fail"); SoftBusFree(ctx); } } @@ -773,7 +773,7 @@ static void BleServiceStopMsgHandler(CommonStatusMsgContext *ctx) } rc = SoftBusMutexLock(&g_serverState.lock); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, status=%{public}d", ctx->status); + CONN_LOGE(CONN_BLE, "try to lock fail, status=%{public}d", ctx->status); rc = SOFTBUS_LOCK_ERR; break; } @@ -786,18 +786,18 @@ static void BleServiceStopMsgHandler(CommonStatusMsgContext *ctx) } rc = UpdateBleServerStateInOrder(BLE_SERVER_STATE_SERVICE_STOPPING, BLE_SERVER_STATE_SERVICE_STOPPED); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update server state failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "update server state fail, err=%{public}d", rc); break; } rc = SoftBusGattsDeleteService(serviceHandle); if (rc != SOFTBUS_OK) { rc = SOFTBUS_CONN_BLE_UNDERLAY_SERVICE_DELETE_ERR; - CONN_LOGE(CONN_BLE, "underlay delete service failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "underlay delete service fail, err=%{public}d", rc); break; } rc = UpdateBleServerStateInOrder(BLE_SERVER_STATE_SERVICE_STOPPED, BLE_SERVER_STATE_SERVICE_DELETING); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "update server state failed, err=%{public}d", rc); + CONN_LOGE(CONN_BLE, "update server state fail, err=%{public}d", rc); break; } } while (false); @@ -815,11 +815,11 @@ static void BleServiceDeleteCallback(int32_t status, int32_t srvcHandle) "gatt server callback, service deleted, srvcHandle=%{public}u, status=%{public}d", srvcHandle, status); CommonStatusMsgContext *ctx = (CommonStatusMsgContext *)SoftBusCalloc(sizeof(CommonStatusMsgContext)); CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_BLE, - "gatt server callback, service deleted handle failed: calloc service stop status msg failed"); + "gatt server callback, service deleted handle fail: calloc service stop status msg fail"); ctx->srvcHandle = srvcHandle; ctx->status = status; if (ConnPostMsgToLooper(&g_bleGattServerAsyncHandler, MSG_SERVER_SERVICE_DELETED, 0, 0, ctx, 0) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "gatt server callback, service deleted handle failed: post message to looper failed"); + CONN_LOGE(CONN_BLE, "gatt server callback, service deleted handle fail: post message to looper fail"); SoftBusFree(ctx); } } @@ -836,7 +836,7 @@ static void BleServiceDeleteMsgHandler(const CommonStatusMsgContext *ctx) } rc = SoftBusMutexLock(&g_serverState.lock); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, status=%{public}d", ctx->status); + CONN_LOGE(CONN_BLE, "try to lock fail, status=%{public}d", ctx->status); rc = SOFTBUS_LOCK_ERR; break; } @@ -902,15 +902,15 @@ static int32_t GetBleAttrHandle(int32_t module) int32_t ConnGattServerSend(ConnBleConnection *connection, const uint8_t *data, uint32_t dataLen, int32_t module) { CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble server send data failed, invalia param, connection is null"); + "ble server send data fail, invalia param, connection is null"); CONN_CHECK_AND_RETURN_RET_LOGW(data != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble server send data failed, invalia param, data is null"); + "ble server send data fail, invalia param, data is null"); CONN_CHECK_AND_RETURN_RET_LOGW(dataLen != 0, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble server send data failed, invalia param, data len is 0"); + "ble server send data fail, invalia param, data len is 0"); int32_t status = SoftBusMutexLock(&connection->lock); CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_BLE, - "ble server send data failed, try to get connection lock failed, connId=%{public}u, err=%{public}d", + "ble server send data fail, try to get connection lock fail, connId=%{public}u, err=%{public}d", connection->connectionId, status); int32_t underlayerHandle = connection->underlayerHandle; (void)SoftBusMutexUnlock(&connection->lock); @@ -931,14 +931,14 @@ int32_t ConnGattServerConnect(ConnBleConnection *connection) "invalid param, connection is null"); int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "ble server connect failed, try to lock failed, connId=%{public}u, err=%{public}d", + CONN_LOGE(CONN_BLE, "ble server connect fail, try to lock fail, connId=%{public}u, err=%{public}d", connection->connectionId, status); return SOFTBUS_LOCK_ERR; } int32_t underlayerHandle = connection->underlayerHandle; (void)SoftBusMutexUnlock(&connection->lock); if (underlayerHandle == INVALID_UNDERLAY_HANDLE) { - CONN_LOGE(CONN_BLE, "ble server connect failed, underlay handle is invalid. connId=%{public}u", + CONN_LOGE(CONN_BLE, "ble server connect fail, underlay handle is invalid. connId=%{public}u", connection->connectionId); return SOFTBUS_CONN_BLE_INTERNAL_ERR; } @@ -946,7 +946,7 @@ int32_t ConnGattServerConnect(ConnBleConnection *connection) status = ConvertBtMacToBinary(connection->addr, BT_MAC_LEN, binaryAddr.addr, BT_ADDR_LEN); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "ble server connect failed: convert string mac to binary fail, connId=%{public}u, err=%{public}d", + "ble server connect fail: convert string mac to binary fail, connId=%{public}u, err=%{public}d", connection->connectionId, status); return status; } @@ -960,12 +960,12 @@ int32_t ConnGattServerConnect(ConnBleConnection *connection) int32_t ConnGattServerDisconnect(ConnBleConnection *connection) { CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, SOFTBUS_CONN_BLE_INTERNAL_ERR, CONN_BLE, - "ble server connection disconnect failed: invalid param, connection is null"); + "ble server connection disconnect fail: invalid param, connection is null"); int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "ble server connection disconnect failed, try to lock failed, connectionId=%{public}u, err=%{public}d", + "ble server connection disconnect fail, try to lock fail, connectionId=%{public}u, err=%{public}d", connection->connectionId, status); return SOFTBUS_LOCK_ERR; } @@ -981,7 +981,7 @@ int32_t ConnGattServerDisconnect(ConnBleConnection *connection) status = ConvertBtMacToBinary(connection->addr, BT_MAC_LEN, binaryAddr.addr, BT_ADDR_LEN); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "ble server connection disconnect failed: convert string mac to binary fail, " + "ble server connection disconnect fail: convert string mac to binary fail, " "connectionId=%{public}u, err=%{public}d", connection->connectionId, status); return status; @@ -1024,7 +1024,7 @@ static void BleServerWaitDisconnectTimeoutHandler(uint32_t connectionId) CONN_LOGI(CONN_BLE, "server wait disconnect timeout, connId=%{public}u", connectionId); ConnBleConnection *connection = ConnBleGetConnectionById(connectionId); CONN_CHECK_AND_RETURN_LOGW(connection != NULL, CONN_BLE, - "ble server wait disconnect timeout handler failed: connection not exist, connId=%{public}u", connectionId); + "ble server wait disconnect timeout handler fail: connection not exist, connId=%{public}u", connectionId); RemoveConnId(connection->underlayerHandle); ConnBleReturnConnection(&connection); g_serverEventListener.onServerConnectionClosed(connectionId, SOFTBUS_CONN_BLE_DISCONNECT_WAIT_TIMEOUT_ERR); @@ -1077,7 +1077,7 @@ static void BleRequestWriteCallback(SoftBusGattWriteRequest writeCbPara) ConnBleConnection *connection = ConnBleGetConnectionByHandle(underlayerHandle, CONN_SIDE_SERVER, BLE_GATT); if (connection == NULL) { CONN_LOGE(CONN_BLE, - "gatt server callback, request write failed: connection not exist, underlayer handle=%{public}d", + "gatt server callback, request write fail: connection not exist, underlayer handle=%{public}d", underlayerHandle); return; } @@ -1089,7 +1089,7 @@ static void BleRequestWriteCallback(SoftBusGattWriteRequest writeCbPara) isConnCharacteristic = true; } else { CONN_LOGE(CONN_BLE, - "request write failed: not NET or CONN characteristic, connId=%{public}u, underlayerHandle=%{public}d, " + "request write fail: not NET or CONN characteristic, connId=%{public}u, underlayerHandle=%{public}d, " "attrHandle=%{public}d, netCharateristicHandle=%{public}d, connCharateristicHandle=%{public}d", connection->connectionId, underlayerHandle, writeCbPara.attrHandle, g_serverState.netCharacteristicHandle, g_serverState.connCharacteristicHandle); @@ -1180,7 +1180,7 @@ static int BleCompareGattServerLooperEventFunc(const SoftBusMessage *msg, void * if (ctx->arg1 != 0 || ctx->arg2 != 0 || ctx->obj != NULL) { CONN_LOGE(CONN_BLE, "there is compare context value not use, forgot implement? " - "compare failed to avoid fault silence, " + "compare fail to avoid fault silence, " "what=%{public}d, arg1=%{public}" PRIu64 ", arg2=%{public}" PRIu64 ", objIsNull=%{public}d", ctx->what, ctx->arg1, ctx->arg2, ctx->obj == NULL); return COMPARE_FAILED; @@ -1192,7 +1192,7 @@ static bool BleIsConcernedAttrHandle(int32_t srvcHandle, int32_t attrHandle) { int32_t rc = SoftBusMutexLock(&g_serverState.lock); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to lock failed, attrHandle=%{public}d", attrHandle); + CONN_LOGE(CONN_BLE, "try to lock fail, attrHandle=%{public}d", attrHandle); return false; } if (g_serverState.serviceHandle != srvcHandle) { @@ -1254,10 +1254,10 @@ int32_t ConnGattInitServerModule(SoftBusLooper *looper, const ConnBleServerEvent "invalid param, listener onServerConnectionClosed is null"); int32_t status = InitSoftbusAdapterServer(); CONN_CHECK_AND_RETURN_RET_LOGW(status == SOFTBUS_OK, status, CONN_INIT, - "init softbus adapter failed, err=%{public}d", status); + "init softbus adapter fail, err=%{public}d", status); status = SoftBusMutexInit(&g_serverState.lock, NULL); CONN_CHECK_AND_RETURN_RET_LOGW(status == SOFTBUS_OK, status, CONN_INIT, - "init ble server failed: init server state lock failed, err=%{public}d", status); + "init ble server fail: init server state lock fail, err=%{public}d", status); g_bleGattServerAsyncHandler.handler.looper = looper; g_serverEventListener = *listener; diff --git a/core/connection/ble/src/softbus_conn_ble_snapshot.c b/core/connection/ble/src/softbus_conn_ble_snapshot.c index 93af2678dc..aac0dea31c 100644 --- a/core/connection/ble/src/softbus_conn_ble_snapshot.c +++ b/core/connection/ble/src/softbus_conn_ble_snapshot.c @@ -49,7 +49,7 @@ static char *ToJson(ListNode *connectionSnapshots) { cJSON *root = cJSON_CreateObject(); if (root == NULL) { - CONN_LOGE(CONN_BLE, "create json object failed"); + CONN_LOGE(CONN_BLE, "create json object fail"); return NULL; } @@ -57,7 +57,7 @@ static char *ToJson(ListNode *connectionSnapshots) char *result = cJSON_Print(root); if (result == NULL) { - CONN_LOGE(CONN_BLE, "ble print hidumper json failed"); + CONN_LOGE(CONN_BLE, "ble print hidumper json fail"); cJSON_Delete(root); return NULL; } @@ -68,7 +68,7 @@ static char *ToJson(ListNode *connectionSnapshots) ConnBleConnectionSnapshot *ConnBleCreateConnectionSnapshot(const ConnBleConnection *connection) { ConnBleConnectionSnapshot *snapshot = (ConnBleConnectionSnapshot *)SoftBusCalloc(sizeof(ConnBleConnectionSnapshot)); - CONN_CHECK_AND_RETURN_RET_LOGE(snapshot != NULL, NULL, CONN_BLE, "ble hidumper malloc failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(snapshot != NULL, NULL, CONN_BLE, "ble hidumper malloc fail"); ListInit(&snapshot->node); snapshot->connectionId = connection->connectionId; @@ -76,7 +76,7 @@ ConnBleConnectionSnapshot *ConnBleCreateConnectionSnapshot(const ConnBleConnecti char anonymizedAddress[BT_MAC_LEN] = { 0 }; ConvertAnonymizeMacAddress(anonymizedAddress, BT_MAC_LEN, connection->addr, BT_MAC_LEN); if (strcpy_s(snapshot->addr, BT_MAC_LEN, anonymizedAddress) != EOK) { - CONN_LOGE(CONN_BLE, "ble hidumper construct failed"); + CONN_LOGE(CONN_BLE, "ble hidumper construct fail"); } snapshot->state = connection->state; snapshot->mtu = connection->mtu; @@ -107,7 +107,7 @@ int32_t BleHiDumper(int fd) do { if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "get ble snapshot failed"); + CONN_LOGE(CONN_BLE, "get ble snapshot fail"); break; } diff --git a/core/connection/ble/src/softbus_conn_ble_trans.c b/core/connection/ble/src/softbus_conn_ble_trans.c index d345023b4f..78dfa8edd3 100644 --- a/core/connection/ble/src/softbus_conn_ble_trans.c +++ b/core/connection/ble/src/softbus_conn_ble_trans.c @@ -50,7 +50,7 @@ static int32_t UnpackTransHeader(uint8_t *data, uint32_t dataLen, BleTransHeader if ((header->size != dataLen - BLE_TRANS_HEADER_SIZE) || (header->total > MAX_DATA_LEN) || (header->size > header->total) || (header->total - header->size < header->offset)) { CONN_LOGW(CONN_BLE, - "unpack ble trans header failed, dataLen=%{public}u, total=%{public}u, currentPacketSize=%{public}u", + "unpack ble trans header fail, dataLen=%{public}u, total=%{public}u, currentPacketSize=%{public}u", dataLen, header->total, header->size); return SOFTBUS_CONN_BLE_INTERNAL_ERR; } @@ -79,15 +79,15 @@ uint8_t *ConnGattTransRecv( uint32_t connectionId, uint8_t *data, uint32_t dataLen, ConnBleReadBuffer *buffer, uint32_t *outLen) { CONN_CHECK_AND_RETURN_RET_LOGW(data != NULL, NULL, CONN_BLE, - "ble recv packet failed: invalid param, data is null, connectionId=%{public}u", connectionId); + "ble recv packet fail: invalid param, data is null, connectionId=%{public}u", connectionId); CONN_CHECK_AND_RETURN_RET_LOGW(dataLen != 0, NULL, CONN_BLE, - "ble recv packet failed: invalid param, data len is 0, connectionId=%{public}u", connectionId); + "ble recv packet fail: invalid param, data len is 0, connectionId=%{public}u", connectionId); CONN_CHECK_AND_RETURN_RET_LOGW(outLen != NULL, NULL, CONN_BLE, - "ble recv packet failed: invalid param, outLen is null, connectionId=%{public}u", connectionId); + "ble recv packet fail: invalid param, outLen is null, connectionId=%{public}u", connectionId); BleTransHeader header = { 0 }; CONN_CHECK_AND_RETURN_RET_LOGW(UnpackTransHeader(data, dataLen, &header) == SOFTBUS_OK, NULL, CONN_BLE, - "unpack ble trans header failed, discard this packet, connectionId=%{public}u, dataLen=%{public}u", + "unpack ble trans header fail, discard this packet, connectionId=%{public}u, dataLen=%{public}u", connectionId, dataLen); if (header.size == header.total) { @@ -103,12 +103,12 @@ uint8_t *ConnGattTransRecv( uint32_t valueLen = header.total; uint8_t *value = SoftBusCalloc(sizeof(uint8_t) * valueLen); CONN_CHECK_AND_RETURN_RET_LOGE(value != NULL, NULL, CONN_BLE, - "calloc value failed, discard this packet. connId=%{public}u, packetDataLen=%{public}u, " + "calloc value fail, discard this packet. connId=%{public}u, packetDataLen=%{public}u, " "Seq=%{public}u, Total=%{public}u, Size=%{public}u, Offset=%{public}u", connectionId, dataLen, header.seq, header.total, header.size, header.offset); if (memcpy_s(value, valueLen, data + BLE_TRANS_HEADER_SIZE, header.size) != EOK) { CONN_LOGE(CONN_BLE, - "memcpy_s value failed, discard this packet. connId=%{public}u, dataLen=%{public}u, " + "memcpy_s value fail, discard this packet. connId=%{public}u, dataLen=%{public}u, " "headerSeq=%{public}u, headerTotal=%{public}u, headerSize=%{public}u, headerOffset=%{public}u", connectionId, dataLen, header.seq, header.total, header.size, header.offset); SoftBusFree(value); @@ -167,7 +167,7 @@ uint8_t *ConnGattTransRecv( uint8_t *copyData = SoftBusCalloc(dataLen); if (packet == NULL || copyData == NULL || memcpy_s(copyData, dataLen, data, dataLen) != EOK) { CONN_LOGE(CONN_BLE, - "ble recv packet failed: calloc ble package or copy data failed, discard all received. " + "ble recv packet fail: calloc ble package or copy data fail, discard all received. " "connId=%{public}u, dataLen=%{public}u, " "headerSeq=%{public}u, headerTotal=%{public}u, headerSize=%{public}u, headerOffset=%{public}u, " "bufferSeq=%{public}u, bufferTotal=%{public}u, bufferReceived=%{public}u", @@ -200,7 +200,7 @@ uint8_t *ConnGattTransRecv( if (buffer->received > buffer->total) { CONN_LOGW(CONN_BLE, - "ble recv packet failed, receive data length more than expected, discard all received segmental packet" + "ble recv packet fail, receive data length more than expected, discard all received segmental packet" "connId=%{public}u, dataLen=%{public}u, " "headerSeq=%{public}u, headerTotal=%{public}u, headerSize=%{public}u, headerOffset=%{public}u, " "bufferSeq=%{public}u, bufferTotal=%{public}u, bufferReceived=%{public}u", @@ -214,7 +214,7 @@ uint8_t *ConnGattTransRecv( uint8_t *value = SoftBusCalloc(sizeof(uint8_t) * valueLen); if (value == NULL) { CONN_LOGE(CONN_BLE, - "calloc out value failed, discard all received segmental packet. connId=%{public}u, dataLen=%{public}u, " + "calloc out value fail, discard all received segmental packet. connId=%{public}u, dataLen=%{public}u, " "headerSeq=%{public}u, headerTotal=%{public}u, headerSize=%{public}u, headerOffset=%{public}u, " "bufferSeq=%{public}u, bufferTotal=%{public}u, bufferReceived=%{public}u", connectionId, dataLen, header.seq, header.total, header.size, header.offset, buffer->seq, buffer->total, @@ -239,7 +239,7 @@ uint8_t *ConnGattTransRecv( } if (memcpy_s(value + offset, valueLen - offset, it->data + BLE_TRANS_HEADER_SIZE, it->header.size) != EOK) { CONN_LOGE(CONN_BLE, - "memcpy_s packet to value failed, discard all received segmental packet. connId=%{public}u, " + "memcpy_s packet to value fail, discard all received segmental packet. connId=%{public}u, " "packetDataLen=%{public}u, Seq=%{public}u, Total=%{public}u, Size=%{public}u, Offset=%{public}u, " "valueLen=%{public}u, currentValueOffset=%{public}u", connectionId, dataLen, header.seq, header.total, header.size, header.offset, valueLen, offset); @@ -314,7 +314,7 @@ int32_t ConnBlePostBytesInner(uint32_t connectionId, uint8_t *data, uint32_t dat int32_t module, int64_t seq, PostBytesFinishAction postBytesFinishAction) { CONN_CHECK_AND_RETURN_RET_LOGW(data != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "ble post bytes failed, invalid param, data is null, connId=%{public}u, pid=%{public}d, " + "ble post bytes fail, invalid param, data is null, connId=%{public}u, pid=%{public}d, " "Len=%{public}u, Flg=%{public}d, Module=%{public}d, Seq=%{public}" PRId64 "", connectionId, pid, dataLen, flag, module, seq); @@ -339,7 +339,7 @@ int32_t ConnBlePostBytesInner(uint32_t connectionId, uint8_t *data, uint32_t dat int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "try to lock failed, connId=%{public}u, pid=%{public}d, " + "try to lock fail, connId=%{public}u, pid=%{public}d, " "Len=%{public}u, Flg=%{public}d, Module=%{public}d, Seq=%{public}" PRId64 ", err=%{public}d", connectionId, pid, dataLen, flag, module, seq, status); ConnBleReturnConnection(&connection); @@ -362,7 +362,7 @@ int32_t ConnBlePostBytesInner(uint32_t connectionId, uint8_t *data, uint32_t dat SendQueueNode *node = (SendQueueNode *)SoftBusCalloc(sizeof(SendQueueNode)); if (node == NULL) { CONN_LOGE(CONN_BLE, - "calloc send node failed, connId=%{public}u, pid=%{public}d, " + "calloc send node fail, connId=%{public}u, pid=%{public}d, " "Len=%{public}u, Flg=%{public}d, Module=%{public}d, Seq=%{public}" PRId64 "", connectionId, pid, dataLen, flag, module, seq); ConnBleReturnConnection(&connection); @@ -388,7 +388,7 @@ int32_t ConnBlePostBytesInner(uint32_t connectionId, uint8_t *data, uint32_t dat if (!g_startBleSendLPInfo.sendTaskRunning) { status = ConnStartActionAsync(NULL, BleSendTask, "BleSend_Tsk"); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "start send task failed errno=%{public}d", status); + CONN_LOGE(CONN_BLE, "start send task fail errno=%{public}d", status); SoftBusMutexUnlock(&g_startBleSendLPInfo.lock); ConnBleReturnConnection(&connection); FreeSendNode(node); @@ -402,7 +402,7 @@ int32_t ConnBlePostBytesInner(uint32_t connectionId, uint8_t *data, uint32_t dat status = ConnBleEnqueueNonBlock((const void *)node); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "enqueue send node failed, connId=%{public}u, pid=%{public}d, " + "enqueue send node fail, connId=%{public}u, pid=%{public}d, " "Len=%{public}u, Flg=%{public}d, Module=%{public}d, Seq=%{public}" PRId64 ", err=%{public}d", connectionId, pid, dataLen, flag, module, seq, status); FreeSendNode(node); @@ -467,7 +467,7 @@ int64_t ConnBlePackCtlMessage(BleCtlMessageSerializationContext ctx, uint8_t **o int32_t ret = BleCtrlMsgSerializeByJson(ctx, &data, &dataLen); if (ret != SOFTBUS_OK) { CONN_LOGE(CONN_BLE, - "ble connecion pack ctl message failed: serialize json bytes failed, " + "ble connecion pack ctl message fail: serialize json bytes fail, " "connId=%{public}u, method=%{public}d", ctx.connectionId, ctx.method); return ret; } @@ -483,7 +483,7 @@ int64_t ConnBlePackCtlMessage(BleCtlMessageSerializationContext ctx, uint8_t **o int64_t seq = ConnBlePackCtrlMsgHeader(header, dataLen); if (memcpy_s(buf + headSize, bufLen - headSize, data, dataLen) != EOK) { CONN_LOGE(CONN_BLE, - "ble connecion pack ctl message failed: memcpy ctl message bytes failed, " + "ble connecion pack ctl message fail: memcpy ctl message bytes fail, " "connId=%{public}u, method=%{public}d", ctx.connectionId, ctx.method); cJSON_free(data); SoftBusFree(buf); @@ -541,12 +541,12 @@ uint8_t *ConnCocTransRecv(uint32_t connectionId, LimitedBuffer *buffer, int32_t } uint8_t *dataCopy = SoftBusCalloc(packLen); if (dataCopy == NULL) { - CONN_LOGE(CONN_BLE, "coc connection parse data failed: calloc failed, retry next time, connId=%{public}u, " + CONN_LOGE(CONN_BLE, "coc connection parse data fail: calloc fail, retry next time, connId=%{public}u, " "packLen=%{public}u", connectionId, packLen); return NULL; } if (memcpy_s(dataCopy, packLen, buffer->buffer, packLen) != EOK) { - CONN_LOGE(CONN_BLE, "coc connection parse data failed: memcpy_s failed, retry next time, " + CONN_LOGE(CONN_BLE, "coc connection parse data fail: memcpy_s fail, retry next time, " "connId=%{public}u, packLen=%{public}u, bufferLen=%{public}u", connectionId, packLen, buffer->length); SoftBusFree(dataCopy); return NULL; @@ -554,7 +554,7 @@ uint8_t *ConnCocTransRecv(uint32_t connectionId, LimitedBuffer *buffer, int32_t if (buffer->length > packLen && memmove_s(buffer->buffer, buffer->length, buffer->buffer + packLen, buffer->length - packLen) != EOK) { - CONN_LOGE(CONN_BLE, "coc connection parse data failed: memmove_s failed, retry next time. " + CONN_LOGE(CONN_BLE, "coc connection parse data fail: memmove_s fail, retry next time. " "connectionId=%{public}u", connectionId); SoftBusFree(dataCopy); return NULL; @@ -614,7 +614,7 @@ void *BleSendTask(void *arg) g_startBleSendLPInfo.messagePosted = false; SoftBusMutexUnlock(&g_startBleSendLPInfo.lock); if (status != SOFTBUS_OK || sendNode == NULL) { - CONN_LOGW(CONN_BLE, "ble dequeue failed err=%{public}d,", status); + CONN_LOGW(CONN_BLE, "ble dequeue fail err=%{public}d,", status); SoftBusSleepMs(WAIT_TIME); continue; } @@ -637,7 +637,7 @@ void *BleSendTask(void *arg) status = ConnCocTransSend(connection, sendNode->data, sendNode->dataLen, sendNode->module); break; default: - CONN_LOGE(CONN_BLE, "ble connecion trans send failed, connectionId=%{public}u, protocol=%{public}d", + CONN_LOGE(CONN_BLE, "ble connecion trans send fail, connectionId=%{public}u, protocol=%{public}d", connection->connectionId, connection->protocol); } ConnBleReturnConnection(&connection); @@ -655,24 +655,24 @@ void *BleSendTask(void *arg) int32_t ConnBleInitTransModule(ConnBleTransEventListener *listener) { CONN_CHECK_AND_RETURN_RET_LOGW( - listener != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, "init ble trans failed: invalid param, listener is null"); + listener != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, "init ble trans fail: invalid param, listener is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onPostBytesFinished != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init ble trans failed: invalid param, listener onPostByteFinshed is null"); + "init ble trans fail: invalid param, listener onPostByteFinshed is null"); struct ConnSlideWindowController *controller = ConnSlideWindowControllerNew(); CONN_CHECK_AND_RETURN_RET_LOGW(controller != NULL, SOFTBUS_CONN_BLE_INTERNAL_ERR, CONN_INIT, - "init br trans module failed: init flow controller failed"); + "init br trans module fail: init flow controller fail"); int32_t status = ConnBleInitSendQueue(); if (status != SOFTBUS_OK) { - CONN_LOGW(CONN_INIT, "init ble trans failed: init send queue failed, err=%{public}d", status); + CONN_LOGW(CONN_INIT, "init ble trans fail: init send queue fail, err=%{public}d", status); ConnSlideWindowControllerDelete(controller); return status; } status = SoftBusMutexInit(&g_startBleSendLPInfo.lock, NULL); if (status != SOFTBUS_OK) { - CONN_LOGW(CONN_INIT, "init ble trans failed: init send lp lock failed, err=%{public}d", status); + CONN_LOGW(CONN_INIT, "init ble trans fail: init send lp lock fail, err=%{public}d", status); ConnBleDeinitSendQueue(); ConnSlideWindowControllerDelete(controller); return status; diff --git a/core/connection/br/src/softbus_conn_br_connection.c b/core/connection/br/src/softbus_conn_br_connection.c index e2d9c8911e..cfce1d0703 100644 --- a/core/connection/br/src/softbus_conn_br_connection.c +++ b/core/connection/br/src/softbus_conn_br_connection.c @@ -90,7 +90,7 @@ static int32_t LoopRead(ConnBrConnection *connection) while (true) { status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "try to get lock failed, connId=%{public}u, err=%{public}d", + CONN_LOGE(CONN_BR, "try to get lock fail, connId=%{public}u, err=%{public}d", connection->connectionId, status); break; } @@ -119,7 +119,7 @@ static void BrConnectStatusCallback(const BdAddr *bdAddr, BtUuid uuid, int32_t s char copyMac[BT_MAC_LEN] = { 0 }; int32_t ret = ConvertBtMacToStr(copyMac, BT_MAC_LEN, bdAddr->addr, sizeof(bdAddr->addr)); CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_BR, - "convert mac failed, result=%{public}d, status=%{public}d", result, status); + "convert mac fail, result=%{public}d, status=%{public}d", result, status); char anomizeAddress[BT_MAC_LEN] = { 0 }; ConvertAnonymizeMacAddress(anomizeAddress, BT_MAC_LEN, copyMac, BT_MAC_LEN); @@ -137,7 +137,7 @@ static void BrConnectStatusCallback(const BdAddr *bdAddr, BtUuid uuid, int32_t s BrUnderlayerStatus *callbackStatus = (BrUnderlayerStatus *)SoftBusCalloc(sizeof(BrUnderlayerStatus)); if (callbackStatus == NULL) { CONN_LOGE(CONN_BR, - "calloc failed, mac=%{public}s, result=%{public}d, status=%{public}d", anomizeAddress, result, status); + "calloc fail, mac=%{public}s, result=%{public}d, status=%{public}d", anomizeAddress, result, status); ConnBrReturnConnection(&connection); return; } @@ -164,7 +164,7 @@ static int32_t StartBrClientConnect(ConnBrConnection *connection, const char *an }; int32_t socketHandle = g_sppDriver->Connect(UUID, binaryAddr, &callback); if (socketHandle <= INVALID_SOCKET_HANDLE) { - CONN_LOGE(CONN_BR, "underlayer bluetooth connect failed, connId=%{public}u, address=%{public}s", + CONN_LOGE(CONN_BR, "underlayer bluetooth connect fail, connId=%{public}u, address=%{public}s", connection->connectionId, anomizeAddress); int32_t errCode = socketHandle; ConnAlarmExtra extraAlarm = { @@ -175,7 +175,7 @@ static int32_t StartBrClientConnect(ConnBrConnection *connection, const char *an return errCode; } if (SoftBusMutexLock(&connection->lock) != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "get lock failed, connId=%{public}u, address=%{public}s", connection->connectionId, + CONN_LOGE(CONN_BR, "get lock fail, connId=%{public}u, address=%{public}s", connection->connectionId, anomizeAddress); g_sppDriver->DisConnect(socketHandle); return SOFTBUS_LOCK_ERR; @@ -225,7 +225,7 @@ static void *StartClientConnect(void *connectCtx) "error=%{public}d", connection->connectionId, anomizeAddress, connection->socketHandle, ret); if (SoftBusMutexLock(&connection->lock) != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "get lock failed, connId=%{public}u, address=%{public}s", connection->connectionId, + CONN_LOGE(CONN_BR, "get lock fail, connId=%{public}u, address=%{public}s", connection->connectionId, anomizeAddress); g_eventListener.onConnectionException(connection->connectionId, SOFTBUS_LOCK_ERR); break; @@ -249,26 +249,26 @@ static ConnBrConnection *CreateAndSaveConnection(int32_t socketHandle) (void)memset_s(&remote, sizeof(remote), 0, sizeof(remote)); int32_t ret = g_sppDriver->GetRemoteDeviceInfo(socketHandle, &remote); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "GetRemoteDeviceInfo failed, socket=%{public}u, error=%{public}d", socketHandle, ret); + CONN_LOGE(CONN_BR, "GetRemoteDeviceInfo fail, socket=%{public}u, error=%{public}d", socketHandle, ret); g_sppDriver->DisConnect(socketHandle); return NULL; } char mac[BT_MAC_LEN] = { 0 }; ret = ConvertBtMacToStr(mac, BT_MAC_LEN, (uint8_t *)remote.mac, BT_ADDR_LEN); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "ConvertBtMacToStr failed, socket=%{public}u, error=%{public}d", socketHandle, ret); + CONN_LOGE(CONN_BR, "ConvertBtMacToStr fail, socket=%{public}u, error=%{public}d", socketHandle, ret); g_sppDriver->DisConnect(socketHandle); return NULL; } ConnBrConnection *connection = ConnBrCreateConnection(mac, CONN_SIDE_SERVER, socketHandle); if (connection == NULL) { - CONN_LOGE(CONN_BR, "create connection failed, socket=%{public}u, error=%{public}d", socketHandle, ret); + CONN_LOGE(CONN_BR, "create connection fail, socket=%{public}u, error=%{public}d", socketHandle, ret); g_sppDriver->DisConnect(socketHandle); return NULL; } ret = ConnBrSaveConnection(connection); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "ConnBrSaveConnection failed, socket=%{public}u, error=%{public}d", socketHandle, ret); + CONN_LOGE(CONN_BR, "ConnBrSaveConnection fail, socket=%{public}u, error=%{public}d", socketHandle, ret); g_sppDriver->DisConnect(socketHandle); ConnBrFreeConnection(connection); return NULL; @@ -292,7 +292,7 @@ static void *StartServerServe(void *serveCtx) connection->connectionId, socketHandle, ret); ret = SoftBusMutexLock(&connection->lock); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "get lock failed, connId=%{public}u, socket=%{public}d, err=%{public}d", + CONN_LOGE(CONN_BR, "get lock fail, connId=%{public}u, socket=%{public}d, err=%{public}d", connection->connectionId, socketHandle, ret); g_sppDriver->DisConnect(socketHandle); connection->socketHandle = INVALID_SOCKET_HANDLE; @@ -316,10 +316,10 @@ ConnBrConnection *ConnBrCreateConnection(const char *addr, ConnSideType side, in { CONN_CHECK_AND_RETURN_RET_LOGW(addr != NULL, NULL, CONN_BR, "br creat connection: addr is NULL"); ConnBrConnection *connection = (ConnBrConnection *)SoftBusCalloc(sizeof(ConnBrConnection)); - CONN_CHECK_AND_RETURN_RET_LOGE(connection != NULL, NULL, CONN_BR, "calloc br conn failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(connection != NULL, NULL, CONN_BR, "calloc br conn fail"); SoftBusList *list = CreateSoftBusList(); if (list == NULL) { - CONN_LOGE(CONN_BR, "create softbus list failed"); + CONN_LOGE(CONN_BR, "create softbus list fail"); SoftBusFree(connection); return NULL; } @@ -329,13 +329,13 @@ ConnBrConnection *ConnBrCreateConnection(const char *addr, ConnSideType side, in connection->connectionId = 0; connection->side = side; if (strcpy_s(connection->addr, BT_MAC_LEN, addr) != EOK) { - CONN_LOGE(CONN_BR, "copy address failed"); + CONN_LOGE(CONN_BR, "copy address fail"); SoftBusFree(connection); return NULL; } connection->mtu = (uint32_t)g_mtuSize; if (SoftBusMutexInit(&connection->lock, NULL) != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "init lock failed"); + CONN_LOGE(CONN_BR, "init lock fail"); SoftBusFree(connection); return NULL; } @@ -356,13 +356,13 @@ void ConnBrOccupy(ConnBrConnection *connection) { CONN_CHECK_AND_RETURN_LOGE(connection != NULL, CONN_BR, "conn is NULL"); CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&connection->lock) == SOFTBUS_OK, CONN_BR, - "lock failed, connId=%{public}u", connection->connectionId); + "lock fail, connId=%{public}u", connection->connectionId); ConnRemoveMsgFromLooper( &g_brConnectionAsyncHandler, MSG_CONNECTION_OCCUPY_RELEASE, connection->connectionId, 0, NULL); int32_t ret = ConnPostMsgToLooper(&g_brConnectionAsyncHandler, MSG_CONNECTION_OCCUPY_RELEASE, connection->connectionId, 0, NULL, WAIT_TIMEOUT_OCCUPY); if (ret != SOFTBUS_OK) { - CONN_LOGW(CONN_BR, "post msg failed, connId=%{public}u, err=%{public}d", connection->connectionId, ret); + CONN_LOGW(CONN_BR, "post msg fail, connId=%{public}u, err=%{public}d", connection->connectionId, ret); (void)SoftBusMutexUnlock(&connection->lock); return; } @@ -394,11 +394,11 @@ int32_t ConnBrConnect(ConnBrConnection *connection) { ClientConnectContext *ctx = (ClientConnectContext *)SoftBusCalloc(sizeof(ClientConnectContext)); CONN_CHECK_AND_RETURN_RET_LOGE(ctx != NULL, SOFTBUS_LOCK_ERR, CONN_BR, - "br client connect: calloc failed, connId=%{public}u", connection->connectionId); + "br client connect: calloc fail, connId=%{public}u", connection->connectionId); ctx->connectionId = connection->connectionId; int32_t status = ConnStartActionAsync(ctx, StartClientConnect, NULL); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "start connect thread failed, connId=%{public}u, error=%{public}d", connection->connectionId, + CONN_LOGE(CONN_BR, "start connect thread fail, connId=%{public}u, error=%{public}d", connection->connectionId, status); SoftBusFree(ctx); return status; @@ -412,7 +412,7 @@ static int32_t NotifyUpdateConnectionRc(uint32_t connectionId, int32_t delta) CONN_CHECK_AND_RETURN_RET_LOGE( connection != NULL, SOFTBUS_INVALID_PARAM, CONN_BR, "conn not exist, id=%{public}u", connectionId); if (SoftBusMutexLock(&connection->lock) != SOFTBUS_OK) { - CONN_LOGI(CONN_BR, "lock failed, connId=%{public}u, delta=%{public}d", connectionId, delta); + CONN_LOGI(CONN_BR, "lock fail, connId=%{public}u, delta=%{public}d", connectionId, delta); ConnBrReturnConnection(&connection); return SOFTBUS_LOCK_ERR; } @@ -446,7 +446,7 @@ static int32_t NotifyUpdateConnectionRc(uint32_t connectionId, int32_t delta) uint32_t dataLen = 0; int64_t seq = ConnBrPackCtlMessage(ctx, &data, &dataLen); if (seq < 0) { - CONN_LOGE(CONN_BR, "request message failed, connId=%{public}u, ret=%{public}d", connectionId, (int32_t)seq); + CONN_LOGE(CONN_BR, "request message fail, connId=%{public}u, ret=%{public}d", connectionId, (int32_t)seq); extra.errcode = (int32_t)seq; extra.result = EVENT_STAGE_RESULT_FAILED; CONN_EVENT(EVENT_SCENE_CONNECT, EVENT_STAGE_CONNECT_UPDATE_CONNECTION_RC, extra); @@ -466,7 +466,7 @@ static int32_t BrUpdateConnectionRc(uint32_t connectionId, int32_t delta) int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock failed, connectionId=%{public}u, error=%{public}d", connectionId, status); + CONN_LOGE(CONN_BR, "lock fail, connectionId=%{public}u, error=%{public}d", connectionId, status); ConnBrReturnConnection(&connection); return SOFTBUS_LOCK_ERR; } @@ -479,7 +479,7 @@ static int32_t BrUpdateConnectionRc(uint32_t connectionId, int32_t delta) status = ConnPostMsgToLooper(&g_brConnectionAsyncHandler, MSG_CONNECTION_UPDATE_LOCAL_RC, connectionId, delta, NULL, WAIT_TIMEOUT_TRY_AGAIN); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "post msg failed, connectionId=%{public}u, error=%{public}d", connectionId, status); + CONN_LOGE(CONN_BR, "post msg fail, connectionId=%{public}u, error=%{public}d", connectionId, status); return status; } return SOFTBUS_OK; @@ -496,7 +496,7 @@ int32_t ConnBrUpdateConnectionRc(ConnBrConnection *connection, int32_t delta) int32_t ConnBrDisconnectNow(ConnBrConnection *connection) { CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&connection->lock) == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_BR, - "br disconnect now: lock failed, connId=%{public}u", connection->connectionId); + "br disconnect now: lock fail, connId=%{public}u", connection->connectionId); int32_t socketHandle = connection->socketHandle; if (socketHandle == INVALID_SOCKET_HANDLE) { connection->state = BR_CONNECTION_STATE_CLOSED; @@ -515,7 +515,7 @@ int32_t ConnBrDisconnectNow(ConnBrConnection *connection) connection->connectionId, socketHandle, ret); ret = SoftBusMutexLock(&connection->lock); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_BR, - "lock failed, connId=%{public}u, err=%{public}d", connection->connectionId, ret); + "lock fail, connId=%{public}u, err=%{public}d", connection->connectionId, ret); connection->state = BR_CONNECTION_STATE_CLOSED; SoftBusMutexUnlock(&connection->lock); return ret; @@ -549,7 +549,7 @@ static int32_t NotifyReferenceRequest(uint32_t connectionId, int32_t delta, int3 SOFTBUS_INVALID_PARAM, CONN_BR, "conn not exist, id=%{public}u", connectionId); int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock failed, connectionId=%{public}u, error=%{public}d", connectionId, status); + CONN_LOGE(CONN_BR, "lock fail, connectionId=%{public}u, error=%{public}d", connectionId, status); ConnBrReturnConnection(&connection); return SOFTBUS_LOCK_ERR; } @@ -590,7 +590,7 @@ static void BrOnOccupyRelease(uint32_t connectionId) CONN_CHECK_AND_RETURN_LOGE(connection != NULL, CONN_BR, "conn not exist, id=%{public}u", connectionId); int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock failed, connectionId=%{public}u, error=%{public}d", connectionId, status); + CONN_LOGE(CONN_BR, "lock fail, connectionId=%{public}u, error=%{public}d", connectionId, status); ConnBrReturnConnection(&connection); return; } @@ -609,7 +609,7 @@ static int32_t BrOnReferenceRequest(uint32_t connectionId, ReferenceCount *refer int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock failed, connectionId=%{public}u, error=%{public}d", connectionId, status); + CONN_LOGE(CONN_BR, "lock fail, connectionId=%{public}u, error=%{public}d", connectionId, status); ConnBrReturnConnection(&connection); return SOFTBUS_LOCK_ERR; } @@ -621,7 +621,7 @@ static int32_t BrOnReferenceRequest(uint32_t connectionId, ReferenceCount *refer CONN_LOGI(CONN_BR, "is occupied, request process later, connectionId=%{public}u", connectionId); ReferenceCount *referenceParam = (ReferenceCount *)SoftBusMalloc(sizeof(ReferenceCount)); if (referenceParam == NULL) { - CONN_LOGE(CONN_BR, "malloc buffer failed, connectionId=%{public}u", connectionId); + CONN_LOGE(CONN_BR, "malloc buffer fail, connectionId=%{public}u", connectionId); return SOFTBUS_MALLOC_ERR; } referenceParam->delta = delta; @@ -630,7 +630,7 @@ static int32_t BrOnReferenceRequest(uint32_t connectionId, ReferenceCount *refer int32_t ret = ConnPostMsgToLooper(&g_brConnectionAsyncHandler, MSG_CONNECTION_UPDATE_PEER_RC, connectionId, 0, referenceParam, WAIT_TIMEOUT_TRY_AGAIN); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "post msg failed, connectionId=%{public}u, error=%{public}d", connectionId, ret); + CONN_LOGE(CONN_BR, "post msg fail, connectionId=%{public}u, error=%{public}d", connectionId, ret); SoftBusFree(referenceParam); return ret; } @@ -645,7 +645,7 @@ int32_t ConnBrOnReferenceRequest(ConnBrConnection *connection, const cJSON *json int32_t peerRc = 0; if (!GetJsonObjectSignedNumberItem(json, KEY_DELTA, &delta) || !GetJsonObjectSignedNumberItem(json, KEY_REFERENCE_NUM, &peerRc)) { - CONN_LOGE(CONN_BR, "parse delta or ref failed, connectionId=%{public}u, delta=%{public}d, peerRc=%{public}d", + CONN_LOGE(CONN_BR, "parse delta or ref fail, connectionId=%{public}u, delta=%{public}d, peerRc=%{public}d", connection->connectionId, delta, peerRc); return SOFTBUS_PARSE_JSON_ERR; } @@ -661,13 +661,13 @@ int32_t ConnBrOnReferenceResponse(ConnBrConnection *connection, const cJSON *jso CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, SOFTBUS_INVALID_PARAM, CONN_BR, "invalid param"); int32_t peerRc = 0; if (!GetJsonObjectSignedNumberItem(json, KEY_REFERENCE_NUM, &peerRc)) { - CONN_LOGE(CONN_BR, "parse delta or ref failed. connectionId=%{public}u", connection->connectionId); + CONN_LOGE(CONN_BR, "parse delta or ref fail. connectionId=%{public}u", connection->connectionId); return SOFTBUS_PARSE_JSON_ERR; } int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "get lock failed, connectionId=%{public}u, error=%{public}d", connection->connectionId, + CONN_LOGE(CONN_BR, "get lock fail, connectionId=%{public}u, error=%{public}d", connection->connectionId, status); return SOFTBUS_LOCK_ERR; } @@ -688,7 +688,7 @@ static void ResetServerState(uint32_t traceId) { int32_t status = SoftBusMutexLock(&g_serverStateMutex); CONN_CHECK_AND_RETURN_LOGE(status == SOFTBUS_OK, - CONN_BR, "lock failed, traceId=%{public}u", traceId); + CONN_BR, "lock fail, traceId=%{public}u", traceId); if (traceId != g_serverState.traceId) { CONN_LOGE(CONN_BR, "not reset, traceId=%{public}u, globalTraceId=%{public}u", traceId, g_serverState.traceId); @@ -707,7 +707,7 @@ static int32_t CheckBrServerStateAndOpenSppServer(int32_t *serverId, uint32_t tr const char *name = "BrManagerInsecure"; int32_t status = SoftBusMutexLock(&g_serverStateMutex); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock failed, exit listen task, traceId=%{public}u, error=%{public}d", + CONN_LOGE(CONN_BR, "lock fail, exit listen task, traceId=%{public}u, error=%{public}d", traceId, status); return SOFTBUS_LOCK_ERR; } @@ -725,7 +725,7 @@ static int32_t CheckBrServerStateAndOpenSppServer(int32_t *serverId, uint32_t tr int32_t serverFd = g_sppDriver->OpenSppServer(name, (int32_t)strlen(name), UUID, 0); if (serverFd == -1) { CONN_LOGE(CONN_BR, - "open br server failed, retry after some times, retryDelay=%{public}d, traceId=%{public}u", + "open br server fail, retry after some times, retryDelay=%{public}d, traceId=%{public}u", BR_ACCEPET_WAIT_TIME, traceId); SoftBusSleepMs(BR_ACCEPET_WAIT_TIME); return SOFTBUS_CONN_BR_RETRY_OPEN_SERVER; @@ -733,7 +733,7 @@ static int32_t CheckBrServerStateAndOpenSppServer(int32_t *serverId, uint32_t tr CONN_LOGI(CONN_BR, "open br server ok, traceId=%{public}u, serverId=%{public}d", traceId, serverFd); status = SoftBusMutexLock(&g_serverStateMutex); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock failed, exit listen task, traceId=%{public}u, error=%{public}d", + CONN_LOGE(CONN_BR, "lock fail, exit listen task, traceId=%{public}u, error=%{public}d", traceId, status); g_sppDriver->CloseSppServer(serverFd); return SOFTBUS_LOCK_ERR; @@ -772,13 +772,13 @@ static void *ListenTask(void *arg) while (true) { int32_t socketHandle = g_sppDriver->Accept(serverId); if (socketHandle == SOFTBUS_CONN_BR_SPP_SERVER_ERR) { - CONN_LOGE(CONN_BR, "accept failed, traceId=%{public}u, serverId=%{public}d", traceId, + CONN_LOGE(CONN_BR, "accept fail, traceId=%{public}u, serverId=%{public}d", traceId, serverId); break; } ServerServeContext *ctx = (ServerServeContext *)SoftBusCalloc(sizeof(ServerServeContext)); if (ctx == NULL) { - CONN_LOGE(CONN_BR, "calloc serve context failed, traceId=%{public}u, serverId=%{public}d, " + CONN_LOGE(CONN_BR, "calloc serve context fail, traceId=%{public}u, serverId=%{public}d, " "socketHandle=%{public}d", traceId, serverId, socketHandle); g_sppDriver->DisConnect(socketHandle); continue; @@ -786,7 +786,7 @@ static void *ListenTask(void *arg) ctx->socketHandle = socketHandle; status = ConnStartActionAsync(ctx, StartServerServe, NULL); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "start serve thread failed, traceId=%{public}u, serverId=%{public}d, " + CONN_LOGE(CONN_BR, "start serve thread fail, traceId=%{public}u, serverId=%{public}d, " "socket=%{public}d, error=%{public}d", traceId, serverId, socketHandle, status); SoftBusFree(ctx); g_sppDriver->DisConnect(socketHandle); @@ -807,7 +807,7 @@ int32_t ConnBrStartServer(void) uint32_t traceId = 0; int32_t status = SoftBusMutexLock(&g_serverStateMutex); CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_BR, - "lock failed, err=%{public}d", status); + "lock fail, err=%{public}d", status); if (g_serverState.available) { CONN_LOGI(CONN_BR, "already start service, traceId=%{public}u", g_serverState.traceId); (void)SoftBusMutexUnlock(&g_serverStateMutex); @@ -821,14 +821,14 @@ int32_t ConnBrStartServer(void) ServerState *serverState = (ServerState *)SoftBusCalloc(sizeof(ServerState)); if (serverState == NULL) { - CONN_LOGE(CONN_BR, "malloc serverState failed"); + CONN_LOGE(CONN_BR, "malloc serverState fail"); ResetServerState(traceId); return SOFTBUS_MALLOC_ERR; } serverState->traceId = traceId; status = ConnStartActionAsync(serverState, ListenTask, "BrListen_Tsk"); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "start br server failed: error=%{public}d", status); + CONN_LOGE(CONN_BR, "start br server fail: error=%{public}d", status); SoftBusFree(serverState); ResetServerState(traceId); return status; @@ -841,7 +841,7 @@ int32_t ConnBrStopServer(void) { int32_t status = SoftBusMutexLock(&g_serverStateMutex); CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_BR, - "lock failed, err=%{public}d", status); + "lock fail, err=%{public}d", status); CONN_LOGI(CONN_BR, "traceId=%{public}u", g_serverState.traceId); g_serverState.available = false; g_serverState.traceId = 0; @@ -866,7 +866,7 @@ static void BrConnectionIdleDisconnectTimeoutHandler(uint32_t connectionId) { ConnBrConnection *connection = ConnBrGetConnectionById(connectionId); CONN_CHECK_AND_RETURN_LOGW(connection != NULL, CONN_BR, - "connection idle disconnect timeout handler failed: connection not exist, connId=%{public}u", connectionId); + "connection idle disconnect timeout handler fail: connection not exist, connId=%{public}u", connectionId); CONN_LOGW(CONN_BR, "connection idle disconnect timeout handler, connection idle exceed forgot call " "disconnect? disconnect now, timeoutMillis=%{public}d, connId=%{public}u", @@ -882,7 +882,7 @@ static void WaitNegotiationClosingTimeoutHandler(uint32_t connectionId) "WaitNegotiationClosingTimeoutHandler: connection not exist, id=%{public}u", connectionId); int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock failed, connId=%{public}u, error=%{public}d", connectionId, status); + CONN_LOGE(CONN_BR, "lock fail, connId=%{public}u, error=%{public}d", connectionId, status); ConnBrReturnConnection(&connection); return; } @@ -969,7 +969,7 @@ static int BrCompareConnectionLooperEventFunc(const SoftBusMessage *msg, void *a } if (ctx->arg1 != 0 || ctx->arg2 != 0 || ctx->obj != NULL) { CONN_LOGE(CONN_BR, - "failed to avoid fault silence, " + "fail to avoid fault silence, " "what=%{public}d, arg1=%{public}" PRIu64 ", arg2=%{public}" PRIu64 ", objIsNull=%{public}d", ctx->what, ctx->arg1, ctx->arg2, ctx->obj == NULL); return COMPARE_FAILED; @@ -1007,30 +1007,30 @@ static int32_t InitProperty() int32_t ConnBrConnectionMuduleInit(SoftBusLooper *looper, SppSocketDriver *sppDriver, ConnBrEventListener *listener) { CONN_CHECK_AND_RETURN_RET_LOGW(looper != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "br connection init failed: looper is null"); + "br connection init fail: looper is null"); CONN_CHECK_AND_RETURN_RET_LOGW(sppDriver != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "br connection init failed: spp driver is null"); + "br connection init fail: spp driver is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "br connection init failed: event listener is null"); + "br connection init fail: event listener is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onServerAccepted != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "br connection init failed: listener OnServerAccepted is null"); + "br connection init fail: listener OnServerAccepted is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onClientConnected != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "br connection init failed: listener OnClientConnected is null"); + "br connection init fail: listener OnClientConnected is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onClientConnectFailed != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "br connection init failed: listener OnClientFailed is null"); + "br connection init fail: listener OnClientFailed is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onDataReceived != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "br connection init failed: listener OnDataReceived, is null"); + "br connection init fail: listener OnDataReceived, is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onConnectionException != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "br connection init failed: listener OnConnectionException is null"); + "br connection init fail: listener OnConnectionException is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onConnectionResume != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "br connection init failed: listener OnConnectionResume is null"); + "br connection init fail: listener OnConnectionResume is null"); int32_t status = InitProperty(); CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, SOFTBUS_INVALID_PARAM, CONN_INIT, - "br connection init failed: init property failed"); + "br connection init fail: init property fail"); status = SoftBusMutexInit(&g_serverStateMutex, NULL); CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_INIT, - "br connection init failed: init lock failed"); + "br connection init fail: init lock fail"); g_brConnectionAsyncHandler.handler.looper = looper; g_sppDriver = sppDriver; g_eventListener = *listener; diff --git a/core/connection/br/src/softbus_conn_br_manager.c b/core/connection/br/src/softbus_conn_br_manager.c index 285f4bfca0..3aabdcdcfd 100644 --- a/core/connection/br/src/softbus_conn_br_manager.c +++ b/core/connection/br/src/softbus_conn_br_manager.c @@ -278,11 +278,11 @@ static void NotifyDeviceConnectResult( ConnBrRequest *it = NULL; if (connection == NULL) { LIST_FOR_EACH_ENTRY(it, &device->requests, ConnBrRequest, node) { - CONN_LOGD(CONN_BR, "br notify connect request failed, requestId=%{public}u, addr=%{public}s, " + CONN_LOGD(CONN_BR, "br notify connect request fail, requestId=%{public}u, addr=%{public}s, " "reason=%{public}d", it->requestId, anomizeAddress, reason); DfxRecordBrConnectFail(it->requestId, DEFAULT_PID, (ConnBrDevice *)device, &it->statistics, reason); it->result.OnConnectFailed(it->requestId, reason); - CONN_LOGE(CONN_BR, "br notify connect request failed done, requestId=%{public}u, addr=%{public}s, " + CONN_LOGE(CONN_BR, "br notify connect request fail done, requestId=%{public}u, addr=%{public}s, " "reason=%{public}d", it->requestId, anomizeAddress, reason); } return; @@ -297,7 +297,7 @@ static void NotifyDeviceConnectResult( ConnectionInfo info = { 0 }; status = Convert2ConnectionInfo(connection, &info); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "convert br connection info failed, error=%{public}d", status); + CONN_LOGE(CONN_BR, "convert br connection info fail, error=%{public}d", status); } ConnectOption option; @@ -339,7 +339,7 @@ static void KeepAliveBleIfSameAddress(ConnBrDevice *device) int32_t status = ConnBleKeepAlive( connectionId, device->bleKeepAliveInfo.keepAliveBleRequestId, BLE_CONNECT_KEEP_ALIVE_TIMEOUT_MILLIS); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "ble keep alive failed, connId=%{public}u, requestId=%{public}u", connectionId, + CONN_LOGE(CONN_BR, "ble keep alive fail, connId=%{public}u, requestId=%{public}u", connectionId, device->bleKeepAliveInfo.keepAliveBleRequestId); return; } @@ -357,7 +357,7 @@ static int32_t ConnectDeviceDirectly(ConnBrDevice *device, const char *anomizeAd char *address = (char *)SoftBusCalloc(BT_MAC_LEN); do { if (address == NULL || strcpy_s(address, BT_MAC_LEN, device->addr) != EOK) { - CONN_LOGW(CONN_BR, "copy br address failed, addr=%{public}s", anomizeAddress); + CONN_LOGW(CONN_BR, "copy br address fail, addr=%{public}s", anomizeAddress); status = SOFTBUS_MEM_ERR; break; } @@ -443,7 +443,7 @@ static int32_t PendingDevice(ConnBrDevice *device, const char *anomizeAddress) static bool BrReuseConnection(ConnBrDevice *device, ConnBrConnection *connection) { CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&connection->lock) == SOFTBUS_OK, false, CONN_BR, - "br reuse connection failed: lock failed, connId=%{public}u", connection->connectionId); + "br reuse connection fail: lock fail, connId=%{public}u", connection->connectionId); enum ConnBrConnectionState state = connection->state; (void)SoftBusMutexUnlock(&connection->lock); if (state != BR_CONNECTION_STATE_CONNECTED) { @@ -456,7 +456,7 @@ static bool BrReuseConnection(ConnBrDevice *device, ConnBrConnection *connection static bool CheckPending(const char *addr) { CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_brManager.pendings->lock) == SOFTBUS_OK, false, CONN_BR, - "check pending failed: lock pendings failed"); + "check pending fail: lock pendings fail"); bool pending = false; BrPending *it = NULL; LIST_FOR_EACH_ENTRY(it, &g_brManager.pendings->list, BrPending, node) { @@ -545,7 +545,7 @@ static void ConnectRequestOnAvailableState(const ConnBrConnectRequestContext *ct ConnBrDevice *device = NULL; int32_t status = ConvertCtxToDevice(&device, ctx); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "ConvertCtxToDevice failed, requestId=%{public}u, error=%{public}d", ctx->requestId, status); + CONN_LOGE(CONN_BR, "ConvertCtxToDevice fail, requestId=%{public}u, error=%{public}d", ctx->requestId, status); DfxRecordBrConnectFail(ctx->requestId, DEFAULT_PID, device, &ctx->statistics, status); ctx->result.OnConnectFailed(ctx->requestId, status); return; @@ -562,7 +562,7 @@ static void ConnectRequestOnConnectingState(const ConnBrConnectRequestContext *c ConnBrDevice *device = NULL; int32_t status = ConvertCtxToDevice(&device, ctx); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "ConvertCtxToDevice failed, requestId=%{public}u, error=%{public}d", ctx->requestId, status); + CONN_LOGE(CONN_BR, "ConvertCtxToDevice fail, requestId=%{public}u, error=%{public}d", ctx->requestId, status); DfxRecordBrConnectFail(ctx->requestId, DEFAULT_PID, device, &ctx->statistics, status); ctx->result.OnConnectFailed(ctx->requestId, status); return; @@ -602,7 +602,7 @@ static void ServerAccepted(uint32_t connectionId) ConnectionInfo info = { 0 }; int32_t status = Convert2ConnectionInfo(connection, &info); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "convert connection info failed, error=%{public}d", status); + CONN_LOGE(CONN_BR, "convert connection info fail, error=%{public}d", status); } g_connectCallback.OnConnected(connectionId, &info); ConnRemoveMsgFromLooper(&g_brManagerAsyncHandler, MSG_UNPEND, 0, 0, connection->addr); @@ -681,10 +681,10 @@ static bool IsNeedWaitCallbackError(uint32_t connectionId, int32_t *error) { ConnBrConnection *connection = ConnBrGetConnectionById(connectionId); CONN_CHECK_AND_RETURN_RET_LOGE(connection != NULL, false, CONN_BR, - "get conntion failed, connId=%{public}d", connectionId); + "get conntion fail, connId=%{public}d", connectionId); if (SoftBusMutexLock(&connection->lock) != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock failed, connId=%{public}u", connectionId); + CONN_LOGE(CONN_BR, "lock fail, connId=%{public}u", connectionId); ConnBrReturnConnection(&connection); return false; } @@ -849,13 +849,13 @@ static void ReceivedControlData(ConnBrConnection *connection, const uint8_t *dat { cJSON *json = cJSON_ParseWithLength((const char *)data, dataLen); if (json == NULL) { - CONN_LOGE(CONN_BR, "parse json failed, connId=%{public}u", connection->connectionId); + CONN_LOGE(CONN_BR, "parse json fail, connId=%{public}u", connection->connectionId); return; } int32_t method = 0; if (!GetJsonObjectNumberItem(json, KEY_METHOD, &method)) { - CONN_LOGE(CONN_BR, "parse method failed, connId=%{public}u", connection->connectionId); + CONN_LOGE(CONN_BR, "parse method fail, connId=%{public}u", connection->connectionId); cJSON_Delete(json); return; } @@ -908,7 +908,7 @@ static void ConnectionException(uint32_t connectionId, int32_t error) ConnectionInfo info = { 0 }; int32_t status = Convert2ConnectionInfo(connection, &info); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "convert br connection info failed, error=%{public}d", status); + CONN_LOGE(CONN_BR, "convert br connection info fail, error=%{public}d", status); } ConnBrRemoveConnection(connection); ConnBrReturnConnection(&connection); @@ -920,7 +920,7 @@ static void ConnectionResume(uint32_t connectionId) { ConnBrConnection *connection = ConnBrGetConnectionById(connectionId); CONN_CHECK_AND_RETURN_LOGW(connection != NULL, CONN_BR, - "br resume connection failed: connection not exist, connId=%{public}u", connectionId); + "br resume connection fail: connection not exist, connId=%{public}u", connectionId); ConnBrDevice *it = NULL; ConnBrDevice *next = NULL; LIST_FOR_EACH_ENTRY_SAFE(it, next, &g_brManager.waitings, ConnBrDevice, node) { @@ -936,7 +936,7 @@ static void DisconnectRequest(uint32_t connectionId) { ConnBrConnection *connection = ConnBrGetConnectionById(connectionId); CONN_CHECK_AND_RETURN_LOGW(connection != NULL, CONN_BR, - "br disconnect request failed: connection is not exist, connId=%{public}u", connectionId); + "br disconnect request fail: connection is not exist, connId=%{public}u", connectionId); ConnBrUpdateConnectionRc(connection, -1); ConnBrReturnConnection(&connection); } @@ -947,7 +947,7 @@ static void UnpendConnection(const char *addr) ConvertAnonymizeMacAddress(anomizeAddress, BT_MAC_LEN, addr, BT_MAC_LEN); CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&g_brManager.pendings->lock) == SOFTBUS_OK, CONN_BR, - "unpend connection: lock failed, addr=%{public}s", anomizeAddress); + "unpend connection: lock fail, addr=%{public}s", anomizeAddress); ConnRemoveMsgFromLooper(&g_brManagerAsyncHandler, MSG_UNPEND, 0, 0, (char *)addr); do { BrPending *target = NULL; @@ -1001,7 +1001,7 @@ static void Reset(int32_t reason) int32_t status = SoftBusMutexLock(&g_brManager.pendings->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock pendings failed, error=%{public}d", status); + CONN_LOGE(CONN_BR, "lock pendings fail, error=%{public}d", status); return; } BrPending *pendingIt = NULL; @@ -1016,7 +1016,7 @@ static void Reset(int32_t reason) status = SoftBusMutexLock(&g_brManager.connections->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock connections failed, error=%{public}d", status); + CONN_LOGE(CONN_BR, "lock connections fail, error=%{public}d", status); return; } ConnBrConnection *connectionIt = NULL; @@ -1253,7 +1253,7 @@ static int BrCompareManagerLooperEventFunc(const SoftBusMessage *msg, void *args } if (ctx->arg1 != 0 || ctx->arg2 != 0 || ctx->obj != NULL) { CONN_LOGE(CONN_BR, - "failed to avoid fault silence, what=%{public}d, arg1=%{public}" PRIu64 ", arg2=%{public}" PRIu64 + "fail to avoid fault silence, what=%{public}d, arg1=%{public}" PRIu64 ", arg2=%{public}" PRIu64 ", objIsNull=%{public}d", ctx->what, ctx->arg1, ctx->arg2, ctx->obj == NULL); return COMPARE_FAILED; @@ -1276,7 +1276,7 @@ static void OnClientConnectFailed(uint32_t connectionId, int32_t error) CONN_LOGW(CONN_BR, "connId=%{public}u, error=%{public}d", connectionId, error); ErrorContext *ctx = (ErrorContext *)SoftBusCalloc(sizeof(ErrorContext)); CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_BR, - "OnClientConnectFailed: calloc ctx failed, connId=%{public}u, error=%{public}d", connectionId, error); + "OnClientConnectFailed: calloc ctx fail, connId=%{public}u, error=%{public}d", connectionId, error); bool needWait = IsNeedWaitCallbackError(connectionId, &error); ctx->connectionId = connectionId; ctx->error = error; @@ -1292,7 +1292,7 @@ static void OnDataReceived(uint32_t connectionId, uint8_t *data, uint32_t dataLe ConnBrDataReceivedContext *ctx = (ConnBrDataReceivedContext *)SoftBusCalloc(sizeof(ConnBrDataReceivedContext)); if (ctx == NULL) { CONN_LOGE( - CONN_BR, "calloc data received context failed, connId=%{public}u, len=%{public}u", connectionId, dataLen); + CONN_BR, "calloc data received context fail, connId=%{public}u, len=%{public}u", connectionId, dataLen); SoftBusFree(data); return; } @@ -1302,7 +1302,7 @@ static void OnDataReceived(uint32_t connectionId, uint8_t *data, uint32_t dataLe int32_t status = ConnPostMsgToLooper(&g_brManagerAsyncHandler, MSG_DATA_RECEIVED, 0, 0, ctx, 0); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "post msg to looper failed, connId=%{public}u, len=%{public}u", connectionId, dataLen); + CONN_LOGE(CONN_BR, "post msg to looper fail, connId=%{public}u, len=%{public}u", connectionId, dataLen); SoftBusFree(data); SoftBusFree(ctx); } @@ -1312,7 +1312,7 @@ static void OnConnectionException(uint32_t connectionId, int32_t error) { ErrorContext *ctx = (ErrorContext *)SoftBusCalloc(sizeof(ErrorContext)); CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_BR, - "br connection exception: calloc ctx failed, connId=%{public}u, error=%{public}d", connectionId, error); + "br connection exception: calloc ctx fail, connId=%{public}u, error=%{public}d", connectionId, error); ctx->connectionId = connectionId; ctx->error = error; if (ConnPostMsgToLooper(&g_brManagerAsyncHandler, MSG_CONNECTION_EXECEPTION, connectionId, 0, ctx, 0) != @@ -1366,7 +1366,7 @@ int32_t ConnBrSaveConnection(ConnBrConnection *connection) int32_t status = SoftBusMutexLock(&g_brManager.connections->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock manager connections failed, error=%{public}d", status); + CONN_LOGE(CONN_BR, "lock manager connections fail, error=%{public}d", status); return status; } uint32_t connectionId = 0; @@ -1385,7 +1385,7 @@ void ConnBrRemoveConnection(ConnBrConnection *connection) { CONN_CHECK_AND_RETURN_LOGW(connection != NULL, CONN_BR, "br remove connection: connection is null"); CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&g_brManager.connections->lock) == SOFTBUS_OK, CONN_BR, - "br remove connection: lock manager connections failed, connId=%{public}u", connection->connectionId); + "br remove connection: lock manager connections fail, connId=%{public}u", connection->connectionId); ConnBrConnection *it = NULL; ConnBrConnection *target = NULL; @@ -1415,7 +1415,7 @@ ConnBrConnection *ConnBrGetConnectionByAddr(const char *addr, ConnSideType side) int32_t status = SoftBusMutexLock(&g_brManager.connections->lock); if (status != SOFTBUS_OK) { CONN_LOGE( - CONN_BR, "lock manager connections failed, addr=%{public}s, error=%{public}d", animizeAddress, status); + CONN_BR, "lock manager connections fail, addr=%{public}s, error=%{public}d", animizeAddress, status); return NULL; } @@ -1429,7 +1429,7 @@ ConnBrConnection *ConnBrGetConnectionByAddr(const char *addr, ConnSideType side) if (target != NULL) { status = SoftBusMutexLock(&target->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock connection failed, error=%{public}d", status); + CONN_LOGE(CONN_BR, "lock connection fail, error=%{public}d", status); SoftBusMutexUnlock(&g_brManager.connections->lock); return NULL; } @@ -1444,7 +1444,7 @@ ConnBrConnection *ConnBrGetConnectionById(uint32_t connectionId) { int32_t status = SoftBusMutexLock(&g_brManager.connections->lock); CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, NULL, CONN_BR, - "br get connection by id: lock manager connections failed, connId=%{public}u, error=%{public}d", connectionId, + "br get connection by id: lock manager connections fail, connId=%{public}u, error=%{public}d", connectionId, status); ConnBrConnection *it = NULL; @@ -1458,7 +1458,7 @@ ConnBrConnection *ConnBrGetConnectionById(uint32_t connectionId) if (target != NULL) { status = SoftBusMutexLock(&target->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock connection failed, connId=%{public}u, error=%{public}d", connectionId, status); + CONN_LOGE(CONN_BR, "lock connection fail, connId=%{public}u, error=%{public}d", connectionId, status); SoftBusMutexUnlock(&g_brManager.connections->lock); return NULL; } @@ -1476,7 +1476,7 @@ void ConnBrReturnConnection(ConnBrConnection **connectionPtr) ConnBrConnection *connection = *connectionPtr; CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&connection->lock) == SOFTBUS_OK, CONN_BR, - "br return connection: lock failed, connId=%{public}u", connection->connectionId); + "br return connection: lock fail, connId=%{public}u", connection->connectionId); connection->objectRc -= 1; int32_t objectRc = connection->objectRc; SoftBusMutexUnlock(&connection->lock); @@ -1506,14 +1506,14 @@ static int32_t BrConnectDevice(const ConnectOption *option, uint32_t requestId, ConnBrConnectRequestContext *ctx = (ConnBrConnectRequestContext *)SoftBusCalloc(sizeof(ConnBrConnectRequestContext)); CONN_CHECK_AND_RETURN_RET_LOGE(ctx != NULL, SOFTBUS_MEM_ERR, CONN_BR, - "BrConnectDevice: calloc connect request context failed: requestId=%{public}u, addr=%{public}s", requestId, + "BrConnectDevice: calloc connect request context fail: requestId=%{public}u, addr=%{public}s", requestId, anomizeAddress); uint32_t traceId = SoftbusGetConnectTraceId(); ctx->statistics.startTime = SoftBusGetSysTimeMs(); ctx->statistics.connectTraceId = traceId; ctx->requestId = requestId; if (strcpy_s(ctx->addr, BT_MAC_LEN, option->brOption.brMac) != EOK) { - CONN_LOGE(CONN_BR, "copy address failed, requestId=%{public}u, address=%{public}s", requestId, anomizeAddress); + CONN_LOGE(CONN_BR, "copy address fail, requestId=%{public}u, address=%{public}s", requestId, anomizeAddress); SoftBusFree(ctx); return SOFTBUS_STRCPY_ERR; } @@ -1522,7 +1522,7 @@ static int32_t BrConnectDevice(const ConnectOption *option, uint32_t requestId, ctx->waitTimeoutDelay = option->brOption.waitTimeoutDelay; int32_t status = ConnPostMsgToLooper(&g_brManagerAsyncHandler, MSG_CONNECT_REQUEST, 0, 0, ctx, 0); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "post msg to looper failed, requestId=%{public}u, addr=%{public}s, error=%{public}d", + CONN_LOGE(CONN_BR, "post msg to looper fail, requestId=%{public}u, addr=%{public}s, error=%{public}d", requestId, anomizeAddress, status); SoftBusFree(ctx); return status; @@ -1648,13 +1648,13 @@ static int32_t BrPendConnection(const ConnectOption *option, uint32_t time) int32_t status = SoftBusMutexLock(&g_brManager.pendings->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock pendings failed: error=%{public}d", status); + CONN_LOGE(CONN_BR, "lock pendings fail: error=%{public}d", status); return SOFTBUS_LOCK_ERR; } do { char *copyAddr = (char *)SoftBusCalloc(BT_MAC_LEN); if (copyAddr == NULL || strcpy_s(copyAddr, BT_MAC_LEN, option->brOption.brMac) != EOK) { - CONN_LOGE(CONN_BR, "copy addr failed, addr=%s", animizeAddress); + CONN_LOGE(CONN_BR, "copy addr fail, addr=%s", animizeAddress); // it is safe, SoftBusFree will check NULL situation SoftBusFree(copyAddr); status = SOFTBUS_MALLOC_ERR; @@ -1675,7 +1675,7 @@ static int32_t BrPendConnection(const ConnectOption *option, uint32_t time) status = ConnPostMsgToLooper(&g_brManagerAsyncHandler, MSG_UNPEND, 0, 0, copyAddr, (time < BR_CONNECTION_PEND_TIMEOUT_MAX_MILLIS ? time : BR_CONNECTION_PEND_TIMEOUT_MAX_MILLIS)); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "post msg failed, addr=%{public}s, error=%{public}d", animizeAddress, status); + CONN_LOGE(CONN_BR, "post msg fail, addr=%{public}s, error=%{public}d", animizeAddress, status); SoftBusFree(copyAddr); } break; @@ -1683,7 +1683,7 @@ static int32_t BrPendConnection(const ConnectOption *option, uint32_t time) BrPending *pending = (BrPending *)SoftBusCalloc(sizeof(BrPending)); if (pending == NULL) { - CONN_LOGE(CONN_BR, "calloc pending object failed"); + CONN_LOGE(CONN_BR, "calloc pending object fail"); status = SOFTBUS_MALLOC_ERR; SoftBusFree(copyAddr); break; @@ -1700,7 +1700,7 @@ static int32_t BrPendConnection(const ConnectOption *option, uint32_t time) status = ConnPostMsgToLooper(&g_brManagerAsyncHandler, MSG_UNPEND, 0, 0, copyAddr, (time < BR_CONNECTION_PEND_TIMEOUT_MAX_MILLIS ? time : BR_CONNECTION_PEND_TIMEOUT_MAX_MILLIS)); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "post msg to looper failed, addr=%{public}s, error=%{public}d", animizeAddress, status); + CONN_LOGE(CONN_BR, "post msg to looper fail, addr=%{public}s, error=%{public}d", animizeAddress, status); ListDelete(&pending->node); SoftBusFree(copyAddr); SoftBusFree(pending); @@ -1727,7 +1727,7 @@ static void DumpLocalBtMac(void) SoftBusBtAddr addr = { 0 }; int32_t status = SoftBusGetBtMacAddr(&addr); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "get bt Smac failed, error=%{public}d", status); + CONN_LOGE(CONN_BR, "get bt Smac fail, error=%{public}d", status); return; } char myBtMac[BT_MAC_LEN] = { 0 }; @@ -1760,13 +1760,13 @@ static void OnBtStateChanged(int listenerId, int state) ErrorContext *ctx = (ErrorContext *)SoftBusCalloc(sizeof(ErrorContext)); if (ctx == NULL) { - CONN_LOGE(CONN_BR, "calloc ctx object failed"); + CONN_LOGE(CONN_BR, "calloc ctx object fail"); return; } ctx->error = SOFTBUS_CONN_BLUETOOTH_OFF; status = ConnPostMsgToLooper(&g_brManagerAsyncHandler, MSG_RESET, 0, 0, ctx, 0); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "post msg to looper failed"); + CONN_LOGE(CONN_BR, "post msg to looper fail"); SoftBusFree(ctx); } return; @@ -1779,7 +1779,7 @@ static int32_t InitBrManager(void) SoftBusList *pendings = CreateSoftBusList(); CONN_CHECK_AND_RETURN_RET_LOGE( connections != NULL && pendings != NULL, SOFTBUS_CREATE_LIST_ERR, - CONN_INIT, "InitBrManager: create list failed"); + CONN_INIT, "InitBrManager: create list fail"); g_brManager.connections = connections; g_brManager.pendings = pendings; ListInit(&g_brManager.waitings); @@ -1793,7 +1793,7 @@ static int32_t InitBrManager(void) int32_t listenerId = -1; int32_t ret = SoftBusAddBtStateListener(&listener, &listenerId); CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, SOFTBUS_CONN_BR_INTERNAL_ERR, CONN_INIT, - "InitBrManager: add bt state change listener failed, invalid listenerId=%{public}d", listenerId); + "InitBrManager: add bt state change listener fail, invalid listenerId=%{public}d", listenerId); TransitionToState(BR_STATE_AVAILABLE); return SOFTBUS_OK; } @@ -1815,10 +1815,10 @@ static int32_t InitBrEventListener(void) { int32_t ret = BrInitLooper(); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, SOFTBUS_CONN_BR_INTERNAL_ERR, CONN_INIT, - "ConnInitBr: init looper failed, error=%{public}d", ret); + "ConnInitBr: init looper fail, error=%{public}d", ret); SppSocketDriver *sppDriver = InitSppSocketDriver(); CONN_CHECK_AND_RETURN_RET_LOGE(sppDriver != NULL, SOFTBUS_CONN_BR_INTERNAL_ERR, CONN_INIT, - "ConnInitBr: init spp socket driver failed"); + "ConnInitBr: init spp socket driver fail"); ConnBrEventListener connectionEventListener = { .onServerAccepted = OnServerAccepted, @@ -1830,30 +1830,30 @@ static int32_t InitBrEventListener(void) }; ret = ConnBrConnectionMuduleInit(g_brManagerAsyncHandler.handler.looper, sppDriver, &connectionEventListener); CONN_CHECK_AND_RETURN_RET_LOGE( - ret == SOFTBUS_OK, ret, CONN_INIT, "ConnInitBr: init connection failed, error=%{public}d ", ret); + ret == SOFTBUS_OK, ret, CONN_INIT, "ConnInitBr: init connection fail, error=%{public}d ", ret); ConnBrTransEventListener transEventListener = { .onPostByteFinshed = OnPostByteFinshed, }; ret = ConnBrTransMuduleInit(sppDriver, &transEventListener); CONN_CHECK_AND_RETURN_RET_LOGE( - ret == SOFTBUS_OK, ret, CONN_INIT, "ConnInitBr: init trans failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_INIT, "ConnInitBr: init trans fail, error=%{public}d", ret); return SOFTBUS_OK; } ConnectFuncInterface *ConnInitBr(const ConnectCallback *callback) { CONN_CHECK_AND_RETURN_RET_LOGW( - CheckConnCallbackPara(callback) == SOFTBUS_OK, NULL, CONN_INIT, "ConnInitBr callback para failed"); + CheckConnCallbackPara(callback) == SOFTBUS_OK, NULL, CONN_INIT, "ConnInitBr callback para fail"); CONN_CHECK_AND_RETURN_RET_LOGE( - InitBrEventListener() == SOFTBUS_OK, NULL, CONN_INIT, "InitBrEventListener init failed"); + InitBrEventListener() == SOFTBUS_OK, NULL, CONN_INIT, "InitBrEventListener init fail"); int32_t ret = InitBrManager(); CONN_CHECK_AND_RETURN_RET_LOGE( - ret == SOFTBUS_OK, NULL, CONN_INIT, "ConnInitBr: init manager failed, error=%{public}d", ret); + ret == SOFTBUS_OK, NULL, CONN_INIT, "ConnInitBr: init manager fail, error=%{public}d", ret); ret = ConnBrInitBrPendingPacket(); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, NULL, CONN_INIT, - "conn init br failed: init pending packet failed, error=%{public}d", ret); + "conn init br fail: init pending packet fail, error=%{public}d", ret); g_connectCallback = *callback; static ConnectFuncInterface connectFuncInterface = { @@ -1881,13 +1881,13 @@ int32_t ConnBrDumper(ListNode *connectionSnapshots) int32_t ret = SoftBusMutexLock(&g_brManager.connections->lock); CONN_CHECK_AND_RETURN_RET_LOGE( - ret == SOFTBUS_OK, ret, CONN_BLE, "lock br connections failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_BLE, "lock br connections fail, error=%{public}d", ret); ConnBrConnection *it = NULL; LIST_FOR_EACH_ENTRY(it, &g_brManager.connections->list, ConnBrConnection, node) { ConnBrConnectionSnapshot *snapshot = ConnBrCreateConnectionSnapshot(it); if (snapshot == NULL) { - CONN_LOGE(CONN_BLE, "br hidumper construct snapshot failed"); + CONN_LOGE(CONN_BLE, "br hidumper construct snapshot fail"); continue; } ListAdd(connectionSnapshots, &snapshot->node); diff --git a/core/connection/br/src/softbus_conn_br_pending_packet.c b/core/connection/br/src/softbus_conn_br_pending_packet.c index 20ad99852c..420d9d6a24 100644 --- a/core/connection/br/src/softbus_conn_br_pending_packet.c +++ b/core/connection/br/src/softbus_conn_br_pending_packet.c @@ -60,7 +60,7 @@ int32_t ConnBrCreateBrPendingPacket(uint32_t id, int64_t seq) } pending = (PendingPacket *)SoftBusCalloc(sizeof(PendingPacket)); if (pending == NULL) { - CONN_LOGE(CONN_BR, "calloc failed, id=%{public}u, seq=%{public}" PRId64, id, seq); + CONN_LOGE(CONN_BR, "calloc fail, id=%{public}u, seq=%{public}" PRId64, id, seq); (void)SoftBusMutexUnlock(&g_pendingLock); return SOFTBUS_MALLOC_ERR; } @@ -109,7 +109,7 @@ int32_t ConnBrGetBrPendingPacket(uint32_t id, int64_t seq, uint32_t waitMillis, #define USECTONSEC 1000LL CONN_CHECK_AND_RETURN_RET_LOGW(data != NULL, SOFTBUS_INVALID_PARAM, CONN_BR, "invalid param"); CONN_CHECK_AND_RETURN_RET_LOGW(SoftBusMutexLock(&g_pendingLock) == SOFTBUS_OK, SOFTBUS_LOCK_ERR, - CONN_BR, "lock failed"); + CONN_BR, "lock fail"); PendingPacket *pending = NULL; PendingPacket *item = NULL; LIST_FOR_EACH_ENTRY(item, &g_pendingList, PendingPacket, node) { @@ -160,7 +160,7 @@ int32_t ConnBrSetBrPendingPacket(uint32_t id, int64_t seq, void *data) { PendingPacket *item = NULL; if (SoftBusMutexLock(&g_pendingLock) != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock failed"); + CONN_LOGE(CONN_BR, "lock fail"); return SOFTBUS_LOCK_ERR; } LIST_FOR_EACH_ENTRY(item, &g_pendingList, PendingPacket, node) { @@ -188,13 +188,13 @@ int32_t ConnBrOnAckRequest(ConnBrConnection *connection, const cJSON *json) int64_t peerSeq = 0; if (!GetJsonObjectSignedNumberItem(json, KEY_WINDOWS, &peerWindows) || !GetJsonObjectNumber64Item(json, KEY_ACK_SEQ_NUM, &peerSeq)) { - CONN_LOGE(CONN_BR, "parse window or seq failed, connId=%{public}u", connection->connectionId); + CONN_LOGE(CONN_BR, "parse window or seq fail, connId=%{public}u", connection->connectionId); return SOFTBUS_PARSE_JSON_ERR; } int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "lock failed, connId=%{public}u, error=%{public}d", connection->connectionId, status); + CONN_LOGE(CONN_BR, "lock fail, connId=%{public}u, error=%{public}d", connection->connectionId, status); return SOFTBUS_LOCK_ERR; } @@ -221,7 +221,7 @@ int32_t ConnBrOnAckRequest(ConnBrConnection *connection, const cJSON *json) int64_t seq = ConnBrPackCtlMessage(ctx, &data, &dataLen); if (seq < 0) { CONN_LOGE(CONN_BR, - "pack msg failed: connId=%{public}u, localWindow=%{public}d, peeWindow=%{public}d, " + "pack msg fail: connId=%{public}u, localWindow=%{public}d, peeWindow=%{public}d, " "peerSeq=%{public}" PRId64 ", error=%{public}d", connection->connectionId, localWindows, peerWindows, peerSeq, (int32_t)seq); return (int32_t)seq; @@ -235,7 +235,7 @@ int32_t ConnBrOnAckResponse(ConnBrConnection *connection, const cJSON *json) uint64_t seq = 0; if (!GetJsonObjectSignedNumberItem(json, KEY_WINDOWS, &peerWindows) || !GetJsonObjectNumber64Item(json, KEY_ACK_SEQ_NUM, (int64_t *)&seq)) { - CONN_LOGE(CONN_BR, "parse window or seq fields failed, connId=%{public}u", connection->connectionId); + CONN_LOGE(CONN_BR, "parse window or seq fields fail, connId=%{public}u", connection->connectionId); return SOFTBUS_PARSE_JSON_ERR; } CONN_LOGD(CONN_BR, "connId=%{public}u, peerWindow=%{public}d, seq=%{public}" PRId64, connection->connectionId, @@ -243,7 +243,7 @@ int32_t ConnBrOnAckResponse(ConnBrConnection *connection, const cJSON *json) int32_t status = ConnBrSetBrPendingPacket(connection->connectionId, (int64_t)seq, NULL); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BR, - "set br pending packet failed, connId=%{public}u, error=%{public}d", connection->connectionId, status); + "set br pending packet fail, connId=%{public}u, error=%{public}d", connection->connectionId, status); } return status; } diff --git a/core/connection/br/src/softbus_conn_br_send_queue.c b/core/connection/br/src/softbus_conn_br_send_queue.c index e459a72e21..41bc9e15eb 100644 --- a/core/connection/br/src/softbus_conn_br_send_queue.c +++ b/core/connection/br/src/softbus_conn_br_send_queue.c @@ -144,7 +144,7 @@ int32_t ConnBrDequeueBlock(void **msg) ConnectionQueue *next = NULL; SoftBusSysTime waitTime = {0}; int32_t ret = SoftBusGetTime(&waitTime); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, SOFTBUS_INVALID_PARAM, CONN_BR, "softbus get time failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, SOFTBUS_INVALID_PARAM, CONN_BR, "softbus get time fail"); waitTime.sec += BR_WAIT_TIME_SEC; CONN_CHECK_AND_RETURN_RET_LOGE(msg != NULL, SOFTBUS_INVALID_PARAM, CONN_BR, "msg is null"); @@ -208,7 +208,7 @@ int32_t ConnBrInnerQueueInit(void) } g_innerQueue = CreateBrQueue(0); if (g_innerQueue == NULL) { - CONN_LOGE(CONN_BR, "CreateBrQueue failed"); + CONN_LOGE(CONN_BR, "CreateBrQueue fail"); (void)SoftBusMutexDestroy(&g_brQueueLock); (void)SoftBusCondDestroy(&g_sendWaitCond); (void)SoftBusCondDestroy(&g_sendCond); diff --git a/core/connection/br/src/softbus_conn_br_snapshot.c b/core/connection/br/src/softbus_conn_br_snapshot.c index f3dfbf7e41..318bd51b86 100644 --- a/core/connection/br/src/softbus_conn_br_snapshot.c +++ b/core/connection/br/src/softbus_conn_br_snapshot.c @@ -51,7 +51,7 @@ static char *ToJson(ListNode *connectionSnapshots) { cJSON *root = cJSON_CreateObject(); if (root == NULL) { - CONN_LOGE(CONN_BR, "create json object failed"); + CONN_LOGE(CONN_BR, "create json object fail"); return NULL; } @@ -59,7 +59,7 @@ static char *ToJson(ListNode *connectionSnapshots) char *result = cJSON_Print(root); if (result == NULL) { - CONN_LOGE(CONN_BR, "br print hidumper json failed"); + CONN_LOGE(CONN_BR, "br print hidumper json fail"); cJSON_Delete(root); return NULL; } @@ -70,7 +70,7 @@ static char *ToJson(ListNode *connectionSnapshots) ConnBrConnectionSnapshot *ConnBrCreateConnectionSnapshot(const ConnBrConnection *connection) { ConnBrConnectionSnapshot *snapshot = (ConnBrConnectionSnapshot *)SoftBusCalloc(sizeof(ConnBrConnectionSnapshot)); - CONN_CHECK_AND_RETURN_RET_LOGE(snapshot != NULL, NULL, CONN_BR, "br hidumper malloc failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(snapshot != NULL, NULL, CONN_BR, "br hidumper malloc fail"); ListInit(&snapshot->node); snapshot->connectionId = connection->connectionId; @@ -78,7 +78,7 @@ ConnBrConnectionSnapshot *ConnBrCreateConnectionSnapshot(const ConnBrConnection char anonymizedAddress[BT_MAC_LEN] = { 0 }; ConvertAnonymizeMacAddress(anonymizedAddress, BT_MAC_LEN, connection->addr, BT_MAC_LEN); if (strcpy_s(snapshot->addr, BT_MAC_LEN, anonymizedAddress) != EOK) { - CONN_LOGE(CONN_BR, "br hidumper copy addr failed"); + CONN_LOGE(CONN_BR, "br hidumper copy addr fail"); } snapshot->state = connection->state; snapshot->mtu = connection->mtu; @@ -109,7 +109,7 @@ int32_t BrHiDumper(int fd) do { if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "get br snapshot failed"); + CONN_LOGE(CONN_BR, "get br snapshot fail"); break; } diff --git a/core/connection/br/src/softbus_conn_br_trans.c b/core/connection/br/src/softbus_conn_br_trans.c index 7e6a483bf0..f821fa65a0 100644 --- a/core/connection/br/src/softbus_conn_br_trans.c +++ b/core/connection/br/src/softbus_conn_br_trans.c @@ -63,19 +63,19 @@ static uint8_t *BrRecvDataParse(uint32_t connectionId, LimitedBuffer *buffer, in } uint8_t *dataCopy = (uint8_t *)SoftBusCalloc(packLen); if (dataCopy == NULL) { - CONN_LOGE(CONN_BR, "parse data failed: calloc failed, retry next time, connId=%{public}u, packLen=%{public}u", + CONN_LOGE(CONN_BR, "parse data fail: calloc fail, retry next time, connId=%{public}u, packLen=%{public}u", connectionId, packLen); return NULL; } if (memcpy_s(dataCopy, packLen, buffer->buffer, packLen) != EOK) { - CONN_LOGE(CONN_BR, "parse data failed: memcpy_s failed, retry next time, connId=%{public}u, " + CONN_LOGE(CONN_BR, "parse data fail: memcpy_s fail, retry next time, connId=%{public}u, " "packLen=%{public}u, bufferLen=%{public}u", connectionId, packLen, buffer->length); SoftBusFree(dataCopy); return NULL; } if (buffer->length > packLen && memmove_s(buffer->buffer, buffer->length, buffer->buffer + packLen, buffer->length - packLen) != EOK) { - CONN_LOGE(CONN_BR, "parse data failed: memmove_s failed, retry next time. connId=%{public}u, ", connectionId); + CONN_LOGE(CONN_BR, "parse data fail: memmove_s fail, retry next time. connId=%{public}u, ", connectionId); SoftBusFree(dataCopy); return NULL; } @@ -135,7 +135,7 @@ int32_t BrTransSend(uint32_t connectionId, int32_t socketHandle, uint32_t mtu, c int32_t writeLen = g_sppDriver->Write(socketHandle, data, amount); if (writeLen < 0) { CONN_LOGE(CONN_BR, - "br send data failed: underlayer bluetooth write failed, connId=%{public}u, " + "br send data fail: underlayer bluetooth write fail, connId=%{public}u, " "socketHandle=%{public}d, mtu=%{public}d, totalLen=%{public}d, waitWriteLen=%{public}d, " "alreadyWriteLen=%{public}d, error=%{public}d", connectionId, socketHandle, mtu, dataLen, waitWriteLen, dataLen - waitWriteLen, writeLen); @@ -204,7 +204,7 @@ int64_t ConnBrPackCtlMessage(BrCtlMessageSerializationContext ctx, uint8_t **out int32_t ret = SerializeByJson(ctx, &data, &dataLen); if (ret != SOFTBUS_OK) { CONN_LOGE(CONN_BR, - "br pack ctl message failed: serialize json bytes failed, connId=%{public}u, method=%{public}d", + "br pack ctl message fail: serialize json bytes fail, connId=%{public}u, method=%{public}d", ctx.connectionId, ctx.method); return ret; } @@ -225,7 +225,7 @@ int64_t ConnBrPackCtlMessage(BrCtlMessageSerializationContext ctx, uint8_t **out PackConnPktHead(&head); if (memcpy_s(buf, bufLen, &head, headSize) != EOK) { CONN_LOGE(CONN_BR, - "br pack ctl message failed: memcpy connection header failed, connId=%{public}u, method=%{public}d", + "br pack ctl message fail: memcpy connection header fail, connId=%{public}u, method=%{public}d", ctx.connectionId, ctx.method); cJSON_free(data); SoftBusFree(buf); @@ -233,7 +233,7 @@ int64_t ConnBrPackCtlMessage(BrCtlMessageSerializationContext ctx, uint8_t **out } if (memcpy_s(buf + headSize, bufLen - headSize, data, dataLen) != EOK) { CONN_LOGE(CONN_BR, - "br pack ctl message failed: memcpy ctl message bytes failed, connId=%{public}u, method=%{public}d", + "br pack ctl message fail: memcpy ctl message bytes fail, connId=%{public}u, method=%{public}d", ctx.connectionId, ctx.method); cJSON_free(data); SoftBusFree(buf); @@ -258,13 +258,13 @@ int32_t ConnBrPostBytes( uint32_t connectionId, uint8_t *data, uint32_t len, int32_t pid, int32_t flag, int32_t module, int64_t seq) { CONN_CHECK_AND_RETURN_RET_LOGW(data != NULL, SOFTBUS_INVALID_PARAM, CONN_BR, - "br post bytes failed: invalid param, data is null, connectionId=%{public}u, pid=%{public}d, " + "br post bytes fail: invalid param, data is null, connectionId=%{public}u, pid=%{public}d, " "Len=%{public}u, Flg=%{public}d, Module=%{public}d, Seq=%{public}" PRId64 "", connectionId, pid, len, flag, module, seq); if (len == 0 || len > MAX_DATA_LEN) { CONN_LOGW(CONN_BR, - "br post bytes failed, invalid param, data len is 0, connectionId=%{public}u, pid=%{public}d, " + "br post bytes fail, invalid param, data len is 0, connectionId=%{public}u, pid=%{public}d, " "Len=%{public}u, Flg=%{public}d, Module=%{public}d, Seq=%{public}" PRId64 "", connectionId, pid, len, flag, module, seq); SoftBusFree(data); @@ -274,7 +274,7 @@ int32_t ConnBrPostBytes( ConnBrConnection *connection = ConnBrGetConnectionById(connectionId); if (connection == NULL) { CONN_LOGE(CONN_BR, - "br post bytes failed: connection is not exist, connectionId=%{public}u, pid=%{public}d, " + "br post bytes fail: connection is not exist, connectionId=%{public}u, pid=%{public}d, " "Len=%{public}u, Flg=%{public}d, Module=%{public}d, Seq=%{public}" PRId64 "", connectionId, pid, len, flag, module, seq); SoftBusFree(data); @@ -284,7 +284,7 @@ int32_t ConnBrPostBytes( int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BR, - "br post bytes failed: try to lock failed, connectionId=%{public}u, pid=%{public}d, " + "br post bytes fail: try to lock fail, connectionId=%{public}u, pid=%{public}d, " "Len=%{public}u, Flg=%{public}d, Module=%{public}d, Seq=%{public}" PRId64 ", error=%{public}d", connectionId, pid, len, flag, module, seq, status); ConnBrReturnConnection(&connection); @@ -296,7 +296,7 @@ int32_t ConnBrPostBytes( ConnBrReturnConnection(&connection); if (state != BR_CONNECTION_STATE_CONNECTED && module != MODULE_CONNECTION) { CONN_LOGE(CONN_BR, - "br post bytes failed: connection is not ready, state=%{public}d, connId=%{public}u, pid=%{public}d, " + "br post bytes fail: connection is not ready, state=%{public}d, connId=%{public}u, pid=%{public}d, " "Len=%{public}u, Flg=%{public}d, Module=%{public}d, Seq=%{public}" PRId64 "", state, connectionId, pid, len, flag, module, seq); SoftBusFree(data); @@ -306,7 +306,7 @@ int32_t ConnBrPostBytes( SendBrQueueNode *node = (SendBrQueueNode *)SoftBusCalloc(sizeof(SendBrQueueNode)); if (node == NULL) { CONN_LOGE(CONN_BR, - "br post bytes failed: calloc queue node failed, connectionId=%{public}u, pid=%{public}d, " + "br post bytes fail: calloc queue node fail, connectionId=%{public}u, pid=%{public}d, " "Len=%{public}u, Flg=%{public}d, Module=%{public}d, Seq=%{public}" PRId64 "", connectionId, pid, len, flag, module, seq); SoftBusFree(data); @@ -329,7 +329,7 @@ int32_t ConnBrPostBytes( if (!g_startBrSendLPInfo.sendTaskRunning) { status = ConnStartActionAsync(NULL, SendHandlerLoop, "BrSend_Tsk"); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BR, "start br send task failed errno=%{public}d", status); + CONN_LOGE(CONN_BR, "start br send task fail errno=%{public}d", status); SoftBusMutexUnlock(&g_startBrSendLPInfo.lock); FreeSendNode(node); return status; @@ -342,7 +342,7 @@ int32_t ConnBrPostBytes( status = ConnBrEnqueueNonBlock((const void *)node); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_BR, - "br post bytes failed: enqueue failed, error=%{public}d, connId=%{public}u, pid=%{public}d, " + "br post bytes fail: enqueue fail, error=%{public}d, connId=%{public}u, pid=%{public}d, " "Len=%{public}u, Flg=%{public}d, Module=%{public}d, Seq=%{public}" PRId64 "", status, connectionId, pid, len, flag, module, seq); FreeSendNode(node); @@ -371,14 +371,14 @@ static int32_t SendAck(const ConnBrConnection *connection, int32_t socketHandle) uint32_t dataLen = 0; int64_t ctrlMsgSeq = ConnBrPackCtlMessage(ctx, &data, &dataLen); if (ctrlMsgSeq < 0) { - CONN_LOGW(CONN_BR, "br send ack failed: pack message failed, connId=%{public}u, window=%{public}d, " + CONN_LOGW(CONN_BR, "br send ack fail: pack message fail, connId=%{public}u, window=%{public}d, " "seq=%{public}" PRId64 ", error=%{public}d", connection->connectionId, connection->window, connection->sequence, (int32_t)ctrlMsgSeq); return (int32_t)ctrlMsgSeq; } int32_t status = ConnBrCreateBrPendingPacket(connection->connectionId, connection->sequence); if (status != SOFTBUS_OK) { - CONN_LOGW(CONN_BR, "br send ack failed: create pending failed, connId=%{public}u, window=%{public}d, " + CONN_LOGW(CONN_BR, "br send ack fail: create pending fail, connId=%{public}u, window=%{public}d, " "seq=%{public}" PRId64 ", error=%{public}d", connection->connectionId, connection->window, connection->sequence, status); SoftBusFree(data); @@ -398,7 +398,7 @@ static int32_t SendAck(const ConnBrConnection *connection, int32_t socketHandle) static void WaitAck(ConnBrConnection *connection) { CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&connection->lock) == SOFTBUS_OK, CONN_BR, - "wait ack failed: try to lock failed, connectionId=%{public}u", connection->connectionId); + "wait ack fail: try to lock fail, connectionId=%{public}u", connection->connectionId); int64_t waitSequence = connection->waitSequence; SoftBusMutexUnlock(&connection->lock); @@ -407,7 +407,7 @@ static void WaitAck(ConnBrConnection *connection) SoftBusFree(ignore); CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&connection->lock) == SOFTBUS_OK, CONN_BR, - "wait ack failed: try to lock failed after pending, connectionId=%{public}u", connection->connectionId); + "wait ack fail: try to lock fail after pending, connectionId=%{public}u", connection->connectionId); switch (ret) { case SOFTBUS_ALREADY_TRIGGERED: connection->ackTimeoutCount = 0; @@ -465,12 +465,12 @@ void *SendHandlerLoop(void *arg) g_startBrSendLPInfo.messagePosted = false; SoftBusMutexUnlock(&g_startBrSendLPInfo.lock); if (status != SOFTBUS_OK || sendNode == NULL) { - CONN_LOGE(CONN_BR, "br dequeue send node failed, error=%{public}d", status); + CONN_LOGE(CONN_BR, "br dequeue send node fail, error=%{public}d", status); continue; } ConnBrConnection *connection = ConnBrGetConnectionById(sendNode->connectionId); if (connection == NULL) { - CONN_LOGE(CONN_BR, "br send data failed: connection is not exist, connectionId=%{public}u", + CONN_LOGE(CONN_BR, "br send data fail: connection is not exist, connectionId=%{public}u", sendNode->connectionId); g_transEventListener.onPostByteFinshed(sendNode->connectionId, sendNode->len, sendNode->pid, sendNode->flag, sendNode->module, sendNode->seq, SOFTBUS_CONN_BR_CONNECTION_NOT_EXIST_ERR); @@ -481,7 +481,7 @@ void *SendHandlerLoop(void *arg) if (SoftBusMutexLock(&connection->lock) != SOFTBUS_OK) { CONN_LOGE( - CONN_BR, "br send data failed: try to lock failed, connectionId=%{public}u", sendNode->connectionId); + CONN_BR, "br send data fail: try to lock fail, connectionId=%{public}u", sendNode->connectionId); g_transEventListener.onPostByteFinshed(sendNode->connectionId, sendNode->len, sendNode->pid, sendNode->flag, sendNode->module, sendNode->seq, SOFTBUS_LOCK_ERR); ConnBrReturnConnection(&connection); @@ -492,7 +492,7 @@ void *SendHandlerLoop(void *arg) int32_t socketHandle = connection->socketHandle; if (socketHandle == INVALID_SOCKET_HANDLE) { - CONN_LOGE(CONN_BR, "br send data failed: invalid socket, connectionId=%{public}u", sendNode->connectionId); + CONN_LOGE(CONN_BR, "br send data fail: invalid socket, connectionId=%{public}u", sendNode->connectionId); (void)SoftBusMutexUnlock(&connection->lock); ConnBrReturnConnection(&connection); g_transEventListener.onPostByteFinshed(sendNode->connectionId, sendNode->len, sendNode->pid, @@ -549,23 +549,23 @@ int32_t ConnBrTransConfigPostLimit(const LimitConfiguration *configuration) int32_t ConnBrTransMuduleInit(SppSocketDriver *sppDriver, ConnBrTransEventListener *listener) { CONN_CHECK_AND_RETURN_RET_LOGW(sppDriver != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init br trans module failed: invalid param, sppDriver is null"); + "init br trans module fail: invalid param, sppDriver is null"); CONN_CHECK_AND_RETURN_RET_LOGW(sppDriver->Read != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init br trans module failed: invalid param, sppDriver->Read is null"); + "init br trans module fail: invalid param, sppDriver->Read is null"); CONN_CHECK_AND_RETURN_RET_LOGW(sppDriver->Write != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init br trans module failed: invalid param, sppDriver->Write is null"); + "init br trans module fail: invalid param, sppDriver->Write is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init br trans module failed: invalid param, listener is null"); + "init br trans module fail: invalid param, listener is null"); CONN_CHECK_AND_RETURN_RET_LOGW(listener->onPostByteFinshed != NULL, SOFTBUS_INVALID_PARAM, CONN_INIT, - "init br trans module failed: invalid param, listener->onPostByteFinshed is null"); + "init br trans module fail: invalid param, listener->onPostByteFinshed is null"); int32_t status = ConnBrInnerQueueInit(); CONN_CHECK_AND_RETURN_RET_LOGW(status == SOFTBUS_OK, status, CONN_INIT, - "init br trans module failed: init br send queue failed, error=%{public}d", status); + "init br trans module fail: init br send queue fail, error=%{public}d", status); struct ConnSlideWindowController *controller = ConnSlideWindowControllerNew(); if (controller == NULL) { - CONN_LOGW(CONN_INIT, "init br trans module failed: init flow controller failed"); + CONN_LOGW(CONN_INIT, "init br trans module fail: init flow controller fail"); ConnBrInnerQueueDeinit(); return SOFTBUS_CONN_BR_INTERNAL_ERR; } @@ -575,7 +575,7 @@ int32_t ConnBrTransMuduleInit(SppSocketDriver *sppDriver, ConnBrTransEventListen g_flowController = controller; status = SoftBusMutexInit(&g_startBrSendLPInfo.lock, NULL); if (status != SOFTBUS_OK) { - CONN_LOGW(CONN_INIT, "init br trans module failed: init send lp lock failed, err=%{public}d", status); + CONN_LOGW(CONN_INIT, "init br trans module fail: init send lp lock fail, err=%{public}d", status); ConnBrInnerQueueDeinit(); ConnSlideWindowControllerDelete(controller); return status; diff --git a/core/connection/common/src/softbus_base_listener.c b/core/connection/common/src/softbus_base_listener.c index ba4c1abcb7..1ec8676975 100644 --- a/core/connection/common/src/softbus_base_listener.c +++ b/core/connection/common/src/softbus_base_listener.c @@ -88,7 +88,7 @@ static SoftbusListenerNode *GetListenerNodeCommon(ListenerModule module, bool cr { int32_t status = SoftBusMutexLock(&g_listenerListLock); CONN_CHECK_AND_RETURN_RET_LOGE( - status == SOFTBUS_OK, NULL, CONN_COMMON, "lock failed, module=%{public}d, error=%{public}d", + status == SOFTBUS_OK, NULL, CONN_COMMON, "lock fail, module=%{public}d, error=%{public}d", module, status); SoftbusListenerNode *node = g_listenerList[module]; do { @@ -103,7 +103,7 @@ static SoftbusListenerNode *GetListenerNodeCommon(ListenerModule module, bool cr } status = SoftBusMutexLock(&node->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "lock listener failed, module=%{public}d, error=%{public}d", module, status); + CONN_LOGE(CONN_COMMON, "lock listener fail, module=%{public}d, error=%{public}d", module, status); node = NULL; break; } @@ -128,7 +128,7 @@ static void RemoveListenerNode(SoftbusListenerNode *node) { int32_t status = SoftBusMutexLock(&g_listenerListLock); CONN_CHECK_AND_RETURN_LOGE( - status == SOFTBUS_OK, CONN_COMMON, "lock listener lists failed, module=%{public}d, error=%{public}d", + status == SOFTBUS_OK, CONN_COMMON, "lock listener lists fail, module=%{public}d, error=%{public}d", node->module, status); do { if (g_listenerList[node->module] != node) { @@ -138,7 +138,7 @@ static void RemoveListenerNode(SoftbusListenerNode *node) } status = SoftBusMutexLock(&node->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "lock listener node failed, module=%{public}d", node->module); + CONN_LOGE(CONN_COMMON, "lock listener node fail, module=%{public}d", node->module); break; } // decrease root object reference @@ -155,7 +155,7 @@ static void ReturnListenerNode(SoftbusListenerNode **nodePtr) do { int32_t status = SoftBusMutexLock(&node->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "lock listener node failed, module=%{public}d", node->module); + CONN_LOGE(CONN_COMMON, "lock listener node fail, module=%{public}d", node->module); break; } node->objectRc -= 1; @@ -179,13 +179,13 @@ static SoftbusListenerNode *CreateSpecifiedListenerModule(ListenerModule module) { SoftbusListenerNode *node = (SoftbusListenerNode *)SoftBusCalloc(sizeof(SoftbusListenerNode)); CONN_CHECK_AND_RETURN_RET_LOGE( - node != NULL, NULL, CONN_COMMON, "calloc failed, module=%{public}d", module); + node != NULL, NULL, CONN_COMMON, "calloc fail, module=%{public}d", module); node->module = module; // NOT apply recursive lock on purpose, problem will be exposes quickly if exist int32_t status = SoftBusMutexInit(&node->lock, NULL); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "init lock failed, module=%{public}d, error=%{public}d", module, status); + CONN_LOGE(CONN_COMMON, "init lock fail, module=%{public}d, error=%{public}d", module, status); SoftBusFree(node); return NULL; } @@ -208,7 +208,7 @@ static SoftbusListenerNode *CreateSpecifiedListenerModule(ListenerModule module) static int32_t AddFdNode(ListNode *fdList, int32_t fd, uint32_t event) { struct FdNode *fdNode = (struct FdNode *)SoftBusCalloc(sizeof(struct FdNode)); - CONN_CHECK_AND_RETURN_RET_LOGE(fdNode != NULL, SOFTBUS_MALLOC_ERR, CONN_COMMON, "calloc fdNode failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(fdNode != NULL, SOFTBUS_MALLOC_ERR, CONN_COMMON, "calloc fdNode fail"); ListInit(&fdNode->node); fdNode->fd = fd; fdNode->triggerSet = event; @@ -220,7 +220,7 @@ static int32_t CollectModuleFdEvent(SoftbusListenerNode *node, ListNode *list) { int32_t ret = SoftBusMutexLock(&node->lock); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_COMMON, - "lock failed, module=%{public}d, error=%{public}d", node->module, ret); + "lock fail, module=%{public}d, error=%{public}d", node->module, ret); if (node->info.status != LISTENER_RUNNING) { (void)SoftBusMutexUnlock(&node->lock); @@ -231,7 +231,7 @@ static int32_t CollectModuleFdEvent(SoftbusListenerNode *node, ListNode *list) if (node->info.modeType == SERVER_MODE && node->info.listenFd > 0) { ret = AddFdNode(list, node->info.listenFd, READ_TRIGGER); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "add fd node failed, fd=%{public}d, status=%{public}d", node->info.listenFd, ret); + CONN_LOGE(CONN_COMMON, "add fd node fail, fd=%{public}d, status=%{public}d", node->info.listenFd, ret); (void)SoftBusMutexUnlock(&node->lock); return ret; } @@ -241,7 +241,7 @@ static int32_t CollectModuleFdEvent(SoftbusListenerNode *node, ListNode *list) LIST_FOR_EACH_ENTRY(it, &node->info.waitEventFds, struct FdNode, node) { ret = AddFdNode(list, it->fd, it->triggerSet); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "add fd node failed, fd=%{public}d, status=%{public}d", it->fd, ret); + CONN_LOGE(CONN_COMMON, "add fd node fail, fd=%{public}d, status=%{public}d", it->fd, ret); (void)SoftBusMutexUnlock(&node->lock); return ret; } @@ -262,7 +262,7 @@ static int32_t OnGetAllFdEvent(ListNode *list) ReturnListenerNode(&node); if (status != SOFTBUS_OK) { ReleaseFdNode(list); - CONN_LOGE(CONN_COMMON, "collect wait event fd set failed: module=%{public}d, error=%{public}d", + CONN_LOGE(CONN_COMMON, "collect wait event fd set fail: module=%{public}d, error=%{public}d", module, status); break; } @@ -278,14 +278,14 @@ static int32_t InitBaseListenerLock(void) }; int32_t status = SoftBusMutexInit(&g_watchThreadStateLock, &attr); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_INIT, "init watch thread lock failed, error=%{public}d", status); + CONN_LOGE(CONN_INIT, "init watch thread lock fail, error=%{public}d", status); return SOFTBUS_LOCK_ERR; } // NOT apply recursive lock on purpose, problem will be exposes quickly if exist status = SoftBusMutexInit(&g_listenerListLock, NULL); if (status != SOFTBUS_OK) { SoftBusMutexDestroy(&g_watchThreadStateLock); - CONN_LOGE(CONN_INIT, "init listener list lock failed, error=%{public}d", status); + CONN_LOGE(CONN_INIT, "init listener list lock fail, error=%{public}d", status); return SOFTBUS_LOCK_ERR; } return SOFTBUS_OK; @@ -304,10 +304,10 @@ int32_t InitBaseListener(void) flag = true; CONN_CHECK_AND_RETURN_RET_LOGE(InitBaseListenerLock() == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_COMMON, - "init lock failed"); + "init lock fail"); int32_t status = SoftBusMutexLock(&g_listenerListLock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_INIT, "lock listener list failed, error=%{public}d", status); + CONN_LOGE(CONN_INIT, "lock listener list fail, error=%{public}d", status); SoftBusMutexDestroy(&g_watchThreadStateLock); SoftBusMutexDestroy(&g_listenerListLock); return SOFTBUS_LOCK_ERR; @@ -316,7 +316,7 @@ int32_t InitBaseListener(void) (void)SoftBusMutexUnlock(&g_listenerListLock); g_eventWatcher = RegisterEventWatcher(OnGetAllFdEvent); if (g_eventWatcher == NULL) { - CONN_LOGE(CONN_INIT, "register event watcher failed"); + CONN_LOGE(CONN_INIT, "register event watcher fail"); SoftBusMutexDestroy(&g_watchThreadStateLock); SoftBusMutexDestroy(&g_listenerListLock); return SOFTBUS_MEM_ERR; @@ -348,7 +348,7 @@ uint32_t CreateListenerModule(void) { int32_t status = SoftBusMutexLock(&g_listenerListLock); CONN_CHECK_AND_RETURN_RET_LOGE( - status == SOFTBUS_OK, UNUSE_BUTT, CONN_COMMON, "lock failed, error=%{public}d", status); + status == SOFTBUS_OK, UNUSE_BUTT, CONN_COMMON, "lock fail, error=%{public}d", status); ListenerModule module = LISTENER_MODULE_DYNAMIC_START; for (; module <= LISTENER_MODULE_DYNAMIC_END; module++) { @@ -357,7 +357,7 @@ uint32_t CreateListenerModule(void) } SoftbusListenerNode *node = CreateSpecifiedListenerModule(module); if (node == NULL) { - CONN_LOGE(CONN_COMMON, "create specified listener module failed, module=%{public}d", module); + CONN_LOGE(CONN_COMMON, "create specified listener module fail, module=%{public}d", module); module = UNUSE_BUTT; } else { CONN_LOGI(CONN_COMMON, "create listener module success, module=%{public}d", module); @@ -397,11 +397,11 @@ int32_t StartBaseClient(ListenerModule module, const SoftbusBaseListener *listen SoftbusListenerNode *node = GetOrCreateListenerNode(module); CONN_CHECK_AND_RETURN_RET_LOGW( - node != NULL, SOFTBUS_NOT_FIND, CONN_COMMON, "get listener node failed, module=%{public}d", module); + node != NULL, SOFTBUS_NOT_FIND, CONN_COMMON, "get listener node fail, module=%{public}d", module); int32_t status = SoftBusMutexLock(&node->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "lock listener node failed, module=%{public}d, error=%{public}d", module, status); + CONN_LOGE(CONN_COMMON, "lock listener node fail, module=%{public}d, error=%{public}d", module, status); ReturnListenerNode(&node); return SOFTBUS_LOCK_ERR; } @@ -416,7 +416,7 @@ int32_t StartBaseClient(ListenerModule module, const SoftbusBaseListener *listen node->listener.onDataEvent = listener->onDataEvent; status = StartWatchThread(); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "start watch thread failed, module=%{public}d, " + CONN_LOGE(CONN_COMMON, "start watch thread fail, module=%{public}d, " "status=%{public}d", module, status); break; } @@ -432,7 +432,7 @@ static void SetIpv6Tos(int fd, uint32_t tos) { int32_t ret = SoftBusSocketSetOpt(fd, SOFTBUS_IPPROTO_IPV6, SOFTBUS_IPV6_TCLASS, &tos, sizeof(tos)); CONN_CHECK_AND_RETURN_LOGE( - ret == SOFTBUS_ADAPTER_OK, CONN_COMMON, "set tos failed, ret=%{public}d, fd=%{public}d", ret, fd); + ret == SOFTBUS_ADAPTER_OK, CONN_COMMON, "set tos fail, ret=%{public}d, fd=%{public}d", ret, fd); } static void SetP2pSocketOption(const LocalListenerInfo *info, int32_t fd) @@ -461,7 +461,7 @@ static int32_t StartServerListenUnsafe(SoftbusListenerNode *node, const LocalLis do { listenFd = socketIf->OpenServerSocket(info); if (listenFd < 0) { - CONN_LOGE(CONN_COMMON, "create server socket failed: module=%{public}d, listenFd=%{public}d", + CONN_LOGE(CONN_COMMON, "create server socket fail: module=%{public}d, listenFd=%{public}d", module, listenFd); status = listenFd; break; @@ -469,18 +469,18 @@ static int32_t StartServerListenUnsafe(SoftbusListenerNode *node, const LocalLis SetP2pSocketOption(info, listenFd); status = SoftBusSocketListen(listenFd, DEFAULT_BACKLOG); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "listen server socket failed: module=%{public}d, error=%{public}d", module, status); + CONN_LOGE(CONN_COMMON, "listen server socket fail: module=%{public}d, error=%{public}d", module, status); break; } listenPort = socketIf->GetSockPort(listenFd); if (listenPort < 0) { - CONN_LOGE(CONN_COMMON, "get listen server port failed: module=%{public}d, listenFd=%{public}d, " + CONN_LOGE(CONN_COMMON, "get listen server port fail: module=%{public}d, listenFd=%{public}d, " "error=%{public}d", module, listenFd, status); status = SOFTBUS_TCP_SOCKET_ERR; break; } if (memcpy_s(&node->info.listenerInfo, sizeof(LocalListenerInfo), info, sizeof(LocalListenerInfo)) != EOK) { - CONN_LOGE(CONN_COMMON, "memcpy_s local listener info object failed: module=%{public}d", module); + CONN_LOGE(CONN_COMMON, "memcpy_s local listener info object fail: module=%{public}d", module); status = SOFTBUS_MEM_ERR; break; } @@ -541,10 +541,10 @@ int32_t StartBaseListener(const LocalListenerInfo *info, const SoftbusBaseListen ListenerModule module = info->socketOption.moduleId; SoftbusListenerNode *node = GetOrCreateListenerNode(module); CONN_CHECK_AND_RETURN_RET_LOGW( - node != NULL, SOFTBUS_NOT_FIND, CONN_COMMON, "get listener node failed, module=%{public}d", module); + node != NULL, SOFTBUS_NOT_FIND, CONN_COMMON, "get listener node fail, module=%{public}d", module); int32_t status = SoftBusMutexLock(&node->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "lock failed, module=%{public}d, error=%{public}d", module, status); + CONN_LOGE(CONN_COMMON, "lock fail, module=%{public}d, error=%{public}d", module, status); ReturnListenerNode(&node); FillConnEventExtra(info, &extra, SOFTBUS_LOCK_ERR); CONN_EVENT(EVENT_SCENE_START_BASE_LISTENER, EVENT_STAGE_TCP_COMMON_ONE, extra); @@ -563,13 +563,13 @@ int32_t StartBaseListener(const LocalListenerInfo *info, const SoftbusBaseListen node->listener.onConnectEvent = listener->onConnectEvent; node->listener.onDataEvent = listener->onDataEvent; if (memcpy_s(&node->info.listenerInfo, sizeof(LocalListenerInfo), info, sizeof(LocalListenerInfo)) != EOK) { - CONN_LOGE(CONN_COMMON, "memcpy_s listener info failed, module=%{public}d", node->module); + CONN_LOGE(CONN_COMMON, "memcpy_s listener info fail, module=%{public}d", node->module); status = SOFTBUS_LOCK_ERR; break; } listenPort = StartServerListenUnsafe(node, info); if (listenPort <= 0) { - CONN_LOGE(CONN_COMMON, "start server failed, module=%{public}d, listenPort=%{public}d", + CONN_LOGE(CONN_COMMON, "start server fail, module=%{public}d, listenPort=%{public}d", module, listenPort); status = listenPort; break; @@ -577,14 +577,14 @@ int32_t StartBaseListener(const LocalListenerInfo *info, const SoftbusBaseListen status = StartWatchThread(); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "start listener thread failed, module=%{public}d, status=%{public}d", + CONN_LOGE(CONN_COMMON, "start listener thread fail, module=%{public}d, status=%{public}d", module, status); CleanupServerListenInfoUnsafe(node); break; } status = AddEvent(g_eventWatcher, node->info.listenFd, READ_TRIGGER); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "add fd trigger to watch failed, module=%{public}d", module); + CONN_LOGE(CONN_COMMON, "add fd trigger to watch fail, module=%{public}d", module); StopWatchThread(); CleanupServerListenInfoUnsafe(node); break; @@ -618,7 +618,7 @@ int32_t StopBaseListener(ListenerModule module) int32_t status = ShutdownBaseListener(node); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "stop listen thread failed, module=%{public}d, error=%{public}d", module, status); + CONN_LOGE(CONN_COMMON, "stop listen thread fail, module=%{public}d, error=%{public}d", module, status); } ReturnListenerNode(&node); extra.errcode = status; @@ -631,7 +631,7 @@ static int32_t ShutdownBaseListener(SoftbusListenerNode *node) { int32_t status = SoftBusMutexLock(&node->lock); CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_COMMON, - "lock failed, module=%{public}d, error=%{public}d", node->module, status); + "lock fail, module=%{public}d, error=%{public}d", node->module, status); do { if (node->info.status != LISTENER_RUNNING) { @@ -641,7 +641,7 @@ static int32_t ShutdownBaseListener(SoftbusListenerNode *node) } status = StopWatchThread(); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "stop watch thread failed, module=%{public}d, error=%{public}d", + CONN_LOGE(CONN_COMMON, "stop watch thread fail, module=%{public}d, error=%{public}d", node->module, status); // fall-through } @@ -716,7 +716,7 @@ int32_t AddTrigger(ListenerModule module, int32_t fd, TriggerType trigger) int32_t status = SoftBusMutexLock(&node->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "lock failed, module=%{public}d, fd=%{public}d, trigger=%{public}d, " + CONN_LOGE(CONN_COMMON, "lock fail, module=%{public}d, fd=%{public}d, trigger=%{public}d, " "error=%{public}d", module, fd, trigger, status); ReturnListenerNode(&node); return SOFTBUS_LOCK_ERR; @@ -757,7 +757,7 @@ int32_t AddTrigger(ListenerModule module, int32_t fd, TriggerType trigger) struct FdNode *fdNode = (struct FdNode *)SoftBusCalloc(sizeof(struct FdNode)); if (fdNode == NULL) { - CONN_LOGE(CONN_COMMON, "calloc failed, module=%{public}d, fd=%{public}d, trigger=%{public}d", + CONN_LOGE(CONN_COMMON, "calloc fail, module=%{public}d, fd=%{public}d, trigger=%{public}d", module, fd, trigger); status = SOFTBUS_MALLOC_ERR; break; @@ -796,7 +796,7 @@ int32_t DelTrigger(ListenerModule module, int32_t fd, TriggerType trigger) int32_t status = SoftBusMutexLock(&node->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "lock failed, module=%{public}d, fd=%{public}d, trigger=%{public}d, " + CONN_LOGE(CONN_COMMON, "lock fail, module=%{public}d, fd=%{public}d, trigger=%{public}d, " "error=%{public}d", module, fd, trigger, status); ReturnListenerNode(&node); return SOFTBUS_LOCK_ERR; @@ -938,7 +938,7 @@ static int32_t CopyWaitEventFdsUnsafe(const SoftbusListenerNode *node, struct Fd uint32_t fdArrayLen = node->info.waitEventFdsLen; struct FdNode *fdArray = (struct FdNode *)SoftBusCalloc(fdArrayLen * sizeof(struct FdNode)); CONN_CHECK_AND_RETURN_RET_LOGE(fdArray != NULL, SOFTBUS_MALLOC_ERR, CONN_COMMON, - "calloc failed, module=%{public}d, eventLen=%{public}u", node->module, fdArrayLen); + "calloc fail, module=%{public}d, eventLen=%{public}u", node->module, fdArrayLen); uint32_t i = 0; struct FdNode *item = NULL; @@ -948,7 +948,7 @@ static int32_t CopyWaitEventFdsUnsafe(const SoftbusListenerNode *node, struct Fd uint32_t tmpLen = fdArrayLen * FDARR_EXPAND_BASE; struct FdNode *tmp = (struct FdNode *)SoftBusCalloc(tmpLen * sizeof(struct FdNode)); if (tmp == NULL) { - CONN_LOGE(CONN_COMMON, "expand calloc fd node array object failed, module=%{public}d, " + CONN_LOGE(CONN_COMMON, "expand calloc fd node array object fail, module=%{public}d, " "eventLen=%{public}u", node->module, tmpLen); SoftBusFree(fdArray); return SOFTBUS_MALLOC_ERR; @@ -987,7 +987,7 @@ static void CloseInvalidListenForcely(SoftbusListenerNode *node, int32_t listenF int32_t reason) { int32_t ret = SoftBusMutexLock(&node->lock); - CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_COMMON, "lock failed, module=%{public}d, error=%{public}d", + CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_COMMON, "lock fail, module=%{public}d, error=%{public}d", node->module, ret); do { if (node->info.status != LISTENER_RUNNING || node->info.modeType != SERVER_MODE || @@ -1009,7 +1009,7 @@ static void ProcessServerAcceptEvent( SoftbusListenerNode *node, ListNode *fdNode, int32_t wakeupTrace, SoftbusBaseListener *listener) { CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&node->lock) == SOFTBUS_OK, CONN_COMMON, - "lock failed, wakeupTrace=%{public}d, module=%{public}d", wakeupTrace, node->module); + "lock fail, wakeupTrace=%{public}d, module=%{public}d", wakeupTrace, node->module); int32_t listenFd = -1; int32_t listenPort = -1; char animizedIp[IP_LEN] = { 0 }; @@ -1044,7 +1044,7 @@ static void ProcessServerAcceptEvent( break; default: CONN_LOGD(CONN_COMMON, - "accept client failed, wakeupTrace=%{public}d, module=%{public}d, listenFd=%{public}d, " + "accept client fail, wakeupTrace=%{public}d, module=%{public}d, listenFd=%{public}d, " "port=%{public}d, ip=%{public}s, error=%{public}d", wakeupTrace, node->module, listenFd, listenPort, animizedIp, status); break; @@ -1109,7 +1109,7 @@ static void ProcessFdEvent(SoftbusListenerNode *node, struct FdNode fdEvent, static void ProcessSpecifiedListenerNodeEvent(SoftbusListenerNode *node, ListNode *fdNode, int32_t wakeupTrace) { CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&node->lock) == SOFTBUS_OK, CONN_COMMON, - "lock failed, wakeupTrace=%{public}d, module=%{public}d", wakeupTrace, node->module); + "lock fail, wakeupTrace=%{public}d, module=%{public}d", wakeupTrace, node->module); if (node->info.status != LISTENER_RUNNING) { SoftBusMutexUnlock(&node->lock); return; @@ -1121,7 +1121,7 @@ static void ProcessSpecifiedListenerNodeEvent(SoftbusListenerNode *node, ListNod SoftBusMutexUnlock(&node->lock); if (status != SOFTBUS_OK) { CONN_LOGE(CONN_COMMON, - "copy wait event fds failed, wakeupTrace=%{public}d, module=%{public}d, error=%{public}d", + "copy wait event fds fail, wakeupTrace=%{public}d, module=%{public}d, error=%{public}d", wakeupTrace, node->module, status); return; } @@ -1154,7 +1154,7 @@ static void RemoveBadFd(void) } int32_t ret = SoftBusMutexLock(&node->lock); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "lock failed, module=%{public}d", module); + CONN_LOGE(CONN_COMMON, "lock fail, module=%{public}d", module); ReturnListenerNode(&node); continue; } @@ -1192,7 +1192,7 @@ static void *WatchTask(void *arg) while (true) { int32_t status = SoftBusMutexLock(&watchState->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "lock failed, retry after some times. " + CONN_LOGE(CONN_COMMON, "lock fail, retry after some times. " "waitDelay=%{public}dms, watchTrace=%{public}d, error=%{public}d", WATCH_UNEXPECT_FAIL_RETRY_WAIT_MILLIS, watchState->traceId, status); SoftBusSleepMs(WATCH_UNEXPECT_FAIL_RETRY_WAIT_MILLIS); @@ -1241,13 +1241,13 @@ static int32_t StartWatchThread(void) int32_t status = SoftBusMutexLock(&g_watchThreadStateLock); CONN_CHECK_AND_RETURN_RET_LOGE( - status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_COMMON, "lock global watch thread state failed"); + status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_COMMON, "lock global watch thread state fail"); do { if (g_watchThreadState != NULL) { status = SoftBusMutexLock(&g_watchThreadState->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "lock watch thread state self failed, error=%{public}d", status); + CONN_LOGE(CONN_COMMON, "lock watch thread state self fail, error=%{public}d", status); status = SOFTBUS_LOCK_ERR; break; } @@ -1268,14 +1268,14 @@ static int32_t StartWatchThread(void) status = SoftBusMutexInit(&state->lock, NULL); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "start watch task async failed, error=%{public}d", status); + CONN_LOGE(CONN_COMMON, "start watch task async fail, error=%{public}d", status); CleanupWatchThreadState(&state); break; } state->referenceCount = 1; status = ConnStartActionAsync(state, WatchTask, "Watch_Tsk"); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "init lock failed, error=%{public}d", status); + CONN_LOGE(CONN_COMMON, "init lock fail, error=%{public}d", status); CleanupWatchThreadState(&state); break; } @@ -1290,7 +1290,7 @@ static int32_t StopWatchThread(void) { int32_t status = SoftBusMutexLock(&g_watchThreadStateLock); CONN_CHECK_AND_RETURN_RET_LOGE( - status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_COMMON, "lock global watch thread state failed"); + status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_COMMON, "lock global watch thread state fail"); do { if (g_watchThreadState == NULL) { CONN_LOGW(CONN_COMMON, "watch thread is already stop or never start"); diff --git a/core/connection/common/src/softbus_conn_async_helper.c b/core/connection/common/src/softbus_conn_async_helper.c index 7cdb24261d..5afa84d17b 100644 --- a/core/connection/common/src/softbus_conn_async_helper.c +++ b/core/connection/common/src/softbus_conn_async_helper.c @@ -97,13 +97,13 @@ int32_t ConnAsyncCall(ConnAsync *async, ConnAsyncFunction function, void *arg, u int32_t callId = (++callIdGenerator); struct AsyncContext *ctx = SoftBusCalloc(sizeof(struct AsyncContext)); - CONN_CHECK_AND_RETURN_RET_LOGE(ctx, SOFTBUS_MEM_ERR, CONN_COMMON, "malloc async ctx failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ctx, SOFTBUS_MEM_ERR, CONN_COMMON, "malloc async ctx fail"); ctx->function = function; ctx->arg = arg; SoftBusMessage *msg = SoftBusCalloc(sizeof(SoftBusMessage)); if (msg == NULL) { - CONN_LOGE(CONN_COMMON, "malloc softbus message failed"); + CONN_LOGE(CONN_COMMON, "malloc softbus message fail"); SoftBusFree(ctx); return SOFTBUS_MEM_ERR; } diff --git a/core/connection/common/src/softbus_conn_bytes_delivery.c b/core/connection/common/src/softbus_conn_bytes_delivery.c index 3092c4b951..0c768c9148 100644 --- a/core/connection/common/src/softbus_conn_bytes_delivery.c +++ b/core/connection/common/src/softbus_conn_bytes_delivery.c @@ -37,7 +37,7 @@ struct ConnBytesDeliveryItem *ConnCreateBytesDeliveryItem( uint32_t connectionId, uint8_t *data, uint32_t length, struct ConnBytesAddition addition) { struct ConnBytesDeliveryItem *item = SoftBusCalloc(sizeof(struct ConnBytesDeliveryItem)); - CONN_CHECK_AND_RETURN_RET_LOGE(item != NULL, NULL, CONN_COMMON, "malloc failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(item != NULL, NULL, CONN_COMMON, "malloc fail"); ConnQueueItemConstruct((struct ConnQueueItem *)item, addition.pid, FlagToPriority(addition.flag)); @@ -74,17 +74,17 @@ ConnBytesDelivery *ConnCreateBytesDelivery(const struct ConnBytesDeliveryConfig CONN_CHECK_AND_RETURN_RET_LOGE(config->name != NULL, NULL, CONN_COMMON, "name is null"); ConnBytesDelivery *delivery = SoftBusCalloc(sizeof(ConnBytesDelivery)); - CONN_CHECK_AND_RETURN_RET_LOGE(delivery != NULL, NULL, CONN_COMMON, "create delivery item failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(delivery != NULL, NULL, CONN_COMMON, "create delivery item fail"); delivery->config = *config; delivery->queue = ConnCreateQueue(config->unitNum); if (delivery->queue == NULL) { - CONN_LOGE(CONN_COMMON, "create fair priority queue failed"); + CONN_LOGE(CONN_COMMON, "create fair priority queue fail"); SoftBusFree(delivery); return NULL; } int32_t ret = SoftBusMutexInit(&delivery->lock, NULL); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "init lock failed: error=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "init lock fail: error=%{public}d", ret); ConnDestroyQueue(delivery->queue); SoftBusFree(delivery); return NULL; @@ -112,7 +112,7 @@ static int32_t RetryDequeueExclusiveIfNeed( } code = SoftBusMutexLock(&delivery->lock); - CONN_CHECK_AND_RETURN_RET_LOGE(code == SOFTBUS_OK, code, CONN_COMMON, "%{public}s, lock failed: error=%{public}d", + CONN_CHECK_AND_RETURN_RET_LOGE(code == SOFTBUS_OK, code, CONN_COMMON, "%{public}s, lock fail: error=%{public}d", delivery->config.name, code); code = ConnDequeue(delivery->queue, (struct ConnQueueItem **)&out, 0); if (code == SOFTBUS_TIMOUT) { @@ -144,7 +144,7 @@ static void *DeliverTask(void *arg) continue; } if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "%{public}s, dequeue failed: error=%{public}d, retry %{public}d later", + CONN_LOGE(CONN_COMMON, "%{public}s, dequeue fail: error=%{public}d, retry %{public}d later", delivery->config.name, ret, delivery->config.errorRetryWaitMs); SoftBusSleepMs(delivery->config.errorRetryWaitMs); continue; @@ -161,7 +161,7 @@ static int32_t PullDeliverTaskIfNeed(ConnBytesDelivery *delivery) { int32_t ret = SoftBusMutexLock(&delivery->lock); CONN_CHECK_AND_RETURN_RET_LOGE( - ret == SOFTBUS_OK, ret, CONN_COMMON, "%{public}s, lock failed: error=%{public}d", delivery->config.name, ret); + ret == SOFTBUS_OK, ret, CONN_COMMON, "%{public}s, lock fail: error=%{public}d", delivery->config.name, ret); do { delivery->deliveryMessagePosting = true; if (delivery->deliveryTaskRunning) { @@ -170,7 +170,7 @@ static int32_t PullDeliverTaskIfNeed(ConnBytesDelivery *delivery) ret = ConnStartActionAsync(delivery, DeliverTask, delivery->config.name); if (ret != SOFTBUS_OK) { CONN_LOGE( - CONN_COMMON, "%{public}s, pull deliver task failed: error=%{public}d", delivery->config.name, ret); + CONN_COMMON, "%{public}s, pull deliver task fail: error=%{public}d", delivery->config.name, ret); break; } delivery->deliveryTaskRunning = true; @@ -184,7 +184,7 @@ void MarkPostMessageDone(ConnBytesDelivery *delivery) { int32_t ret = SoftBusMutexLock(&delivery->lock); CONN_CHECK_AND_RETURN_LOGE( - ret == SOFTBUS_OK, CONN_COMMON, "%{public}s, lock failed: error=%{public}d", delivery->config.name, ret); + ret == SOFTBUS_OK, CONN_COMMON, "%{public}s, lock fail: error=%{public}d", delivery->config.name, ret); delivery->deliveryMessagePosting = false; SoftBusMutexUnlock(&delivery->lock); } @@ -195,15 +195,15 @@ int32_t ConnDeliver(ConnBytesDelivery *delivery, uint32_t connectionId, uint8_t CONN_CHECK_AND_RETURN_RET_LOGE(delivery != NULL, SOFTBUS_INVALID_PARAM, CONN_COMMON, "delivery is null"); int32_t ret = PullDeliverTaskIfNeed(delivery); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_COMMON, - "%{public}s, pull deliver task failed ret=%{public}d", delivery->config.name, ret); + "%{public}s, pull deliver task fail ret=%{public}d", delivery->config.name, ret); struct ConnBytesDeliveryItem *item = ConnCreateBytesDeliveryItem(connectionId, data, length, addition); CONN_CHECK_AND_RETURN_RET_LOGE( - item != NULL, SOFTBUS_MALLOC_ERR, CONN_COMMON, "%{public}s, create queue item failed", delivery->config.name); + item != NULL, SOFTBUS_MALLOC_ERR, CONN_COMMON, "%{public}s, create queue item fail", delivery->config.name); ret = ConnEnqueue(delivery->queue, (struct ConnQueueItem *)item, delivery->config.waitTimeoutMs); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "%{public}s, enqueue item failed: error=%{public}d", delivery->config.name, ret); + CONN_LOGE(CONN_COMMON, "%{public}s, enqueue item fail: error=%{public}d", delivery->config.name, ret); ConnDestroyBytesDeliveryItem(item); } MarkPostMessageDone(delivery); @@ -216,7 +216,7 @@ bool ConnIsDeliveryTaskRunning(ConnBytesDelivery *delivery) int32_t code = SoftBusMutexLock(&delivery->lock); CONN_CHECK_AND_RETURN_RET_LOGE( - code == SOFTBUS_OK, false, CONN_TEST, "%{public}s, lock failed: error=%{public}d", delivery->config.name, code); + code == SOFTBUS_OK, false, CONN_TEST, "%{public}s, lock fail: error=%{public}d", delivery->config.name, code); bool running = delivery->deliveryTaskRunning; SoftBusMutexUnlock(&delivery->lock); return running; diff --git a/core/connection/common/src/softbus_conn_common.c b/core/connection/common/src/softbus_conn_common.c index a47429fc7a..4313ef04ba 100644 --- a/core/connection/common/src/softbus_conn_common.c +++ b/core/connection/common/src/softbus_conn_common.c @@ -99,7 +99,7 @@ int32_t ConnPostMsgToLooper( { SoftBusMessage *msg = (SoftBusMessage *)SoftBusCalloc(sizeof(SoftBusMessage)); CONN_CHECK_AND_RETURN_RET_LOGE(msg != NULL, SOFTBUS_MEM_ERR, CONN_COMMON, - "ATTENTION, calloc message object failed: what=%{public}d", what); + "ATTENTION, calloc message object fail: what=%{public}d", what); msg->what = what; msg->arg1 = arg1; msg->arg2 = arg2; @@ -161,7 +161,7 @@ static int32_t ConnectSoftBusCondWait(SoftBusCond *cond, SoftBusMutex *mutex, ui } SoftBusSysTime now; if (SoftBusGetTime(&now) != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "get time failed"); + CONN_LOGE(CONN_COMMON, "get time fail"); return SOFTBUS_CONN_GET_TIME_FAIL; } now.sec += (now.usec + ((int32_t)timeMillis * USECTONSEC)) / MICROSECONDS; diff --git a/core/connection/common/src/softbus_conn_fair_priority_queue.c b/core/connection/common/src/softbus_conn_fair_priority_queue.c index 84b952ea10..f27455b671 100644 --- a/core/connection/common/src/softbus_conn_fair_priority_queue.c +++ b/core/connection/common/src/softbus_conn_fair_priority_queue.c @@ -48,7 +48,7 @@ struct PriorityQueue { static struct PriorityQueue *CreatePriorityQueue(int32_t id, uint32_t size) { struct PriorityQueue *pq = SoftBusCalloc(sizeof(struct PriorityQueue)); - CONN_CHECK_AND_RETURN_RET_LOGE(pq != NULL, NULL, CONN_COMMON, "malloc failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(pq != NULL, NULL, CONN_COMMON, "malloc fail"); ListInit(&pq->node); pq->id = id; @@ -78,7 +78,7 @@ static LockFreeQueue *GetQueue(struct PriorityQueue *queue, ConnPriority priorit return lfq; } lfq = CreateQueue(queue->size); - CONN_CHECK_AND_RETURN_RET_LOGE(lfq != NULL, NULL, CONN_COMMON, "create queue failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(lfq != NULL, NULL, CONN_COMMON, "create queue fail"); queue->queue[priority] = lfq; return lfq; } @@ -88,7 +88,7 @@ static int32_t Enqueue(struct PriorityQueue *queue, struct ConnQueueItem *item) ConnPriority priority = item->priority; LockFreeQueue *lfq = GetQueue(queue, priority, true); CONN_CHECK_AND_RETURN_RET_LOGE(lfq != NULL, SOFTBUS_MALLOC_ERR, CONN_COMMON, - "get queue failed, id=%{public}d, priority=%{public}d", item->id, priority); + "get queue fail, id=%{public}d, priority=%{public}d", item->id, priority); int32_t ret = QueueMultiProducerEnqueue(lfq, item); return ret; } @@ -123,7 +123,7 @@ struct ConnFairPriorityQueue { ConnFairPriorityQueue *ConnCreateQueue(uint32_t size) { ConnFairPriorityQueue *queue = SoftBusCalloc(sizeof(ConnFairPriorityQueue)); - CONN_CHECK_AND_RETURN_RET_LOGE(queue != NULL, NULL, CONN_COMMON, "malloc failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(queue != NULL, NULL, CONN_COMMON, "malloc fail"); queue->size = size; SoftBusMutexAttr attr = { @@ -131,23 +131,23 @@ ConnFairPriorityQueue *ConnCreateQueue(uint32_t size) }; int32_t ret = SoftBusMutexInit(&queue->lock, &attr); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "init lock failed: error=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "init lock fail: error=%{public}d", ret); goto CLEANUP; } ret = SoftBusCondInit(&queue->dequeueCondition); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "init dequeue condition failed: error=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "init dequeue condition fail: error=%{public}d", ret); goto CLEANUP; } ret = SoftBusCondInit(&queue->enqueueCondition); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "init dequeue condition failed: error=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "init dequeue condition fail: error=%{public}d", ret); goto CLEANUP; } ListInit(&queue->queues); queue->innerQueue = CreatePriorityQueue(0, queue->size); if (queue->innerQueue == NULL) { - CONN_LOGE(CONN_COMMON, "create inner priority queue failed"); + CONN_LOGE(CONN_COMMON, "create inner priority queue fail"); goto CLEANUP; } return queue; @@ -191,7 +191,7 @@ static struct PriorityQueue *GetOrCreatePriorityQueue(ConnFairPriorityQueue *que } struct PriorityQueue *pq = CreatePriorityQueue(id, queue->size); - CONN_CHECK_AND_RETURN_RET_LOGE(pq != NULL, NULL, CONN_COMMON, "create priority queue failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(pq != NULL, NULL, CONN_COMMON, "create priority queue fail"); ListTailInsert(&queue->queues, &pq->node); return pq; } @@ -203,7 +203,7 @@ static int32_t WaitCondition(SoftBusCond *condition, SoftBusMutex *mutex, int32_ } SoftBusSysTime now = { 0 }; int32_t ret = SoftBusGetTime(&now); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_COMMON, "get time failed: error=%{public}d", ret); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_COMMON, "get time fail: error=%{public}d", ret); int64_t us = timeoutMs * FACTOR_S_MS_US + now.usec; now.sec += us / (FACTOR_S_MS_US * FACTOR_S_MS_US); @@ -217,14 +217,14 @@ int32_t ConnEnqueue(ConnFairPriorityQueue *queue, struct ConnQueueItem *item, in CONN_CHECK_AND_RETURN_RET_LOGW(item != NULL, SOFTBUS_INVALID_PARAM, CONN_COMMON, "item is null"); int32_t code = SoftBusMutexLock(&queue->lock); - CONN_CHECK_AND_RETURN_RET_LOGW(code == SOFTBUS_OK, code, CONN_COMMON, "lock queue failed: error=%{public}d", code); + CONN_CHECK_AND_RETURN_RET_LOGW(code == SOFTBUS_OK, code, CONN_COMMON, "lock queue fail: error=%{public}d", code); bool afterWait = false; do { struct PriorityQueue *pq = GetOrCreatePriorityQueue(queue, item->id); if (pq == NULL) { code = SOFTBUS_MALLOC_ERR; CONN_LOGE(CONN_COMMON, - "enqueue failed: get queue failed, id=%{public}d, priority=%{public}d, error=%{public}d", item->id, + "enqueue fail: get queue fail, id=%{public}d, priority=%{public}d, error=%{public}d", item->id, item->priority, code); break; } @@ -233,7 +233,7 @@ int32_t ConnEnqueue(ConnFairPriorityQueue *queue, struct ConnQueueItem *item, in break; } if (code != QUEUE_FULL) { - CONN_LOGE(CONN_COMMON, "enqueue failed: id=%{public}d, priority=%{public}d, error=%{public}d", item->id, + CONN_LOGE(CONN_COMMON, "enqueue fail: id=%{public}d, priority=%{public}d, error=%{public}d", item->id, item->priority, code); break; } @@ -246,7 +246,7 @@ int32_t ConnEnqueue(ConnFairPriorityQueue *queue, struct ConnQueueItem *item, in code = WaitCondition(&queue->enqueueCondition, &queue->lock, timeoutMs); if (code != SOFTBUS_OK) { CONN_LOGE(CONN_COMMON, - "wait enqueue condition failed: id=%{public}d, priority=%{public}d, error=%{public}d", item->id, + "wait enqueue condition fail: id=%{public}d, priority=%{public}d, error=%{public}d", item->id, item->priority, code); break; } @@ -263,7 +263,7 @@ static int32_t DequeueInner(ConnFairPriorityQueue *queue, ConnPriority least, st { int32_t ret = Dequeue(queue->innerQueue, least, outMsg); if (ret != SOFTBUS_OK && ret != QUEUE_EMPTY) { - CONN_LOGE(CONN_COMMON, "get item from inner queue failed: error=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "get item from inner queue fail: error=%{public}d", ret); } return ret; } @@ -281,7 +281,7 @@ static int32_t DequeueFairly(ConnFairPriorityQueue *queue, struct ConnQueueItem } ListTailInsert(&queue->queues, &it->node); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "get item from queue failed: pid=%{public}d, error=%{public}d", it->id, ret); + CONN_LOGE(CONN_COMMON, "get item from queue fail: pid=%{public}d, error=%{public}d", it->id, ret); } return ret; } @@ -294,7 +294,7 @@ int32_t ConnDequeue(ConnFairPriorityQueue *queue, struct ConnQueueItem **outMsg, CONN_CHECK_AND_RETURN_RET_LOGW(outMsg != NULL, SOFTBUS_INVALID_PARAM, CONN_COMMON, "out item is null"); int32_t code = SoftBusMutexLock(&queue->lock); - CONN_CHECK_AND_RETURN_RET_LOGW(code == SOFTBUS_OK, code, CONN_COMMON, "lock queue failed: error=%{public}d", code); + CONN_CHECK_AND_RETURN_RET_LOGW(code == SOFTBUS_OK, code, CONN_COMMON, "lock queue fail: error=%{public}d", code); bool afterWait = false; do { code = DequeueInner(queue, CONN_PRIORITY_MIDDLE, outMsg); @@ -321,7 +321,7 @@ int32_t ConnDequeue(ConnFairPriorityQueue *queue, struct ConnQueueItem **outMsg, break; } if (code != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "wait dequeue condition failed: error=%{public}d", code); + CONN_LOGE(CONN_COMMON, "wait dequeue condition fail: error=%{public}d", code); break; } afterWait = true; diff --git a/core/connection/common/src/softbus_epoll_event_implement.c b/core/connection/common/src/softbus_epoll_event_implement.c index 1b55647edc..f4b47f0577 100644 --- a/core/connection/common/src/softbus_epoll_event_implement.c +++ b/core/connection/common/src/softbus_epoll_event_implement.c @@ -34,7 +34,7 @@ static int32_t SoftBusSocketEpollCreate(void) { int32_t ret = epoll_create(0); if (ret < 0) { - CONN_LOGE(CONN_COMMON, "epoll create failed errno=%{public}s, ret=%{public}d", strerror(errno), ret); + CONN_LOGE(CONN_COMMON, "epoll create fail errno=%{public}s, ret=%{public}d", strerror(errno), ret); return SOFTBUS_ERRNO(KERNELS_SUB_MODULE_CODE) + abs(errno); } @@ -45,7 +45,7 @@ static int32_t SoftBusSocketEpollCtl(int32_t fd, int32_t op, int32_t fd2, struct { int32_t ret = epoll_ctl(fd, op, fd2, ev); if (ret < 0) { - CONN_LOGE(CONN_COMMON, "epoll ctl failed errno=%{public}s, ret=%{public}d", strerror(errno), ret); + CONN_LOGE(CONN_COMMON, "epoll ctl fail errno=%{public}s, ret=%{public}d", strerror(errno), ret); return SOFTBUS_ERRNO(KERNELS_SUB_MODULE_CODE) + abs(errno); } @@ -56,7 +56,7 @@ static int32_t SoftBusSocketEpollWait(int32_t fd, struct epoll_event *ev, int32_ { int32_t ret = epoll_wait(fd, ev, cnt, timeoutMs); if (ret < 0) { - CONN_LOGE(CONN_COMMON, "epoll wait failed errno=%{public}s, ret=%{public}d", strerror(errno), ret); + CONN_LOGE(CONN_COMMON, "epoll wait fail errno=%{public}s, ret=%{public}d", strerror(errno), ret); if (errno == EINTR) { return SOFTBUS_ADAPTER_SOCKET_EINTR; } @@ -70,7 +70,7 @@ EventWatcher* RegisterEventWatcher(GetAllFdEventCallback callback) { (void)callback; EventWatcher *watcher = (EventWatcher *)SoftBusCalloc(sizeof(EventWatcher)); - CONN_CHECK_AND_RETURN_RET_LOGE(watcher != NULL, NULL, CONN_COMMON, "calloc event watcher failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(watcher != NULL, NULL, CONN_COMMON, "calloc event watcher fail"); int32_t watcherId = SoftBusSocketEpollCreate(); if (watcherId < 0) { SoftBusFree(watcher); @@ -148,7 +148,7 @@ static void SetReadyFdEvent(struct epoll_event *events, int32_t nEvents, ListNod for (int32_t i = 0; i < nEvents; i++) { struct FdNode *fdNode = (struct FdNode *)SoftBusCalloc(sizeof(struct FdNode)); if (fdNode == NULL) { - CONN_LOGE(CONN_COMMON, "calloc fd node failed, fd=%{public}d", events[i].data.fd); + CONN_LOGE(CONN_COMMON, "calloc fd node fail, fd=%{public}d", events[i].data.fd); continue; } ListInit(&fdNode->node); @@ -167,7 +167,7 @@ int32_t WatchEvent(EventWatcher *watcher, int32_t timeoutMS, ListNode *out) CONN_LOGI(CONN_COMMON, "epoll wait start"); int32_t nEvents = SoftBusSocketEpollWait(watcher->watcherId, events, SOFTBUS_FD_EVENT, timeoutMS); CONN_CHECK_AND_RETURN_RET_LOGW(nEvents > 0, nEvents, CONN_COMMON, - "epoll wait failed or not exist ready event, status=%{public}d", nEvents); + "epoll wait fail or not exist ready event, status=%{public}d", nEvents); SetReadyFdEvent(events, nEvents, out); return nEvents; } @@ -185,10 +185,10 @@ void CloseEventWatcher(EventWatcher *watcher) static int32_t WaitEpollReadyEvent(struct epoll_event fdEvent, int32_t fd, int32_t timeoutMs) { int32_t epollFd = SoftBusSocketEpollCreate(); - CONN_CHECK_AND_RETURN_RET_LOGE(epollFd >= 0, epollFd, CONN_COMMON, "create epollFd failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(epollFd >= 0, epollFd, CONN_COMMON, "create epollFd fail"); int32_t ret = SoftBusSocketEpollCtl(epollFd, EPOLL_CTL_ADD, fd, &fdEvent); if (ret < 0) { - CONN_LOGE(CONN_COMMON, "add epoll event failed"); + CONN_LOGE(CONN_COMMON, "add epoll event fail"); SoftBusSocketClose(epollFd); return ret; } diff --git a/core/connection/common/src/softbus_htp_socket.c b/core/connection/common/src/softbus_htp_socket.c index c94ce7d800..2a0b82e13d 100644 --- a/core/connection/common/src/softbus_htp_socket.c +++ b/core/connection/common/src/softbus_htp_socket.c @@ -51,7 +51,7 @@ static int32_t HtpConnect(int32_t fd, const char *mac, uint16_t port) SoftBusSockAddrHtp htpAddr; int32_t ret = MacToHtpAddr(mac, &htpAddr, port); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "convert mac to htp address failed, ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "convert mac to htp address fail, ret=%{public}d", ret); return ret; } return SOFTBUS_TEMP_FAILURE_RETRY( @@ -63,7 +63,7 @@ static int32_t BindLocalMac(int32_t fd, const char *mac, uint16_t port) SoftBusSockAddrHtp htpAddr; int32_t ret = MacToHtpAddr(mac, &htpAddr, port); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "convert mac to htp address failed, ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "convert mac to htp address fail, ret=%{public}d", ret); return ret; } return SOFTBUS_TEMP_FAILURE_RETRY(SoftBusSocketBind(fd, (SoftBusSockAddr *)&htpAddr, sizeof(SoftBusSockAddrHtp))); @@ -74,7 +74,7 @@ static int32_t GetHtpSockPort(int32_t fd) SoftBusSockAddr addr; int32_t rc = SoftBusSocketGetLocalName(fd, &addr); if (rc != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "get mintp sock port failed. rc=%{public}d, fd=%{public}d", rc, fd); + CONN_LOGE(CONN_COMMON, "get mintp sock port fail. rc=%{public}d, fd=%{public}d", rc, fd); return rc; } if (addr.saFamily == SOFTBUS_AF_INET6) { @@ -105,12 +105,12 @@ static int32_t OpenHtpClientSocket(const ConnectOption *option, const char *myIp int32_t fd = -1; int32_t ret = SoftBusSocketCreate(domain, SOFTBUS_SOCK_DGRAM, IPPROTO_HTP, &fd); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "create htp socket failed. serverMac=%{public}s, serverPort=%{public}d, ret=%{public}d", + CONN_LOGE(CONN_COMMON, "create htp socket fail. serverMac=%{public}s, serverPort=%{public}d, ret=%{public}d", AnonymizeWrapper(animizedMac), option->socketOption.port, ret); return ret; } if (isNonBlock && ConnToggleNonBlockMode(fd, true) != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "set nonblock mode failed. serverMac=%{public}s, serverPort=%{public}d", + CONN_LOGE(CONN_COMMON, "set nonblock mode fail. serverMac=%{public}s, serverPort=%{public}d", AnonymizeWrapper(animizedMac), option->socketOption.port); ConnShutdownSocket(fd); return SOFTBUS_SOCKET_ERR; @@ -118,7 +118,7 @@ static int32_t OpenHtpClientSocket(const ConnectOption *option, const char *myIp SetClientOption(fd); ret = BindLocalMac(fd, option->socketOption.localMac, 0); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "bind client address failed. ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "bind client address fail. ret=%{public}d", ret); ConnShutdownSocket(fd); return ret; } @@ -126,7 +126,7 @@ static int32_t OpenHtpClientSocket(const ConnectOption *option, const char *myIp ret = HtpConnect(fd, option->socketOption.remoteMac, option->socketOption.port); if ((ret != SOFTBUS_ADAPTER_OK) && (ret != SOFTBUS_ADAPTER_SOCKET_EINPROGRESS) && (ret != SOFTBUS_ADAPTER_SOCKET_EAGAIN)) { - CONN_LOGE(CONN_COMMON, "connect htp failed. serverMac=%{public}s, serverPort=%{public}d, ret=%{public}d", + CONN_LOGE(CONN_COMMON, "connect htp fail. serverMac=%{public}s, serverPort=%{public}d, ret=%{public}d", AnonymizeWrapper(animizedMac), option->socketOption.port, ret); ConnShutdownSocket(fd); return SOFTBUS_SOCKET_ERR; @@ -155,13 +155,13 @@ static int32_t OpenHtpServerSocket(const LocalListenerInfo *option) int32_t ret = SoftBusSocketCreate( domain, SOFTBUS_SOCK_DGRAM | SOFTBUS_SOCK_CLOEXEC | SOFTBUS_SOCK_NONBLOCK, IPPROTO_HTP, &fd); if (ret != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "create htp socket failed. ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "create htp socket fail. ret=%{public}d", ret); return ret; } SetServerOption(fd); ret = BindLocalMac(fd, option->socketOption.localMac, 0); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "bind client address failed. ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "bind client address fail. ret=%{public}d", ret); ConnShutdownSocket(fd); return ret; } @@ -178,7 +178,7 @@ static int32_t AcceptHtpClient(int32_t fd, ConnectOption *clientAddr, int32_t *c (void)memset_s(&addr, sizeof(addr), 0, sizeof(addr)); int32_t ret = SOFTBUS_TEMP_FAILURE_RETRY(SoftBusSocketAccept(fd, &addr, cfd)); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "htp accept failed. ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "htp accept fail. ret=%{public}d", ret); return ret; } clientAddr->type = CONNECT_HML; @@ -188,7 +188,7 @@ static int32_t AcceptHtpClient(int32_t fd, ConnectOption *clientAddr, int32_t *c ret = snprintf_s(clientAddr->socketOption.addr, sizeof(clientAddr->socketOption.addr), MAC_MAX_LEN, "%02X:%02X:%02X:%02X:%02X:%02X", mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]); if (ret < 0 || ret >= MAC_MAX_LEN) { - CONN_LOGE(CONN_COMMON, "snprintf_s failed. ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "snprintf_s fail. ret=%{public}d", ret); return SOFTBUS_STRCPY_ERR; } for (uint32_t i = 0; i < strlen(clientAddr->socketOption.addr); i++) { diff --git a/core/connection/common/src/softbus_mintp_socket.c b/core/connection/common/src/softbus_mintp_socket.c index 7de7c66e7a..44bade6dcb 100644 --- a/core/connection/common/src/softbus_mintp_socket.c +++ b/core/connection/common/src/softbus_mintp_socket.c @@ -68,7 +68,7 @@ int32_t SetMintpSocketMsgSize(int32_t fd) int32_t msgSize = MTP_SOCKET_MSG_SIZE; int32_t rc = SoftBusSocketSetOpt(fd, SOL_MTP, MTP_MAX_MSG_SIZE, &msgSize, sizeof(msgSize)); if (rc != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "set MTP_MAX_MSG_SIZE failed. rc=%{public}d, errno=%{public}d", rc, errno); + CONN_LOGE(CONN_COMMON, "set MTP_MAX_MSG_SIZE fail. rc=%{public}d, errno=%{public}d", rc, errno); return rc; } return SOFTBUS_OK; @@ -78,7 +78,7 @@ int32_t SetMintpSocketTos(int32_t fd, uint32_t tos) { int32_t rc = SoftBusSocketSetOpt(fd, SOL_MTP, MTP_TOS, &tos, sizeof(tos)); if (rc != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "set mintp tos failed. fd=%{public}d", fd); + CONN_LOGE(CONN_COMMON, "set mintp tos fail. fd=%{public}d", fd); return rc; } return SOFTBUS_OK; @@ -88,7 +88,7 @@ int32_t SetMintpSocketTransType(int32_t fd, uint32_t transType) { int32_t rc = SoftBusSocketSetOpt(fd, SOL_MTP, MTP_TRANS_TYPE, &transType, sizeof(transType)); if (rc != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "set mintp trans type failed. fd=%{public}d", fd); + CONN_LOGE(CONN_COMMON, "set mintp trans type fail. fd=%{public}d", fd); return rc; } return SOFTBUS_OK; @@ -102,7 +102,7 @@ int32_t SetMintpSocketKeepAlive(int32_t fd, int32_t timeoutMs) } int32_t rc = SoftBusSocketSetOpt(fd, SOL_MTP, MTP_KEEPIDLE, &timeoutMs, sizeof(timeoutMs)); if (rc != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "set mintp keep idle failed. fd=%{public}d", fd); + CONN_LOGE(CONN_COMMON, "set mintp keep idle fail. fd=%{public}d", fd); return rc; } return SOFTBUS_OK; @@ -116,7 +116,7 @@ int32_t SetMintpSocketTimeSync(int32_t fd, MintpTimeSync *timeSync) } int32_t rc = SoftBusSocketSetOpt(fd, SOL_MTP, MTP_TIME_SYNC, timeSync, sizeof(MintpTimeSync)); if (rc != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "set mintp time sync failed. fd=%{public}d", fd); + CONN_LOGE(CONN_COMMON, "set mintp time sync fail. fd=%{public}d", fd); return rc; } return SOFTBUS_OK; @@ -141,20 +141,20 @@ static int32_t BindMintp(int32_t domain, int32_t fd, const char *localIp) if (isIpv4) { int32_t rc = SoftBusInetPtoN(SOFTBUS_AF_INET, localIp, &tmpAddr.ip.addr); if (rc != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "ipv4 SoftBusInetPtoN failed. rc=%{public}d", rc); + CONN_LOGE(CONN_COMMON, "ipv4 SoftBusInetPtoN fail. rc=%{public}d", rc); return SOFTBUS_SOCKET_ADDR_ERR; } } else { int32_t rc = SoftBusInetPtoN(SOFTBUS_AF_INET6, localIp, &tmpAddr.ip6.addr); if (rc != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "ipv6 SoftBusInetPtoN failed. rc=%{public}d", rc); + CONN_LOGE(CONN_COMMON, "ipv6 SoftBusInetPtoN fail. rc=%{public}d", rc); return SOFTBUS_SOCKET_ADDR_ERR; } } addrLen = isIpv4 ? sizeof(SoftBusSockAddrIn) : sizeof(tmpAddr); int32_t ret = bind(fd, (struct sockaddr *)&tmpAddr, addrLen); if (ret != 0) { - CONN_LOGE(CONN_COMMON, "bind mintp failed. ret=%{public}d, errno=%{public}d(%{public}s)", ret, errno, + CONN_LOGE(CONN_COMMON, "bind mintp fail. ret=%{public}d, errno=%{public}d(%{public}s)", ret, errno, strerror(errno)); return SOFTBUS_SOCKET_BIND_ERR; } @@ -178,12 +178,12 @@ static int32_t OpenMintpServerSocket(const LocalListenerInfo *option) int32_t domain = GetDomainByAddr(option->socketOption.addr); int32_t ret = SoftBusSocketCreate(domain, SOFTBUS_SOCK_DGRAM | SOFTBUS_SOCK_NONBLOCK, IPPROTO_MINTP, &fd); if (ret != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "create mintp socket failed. ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "create mintp socket fail. ret=%{public}d", ret); return ret; } ret = BindMintp(domain, fd, option->socketOption.addr); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "bind mintp failed. ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "bind mintp fail. ret=%{public}d", ret); ConnShutdownSocket(fd); return ret; } @@ -201,13 +201,13 @@ static int32_t MintpSocketConnect(int32_t fd, int32_t domain, const ConnectOptio if (domain == SOFTBUS_AF_INET) { int32_t rc = SoftBusInetPtoN(SOFTBUS_AF_INET, option->socketOption.addr, &tmpAddr.ip.addr); if (rc != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "ipv4 SoftBusInetPtoN failed. rc=%{public}d", rc); + CONN_LOGE(CONN_COMMON, "ipv4 SoftBusInetPtoN fail. rc=%{public}d", rc); return rc; } } else { int32_t rc = SoftBusInetPtoN(SOFTBUS_AF_INET6, option->socketOption.addr, &tmpAddr.ip6.addr); if (rc != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "ipv6 SoftBusInetPtoN failed. rc=%{public}d", rc); + CONN_LOGE(CONN_COMMON, "ipv6 SoftBusInetPtoN fail. rc=%{public}d", rc); return rc; } } @@ -235,19 +235,19 @@ static int32_t OpenMintpClientSocket(const ConnectOption *option, const char *my int32_t domain = GetDomainByAddr(option->socketOption.addr); int32_t ret = SoftBusSocketCreate(domain, SOFTBUS_SOCK_DGRAM, IPPROTO_MINTP, &fd); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "create mintp socket failed. serverIp=%{public}s, serverPort=%{public}d, ret=%{public}d", + CONN_LOGE(CONN_COMMON, "create mintp socket fail. serverIp=%{public}s, serverPort=%{public}d, ret=%{public}d", animizedIp, option->socketOption.port, ret); return ret; } if (isNonBlock && ConnToggleNonBlockMode(fd, true) != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "set nonblock mode failed. serverIp=%{public}s, serverPort=%{public}d", animizedIp, + CONN_LOGE(CONN_COMMON, "set nonblock mode fail. serverIp=%{public}s, serverPort=%{public}d", animizedIp, option->socketOption.port); ConnShutdownSocket(fd); return SOFTBUS_SOCKET_ERR; } ret = BindMintp(domain, fd, myIp); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "bind mintp failed. ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "bind mintp fail. ret=%{public}d", ret); ConnShutdownSocket(fd); return ret; } @@ -255,7 +255,7 @@ static int32_t OpenMintpClientSocket(const ConnectOption *option, const char *my ret = MintpSocketConnect(fd, domain, option); if ((ret != SOFTBUS_ADAPTER_OK) && (ret != SOFTBUS_ADAPTER_SOCKET_EINPROGRESS) && (ret != SOFTBUS_ADAPTER_SOCKET_EAGAIN)) { - CONN_LOGE(CONN_COMMON, "connect mintp failed. serverIp=%{public}s, serverPort=%{public}d, ret=%{public}d", + CONN_LOGE(CONN_COMMON, "connect mintp fail. serverIp=%{public}s, serverPort=%{public}d, ret=%{public}d", animizedIp, option->socketOption.port, ret); ConnShutdownSocket(fd); return SOFTBUS_SOCKET_ERR; @@ -270,7 +270,7 @@ int32_t GetMintpSockPort(int32_t fd) SoftBusSockAddr addr; int32_t rc = SoftBusSocketGetLocalName(fd, &addr); if (rc != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "get mintp sock port failed. rc=%{public}d, fd=%{public}d", rc, fd); + CONN_LOGE(CONN_COMMON, "get mintp sock port fail. rc=%{public}d, fd=%{public}d", rc, fd); return rc; } if (addr.saFamily == SOFTBUS_AF_INET6) { @@ -289,7 +289,7 @@ static int32_t AcceptMintpClient(int32_t fd, ConnectOption *clientAddr, int32_t (void)memset_s(&mtpClientAddr, addrLen, 0, addrLen); int32_t ret = SOFTBUS_TEMP_FAILURE_RETRY(SoftBusSocketAccept(fd, (SoftBusSockAddr *)&mtpClientAddr, cfd)); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "accept mintp client failed. ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "accept mintp client fail. ret=%{public}d", ret); return ret; } clientAddr->type = CONNECT_HML; @@ -298,12 +298,12 @@ static int32_t AcceptMintpClient(int32_t fd, ConnectOption *clientAddr, int32_t char mtpMac[BT_MAC_LEN] = { 0 }; ret = ConvertBtMacToStr(mtpMac, sizeof(mtpMac), mtpClientAddr.mac.addr, sizeof(mtpClientAddr.mac.addr)); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "convert mintp mac to string failed. ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "convert mintp mac to string fail. ret=%{public}d", ret); return ret; } ret = strcpy_s(clientAddr->socketOption.addr, sizeof(clientAddr->socketOption.addr), mtpMac); if (ret != EOK) { - CONN_LOGE(CONN_COMMON, "copy mintp mac to clientAddr failed. ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "copy mintp mac to clientAddr fail. ret=%{public}d", ret); return SOFTBUS_ERR; } CONN_LOGI(CONN_COMMON, "accept mintp client success, cfd=%{public}d", *cfd); diff --git a/core/connection/common/src/softbus_rc_collection.c b/core/connection/common/src/softbus_rc_collection.c index 4d08d1f04e..ba5fac889c 100644 --- a/core/connection/common/src/softbus_rc_collection.c +++ b/core/connection/common/src/softbus_rc_collection.c @@ -49,7 +49,7 @@ int32_t SoftBusRcSave(SoftBusRcCollection *collection, SoftBusRcObject *object) SoftBusList *objects = collection->objects; int32_t code = SoftBusMutexLock(&objects->lock); COMM_CHECK_AND_RETURN_RET_LOGE( - code == SOFTBUS_OK, code, COMM_UTILS, "%{public}s, lock failed: error=%{public}d", collection->name, code); + code == SOFTBUS_OK, code, COMM_UTILS, "%{public}s, lock fail: error=%{public}d", collection->name, code); if (collection->idGenerator != NULL) { uint32_t id = AllocateUniqueIdUnsafe(collection, object, UINT16_MAX); @@ -62,7 +62,7 @@ int32_t SoftBusRcSave(SoftBusRcCollection *collection, SoftBusRcObject *object) } code = object->Reference(object); if (code != SOFTBUS_OK) { - COMM_LOGW(COMM_UTILS, "%{public}s, reference object failed: error=%{public}d", collection->name, code); + COMM_LOGW(COMM_UTILS, "%{public}s, reference object fail: error=%{public}d", collection->name, code); SoftBusMutexUnlock(&objects->lock); return code; } @@ -81,7 +81,7 @@ SoftBusRcObject *SoftBusRcGetCommon(SoftBusRcCollection *collection, SoftBusRcOb SoftBusList *objects = collection->objects; int32_t code = SoftBusMutexLock(&objects->lock); COMM_CHECK_AND_RETURN_RET_LOGE( - code == SOFTBUS_OK, NULL, COMM_UTILS, "%{public}s, lock failed: error=%{public}d", collection->name, code); + code == SOFTBUS_OK, NULL, COMM_UTILS, "%{public}s, lock fail: error=%{public}d", collection->name, code); SoftBusRcObject *it = NULL; LIST_FOR_EACH_ENTRY(it, &objects->list, SoftBusRcObject, node) { @@ -91,7 +91,7 @@ SoftBusRcObject *SoftBusRcGetCommon(SoftBusRcCollection *collection, SoftBusRcOb code = it->Reference(it); SoftBusMutexUnlock(&objects->lock); if (code != SOFTBUS_OK) { - COMM_LOGW(COMM_UTILS, "%{public}s, reference object failed: object id=%{public}d, error=%{public}d", + COMM_LOGW(COMM_UTILS, "%{public}s, reference object fail: object id=%{public}d, error=%{public}d", collection->name, it->id, code); return NULL; } @@ -126,7 +126,7 @@ void SoftBusRcRemove(SoftBusRcCollection *collection, SoftBusRcObject *object) SoftBusList *objects = collection->objects; int32_t code = SoftBusMutexLock(&objects->lock); COMM_CHECK_AND_RETURN_LOGE( - code == SOFTBUS_OK, COMM_UTILS, "%{public}s, lock failed: error=%{public}d", collection->name, code); + code == SOFTBUS_OK, COMM_UTILS, "%{public}s, lock fail: error=%{public}d", collection->name, code); SoftBusRcObject *exist = SoftBusRcGetCommon(collection, PointerMatcher, object); if (exist == NULL) { COMM_LOGW(COMM_UTILS, "%{public}s, object not found: object id=%{public}d", collection->name, object->id); @@ -150,7 +150,7 @@ int32_t SoftBusRcCollectionConstruct(const char *name, SoftBusRcCollection *coll // generator is nullable SoftBusList *objects = CreateSoftBusList(); - COMM_CHECK_AND_RETURN_RET_LOGE(objects, SOFTBUS_MALLOC_ERR, COMM_UTILS, "create list failed"); + COMM_CHECK_AND_RETURN_RET_LOGE(objects, SOFTBUS_MALLOC_ERR, COMM_UTILS, "create list fail"); collection->objects = objects; collection->idGenerator = generator; collection->name = name; @@ -167,7 +167,7 @@ void SoftBusRcCollectionDestruct(SoftBusRcCollection *collection) SoftBusRcObject *next = NULL; int32_t code = SoftBusMutexLock(&objects->lock); COMM_CHECK_AND_RETURN_LOGE( - code == SOFTBUS_OK, COMM_UTILS, "%{public}s, lock failed: error=%{public}d", collection->name, code); + code == SOFTBUS_OK, COMM_UTILS, "%{public}s, lock fail: error=%{public}d", collection->name, code); LIST_FOR_EACH_ENTRY_SAFE(it, next, &objects->list, SoftBusRcObject, node) { COMM_LOGW(COMM_UTILS, "%{public}s, object still in collection, remove it before destructing: object id=%{public}d", diff --git a/core/connection/common/src/softbus_rc_object.c b/core/connection/common/src/softbus_rc_object.c index f0089301ec..d2711c5568 100755 --- a/core/connection/common/src/softbus_rc_object.c +++ b/core/connection/common/src/softbus_rc_object.c @@ -34,7 +34,7 @@ int32_t Reference(SoftBusRcObject *object) int32_t ret = Lock(object); COMM_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, COMM_UTILS, - "%{public}s lock failed: id=%{public}d, error=%{public}d", object->name, object->id, ret); + "%{public}s lock fail: id=%{public}d, error=%{public}d", object->name, object->id, ret); object->objectRc += 1; Unlock(object); return SOFTBUS_OK; @@ -47,7 +47,7 @@ void Deference(SoftBusRcObject **ptr) COMM_CHECK_AND_RETURN_LOGE(object != NULL, COMM_UTILS, "object is null"); int32_t ret = Lock(object); - COMM_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, COMM_UTILS, "%{public}s lock failed: id=%{public}d, error=%{public}d", + COMM_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, COMM_UTILS, "%{public}s lock fail: id=%{public}d, error=%{public}d", object->name, object->id, ret); object->objectRc -= 1; int32_t remain = object->objectRc; @@ -75,7 +75,7 @@ int32_t SoftBusRcObjectConstruct(const char *name, SoftBusRcObject *object, Soft }; int32_t ret = SoftBusMutexInit(&object->mutex, &attr); COMM_CHECK_AND_RETURN_RET_LOGE( - ret == SOFTBUS_OK, ret, COMM_UTILS, "%{public}s init lock failed: error=%{public}d", name, ret); + ret == SOFTBUS_OK, ret, COMM_UTILS, "%{public}s init lock fail: error=%{public}d", name, ret); // assigned 1, as object is referenced by local construct progress object->objectRc = 1; object->freehook = hook; diff --git a/core/connection/common/src/softbus_select_event_implement.c b/core/connection/common/src/softbus_select_event_implement.c index fb9dcd4253..0a48183d14 100644 --- a/core/connection/common/src/softbus_select_event_implement.c +++ b/core/connection/common/src/softbus_select_event_implement.c @@ -40,7 +40,7 @@ EventWatcher* RegisterEventWatcher(GetAllFdEventCallback callback) { CONN_CHECK_AND_RETURN_RET_LOGE(callback != NULL, NULL, CONN_COMMON, "callback is NULL"); EventWatcher *watcher = (EventWatcher *)SoftBusCalloc(sizeof(EventWatcher)); - CONN_CHECK_AND_RETURN_RET_LOGE(watcher != NULL, NULL, CONN_COMMON, "malloc eventWatcher failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(watcher != NULL, NULL, CONN_COMMON, "malloc eventWatcher fail"); watcher->callback = callback; CONN_LOGI(CONN_COMMON, "register event watcher success"); return watcher; @@ -127,7 +127,7 @@ int32_t WatchEvent(EventWatcher *watcher, int32_t timeoutMS, ListNode *out) ListNode fdHeadNode; ListInit(&fdHeadNode); int32_t status = watcher->callback(&fdHeadNode); - CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, status, CONN_COMMON, "get all fd event failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, status, CONN_COMMON, "get all fd event fail"); SoftBusFdSets fdSets = {0}; int32_t maxFd = PrepareFdSets(&fdHeadNode, &fdSets); @@ -136,7 +136,7 @@ int32_t WatchEvent(EventWatcher *watcher, int32_t timeoutMS, ListNode *out) CONN_LOGI(CONN_COMMON, "select start"); int32_t nEvents = SoftBusSocketSelect(maxFd + 1, &fdSets.readSet, &fdSets.writeSet, &fdSets.exceptSet, &timeout); if (nEvents <= 0) { - CONN_LOGE(CONN_COMMON, "epoll wait failed or not exist ready event, status=%{public}d", nEvents); + CONN_LOGE(CONN_COMMON, "epoll wait fail or not exist ready event, status=%{public}d", nEvents); ReleaseFdNode(&fdHeadNode); return nEvents; } diff --git a/core/connection/common/src/softbus_socket.c b/core/connection/common/src/softbus_socket.c index f0a185a303..5c79107b6d 100644 --- a/core/connection/common/src/softbus_socket.c +++ b/core/connection/common/src/softbus_socket.c @@ -50,7 +50,7 @@ int32_t RegistSocketProtocol(const SocketInterface *interface) } int ret = SoftBusMutexLock(&g_socketsMutex); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "get lock failed! ret=%{public}" PRId32, ret); + CONN_LOGE(CONN_COMMON, "get lock fail! ret=%{public}" PRId32, ret); return ret; } @@ -73,7 +73,7 @@ const SocketInterface *GetSocketInterface(ProtocolType protocolType) { int ret = SoftBusMutexLock(&g_socketsMutex); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "get lock failed! ret=%{public}" PRId32, ret); + CONN_LOGE(CONN_COMMON, "get lock fail! ret=%{public}" PRId32, ret); return NULL; } const SocketInterface *result = NULL; @@ -98,7 +98,7 @@ int32_t ConnInitSockets(void) { int32_t ret = SoftBusMutexInit(&g_socketsMutex, NULL); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_INIT, "init mutex failed! ret=%{public}" PRId32, ret); + CONN_LOGE(CONN_INIT, "init mutex fail! ret=%{public}" PRId32, ret); return ret; } @@ -106,7 +106,7 @@ int32_t ConnInitSockets(void) ret = RegistSocketProtocol(GetTcpProtocol()); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_INIT, "regist tcp failed!! ret=%{public}" PRId32, ret); + CONN_LOGE(CONN_INIT, "regist tcp fail!! ret=%{public}" PRId32, ret); (void)SoftBusMutexDestroy(&g_socketsMutex); return ret; } @@ -114,14 +114,14 @@ int32_t ConnInitSockets(void) ret = RegistNewIpSocket(); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_INIT, "regist newip failed!! ret=%{public}" PRId32, ret); + CONN_LOGE(CONN_INIT, "regist newip fail!! ret=%{public}" PRId32, ret); (void)SoftBusMutexDestroy(&g_socketsMutex); return ret; } ret = RegistSocketProtocol(GetUsbProtocol()); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_INIT, "regist usb failed!! ret=%{public}" PRId32, ret); + CONN_LOGE(CONN_INIT, "regist usb fail!! ret=%{public}" PRId32, ret); (void)SoftBusMutexDestroy(&g_socketsMutex); return ret; } @@ -129,7 +129,7 @@ int32_t ConnInitSockets(void) ret = RegistSocketProtocol(GetMintpProtocol()); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_INIT, "regist mintp failed!! ret=%{public}" PRId32, ret); + CONN_LOGE(CONN_INIT, "regist mintp fail!! ret=%{public}" PRId32, ret); (void)SoftBusMutexDestroy(&g_socketsMutex); return ret; } @@ -137,7 +137,7 @@ int32_t ConnInitSockets(void) ret = RegistSocketProtocol(GetHtpProtocol()); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_INIT, "regist htp failed!! ret=%{public}" PRId32, ret); + CONN_LOGE(CONN_INIT, "regist htp fail!! ret=%{public}" PRId32, ret); (void)SoftBusMutexDestroy(&g_socketsMutex); return ret; } @@ -170,7 +170,7 @@ int32_t ConnToggleNonBlockMode(int32_t fd, bool isNonBlock) } int32_t flags = fcntl(fd, F_GETFL, 0); if (flags < 0) { - CONN_LOGE(CONN_COMMON, "fcntl get flag failed, fd=%{public}d, errno=%{public}d(%{public}s)", + CONN_LOGE(CONN_COMMON, "fcntl get flag fail, fd=%{public}d, errno=%{public}d(%{public}s)", fd, errno, strerror(errno)); return SOFTBUS_CONN_SOCKET_FCNTL_ERR; } @@ -369,7 +369,7 @@ static int32_t ConnPreAssignPortBind(int32_t socketFd, int32_t domain) SoftBusSockAddrIn6 addrIn6 = {0}; ret = Ipv6AddrToAddrIn(&addrIn6, "::", 0); if (ret != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "convert address to net order failed"); + CONN_LOGE(CONN_COMMON, "convert address to net order fail"); return SOFTBUS_TCPCONNECTION_SOCKET_ERR; } return SoftBusSocketBind(socketFd, (SoftBusSockAddr *)&addrIn6, sizeof(SoftBusSockAddrIn6)); @@ -377,7 +377,7 @@ static int32_t ConnPreAssignPortBind(int32_t socketFd, int32_t domain) SoftBusSockAddrIn addrIn = {0}; ret = Ipv4AddrToAddrIn(&addrIn, "0.0.0.0", 0); if (ret != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "convert address to net order failed"); + CONN_LOGE(CONN_COMMON, "convert address to net order fail"); return SOFTBUS_TCPCONNECTION_SOCKET_ERR; } return SoftBusSocketBind(socketFd, (SoftBusSockAddr *)&addrIn, sizeof(SoftBusSockAddrIn)); @@ -388,20 +388,20 @@ int32_t ConnPreAssignPort(int32_t domain) int socketFd = -1; int ret = SoftBusSocketCreate(domain, SOFTBUS_SOCK_STREAM, 0, &socketFd); if (ret < 0) { - CONN_LOGE(CONN_COMMON, "create socket failed, ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "create socket fail, ret=%{public}d", ret); return SOFTBUS_TCPCONNECTION_SOCKET_ERR; } int reuse = 1; ret = SoftBusSocketSetOpt(socketFd, SOL_SOCKET, SO_REUSEPORT, &reuse, sizeof(reuse)); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "set reuse port option failed"); + CONN_LOGE(CONN_COMMON, "set reuse port option fail"); SoftBusSocketClose(socketFd); return SOFTBUS_TCPCONNECTION_SOCKET_ERR; } ret = ConnPreAssignPortBind(socketFd, domain); if (ret != SOFTBUS_ADAPTER_OK) { SoftBusSocketClose(socketFd); - CONN_LOGE(CONN_COMMON, "bind address failed"); + CONN_LOGE(CONN_COMMON, "bind address fail"); return SOFTBUS_TCPCONNECTION_SOCKET_ERR; } return socketFd; @@ -455,7 +455,7 @@ int32_t Ipv6AddrToAddrIn(SoftBusSockAddrIn6 *addrIn6, const char *ip, uint16_t p char *nextToken = NULL; char tmpIp[IP_LEN] = { 0 }; if (strcpy_s(tmpIp, sizeof(tmpIp), ip) != EOK) { - CONN_LOGE(CONN_COMMON, "copy local id failed"); + CONN_LOGE(CONN_COMMON, "copy local id fail"); return SOFTBUS_MEM_ERR; } addr = strtok_s(tmpIp, ADDR_SPLIT_IPV6, &nextToken); @@ -466,7 +466,7 @@ int32_t Ipv6AddrToAddrIn(SoftBusSockAddrIn6 *addrIn6, const char *ip, uint16_t p if (ifName != NULL) { addrIn6->sin6ScopeId = SoftBusIfNameToIndex(ifName); if (addrIn6->sin6ScopeId == 0) { - CONN_LOGE(CONN_WIFI_DIRECT, "nameToIndex failed, errno=%{public}d(%{public}s)", errno, strerror(errno)); + CONN_LOGE(CONN_WIFI_DIRECT, "nameToIndex fail, errno=%{public}d(%{public}s)", errno, strerror(errno)); return SOFTBUS_SOCKET_ADDR_ERR; } } @@ -519,12 +519,12 @@ static int32_t GetIfNameByIp(const char *myIp, int32_t domain, char *ifName, int int32_t ret = getifaddrs(&ifList); if (ret != 0) { - COMM_LOGE(CONN_COMMON, "ip=%{public}s getifaddrs ifList failed, ret=%{public}d, errno=%{public}d(%{public}s)", + COMM_LOGE(CONN_COMMON, "ip=%{public}s getifaddrs ifList fail, ret=%{public}d, errno=%{public}d(%{public}s)", animizedIp, ret, errno, strerror(errno)); return SOFTBUS_SOCKET_ADDR_ERR; } if (inet_aton(myIp, &inAddr) == 0) { - COMM_LOGE(CONN_COMMON, "inet_aton ip=%{public}s failed.", animizedIp); + COMM_LOGE(CONN_COMMON, "inet_aton ip=%{public}s fail.", animizedIp); freeifaddrs(ifList); return SOFTBUS_TCP_SOCKET_ERR; } diff --git a/core/connection/common/src/softbus_tcp_socket.c b/core/connection/common/src/softbus_tcp_socket.c index 71b4d30156..5527310b0c 100644 --- a/core/connection/common/src/softbus_tcp_socket.c +++ b/core/connection/common/src/softbus_tcp_socket.c @@ -34,7 +34,7 @@ static int SetReusePort(int fd, int on) { int rc = SoftBusSocketSetOpt(fd, SOFTBUS_SOL_SOCKET, SOFTBUS_SO_REUSEPORT, &on, sizeof(on)); if (rc != 0) { - CONN_LOGE(CONN_COMMON, "set SO_REUSEPORT failed"); + CONN_LOGE(CONN_COMMON, "set SO_REUSEPORT fail"); return -1; } return 0; @@ -45,7 +45,7 @@ static int SetReuseAddr(int fd, int on) { int rc = SoftBusSocketSetOpt(fd, SOFTBUS_SOL_SOCKET, SOFTBUS_SO_REUSEADDR, &on, sizeof(on)); if (rc != 0) { - CONN_LOGE(CONN_COMMON, "set SO_REUSEADDR failed"); + CONN_LOGE(CONN_COMMON, "set SO_REUSEADDR fail"); return -1; } return 0; @@ -55,7 +55,7 @@ static int SetNoDelay(int fd, int on) { int rc = SoftBusSocketSetOpt(fd, SOFTBUS_IPPROTO_TCP, SOFTBUS_TCP_NODELAY, &on, sizeof(on)); if (rc != 0) { - CONN_LOGE(CONN_COMMON, "set TCP_NODELAY failed"); + CONN_LOGE(CONN_COMMON, "set TCP_NODELAY fail"); return -1; } return 0; @@ -70,7 +70,7 @@ static int SetQuickStart(int fd, int quick) errno = 0; int rc = setsockopt(fd, SOFTBUS_IPPROTO_TCP, TCP_QUICK_START, &quick, sizeof(quick)); if (rc != 0) { - CONN_LOGE(CONN_COMMON, "set TCP_QUICK_START failed. rc=%{public}d, errno=%{public}d(%{public}s)", + CONN_LOGE(CONN_COMMON, "set TCP_QUICK_START fail. rc=%{public}d, errno=%{public}d(%{public}s)", rc, errno, strerror(errno)); return -1; } @@ -81,7 +81,7 @@ static int SetSendBufFix(int fd, int val) { int rc = setsockopt(fd, SOFTBUS_SOL_SOCKET, SOFTBUS_SO_SNDBUF, &val, sizeof(val)); if (rc != 0) { - CONN_LOGE(CONN_COMMON, "set SOFTBUS_SO_SNDBUF failed. rc=%{public}d, errno=%{public}d(%{public}s)", + CONN_LOGE(CONN_COMMON, "set SOFTBUS_SO_SNDBUF fail. rc=%{public}d, errno=%{public}d(%{public}s)", rc, errno, strerror(errno)); return -1; } @@ -92,7 +92,7 @@ static int SetRcvBufFix(int fd, int val) { int rc = setsockopt(fd, SOFTBUS_SOL_SOCKET, SOFTBUS_SO_RCVBUF, &val, sizeof(val)); if (rc != 0) { - CONN_LOGE(CONN_COMMON, "set SOFTBUS_SO_RCVBUF failed. rc=%{public}d, errno=%{public}d(%{public}s)", + CONN_LOGE(CONN_COMMON, "set SOFTBUS_SO_RCVBUF fail. rc=%{public}d, errno=%{public}d(%{public}s)", rc, errno, strerror(errno)); return -1; } @@ -165,7 +165,7 @@ int BindLocalIP(int32_t domain, int fd, const char *localIP, uint16_t port) SoftBusSockAddrIn6 addrIn6 = {0}; rc = Ipv6AddrToAddrIn(&addrIn6, localIP, port); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "pack ipv6 addr failed"); + CONN_LOGE(CONN_COMMON, "pack ipv6 addr fail"); return SOFTBUS_SOCKET_ADDR_ERR; } return SOFTBUS_TEMP_FAILURE_RETRY( @@ -174,7 +174,7 @@ int BindLocalIP(int32_t domain, int fd, const char *localIP, uint16_t port) SoftBusSockAddrIn addrIn = {0}; rc = Ipv4AddrToAddrIn(&addrIn, localIP, port); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "pack ipv4 addr failed"); + CONN_LOGE(CONN_COMMON, "pack ipv4 addr fail"); return SOFTBUS_SOCKET_ADDR_ERR; } return SOFTBUS_TEMP_FAILURE_RETRY( @@ -185,7 +185,7 @@ int32_t SetIpTos(int fd, uint32_t tos) { int rc = SoftBusSocketSetOpt(fd, SOFTBUS_IPPROTO_IP, SOFTBUS_IP_TOS, &tos, sizeof(tos)); if (rc != 0) { - CONN_LOGE(CONN_COMMON, "set tos failed, fd=%{public}d", fd); + CONN_LOGE(CONN_COMMON, "set tos fail, fd=%{public}d", fd); return SOFTBUS_TCP_SOCKET_ERR; } return SOFTBUS_OK; @@ -195,7 +195,7 @@ static void SetIpv6Tos(int fd, uint32_t tos) { int32_t ret = SoftBusSocketSetOpt(fd, SOFTBUS_IPPROTO_IPV6, SOFTBUS_IPV6_TCLASS, &tos, sizeof(tos)); CONN_CHECK_AND_RETURN_LOGE( - ret == SOFTBUS_ADAPTER_OK, CONN_COMMON, "set tos failed, ret=%{public}d, fd=%{public}d", ret, fd); + ret == SOFTBUS_ADAPTER_OK, CONN_COMMON, "set tos fail, ret=%{public}d, fd=%{public}d", ret, fd); } static int32_t OpenTcpServerSocket(const LocalListenerInfo *option) @@ -218,7 +218,7 @@ static int32_t OpenTcpServerSocket(const LocalListenerInfo *option) int ret = SoftBusSocketCreate( domain, SOFTBUS_SOCK_STREAM | SOFTBUS_SOCK_CLOEXEC | SOFTBUS_SOCK_NONBLOCK, 0, (int32_t *)&fd); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "Create socket failed! ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "Create socket fail! ret=%{public}d", ret); return SOFTBUS_TCP_SOCKET_ERR; } @@ -266,7 +266,7 @@ int32_t SocketConnect(int32_t fd, int32_t domain, const ConnectOption *option) SoftBusSockAddrIn6 addrIn6 = {0}; rc = Ipv6AddrToAddrIn(&addrIn6, option->socketOption.addr, (uint16_t)option->socketOption.port); if (rc != SOFTBUS_OK) { - CONN_LOGW(CONN_COMMON, "pack ipv6 addr failed"); + CONN_LOGW(CONN_COMMON, "pack ipv6 addr fail"); return rc; } return SOFTBUS_TEMP_FAILURE_RETRY( @@ -275,7 +275,7 @@ int32_t SocketConnect(int32_t fd, int32_t domain, const ConnectOption *option) SoftBusSockAddrIn addrIn = {0}; rc = Ipv4AddrToAddrIn(&addrIn, option->socketOption.addr, (uint16_t)option->socketOption.port); if (rc != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "pack ipv4 addr failed"); + CONN_LOGE(CONN_COMMON, "pack ipv4 addr fail"); return rc; } return SOFTBUS_TEMP_FAILURE_RETRY( @@ -300,11 +300,11 @@ static int32_t OpenTcpClientSocket(const ConnectOption *option, const char *myIp int32_t domain = GetDomainByAddr(option->socketOption.addr); int32_t ret = SoftBusSocketCreate(domain, SOFTBUS_SOCK_STREAM, 0, &fd); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_COMMON, - "create socket failed, serverIp=%{public}s, serverPort=%{public}d, error=%{public}d", animizedIp, + "create socket fail, serverIp=%{public}s, serverPort=%{public}d, error=%{public}d", animizedIp, option->socketOption.port, ret); if (isNonBlock && ConnToggleNonBlockMode(fd, true) != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "set nonblock failed, serverIp=%{public}s, serverPort=%{public}d, fd=%{public}d", + CONN_LOGE(CONN_COMMON, "set nonblock fail, serverIp=%{public}s, serverPort=%{public}d, fd=%{public}d", animizedIp, option->socketOption.port, fd); SoftBusSocketClose(fd); return SOFTBUS_TCPCONNECTION_SOCKET_ERR; @@ -319,7 +319,7 @@ static int32_t OpenTcpClientSocket(const ConnectOption *option, const char *myIp } ret = BindTcpClientAddr(domain, fd, myIp); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "bind client address failed, serverIp=%{public}s, serverPort=%{public}d, " + CONN_LOGE(CONN_COMMON, "bind client address fail, serverIp=%{public}s, serverPort=%{public}d, " "error=%{public}d", animizedIp, option->socketOption.port, ret); ConnShutdownSocket(fd); return ret; @@ -329,7 +329,7 @@ static int32_t OpenTcpClientSocket(const ConnectOption *option, const char *myIp ret = SocketConnect(fd, domain, option); if ((ret != SOFTBUS_ADAPTER_OK) && (ret != SOFTBUS_ADAPTER_SOCKET_EINPROGRESS) && (ret != SOFTBUS_ADAPTER_SOCKET_EAGAIN)) { - CONN_LOGE(CONN_COMMON, "client connect failed, serverIp=%{public}s, serverPort=%{public}d, fd=%{public}d, " + CONN_LOGE(CONN_COMMON, "client connect fail, serverIp=%{public}s, serverPort=%{public}d, fd=%{public}d, " "ret=%{public}d, errno=%{public}d(%{public}s)", animizedIp, option->socketOption.port, fd, ret, errno, strerror(errno)); ConnShutdownSocket(fd); @@ -360,7 +360,7 @@ int32_t ConnSetTcpKeepaliveState(int32_t fd, bool needKeepalive) int32_t enable = needKeepalive ? 1 : 0; int32_t ret = SoftBusSocketSetOpt(fd, SOFTBUS_SOL_SOCKET, SOFTBUS_SO_KEEPALIVE, &enable, sizeof(enable)); if (ret != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "set SO_KEEPALIVE failed, ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "set SO_KEEPALIVE fail, ret=%{public}d", ret); return SOFTBUS_ADAPTER_ERR; } return SOFTBUS_ADAPTER_OK; @@ -376,19 +376,19 @@ int32_t ConnSetTcpKeepalive(int32_t fd, int32_t seconds, int32_t keepAliveIntvl, int32_t rc; rc = SoftBusSocketSetOpt(fd, SOFTBUS_IPPROTO_TCP, SOFTBUS_TCP_KEEPIDLE, &seconds, sizeof(seconds)); if (rc != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "set TCP_KEEPIDLE failed"); + CONN_LOGE(CONN_COMMON, "set TCP_KEEPIDLE fail"); return SOFTBUS_ADAPTER_ERR; } rc = SoftBusSocketSetOpt(fd, SOFTBUS_IPPROTO_TCP, SOFTBUS_TCP_KEEPCNT, &keepAliveCount, sizeof(keepAliveCount)); if (rc != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "set TCP_KEEPCNT failed"); + CONN_LOGE(CONN_COMMON, "set TCP_KEEPCNT fail"); return SOFTBUS_ADAPTER_ERR; } rc = SoftBusSocketSetOpt(fd, SOFTBUS_IPPROTO_TCP, SOFTBUS_TCP_KEEPINTVL, &keepAliveIntvl, sizeof(keepAliveIntvl)); if (rc != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "set TCP_KEEPINTVL failed"); + CONN_LOGE(CONN_COMMON, "set TCP_KEEPINTVL fail"); return SOFTBUS_ADAPTER_ERR; } @@ -404,7 +404,7 @@ int32_t ConnSetTcpUserTimeOut(int32_t fd, uint32_t millSec) } if (SoftBusSocketSetOpt(fd, SOFTBUS_IPPROTO_TCP, SOFTBUS_TCP_USER_TIMEOUT, &millSec, sizeof(millSec)) != SOFTBUS_ADAPTER_OK) { - CONN_LOGE(CONN_COMMON, "set SOFTBUS_TCP_USER_TIMEOUT failed"); + CONN_LOGE(CONN_COMMON, "set SOFTBUS_TCP_USER_TIMEOUT fail"); return SOFTBUS_ADAPTER_ERR; } return SOFTBUS_OK; @@ -427,7 +427,7 @@ static int32_t AcceptTcpClient(int32_t fd, ConnectOption *clientAddr, int32_t *c (void)memset_s(&addr, sizeof(addr), 0, sizeof(addr)); int32_t ret = SOFTBUS_TEMP_FAILURE_RETRY(SoftBusSocketAccept(fd, &addr, cfd)); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "accept failed, ret=%{public}" PRId32 ", cfd=%{public}d, fd=%{public}d", ret, *cfd, fd); + CONN_LOGE(CONN_COMMON, "accept fail, ret=%{public}" PRId32 ", cfd=%{public}d, fd=%{public}d", ret, *cfd, fd); return ret; } @@ -438,14 +438,14 @@ static int32_t AcceptTcpClient(int32_t fd, ConnectOption *clientAddr, int32_t *c ret = Ipv6AddrInToAddr((SoftBusSockAddrIn6 *)&addr, clientAddr->socketOption.addr, sizeof(clientAddr->socketOption.addr)); if (ret < 0) { - CONN_LOGE(CONN_COMMON, "get ipv6 addr failed"); + CONN_LOGE(CONN_COMMON, "get ipv6 addr fail"); return ret; } return SOFTBUS_OK; } if (SoftBusInetNtoP(SOFTBUS_AF_INET, &((SoftBusSockAddrIn *)&addr)->sinAddr, clientAddr->socketOption.addr, sizeof(clientAddr->socketOption.addr)) == NULL) { - CONN_LOGE(CONN_COMMON, "get addr failed"); + CONN_LOGE(CONN_COMMON, "get addr fail"); return SOFTBUS_TCPCONNECTION_SOCKET_ERR; } return SOFTBUS_OK; diff --git a/core/connection/common/src/softbus_usb_tcp_socket.c b/core/connection/common/src/softbus_usb_tcp_socket.c index 824bfb58c4..e683e29db4 100644 --- a/core/connection/common/src/softbus_usb_tcp_socket.c +++ b/core/connection/common/src/softbus_usb_tcp_socket.c @@ -43,7 +43,7 @@ static int32_t OpenUsbServerSocket(const LocalListenerInfo *option) int ret = SoftBusSocketCreate( domain, SOFTBUS_SOCK_STREAM | SOFTBUS_SOCK_CLOEXEC | SOFTBUS_SOCK_NONBLOCK, 0, (int32_t *)&fd); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "Create socket failed! ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "Create socket fail! ret=%{public}d", ret); return SOFTBUS_TCP_SOCKET_ERR; } @@ -77,12 +77,12 @@ static int32_t OpenUsbClientSocket(const ConnectOption *option, const char *myIp int32_t domain = GetDomainByAddr(option->socketOption.addr); int32_t ret = SoftBusSocketCreate(domain, SOFTBUS_SOCK_STREAM, 0, &fd); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "create socket failed, serverIp=%{public}s, serverPort=%{public}d, error=%{public}d", + CONN_LOGE(CONN_COMMON, "create socket fail, serverIp=%{public}s, serverPort=%{public}d, error=%{public}d", animizedIp, option->socketOption.port, ret); return ret; } if (isNonBlock && ConnToggleNonBlockMode(fd, true) != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "set nonblock failed, serverIp=%{public}s, serverPort=%{public}d, fd=%{public}d", + CONN_LOGE(CONN_COMMON, "set nonblock fail, serverIp=%{public}s, serverPort=%{public}d, fd=%{public}d", animizedIp, option->socketOption.port, fd); SoftBusSocketClose(fd); return SOFTBUS_TCPCONNECTION_SOCKET_ERR; @@ -90,7 +90,7 @@ static int32_t OpenUsbClientSocket(const ConnectOption *option, const char *myIp SetClientOption(fd); ret = BindTcpClientAddr(domain, fd, myIp); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "bind client address failed, serverIp=%{public}s, serverPort=%{public}d, " + CONN_LOGE(CONN_COMMON, "bind client address fail, serverIp=%{public}s, serverPort=%{public}d, " "error=%{public}d", animizedIp, option->socketOption.port, ret); ConnShutdownSocket(fd); return ret; @@ -100,7 +100,7 @@ static int32_t OpenUsbClientSocket(const ConnectOption *option, const char *myIp ret = SocketConnect(fd, domain, option); if ((ret != SOFTBUS_ADAPTER_OK) && (ret != SOFTBUS_ADAPTER_SOCKET_EINPROGRESS) && (ret != SOFTBUS_ADAPTER_SOCKET_EAGAIN)) { - CONN_LOGE(CONN_COMMON, "client connect failed, serverIp=%{public}s, serverPort=%{public}d, fd=%{public}d, " + CONN_LOGE(CONN_COMMON, "client connect fail, serverIp=%{public}s, serverPort=%{public}d, fd=%{public}d, " "ret=%{public}d, errno=%{public}d(%{public}s)", animizedIp, option->socketOption.port, fd, ret, errno, strerror(errno)); ConnShutdownSocket(fd); @@ -119,7 +119,7 @@ static int32_t AcceptUsbClient(int32_t fd, ConnectOption *clientAddr, int32_t *c (void)memset_s(&addr, sizeof(addr), 0, sizeof(addr)); int32_t ret = SOFTBUS_TEMP_FAILURE_RETRY(SoftBusSocketAccept(fd, &addr, cfd)); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "accept failed, ret=%{public}" PRId32 ", cfd=%{public}d, fd=%{public}d", ret, *cfd, fd); + CONN_LOGE(CONN_COMMON, "accept fail, ret=%{public}" PRId32 ", cfd=%{public}d, fd=%{public}d", ret, *cfd, fd); return ret; } @@ -129,7 +129,7 @@ static int32_t AcceptUsbClient(int32_t fd, ConnectOption *clientAddr, int32_t *c if (SoftBusInetNtoP(SOFTBUS_AF_INET6, &((SoftBusSockAddrIn6 *)&addr)->sin6Addr, clientAddr->socketOption.addr, sizeof(clientAddr->socketOption.addr)) == NULL) { - CONN_LOGE(CONN_COMMON, "get addr failed"); + CONN_LOGE(CONN_COMMON, "get addr fail"); return SOFTBUS_TCPCONNECTION_SOCKET_ERR; } return SOFTBUS_OK; diff --git a/core/connection/general/softbus_conn_general_connection.c b/core/connection/general/softbus_conn_general_connection.c index b600184db8..6594986700 100644 --- a/core/connection/general/softbus_conn_general_connection.c +++ b/core/connection/general/softbus_conn_general_connection.c @@ -88,7 +88,7 @@ static SoftBusHandlerWrapper g_generalManagerSyncHandler = { static int GeneralCompareConnectionLooperEventFunc(const SoftBusMessage *msg, void *args) { SoftBusMessage *ctx = (SoftBusMessage *)args; - CONN_CHECK_AND_RETURN_RET_LOGE(msg->what == ctx->what, COMPARE_FAILED, CONN_BLE, "compade failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(msg->what == ctx->what, COMPARE_FAILED, CONN_BLE, "compade fail"); switch (ctx->what) { case GENERAL_MGR_MSG_MERGE_CMD: { if (msg->arg1 == ctx->arg1) { @@ -200,7 +200,7 @@ static void ConnReturnGeneralConnection(struct GeneralConnection **generalConnec struct GeneralConnection *GetConnectionByGeneralId(uint32_t generalId) { int32_t ret = SoftBusMutexLock(&g_generalManager.connections->lock); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, NULL, CONN_BLE, "lock failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, NULL, CONN_BLE, "lock fail"); struct GeneralConnection *it = NULL; LIST_FOR_EACH_ENTRY(it, &g_generalManager.connections->list, struct GeneralConnection, node) { if (it->generalId == generalId) { @@ -217,7 +217,7 @@ static void ConnRemoveGeneralConnection(struct GeneralConnection *generalConnect { CONN_CHECK_AND_RETURN_LOGE(generalConnection != NULL, CONN_BLE, "connection is null"); CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&g_generalManager.connections->lock) == SOFTBUS_OK, CONN_BLE, - "lock failed"); + "lock fail"); struct GeneralConnection *it = NULL; bool exist = false; @@ -239,7 +239,7 @@ static void ConnRemoveGeneralConnection(struct GeneralConnection *generalConnect struct GeneralConnection *GetGeneralConnectionByReqId(uint32_t reqId) { CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_generalManager.connections->lock) == SOFTBUS_OK, NULL, CONN_BLE, - "lock failed"); + "lock fail"); struct GeneralConnection *it = NULL; LIST_FOR_EACH_ENTRY(it, &g_generalManager.connections->list, struct GeneralConnection, node) { if (it->requestId == reqId) { @@ -255,7 +255,7 @@ struct GeneralConnection *GetGeneralConnectionByReqId(uint32_t reqId) struct GeneralConnection *GetGeneralConnectionByParam(const char *pkgName, int32_t pid) { CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_generalManager.connections->lock) == SOFTBUS_OK, NULL, CONN_BLE, - "lock failed"); + "lock fail"); struct GeneralConnection *it = NULL; LIST_FOR_EACH_ENTRY(it, &g_generalManager.connections->list, struct GeneralConnection, node) { if (StrCmpIgnoreCase(it->info.pkgName, pkgName) == 0 && it->info.pid == pid) { @@ -275,19 +275,19 @@ static int32_t GeneralSendResetMessage(struct GeneralConnection *generalConnecti info.peerId = generalConnection->peerGeneralId; OutData *data = GeneralConnectionPackMsg(&info, GENERAL_CONNECTION_MSG_TYPE_RESET); CONN_CHECK_AND_RETURN_RET_LOGE(data != NULL, SOFTBUS_CONN_GENERAL_PACK_ERROR, CONN_BLE, - "pack data failed, generalId=%{public}u", generalConnection->generalId); + "pack data fail, generalId=%{public}u", generalConnection->generalId); CONN_LOGI(CONN_BLE, "send reset msg, generalId=%{public}u", generalConnection->generalId); int32_t status = SendInner(data, generalConnection->underlayerHandle, MODULE_BLE_GENERAL, 0); FreeOutData(data); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "send failed, generalId=%{public}u, err=%{public}d", generalConnection->generalId, status); + CONN_LOGE(CONN_BLE, "send fail, generalId=%{public}u, err=%{public}d", generalConnection->generalId, status); ConnDisconnectDevice(generalConnection->underlayerHandle); return status; } if (generalConnection->isClient && ConnPostMsgToLooper(&g_generalManagerSyncHandler, GENERAL_MGR_MSG_DISCONNECT_DELAY, generalConnection->underlayerHandle, 0, NULL, GENERAL_CONNECT_DISCONNECT_DELAY) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "post msg failed"); + CONN_LOGE(CONN_BLE, "post msg fail"); return SOFTBUS_CONN_GENERAL_POST_MSG_FAILED; } return SOFTBUS_OK; @@ -301,7 +301,7 @@ static Server *NewServerNode(const GeneralConnectionParam *param) if ((strncpy_s(nameNode->info.bundleName, BUNDLE_NAME_MAX, param->bundleName, BUNDLE_NAME_MAX - 1) != EOK) || (strncpy_s(nameNode->info.name, GENERAL_NAME_LEN, param->name, GENERAL_NAME_LEN - 1) != EOK) || (strncpy_s(nameNode->info.pkgName, PKG_NAME_SIZE_MAX, param->pkgName, PKG_NAME_SIZE_MAX - 1) != EOK)) { - CONN_LOGE(CONN_BLE, "strcpy failed"); + CONN_LOGE(CONN_BLE, "strcpy fail"); SoftBusFree(nameNode); return NULL; } @@ -320,7 +320,7 @@ static void ClearAllGeneralConnection(const char *pkgName, int32_t pid) CONN_LOGW(CONN_BLE, "clean up connections"); CONN_CHECK_AND_RETURN_LOGE(pkgName != NULL, CONN_BLE, "pkgName is null"); CONN_CHECK_AND_RETURN_LOGE((SoftBusMutexLock(&g_generalManager.servers->lock)) == SOFTBUS_OK, CONN_BLE, - "lock servers failed"); + "lock servers fail"); Server *serverIt = NULL; Server *serverNext = NULL; LIST_FOR_EACH_ENTRY_SAFE(serverIt, serverNext, &g_generalManager.servers->list, Server, node) { @@ -334,7 +334,7 @@ static void ClearAllGeneralConnection(const char *pkgName, int32_t pid) ListNode waitNotifyDisconnect = {0}; ListInit(&waitNotifyDisconnect); CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&g_generalManager.connections->lock) == SOFTBUS_OK, CONN_BLE, - "lock failed"); + "lock fail"); struct GeneralConnection *it = NULL; struct GeneralConnection *next = NULL; LIST_FOR_EACH_ENTRY_SAFE(it, next, &g_generalManager.connections->list, struct GeneralConnection, node) { @@ -362,11 +362,11 @@ static int32_t GeneralSendMergeMessage(struct GeneralConnection *generalConnecti info.updateHandle = updateHandle; OutData *data = GeneralConnectionPackMsg(&info, GENERAL_CONNECTION_MSG_TYPE_MERGE); CONN_CHECK_AND_RETURN_RET_LOGE(data != NULL, SOFTBUS_CONN_GENERAL_PACK_ERROR, CONN_BLE, - "pack data failed, generalId=%{public}u", generalConnection->generalId); + "pack data fail, generalId=%{public}u", generalConnection->generalId); int32_t status = SendInner(data, generalConnection->underlayerHandle, MODULE_BLE_GENERAL, 0); FreeOutData(data); CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, SOFTBUS_CONN_GENERAL_PACK_ERROR, CONN_BLE, - "send failed, generalId=%{public}u, err=%{public}d", generalConnection->generalId, status); + "send fail, generalId=%{public}u, err=%{public}d", generalConnection->generalId, status); return status; } @@ -376,7 +376,7 @@ static int32_t GeneralSessionNegotiation( GeneralConnectionInfo info = {0}; if (strcpy_s(info.name, GENERAL_NAME_LEN, generalConnection->info.name) != EOK || strcpy_s(info.bundleName, BUNDLE_NAME_MAX, generalConnection->info.bundleName) != EOK) { - CONN_LOGE(CONN_BLE, "copy address failed, generalId=%{public}u", generalConnection->generalId); + CONN_LOGE(CONN_BLE, "copy address fail, generalId=%{public}u", generalConnection->generalId); return SOFTBUS_STRCPY_ERR; } info.ackStatus = ackStatus; @@ -385,11 +385,11 @@ static int32_t GeneralSessionNegotiation( info.abilityBitSet = generalConnection->abilityBitSet; OutData *data = GeneralConnectionPackMsg(&info, type); CONN_CHECK_AND_RETURN_RET_LOGE(data != NULL, SOFTBUS_CONN_GENERAL_PACK_ERROR, CONN_BLE, - "pack data failed, generalId=%{public}u", generalConnection->generalId); + "pack data fail, generalId=%{public}u", generalConnection->generalId); CONN_LOGI(CONN_BLE, "send session negotiation msg, generalId=%{public}u", generalConnection->generalId); int32_t status = SendInner(data, generalConnection->underlayerHandle, MODULE_BLE_GENERAL, 0); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "send failed, generalId=%{public}u, err=%{public}d", generalConnection->generalId, status); + CONN_LOGE(CONN_BLE, "send fail, generalId=%{public}u, err=%{public}d", generalConnection->generalId, status); } FreeOutData(data); return status; @@ -407,7 +407,7 @@ static int32_t StartConnConnectDevice(const char *addr, .bleOption.psm = GENERAL_PSM, }; if (strcpy_s(option.bleOption.bleMac, BT_MAC_LEN, addr) != EOK) { - CONN_LOGE(CONN_BLE, "copy mac failed"); + CONN_LOGE(CONN_BLE, "copy mac fail"); return SOFTBUS_STRCPY_ERR; } int32_t status = ConnConnectDevice(&option, requestId, result); @@ -433,12 +433,12 @@ static int32_t SetConnectionDeviceId(struct GeneralConnection *generalConnection ret = memcpy_s(generalConnection->udid, UDID_BUF_LEN, bleConnection->udid, UDID_BUF_LEN); } if (ret != EOK) { - CONN_LOGE(CONN_BLE, "server copy networkId failed, generalId=%{public}u", generalConnection->generalId); + CONN_LOGE(CONN_BLE, "server copy networkId fail, generalId=%{public}u", generalConnection->generalId); } ret = memcpy_s(generalConnection->addr, BT_MAC_LEN, bleConnection->addr, BT_MAC_LEN); ConnBleReturnConnection(&bleConnection); CONN_CHECK_AND_RETURN_RET_LOGE(ret == EOK, SOFTBUS_MEM_ERR, CONN_BLE, - "copy mac failed, err=%{public}d", ret); + "copy mac fail, err=%{public}d", ret); return SOFTBUS_OK; } @@ -446,11 +446,11 @@ static void OnCommConnectSucc(uint32_t requestId, uint32_t connectionId, const C { (void)info; struct GeneralConnection *generalConnection = GetGeneralConnectionByReqId(requestId); - CONN_CHECK_AND_RETURN_LOGE(generalConnection != NULL, CONN_BLE, "get connection failed"); + CONN_CHECK_AND_RETURN_LOGE(generalConnection != NULL, CONN_BLE, "get connection fail"); int32_t status = SOFTBUS_OK; do { if (SoftBusMutexLock(&generalConnection->lock) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "lock failed, generalId=%{public}u", generalConnection->generalId); + CONN_LOGE(CONN_BLE, "lock fail, generalId=%{public}u", generalConnection->generalId); status = SOFTBUS_LOCK_ERR; break; } @@ -482,7 +482,7 @@ static void OnCommConnectSucc(uint32_t requestId, uint32_t connectionId, const C static uint32_t GenerateRequestId(void) { int32_t ret = SoftBusMutexLock(&g_requestIdLock); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, g_requestId, CONN_BLE, "lock failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, g_requestId, CONN_BLE, "lock fail"); uint32_t reqId = g_requestId++; (void)SoftBusMutexUnlock(&g_requestIdLock); return reqId; @@ -491,9 +491,9 @@ static uint32_t GenerateRequestId(void) static void OnCommConnectFail(uint32_t requestId, int32_t reason) { struct GeneralConnection *connection = GetGeneralConnectionByReqId(requestId); - CONN_CHECK_AND_RETURN_LOGE(connection != NULL, CONN_BLE, "get connection failed"); + CONN_CHECK_AND_RETURN_LOGE(connection != NULL, CONN_BLE, "get connection fail"); CONN_LOGE(CONN_BLE, - "on connect failed, generalId=%{public}u, reason=%{public}d", + "on connect fail, generalId=%{public}u, reason=%{public}d", connection->generalId, reason); ConnRemoveMsgFromLooper(&g_generalManagerSyncHandler, GENERAL_MGR_MSG_CONNECT_TIMEOUT, connection->generalId, 0, NULL); @@ -505,10 +505,10 @@ static void OnCommConnectFail(uint32_t requestId, int32_t reason) } if (connection->protocol == BLE_COC) { CONN_LOGI(CONN_BLE, - "connect failed, try to connect gatt, generalId=%{public}u", connection->generalId); + "connect fail, try to connect gatt, generalId=%{public}u", connection->generalId); int32_t status = SoftBusMutexLock(&connection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "lock failed, error=%{public}d", status); + CONN_LOGE(CONN_BLE, "lock fail, error=%{public}d", status); g_generalConnectionListener.onConnectFailed(&connection->info, connection->generalId, status); ConnRemoveGeneralConnection(connection); ConnReturnGeneralConnection(&connection); @@ -532,7 +532,7 @@ static void UpdateConnectionState(struct GeneralConnection *generalConnection, enum GeneralConnState expectedState, enum GeneralConnState nextState) { int32_t status = SoftBusMutexLock(&generalConnection->lock); - CONN_CHECK_AND_RETURN_LOGE(status == SOFTBUS_OK, CONN_BLE, "lock failed"); + CONN_CHECK_AND_RETURN_LOGE(status == SOFTBUS_OK, CONN_BLE, "lock fail"); if (generalConnection->state != expectedState) { CONN_LOGW(CONN_BLE, "unexpected state, actualState=%{public}d, expectedState=%{public}d, nextState=%{public}d", @@ -560,7 +560,7 @@ static uint32_t AllocateGeneralIdUnsafe(void) static bool FindInfoFromServer(GeneralConnectionInfo *info, struct GeneralConnection *generalConnection) { int32_t status = SoftBusMutexLock(&g_generalManager.servers->lock); - CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, false, CONN_BLE, "lock failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, false, CONN_BLE, "lock fail"); Server *it = NULL; bool found = false; @@ -581,7 +581,7 @@ static bool FindInfoFromServer(GeneralConnectionInfo *info, struct GeneralConnec if (strncpy_s(infoTemp.name, GENERAL_NAME_LEN, it->info.name, GENERAL_NAME_LEN - 1) != EOK || strncpy_s(infoTemp.pkgName, PKG_NAME_SIZE_MAX, it->info.pkgName, PKG_NAME_SIZE_MAX - 1) != EOK || strncpy_s(infoTemp.bundleName, BUNDLE_NAME_MAX, it->info.bundleName, BUNDLE_NAME_MAX - 1) != EOK) { - CONN_LOGE(CONN_BLE, "copy info failed"); + CONN_LOGE(CONN_BLE, "copy info fail"); (void)SoftBusMutexUnlock(&g_generalManager.servers->lock); return false; } @@ -589,13 +589,13 @@ static bool FindInfoFromServer(GeneralConnectionInfo *info, struct GeneralConnec (void)SoftBusMutexUnlock(&g_generalManager.servers->lock); status = SoftBusMutexLock(&generalConnection->lock); - CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, false, CONN_BLE, "lock failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, false, CONN_BLE, "lock fail"); if (strncpy_s(generalConnection->info.name, GENERAL_NAME_LEN, infoTemp.name, GENERAL_NAME_LEN - 1) != EOK || strncpy_s(generalConnection->info.pkgName, PKG_NAME_SIZE_MAX, infoTemp.pkgName, PKG_NAME_SIZE_MAX - 1) != EOK || strncpy_s(generalConnection->info.bundleName, BUNDLE_NAME_MAX, infoTemp.bundleName, BUNDLE_NAME_MAX - 1) != EOK) { - CONN_LOGE(CONN_BLE, "copy failed"); + CONN_LOGE(CONN_BLE, "copy fail"); (void)SoftBusMutexUnlock(&generalConnection->lock); return false; } @@ -620,7 +620,7 @@ static void OnReuseConnectFail(uint32_t requestId, int32_t reason) static bool IsLocalStartMerge(struct GeneralConnection *generalConnection) { int32_t status = SoftBusMutexLock(&generalConnection->lock); - CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, false, CONN_BLE, "lock failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, false, CONN_BLE, "lock fail"); bool isSupportNetWorkIdExchange = generalConnection->isSupportNetWorkIdExchange; (void)SoftBusMutexUnlock(&generalConnection->lock); @@ -630,7 +630,7 @@ static bool IsLocalStartMerge(struct GeneralConnection *generalConnection) LnnGetLocalStrInfo(STRING_KEY_NETWORKID, localNetworkId, NETWORK_ID_BUF_LEN) : LnnGetLocalStrInfo(STRING_KEY_DEV_UDID, localUdid, UDID_BUF_LEN); CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, false, - CONN_BLE, "get local str info failed, error=%{public}d", status); + CONN_BLE, "get local str info fail, error=%{public}d", status); return isSupportNetWorkIdExchange ? (strcmp(localNetworkId, generalConnection->networkId) > 0): (strcmp(localUdid, generalConnection->udid) > 0); } @@ -650,7 +650,7 @@ static void MergeConnectionInner(struct GeneralConnection *out, CONN_LOGI(CONN_BLE, "merge connection, before generalId=%{public}u", out->generalId); GeneralSendMergeMessage(out, generalConnection->peerGeneralId); int32_t status = SoftBusMutexLock(&out->lock); - CONN_CHECK_AND_RETURN_LOGE(status == SOFTBUS_OK, CONN_BLE, "lock failed"); + CONN_CHECK_AND_RETURN_LOGE(status == SOFTBUS_OK, CONN_BLE, "lock fail"); out->underlayerHandle = generalConnection->underlayerHandle; (void)SoftBusMutexUnlock(&out->lock); } @@ -674,7 +674,7 @@ static void MergeConnection(uint32_t generalId) CONN_CHECK_AND_RETURN_LOGE(generalConnection != NULL, CONN_BLE, "connection is null"); if (SoftBusMutexLock(&g_generalManager.connections->lock) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "try to get connection lock failed"); + CONN_LOGE(CONN_BLE, "try to get connection lock fail"); ConnReturnGeneralConnection(&generalConnection); return; } @@ -718,7 +718,7 @@ static void ConnFreeGeneralConnection(struct GeneralConnection *generalConnectio static void Reference(struct GeneralConnection *target) { CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&target->lock) == SOFTBUS_OK, CONN_BLE, - "lock failed"); + "lock fail"); target->objectRc += 1; (void)SoftBusMutexUnlock(&target->lock); } @@ -726,7 +726,7 @@ static void Reference(struct GeneralConnection *target) static void Dereference(struct GeneralConnection *underlayer) { CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&underlayer->lock) == SOFTBUS_OK, CONN_BLE, - "lock failed"); + "lock fail"); underlayer->objectRc -= 1; int32_t objectRc = underlayer->objectRc; (void)SoftBusMutexUnlock(&underlayer->lock); @@ -741,7 +741,7 @@ static bool IsAllowSave(const char *bundleName, bool isFindServer) int32_t count = 0; if (!isFindServer) { CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_generalManager.connections->lock) == SOFTBUS_OK, - false, CONN_BLE, "lock failed"); + false, CONN_BLE, "lock fail"); struct GeneralConnection *it = NULL; LIST_FOR_EACH_ENTRY(it, &g_generalManager.connections->list, struct GeneralConnection, node) { if (StrCmpIgnoreCase(it->info.bundleName, bundleName) == 0 && it->isClient) { @@ -751,7 +751,7 @@ static bool IsAllowSave(const char *bundleName, bool isFindServer) (void)SoftBusMutexUnlock(&g_generalManager.connections->lock); } else { CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_generalManager.servers->lock) == SOFTBUS_OK, - SOFTBUS_LOCK_ERR, CONN_BLE, "lock failed"); + SOFTBUS_LOCK_ERR, CONN_BLE, "lock fail"); Server *item = NULL; LIST_FOR_EACH_ENTRY(item, &g_generalManager.servers->list, Server, node) { if (StrCmpIgnoreCase(item->info.bundleName, bundleName) == 0) { @@ -777,14 +777,14 @@ static struct GeneralConnection *CreateConnection(const GeneralConnectionParam * } struct GeneralConnection *connection = (struct GeneralConnection *)SoftBusCalloc(sizeof(struct GeneralConnection)); - CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, NULL, CONN_BLE, "calloc connection failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(connection != NULL, NULL, CONN_BLE, "calloc connection fail"); ListInit(&connection->node); connection->underlayerHandle = underlayerHandle; if (strncpy_s(connection->addr, BT_MAC_LEN, addr, BT_MAC_LEN - 1) != EOK || strncpy_s(connection->info.name, GENERAL_NAME_LEN, param->name, GENERAL_NAME_LEN - 1) != EOK || strncpy_s(connection->info.pkgName, PKG_NAME_SIZE_MAX, param->pkgName, PKG_NAME_SIZE_MAX - 1) != EOK || strncpy_s(connection->info.bundleName, BUNDLE_NAME_MAX, param->bundleName, BUNDLE_NAME_MAX - 1) != EOK) { - CONN_LOGE(CONN_BLE, "copy failed"); + CONN_LOGE(CONN_BLE, "copy fail"); SoftBusFree(connection); *errorCode = SOFTBUS_STRCPY_ERR; return NULL; @@ -793,7 +793,7 @@ static struct GeneralConnection *CreateConnection(const GeneralConnectionParam * connection->dereference = Dereference; connection->info.pid = param->pid; if (SoftBusMutexInit(&connection->lock, NULL) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "init lock failed"); + CONN_LOGE(CONN_BLE, "init lock fail"); SoftBusFree(connection); *errorCode = SOFTBUS_LOCK_ERR; return NULL; @@ -828,7 +828,7 @@ static int32_t SaveConnection(struct GeneralConnection *connection) static void UpdatePeerGeneralId(struct GeneralConnection *connection, GeneralConnectionInfo *info) { CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&connection->lock) == SOFTBUS_OK, CONN_BLE, - "lock failed"); + "lock fail"); connection->peerGeneralId = info->peerId; (void)SoftBusMutexUnlock(&connection->lock); } @@ -840,7 +840,7 @@ static int32_t ProcessHandshakeMessage(uint32_t connectionId, GeneralConnectionI char addr[BT_MAC_LEN] = {0}; struct GeneralConnection *generalConnection = CreateConnection(¶m, addr, connectionId, false, &ret); CONN_CHECK_AND_RETURN_RET_LOGE(generalConnection != NULL, ret, CONN_BLE, - "create connection failed"); + "create connection fail"); ret = SaveConnection(generalConnection); if (ret != SOFTBUS_OK) { generalConnection->dereference(generalConnection); @@ -851,7 +851,7 @@ static int32_t ProcessHandshakeMessage(uint32_t connectionId, GeneralConnectionI generalConnection->peerGeneralId, generalConnection->generalId); ret = SetConnectionDeviceId(generalConnection); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "set param failed, error=%{public}d", ret); + CONN_LOGE(CONN_BLE, "set param fail, error=%{public}d", ret); ConnRemoveGeneralConnection(generalConnection); generalConnection->dereference(generalConnection); return ret; @@ -875,7 +875,7 @@ static int32_t ProcessHandshakeMessage(uint32_t connectionId, GeneralConnectionI generalConnection->dereference(generalConnection); CONN_CHECK_AND_RETURN_RET_LOGE(ConnPostMsgToLooper(&g_generalManagerSyncHandler, GENERAL_MGR_MSG_MERGE_CMD, generalId, 0, NULL, 0) == SOFTBUS_OK, ret, CONN_BLE, - "post merge msg failed"); + "post merge msg fail"); return ret; } @@ -922,7 +922,7 @@ static int32_t ProcessMergeMessage(uint32_t connectionId, GeneralConnectionInfo ConnReturnGeneralConnection(&mergedConnection); int32_t ret = SoftBusMutexLock(&generalConnection->lock); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "locak failed, generalId=%{public}u, err=%{public}d", + CONN_LOGE(CONN_BLE, "locak fail, generalId=%{public}u, err=%{public}d", generalConnection->generalId, ret); ConnReturnGeneralConnection(&generalConnection); return SOFTBUS_LOCK_ERR; @@ -956,7 +956,7 @@ static int32_t ProcessResetMessage(uint32_t connectionId, GeneralConnectionInfo static void UpdateGeneralConnectionByInfo(struct GeneralConnection *generalConnection, GeneralConnectionInfo *info) { CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&generalConnection->lock) == SOFTBUS_OK, CONN_BLE, - "lock failed"); + "lock fail"); generalConnection->abilityBitSet = info->abilityBitSet; generalConnection->peerGeneralId = info->peerId; (void)SoftBusMutexUnlock(&generalConnection->lock); @@ -970,7 +970,7 @@ static int32_t ProcessHandShakeAck(uint32_t connectionId, GeneralConnectionInfo ConnRemoveMsgFromLooper(&g_generalManagerSyncHandler, GENERAL_MGR_MSG_CONNECT_TIMEOUT, generalConnection->generalId, 0, NULL); if (info->ackStatus != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "hand shake failed, ackStatus=%{public}d, generalId=%{public}u", + CONN_LOGE(CONN_BLE, "hand shake fail, ackStatus=%{public}d, generalId=%{public}u", info->ackStatus, generalConnection->generalId); g_generalConnectionListener.onConnectFailed(&generalConnection->info, generalConnection->generalId, info->ackStatus); @@ -984,7 +984,7 @@ static int32_t ProcessHandShakeAck(uint32_t connectionId, GeneralConnectionInfo g_generalConnectionListener.onConnectSuccess(&generalConnection->info, generalConnection->generalId); if (ConnPostMsgToLooper(&g_generalManagerSyncHandler, GENERAL_MGR_MSG_MERGE_CMD, generalConnection->generalId, 0, NULL, 0) != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "post merage msg failed"); + CONN_LOGE(CONN_BLE, "post merage msg fail"); } ConnReturnGeneralConnection(&generalConnection); return SOFTBUS_OK; @@ -1018,7 +1018,7 @@ static void OnCommDisconnected(uint32_t connectionId, const ConnectionInfo *info { CONN_CHECK_AND_RETURN_LOGE(info != NULL, CONN_BLE, "info is null"); CONN_CHECK_AND_RETURN_LOGE(SoftBusMutexLock(&g_generalManager.connections->lock) == SOFTBUS_OK, CONN_BLE, - "lock failed"); + "lock fail"); CONN_LOGI(CONN_BLE, "on connect disconnected, connectionId=%{public}u", connectionId); struct GeneralConnection *it = NULL; struct GeneralConnection *next = NULL; @@ -1075,7 +1075,7 @@ static void OnCommDataReceived(uint32_t connectionId, ConnModule moduleId, int64 return; } int32_t status = GeneralConnectionUnpackMsg(recvData, recvDataLen, &info, head.msgType); - CONN_CHECK_AND_RETURN_LOGE(status == SOFTBUS_OK, CONN_BLE, "pack msg failed, handle=%{public}u, status=%{public}d", + CONN_CHECK_AND_RETURN_LOGE(status == SOFTBUS_OK, CONN_BLE, "pack msg fail, handle=%{public}u, status=%{public}d", info.localId, status); status = ProcessInnerMessageByType(connectionId, msgType, &info); CONN_LOGD(CONN_BLE, "process inner msg, handle=%{public}u, status=%{public}d", info.localId, status); @@ -1109,7 +1109,7 @@ static int32_t Connect(const GeneralConnectionParam *param, const char *addr) int32_t status = SOFTBUS_OK; struct GeneralConnection *generalConnection = CreateConnection(param, addr, 0, true, &status); CONN_CHECK_AND_RETURN_RET_LOGE(generalConnection != NULL, status, CONN_BLE, - "create connection failed"); + "create connection fail"); status = SaveConnection(generalConnection); if (status != SOFTBUS_OK) { generalConnection->dereference(generalConnection); @@ -1117,7 +1117,7 @@ static int32_t Connect(const GeneralConnectionParam *param, const char *addr) } status= StartConnConnectDevice(generalConnection->addr, BLE_COC, &result, generalConnection->requestId); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "connect failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "connect fail, err=%{public}d", status); ConnRemoveGeneralConnection(generalConnection); generalConnection->dereference(generalConnection); return SOFTBUS_CONN_GENERAL_CONNECT_FAILED; @@ -1125,7 +1125,7 @@ static int32_t Connect(const GeneralConnectionParam *param, const char *addr) status = ConnPostMsgToLooper(&g_generalManagerSyncHandler, GENERAL_MGR_MSG_CONNECT_TIMEOUT, generalConnection->generalId, 0, NULL, GENERAL_CONNECT_TIMEOUT_MILLIS); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "post timeout msg failed, err=%{public}d", status); + CONN_LOGE(CONN_BLE, "post timeout msg fail, err=%{public}d", status); ConnRemoveGeneralConnection(generalConnection); generalConnection->dereference(generalConnection); return status; @@ -1159,7 +1159,7 @@ static int32_t Send(uint32_t generalHandle, const uint8_t *data, uint32_t dataLe "invalid param, generalId=%{public}u", generalHandle); int32_t status = SoftBusMutexLock(&generalConnection->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "lock failed, handle=%{public}u, err=%{public}u", + CONN_LOGE(CONN_BLE, "lock fail, handle=%{public}u, err=%{public}u", generalConnection->generalId, status); ConnReturnGeneralConnection(&generalConnection); return SOFTBUS_LOCK_ERR; @@ -1199,7 +1199,7 @@ static void Disconnect(uint32_t generalHandle, int32_t pid) static int32_t GetPeerDeviceId(uint32_t generalHandle, char *addr, uint32_t length, uint32_t tokenId, int32_t pid) { CONN_CHECK_AND_RETURN_RET_LOGE(addr != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "addr is null, get deviceId failed"); + "addr is null, get deviceId fail"); CONN_CHECK_AND_RETURN_RET_LOGE(length == BT_MAC_LEN, SOFTBUS_INVALID_PARAM, CONN_BLE, "invalid param, generalId=%{public}u, len=%{public}u", generalHandle, length); @@ -1208,7 +1208,7 @@ static int32_t GetPeerDeviceId(uint32_t generalHandle, char *addr, uint32_t leng "invalid param, generalId=%{public}u", generalHandle); int32_t status = SoftBusGetRandomAddress(generalConnection->addr, addr, (int32_t)tokenId); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_BLE, "get mac failed, generalId=%{public}u", generalHandle); + CONN_LOGE(CONN_BLE, "get mac fail, generalId=%{public}u", generalHandle); } ConnReturnGeneralConnection(&generalConnection); return status; @@ -1217,14 +1217,14 @@ static int32_t GetPeerDeviceId(uint32_t generalHandle, char *addr, uint32_t leng static int32_t CreateServer(const GeneralConnectionParam *param) { CONN_CHECK_AND_RETURN_RET_LOGE(param != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, - "create server failed, param is null"); + "create server fail, param is null"); if (!IsAllowSave(param->bundleName, true)) { CONN_LOGE(CONN_BLE, "add pkg name is max"); return SOFTBUS_CONN_GENERAL_CREATE_SERVER_MAX; } int32_t status = SoftBusMutexLock(&g_generalManager.servers->lock); CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, - CONN_BLE, "lock servers failed"); + CONN_BLE, "lock servers fail"); Server *it = NULL; bool exit = false; LIST_FOR_EACH_ENTRY(it, &g_generalManager.servers->list, Server, node) { @@ -1252,9 +1252,9 @@ static int32_t CreateServer(const GeneralConnectionParam *param) static void CloseServer(const GeneralConnectionParam *param) { - CONN_CHECK_AND_RETURN_LOGE(param != NULL, CONN_BLE, "close server failed, param is null"); + CONN_CHECK_AND_RETURN_LOGE(param != NULL, CONN_BLE, "close server fail, param is null"); int32_t status = SoftBusMutexLock(&g_generalManager.servers->lock); - CONN_CHECK_AND_RETURN_LOGE(status == SOFTBUS_OK, CONN_BLE, "lock names failed"); + CONN_CHECK_AND_RETURN_LOGE(status == SOFTBUS_OK, CONN_BLE, "lock names fail"); Server *it = NULL; Server *next = NULL; LIST_FOR_EACH_ENTRY_SAFE(it, next, &g_generalManager.servers->list, Server, node) { @@ -1292,23 +1292,23 @@ int32_t InitGeneralConnectionManager(void) .OnDataReceived = OnCommDataReceived, }; int32_t ret = SoftBusMutexInit(&g_requestIdLock, NULL); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_INIT, "init lock failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_INIT, "init lock fail"); ret = ConnSetConnectCallback(MODULE_BLE_GENERAL, &connCb); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_INIT, "set callback failed"); + CONN_LOGE(CONN_INIT, "set callback fail"); SoftBusMutexDestroy(&g_requestIdLock); return ret; } SoftBusList *connections = CreateSoftBusList(); if (connections == NULL) { - CONN_LOGE(CONN_INIT, "create connections list failed"); + CONN_LOGE(CONN_INIT, "create connections list fail"); SoftBusMutexDestroy(&g_requestIdLock); return SOFTBUS_CREATE_LIST_ERR; } g_generalManager.connections = connections; SoftBusList *servers = CreateSoftBusList(); if (servers == NULL) { - CONN_LOGE(CONN_INIT, "create servers list failed"); + CONN_LOGE(CONN_INIT, "create servers list fail"); SoftBusMutexDestroy(&g_requestIdLock); DestroySoftBusList(g_generalManager.connections); return SOFTBUS_CREATE_LIST_ERR; @@ -1316,7 +1316,7 @@ int32_t InitGeneralConnectionManager(void) g_generalManager.servers = servers; g_generalManagerSyncHandler.handler.looper = GetLooper(LOOP_TYPE_CONN); if (g_generalManagerSyncHandler.handler.looper == NULL) { - CONN_LOGE(CONN_INIT, "create names list failed"); + CONN_LOGE(CONN_INIT, "create names list fail"); SoftBusMutexDestroy(&g_requestIdLock); DestroySoftBusList(g_generalManager.connections); DestroySoftBusList(g_generalManager.servers); diff --git a/core/connection/general/softbus_conn_general_negotiation.c b/core/connection/general/softbus_conn_general_negotiation.c index 34a5331606..d9c7297e5d 100644 --- a/core/connection/general/softbus_conn_general_negotiation.c +++ b/core/connection/general/softbus_conn_general_negotiation.c @@ -54,9 +54,9 @@ static OutData *ConstructOutData(GeneralConnectionInfo *info, GeneralConnectionM OutData *GeneralConnectionPackMsg(GeneralConnectionInfo *info, GeneralConnectionMsgType msgType) { - CONN_CHECK_AND_RETURN_RET_LOGE(info != NULL, NULL, CONN_BLE, "pack msg failed, info is null"); + CONN_CHECK_AND_RETURN_RET_LOGE(info != NULL, NULL, CONN_BLE, "pack msg fail, info is null"); cJSON *json = cJSON_CreateObject(); - CONN_CHECK_AND_RETURN_RET_LOGE(json != NULL, NULL, CONN_BLE, "create json object failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(json != NULL, NULL, CONN_BLE, "create json object fail"); int32_t status = SOFTBUS_OK; switch (msgType) { case GENERAL_CONNECTION_MSG_TYPE_HANDSHAKE: @@ -91,7 +91,7 @@ OutData *GeneralConnectionPackMsg(GeneralConnectionInfo *info, GeneralConnection char *payload = cJSON_PrintUnformatted(json); cJSON_Delete(json); - CONN_CHECK_AND_RETURN_RET_LOGE(payload != NULL, NULL, CONN_BLE, "cJSON_PrintUnformatted failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(payload != NULL, NULL, CONN_BLE, "cJSON_PrintUnformatted fail"); OutData *outData = ConstructOutData(info, msgType, payload); if (outData == NULL) { cJSON_free(payload); @@ -105,11 +105,11 @@ OutData *GeneralConnectionPackMsg(GeneralConnectionInfo *info, GeneralConnection int32_t GeneralConnectionUnpackMsg(const uint8_t *data, uint32_t dataLen, GeneralConnectionInfo *info, GeneralConnectionMsgType parseMsgType) { - CONN_CHECK_AND_RETURN_RET_LOGE(data != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, "unpack msg failed, data is null"); - CONN_CHECK_AND_RETURN_RET_LOGE(info != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, "unpack msg failed, info is null"); + CONN_CHECK_AND_RETURN_RET_LOGE(data != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, "unpack msg fail, data is null"); + CONN_CHECK_AND_RETURN_RET_LOGE(info != NULL, SOFTBUS_INVALID_PARAM, CONN_BLE, "unpack msg fail, info is null"); cJSON *json = cJSON_ParseWithLength((char *)data, dataLen); - CONN_CHECK_AND_RETURN_RET_LOGE(json != NULL, SOFTBUS_PARSE_JSON_ERR, CONN_BLE, "parse json failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(json != NULL, SOFTBUS_PARSE_JSON_ERR, CONN_BLE, "parse json fail"); int32_t status = SOFTBUS_OK; switch (parseMsgType) { case GENERAL_CONNECTION_MSG_TYPE_HANDSHAKE: diff --git a/core/connection/ipc/standard/src/general_connection_client_proxy_standard.cpp b/core/connection/ipc/standard/src/general_connection_client_proxy_standard.cpp index 4296601184..ad7ea9c428 100644 --- a/core/connection/ipc/standard/src/general_connection_client_proxy_standard.cpp +++ b/core/connection/ipc/standard/src/general_connection_client_proxy_standard.cpp @@ -31,19 +31,19 @@ int32_t ConnectionClientProxy::OnConnectionStateChange(uint32_t handle, int32_t } MessageParcel data; if (!data.WriteInterfaceToken(GetDescriptor())) { - CONN_LOGE(CONN_COMMON, "write InterfaceToken failed."); + CONN_LOGE(CONN_COMMON, "write InterfaceToken fail."); return SOFTBUS_IPC_ERR; } if (!data.WriteUint32(handle)) { - CONN_LOGE(CONN_COMMON, "write handle failed."); + CONN_LOGE(CONN_COMMON, "write handle fail."); return SOFTBUS_IPC_ERR; } if (!data.WriteInt32(state)) { - CONN_LOGE(CONN_COMMON, "write state failed."); + CONN_LOGE(CONN_COMMON, "write state fail."); return SOFTBUS_IPC_ERR; } if (!data.WriteInt32(reason)) { - CONN_LOGE(CONN_COMMON, "write reason failed."); + CONN_LOGE(CONN_COMMON, "write reason fail."); return SOFTBUS_IPC_ERR; } @@ -51,7 +51,7 @@ int32_t ConnectionClientProxy::OnConnectionStateChange(uint32_t handle, int32_t MessageOption option = { MessageOption::TF_ASYNC }; int32_t ret = remote->SendRequest(CLIENT_GENERAL_CONNECTION_STATE_CHANGE, data, reply, option); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "OnConnectionStateChange send request failed, ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "OnConnectionStateChange send request fail, ret=%{public}d", ret); return ret; } return SOFTBUS_OK; @@ -66,15 +66,15 @@ int32_t ConnectionClientProxy::OnAcceptConnect(const char *name, uint32_t handle } MessageParcel data; if (!data.WriteInterfaceToken(GetDescriptor())) { - CONN_LOGE(CONN_COMMON, "write InterfaceToken failed."); + CONN_LOGE(CONN_COMMON, "write InterfaceToken fail."); return SOFTBUS_IPC_ERR; } if (!data.WriteCString(name)) { - CONN_LOGE(CONN_COMMON, "write name failed."); + CONN_LOGE(CONN_COMMON, "write name fail."); return SOFTBUS_IPC_ERR; } if (!data.WriteUint32(handle)) { - CONN_LOGE(CONN_COMMON, "write handle failed."); + CONN_LOGE(CONN_COMMON, "write handle fail."); return SOFTBUS_IPC_ERR; } @@ -82,7 +82,7 @@ int32_t ConnectionClientProxy::OnAcceptConnect(const char *name, uint32_t handle MessageOption option = { MessageOption::TF_ASYNC }; int32_t ret = remote->SendRequest(CLIENT_GENERAL_ACCEPT_CONNECT, data, reply, option); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "OnAcceptConnect send request failed, ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "OnAcceptConnect send request fail, ret=%{public}d", ret); return ret; } return SOFTBUS_OK; @@ -97,19 +97,19 @@ int32_t ConnectionClientProxy::OnDataReceived(uint32_t handle, const uint8_t *da } MessageParcel dataParcel; if (!dataParcel.WriteInterfaceToken(GetDescriptor())) { - CONN_LOGE(CONN_COMMON, "write InterfaceToken failed."); + CONN_LOGE(CONN_COMMON, "write InterfaceToken fail."); return SOFTBUS_IPC_ERR; } if (!dataParcel.WriteUint32(handle)) { - CONN_LOGE(CONN_COMMON, "write handle failed."); + CONN_LOGE(CONN_COMMON, "write handle fail."); return SOFTBUS_IPC_ERR; } if (!dataParcel.WriteUint32(len)) { - CONN_LOGE(CONN_COMMON, "write len failed."); + CONN_LOGE(CONN_COMMON, "write len fail."); return SOFTBUS_IPC_ERR; } if (!dataParcel.WriteBuffer(data, len)) { - CONN_LOGE(CONN_COMMON, "write data failed."); + CONN_LOGE(CONN_COMMON, "write data fail."); return SOFTBUS_IPC_ERR; } @@ -117,7 +117,7 @@ int32_t ConnectionClientProxy::OnDataReceived(uint32_t handle, const uint8_t *da MessageOption option = { MessageOption::TF_ASYNC }; int32_t ret = remote->SendRequest(CLIENT_GENERAL_DATA_RECEIVED, dataParcel, replyParcel, option); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "OnDataReceived send request failed, ret=%{public}d", ret); + CONN_LOGE(CONN_COMMON, "OnDataReceived send request fail, ret=%{public}d", ret); return ret; } return SOFTBUS_OK; diff --git a/core/connection/manager/softbus_conn_flow_control.c b/core/connection/manager/softbus_conn_flow_control.c index 2ceaef9d12..479ab93f8f 100644 --- a/core/connection/manager/softbus_conn_flow_control.c +++ b/core/connection/manager/softbus_conn_flow_control.c @@ -32,7 +32,7 @@ static int32_t Apply(struct ConnSlideWindowController *self, int32_t expect) CONN_CHECK_AND_RETURN_RET_LOGE(self, SOFTBUS_INVALID_PARAM, CONN_COMMON, "invalid parameter, controller is null"); int32_t status = SoftBusMutexLock(&self->lock); - CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_COMMON, "lock failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_COMMON, "lock fail"); if (!self->active) { (void)SoftBusMutexUnlock(&self->lock); return expect; @@ -97,7 +97,7 @@ static int32_t ChangeConfiguration( } int32_t status = SoftBusMutexLock(&self->lock); - CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_COMMON, "lock failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(status == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_COMMON, "lock fail"); self->windowInMillis = windowInMillis; self->quotaInBytes = quotaInBytes; @@ -122,7 +122,7 @@ int32_t ConnSlideWindowControllerConstructor(struct ConnSlideWindowController *s { CONN_CHECK_AND_RETURN_RET_LOGE(self, SOFTBUS_INVALID_PARAM, CONN_COMMON, "invalid parameter, controller is null"); int32_t ret = SoftBusMutexInit(&self->lock, NULL); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_COMMON, "init lock failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, SOFTBUS_LOCK_ERR, CONN_COMMON, "init lock fail"); self->active = false; self->windowInMillis = -1; @@ -139,7 +139,7 @@ void ConnSlideWindowControllerDestructor(struct ConnSlideWindowController *self) { CONN_CHECK_AND_RETURN_LOGE(self, CONN_COMMON, "invalid parameter, controller is null"); int32_t status = SoftBusMutexLock(&self->lock); - CONN_CHECK_AND_RETURN_LOGE(status == SOFTBUS_OK, CONN_COMMON, "lock failed"); + CONN_CHECK_AND_RETURN_LOGE(status == SOFTBUS_OK, CONN_COMMON, "lock fail"); CleanupHistoriesUnsafe(self); SoftBusMutexDestroy(&self->lock); } @@ -147,7 +147,7 @@ void ConnSlideWindowControllerDestructor(struct ConnSlideWindowController *self) struct ConnSlideWindowController *ConnSlideWindowControllerNew(void) { struct ConnSlideWindowController *controller = SoftBusCalloc(sizeof(*controller)); - CONN_CHECK_AND_RETURN_RET_LOGE(controller, NULL, CONN_COMMON, "alloc failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(controller, NULL, CONN_COMMON, "alloc fail"); int32_t ret = ConnSlideWindowControllerConstructor(controller); if (ret != SOFTBUS_OK) { diff --git a/core/connection/manager/softbus_conn_init.c b/core/connection/manager/softbus_conn_init.c index a4d4473324..57c011cc2a 100644 --- a/core/connection/manager/softbus_conn_init.c +++ b/core/connection/manager/softbus_conn_init.c @@ -31,12 +31,12 @@ int32_t ConnOpenFuncInit(void *soHandle) int32_t (*connRegisterOpenfunc)(void); int ret = SoftBusDlsym(soHandle, "ConnRegisterOpenFunc", (void**)&connRegisterOpenfunc); if (ret != SOFTBUS_OK) { - COMM_LOGE(COMM_SVC, "dlsym ConnRegisterOpenFunc failed, ret=%d", ret); + COMM_LOGE(COMM_SVC, "dlsym ConnRegisterOpenFunc fail, ret=%d", ret); return SOFTBUS_NETWORK_DLSYM_FAILED; } if (connRegisterOpenfunc() != SOFTBUS_OK) { - COMM_LOGE(COMM_SVC, "ConnRegisterOpenFunc return failed, ret=%d", ret); + COMM_LOGE(COMM_SVC, "ConnRegisterOpenFunc return fail, ret=%d", ret); return SOFTBUS_NETWORK_CONN_OPEN_FUNC_INIT_FAILED; } diff --git a/core/connection/manager/softbus_conn_ipc.c b/core/connection/manager/softbus_conn_ipc.c index 2117cf3470..87f53d6a87 100644 --- a/core/connection/manager/softbus_conn_ipc.c +++ b/core/connection/manager/softbus_conn_ipc.c @@ -69,7 +69,7 @@ int32_t InitGeneralConnection(void) { int32_t ret = InitGeneralConnectionManager(); if (ret != SOFTBUS_OK) { - COMM_LOGE(CONN_COMMON, "init general manager failed, err=%{public}d", ret); + COMM_LOGE(CONN_COMMON, "init general manager fail, err=%{public}d", ret); return SOFTBUS_NO_INIT; } @@ -80,7 +80,7 @@ int32_t InitGeneralConnection(void) } ret = manager->registerListener(&g_baseListener); if (ret != SOFTBUS_OK) { - COMM_LOGE(CONN_COMMON, "init general manager failed, err=%{public}d", ret); + COMM_LOGE(CONN_COMMON, "init general manager fail, err=%{public}d", ret); return SOFTBUS_NO_INIT; } COMM_LOGI(CONN_COMMON, "init and refister listener success"); diff --git a/core/connection/manager/softbus_conn_manager.c b/core/connection/manager/softbus_conn_manager.c index 1029b61713..67ca7e897e 100644 --- a/core/connection/manager/softbus_conn_manager.c +++ b/core/connection/manager/softbus_conn_manager.c @@ -92,7 +92,7 @@ static int32_t GetAllListener(ConnListenerNode **node) } if (SoftBusMutexLock(&g_listenerList->lock) != 0) { - CONN_LOGE(CONN_COMMON, "lock mutex failed"); + CONN_LOGE(CONN_COMMON, "lock mutex fail"); return 0; } @@ -104,7 +104,7 @@ static int32_t GetAllListener(ConnListenerNode **node) *node = SoftBusCalloc(g_listenerList->cnt * sizeof(ConnListenerNode)); if (*node == NULL) { - CONN_LOGE(CONN_COMMON, "malloc failed"); + CONN_LOGE(CONN_COMMON, "malloc fail"); (void)SoftBusMutexUnlock(&g_listenerList->lock); return cnt; } @@ -129,7 +129,7 @@ static int32_t GetListenerByModuleId(ConnModule moduleId, ConnListenerNode *node } int ret = SOFTBUS_OK; if (SoftBusMutexLock(&g_listenerList->lock) != 0) { - CONN_LOGE(CONN_COMMON, "lock mutex failed"); + CONN_LOGE(CONN_COMMON, "lock mutex fail"); return SOFTBUS_LOCK_ERR; } LIST_FOR_EACH_ENTRY(listenerNode, &g_listenerList->list, ConnListenerNode, node) { @@ -155,7 +155,7 @@ static int32_t AddListener(ConnModule moduleId, const ConnectCallback *callback) return SOFTBUS_INVALID_PARAM; } if (SoftBusMutexLock(&g_listenerList->lock) != 0) { - CONN_LOGE(CONN_COMMON, "lock mutex failed"); + CONN_LOGE(CONN_COMMON, "lock mutex fail"); return SOFTBUS_LOCK_ERR; } LIST_FOR_EACH_ENTRY(listNode, &g_listenerList->list, ConnListenerNode, node) { @@ -166,7 +166,7 @@ static int32_t AddListener(ConnModule moduleId, const ConnectCallback *callback) } item = (ConnListenerNode *)SoftBusCalloc(sizeof(ConnListenerNode)); if (item == NULL) { - CONN_LOGE(CONN_COMMON, "malloc failed"); + CONN_LOGE(CONN_COMMON, "malloc fail"); (void)SoftBusMutexUnlock(&g_listenerList->lock); return SOFTBUS_MALLOC_ERR; } @@ -188,7 +188,7 @@ static void DelListener(ConnModule moduleId) } if (SoftBusMutexLock(&g_listenerList->lock) != 0) { - CONN_LOGE(CONN_COMMON, "lock mutex failed"); + CONN_LOGE(CONN_COMMON, "lock mutex fail"); return; } @@ -216,7 +216,7 @@ uint32_t ConnGetNewRequestId(ConnModule moduleId) { #define REQID_MAX 1000000 (void)moduleId; - CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_ReqLock) == SOFTBUS_OK, g_ReqId, CONN_COMMON, "lock failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexLock(&g_ReqLock) == SOFTBUS_OK, g_ReqId, CONN_COMMON, "lock fail"); g_ReqId++; g_ReqId = g_ReqId % REQID_MAX + 1; @@ -228,15 +228,15 @@ uint32_t ConnGetNewRequestId(ConnModule moduleId) void ConnManagerRecvData(uint32_t connectionId, ConnModule moduleId, int64_t seq, char *data, int32_t len) { CONN_CHECK_AND_RETURN_LOGW(data != NULL, CONN_COMMON, - "dispatch data failed: data is null, connectionId=%{public}u, module=%{public}d", connectionId, moduleId); + "dispatch data fail: data is null, connectionId=%{public}u, module=%{public}d", connectionId, moduleId); CONN_CHECK_AND_RETURN_LOGW(len > (int32_t)sizeof(ConnPktHead), CONN_COMMON, - "dispatch data failed: dataLen=%{public}d < connection header size, " + "dispatch data fail: dataLen=%{public}d < connection header size, " "connectionId=%{public}u, module=%{public}d", len, connectionId, moduleId); ConnListenerNode listener = { 0 }; int32_t status = GetListenerByModuleId(moduleId, &listener); CONN_CHECK_AND_RETURN_LOGW(status == SOFTBUS_OK, CONN_COMMON, - "dispatch data failed: get module listener failed or not register, " + "dispatch data fail: get module listener fail or not register, " "connectionId=%{public}u, module=%{public}d, dataLen=%{public}d, err=%{public}d", connectionId, moduleId, len, status); @@ -252,7 +252,7 @@ void ConnManagerConnected(uint32_t connectionId, const ConnectionInfo *info) int32_t num = GetAllListener(&node); if (num == 0 || node == NULL) { - CONN_LOGE(CONN_COMMON, "get node failed, connId=%{public}u", connectionId); + CONN_LOGE(CONN_COMMON, "get node fail, connId=%{public}u", connectionId); SoftBusFree(node); return; } @@ -272,7 +272,7 @@ void ConnManagerReusedConnected(uint32_t connectionId, const ConnectionInfo *inf int32_t num = GetAllListener(&node); if (num == 0 || node == NULL) { - CONN_LOGE(CONN_COMMON, "get node failed, connId=%{public}u", connectionId); + CONN_LOGE(CONN_COMMON, "get node fail, connId=%{public}u", connectionId); SoftBusFree(node); return; } @@ -294,7 +294,7 @@ void ConnManagerDisconnected(uint32_t connectionId, const ConnectionInfo *info) int32_t num = GetAllListener(&node); if (num == 0 || node == NULL) { - CONN_LOGE(CONN_COMMON, "get node failed, connId=%{public}u", connectionId); + CONN_LOGE(CONN_COMMON, "get node fail, connId=%{public}u", connectionId); SoftBusFree(node); return; } @@ -309,7 +309,7 @@ void ConnManagerDisconnected(uint32_t connectionId, const ConnectionInfo *info) int32_t ConnSetConnectCallback(ConnModule moduleId, const ConnectCallback *callback) { if (ModuleCheck(moduleId) != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "module check failed, moduleId=%{public}d", moduleId); + CONN_LOGE(CONN_COMMON, "module check fail, moduleId=%{public}d", moduleId); return SOFTBUS_INVALID_PARAM; } @@ -461,11 +461,11 @@ int32_t ConnSetKeepaliveByConnectionId(uint32_t connectionId, bool needKeepalive ConnectType type; int32_t ret = ConnGetTypeByConnectionId(connectionId, &type); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, - SOFTBUS_CONN_MANAGER_TYPE_NOT_SUPPORT, CONN_COMMON, "get connect type failed"); + SOFTBUS_CONN_MANAGER_TYPE_NOT_SUPPORT, CONN_COMMON, "get connect type fail"); CONN_CHECK_AND_RETURN_RET_LOGE(type == CONNECT_TCP || type == CONNECT_P2P || type == CONNECT_P2P_REUSE || type == CONNECT_HML, SOFTBUS_INVALID_PARAM, CONN_COMMON, "connect type is not tcp"); ret = ConnGetConnectionInfo(connectionId, &info); - CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_COMMON, "set keepalive failed, ret=%{public}d", ret); + CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_COMMON, "set keepalive fail, ret=%{public}d", ret); return TcpConnSetKeepalive(info.socketInfo.fd, needKeepalive); } @@ -527,13 +527,13 @@ static int32_t ConnSocketsAndBaseListenerInit(void) int32_t ret = ConnInitSockets(); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_INIT, "ConnInitSockets failed! ret=%{public}" PRId32 " \r\n", ret); + CONN_LOGE(CONN_INIT, "ConnInitSockets fail! ret=%{public}" PRId32 " \r\n", ret); return ret; } ret = InitBaseListener(); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_INIT, "InitBaseListener failed! ret=%{public}" PRId32 " \r\n", ret); + CONN_LOGE(CONN_INIT, "InitBaseListener fail! ret=%{public}" PRId32 " \r\n", ret); return ret; } return SOFTBUS_OK; @@ -542,7 +542,7 @@ static int32_t ConnSocketsAndBaseListenerInit(void) int32_t ConnServerInit(void) { int32_t ret = ConnSocketsAndBaseListenerInit(); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_COMMON, "init failed."); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_COMMON, "init fail."); g_connManagerCb.OnConnected = ConnManagerConnected; g_connManagerCb.OnReusedConnected = ConnManagerReusedConnected; g_connManagerCb.OnDisconnected = ConnManagerDisconnected; @@ -580,18 +580,18 @@ int32_t ConnServerInit(void) if (g_listenerList == NULL) { g_listenerList = CreateSoftBusList(); if (g_listenerList == NULL) { - CONN_LOGE(CONN_COMMON, "create list failed"); + CONN_LOGE(CONN_COMMON, "create list fail"); return SOFTBUS_CREATE_LIST_ERR; } } CONN_CHECK_AND_RETURN_RET_LOGE(InitGeneralConnection() == SOFTBUS_OK, - SOFTBUS_CONN_INTERNAL_ERR, CONN_COMMON, "init failed."); + SOFTBUS_CONN_INTERNAL_ERR, CONN_COMMON, "init fail."); CONN_CHECK_AND_RETURN_RET_LOGE(ProxyChannelManagerInit() == SOFTBUS_OK, - SOFTBUS_CONN_INTERNAL_ERR, CONN_COMMON, "init proxy manager failed"); + SOFTBUS_CONN_INTERNAL_ERR, CONN_COMMON, "init proxy manager fail"); CONN_CHECK_AND_RETURN_RET_LOGE(SoftBusMutexInit(&g_ReqLock, NULL) == SOFTBUS_OK, - SOFTBUS_CONN_INTERNAL_ERR, CONN_COMMON, "g_ReqLock init lock failed."); + SOFTBUS_CONN_INTERNAL_ERR, CONN_COMMON, "g_ReqLock init lock fail."); atomic_store_explicit(&g_isInited, true, memory_order_release); CONN_LOGI(CONN_COMMON, "connect manager init success."); diff --git a/core/connection/proxy/proxy_connection.c b/core/connection/proxy/proxy_connection.c index b64c84cf92..3b5af44b36 100644 --- a/core/connection/proxy/proxy_connection.c +++ b/core/connection/proxy/proxy_connection.c @@ -36,13 +36,13 @@ static int32_t LegacyBrLoopRead(struct ProxyConnection *connection) { #define BUFFER_SIZE (1024 * 2) uint8_t *buffer = (uint8_t *)SoftBusCalloc(BUFFER_SIZE); - CONN_CHECK_AND_RETURN_RET_LOGE(buffer != NULL, SOFTBUS_MALLOC_ERR, CONN_PROXY, "create buffer failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(buffer != NULL, SOFTBUS_MALLOC_ERR, CONN_PROXY, "create buffer fail"); uint32_t channelId = connection->channelId; int32_t ret = SOFTBUS_OK; while (true) { ret = SoftBusMutexLock(&connection->lock); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_PROXY, "get lock failed, channelId=%{public}u, err=%{public}d", channelId, ret); + CONN_LOGE(CONN_PROXY, "get lock fail, channelId=%{public}u, err=%{public}d", channelId, ret); ret = SOFTBUS_LOCK_ERR; break; } @@ -86,17 +86,17 @@ static int32_t StartClientConnect(struct ProxyConnection *connection) uint8_t binaryAddr[BT_ADDR_LEN] = { 0 }; int32_t ret = ConvertBtMacToBinary(connection->proxyChannel.brMac, BT_MAC_LEN, binaryAddr, BT_ADDR_LEN); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, - ret, CONN_PROXY, "convert btMac to binary failed, error=%{public}d", ret); + ret, CONN_PROXY, "convert btMac to binary fail, error=%{public}d", ret); BtSocketConnectionCallback callback = { .connStateCb = BrConnectCallback, }; int32_t socketHandle = g_sppDriver->Connect(connection->proxyChannel.uuid, binaryAddr, &callback); if (socketHandle < 0) { - CONN_LOGE(CONN_PROXY, "connect failed, socketHandle=%{public}d", socketHandle); + CONN_LOGE(CONN_PROXY, "connect fail, socketHandle=%{public}d", socketHandle); return SOFTBUS_CONN_BR_UNDERLAY_CONNECT_FAIL; } if (SoftBusMutexLock(&connection->lock) != SOFTBUS_OK) { - CONN_LOGE(CONN_PROXY, "get lock failed, connId=%{public}u", connection->channelId); + CONN_LOGE(CONN_PROXY, "get lock fail, connId=%{public}u", connection->channelId); g_sppDriver->DisConnect(socketHandle); return SOFTBUS_LOCK_ERR; } @@ -145,7 +145,7 @@ static void *ProxyBrClientConnect(void *data) CONN_LOGW(CONN_PROXY, "client loop read exit, channelId=%{public}u, socketHandle=%{public}d, error=%{public}d", connection->channelId, connection->socketHandle, ret); if (SoftBusMutexLock(&connection->lock) != SOFTBUS_OK) { - CONN_LOGE(CONN_PROXY, "lock connection failed, channelId=%{public}u", connection->channelId); + CONN_LOGE(CONN_PROXY, "lock connection fail, channelId=%{public}u", connection->channelId); g_sppDriver->DisConnect(connection->socketHandle); g_eventListener.onDisconnected(connection->channelId, SOFTBUS_LOCK_ERR); break; @@ -170,12 +170,12 @@ int32_t ProxyBrConnect(struct ProxyConnection *connection, const ProxyBrConnectS "callback is null"); ProxyBrConnectContext *ctx = (ProxyBrConnectContext *)SoftBusCalloc(sizeof(ProxyBrConnectContext)); CONN_CHECK_AND_RETURN_RET_LOGE(ctx != NULL, SOFTBUS_LOCK_ERR, CONN_PROXY, - "calloc failed, connId=%{public}u", connection->channelId); + "calloc fail, connId=%{public}u", connection->channelId); ctx->channelId = connection->channelId; ctx->callback = *callback; int32_t status = ConnStartActionAsync(ctx, ProxyBrClientConnect, "Proxy_Conn"); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_PROXY, "start connect thread failed, connId=%{public}u, error=%{public}d", + CONN_LOGE(CONN_PROXY, "start connect thread fail, connId=%{public}u, error=%{public}d", connection->channelId, status); SoftBusFree(ctx); return status; @@ -189,7 +189,7 @@ static int32_t Disconnect(struct ProxyConnection *connection) SOFTBUS_INVALID_PARAM, CONN_PROXY, "connection is null"); int32_t ret = SoftBusMutexLock(&connection->lock); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_PROXY, - "br disconnect lock failed, connId=%{public}u, ret=%{public}d", connection->channelId, ret); + "br disconnect lock fail, connId=%{public}u, ret=%{public}d", connection->channelId, ret); int32_t socketHandle = connection->socketHandle; if (connection->socketHandle == BR_INVALID_SOCKET_HANDLE) { connection->state = PROXY_CHANNEL_DISCONNECTED; @@ -210,7 +210,7 @@ static int32_t Send(struct ProxyConnection *connection, const uint8_t *data, uin SOFTBUS_INVALID_PARAM, CONN_PROXY, "connection is null"); int32_t ret = SoftBusMutexLock(&connection->lock); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_PROXY, - "lock connection failed, channelId=%{public}u, ret=%{public}d", connection->channelId, ret); + "lock connection fail, channelId=%{public}u, ret=%{public}d", connection->channelId, ret); if (connection->state != PROXY_CHANNEL_CONNECTED) { CONN_LOGE(CONN_PROXY, "connection is not ready, currentState=%{public}d", connection->state); SoftBusMutexUnlock(&connection->lock); @@ -234,7 +234,7 @@ static int32_t Send(struct ProxyConnection *connection, const uint8_t *data, uin int32_t written = g_sppDriver->Write(socketHandle, data, waitWriteLen); if (written < 0) { CONN_LOGE(CONN_PROXY, - "send data failed, channelId=%{public}u, totalLen=%{public}u, waitWriteLen=%{public}d, " + "send data fail, channelId=%{public}u, totalLen=%{public}u, waitWriteLen=%{public}d, " "alreadyWriteLen=%{public}d, error=%{public}d", connection->channelId, dataLen, waitWriteLen, dataLen - waitWriteLen, written); return SOFTBUS_CONN_BR_UNDERLAY_WRITE_FAIL; @@ -255,7 +255,7 @@ int32_t RegisterEventListener(const ProxyEventListener *listener) g_eventListener = *listener; g_sppDriver = InitSppSocketDriver(); CONN_CHECK_AND_RETURN_RET_LOGE(g_sppDriver != NULL, SOFTBUS_CONN_PROXY_INTERNAL_ERR, CONN_INIT, - "init spp socket driver failed"); + "init spp socket driver fail"); return SOFTBUS_OK; } diff --git a/core/connection/proxy/proxy_manager.c b/core/connection/proxy/proxy_manager.c index 19a1a63d0e..d0635e8b34 100644 --- a/core/connection/proxy/proxy_manager.c +++ b/core/connection/proxy/proxy_manager.c @@ -87,7 +87,7 @@ static uint32_t GenerateRequestId(void) { int32_t ret = SoftBusMutexLock(&g_reqIdLock); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, PROXY_CHANNEL_MAX_STATE, CONN_PROXY, - "lock channel failed=%{public}d", ret); + "lock channel fail=%{public}d", ret); uint32_t reqId = g_reqId++; SoftBusMutexUnlock(&g_reqIdLock); return reqId; @@ -97,7 +97,7 @@ static ProxyChannelState GetProxyChannelState(struct ProxyConnection *proxyConne { int32_t ret = SoftBusMutexLock(&proxyConnection->lock); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, PROXY_CHANNEL_MAX_STATE, CONN_PROXY, - "lock channel failed. channelId=%{public}u, error=%{public}d", proxyConnection->channelId, ret); + "lock channel fail. channelId=%{public}u, error=%{public}d", proxyConnection->channelId, ret); ProxyChannelState state = proxyConnection->state; SoftBusMutexUnlock(&proxyConnection->lock); return state; @@ -107,7 +107,7 @@ static ProxyChannelState SetProxyChannelState(struct ProxyConnection *proxyConne { int32_t ret = SoftBusMutexLock(&proxyConnection->lock); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, PROXY_CHANNEL_MAX_STATE, CONN_PROXY, - "lock channel failed. channelId=%{public}u", proxyConnection->channelId); + "lock channel fail. channelId=%{public}u", proxyConnection->channelId); proxyConnection->state = state; SoftBusMutexUnlock(&proxyConnection->lock); return state; @@ -118,7 +118,7 @@ static void ProxyChannelDereference(struct ProxyConnection *proxyConnection) CONN_CHECK_AND_RETURN_LOGE(proxyConnection != NULL, CONN_PROXY, "proxyConnection is null"); int32_t ret = SoftBusMutexLock(&proxyConnection->lock); CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_PROXY, - "lock channel failed. channelId=%{public}u", proxyConnection->channelId); + "lock channel fail. channelId=%{public}u", proxyConnection->channelId); proxyConnection->refCount -= 1; bool destruct = (proxyConnection->refCount <= 0); SoftBusMutexUnlock(&proxyConnection->lock); @@ -133,7 +133,7 @@ static void ProxyChannelReference(struct ProxyConnection *proxyConnection) CONN_CHECK_AND_RETURN_LOGE(proxyConnection != NULL, CONN_PROXY, "proxyConnection is null"); int32_t ret = SoftBusMutexLock(&proxyConnection->lock); CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_PROXY, - "lock channel failed. channelId=%{public}u", proxyConnection->channelId); + "lock channel fail. channelId=%{public}u", proxyConnection->channelId); proxyConnection->refCount += 1; SoftBusMutexUnlock(&proxyConnection->lock); } @@ -144,7 +144,7 @@ int32_t ProxyChannelSend(struct ProxyChannel *channel, const uint8_t *data, uint CONN_CHECK_AND_RETURN_RET_LOGE(data != NULL, SOFTBUS_INVALID_PARAM, CONN_PROXY, "data is null"); struct ProxyConnection *proxyConnection = GetProxyChannelByChannelId(channel->channelId); CONN_CHECK_AND_RETURN_RET_LOGE(proxyConnection != NULL, SOFTBUS_NOT_FIND, CONN_PROXY, - "get proxyConnection failed, channelId=%{public}u", channel->channelId); + "get proxyConnection fail, channelId=%{public}u", channel->channelId); int32_t ret = GetProxyBrConnectionManager()->send(proxyConnection, data, dataLen); proxyConnection->dereference(proxyConnection); return ret; @@ -160,20 +160,20 @@ static void ProxyChannelClose(struct ProxyChannel *channel) CONN_CHECK_AND_RETURN_LOGE(channel != NULL, CONN_PROXY, "channel is null"); char *copyAddr = (char *)SoftBusCalloc(BT_MAC_LEN); if (copyAddr == NULL || strcpy_s(copyAddr, BT_MAC_LEN, channel->brMac) != EOK) { - CONN_LOGE(CONN_PROXY, "copyAddr failed"); + CONN_LOGE(CONN_PROXY, "copyAddr fail"); SoftBusFree(copyAddr); return; } int32_t ret = ConnPostMsgToLooper(&g_proxyChannelAsyncHandler, MSG_CLOSE_PROXY_CHANNEL, 0, 0, copyAddr, 0); if (ret < 0) { // fall-through - CONN_LOGE(CONN_PROXY, "send msg failed, error=%{public}d", ret); + CONN_LOGE(CONN_PROXY, "send msg fail, error=%{public}d", ret); SoftBusFree(copyAddr); } struct ProxyConnection *proxyConnection = GetProxyChannelByChannelId(channel->channelId); CONN_CHECK_AND_RETURN_LOGE(proxyConnection != NULL, CONN_PROXY, - "get proxyConnection failed, channelId=%{public}u", channel->channelId); + "get proxyConnection fail, channelId=%{public}u", channel->channelId); SetProxyChannelState(proxyConnection, PROXY_CHANNEL_DISCONNECTING); ret = GetProxyBrConnectionManager()->disconnect(proxyConnection); CONN_LOGW(CONN_PROXY, "close proxy channel=%{public}u, ret=%{public}d", channel->channelId, ret); @@ -201,7 +201,7 @@ static struct ProxyConnection *CreateProxyConnection(ProxyConnectInfo *connectIn ListInit(&proxyConnection->node); if (SoftBusMutexInit(&proxyConnection->lock, NULL) != SOFTBUS_OK) { - CONN_LOGE(CONN_PROXY, "init lock failed"); + CONN_LOGE(CONN_PROXY, "init lock fail"); SoftBusFree(proxyConnection); return NULL; } @@ -227,7 +227,7 @@ static int32_t SaveProxyConnection(struct ProxyConnection *proxyConnection) #define RETRY_MAX_NUM 100 int32_t ret = SoftBusMutexLock(&GetProxyChannelManager()->proxyConnectionList->lock); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_PROXY, "lock proxyConnectionList failed"); + CONN_LOGE(CONN_PROXY, "lock proxyConnectionList fail"); return SOFTBUS_LOCK_ERR; } uint32_t channelId = 0; @@ -237,7 +237,7 @@ static int32_t SaveProxyConnection(struct ProxyConnection *proxyConnection) retryNum++; } while (channelId == 0 && retryNum < RETRY_MAX_NUM); if (channelId == 0) { - CONN_LOGE(CONN_PROXY, "allocate channelId failed"); + CONN_LOGE(CONN_PROXY, "allocate channelId fail"); SoftBusMutexUnlock(&GetProxyChannelManager()->proxyConnectionList->lock); return SOFTBUS_CONN_PROXY_INTERNAL_ERR; } @@ -265,10 +265,10 @@ static void ProcessConnectFailed(ProxyConnectInfo *connectingChannel, const char CONN_CHECK_AND_RETURN_LOGW(isInnerRequest, CONN_PROXY, "not inner request, not retry"); // inner request retry connect after failed - CONN_LOGI(CONN_PROXY, "inner reconnect failed, retry reqId=%{public}u", requestId); + CONN_LOGI(CONN_PROXY, "inner reconnect fail, retry reqId=%{public}u", requestId); char *copyAddr = (char *)SoftBusCalloc(BT_MAC_LEN); if (copyAddr == NULL || strcpy_s(copyAddr, BT_MAC_LEN, brMac) != EOK) { - CONN_LOGE(CONN_PROXY, "copyAddr failed"); + CONN_LOGE(CONN_PROXY, "copyAddr fail"); SoftBusFree(copyAddr); return; } @@ -301,12 +301,12 @@ static void NotifyOpenProxyChannelResult(struct ProxyConnection *proxyConnection static void BrChannelConnectSuccess(uint32_t channelId) { ProxyChannelNotifyContext *ctx = (ProxyChannelNotifyContext *)SoftBusCalloc(sizeof(ProxyChannelNotifyContext)); - CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_PROXY, "on connect failed, calloc error context failed"); + CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_PROXY, "on connect fail, calloc error context fail"); ctx->channelId = channelId; ctx->isSuccess = true; int32_t ret = ConnPostMsgToLooper(&g_proxyChannelAsyncHandler, MSG_OPEN_PROXY_CHANNEL_CONNECT_RESULT, 0, 0, ctx, 0); if (ret < 0) { - CONN_LOGE(CONN_PROXY, "send msg failed, error=%{public}d", ret); + CONN_LOGE(CONN_PROXY, "send msg fail, error=%{public}d", ret); SoftBusFree(ctx); } } @@ -314,13 +314,13 @@ static void BrChannelConnectSuccess(uint32_t channelId) static void BrChannelConnectFail(uint32_t channelId, int32_t errorCode) { ProxyChannelNotifyContext *ctx = (ProxyChannelNotifyContext *)SoftBusCalloc(sizeof(ProxyChannelNotifyContext)); - CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_PROXY, "on connect failed, calloc error context failed"); + CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_PROXY, "on connect fail, calloc error context fail"); ctx->channelId = channelId; ctx->status = errorCode; ctx->isSuccess = false; int32_t ret = ConnPostMsgToLooper(&g_proxyChannelAsyncHandler, MSG_OPEN_PROXY_CHANNEL_CONNECT_RESULT, 0, 0, ctx, 0); if (ret < 0) { - CONN_LOGE(CONN_PROXY, "send msg failed, error=%{public}d", ret); + CONN_LOGE(CONN_PROXY, "send msg fail, error=%{public}d", ret); SoftBusFree(ctx); } } @@ -347,7 +347,7 @@ static void ProxyChannelConnectResultHandler(ProxyChannelNotifyContext *ctx) static struct ProxyConnection *GetProxyChannelByAddr(char *addr) { int32_t ret = SoftBusMutexLock(&GetProxyChannelManager()->proxyConnectionList->lock); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, NULL, CONN_PROXY, "lock proxyConnectionList failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, NULL, CONN_PROXY, "lock proxyConnectionList fail"); struct ProxyConnection *it = NULL; LIST_FOR_EACH_ENTRY(it, &GetProxyChannelManager()->proxyConnectionList->list, struct ProxyConnection, node) { if (StrCmpIgnoreCase(addr, it->proxyChannel.brMac) == 0) { @@ -363,7 +363,7 @@ static struct ProxyConnection *GetProxyChannelByAddr(char *addr) static struct ProxyConnection *GetProxyChannelByChannelId(uint32_t channelId) { int32_t ret = SoftBusMutexLock(&GetProxyChannelManager()->proxyConnectionList->lock); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, NULL, CONN_PROXY, "lock proxyConnectionList failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, NULL, CONN_PROXY, "lock proxyConnectionList fail"); struct ProxyConnection *it = NULL; LIST_FOR_EACH_ENTRY(it, &GetProxyChannelManager()->proxyConnectionList->list, struct ProxyConnection, node) { if (it->channelId == channelId) { @@ -379,7 +379,7 @@ static struct ProxyConnection *GetProxyChannelByChannelId(uint32_t channelId) static void RemoveProxyChannelByChannelId(uint32_t channelId) { int32_t ret = SoftBusMutexLock(&GetProxyChannelManager()->proxyConnectionList->lock); - CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_PROXY, "lock proxyConnectionList failed"); + CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_PROXY, "lock proxyConnectionList fail"); struct ProxyConnection *it = NULL; struct ProxyConnection *next = NULL; LIST_FOR_EACH_ENTRY_SAFE(it, next, &GetProxyChannelManager()->proxyConnectionList->list, @@ -436,7 +436,7 @@ static bool IsNeedReuseOrWait(ProxyConnectInfo *connectInfo) int32_t ret = ConnPostMsgToLooper(&g_proxyChannelAsyncHandler, MSG_OPEN_PROXY_CHANNEL, 0, 0, copyConnectInfo, OPEN_PROXY_CHANNEL_WAIT_MS); if (ret < 0) { - CONN_LOGE(CONN_PROXY, "send msg failed, error=%{public}d", ret); + CONN_LOGE(CONN_PROXY, "send msg fail, error=%{public}d", ret); DestoryProxyConnectInfo(©ConnectInfo); return false; } @@ -482,7 +482,7 @@ static void AddReconnectDeviceInfoUnsafe(ProxyConnectInfo *connectInfo) CONN_CHECK_AND_RETURN_LOGI(target == NULL, CONN_PROXY, "aleady exist, addr=%{public}s", anomizeAddress); ProxyConnectInfo *info = CopyProxyConnectInfo(connectInfo); - CONN_CHECK_AND_RETURN_LOGE(info != NULL, CONN_PROXY, "CopyProxyConnectInfo failed"); + CONN_CHECK_AND_RETURN_LOGE(info != NULL, CONN_PROXY, "CopyProxyConnectInfo fail"); info->isAclConnected = true; info->innerRetryNum = 0; ListAdd(&GetProxyChannelManager()->reconnectDeviceInfos, &info->node); @@ -543,7 +543,7 @@ static void OpenProxyChannelHandler(ProxyConnectInfo *connectInfo) int32_t ret = ConnPostMsgToLooper(&g_proxyChannelAsyncHandler, MSG_OPEN_PROXY_CHANNEL_TIMEOUT, connection->channelId, 0, NULL, connectInfo->timeoutMs); if (ret < 0) { - CONN_LOGE(CONN_PROXY, "send msg failed, error=%{public}d", ret); + CONN_LOGE(CONN_PROXY, "send msg fail, error=%{public}d", ret); DestoryProxyConnectInfo(&GetProxyChannelManager()->proxyChannelRequestInfo); RemoveProxyChannelByChannelId(connection->channelId); connection->dereference(connection); @@ -617,10 +617,10 @@ static int32_t OpenProxyChannel(ProxyChannelParam *param, const OpenProxyChannel ProxyConnectInfo *connectInfo = NULL; int32_t ret = CreateProxyConnectInfo(param, callback, &connectInfo); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_PROXY, - "createProxyConnectInfo failed, ret=%{public}d", ret); + "createProxyConnectInfo fail, ret=%{public}d", ret); ret = ConnPostMsgToLooper(&g_proxyChannelAsyncHandler, MSG_OPEN_PROXY_CHANNEL, 0, 0, connectInfo, 0); if (ret < 0) { - CONN_LOGE(CONN_PROXY, "send msg failed, error=%{public}d", ret); + CONN_LOGE(CONN_PROXY, "send msg fail, error=%{public}d", ret); DestoryProxyConnectInfo(&connectInfo); return ret; } @@ -631,7 +631,7 @@ static void OnProxyChannelDataReceived(uint32_t channelId, uint8_t *data, uint32 { struct ProxyConnection *proxyConnection = GetProxyChannelByChannelId(channelId); CONN_CHECK_AND_RETURN_LOGE(proxyConnection != NULL, CONN_PROXY, - "get proxyConnection failed, channelId=%{public}u", channelId); + "get proxyConnection fail, channelId=%{public}u", channelId); CONN_LOGI(CONN_PROXY, "channelId=%{public}u, dataLen=%{public}u", channelId, dataLen); if (g_listener.onProxyChannelDataReceived != NULL) { g_listener.onProxyChannelDataReceived(&proxyConnection->proxyChannel, data, dataLen); @@ -652,7 +652,7 @@ static void ProxyChannelDisconnectHandler(ProxyChannelNotifyContext *ctx) int32_t reason = ctx->status; struct ProxyConnection *proxyConnection = GetProxyChannelByChannelId(channelId); CONN_CHECK_AND_RETURN_LOGE(proxyConnection != NULL, CONN_PROXY, - "get proxyConnection failed, channelId=%{public}u", channelId); + "get proxyConnection fail, channelId=%{public}u", channelId); CONN_LOGE(CONN_PROXY, "channelId=%{public}u, disconnected err=%{public}d", channelId, reason); SetProxyChannelState(proxyConnection, PROXY_CHANNEL_DISCONNECTED); @@ -660,7 +660,7 @@ static void ProxyChannelDisconnectHandler(ProxyChannelNotifyContext *ctx) RemoveProxyChannelByChannelId(channelId); char *copyAddr = (char *)SoftBusCalloc(BT_MAC_LEN); if (copyAddr == NULL || strcpy_s(copyAddr, BT_MAC_LEN, proxyConnection->proxyChannel.brMac) != EOK) { - CONN_LOGE(CONN_PROXY, "copyAddr failed"); + CONN_LOGE(CONN_PROXY, "copyAddr fail"); SoftBusFree(copyAddr); proxyConnection->dereference(proxyConnection); return; @@ -677,12 +677,12 @@ static void ProxyChannelDisconnectHandler(ProxyChannelNotifyContext *ctx) static void OnProxyChannelDisconnected(uint32_t channelId, int32_t reason) { ProxyChannelNotifyContext *ctx = (ProxyChannelNotifyContext *)SoftBusCalloc(sizeof(ProxyChannelNotifyContext)); - CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_PROXY, "on connect failed, calloc error context failed"); + CONN_CHECK_AND_RETURN_LOGE(ctx != NULL, CONN_PROXY, "on connect fail, calloc error context fail"); ctx->channelId = channelId; ctx->status = reason; int32_t ret = ConnPostMsgToLooper(&g_proxyChannelAsyncHandler, MSG_CLOSE_PROXY_DISCONNECT, 0, 0, ctx, 0); if (ret < 0) { - CONN_LOGE(CONN_PROXY, "send msg failed, error=%{public}d", ret); + CONN_LOGE(CONN_PROXY, "send msg fail, error=%{public}d", ret); SoftBusFree(ctx); } } @@ -747,7 +747,7 @@ static void AttemptReconnectDevice(char *brAddr) uint32_t innerRetryNum = reconnectDeviceInfo->innerRetryNum; if (innerRetryNum > RETRY_CONNECT_MAX_NUM) { reconnectDeviceInfo->innerRetryNum = 0; - CONN_LOGE(CONN_PROXY, "retryNum=%{public}u, is max, retry failed", innerRetryNum); + CONN_LOGE(CONN_PROXY, "retryNum=%{public}u, is max, retry fail", innerRetryNum); struct ProxyChannel proxyChannel = { 0 }; int32_t ret = strncpy_s(proxyChannel.brMac, BT_MAC_LEN, brAddr, BT_MAC_LEN); CONN_CHECK_AND_RETURN_LOGE(ret == EOK, CONN_PROXY, "cpy mac err"); @@ -758,7 +758,7 @@ static void AttemptReconnectDevice(char *brAddr) } ProxyConnectInfo *proxyChannelRequestInfo = CopyProxyConnectInfo(reconnectDeviceInfo); - CONN_CHECK_AND_RETURN_LOGW(proxyChannelRequestInfo != NULL, CONN_PROXY, "CopyProxyConnectInfo failed"); + CONN_CHECK_AND_RETURN_LOGW(proxyChannelRequestInfo != NULL, CONN_PROXY, "CopyProxyConnectInfo fail"); uint64_t delayMillis = g_retryIntervalMillis[innerRetryNum]; reconnectDeviceInfo->innerRetryNum += 1; proxyChannelRequestInfo->result.onOpenSuccess = OnInnerReConnectSuccess; @@ -770,7 +770,7 @@ static void AttemptReconnectDevice(char *brAddr) int32_t ret = ConnPostMsgToLooper(&g_proxyChannelAsyncHandler, MSG_OPEN_PROXY_CHANNEL, 0, 0, proxyChannelRequestInfo, delayMillis); if (ret < 0) { - CONN_LOGE(CONN_PROXY, "post msg failed=%{public}d", ret); + CONN_LOGE(CONN_PROXY, "post msg fail=%{public}d", ret); DestoryProxyConnectInfo(&proxyChannelRequestInfo); } } @@ -792,7 +792,7 @@ static void ProxyResetHandler(void) ListNode notifyConnectionList; ListInit(¬ifyConnectionList); int32_t ret = SoftBusMutexLock(&GetProxyChannelManager()->proxyConnectionList->lock); - CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_PROXY, "lock proxyConnectionList failed"); + CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_PROXY, "lock proxyConnectionList fail"); struct ProxyConnection *item = NULL; struct ProxyConnection *next = NULL; LIST_FOR_EACH_ENTRY_SAFE(item, next, &GetProxyChannelManager()->proxyConnectionList->list, @@ -846,21 +846,21 @@ static void OnProxyAclStateChanged( CONN_CHECK_AND_RETURN_LOGW(btAddr != NULL, CONN_PROXY, "addr is null"); char address[BT_MAC_LEN] = { 0 }; int32_t status = ConvertBtMacToStr(address, BT_MAC_LEN, btAddr->addr, BT_ADDR_LEN); - CONN_CHECK_AND_RETURN_LOGE(status == SOFTBUS_OK, CONN_PROXY, "convert binary mac address to string failed"); + CONN_CHECK_AND_RETURN_LOGE(status == SOFTBUS_OK, CONN_PROXY, "convert binary mac address to string fail"); char anomizeAddress[BT_MAC_LEN] = { 0 }; ConvertAnonymizeMacAddress(anomizeAddress, BT_MAC_LEN, address, BT_MAC_LEN); CONN_LOGW(CONN_PROXY, "state=%{public}d, addr=%{public}s", aclState, anomizeAddress); ProxyChannelAclStateContext *context = (ProxyChannelAclStateContext *)SoftBusCalloc(sizeof(ProxyChannelAclStateContext)); if (context == NULL || strcpy_s(context->brMac, BT_MAC_LEN, address) != EOK) { - CONN_LOGE(CONN_PROXY, "copyAddr failed"); + CONN_LOGE(CONN_PROXY, "copyAddr fail"); SoftBusFree(context); return; } context->state = aclState; int32_t ret = ConnPostMsgToLooper(&g_proxyChannelAsyncHandler, MSG_ACL_STATE_CHANGE, 0, 0, context, 0); if (ret < 0) { - CONN_LOGE(CONN_PROXY, "post msg failed=%{public}d", ret); + CONN_LOGE(CONN_PROXY, "post msg fail=%{public}d", ret); SoftBusFree(context); } } @@ -873,7 +873,7 @@ static void OnObserverStateChanged(const char *addr, int32_t state) CONN_CHECK_AND_RETURN_LOGW(addr != NULL, CONN_PROXY, "addr is NULL"); char *copyAddr = (char *)SoftBusCalloc(BT_MAC_LEN); if (copyAddr == NULL || strncpy_s(copyAddr, BT_MAC_LEN, addr, BT_MAC_LEN - 1) != EOK) { - CONN_LOGE(CONN_PROXY, "copyAddr failed"); + CONN_LOGE(CONN_PROXY, "copyAddr fail"); SoftBusFree(copyAddr); return; } @@ -882,7 +882,7 @@ static void OnObserverStateChanged(const char *addr, int32_t state) MSG_OPEN_PROXY_CHANNEL_RETRY : MSG_PROXY_UNPAIRED; int32_t ret = ConnPostMsgToLooper(&g_proxyChannelAsyncHandler, msgType, 0, 0, copyAddr, 0); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_PROXY, "post msg failed=%{public}d", ret); + CONN_LOGE(CONN_PROXY, "post msg fail=%{public}d", ret); SoftBusFree(copyAddr); return; } @@ -957,7 +957,7 @@ static int ProxyChannelLooperEventFunc(const SoftBusMessage *msg, void *args) break; } if (ctx->arg1 != 0 || ctx->arg2 != 0 || ctx->obj != NULL) { - CONN_LOGE(CONN_PROXY, "failed to avoid fault silence, " + CONN_LOGE(CONN_PROXY, "fail to avoid fault silence, " "what=%{public}d, arg1=%{public}" PRIu64 ", arg2=%{public}" PRIu64 ", objIsNull=%{public}d", ctx->what, ctx->arg1, ctx->arg2, ctx->obj == NULL); return COMPARE_FAILED; @@ -984,12 +984,12 @@ int32_t ProxyChannelManagerInit(void) { g_proxyChannelManager.proxyConnectionList = CreateSoftBusList(); CONN_CHECK_AND_RETURN_RET_LOGE(GetProxyChannelManager()->proxyConnectionList != NULL, SOFTBUS_CREATE_LIST_ERR, - CONN_INIT, "create channels list failed"); + CONN_INIT, "create channels list fail"); ListInit(&(GetProxyChannelManager()->reconnectDeviceInfos)); g_proxyChannelAsyncHandler.handler.looper = GetLooper(LOOP_TYPE_CONN); if (g_proxyChannelAsyncHandler.handler.looper == NULL) { - CONN_LOGE(CONN_PROXY, "init conn ble looper failed"); + CONN_LOGE(CONN_PROXY, "init conn ble looper fail"); DestroySoftBusList(g_proxyChannelManager.proxyConnectionList); return SOFTBUS_LOOPER_ERR; } @@ -1006,13 +1006,13 @@ int32_t ProxyChannelManagerInit(void) int32_t listenerId = -1; ret = SoftBusAddBtStateListener(&btStateListener, &listenerId); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_PROXY, "add bt listener failed, listenerId=%{public}d", listenerId); + CONN_LOGE(CONN_PROXY, "add bt listener fail, listenerId=%{public}d", listenerId); DestroySoftBusList(g_proxyChannelManager.proxyConnectionList); return ret; } ret = RegisterHfpListener(OnObserverStateChanged); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_PROXY, "register hfp listener failed, ret=%{public}d", ret); + CONN_LOGE(CONN_PROXY, "register hfp listener fail, ret=%{public}d", ret); DestroySoftBusList(g_proxyChannelManager.proxyConnectionList); SoftBusRemoveBtStateListener(listenerId); return ret; diff --git a/core/connection/proxy/proxy_observer.cpp b/core/connection/proxy/proxy_observer.cpp index 488bf32f2f..374322de98 100644 --- a/core/connection/proxy/proxy_observer.cpp +++ b/core/connection/proxy/proxy_observer.cpp @@ -116,7 +116,7 @@ bool IsPairedDevice(const char *addr) std::vector remoteDeviceLists; int32_t ret = OHOS::Bluetooth::BluetoothHost::GetDefaultHost().GetPairedDevices(OHOS::Bluetooth::BT_TRANSPORT_BREDR, remoteDeviceLists); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == 0, false, CONN_PROXY, "GetPairedDevices failed, ret=%{public}d", ret); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == 0, false, CONN_PROXY, "GetPairedDevices fail, ret=%{public}d", ret); for (const auto &device : remoteDeviceLists) { int32_t state = 0; device.GetPairState(state); diff --git a/core/connection/tcp/src/softbus_tcp_connect_manager.c b/core/connection/tcp/src/softbus_tcp_connect_manager.c index d2b6e46078..970b6b299f 100644 --- a/core/connection/tcp/src/softbus_tcp_connect_manager.c +++ b/core/connection/tcp/src/softbus_tcp_connect_manager.c @@ -120,7 +120,7 @@ int32_t AddTcpConnInfo(TcpConnInfoNode *item) } TcpConnInfoNode *temp = NULL; if (SoftBusMutexLock(&g_tcpConnInfoList->lock) != 0) { - CONN_LOGE(CONN_COMMON, "lock failed"); + CONN_LOGE(CONN_COMMON, "lock fail"); return SOFTBUS_LOCK_ERR; } if ((int32_t)g_tcpConnInfoList->cnt >= g_tcpMaxConnNum) { @@ -148,7 +148,7 @@ static void DelTcpConnInfo(uint32_t connectionId, ListenerModule module, int32_t CONN_CHECK_AND_RETURN_LOGE(g_tcpConnInfoList, CONN_COMMON, "global connection list is null"); int32_t status = SoftBusMutexLock(&g_tcpConnInfoList->lock); if (status != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "lock failed, connid=%{public}u, error=%{public}d", connectionId, status); + CONN_LOGE(CONN_COMMON, "lock fail, connid=%{public}u, error=%{public}d", connectionId, status); return; } @@ -176,7 +176,7 @@ static void DelTcpConnInfo(uint32_t connectionId, ListenerModule module, int32_t (void)SoftBusMutexUnlock(&g_tcpConnInfoList->lock); CONN_LOGE(CONN_COMMON, - "delete tcp conn failed. connId not found. connId=%{public}u, module=%{public}d, fd=%{public}d", + "delete tcp conn fail. connId not found. connId=%{public}u, module=%{public}d, fd=%{public}d", connectionId, module, fd); (void)DelTrigger(module, fd, RW_TRIGGER); } @@ -188,7 +188,7 @@ static void DelTcpConnNode(uint32_t connectionId) } TcpConnInfoNode *item = NULL; if (SoftBusMutexLock(&g_tcpConnInfoList->lock) != 0) { - CONN_LOGE(CONN_COMMON, "lock failed"); + CONN_LOGE(CONN_COMMON, "lock fail"); return; } LIST_FOR_EACH_ENTRY(item, &g_tcpConnInfoList->list, TcpConnInfoNode, node) { @@ -248,11 +248,11 @@ static int32_t TcpOnConnectEvent(ListenerModule module, int32_t cfd, const Conne tcpConnInfoNode->info.socketInfo.moduleId = module; tcpConnInfoNode->info.socketInfo.protocol = clientAddr->socketOption.protocol; if (AddTrigger(module, cfd, READ_TRIGGER) != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "add trigger failed, READ_TRIGGER. module=%{public}d, cfd=%{public}d", module, cfd); + CONN_LOGE(CONN_COMMON, "add trigger fail, READ_TRIGGER. module=%{public}d, cfd=%{public}d", module, cfd); goto EXIT; } if (AddTcpConnInfo(tcpConnInfoNode) != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "add tcp conninfo failed"); + CONN_LOGE(CONN_COMMON, "add tcp conninfo fail"); goto EXIT; } g_tcpConnCallback->OnConnected(tcpConnInfoNode->connectionId, &tcpConnInfoNode->info); @@ -279,7 +279,7 @@ static char *RecvData(const ConnPktHead *head, int32_t fd, uint32_t len) return NULL; } if (memcpy_s(data, headSize, head, headSize) != EOK) { - CONN_LOGE(CONN_COMMON, "Tcp recv data copy head failed"); + CONN_LOGE(CONN_COMMON, "Tcp recv data copy head fail"); goto EXIT; } while (recvLen < len) { @@ -302,7 +302,7 @@ static int32_t GetTcpInfoByFd(int32_t fd, TcpConnInfoNode *tcpInfo) return SOFTBUS_CONN_SOCKET_INTERNAL_ERR; } if (SoftBusMutexLock(&g_tcpConnInfoList->lock) != 0) { - CONN_LOGE(CONN_COMMON, "lock failed"); + CONN_LOGE(CONN_COMMON, "lock fail"); return SOFTBUS_LOCK_ERR; } TcpConnInfoNode *item = NULL; @@ -310,7 +310,7 @@ static int32_t GetTcpInfoByFd(int32_t fd, TcpConnInfoNode *tcpInfo) LIST_FOR_EACH_ENTRY_SAFE(item, next, &g_tcpConnInfoList->list, TcpConnInfoNode, node) { if (item->info.socketInfo.fd == fd) { if (memcpy_s(tcpInfo, sizeof(TcpConnInfoNode), item, sizeof(TcpConnInfoNode)) != EOK) { - CONN_LOGE(CONN_COMMON, "memcpy_s failed"); + CONN_LOGE(CONN_COMMON, "memcpy_s fail"); (void)SoftBusMutexUnlock(&g_tcpConnInfoList->lock); return SOFTBUS_MEM_ERR; } @@ -325,7 +325,7 @@ static int32_t GetTcpInfoByFd(int32_t fd, TcpConnInfoNode *tcpInfo) static int32_t TcpOnDataEventOut(ListenerModule module, int32_t fd) { CONN_CHECK_AND_RETURN_RET_LOGW(SoftBusMutexLock(&g_tcpConnInfoList->lock) == SOFTBUS_OK, SOFTBUS_LOCK_ERR, - CONN_COMMON, "lock failed, module=%{public}d, fd=%{public}d", module, fd); + CONN_COMMON, "lock fail, module=%{public}d, fd=%{public}d", module, fd); (void)module; TcpConnInfoNode tcpInfo; (void)memset_s(&tcpInfo, sizeof(tcpInfo), 0, sizeof(tcpInfo)); @@ -361,13 +361,13 @@ static int32_t TcpOnDataEventOut(ListenerModule module, int32_t fd) static int32_t TcpOnDataEventIn(ListenerModule module, int32_t fd) { CONN_CHECK_AND_RETURN_RET_LOGW(SoftBusMutexLock(&g_tcpConnInfoList->lock) == SOFTBUS_OK, SOFTBUS_LOCK_ERR, - CONN_COMMON, "lock failed, module=%{public}d, fd=%{public}d", module, fd); + CONN_COMMON, "lock fail, module=%{public}d, fd=%{public}d", module, fd); uint32_t connectionId = CalTcpConnectionId(fd); TcpConnInfoNode tcpInfo; (void)memset_s(&tcpInfo, sizeof(tcpInfo), 0, sizeof(tcpInfo)); if (GetTcpInfoByFd(fd, &tcpInfo) != SOFTBUS_OK) { (void)SoftBusMutexUnlock(&g_tcpConnInfoList->lock); - CONN_LOGE(CONN_COMMON, "get tcp info failed. module=%{public}d, fd=%{public}d", module, fd); + CONN_LOGE(CONN_COMMON, "get tcp info fail. module=%{public}d, fd=%{public}d", module, fd); return SOFTBUS_NOT_FIND; } ConnPktHead head = {0}; @@ -380,7 +380,7 @@ static int32_t TcpOnDataEventIn(ListenerModule module, int32_t fd) DelTcpConnInfo(connectionId, module, fd); return SOFTBUS_OK; } else if (bytes != (ssize_t)headSize) { - CONN_LOGE(CONN_COMMON, "Recv Head failed."); + CONN_LOGE(CONN_COMMON, "Recv Head fail."); (void)SoftBusMutexUnlock(&g_tcpConnInfoList->lock); return SOFTBUS_CONN_SOCKET_INTERNAL_ERR; } @@ -419,7 +419,7 @@ static void DelAllConnInfo(ListenerModule moduleId) return; } if (SoftBusMutexLock(&g_tcpConnInfoList->lock) != 0) { - CONN_LOGE(CONN_COMMON, "lock failed"); + CONN_LOGE(CONN_COMMON, "lock fail"); return; } ListNode waitDelete; @@ -476,14 +476,14 @@ static int32_t WrapperAddTcpConnInfo(const ConnectOption *option, const ConnectR { TcpConnInfoNode *tcpConnInfoNode = (TcpConnInfoNode *)SoftBusCalloc(sizeof(TcpConnInfoNode)); if (tcpConnInfoNode == NULL) { - CONN_LOGE(CONN_COMMON, "malloc failed"); + CONN_LOGE(CONN_COMMON, "malloc fail"); return SOFTBUS_MALLOC_ERR; } if (strcpy_s(tcpConnInfoNode->info.socketInfo.addr, sizeof(tcpConnInfoNode->info.socketInfo.addr), option->socketOption.addr) != EOK || memcpy_s(&tcpConnInfoNode->result, sizeof(ConnectResult), result, sizeof(ConnectResult)) != EOK) { - CONN_LOGE(CONN_COMMON, "copy failed"); + CONN_LOGE(CONN_COMMON, "copy fail"); SoftBusFree(tcpConnInfoNode); return SOFTBUS_STRCPY_ERR; } @@ -499,7 +499,7 @@ static int32_t WrapperAddTcpConnInfo(const ConnectOption *option, const ConnectR tcpConnInfoNode->info.socketInfo.moduleId = option->socketOption.moduleId; tcpConnInfoNode->statistics = statistics; if (AddTcpConnInfo(tcpConnInfoNode) != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "AddTcpConnInfo failed"); + CONN_LOGE(CONN_COMMON, "AddTcpConnInfo fail"); SoftBusFree(tcpConnInfoNode); return SOFTBUS_CONN_SOCKET_INTERNAL_ERR; } @@ -515,7 +515,7 @@ static int32_t TcpOpenClientSocketErr(const ConnectOption *option, uint32_t requ .errcode = SOFTBUS_TCPCONNECTION_SOCKET_ERR, }; CONN_ALARM(CONNECTION_FAIL_ALARM, MANAGE_ALARM_TYPE, extraAlarm); - CONN_LOGE(CONN_COMMON, "OpenTcpClient failed."); + CONN_LOGE(CONN_COMMON, "OpenTcpClient fail."); result->OnConnectFailed(requestId, SOFTBUS_TCPCONNECTION_SOCKET_ERR); statistics->reqId = requestId; DfxRecordTcpConnectFail( @@ -579,7 +579,7 @@ int32_t TcpDisconnectDevice(uint32_t connectionId) { ConnectionInfo info; if (TcpGetConnectionInfo(connectionId, &info) != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "tcp get connection info failed"); + CONN_LOGE(CONN_COMMON, "tcp get connection info fail"); return SOFTBUS_CONN_SOCKET_INTERNAL_ERR; } DelTcpConnInfo(connectionId, UNUSE_BUTT, -1); @@ -593,7 +593,7 @@ int32_t TcpDisconnectDeviceNow(const ConnectOption *option) return SOFTBUS_INVALID_PARAM; } if (SoftBusMutexLock(&g_tcpConnInfoList->lock) != 0) { - CONN_LOGE(CONN_COMMON, "lock failed"); + CONN_LOGE(CONN_COMMON, "lock fail"); return SOFTBUS_LOCK_ERR; } ListNode waitDelete; @@ -641,7 +641,7 @@ int32_t TcpPostBytes( } int32_t fd = -1; if (SoftBusMutexLock(&g_tcpConnInfoList->lock) != 0) { - CONN_LOGE(CONN_COMMON, "lock failed"); + CONN_LOGE(CONN_COMMON, "lock fail"); SoftBusFree((void*)data); return SOFTBUS_LOCK_ERR; } @@ -679,7 +679,7 @@ int32_t TcpGetConnectionInfo(uint32_t connectionId, ConnectionInfo *info) } TcpConnInfoNode *item = NULL; if (SoftBusMutexLock(&g_tcpConnInfoList->lock) != 0) { - CONN_LOGE(CONN_COMMON, "lock failed"); + CONN_LOGE(CONN_COMMON, "lock fail"); return SOFTBUS_LOCK_ERR; } LIST_FOR_EACH_ENTRY(item, &g_tcpConnInfoList->list, TcpConnInfoNode, node) { @@ -687,7 +687,7 @@ int32_t TcpGetConnectionInfo(uint32_t connectionId, ConnectionInfo *info) int32_t ret = memcpy_s(info, sizeof(ConnectionInfo), &item->info, sizeof(ConnectionInfo)); (void)SoftBusMutexUnlock(&g_tcpConnInfoList->lock); if (ret != EOK) { - CONN_LOGE(CONN_COMMON, "copy connection info failed"); + CONN_LOGE(CONN_COMMON, "copy connection info fail"); return SOFTBUS_MEM_ERR; } return SOFTBUS_OK; @@ -721,7 +721,7 @@ int32_t TcpStopListening(const LocalListenerInfo *info) ListenerModule moduleId = info->socketOption.moduleId; int32_t ret = StopBaseListener(moduleId); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "stop listener failed"); + CONN_LOGE(CONN_COMMON, "stop listener fail"); return ret; } DelAllConnInfo(moduleId); @@ -800,7 +800,7 @@ ConnectFuncInterface *ConnInitTcp(const ConnectCallback *callback) if (g_tcpConnInfoList == NULL) { g_tcpConnInfoList = CreateSoftBusList(); if (g_tcpConnInfoList == NULL) { - CONN_LOGE(CONN_INIT, "Create tcpConnInfoList failed."); + CONN_LOGE(CONN_INIT, "Create tcpConnInfoList fail."); return NULL; } g_tcpConnInfoList->cnt = 0; @@ -813,7 +813,7 @@ static int TcpConnectInfoDump(int fd) { char *anonyIpAddr = NULL; if (SoftBusMutexLock(&g_tcpConnInfoList->lock) != SOFTBUS_OK) { - CONN_LOGE(CONN_COMMON, "lock failed"); + CONN_LOGE(CONN_COMMON, "lock fail"); return SOFTBUS_LOCK_ERR; } ListNode *item = NULL; diff --git a/core/connection/wifi_direct_cpp/adapter/p2p_adapter.cpp b/core/connection/wifi_direct_cpp/adapter/p2p_adapter.cpp index 64cb969cd7..e68c9f7693 100644 --- a/core/connection/wifi_direct_cpp/adapter/p2p_adapter.cpp +++ b/core/connection/wifi_direct_cpp/adapter/p2p_adapter.cpp @@ -72,7 +72,7 @@ bool P2pAdapter::IsWifiConnected() { WifiLinkedInfo linkedInfo; int32_t ret = GetLinkedInfo(&linkedInfo); - CONN_CHECK_AND_RETURN_RET_LOGW(ret == WIFI_SUCCESS, false, CONN_WIFI_DIRECT, "get wifi linked info failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(ret == WIFI_SUCCESS, false, CONN_WIFI_DIRECT, "get wifi linked info fail"); if (linkedInfo.connState == WIFI_CONNECTED) { CONN_LOGI(CONN_WIFI_DIRECT, "wifi is connected"); return true; @@ -85,7 +85,7 @@ bool P2pAdapter::IsWifiP2pEnabled() { enum P2pState state; auto ret = GetP2pEnableStatus(&state); - CONN_CHECK_AND_RETURN_RET_LOGW(ret == WIFI_SUCCESS, false, CONN_WIFI_DIRECT, "get p2p enable status failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(ret == WIFI_SUCCESS, false, CONN_WIFI_DIRECT, "get p2p enable status fail"); CONN_LOGI(CONN_WIFI_DIRECT, "P2pEnableStatus=%{public}d", static_cast(state)); return state == P2P_STATE_STARTED; } @@ -100,7 +100,7 @@ int32_t P2pAdapter::GetStationFrequency() WifiLinkedInfo linkedInfo; int32_t ret = GetLinkedInfo(&linkedInfo); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == WIFI_SUCCESS, ToSoftBusErrorCode(ret), CONN_WIFI_DIRECT, "get wifi linked info failed"); + ret == WIFI_SUCCESS, ToSoftBusErrorCode(ret), CONN_WIFI_DIRECT, "get wifi linked info fail"); CONN_LOGI(CONN_WIFI_DIRECT, "frequency=%{public}d", linkedInfo.frequency); return linkedInfo.frequency; @@ -111,7 +111,7 @@ int32_t P2pAdapter::P2pCreateGroup(const CreateGroupParam ¶m) FreqType type = param.isWideBandSupported ? FREQUENCY_160M : FREQUENCY_DEFAULT; int32_t ret = Hid2dCreateGroup(param.frequency, type); CONN_CHECK_AND_RETURN_RET_LOGW(ret == WIFI_SUCCESS, ToSoftBusErrorCode(ret), - CONN_WIFI_DIRECT, "create group failed, frequency=%{public}d, type=%{public}d, error=%{public}d", + CONN_WIFI_DIRECT, "create group fail, frequency=%{public}d, type=%{public}d, error=%{public}d", param.frequency, type, ToSoftBusErrorCode(ret)); CONN_LOGI(CONN_WIFI_DIRECT, "create group success"); @@ -129,7 +129,7 @@ int32_t P2pAdapter::P2pConnectGroup(const ConnectParam ¶m) int32_t ret = strcpy_s(connectConfig.ssid, sizeof(connectConfig.ssid), configs[P2P_GROUP_CONFIG_INDEX_SSID].c_str()); - CONN_CHECK_AND_RETURN_RET_LOGW(ret == EOK, SOFTBUS_CONN_PV2_COPY_SSID_FAILED, CONN_WIFI_DIRECT, "copy ssid failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(ret == EOK, SOFTBUS_CONN_PV2_COPY_SSID_FAILED, CONN_WIFI_DIRECT, "copy ssid fail"); std::vector bssid = WifiDirectUtils::MacStringToArray(configs[P2P_GROUP_CONFIG_INDEX_BSSID]); memcpy_s(connectConfig.bssid, sizeof(connectConfig.bssid), bssid.data(), sizeof(connectConfig.bssid)); @@ -137,7 +137,7 @@ int32_t P2pAdapter::P2pConnectGroup(const ConnectParam ¶m) ret = strcpy_s(connectConfig.preSharedKey, sizeof(connectConfig.preSharedKey), configs[P2P_GROUP_CONFIG_INDEX_SHARE_KEY].c_str()); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == EOK, SOFTBUS_CONN_PV2_COPY_SHARE_KEY_FAILED, CONN_WIFI_DIRECT, "copy share key failed"); + ret == EOK, SOFTBUS_CONN_PV2_COPY_SHARE_KEY_FAILED, CONN_WIFI_DIRECT, "copy share key fail"); connectConfig.frequency = strtol(configs[P2P_GROUP_CONFIG_INDEX_FREQ].c_str(), nullptr, DECIMAL_BASE); CONN_LOGI(CONN_WIFI_DIRECT, "connect config frequency=%{public}d", connectConfig.frequency); @@ -155,7 +155,7 @@ int32_t P2pAdapter::P2pConnectGroup(const ConnectParam ¶m) CONN_WIFI_DIRECT, "dhcpMode=%{public}d frequency=%{public}d", connectConfig.dhcpMode, connectConfig.frequency); ret = Hid2dConnect(&connectConfig); CONN_CHECK_AND_RETURN_RET_LOGW(ret == WIFI_SUCCESS, ToSoftBusErrorCode(ret), - CONN_WIFI_DIRECT, "connect group failed"); + CONN_WIFI_DIRECT, "connect group fail"); CONN_LOGI(CONN_WIFI_DIRECT, "connect group success"); return SOFTBUS_OK; @@ -165,7 +165,7 @@ int32_t P2pAdapter::P2pShareLinkReuse() { WifiErrorCode ret = Hid2dSharedlinkIncrease(); CONN_CHECK_AND_RETURN_RET_LOGW(ret == WIFI_SUCCESS, ToSoftBusErrorCode(static_cast(ret)), - CONN_WIFI_DIRECT, "failed ret=%{public}d", ToSoftBusErrorCode(static_cast(ret))); + CONN_WIFI_DIRECT, "fail ret=%{public}d", ToSoftBusErrorCode(static_cast(ret))); return SOFTBUS_OK; } @@ -173,7 +173,7 @@ int32_t P2pAdapter::P2pShareLinkRemoveGroup(const DestroyGroupParam ¶m) { WifiErrorCode ret = Hid2dSharedlinkDecrease(); CONN_CHECK_AND_RETURN_RET_LOGW(ret == WIFI_SUCCESS, ToSoftBusErrorCode(static_cast(ret)), - CONN_WIFI_DIRECT, "failed ret=%{public}d", ToSoftBusErrorCode(static_cast(ret))); + CONN_WIFI_DIRECT, "fail ret=%{public}d", ToSoftBusErrorCode(static_cast(ret))); return SOFTBUS_OK; } @@ -190,12 +190,12 @@ int32_t P2pAdapter::DestroyGroup(const DestroyGroupParam ¶m) if (role == LinkInfo::LinkMode::GO) { ret = RemoveGroup(); CONN_CHECK_AND_RETURN_RET_LOGW(ret == WIFI_SUCCESS, ToSoftBusErrorCode(static_cast(ret)), - CONN_WIFI_DIRECT, "remove group failed, ret=%{public}d", + CONN_WIFI_DIRECT, "remove group fail, ret=%{public}d", ToSoftBusErrorCode(static_cast(ret))); } else if (role == LinkInfo::LinkMode::GC) { ret = Hid2dRemoveGcGroup(param.interface.c_str()); CONN_CHECK_AND_RETURN_RET_LOGW(ret == WIFI_SUCCESS, ToSoftBusErrorCode(static_cast(ret)), - CONN_WIFI_DIRECT, "remove gc group of interface failed, interface=%{public}s, ret=%{public}d", + CONN_WIFI_DIRECT, "remove gc group of interface fail, interface=%{public}s, ret=%{public}d", param.interface.c_str(), ToSoftBusErrorCode(static_cast(ret))); } else { CONN_LOGW(CONN_WIFI_DIRECT, "unknown api role. role=%{public}d", role); @@ -225,7 +225,7 @@ int32_t P2pAdapter::GetStationFrequencyWithFilter() return frequency; } - CONN_LOGE(CONN_WIFI_DIRECT, "get local frequency failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "get local frequency fail"); return FREQUENCY_INVALID; } @@ -258,7 +258,7 @@ int32_t P2pAdapter::GetSelfWifiConfigInfo(std::string &config) int32_t wifiConfigSize = 0; int32_t ret = Hid2dGetSelfWifiCfgInfo(TYPE_OF_GET_SELF_CONFIG, (char *)wifiConfig, &wifiConfigSize); CONN_CHECK_AND_RETURN_RET_LOGE((ret == WIFI_SUCCESS) || (ret == ERROR_WIFI_ENHANCE_SVC), ToSoftBusErrorCode(ret), - CONN_WIFI_DIRECT, "get self wifi config failed, error=%{public}d", + CONN_WIFI_DIRECT, "get self wifi config fail, error=%{public}d", ToSoftBusErrorCode(ret)); CONN_LOGI(CONN_WIFI_DIRECT, "wifiConfigSize=%{public}d", wifiConfigSize); @@ -270,7 +270,7 @@ int32_t P2pAdapter::GetSelfWifiConfigInfo(std::string &config) uint8_t encode[CFG_DATA_MAX_BYTES] = { 0 }; size_t encodeSize = 0; ret = SoftBusBase64Encode(encode, sizeof(encode), &encodeSize, wifiConfig, wifiConfigSize); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == WIFI_SUCCESS, ret, CONN_WIFI_DIRECT, "encode failed, error=%{public}d", ret); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == WIFI_SUCCESS, ret, CONN_WIFI_DIRECT, "encode fail, error=%{public}d", ret); config = std::string((const char *)encode, encodeSize); return SOFTBUS_OK; @@ -281,18 +281,18 @@ int32_t P2pAdapter::SetPeerWifiConfigInfo(const std::string &config) auto peerCfgLen = config.size() + 1; auto decodeCfg = new uint8_t[peerCfgLen]; size_t decodeLen = 0; - CONN_CHECK_AND_RETURN_RET_LOGE(decodeCfg, SOFTBUS_MALLOC_ERR, CONN_WIFI_DIRECT, "alloc failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(decodeCfg, SOFTBUS_MALLOC_ERR, CONN_WIFI_DIRECT, "alloc fail"); int32_t ret = SoftBusBase64Decode(decodeCfg, peerCfgLen, &decodeLen, (uint8_t *)config.c_str(), config.size()); if (ret != SOFTBUS_OK) { delete[] decodeCfg; - CONN_LOGI(CONN_WIFI_DIRECT, "decode wifi cfg failed, error=%{public}d", ret); + CONN_LOGI(CONN_WIFI_DIRECT, "decode wifi cfg fail, error=%{public}d", ret); return ret; } ret = Hid2dSetPeerWifiCfgInfo(TYPE_OF_SET_PEER_CONFIG, (char *)decodeCfg, (int32_t)decodeLen); delete[] decodeCfg; CONN_CHECK_AND_RETURN_RET_LOGE((ret == WIFI_SUCCESS) || (ret == ERROR_WIFI_ENHANCE_SVC), ToSoftBusErrorCode(ret), - CONN_WIFI_DIRECT, "set wifi cfg failed, error=%{public}d", + CONN_WIFI_DIRECT, "set wifi cfg fail, error=%{public}d", ToSoftBusErrorCode(ret)); CONN_LOGI(CONN_WIFI_DIRECT, "set success"); return SOFTBUS_OK; @@ -315,7 +315,7 @@ int32_t P2pAdapter::GetGroupInfo(WifiDirectP2pGroupInfo &groupInfoOut) auto groupInfo = std::make_shared(); auto ret = GetCurrentGroup(groupInfo.get()); if (ret != WIFI_SUCCESS) { - CONN_LOGE(CONN_WIFI_DIRECT, "get current group failed, error=%{public}d", + CONN_LOGE(CONN_WIFI_DIRECT, "get current group fail, error=%{public}d", ToSoftBusErrorCode(static_cast(ret))); return ToSoftBusErrorCode(static_cast(ret)); } @@ -348,7 +348,7 @@ int32_t P2pAdapter::GetGroupConfig(std::string &groupConfigString) auto groupInfo = std::make_shared(); auto ret = GetCurrentGroup(groupInfo.get()); if (ret != WIFI_SUCCESS) { - CONN_LOGE(CONN_WIFI_DIRECT, "get current group failed, error=%{public}d", + CONN_LOGE(CONN_WIFI_DIRECT, "get current group fail, error=%{public}d", ToSoftBusErrorCode(static_cast(ret))); return ToSoftBusErrorCode(static_cast(ret)); } @@ -376,7 +376,7 @@ int32_t P2pAdapter::GetIpAddress(std::string &ipString) auto groupInfo = std::make_shared(); int32_t ret = GetCurrentGroup(groupInfo.get()); if (ret != WIFI_SUCCESS) { - CONN_LOGE(CONN_WIFI_DIRECT, "get current group failed, error=%{public}d", ToSoftBusErrorCode(ret)); + CONN_LOGE(CONN_WIFI_DIRECT, "get current group fail, error=%{public}d", ToSoftBusErrorCode(ret)); return ToSoftBusErrorCode(ret); } @@ -384,7 +384,7 @@ int32_t P2pAdapter::GetIpAddress(std::string &ipString) CONN_LOGI(CONN_WIFI_DIRECT, "interfaceName=%{public}s", interface.c_str()); ret = WifiDirectUtils::GetInterfaceIpString(interface, ipString); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get interfaceIp string failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get interfaceIp string fail, error=%{public}d", ret); return SOFTBUS_OK; } @@ -414,7 +414,7 @@ int32_t P2pAdapter::GetDynamicMacAddress(std::string &macString) auto groupInfo = std::make_shared(); auto ret = GetCurrentGroup(groupInfo.get()); if (ret != WIFI_SUCCESS) { - CONN_LOGE(CONN_WIFI_DIRECT, "get current group failed, error=%{public}d", ToSoftBusErrorCode(ret)); + CONN_LOGE(CONN_WIFI_DIRECT, "get current group fail, error=%{public}d", ToSoftBusErrorCode(ret)); return ToSoftBusErrorCode(ret); } std::vector macArray = WifiDirectUtils::GetInterfaceMacAddr(groupInfo->interface); @@ -433,7 +433,7 @@ int32_t P2pAdapter::RequestGcIp(const std::string &macString, std::string &ipStr uint32_t ipArray[IPV4_ADDR_ARRAY_LEN]; int ret = Hid2dRequestGcIp(macArray.data(), ipArray); if (ret != WIFI_SUCCESS) { - CONN_LOGE(CONN_WIFI_DIRECT, "request Gc Ip failed, error=%{public}d", ToSoftBusErrorCode(ret)); + CONN_LOGE(CONN_WIFI_DIRECT, "request Gc Ip fail, error=%{public}d", ToSoftBusErrorCode(ret)); return ToSoftBusErrorCode(ret); } @@ -454,17 +454,17 @@ int32_t P2pAdapter::P2pConfigGcIp(const std::string &interface, const std::strin int32_t ret = WifiDirectUtils::IpStringToIntArray(ip.c_str(), addrInfo.ip, IPV4_ARRAY_LEN); - CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "convert ip to int array failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "convert ip to int array fail"); ret = WifiDirectUtils::IpStringToIntArray(ip.c_str(), addrInfo.gateway, IPV4_ARRAY_LEN); CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, SOFTBUS_CONN_CONVERT_GATEWAY_TO_INTARRAY_FAILED, CONN_WIFI_DIRECT, - "convert gateway to int array failed"); + "convert gateway to int array fail"); ret = WifiDirectUtils::IpStringToIntArray(DEFAULT_NET_MASK, addrInfo.netmask, IPV4_ARRAY_LEN); CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, SOFTBUS_CONN_CONVERT_GATEWAY_TO_INTARRAY_FAILED, CONN_WIFI_DIRECT, - "convert gateway to int array failed"); + "convert gateway to int array fail"); ret = Hid2dConfigIPAddr(interface.c_str(), &addrInfo); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == WIFI_SUCCESS, ToSoftBusErrorCode(ret), CONN_WIFI_DIRECT, "hid2d config ip failed"); + ret == WIFI_SUCCESS, ToSoftBusErrorCode(ret), CONN_WIFI_DIRECT, "hid2d config ip fail"); CONN_LOGI(CONN_WIFI_DIRECT, "success"); return SOFTBUS_OK; } @@ -499,7 +499,7 @@ int32_t P2pAdapter::GetP2pGroupFrequency() WifiP2pGroupInfo p2pGroupInfo{}; int32_t ret = GetCurrentGroup(&p2pGroupInfo); CONN_CHECK_AND_RETURN_RET_LOGW(ret == WIFI_SUCCESS, ToSoftBusErrorCode(ret), CONN_WIFI_DIRECT, - "get current group info failed, error=%{public}d", ToSoftBusErrorCode(ret)); + "get current group info fail, error=%{public}d", ToSoftBusErrorCode(ret)); return p2pGroupInfo.frequency; } } // namespace OHOS::SoftBus diff --git a/core/connection/wifi_direct_cpp/channel/auth_negotiate_channel.cpp b/core/connection/wifi_direct_cpp/channel/auth_negotiate_channel.cpp index d0bf799ac7..fff352ff59 100644 --- a/core/connection/wifi_direct_cpp/channel/auth_negotiate_channel.cpp +++ b/core/connection/wifi_direct_cpp/channel/auth_negotiate_channel.cpp @@ -42,7 +42,7 @@ AuthNegotiateChannel::AuthNegotiateChannel(const AuthHandle &handle) { char remoteUuid[UUID_BUF_LEN] {}; auto ret = DBinderSoftbusServer::GetInstance().AuthGetDeviceUuid(handle_.authId, remoteUuid, UUID_BUF_LEN); - CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_WIFI_DIRECT, "auth get device id failed"); + CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_WIFI_DIRECT, "auth get device id fail"); remoteDeviceId_ = remoteUuid; CONN_LOGI(CONN_WIFI_DIRECT, "remoteDeviceId=%{public}s", WifiDirectAnonymizeDeviceId(remoteDeviceId_).c_str()); } @@ -69,7 +69,7 @@ bool AuthNegotiateChannel::IsMeta() const { bool isMeta = false; int32_t ret = DBinderSoftbusServer::GetInstance().AuthGetMetaType(handle_.authId, &isMeta); - CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, false, CONN_WIFI_DIRECT, "get meta type failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, false, CONN_WIFI_DIRECT, "get meta type fail"); return isMeta; } @@ -103,7 +103,7 @@ int AuthNegotiateChannel::SendMessage(const NegotiateMessage &msg) const } auto protocol = WifiDirectProtocolFactory::CreateProtocol(type); CONN_CHECK_AND_RETURN_RET_LOGE( - protocol != nullptr, SOFTBUS_INVALID_PARAM, CONN_WIFI_DIRECT, "create protocol failed"); + protocol != nullptr, SOFTBUS_INVALID_PARAM, CONN_WIFI_DIRECT, "create protocol fail"); std::vector output; msg.Marshalling(*protocol, output); @@ -116,7 +116,7 @@ int AuthNegotiateChannel::SendMessage(const NegotiateMessage &msg) const CONN_CHECK_AND_RETURN_RET_LOGE( DBinderSoftbusServer::GetInstance().AuthPostTransData(handle_, &dataInfo) == SOFTBUS_OK, - SOFTBUS_CONN_AUTH_POST_DATA_FAILED, CONN_WIFI_DIRECT, "post data failed"); + SOFTBUS_CONN_AUTH_POST_DATA_FAILED, CONN_WIFI_DIRECT, "post data fail"); return SOFTBUS_OK; } @@ -341,10 +341,10 @@ void AuthNegotiateChannel::Init() }; int32_t ret = DBinderSoftbusServer::GetInstance().RegAuthTransListener(MODULE_P2P_LINK, &authListener); - CONN_CHECK_AND_RETURN_LOGW(ret == SOFTBUS_OK, CONN_INIT, "register auth transfer listener failed"); + CONN_CHECK_AND_RETURN_LOGW(ret == SOFTBUS_OK, CONN_INIT, "register auth transfer listener fail"); ret = DBinderSoftbusServer::GetInstance().LnnRegisterEventHandler(LNN_EVENT_NOTIFY_RAW_ENHANCE_P2P, AddAuthConnection); - CONN_CHECK_AND_RETURN_LOGW(ret == SOFTBUS_OK, CONN_INIT, "register lnn event failed, ret=%{public}d", ret); + CONN_CHECK_AND_RETURN_LOGW(ret == SOFTBUS_OK, CONN_INIT, "register lnn event fail, ret=%{public}d", ret); } std::pair AuthNegotiateChannel::StartListening( @@ -431,17 +431,17 @@ void AuthNegotiateChannel::RefreshAuthConnection(std::string remoteUuid) } return false; }); - CONN_CHECK_AND_RETURN_LOGE(res, CONN_WIFI_DIRECT, "get param failed"); + CONN_CHECK_AND_RETURN_LOGE(res, CONN_WIFI_DIRECT, "get param fail"); CONN_CHECK_AND_RETURN_LOGE(param.remotePort > 0, CONN_WIFI_DIRECT, "remote port is zero"); auto authOpenEventPromise = std::make_shared>(); uint32_t authReqId = 0; auto ret = AuthNegotiateChannel::OpenConnection(param, nullptr, authReqId, authOpenEventPromise); CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_WIFI_DIRECT, - "open connection failed, ret=%{public}d", ret); + "open connection fail, ret=%{public}d", ret); auto authEvent = authOpenEventPromise->get_future().get(); CONN_CHECK_AND_RETURN_LOGE(authEvent.reason_ == SOFTBUS_OK, CONN_WIFI_DIRECT, - "open connection failed, ret=%{public}d", authEvent.reason_); + "open connection fail, ret=%{public}d", authEvent.reason_); auto channel = std::make_shared(authEvent.handle_); LinkManager::GetInstance().RefreshAuthHandle(remoteUuid, channel); NegotiateMessage msg(NegotiateMessageType::CMD_REFRESH_AUTH_HANDLE); @@ -460,15 +460,15 @@ int AuthNegotiateChannel::AssignValueForAuthConnInfo(bool isMeta, bool needUdid, } auto ret = strcpy_s(authConnInfo.info.ipInfo.ip, IP_LEN, param.remoteIp.c_str()); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == EOK, SOFTBUS_CONN_OPEN_CONNECTION_COPY_IP_FAILED, CONN_WIFI_DIRECT, "copy ip failed"); + ret == EOK, SOFTBUS_CONN_OPEN_CONNECTION_COPY_IP_FAILED, CONN_WIFI_DIRECT, "copy ip fail"); if (needUdid) { const char *remoteUdid = DBinderSoftbusServer::GetInstance().LnnConvertDLidToUdid(param.remoteUuid.c_str(), CATEGORY_UUID); CONN_CHECK_AND_RETURN_RET_LOGE(remoteUdid != nullptr && strlen(remoteUdid) != 0, - SOFTBUS_CONN_OPEN_CONNECTION_GET_REMOTE_UUID_FAILED, CONN_WIFI_DIRECT, "get remote udid failed"); + SOFTBUS_CONN_OPEN_CONNECTION_GET_REMOTE_UUID_FAILED, CONN_WIFI_DIRECT, "get remote udid fail"); ret = strcpy_s(authConnInfo.info.ipInfo.udid, UDID_BUF_LEN, remoteUdid); CONN_CHECK_AND_RETURN_RET_LOGE( - ret == EOK, SOFTBUS_CONN_OPEN_CONNECTION_COPY_UUID_FAILED, CONN_WIFI_DIRECT, "copy udid failed"); + ret == EOK, SOFTBUS_CONN_OPEN_CONNECTION_COPY_UUID_FAILED, CONN_WIFI_DIRECT, "copy udid fail"); } return SOFTBUS_OK; } @@ -502,7 +502,7 @@ int AuthNegotiateChannel::OpenConnection(const OpenParam ¶m, const std::shar AuthConnInfo authConnInfo {}; auto ret = AssignValueForAuthConnInfo(isMeta, needUdid, param, channel, authConnInfo); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "assign value for auth conn info failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "assign value for auth conn info fail"); auto requestId = DBinderSoftbusServer::GetInstance().AuthGenRequestId(); { @@ -515,7 +515,7 @@ int AuthNegotiateChannel::OpenConnection(const OpenParam ¶m, const std::shar authReqId = requestId; ret = AuthOpenConnection(requestId, authConnInfo, isMeta); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "auth open connect failed, error=%{public}d", ret); + CONN_LOGE(CONN_WIFI_DIRECT, "auth open connect fail, error=%{public}d", ret); std::lock_guard lock(lock_); requestIdToDeviceIdMap_.erase(requestId); if (authOpenEventPromise != nullptr) { diff --git a/core/connection/wifi_direct_cpp/channel/proxy_negotiate_channel.cpp b/core/connection/wifi_direct_cpp/channel/proxy_negotiate_channel.cpp index 0f10b7c32e..1f41f09ded 100644 --- a/core/connection/wifi_direct_cpp/channel/proxy_negotiate_channel.cpp +++ b/core/connection/wifi_direct_cpp/channel/proxy_negotiate_channel.cpp @@ -70,7 +70,7 @@ int CoCProxyNegotiateChannel::Init() int32_t ret = DBinderSoftbusServer::GetInstance().TransProxyPipelineRegisterListener(MSG_TYPE_P2P_NEGO, &listener); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "register proxy channel listener failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "register proxy channel listener fail, error=%{public}d", ret); return SOFTBUS_OK; } @@ -79,7 +79,7 @@ CoCProxyNegotiateChannel::CoCProxyNegotiateChannel(int32_t channelId) : channelI char remoteUuid[UUID_BUF_LEN] {}; if (DBinderSoftbusServer::GetInstance().TransProxyPipelineGetUuidByChannelId(channelId, remoteUuid, UUID_BUF_LEN) != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "auth get uuid failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "auth get uuid fail"); return; } remoteDeviceId_ = remoteUuid; @@ -105,13 +105,13 @@ int CoCProxyNegotiateChannel::SendMessage(const NegotiateMessage &msg) const } auto protocol = WifiDirectProtocolFactory::CreateProtocol(type); CONN_CHECK_AND_RETURN_RET_LOGE( - protocol != nullptr, SOFTBUS_INVALID_PARAM, CONN_WIFI_DIRECT, "create protocol failed"); + protocol != nullptr, SOFTBUS_INVALID_PARAM, CONN_WIFI_DIRECT, "create protocol fail"); std::vector output; msg.Marshalling(*protocol, output); auto ret = DBinderSoftbusServer::GetInstance().TransProxyPipelineSendMessage( channelId_, output.data(), static_cast(output.size()), MSG_TYPE_P2P_NEGO); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "post data failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "post data fail"); return SOFTBUS_OK; } diff --git a/core/connection/wifi_direct_cpp/data/inner_link.cpp b/core/connection/wifi_direct_cpp/data/inner_link.cpp index 555cc9eb6c..8f9e938691 100644 --- a/core/connection/wifi_direct_cpp/data/inner_link.cpp +++ b/core/connection/wifi_direct_cpp/data/inner_link.cpp @@ -364,11 +364,11 @@ void InnerLink::GenerateLink(uint32_t requestId, int pid, WifiDirectLink &link, remoteIp = GetRemoteIpv6(); } if (strcpy_s(link.localIp, IP_STR_MAX_LEN, localIp.c_str()) != EOK) { - CONN_LOGI(CONN_WIFI_DIRECT, "local ip cpy failed, link id=%{public}d", link.linkId); + CONN_LOGI(CONN_WIFI_DIRECT, "local ip cpy fail, link id=%{public}d", link.linkId); // fall-through } if (strcpy_s(link.remoteIp, IP_STR_MAX_LEN, remoteIp.c_str()) != EOK) { - CONN_LOGI(CONN_WIFI_DIRECT, "remote ip cpy failed, link id=%{public}d", link.linkId); + CONN_LOGI(CONN_WIFI_DIRECT, "remote ip cpy fail, link id=%{public}d", link.linkId); // fall-through } @@ -376,11 +376,11 @@ void InnerLink::GenerateLink(uint32_t requestId, int pid, WifiDirectLink &link, std::string localIpv6 = GetLocalIpv6(); std::string remoteIpv6 = GetRemoteIpv6(); if (strcpy_s(link.localIpv6, IP_STR_MAX_LEN, localIpv6.c_str()) != EOK) { - CONN_LOGI(CONN_WIFI_DIRECT, "local custom ip cpy failed, link id=%{public}d", link.linkId); + CONN_LOGI(CONN_WIFI_DIRECT, "local custom ip cpy fail, link id=%{public}d", link.linkId); // fall-through } if (strcpy_s(link.remoteIpv6, IP_STR_MAX_LEN, remoteIpv6.c_str()) != EOK) { - CONN_LOGI(CONN_WIFI_DIRECT, "remote custom ip cpy failed, link id=%{public}d", link.linkId); + CONN_LOGI(CONN_WIFI_DIRECT, "remote custom ip cpy fail, link id=%{public}d", link.linkId); // fall-through } } diff --git a/core/connection/wifi_direct_cpp/data/ipv4_info.cpp b/core/connection/wifi_direct_cpp/data/ipv4_info.cpp index 3b8c18a6b5..618ca33c3c 100644 --- a/core/connection/wifi_direct_cpp/data/ipv4_info.cpp +++ b/core/connection/wifi_direct_cpp/data/ipv4_info.cpp @@ -62,7 +62,7 @@ int Ipv4Info::FromIpString(const std::string &ipString) return SOFTBUS_OK; } if (inet_pton(AF_INET, ipString.c_str(), &ip_) != 1) { - CONN_LOGW(CONN_WIFI_DIRECT, "inet_pton failed"); + CONN_LOGW(CONN_WIFI_DIRECT, "inet_pton fail"); return SOFTBUS_CONN_INET_PTON_FAILED; } ip_ = htonl(ip_); @@ -77,7 +77,7 @@ std::string Ipv4Info::ToIpString() const uint32_t ip = ntohl(ip_); char ipStr[IP_STR_MAX_LEN] {}; const char *ret = inet_ntop(AF_INET, &ip, ipStr, IP_STR_MAX_LEN); - CONN_CHECK_AND_RETURN_RET_LOGW(ret != nullptr, "", CONN_WIFI_DIRECT, "inet_ntop failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(ret != nullptr, "", CONN_WIFI_DIRECT, "inet_ntop fail"); return ipStr; } diff --git a/core/connection/wifi_direct_cpp/data/link_manager.cpp b/core/connection/wifi_direct_cpp/data/link_manager.cpp index 5aa0d21f74..c82ea98df3 100644 --- a/core/connection/wifi_direct_cpp/data/link_manager.cpp +++ b/core/connection/wifi_direct_cpp/data/link_manager.cpp @@ -328,7 +328,7 @@ void LinkManager::RefreshRelationShip(const std::string &remoteDeviceId, const s link->SetRemoteDeviceId(remoteDeviceId); auto result = links_.insert({{ InnerLink::LinkType::HML, remoteDeviceId }, link }); if (!result.second) { - CONN_LOGE(CONN_WIFI_DIRECT, "insert by remoteDeviceId failed, use remoteMac"); + CONN_LOGE(CONN_WIFI_DIRECT, "insert by remoteDeviceId fail, use remoteMac"); links_.insert({{ InnerLink::LinkType::HML, remoteMac }, link }); } } diff --git a/core/connection/wifi_direct_cpp/data/negotiate_message.cpp b/core/connection/wifi_direct_cpp/data/negotiate_message.cpp index 29efe6d5e3..0d47a0a72d 100644 --- a/core/connection/wifi_direct_cpp/data/negotiate_message.cpp +++ b/core/connection/wifi_direct_cpp/data/negotiate_message.cpp @@ -242,7 +242,7 @@ void NegotiateMessage::MarshallingLinkInfo(WifiDirectProtocol &protocol) const { auto pro = WifiDirectProtocolFactory::CreateProtocol(protocol.GetType()); if (pro == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "create protocol failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "create protocol fail"); return; } pro->SetFormat(protocol.GetFormat()); diff --git a/core/connection/wifi_direct_cpp/data/wifi_config_info.cpp b/core/connection/wifi_direct_cpp/data/wifi_config_info.cpp index 11c2cd20c6..1ff0fd6f9d 100644 --- a/core/connection/wifi_direct_cpp/data/wifi_config_info.cpp +++ b/core/connection/wifi_direct_cpp/data/wifi_config_info.cpp @@ -30,7 +30,7 @@ WifiConfigInfo::WifiConfigInfo(std::vector &config) "invalid parameter, config size is %{public}zu", config.size()); auto pro = WifiDirectProtocolFactory::CreateProtocol(ProtocolType::TLV); if (pro == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "create tlv protocol failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "create tlv protocol fail"); return; } pro->SetFormat(ProtocolFormat { TlvProtocol::TLV_TAG_SIZE, TlvProtocol::TLV_LENGTH_SIZE1 }); @@ -92,7 +92,7 @@ void WifiConfigInfo::UnmarshallingInterfaceArray(WifiDirectProtocol &protocol, u { CONN_CHECK_AND_RETURN_LOGW(data != nullptr, CONN_WIFI_DIRECT, "data is nullptr"); auto pro = WifiDirectProtocolFactory::CreateProtocol(protocol.GetType()); - CONN_CHECK_AND_RETURN_LOGE(pro != nullptr, CONN_WIFI_DIRECT, "create protocol failed"); + CONN_CHECK_AND_RETURN_LOGE(pro != nullptr, CONN_WIFI_DIRECT, "create protocol fail"); pro->SetFormat(ProtocolFormat { TlvProtocol::TLV_TAG_SIZE, TlvProtocol::TLV_LENGTH_SIZE1 }); InterfaceInfo info; diff --git a/core/connection/wifi_direct_cpp/dbinder/wifi_direct_init.cpp b/core/connection/wifi_direct_cpp/dbinder/wifi_direct_init.cpp index ff179f3715..d46aa4ac6b 100644 --- a/core/connection/wifi_direct_cpp/dbinder/wifi_direct_init.cpp +++ b/core/connection/wifi_direct_cpp/dbinder/wifi_direct_init.cpp @@ -53,7 +53,7 @@ bool DBinderSoftbusServer::OpenSoftbusServerSo() soHandle_ = dlopen(SOFTBUS_SERVER_PATH_NAME, RTLD_NOW | RTLD_GLOBAL); if (soHandle_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlopen libsoftbus_server.z.so failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlopen libsoftbus_server.z.so fail."); return false; } @@ -76,7 +76,7 @@ int32_t DBinderSoftbusServer::RegAuthTransListener(int32_t module, const AuthTra regAuthTransListenerFunc_ = (RegAuthTransListenerFunc)dlsym(soHandle_, "RegAuthTransListener"); if (regAuthTransListenerFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym RegAuthTransListener failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym RegAuthTransListener fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -96,7 +96,7 @@ int32_t DBinderSoftbusServer::AuthGetDeviceUuid(int64_t authId, char *uuid, uint authGetDeviceUuidFunc_ = (AuthGetDeviceUuidFunc)dlsym(soHandle_, "AuthGetDeviceUuid"); if (authGetDeviceUuidFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthGetDeviceUuid failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthGetDeviceUuid fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -116,7 +116,7 @@ int32_t DBinderSoftbusServer::AuthPostTransData(AuthHandle authHandle, const Aut authPostTransDataFunc_ = (AuthPostTransDataFunc)dlsym(soHandle_, "AuthPostTransData"); if (authPostTransDataFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthPostTransData failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthPostTransData fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -136,7 +136,7 @@ void DBinderSoftbusServer::AuthCloseConn(AuthHandle authHandle) authCloseConnFunc_ = (AuthCloseConnFunc)dlsym(soHandle_, "AuthCloseConn"); if (authCloseConnFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthCloseConn failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthCloseConn fail."); return; } @@ -156,7 +156,7 @@ int32_t DBinderSoftbusServer::AuthGetMetaType(int64_t authId, bool *isMetaAuth) authGetMetaTypeFunc_ = (AuthGetMetaTypeFunc)dlsym(soHandle_, "AuthGetMetaType"); if (authGetMetaTypeFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthGetMetaType failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthGetMetaType fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -178,7 +178,7 @@ int32_t DBinderSoftbusServer::AuthStartListeningForWifiDirect(AuthLinkType type, authStartListeningForWifiDirectFunc_ = (AuthStartListeningForWifiDirectFunc)dlsym(soHandle_, "AuthStartListeningForWifiDirect"); if (authStartListeningForWifiDirectFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthStartListeningForWifiDirect failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthStartListeningForWifiDirect fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -199,7 +199,7 @@ void DBinderSoftbusServer::AuthStopListeningForWifiDirect(AuthLinkType type, Lis authStopListeningForWifiDirectFunc_ = (AuthStopListeningForWifiDirectFunc)dlsym(soHandle_, "AuthStopListeningForWifiDirect"); if (authStopListeningForWifiDirectFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthStopListeningForWifiDirect failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthStopListeningForWifiDirect fail."); return; } @@ -219,7 +219,7 @@ uint32_t DBinderSoftbusServer::AuthGenRequestId(void) authGenRequestIdFunc_ = (AuthGenRequestIdFunc)dlsym(soHandle_, "AuthGenRequestId"); if (authGenRequestIdFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthGenRequestId failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthGenRequestId fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -240,7 +240,7 @@ int32_t DBinderSoftbusServer::AuthOpenConn(const AuthConnInfo *info, uint32_t re authOpenConnFunc_ = (AuthOpenConnFunc)dlsym(soHandle_, "AuthOpenConn"); if (authOpenConnFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthOpenConn failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthOpenConn fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -259,7 +259,7 @@ const char *DBinderSoftbusServer::LnnConvertDLidToUdid(const char *id, IdCategor lnnConvertDLidToUdidFunc_ = (LnnConvertDLidToUdidFunc)dlsym(soHandle_, "LnnConvertDLidToUdid"); if (lnnConvertDLidToUdidFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnConvertDLidToUdid failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnConvertDLidToUdid fail."); return nullptr; } @@ -278,7 +278,7 @@ void DBinderSoftbusServer::AuthStopListening(AuthLinkType type) authStopListeningFunc_ = (AuthStopListeningFunc)dlsym(soHandle_, "AuthStopListening"); if (authStopListeningFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthStopListening failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym AuthStopListening fail."); return; } @@ -299,7 +299,7 @@ int32_t DBinderSoftbusServer::TransProxyPipelineRegisterListener(TransProxyPipel transProxyPipelineRegisterListenerFunc_ = (TransProxyPipelineRegisterListenerFunc)dlsym(soHandle_, "TransProxyPipelineRegisterListener"); if (transProxyPipelineRegisterListenerFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym TransProxyPipelineRegisterListener failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym TransProxyPipelineRegisterListener fail"); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -319,7 +319,7 @@ int32_t DBinderSoftbusServer::TransProxyPipelineGetUuidByChannelId(int32_t chann transProxyPipelineGetUuidByChannelIdFunc_ = (TransProxyPipelineGetUuidByChannelIdFunc)dlsym(soHandle_, "TransProxyPipelineGetUuidByChannelId"); if (transProxyPipelineGetUuidByChannelIdFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym TransProxyPipelineGetUuidByChannelId failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym TransProxyPipelineGetUuidByChannelId fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -341,7 +341,7 @@ int32_t DBinderSoftbusServer::TransProxyPipelineSendMessage( transProxyPipelineSendMessageFunc_ = (TransProxyPipelineSendMessageFunc)dlsym(soHandle_, "TransProxyPipelineSendMessage"); if (transProxyPipelineSendMessageFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym TransProxyPipelineSendMessage failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym TransProxyPipelineSendMessage fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -379,7 +379,7 @@ int32_t DBinderSoftbusServer::LnnGetRemoteStrInfo(const char *networkId, InfoKey lnnGetRemoteStrInfoFunc_ = (LnnGetRemoteStrInfoFunc)dlsym(soHandle_, "LnnGetRemoteStrInfo"); if (lnnGetRemoteStrInfoFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetRemoteStrInfo failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetRemoteStrInfo fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } return lnnGetRemoteStrInfoFunc_(networkId, key, info, len); @@ -397,7 +397,7 @@ int32_t DBinderSoftbusServer::LnnGetNetworkIdByUuid(const char *uuid, char *buf, lnnGetNetworkIdByUuidFunc_ = (LnnGetNetworkIdByUuidFunc)dlsym(soHandle_, "LnnGetNetworkIdByUuid"); if (lnnGetNetworkIdByUuidFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetNetworkIdByUuid failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetNetworkIdByUuid fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -416,7 +416,7 @@ int32_t DBinderSoftbusServer::LnnGetLocalStrInfo(InfoKey key, char *info, uint32 lnnGetLocalStrInfoFunc_ = (LnnGetLocalStrInfoFunc)dlsym(soHandle_, "LnnGetLocalStrInfo"); if (lnnGetLocalStrInfoFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetLocalStrInfo failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetLocalStrInfo fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -435,7 +435,7 @@ int32_t DBinderSoftbusServer::LnnGetLocalNumU64Info(InfoKey key, uint64_t *info) lnnGetLocalNumU64InfoFunc_ = (LnnGetLocalNumU64InfoFunc)dlsym(soHandle_, "LnnGetLocalNumU64Info"); if (lnnGetLocalNumU64InfoFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetLocalNumU64Info failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetLocalNumU64Info fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -454,7 +454,7 @@ int32_t DBinderSoftbusServer::LnnGetRemoteByteInfo(const char *networkId, InfoKe lnnGetRemoteByteInfoFunc_ = (LnnGetRemoteByteInfoFunc)dlsym(soHandle_, "LnnGetRemoteByteInfo"); if (lnnGetRemoteByteInfoFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetRemoteByteInfo failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetRemoteByteInfo fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -474,7 +474,7 @@ int32_t DBinderSoftbusServer::LnnGetRemoteBoolInfoIgnoreOnline(const char *netwo lnnGetRemoteBoolInfoIgnoreOnlineFunc_ = (LnnGetRemoteBoolInfoIgnoreOnlineFunc)dlsym(soHandle_, "LnnGetRemoteBoolInfoIgnoreOnline"); if (lnnGetRemoteBoolInfoIgnoreOnlineFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetRemoteBoolInfoIgnoreOnline failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetRemoteBoolInfoIgnoreOnline fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -494,7 +494,7 @@ uint64_t DBinderSoftbusServer::LnnGetFeatureCapabilty(void) lnnGetFeatureCapabiltyFunc_ = (LnnGetFeatureCapabiltyFunc)dlsym(soHandle_, "LnnGetFeatureCapabilty"); if (lnnGetFeatureCapabiltyFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetFeatureCapabilty failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetFeatureCapabilty fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -514,7 +514,7 @@ bool DBinderSoftbusServer::IsFeatureSupport(uint64_t feature, FeatureCapability isFeatureSupportFunc_ = (IsFeatureSupportFunc)dlsym(soHandle_, "IsFeatureSupport"); if (isFeatureSupportFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym IsFeatureSupport failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym IsFeatureSupport fail."); return false; } @@ -533,7 +533,7 @@ int32_t DBinderSoftbusServer::LnnSetLocalStrInfo(InfoKey key, const char *info) lnnSetLocalStrInfoFunc_ = (LnnSetLocalStrInfoFunc)dlsym(soHandle_, "LnnSetLocalStrInfo"); if (lnnSetLocalStrInfoFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnSetLocalStrInfo failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnSetLocalStrInfo fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -552,7 +552,7 @@ bool DBinderSoftbusServer::LnnGetOnlineStateById(const char *id, IdCategory type lnnGetOnlineStateByIdFunc_ = (LnnGetOnlineStateByIdFunc)dlsym(soHandle_, "LnnGetOnlineStateById"); if (lnnGetOnlineStateByIdFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetOnlineStateById failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetOnlineStateById fail"); return false; } @@ -571,7 +571,7 @@ int32_t DBinderSoftbusServer::LnnSetLocalNumInfo(InfoKey key, int32_t info) lnnSetLocalNumInfoFunc_ = (LnnSetLocalNumInfoFunc)dlsym(soHandle_, "LnnSetLocalNumInfo"); if (lnnSetLocalNumInfoFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnSetLocalNumInfo failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnSetLocalNumInfo fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -590,7 +590,7 @@ int32_t DBinderSoftbusServer::LnnSyncP2pInfo(void) lnnSyncP2pInfoFunc_ = (LnnSyncP2pInfoFunc)dlsym(soHandle_, "LnnSyncP2pInfo"); if (lnnSyncP2pInfoFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnSyncP2pInfo failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnSyncP2pInfo fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -609,7 +609,7 @@ int32_t DBinderSoftbusServer::LnnGetOsTypeByNetworkId(const char *networkId, int lnnGetOsTypeByNetworkIdFunc_ = (LnnGetOsTypeByNetworkIdFunc)dlsym(soHandle_, "LnnGetOsTypeByNetworkId"); if (lnnGetOsTypeByNetworkIdFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetOsTypeByNetworkId failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetOsTypeByNetworkId fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -628,7 +628,7 @@ int32_t DBinderSoftbusServer::LnnGetRemoteNumInfo(const char *networkId, InfoKey lnnGetRemoteNumInfoFunc_ = (LnnGetRemoteNumInfoFunc)dlsym(soHandle_, "LnnGetRemoteNumInfo"); if (lnnGetRemoteNumInfoFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetRemoteNumInfo failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetRemoteNumInfo fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -647,7 +647,7 @@ int32_t DBinderSoftbusServer::LnnGetLocalNumInfo(InfoKey key, int32_t *info) lnnGetLocalNumInfoFunc_ = (LnnGetLocalNumInfoFunc)dlsym(soHandle_, "LnnGetLocalNumInfo"); if (lnnGetLocalNumInfoFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetLocalNumInfo failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetLocalNumInfo fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -666,7 +666,7 @@ int32_t DBinderSoftbusServer::LnnGetRemoteNumU64Info(const char *networkId, Info lnnGetRemoteNumU64InfoFunc_ = (LnnGetRemoteNumU64InfoFunc)dlsym(soHandle_, "LnnGetRemoteNumU64Info"); if (lnnGetRemoteNumU64InfoFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetRemoteNumU64Info failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetRemoteNumU64Info fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -685,7 +685,7 @@ int32_t DBinderSoftbusServer::LnnGetRemoteNodeInfoById(const char *id, IdCategor lnnGetRemoteNodeInfoByIdFunc_ = (LnnGetRemoteNodeInfoByIdFunc)dlsym(soHandle_, "LnnGetRemoteNodeInfoById"); if (lnnGetRemoteNodeInfoByIdFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetRemoteNodeInfoById failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetRemoteNodeInfoById fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -704,7 +704,7 @@ int32_t DBinderSoftbusServer::LnnGetRemoteNodeInfoByKey(const char *key, NodeInf lnnGetRemoteNodeInfoByKeyFunc_ = (LnnGetRemoteNodeInfoByKeyFunc)dlsym(soHandle_, "LnnGetRemoteNodeInfoByKey"); if (lnnGetRemoteNodeInfoByKeyFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetRemoteNodeInfoByKey failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetRemoteNodeInfoByKey fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -724,7 +724,7 @@ int32_t DBinderSoftbusServer::LnnGetAllOnlineNodeInfo(NodeBasicInfo **info, int3 lnnGetAllOnlineNodeInfoFunc_ = (LnnGetAllOnlineNodeInfoFunc)dlsym(soHandle_, "LnnGetAllOnlineNodeInfo"); if (lnnGetAllOnlineNodeInfoFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetAllOnlineNodeInfo failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetAllOnlineNodeInfo fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -744,7 +744,7 @@ int32_t DBinderSoftbusServer::LnnRegisterEventHandler(LnnEventType event, LnnEve lnnRegisterEventHandlerFunc_ = (LnnRegisterEventHandlerFunc)dlsym(soHandle_, "LnnRegisterEventHandler"); if (lnnRegisterEventHandlerFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnRegisterEventHandler failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnRegisterEventHandler fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -764,7 +764,7 @@ int32_t DBinderSoftbusServer::LnnGetLocalBoolInfo(InfoKey key, bool *info, uint3 lnnGetLocalBoolInfoFunc_ = (LnnGetLocalBoolInfoFunc)dlsym(soHandle_, "LnnGetLocalBoolInfo"); if (lnnGetLocalBoolInfoFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetLocalBoolInfo failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnGetLocalBoolInfo fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -785,7 +785,7 @@ int32_t DBinderSoftbusServer::LnnConvertDlId( lnnConvertDlIdFunc_ = (LnnConvertDlIdFunc)dlsym(soHandle_, "LnnConvertDlId"); if (lnnConvertDlIdFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnConvertDlId failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym LnnConvertDlId fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -805,7 +805,7 @@ int32_t DBinderSoftbusServer::GetConnectionIdByHandle(AuthHandle handle) getConnectionIdByHandleFunc_ = (GetConnectionIdByHandleFunc)dlsym(soHandle_, "GetConnectionIdByHandle"); if (getConnectionIdByHandleFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym GetConnectionIdByHandle failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym GetConnectionIdByHandle fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } @@ -826,7 +826,7 @@ int32_t DBinderSoftbusServer::ConnSetKeepaliveByConnectionId(uint32_t connection connSetKeepaliveByConnectionIdFunc_ = (ConnSetKeepaliveByConnectionIdFunc)dlsym( soHandle_, "ConnSetKeepaliveByConnectionId"); if (connSetKeepaliveByConnectionIdFunc_ == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym ConnSetKeepaliveByConnectionId failed."); + CONN_LOGE(CONN_WIFI_DIRECT, "[wifi_direct_init] dlsym ConnSetKeepaliveByConnectionId fail."); return SOFTBUS_WIFI_DIRECT_DLSYM_FAILED; } diff --git a/core/connection/wifi_direct_cpp/dfx/wifi_direct_hidumper.cpp b/core/connection/wifi_direct_cpp/dfx/wifi_direct_hidumper.cpp index 4e559442e8..f1340e507b 100644 --- a/core/connection/wifi_direct_cpp/dfx/wifi_direct_hidumper.cpp +++ b/core/connection/wifi_direct_cpp/dfx/wifi_direct_hidumper.cpp @@ -99,7 +99,7 @@ int WifiDirectHidumper::JudgeP2pGroup() if (ret != WIFI_SUCCESS) { CONN_CHECK_AND_RETURN_RET_LOGE( ret != ERROR_P2P_GROUP_NOT_AVAILABLE, P2P_GROUP_NOT_EXIST, CONN_WIFI_DIRECT, "p2p group not exist"); - CONN_LOGE(CONN_WIFI_DIRECT, "get current group failed, error=%{public}d", ret); + CONN_LOGE(CONN_WIFI_DIRECT, "get current group fail, error=%{public}d", ret); return ret; } return (groupInfo->frequency != 0) ? P2P_GROUP_EXIST : P2P_GROUP_NOT_EXIST; diff --git a/core/connection/wifi_direct_cpp/entity/p2p_available_state.cpp b/core/connection/wifi_direct_cpp/entity/p2p_available_state.cpp index 69fda66fdc..9a753591c1 100644 --- a/core/connection/wifi_direct_cpp/entity/p2p_available_state.cpp +++ b/core/connection/wifi_direct_cpp/entity/p2p_available_state.cpp @@ -66,7 +66,7 @@ int P2pAvailableState::CreateGroup(const std::shared_ptrcontent_); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "create group failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "create group fail"); ChangeState(P2pCreateGroupState::Instance(), operation); return SOFTBUS_OK; } @@ -96,7 +96,7 @@ int P2pAvailableState::RemoveLink(const std::shared_ptrcontent_); if (ret != SOFTBUS_OK) { - CONN_LOGI(CONN_WIFI_DIRECT, "remove group failed, error=%{public}d", ret); + CONN_LOGI(CONN_WIFI_DIRECT, "remove group fail, error=%{public}d", ret); return ret; } ChangeState(P2pDestroyGroupState::Instance(), operation); diff --git a/core/connection/wifi_direct_cpp/entity/p2p_connect_state.cpp b/core/connection/wifi_direct_cpp/entity/p2p_connect_state.cpp index d0c12e30bc..8c69af2f61 100644 --- a/core/connection/wifi_direct_cpp/entity/p2p_connect_state.cpp +++ b/core/connection/wifi_direct_cpp/entity/p2p_connect_state.cpp @@ -160,7 +160,7 @@ void P2pConnectState::PreprocessP2pConnectionChangeEvent( } auto ret = P2pAdapter::P2pConfigGcIp(groupInfo->interface, operation->content_.gcIp); P2pEntity::GetInstance().Unlock(); - CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_WIFI_DIRECT, "config gc ip failed, error=%{public}d", ret); + CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_WIFI_DIRECT, "config gc ip fail, error=%{public}d", ret); } void P2pConnectState::OnP2pConnectionChangeEvent( @@ -178,7 +178,7 @@ void P2pConnectState::OnP2pConnectionChangeEvent( P2pOperationResult result; if (ret != SOFTBUS_OK || info.connectState == P2P_DISCONNECTED) { result.errorCode_ = SOFTBUS_CONN_P2P_ABNORMAL_DISCONNECTION; - CONN_LOGE(CONN_WIFI_DIRECT, "connect call event failed, error=%{public}d", result.errorCode_); + CONN_LOGE(CONN_WIFI_DIRECT, "connect call event fail, error=%{public}d", result.errorCode_); } else { result.errorCode_ = SOFTBUS_OK; } diff --git a/core/connection/wifi_direct_cpp/entity/p2p_create_group_state.cpp b/core/connection/wifi_direct_cpp/entity/p2p_create_group_state.cpp index 42f487890b..0d626b7a69 100644 --- a/core/connection/wifi_direct_cpp/entity/p2p_create_group_state.cpp +++ b/core/connection/wifi_direct_cpp/entity/p2p_create_group_state.cpp @@ -102,7 +102,7 @@ void P2pCreateGroupState::OnP2pConnectionChangeEvent( P2pOperationResult result; if (info.connectState == P2P_DISCONNECTED) { result.errorCode_ = SOFTBUS_CONN_P2P_ABNORMAL_DISCONNECTION; - CONN_LOGE(CONN_WIFI_DIRECT, "create group call event failed, error=%{public}d", result.errorCode_); + CONN_LOGE(CONN_WIFI_DIRECT, "create group call event fail, error=%{public}d", result.errorCode_); } else { P2pEntity::GetInstance().currentFrequency_ = groupInfo->frequency; result.errorCode_ = SOFTBUS_OK; diff --git a/core/connection/wifi_direct_cpp/entity/p2p_destroy_group_state.cpp b/core/connection/wifi_direct_cpp/entity/p2p_destroy_group_state.cpp index 0e4a1f38bd..93d175ae4a 100644 --- a/core/connection/wifi_direct_cpp/entity/p2p_destroy_group_state.cpp +++ b/core/connection/wifi_direct_cpp/entity/p2p_destroy_group_state.cpp @@ -105,7 +105,7 @@ void P2pDestroyGroupState::OnP2pConnectionChangeEvent( result.errorCode_ = SOFTBUS_OK; } else { result.errorCode_ = SOFTBUS_CONN_P2P_SHORT_RANGE_CALLBACK_DESTROY_FAILED; - CONN_LOGE(CONN_WIFI_DIRECT, "destroy group call event failed, error=%{public}d", result.errorCode_); + CONN_LOGE(CONN_WIFI_DIRECT, "destroy group call event fail, error=%{public}d", result.errorCode_); } ChangeState(P2pAvailableState::Instance(), nullptr); operation_->promise_.set_value(result); diff --git a/core/connection/wifi_direct_cpp/entity/p2p_entity.cpp b/core/connection/wifi_direct_cpp/entity/p2p_entity.cpp index c6afadec42..6bb78aa35c 100644 --- a/core/connection/wifi_direct_cpp/entity/p2p_entity.cpp +++ b/core/connection/wifi_direct_cpp/entity/p2p_entity.cpp @@ -44,7 +44,7 @@ static void P2pConnectionChangeCallback(const WifiP2pLinkedInfo info) param.groupInfo = std::make_shared(); auto ret = P2pAdapter::GetGroupInfo(*(param.groupInfo)); if (ret != SOFTBUS_OK) { - CONN_LOGI(CONN_WIFI_DIRECT, "get group info failed, error=%{public}d", ret); + CONN_LOGI(CONN_WIFI_DIRECT, "get group info fail, error=%{public}d", ret); param.groupInfo = nullptr; } P2pBroadcast::GetInstance()->DispatchWorkHandler( @@ -93,7 +93,7 @@ void P2pEntity::DisconnectLink(const std::string &remoteMac) CONN_LOGI(CONN_WIFI_DIRECT, "enter"); P2pAdapter::WifiDirectP2pGroupInfo groupInfo {}; auto ret = P2pAdapter::GetGroupInfo(groupInfo); - CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_WIFI_DIRECT, "get group info failed"); + CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_WIFI_DIRECT, "get group info fail"); bool isNeedRemove = true; if (groupInfo.isGroupOwner) { if (groupInfo.clientDevices.size() > 1) { @@ -271,7 +271,7 @@ P2pOperationResult P2pEntity::Disconnect(const P2pDestroyGroupParam ¶m) return SOFTBUS_OK; }); if (ret != SOFTBUS_OK) { - CONN_LOGI(CONN_WIFI_DIRECT, "get reuse cnt from interface info failed, error=%{public}d", ret); + CONN_LOGI(CONN_WIFI_DIRECT, "get reuse cnt from interface info fail, error=%{public}d", ret); result.errorCode_ = ret; return result; } @@ -447,15 +447,15 @@ static void UpdateInterfaceInfo( if (groupInfo->isGroupOwner) { auto ret = P2pAdapter::GetGroupConfig(groupConfig); CONN_CHECK_AND_RETURN_LOGE( - ret == SOFTBUS_OK, CONN_WIFI_DIRECT, "get group config failed, error=%{public}d", ret); + ret == SOFTBUS_OK, CONN_WIFI_DIRECT, "get group config fail, error=%{public}d", ret); } std::string dynamicMac; auto ret = P2pAdapter::GetDynamicMacAddress(dynamicMac); - CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_WIFI_DIRECT, "get dynamic mac failed, error=%{public}d", ret); + CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_WIFI_DIRECT, "get dynamic mac fail, error=%{public}d", ret); std::string ip; ret = P2pAdapter::GetIpAddress(ip); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "get ip failed, error=%{public}d", ret); + CONN_LOGE(CONN_WIFI_DIRECT, "get ip fail, error=%{public}d", ret); } else { CONN_LOGI(CONN_WIFI_DIRECT, "localIp=%{public}s", WifiDirectAnonymizeIp(ip).c_str()); } @@ -551,7 +551,7 @@ void P2pEntity::UpdateLinkManager( CONN_CHECK_AND_RETURN_LOGE(groupInfo, CONN_WIFI_DIRECT, "groupInfo is null"); std::string dynamicMac; auto ret = P2pAdapter::GetDynamicMacAddress(dynamicMac); - CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_WIFI_DIRECT, "get dynamic mac failed, error=%{public}d", ret); + CONN_CHECK_AND_RETURN_LOGE(ret == SOFTBUS_OK, CONN_WIFI_DIRECT, "get dynamic mac fail, error=%{public}d", ret); UpdateInnerLink(groupInfo, dynamicMac); } diff --git a/core/connection/wifi_direct_cpp/processor/p2p_v1_processor.cpp b/core/connection/wifi_direct_cpp/processor/p2p_v1_processor.cpp index 4d41ac8f8b..e7b4071b77 100644 --- a/core/connection/wifi_direct_cpp/processor/p2p_v1_processor.cpp +++ b/core/connection/wifi_direct_cpp/processor/p2p_v1_processor.cpp @@ -271,7 +271,7 @@ void P2pV1Processor::ProcessConnectCommand(std::shared_ptr &comm CleanupIfNeed(ret, connectCommand_->GetRemoteDeviceId()); } if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "connect failed, error=%{public}d", ret); + CONN_LOGE(CONN_WIFI_DIRECT, "connect fail, error=%{public}d", ret); command->OnFailure(ret); Terminate(); } @@ -309,7 +309,7 @@ void P2pV1Processor::ProcessDisconnectCommand(std::shared_ptr } auto ret = SendDisconnectRequest(*command->GetNegotiateChannel()); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "send disconnect request failed, error=%{public}d", ret); + CONN_LOGE(CONN_WIFI_DIRECT, "send disconnect request fail, error=%{public}d", ret); command->OnFailure(ret); Terminate(); } @@ -332,7 +332,7 @@ void P2pV1Processor::ProcessDisconnectCommand(std::shared_ptr SoftBusSleepMs(DISCONNECT_WAIT_POST_REQUEST_MS); ret = RemoveLink(command->GetRemoteDeviceId()); if (ret != SOFTBUS_OK) { - CONN_LOGI(CONN_WIFI_DIRECT, "remove link failed, error=%{public}d", ret); + CONN_LOGI(CONN_WIFI_DIRECT, "remove link fail, error=%{public}d", ret); command->OnFailure(ret); Terminate(); } @@ -581,14 +581,14 @@ void P2pV1Processor::ProcessAuthConnEvent(std::shared_ptr &event) { StopTimer(); if (event->reason_ != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "auth connect failed, error=%{public}d", event->reason_); + CONN_LOGE(CONN_WIFI_DIRECT, "auth connect fail, error=%{public}d", event->reason_); Terminate(); } auto channel = std::make_shared(event->handle_); channel->SetClose(); auto ret = SendHandShakeMessage(*channel); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "send hand shake message failed, error=%{public}d", ret); + CONN_LOGE(CONN_WIFI_DIRECT, "send hand shake message fail, error=%{public}d", ret); Terminate(); } LinkManager::GetInstance().ProcessIfPresent(InnerLink::LinkType::P2P, remoteDeviceId_, [&channel](InnerLink &link) { @@ -665,7 +665,7 @@ void P2pV1Processor::OnWaitRequestTimeoutEvent() int P2pV1Processor::OnClientJoinEvent(std::shared_ptr &event) { CONN_CHECK_AND_RETURN_RET_LOGW(event->result_ == SOFTBUS_OK, event->result_, CONN_WIFI_DIRECT, - "client join failed, error=%{public}d", event->result_); + "client join fail, error=%{public}d", event->result_); SwitchState(&P2pV1Processor::WaitAuthHandShakeState, P2P_V1_WAITING_AUTH_TIME_MS); return SOFTBUS_OK; } @@ -688,7 +688,7 @@ int P2pV1Processor::CreateLink() return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get current p2p role failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get current p2p role fail, error=%{public}d", ret); CONN_LOGI(CONN_WIFI_DIRECT, "myRole=%{public}d", WifiDirectUtils::ToWifiDirectRole(role)); switch (role) { @@ -738,7 +738,7 @@ int P2pV1Processor::CreateLinkAsNone() connectCommand_->PreferNegotiateChannel(); auto ret = SendConnectRequestAsNone(*connectCommand_->GetConnectInfo().channel_, expectedRole); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send message failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send message fail, error=%{public}d", ret); SwitchState(&P2pV1Processor::WaitingReqResponseState, P2P_V1_WAITING_RESPONSE_TIME_MS); return SOFTBUS_OK; @@ -747,7 +747,7 @@ int P2pV1Processor::CreateLinkAsNone() int P2pV1Processor::CreateLinkAsGo() { auto ret = ReuseP2p(); - CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "reuse p2p failed, error=%{public}d", ret); + CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "reuse p2p fail, error=%{public}d", ret); std::string localIp; std::string localMac; @@ -758,13 +758,13 @@ int P2pV1Processor::CreateLinkAsGo() return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get local ip failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get local ip fail, error=%{public}d", ret); auto remoteMac = std::string(connectCommand_->GetConnectInfo().info_.remoteMac); std::string gcIp; ret = P2pAdapter::RequestGcIp(remoteMac, gcIp); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "request gc ip failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "request gc ip fail, error=%{public}d", ret); auto success = LinkManager::GetInstance().ProcessIfAbsent(InnerLink::LinkType::P2P, connectCommand_->GetRemoteDeviceId(), [remoteMac, gcIp, localIp, localMac](InnerLink &link) { link.SetRemoteBaseMac(remoteMac); @@ -773,7 +773,7 @@ int P2pV1Processor::CreateLinkAsGo() link.SetLocalIpv4(localIp); link.SetState(InnerLink::LinkState::CONNECTING); }); - CONN_CHECK_AND_RETURN_RET_LOGW(success, SOFTBUS_CONN_PV1_INTERNAL_ERR0R, CONN_WIFI_DIRECT, "save remote ip failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(success, SOFTBUS_CONN_PV1_INTERNAL_ERR0R, CONN_WIFI_DIRECT, "save remote ip fail"); clientJoiningMac_ = remoteMac; P2pEntity::GetInstance().NotifyNewClientJoining(remoteMac, P2P_V1_WAITING_CLIENT_JOIN_MS); @@ -781,7 +781,7 @@ int P2pV1Processor::CreateLinkAsGo() connectCommand_->PreferNegotiateChannel(); ret = SendConnectRequestAsGo(*connectCommand_->GetConnectInfo().channel_, remoteMac); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send message failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send message fail, error=%{public}d", ret); SwitchState(&P2pV1Processor::WaitingClientJoiningState, 0); return SOFTBUS_OK; } @@ -806,7 +806,7 @@ int P2pV1Processor::ProcessConnectRequest(std::shared_ptr &com return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get role info failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get role info fail, error=%{public}d", ret); if (myRole == LinkInfo::LinkMode::NONE && !p2pEnable) { CONN_LOGE(CONN_WIFI_DIRECT, "SOFTBUS_CONN_PV1_IF_NOT_AVAILABLE"); @@ -818,7 +818,7 @@ int P2pV1Processor::ProcessConnectRequest(std::shared_ptr &com CONN_LOGI(CONN_WIFI_DIRECT, "remoteConfigSize=%{public}zu", remoteConfig.size()); ret = P2pAdapter::SetPeerWifiConfigInfo(remoteConfig); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "set wifi cfg failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "set wifi cfg fail, error=%{public}d", ret); } auto localGoMac = GetGoMac(myRole); @@ -848,17 +848,17 @@ int P2pV1Processor::ProcessConnectRequestAsGo(std::shared_ptr if (myRole != LinkInfo::LinkMode::GO) { auto ret = CreateGroup(msg); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "create group failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "create group fail, error=%{public}d", ret); } else { std::string remoteIp; auto ret = P2pAdapter::RequestGcIp(remoteMac, remoteIp); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "apply gc ip failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "apply gc ip fail, error=%{public}d", ret); CONN_LOGI(CONN_WIFI_DIRECT, "apply gc ip %{public}s", WifiDirectAnonymizeIp(remoteIp).c_str()); ret = ReuseP2p(); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "reuse p2p failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "reuse p2p fail, error=%{public}d", ret); std::string localMac; std::string localIp; @@ -869,7 +869,7 @@ int P2pV1Processor::ProcessConnectRequestAsGo(std::shared_ptr return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, SOFTBUS_CONN_PV1_REUSE_FAIL, CONN_WIFI_DIRECT, - "update inner link failed, error=%{public}d", ret); + "update inner link fail, error=%{public}d", ret); auto success = LinkManager::GetInstance().ProcessIfAbsent(InnerLink::LinkType::P2P, msg.GetRemoteDeviceId(), [localMac, remoteMac, localIp, remoteIp](InnerLink &link) { link.SetLocalBaseMac(localMac); @@ -881,14 +881,14 @@ int P2pV1Processor::ProcessConnectRequestAsGo(std::shared_ptr link.SetState(InnerLink::LinkState::CONNECTING); }); CONN_CHECK_AND_RETURN_RET_LOGW( - success, SOFTBUS_CONN_PV1_INTERNAL_ERR0R, CONN_WIFI_DIRECT, "update inner link failed"); + success, SOFTBUS_CONN_PV1_INTERNAL_ERR0R, CONN_WIFI_DIRECT, "update inner link fail"); } clientJoiningMac_ = remoteMac; P2pEntity::GetInstance().NotifyNewClientJoining(remoteMac, P2P_V1_WAITING_CLIENT_JOIN_MS); auto ret = SendConnectResponseAsGo(*command->GetNegotiateChannel(), remoteMac); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send connection response failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send connection response fail, error=%{public}d", ret); SwitchState(&P2pV1Processor::WaitingClientJoiningState, -1); return SOFTBUS_OK; @@ -899,7 +899,7 @@ int P2pV1Processor::SendConnectResponseAsGo(const NegotiateChannel &channel, con std::string selfWifiConfig; auto ret = P2pAdapter::GetSelfWifiConfigInfo(selfWifiConfig); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get wifi cfg failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get wifi cfg fail, error=%{public}d", ret); NegotiateMessage response; response.SetLegacyP2pVersion(P2P_VERSION); @@ -924,7 +924,7 @@ int P2pV1Processor::SendConnectResponseAsGo(const NegotiateChannel &channel, con return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build response failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build response fail, error=%{public}d", ret); return channel.SendMessage(response); } @@ -938,7 +938,7 @@ int P2pV1Processor::ProcessConnectRequestAsGc(std::shared_ptr return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGE( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get local mac failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get local mac fail, error=%{public}d", ret); auto remoteMac = msg.GetLegacyP2pMac(); auto contentType = msg.GetLegacyP2pContentType(); CONN_LOGI(CONN_WIFI_DIRECT, "localMac=%{public}s, remoteMac=%{public}s, contentType=%{public}d", @@ -948,7 +948,7 @@ int P2pV1Processor::ProcessConnectRequestAsGc(std::shared_ptr if (contentType == LegacyContentType::GC_INFO) { ret = SendConnectResponseAsNone(*command->GetNegotiateChannel(), remoteMac); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send message failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send message fail, error=%{public}d", ret); SwitchState(&P2pV1Processor::WaitingRequestState, P2P_V1_WAITING_REQUEST_TIME_MS); CONN_LOGD(CONN_WIFI_DIRECT, "send response with gc info success"); @@ -960,17 +960,17 @@ int P2pV1Processor::ProcessConnectRequestAsGc(std::shared_ptr CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "SOFTBUS_CONN_PV1_REUSE_FAIL"); ret = SendNegotiateResult(*command->GetNegotiateChannel(), SOFTBUS_OK); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send result message failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send result message fail, error=%{public}d", ret); Terminate(); } CONN_LOGI(CONN_WIFI_DIRECT, "start connect group"); ret = ConnectGroup(msg, command->GetNegotiateChannel()); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "connect group failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "connect group fail, error=%{public}d", ret); ret = SendNegotiateResult(*command->GetNegotiateChannel(), SOFTBUS_OK); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send result message failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send result message fail, error=%{public}d", ret); RemoveExclusive(); SwitchState(&P2pV1Processor::WaitAuthHandShakeState, P2P_V1_WAITING_AUTH_TIME_MS); @@ -982,13 +982,13 @@ int P2pV1Processor::SendConnectResponseAsNone(const NegotiateChannel &channel, c std::vector channels; auto ret = P2pAdapter::GetChannel5GListIntArray(channels); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get 5g channels failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get 5g channels fail, error=%{public}d", ret); auto channelString = WifiDirectUtils::ChannelListToString(channels); std::string selfWifiConfig; ret = P2pAdapter::GetSelfWifiConfigInfo(selfWifiConfig); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get wifi cfg failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get wifi cfg fail, error=%{public}d", ret); NegotiateMessage response; response.SetLegacyP2pVersion(P2P_VERSION); @@ -1008,7 +1008,7 @@ int P2pV1Processor::SendConnectResponseAsNone(const NegotiateChannel &channel, c return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build response failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build response fail, error=%{public}d", ret); return channel.SendMessage(response); } int P2pV1Processor::SendInterfaceInfoResponse(const NegotiateChannel &channel) @@ -1022,7 +1022,7 @@ int P2pV1Processor::SendInterfaceInfoResponse(const NegotiateChannel &channel) return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build response failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build response fail, error=%{public}d", ret); return channel.SendMessage(response); } @@ -1041,7 +1041,7 @@ int P2pV1Processor::SendNegotiateResult(const NegotiateChannel &channel, int rea return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build result failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build result fail, error=%{public}d", ret); return channel.SendMessage(result); } @@ -1055,7 +1055,7 @@ int P2pV1Processor::SendReuseRequest(const NegotiateChannel &channel) return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build result failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build result fail, error=%{public}d", ret); return channel.SendMessage(result); } @@ -1071,7 +1071,7 @@ int P2pV1Processor::SendReuseResponse(const NegotiateChannel &channel, int32_t r return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build response failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build response fail, error=%{public}d", ret); return channel.SendMessage(response); } @@ -1085,7 +1085,7 @@ int P2pV1Processor::SendDisconnectRequest(const NegotiateChannel &channel) return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build request failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build request fail, error=%{public}d", ret); return channel.SendMessage(request); } @@ -1099,7 +1099,7 @@ int P2pV1Processor::SendForceDisconnectRequest(const NegotiateChannel &channel) return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build request failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build request fail, error=%{public}d", ret); return channel.SendMessage(request); } @@ -1142,7 +1142,7 @@ int P2pV1Processor::ProcessConflictRequest(std::shared_ptr &co CONN_LOGI(CONN_WIFI_DIRECT, "no need reversal, ignore remote request"); auto ret = SendNegotiateResult(*command->GetNegotiateChannel(), SOFTBUS_CONN_PV1_BUSY_ERR); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send result message failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send result message fail, error=%{public}d", ret); return SOFTBUS_OK; } @@ -1155,7 +1155,7 @@ int P2pV1Processor::ProcessConflictRequest(std::shared_ptr &co myRole = interface.GetRole(); return SOFTBUS_OK; }); - CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get role failed, error=%{public}d", ret); + CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get role fail, error=%{public}d", ret); if (myRole == LinkInfo::LinkMode::GO) { CONN_LOGI(CONN_WIFI_DIRECT, "decrease reuseCount and stop new client timer"); RemoveLink(command->GetRemoteDeviceId()); @@ -1194,7 +1194,7 @@ int P2pV1Processor::ProcessReuseRequest(std::shared_ptr &comma link.SetBeingUsedByRemote(true); }); if (!success) { - CONN_LOGE(CONN_WIFI_DIRECT, "update inner link failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "update inner link fail"); goto Failed; } result = SOFTBUS_OK; @@ -1202,7 +1202,7 @@ int P2pV1Processor::ProcessReuseRequest(std::shared_ptr &comma Failed: ret = SendReuseResponse(*command->GetNegotiateChannel(), result); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, - "send reuse response failed, remote=%{public}s, error=%{public}d", WifiDirectAnonymizeMac(remoteMac).c_str(), + "send reuse response fail, remote=%{public}s, error=%{public}d", WifiDirectAnonymizeMac(remoteMac).c_str(), ret); return SOFTBUS_OK; } @@ -1216,12 +1216,12 @@ int P2pV1Processor::ProcessReuseResponse(std::shared_ptr &comm CONN_LOGI( CONN_WIFI_DIRECT, "result=%{public}d, remoteMac=%{public}s", result, WifiDirectAnonymizeMac(remoteMac).c_str()); CONN_CHECK_AND_RETURN_RET_LOGW( - result == SOFTBUS_OK, result, CONN_WIFI_DIRECT, "remote response failed. result=%{public}d", result); + result == SOFTBUS_OK, result, CONN_WIFI_DIRECT, "remote response fail. result=%{public}d", result); auto ret = ReuseP2p(); if (ret != SOFTBUS_OK) { CONN_LOGE(CONN_WIFI_DIRECT, - "local reuse failed, send disconnect to remote for decreasing reference, error=%{public}d", ret); + "local reuse fail, send disconnect to remote for decreasing reference, error=%{public}d", ret); SendDisconnectRequest(*command->GetNegotiateChannel()); CONN_LOGI(CONN_WIFI_DIRECT, "wait for p2p auth to send data, DISCONNECT_WAIT_POST_REQUEST_MS=%{public}dms", @@ -1240,7 +1240,7 @@ int P2pV1Processor::ProcessReuseResponse(std::shared_ptr &comm dlink.channelId = WifiDirectUtils::FrequencyToChannel(link.GetFrequency()); }); CONN_CHECK_AND_RETURN_RET_LOGW( - success, SOFTBUS_CONN_PV1_INTERNAL_ERR0R, CONN_WIFI_DIRECT, "update inner link failed"); + success, SOFTBUS_CONN_PV1_INTERNAL_ERR0R, CONN_WIFI_DIRECT, "update inner link fail"); connectCommand_->OnSuccess(dlink); connectCommand_ = nullptr; Terminate(); @@ -1255,7 +1255,7 @@ int P2pV1Processor::ProcessDisconnectRequest(std::shared_ptr & return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get reuse count for interface info failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get reuse count for interface info fail, error=%{public}d", ret); if (reuseCountOld <= 0) { CONN_LOGI(CONN_WIFI_DIRECT, "reuseCountOld already 0, do not call RemoveLink"); @@ -1269,7 +1269,7 @@ int P2pV1Processor::ProcessDisconnectRequest(std::shared_ptr & ret = RemoveLink(command->GetRemoteDeviceId()); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "remove link failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "remove link fail, error=%{public}d", ret); return SOFTBUS_OK; } @@ -1289,7 +1289,7 @@ int P2pV1Processor::ProcessGetInterfaceInfoRequest(std::shared_ptrGetNegotiateChannel()); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send interface info response failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send interface info response fail, error=%{public}d", ret); return SOFTBUS_OK; } @@ -1315,7 +1315,7 @@ int P2pV1Processor::ProcessAuthHandShakeRequest(std::shared_ptrOnSuccess(dlink); connectCommand_ = nullptr; @@ -1328,13 +1328,13 @@ int P2pV1Processor::SendConnectRequestAsNone(const NegotiateChannel &channel, Wi std::vector channels; int32_t ret = P2pAdapter::GetChannel5GListIntArray(channels); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get 5g channels failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get 5g channels fail, error=%{public}d", ret); auto channelString = WifiDirectUtils::ChannelListToString(channels); std::string selfWifiConfig; ret = P2pAdapter::GetSelfWifiConfigInfo(selfWifiConfig); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get self wifi cfg failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get self wifi cfg fail, error=%{public}d", ret); NegotiateMessage request; request.SetLegacyP2pCommandType(LegacyCommandType::CMD_CONN_V1_REQ); @@ -1354,7 +1354,7 @@ int P2pV1Processor::SendConnectRequestAsNone(const NegotiateChannel &channel, Wi return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build request failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build request fail, error=%{public}d", ret); return channel.SendMessage(request); } @@ -1385,7 +1385,7 @@ int P2pV1Processor::SendConnectRequestAsGo(const NegotiateChannel &channel, cons return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build request failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build request fail, error=%{public}d", ret); return channel.SendMessage(request); } @@ -1400,7 +1400,7 @@ int P2pV1Processor::SendHandShakeMessage(const NegotiateChannel &channel) return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build message failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "build message fail, error=%{public}d", ret); return channel.SendMessage(message); } @@ -1413,13 +1413,13 @@ int P2pV1Processor::ProcessConnectResponseAtWaitingReqResponseState(std::shared_ myRole = interface.GetRole(); return SOFTBUS_OK; }); - CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get role failed, error=%{public}d", ret); + CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get role fail, error=%{public}d", ret); CONN_LOGI(CONN_WIFI_DIRECT, "myRole=%{public}d", WifiDirectUtils::ToWifiDirectRole(myRole)); if (myRole == LinkInfo::LinkMode::NONE) { return ProcessConnectResponseAsNone(command); } - CONN_LOGE(CONN_WIFI_DIRECT, "negotiate failed, my role invalid and changed during negotiation"); + CONN_LOGE(CONN_WIFI_DIRECT, "negotiate fail, my role invalid and changed during negotiation"); return SOFTBUS_CONN_PV1_CONNECTED_WITH_MISMATCHED_ROLE_ERR; } @@ -1431,13 +1431,13 @@ int P2pV1Processor::ProcessConnectResponseAtWaitingClientJoiningState(std::share myRole = interface.GetRole(); return SOFTBUS_OK; }); - CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get role failed, error=%{public}d", ret); + CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get role fail, error=%{public}d", ret); CONN_LOGI(CONN_WIFI_DIRECT, "myRole=%{public}d", WifiDirectUtils::ToWifiDirectRole(myRole)); if (myRole == LinkInfo::LinkMode::GO) { return ProcessConnectResponseAsGo(command); } - CONN_LOGE(CONN_WIFI_DIRECT, "negotiate failed, my role invalid and changed during negotiation"); + CONN_LOGE(CONN_WIFI_DIRECT, "negotiate fail, my role invalid and changed during negotiation"); return SOFTBUS_CONN_PV1_CONNECTED_WITH_MISMATCHED_ROLE_ERR; } @@ -1470,7 +1470,7 @@ int P2pV1Processor::ProcessConnectResponseAsGo(std::shared_ptr dlink.channelId = WifiDirectUtils::FrequencyToChannel(link.GetFrequency()); alreadyAuthHandShake = link.GetNegotiateChannel() != nullptr; }); - CONN_CHECK_AND_RETURN_RET_LOGW(success, SOFTBUS_NOT_FIND, CONN_WIFI_DIRECT, "update inner link failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(success, SOFTBUS_NOT_FIND, CONN_WIFI_DIRECT, "update inner link fail"); P2pEntity::GetInstance().CancelNewClientJoining(clientJoiningMac_); connectCommand_->OnSuccess(dlink); connectCommand_ = nullptr; @@ -1489,7 +1489,7 @@ int P2pV1Processor::ProcessConnectResponseAsNone(std::shared_ptrGetNegotiateMessage(); auto ret = ConnectGroup(msg, command->GetNegotiateChannel()); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "connect group failed, errorCode=%{public}d", ret); + CONN_LOGE(CONN_WIFI_DIRECT, "connect group fail, errorCode=%{public}d", ret); SendNegotiateResult(*command->GetNegotiateChannel(), ret); return ret; } @@ -1528,7 +1528,7 @@ int P2pV1Processor::ProcessConnectResponseWithGoInfoAsNone(std::shared_ptrOnSuccess(dlink); connectCommand_ = nullptr; @@ -1542,11 +1542,11 @@ int P2pV1Processor::ProcessConnectResponseWithGcInfoAsNone(std::shared_ptrGetNegotiateMessage(); auto ret = CreateGroup(msg); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "create group failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "create group fail, error=%{public}d", ret); std::string remoteMac = msg.GetLegacyP2pMac(); ret = SendConnectRequestAsGo(*command->GetNegotiateChannel(), remoteMac); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send message failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "send message fail, error=%{public}d", ret); SwitchState(&P2pV1Processor::WaitingClientJoiningState, -1); return SOFTBUS_OK; @@ -1592,7 +1592,7 @@ int P2pV1Processor::UpdateWhenCreateSuccess(const NegotiateMessage &msg) std::string remoteIp; int32_t ret = P2pAdapter::RequestGcIp(remoteMac, remoteIp); CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, SOFTBUS_CONN_PV1_APPLY_GC_IP_FAIL, CONN_WIFI_DIRECT, - "apply gc ip failed, error=%{public}d", ret); + "apply gc ip fail, error=%{public}d", ret); std::string localMac; std::string localIp; @@ -1605,7 +1605,7 @@ int P2pV1Processor::UpdateWhenCreateSuccess(const NegotiateMessage &msg) return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "update interface failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "update interface fail, error=%{public}d", ret); auto success = LinkManager::GetInstance().ProcessIfAbsent( InnerLink::LinkType::P2P, msg.GetRemoteDeviceId(), [localMac, localIp, remoteMac, remoteIp](InnerLink &link) { @@ -1616,7 +1616,7 @@ int P2pV1Processor::UpdateWhenCreateSuccess(const NegotiateMessage &msg) link.SetState(InnerLink::LinkState::CONNECTING); }); CONN_CHECK_AND_RETURN_RET_LOGW( - success, SOFTBUS_CONN_PV1_INTERNAL_ERR0R, CONN_WIFI_DIRECT, "update inner link failed"); + success, SOFTBUS_CONN_PV1_INTERNAL_ERR0R, CONN_WIFI_DIRECT, "update inner link fail"); clientJoiningMac_ = remoteMac; P2pEntity::GetInstance().NotifyNewClientJoining(remoteMac, P2P_V1_WAITING_CLIENT_JOIN_MS); @@ -1630,7 +1630,7 @@ int P2pV1Processor::CreateGroup(const NegotiateMessage &msg) auto channelListString = msg.GetLegacyP2pGcChannelList(); auto finalFrequency = ChooseFrequency(stationFrequency, WifiDirectUtils::StringToChannelList(channelListString)); CONN_CHECK_AND_RETURN_RET_LOGW(finalFrequency > 0, finalFrequency, CONN_WIFI_DIRECT, - "choose frequency failed, frequency=%{public}d", finalFrequency); + "choose frequency fail, frequency=%{public}d", finalFrequency); int coexCode = P2pAdapter::GetCoexConflictCode(IF_NAME_P2P, WifiDirectUtils::FrequencyToChannel(finalFrequency)); CONN_CHECK_AND_RETURN_RET_LOGE( coexCode == SOFTBUS_OK, coexCode, CONN_WIFI_DIRECT, "coex conflict, errorcode=%{public}d", coexCode); @@ -1648,7 +1648,7 @@ int P2pV1Processor::CreateGroup(const NegotiateMessage &msg) connectCommand_->GetConnectInfo().info_.dfxInfo.frequency = param.frequency; } CONN_CHECK_AND_RETURN_RET_LOGW(result.errorCode_ == SOFTBUS_OK, result.errorCode_, CONN_WIFI_DIRECT, - "create group failed, error=%{public}d", result.errorCode_); + "create group fail, error=%{public}d", result.errorCode_); return UpdateWhenCreateSuccess(msg); } @@ -1669,7 +1669,7 @@ int P2pV1Processor::UpdateWhenConnectSuccess(std::string groupConfig, const Nego return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "update interface failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "update interface fail, error=%{public}d", ret); std::string remoteIp = msg.GetLegacyP2pGoIp(); auto success = LinkManager::GetInstance().ProcessIfPresent( InnerLink::LinkType::P2P, msg.GetRemoteDeviceId(), [localMac, localIp, remoteIp](InnerLink &link) { @@ -1679,11 +1679,11 @@ int P2pV1Processor::UpdateWhenConnectSuccess(std::string groupConfig, const Nego link.SetState(InnerLink::LinkState::CONNECTED); }); CONN_CHECK_AND_RETURN_RET_LOGW( - success, SOFTBUS_CONN_PV1_INTERNAL_ERR0R, CONN_WIFI_DIRECT, "update inner link failed"); + success, SOFTBUS_CONN_PV1_INTERNAL_ERR0R, CONN_WIFI_DIRECT, "update inner link fail"); WifiDirectUtils::SyncLnnInfoForP2p((enum WifiDirectApiRole)myRole, localMac, msg.GetLegacyP2pGoMac()); ret = StartAuthListening(localIp); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "start auth listen failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "start auth listen fail, error=%{public}d", ret); return SOFTBUS_OK; } @@ -1713,17 +1713,17 @@ int P2pV1Processor::ConnectGroup(const NegotiateMessage &msg, const std::shared_ }); auto result = P2pEntity::GetInstance().Connect(params); if (result.errorCode_ != SOFTBUS_OK) { - CONN_LOGI(CONN_WIFI_DIRECT, "connect group failed, error=%{public}d", result.errorCode_); + CONN_LOGI(CONN_WIFI_DIRECT, "connect group fail, error=%{public}d", result.errorCode_); LinkManager::GetInstance().RemoveLink(InnerLink::LinkType::P2P, msg.GetRemoteDeviceId()); P2pEntity::GetInstance().Disconnect(P2pAdapter::DestroyGroupParam { IF_NAME_P2P }); return result.errorCode_; } auto ret = UpdateWhenConnectSuccess(groupConfig, msg); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "update date failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "update date fail, error=%{public}d", ret); ret = OpenAuthConnection(msg, channel); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "open auth connection failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "open auth connection fail, error=%{public}d", ret); return SOFTBUS_OK; } @@ -1759,7 +1759,7 @@ int P2pV1Processor::ChooseFrequency(int gcFreq, const std::vector &gcChanne std::vector goChannels; int32_t ret = P2pAdapter::GetChannel5GListIntArray(goChannels); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get local channel list failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get local channel list fail, error=%{public}d", ret); for (auto goChannel : goChannels) { if (std::find(gcChannels.begin(), gcChannels.end(), goChannel) != gcChannels.end()) { @@ -1786,7 +1786,7 @@ int P2pV1Processor::DestroyGroup() P2pAdapter::DestroyGroupParam param { IF_NAME_P2P }; auto result = P2pEntity::GetInstance().DestroyGroup(param); CONN_CHECK_AND_RETURN_RET_LOGW(result.errorCode_ == SOFTBUS_OK, result.errorCode_, CONN_WIFI_DIRECT, - "destroy group failed, error=%{public}d", result.errorCode_); + "destroy group fail, error=%{public}d", result.errorCode_); return SOFTBUS_OK; } @@ -1794,7 +1794,7 @@ int P2pV1Processor::ReuseP2p() { auto ret = P2pEntity::GetInstance().ReuseLink(); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "reuse link failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "reuse link fail, error=%{public}d", ret); return InterfaceManager::GetInstance().UpdateInterface(InterfaceInfo::P2P, [](InterfaceInfo &interface) { auto reuseCnt = interface.GetReuseCount(); interface.SetReuseCount(reuseCnt + 1); @@ -1827,7 +1827,7 @@ int P2pV1Processor::ReuseLink(const std::shared_ptr &command, In command->PreferNegotiateChannel(); auto ret = SendReuseRequest(*command->GetConnectInfo().channel_); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "post request failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "post request fail, error=%{public}d", ret); SwitchState(&P2pV1Processor::WaitingReuseResponseState, P2P_V1_WAITING_REUSE_RESPONSE_TIME_MS); return SOFTBUS_OK; } @@ -1865,21 +1865,21 @@ int P2pV1Processor::StartAuthListening(const std::string &localIp) return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get go port failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get go port fail, error=%{public}d", ret); if (port > 0) { CONN_LOGI(CONN_WIFI_DIRECT, "already has started listening, port=%{public}d", port); return SOFTBUS_OK; } auto pair = AuthNegotiateChannel::StartListening(AUTH_LINK_TYPE_P2P, localIp, 0); - CONN_CHECK_AND_RETURN_RET_LOGW(pair.first > 0, pair.first, CONN_WIFI_DIRECT, "start listen failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(pair.first > 0, pair.first, CONN_WIFI_DIRECT, "start listen fail"); ret = InterfaceManager::GetInstance().UpdateInterface(InterfaceInfo::P2P, [&pair](InterfaceInfo &interface) { interface.SetP2pListenPort(pair.first); interface.SetP2pListenModule(pair.second); return SOFTBUS_OK; }); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "update interface failed, error=%{public}d", ret); + CONN_LOGE(CONN_WIFI_DIRECT, "update interface fail, error=%{public}d", ret); AuthNegotiateChannel::StopListening(AUTH_LINK_TYPE_P2P, pair.second); } return ret; @@ -1899,7 +1899,7 @@ int P2pV1Processor::OpenAuthConnection(const NegotiateMessage &msg, const std::s return SOFTBUS_OK; }); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get listen module failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get listen module fail, error=%{public}d", ret); std::shared_ptr authChannel = nullptr; if (channel != nullptr && channel->GetType() != NegotiateChannelType::AUTH_CHANNEL) { @@ -1909,7 +1909,7 @@ int P2pV1Processor::OpenAuthConnection(const NegotiateMessage &msg, const std::s uint32_t authReqId = 0; ret = AuthNegotiateChannel::OpenConnection(param, authChannel, authReqId); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "open p2p auth failed, error=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "open p2p auth fail, error=%{public}d", ret); return SOFTBUS_OK; } @@ -1922,7 +1922,7 @@ int P2pV1Processor::RemoveLink(const std::string &remoteDeviceId) reuseCount = interface.GetReuseCount(); return SOFTBUS_OK; }); - CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get port failed, error=%{public}d", ret); + CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get port fail, error=%{public}d", ret); CONN_LOGI(CONN_WIFI_DIRECT, "reuseCount=%{public}d", reuseCount); if (reuseCount == 0) { @@ -1932,7 +1932,7 @@ int P2pV1Processor::RemoveLink(const std::string &remoteDeviceId) P2pAdapter::DestroyGroupParam param { IF_NAME_P2P }; auto result = P2pEntity::GetInstance().Disconnect(param); CONN_CHECK_AND_RETURN_RET_LOGW(result.errorCode_ == SOFTBUS_OK, result.errorCode_, CONN_WIFI_DIRECT, - "entity disconnect failed, error=%{public}d", result.errorCode_); + "entity disconnect fail, error=%{public}d", result.errorCode_); return InterfaceManager::GetInstance().UpdateInterface(InterfaceInfo::P2P, [](InterfaceInfo &interface) { auto reuseCount = interface.GetReuseCount(); @@ -2045,7 +2045,7 @@ int P2pV1Processor::GetFinalRoleAsNone(WifiDirectRole peerRole, WifiDirectRole e int P2pV1Processor::GenerateSinkLink(WifiDirectSinkLink &sinkLink) { bool cpyRet = strcpy_s(sinkLink.remoteUuid, sizeof(sinkLink.remoteUuid), remoteDeviceId_.c_str()) == EOK; - CONN_CHECK_AND_RETURN_RET_LOGW(cpyRet, SOFTBUS_STRCPY_ERR, CONN_WIFI_DIRECT, "strcpy failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(cpyRet, SOFTBUS_STRCPY_ERR, CONN_WIFI_DIRECT, "strcpy fail"); InterfaceManager::GetInstance().ReadInterface(InterfaceInfo::P2P, [&sinkLink](const InterfaceInfo &interface) { sinkLink.bandWidth = static_cast(interface.GetBandWidth()); @@ -2061,7 +2061,7 @@ int P2pV1Processor::GenerateSinkLink(WifiDirectSinkLink &sinkLink) (strcpy_s(sinkLink.remoteMac, sizeof(sinkLink.remoteMac), link.GetRemoteBaseMac().c_str()) == EOK); }); - CONN_CHECK_AND_RETURN_RET_LOGW(cpyRet, SOFTBUS_STRCPY_ERR, CONN_WIFI_DIRECT, "strcpy failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(cpyRet, SOFTBUS_STRCPY_ERR, CONN_WIFI_DIRECT, "strcpy fail"); return SOFTBUS_OK; } diff --git a/core/connection/wifi_direct_cpp/protocol/json_protocol.cpp b/core/connection/wifi_direct_cpp/protocol/json_protocol.cpp index f7e8258144..8f1f613330 100644 --- a/core/connection/wifi_direct_cpp/protocol/json_protocol.cpp +++ b/core/connection/wifi_direct_cpp/protocol/json_protocol.cpp @@ -105,7 +105,7 @@ void JsonProtocol::SetInput(const std::vector &input) jsonObject_ = nlohmann::json::parse(inputString, nullptr, false, false); readPos_ = jsonObject_.begin(); if (jsonObject_.is_discarded()) { - CONN_LOGE(CONN_WIFI_DIRECT, "parse json failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "parse json fail"); readPos_ = jsonObject_.end(); } } diff --git a/core/connection/wifi_direct_cpp/utils/wifi_direct_utils.cpp b/core/connection/wifi_direct_cpp/utils/wifi_direct_utils.cpp index 341720823f..eb51962a71 100644 --- a/core/connection/wifi_direct_cpp/utils/wifi_direct_utils.cpp +++ b/core/connection/wifi_direct_cpp/utils/wifi_direct_utils.cpp @@ -83,7 +83,7 @@ uint32_t WifiDirectUtils::BytesToInt(const uint8_t *data, uint32_t size) CONN_CHECK_AND_RETURN_RET_LOGW(size <= sizeof(uint32_t), 0, CONN_WIFI_DIRECT, "data len invalid"); uint32_t result = 0; int res = memcpy_s(&result, sizeof(result), data, size); - CONN_CHECK_AND_RETURN_RET_LOGW(res == EOK, 0, CONN_WIFI_DIRECT, "copy failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(res == EOK, 0, CONN_WIFI_DIRECT, "copy fail"); return le32toh(result); } @@ -171,7 +171,7 @@ int WifiDirectUtils::GetRecommendChannelFromLnn(const std::string &networkId) char udid[UDID_BUF_LEN] {}; int ret = DBinderSoftbusServer::GetInstance().LnnGetRemoteStrInfo(networkId.c_str(), STRING_KEY_DEV_UDID, udid, UDID_BUF_LEN); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get udid failed, ret = %{public}d", ret); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get udid fail, ret = %{public}d", ret); int channelIdLnn = 0; ret = LnnGetRecommendChannelPacked(udid, &channelIdLnn); CONN_CHECK_AND_RETURN_RET_LOGE( @@ -184,7 +184,7 @@ std::string WifiDirectUtils::NetworkIdToUuid(const std::string &networkId) char uuid[UUID_BUF_LEN] {}; int ret = DBinderSoftbusServer::GetInstance().LnnGetRemoteStrInfo(networkId.c_str(), STRING_KEY_UUID, uuid, UUID_BUF_LEN); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, "", CONN_WIFI_DIRECT, "get uuid failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, "", CONN_WIFI_DIRECT, "get uuid fail"); return uuid; } @@ -192,7 +192,7 @@ std::string WifiDirectUtils::UuidToNetworkId(const std::string &uuid) { char networkId[NETWORK_ID_BUF_LEN] {}; auto ret = DBinderSoftbusServer::GetInstance().LnnGetNetworkIdByUuid(uuid.c_str(), networkId, sizeof(networkId)); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, "", CONN_WIFI_DIRECT, "get network id failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, "", CONN_WIFI_DIRECT, "get network id fail"); return networkId; } @@ -201,7 +201,7 @@ std::string WifiDirectUtils::GetLocalNetworkId() char networkId[NETWORK_ID_BUF_LEN] {}; auto ret = DBinderSoftbusServer::GetInstance().LnnGetLocalStrInfo(STRING_KEY_NETWORKID, networkId, NETWORK_ID_BUF_LEN); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, "", CONN_WIFI_DIRECT, "get network id failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, "", CONN_WIFI_DIRECT, "get network id fail"); return networkId; } @@ -209,7 +209,7 @@ std::string WifiDirectUtils::GetLocalUuid() { char uuid[UUID_BUF_LEN] {}; auto ret = DBinderSoftbusServer::GetInstance().LnnGetLocalStrInfo(STRING_KEY_UUID, uuid, UUID_BUF_LEN); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, "", CONN_WIFI_DIRECT, "get uuid id failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, "", CONN_WIFI_DIRECT, "get uuid id fail"); return uuid; } @@ -218,7 +218,7 @@ int32_t WifiDirectUtils::GetLocalConnSubFeature(uint64_t &feature) uint64_t connSubFeature = 0; auto ret = DBinderSoftbusServer::GetInstance().LnnGetLocalNumU64Info(NUM_KEY_CONN_SUB_FEATURE_CAPA, &connSubFeature); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get connSubFeature failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get connSubFeature fail"); feature = connSubFeature; return SOFTBUS_OK; } @@ -258,7 +258,7 @@ std::vector WifiDirectUtils::GetLocalPtk(const std::string &remoteNetwo ret = LnnGetLocalDefaultPtkByUuidPacked(remoteUuid.c_str(), (char *)ptkBytes, sizeof(ptkBytes)); } - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, result, CONN_WIFI_DIRECT, "get local ptk failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, result, CONN_WIFI_DIRECT, "get local ptk fail"); result.insert(result.end(), ptkBytes, ptkBytes + PTK_128BIT_LEN); return result; } @@ -287,7 +287,7 @@ std::vector WifiDirectUtils::GetRemotePtk(const std::string &remoteNetw ret = LnnGetRemoteDefaultPtkByUuidPacked(remoteUuid.c_str(), (char *)ptkBytes, sizeof(ptkBytes)); } - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, result, CONN_WIFI_DIRECT, "get remote ptk failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, result, CONN_WIFI_DIRECT, "get remote ptk fail"); result.insert(result.end(), ptkBytes, ptkBytes + PTK_128BIT_LEN); return result; } @@ -298,7 +298,7 @@ bool WifiDirectUtils::IsRemoteSupportTlv(const std::string &remoteDeviceId) auto networkId = UuidToNetworkId(remoteDeviceId); auto ret = DBinderSoftbusServer::GetInstance().LnnGetRemoteBoolInfoIgnoreOnline(networkId.c_str(), BOOL_KEY_TLV_NEGOTIATION, &result); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, true, CONN_WIFI_DIRECT, "get tlv feature failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, true, CONN_WIFI_DIRECT, "get tlv feature fail"); return result; } @@ -369,15 +369,15 @@ std::vector WifiDirectUtils::GetInterfaceMacAddr(const std::string &int std::vector macArray; int ret = strcpy_s(ifr.ifr_name, sizeof(ifr.ifr_name), interface.c_str()); - CONN_CHECK_AND_RETURN_RET_LOGW(ret == EOK, macArray, CONN_WIFI_DIRECT, "copy interface name failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(ret == EOK, macArray, CONN_WIFI_DIRECT, "copy interface name fail"); int32_t fd = socket(AF_INET, SOCK_DGRAM, 0); CONN_CHECK_AND_RETURN_RET_LOGW(fd > 0, macArray, CONN_WIFI_DIRECT, - "open socket failed, fd=%{public}d, errno=%{public}d(%{public}s)", fd, errno, strerror(errno)); + "open socket fail, fd=%{public}d, errno=%{public}d(%{public}s)", fd, errno, strerror(errno)); fdsan_exchange_owner_tag(fd, 0, CONN_WIFI_DIRECT_FD_TAG); ret = ioctl(fd, SIOCGIFHWADDR, &ifr); fdsan_close_with_tag(fd, CONN_WIFI_DIRECT_FD_TAG); CONN_CHECK_AND_RETURN_RET_LOGW(ret == 0, macArray, CONN_WIFI_DIRECT, - "get hw addr failed ret=%{public}d, errno=%{public}d(%{public}s)", ret, errno, strerror(errno)); + "get hw addr fail ret=%{public}d, errno=%{public}d(%{public}s)", ret, errno, strerror(errno)); macArray.insert(macArray.end(), ifr.ifr_hwaddr.sa_data, ifr.ifr_hwaddr.sa_data + MAC_ADDR_ARRAY_SIZE); return macArray; } @@ -387,7 +387,7 @@ std::string WifiDirectUtils::GetInterfaceIpv6Addr(const std::string &name) struct ifaddrs *allAddr = nullptr; auto ret = getifaddrs(&allAddr); CONN_CHECK_AND_RETURN_RET_LOGE(ret == 0, "", CONN_WIFI_DIRECT, - "getifaddrs failed, ret=%{public}d, errno=%{public}d(%{public}s)", ret, errno, strerror(errno)); + "getifaddrs fail, ret=%{public}d, errno=%{public}d(%{public}s)", ret, errno, strerror(errno)); for (struct ifaddrs *ifa = allAddr; ifa != nullptr; ifa = ifa->ifa_next) { if (ifa->ifa_addr == nullptr || ifa->ifa_addr->sa_family != AF_INET6 || ifa->ifa_netmask == nullptr || @@ -409,7 +409,7 @@ std::vector WifiDirectUtils::GetLocalIpv4Infos() std::vector ipv4Infos; struct ifaddrs *ifAddr = nullptr; if (getifaddrs(&ifAddr) == -1) { - CONN_LOGE(CONN_WIFI_DIRECT, "getifaddrs failed, errno=%{public}d(%{public}s)", errno, strerror(errno)); + CONN_LOGE(CONN_WIFI_DIRECT, "getifaddrs fail, errno=%{public}d(%{public}s)", errno, strerror(errno)); return ipv4Infos; } @@ -460,7 +460,7 @@ int32_t WifiDirectUtils::GetInterfaceIpString(const std::string &interface, std: int32_t socketFd = socket(AF_INET, SOCK_DGRAM, 0); CONN_CHECK_AND_RETURN_RET_LOGW(socketFd >= 0, SOFTBUS_CONN_OPEN_SOCKET_FAILED, CONN_WIFI_DIRECT, - "open socket failed, socketFd=%{public}d, errno=%{public}d(%{public}s)", socketFd, errno, strerror(errno)); + "open socket fail, socketFd=%{public}d, errno=%{public}d(%{public}s)", socketFd, errno, strerror(errno)); fdsan_exchange_owner_tag(socketFd, 0, CONN_WIFI_DIRECT_FD_TAG); struct ifreq request { }; @@ -468,7 +468,7 @@ int32_t WifiDirectUtils::GetInterfaceIpString(const std::string &interface, std: int32_t ret = strcpy_s(request.ifr_name, sizeof(request.ifr_name), reinterpret_cast(interface.c_str())); if (ret != EOK) { - CONN_LOGW(CONN_WIFI_DIRECT, "copy interface name failed"); + CONN_LOGW(CONN_WIFI_DIRECT, "copy interface name fail"); fdsan_close_with_tag(socketFd, CONN_WIFI_DIRECT_FD_TAG); return SOFTBUS_CONN_COPY_INTERFACE_NAME_FAILED; } @@ -476,12 +476,12 @@ int32_t WifiDirectUtils::GetInterfaceIpString(const std::string &interface, std: ret = ioctl(socketFd, SIOCGIFADDR, &request); fdsan_close_with_tag(socketFd, CONN_WIFI_DIRECT_FD_TAG); CONN_CHECK_AND_RETURN_RET_LOGW(ret >= 0, SOFTBUS_CONN_GET_IFR_CONF_FAILED, CONN_WIFI_DIRECT, - "get ifr conf failed ret=%{public}d, errno=%{public}d(%{public}s)", ret, errno, strerror(errno)); + "get ifr conf fail ret=%{public}d, errno=%{public}d(%{public}s)", ret, errno, strerror(errno)); auto *sockAddrIn = (struct sockaddr_in *)&request.ifr_addr; char ipString[IP_LEN] = { 0 }; if (!inet_ntop(sockAddrIn->sin_family, &sockAddrIn->sin_addr, ipString, IP_LEN)) { - CONN_LOGW(CONN_WIFI_DIRECT, "inet_ntop failed"); + CONN_LOGW(CONN_WIFI_DIRECT, "inet_ntop fail"); return SOFTBUS_CONN_INET_NTOP_FAILED; } ip = std::string(ipString); @@ -506,7 +506,7 @@ int32_t WifiDirectUtils::IpStringToIntArray(const char *addrString, uint32_t *ad int32_t ret = sscanf_s(addrString, "%u.%u.%u.%u", addrArray, addrArray + 1, addrArray + 2, addrArray + 3); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == IPV4_ADDR_ARRAY_LEN, SOFTBUS_CONN_SCAN_IP_NUMBER_FAILED, CONN_WIFI_DIRECT, "scan ip number failed"); + ret == IPV4_ADDR_ARRAY_LEN, SOFTBUS_CONN_SCAN_IP_NUMBER_FAILED, CONN_WIFI_DIRECT, "scan ip number fail"); return SOFTBUS_OK; } @@ -642,17 +642,17 @@ void WifiDirectUtils::SyncLnnInfoForP2p(WifiDirectApiRole role, const std::strin role, WifiDirectAnonymizeMac(localMac).c_str(), WifiDirectAnonymizeMac(goMac).c_str()); int32_t ret = DBinderSoftbusServer::GetInstance().LnnSetLocalNumInfo(NUM_KEY_P2P_ROLE, role); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "set lnn p2p role failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "set lnn p2p role fail"); } ret = DBinderSoftbusServer::GetInstance().LnnSetLocalStrInfo(STRING_KEY_P2P_MAC, localMac.c_str()); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "set lnn my mac failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "set lnn my mac fail"); } ret = DBinderSoftbusServer::GetInstance().LnnSetLocalStrInfo(STRING_KEY_P2P_GO_MAC, goMac.c_str()); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "set lnn go mac failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "set lnn go mac fail"); } DBinderSoftbusServer::GetInstance().LnnSyncP2pInfo(); @@ -676,7 +676,7 @@ bool WifiDirectUtils::CheckLinkAtDfsChannelConflict(const std::string &remoteDev auto remoteNetworkId = UuidToNetworkId(remoteDeviceId); int32_t osType = OH_OS_TYPE; if (DBinderSoftbusServer::GetInstance().LnnGetOsTypeByNetworkId(remoteNetworkId.c_str(), &osType) != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "get os type failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "get os type fail"); return false; } LinkManager::GetInstance().ForEach([&dfsLinkIsExist, osType, type](InnerLink &link) { @@ -694,7 +694,7 @@ int32_t WifiDirectUtils::GetOsType(const char *networkId) { int32_t osType = OH_OS_TYPE; auto ret = DBinderSoftbusServer::GetInstance().LnnGetOsTypeByNetworkId(networkId, &osType); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get os type failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get os type fail"); CONN_LOGI(CONN_WIFI_DIRECT, "dfx remote os type %{public}d", osType); return osType; } @@ -703,7 +703,7 @@ int32_t WifiDirectUtils::GetDeviceType(const char *networkId) { int32_t deviceTypeId = 0; auto ret = DBinderSoftbusServer::GetInstance().LnnGetRemoteNumInfo(networkId, NUM_KEY_DEV_TYPE_ID, &deviceTypeId); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get remote device type failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get remote device type fail"); CONN_LOGI(CONN_WIFI_DIRECT, "dfx remote device type %{public}d", deviceTypeId); return deviceTypeId; } @@ -712,7 +712,7 @@ int32_t WifiDirectUtils::GetDeviceType() { int32_t deviceTypeId = 0; auto ret = DBinderSoftbusServer::GetInstance().LnnGetLocalNumInfo(NUM_KEY_DEV_TYPE_ID, &deviceTypeId); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get local device type failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get local device type fail"); CONN_LOGI(CONN_WIFI_DIRECT, "dfx local device type %{public}d", deviceTypeId); return deviceTypeId; } @@ -723,7 +723,7 @@ int32_t WifiDirectUtils::GetRemoteConnSubFeature(const std::string &remoteNetwor auto ret = DBinderSoftbusServer::GetInstance().LnnGetRemoteNumU64Info(remoteNetworkId.c_str(), NUM_KEY_CONN_SUB_FEATURE_CAPA, &connSubFeature); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, - "remoteNetworkId=%{public}s, get connSubFeature failed", WifiDirectAnonymizeDeviceId(remoteNetworkId).c_str()); + "remoteNetworkId=%{public}s, get connSubFeature fail", WifiDirectAnonymizeDeviceId(remoteNetworkId).c_str()); feature = connSubFeature; return SOFTBUS_OK; } @@ -737,7 +737,7 @@ std::string WifiDirectUtils::GetRemoteOsVersion(const char *remoteNetworkId) auto ret = DBinderSoftbusServer::GetInstance().LnnGetRemoteNodeInfoById(remoteNetworkId, CATEGORY_NETWORK_ID, nodeInfo); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "get remote os version failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "get remote os version fail"); SoftBusFree(nodeInfo); return ""; } @@ -754,7 +754,7 @@ int32_t WifiDirectUtils::GetRemoteScreenStatus(const char *remoteNetworkId) CONN_CHECK_AND_RETURN_RET_LOGE(nodeInfo != nullptr, SOFTBUS_MALLOC_ERR, CONN_WIFI_DIRECT, "nodeInfo malloc err"); auto ret = DBinderSoftbusServer::GetInstance().LnnGetRemoteNodeInfoByKey(remoteNetworkId, nodeInfo); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "get screen status failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "get screen status fail"); SoftBusFree(nodeInfo); return ret; } @@ -792,7 +792,7 @@ std::string WifiDirectUtils::RemoteDeviceIdToMac(const std::string &remoteDevice STRING_KEY_WIFIDIRECT_ADDR, remoteMac, MAC_ADDR_STR_LEN); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, "", CONN_WIFI_DIRECT, - "get wifi direct addr failed, ret=%{public}d", ret); + "get wifi direct addr fail, ret=%{public}d", ret); CONN_LOGI(CONN_WIFI_DIRECT, "remoteMac=%{public}s", WifiDirectAnonymizeMac(remoteMac).c_str()); return remoteMac; } @@ -803,7 +803,7 @@ std::string WifiDirectUtils::RemoteMacToDeviceId(const std::string &remoteMac) NodeBasicInfo *basicInfo = nullptr; auto ret = DBinderSoftbusServer::GetInstance().LnnGetAllOnlineNodeInfo(&basicInfo, &num); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, "", CONN_WIFI_DIRECT, - "get online node info failed, ret=%{public}d", ret); + "get online node info fail, ret=%{public}d", ret); for (int32_t i = 0; i < num; i++) { char wifiDirectAddr[MAC_ADDR_STR_LEN] {}; @@ -811,7 +811,7 @@ std::string WifiDirectUtils::RemoteMacToDeviceId(const std::string &remoteMac) STRING_KEY_WIFIDIRECT_ADDR, wifiDirectAddr, MAC_ADDR_STR_LEN); if (ret != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "get wifi direct addr failed, remoteNetworkId=%{public}s, ret=%{public}d", + CONN_LOGE(CONN_WIFI_DIRECT, "get wifi direct addr fail, remoteNetworkId=%{public}s, ret=%{public}d", WifiDirectAnonymizeDeviceId(basicInfo[i].networkId).c_str(), ret); continue; } @@ -831,7 +831,7 @@ int WifiDirectUtils::GetLocalScreenStatus() auto ret = DBinderSoftbusServer::GetInstance().LnnGetLocalBoolInfo( BOOL_KEY_SCREEN_STATUS, &result, NODE_SCREEN_STATUS_LEN); CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, - "get screen state failed, ret=%{public}d", ret); + "get screen state fail, ret=%{public}d", ret); return result ? WIFI_DIRECT_SCREEN_ON : WIFI_DIRECT_SCREEN_OFF; } } // namespace OHOS::SoftBus \ No newline at end of file diff --git a/core/connection/wifi_direct_cpp/wifi_direct_ip_manager.cpp b/core/connection/wifi_direct_cpp/wifi_direct_ip_manager.cpp index 821df90c2d..cb90676bad 100644 --- a/core/connection/wifi_direct_cpp/wifi_direct_ip_manager.cpp +++ b/core/connection/wifi_direct_cpp/wifi_direct_ip_manager.cpp @@ -62,16 +62,16 @@ std::string WifiDirectIpManager::ApplyIpv6(const std::string &mac) char ip[IP_STR_MAX_LEN] {}; auto ret = sprintf_s(ip, sizeof(ip), "fe80::%02x%02x:%02x%02x:%02x%02x:%02x%02x%%chba0", array[0], array[1], array[2], array[3], array[4], array[5], array[6], array[7]); - CONN_CHECK_AND_RETURN_RET_LOGE(ret > 0, "", CONN_WIFI_DIRECT, "format failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret > 0, "", CONN_WIFI_DIRECT, "format fail"); SoftBusSockAddrIn6 addrIn6 {}; if (Ipv6AddrToAddrIn(&addrIn6, ip, 0) != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "to addrIn6 failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "to addrIn6 fail"); return ""; } char result[IP_STR_MAX_LEN] {}; if (Ipv6AddrInToAddr(&addrIn6, result, sizeof(result)) != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "to ip string failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "to ip string fail"); return ""; } CONN_LOGI(CONN_WIFI_DIRECT, "scopeId=%{public}u", addrIn6.sin6ScopeId); @@ -87,16 +87,16 @@ int32_t WifiDirectIpManager::ApplyIpv4( { std::string subNet = ApplySubNet(localArray, remoteArray); CONN_CHECK_AND_RETURN_RET_LOGE( - !subNet.empty(), SOFTBUS_CONN_APPLY_SUBNET_FAIL, CONN_WIFI_DIRECT, "apply subnet failed"); + !subNet.empty(), SOFTBUS_CONN_APPLY_SUBNET_FAIL, CONN_WIFI_DIRECT, "apply subnet fail"); std::string sourceIp = subNet + HML_IP_SOURCE_SUFFIX; std::string sinkIp = subNet + HML_IP_SINK_SUFFIX; int32_t ret = source.FromIpString(sourceIp); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "source ip to ipv4 failed"); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "source ip to ipv4 fail"); ret = sink.FromIpString(sinkIp); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "sink ip to ipv4 failed"); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "sink ip to ipv4 fail"); return SOFTBUS_OK; } @@ -126,7 +126,7 @@ int32_t WifiDirectIpManager::ConfigIpv6(const std::string &interface, const std: { auto ret = OHOS::NetManagerStandard::NetConnClient::GetInstance().AddInterfaceAddress(interface, ip, IPV6_PREFIX); CONN_CHECK_AND_RETURN_RET_LOGE( - ret == 0, SOFTBUS_CONN_CONFIG_IPV6_CONFIG_IP_FAILED, CONN_WIFI_DIRECT, "add ip failed"); + ret == 0, SOFTBUS_CONN_CONFIG_IPV6_CONFIG_IP_FAILED, CONN_WIFI_DIRECT, "add ip fail"); return SOFTBUS_OK; } @@ -135,19 +135,19 @@ int32_t WifiDirectIpManager::ConfigIpv4( { std::string localIpStr = local.ToIpString(); CONN_CHECK_AND_RETURN_RET_LOGE( - !localIpStr.empty(), SOFTBUS_CONN_CONVERT_LOCAL_IP_FAIL, CONN_WIFI_DIRECT, "convert local ip failed"); + !localIpStr.empty(), SOFTBUS_CONN_CONVERT_LOCAL_IP_FAIL, CONN_WIFI_DIRECT, "convert local ip fail"); std::string remoteIpStr = remote.ToIpString(); CONN_CHECK_AND_RETURN_RET_LOGE( - !remoteIpStr.empty(), SOFTBUS_CONN_CONVERT_REMOTE_IP_FAIL, CONN_WIFI_DIRECT, "convert remote ip failed"); + !remoteIpStr.empty(), SOFTBUS_CONN_CONVERT_REMOTE_IP_FAIL, CONN_WIFI_DIRECT, "convert remote ip fail"); CONN_LOGI(CONN_WIFI_DIRECT, "localIp=%{public}s, remoteIp=%{public}s, remoteMac=%{public}s", WifiDirectAnonymizeIp(localIpStr).c_str(), WifiDirectAnonymizeIp(remoteIpStr).c_str(), WifiDirectAnonymizeMac(remoteMac).c_str()); int32_t ret = AddInterfaceAddress(interface, localIpStr, local.GetPrefixLength()); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "add ip failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "add ip fail"); ret = AddStaticArp(interface, remoteIpStr, remoteMac); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "add static arp failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "add static arp fail"); return SOFTBUS_OK; } @@ -155,20 +155,20 @@ void WifiDirectIpManager::ReleaseIpv4( const std::string &interface, const Ipv4Info &local, const Ipv4Info &remote, const std::string &remoteMac) { std::string localIpStr = local.ToIpString(); - CONN_CHECK_AND_RETURN_LOGE(!localIpStr.empty(), CONN_WIFI_DIRECT, "convert local ip failed"); + CONN_CHECK_AND_RETURN_LOGE(!localIpStr.empty(), CONN_WIFI_DIRECT, "convert local ip fail"); std::string remoteIpStr = remote.ToIpString(); - CONN_CHECK_AND_RETURN_LOGE(!remoteIpStr.empty(), CONN_WIFI_DIRECT, "convert remote ip failed"); + CONN_CHECK_AND_RETURN_LOGE(!remoteIpStr.empty(), CONN_WIFI_DIRECT, "convert remote ip fail"); CONN_LOGI(CONN_WIFI_DIRECT, "localIp=%{public}s, remoteIp=%{public}s, remoteMac=%{public}s", WifiDirectAnonymizeIp(localIpStr).c_str(), WifiDirectAnonymizeIp(remoteIpStr).c_str(), WifiDirectAnonymizeMac(remoteMac).c_str()); if (DeleteInterfaceAddress(interface, localIpStr, local.GetPrefixLength()) != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "delete ip failed. ip=%{public}s", WifiDirectAnonymizeIp(localIpStr).c_str()); + CONN_LOGE(CONN_WIFI_DIRECT, "delete ip fail. ip=%{public}s", WifiDirectAnonymizeIp(localIpStr).c_str()); } if (DeleteStaticArp(interface, remoteIpStr, remoteMac) != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "delete arp failed. remoteIp=%{public}s, remoteMac=%{public}s", + CONN_LOGE(CONN_WIFI_DIRECT, "delete arp fail. remoteIp=%{public}s, remoteMac=%{public}s", WifiDirectAnonymizeIp(remoteIpStr).c_str(), WifiDirectAnonymizeMac(remoteMac).c_str()); } } @@ -179,7 +179,7 @@ void WifiDirectIpManager::ClearAllIpv4() for (const auto &ipv4 : localIpv4Array) { std::string ipStr = ipv4.ToIpString(); if (DeleteInterfaceAddress(IF_NAME_HML, ipStr, ipv4.GetPrefixLength()) != SOFTBUS_OK) { - CONN_LOGE(CONN_WIFI_DIRECT, "delete ip failed. ip=%{public}s", WifiDirectAnonymizeIp(ipStr).c_str()); + CONN_LOGE(CONN_WIFI_DIRECT, "delete ip fail. ip=%{public}s", WifiDirectAnonymizeIp(ipStr).c_str()); } } } @@ -189,18 +189,18 @@ int32_t WifiDirectIpManager::AddInterfaceAddress( { std::string gateWay; int32_t ret = GetNetworkGateWay(ipString, gateWay); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get gate way failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get gate way fail"); std::string destination; ret = GetNetworkDestination(ipString, destination); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get destination failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get destination fail"); ret = OHOS::NetManagerStandard::NetConnClient::GetInstance().AddInterfaceAddress(interface, ipString, prefixLength); CONN_CHECK_AND_RETURN_RET_LOGE( - ret == NetManagerStandard::NETMANAGER_SUCCESS, ret, CONN_WIFI_DIRECT, "add ip failed ret=%{public}d", ret); + ret == NetManagerStandard::NETMANAGER_SUCCESS, ret, CONN_WIFI_DIRECT, "add ip fail ret=%{public}d", ret); ret = OHOS::NetManagerStandard::NetConnClient::GetInstance().AddNetworkRoute( LOCAL_NETWORK_ID, interface, destination, gateWay); CONN_CHECK_AND_RETURN_RET_LOGE( - ret == NetManagerStandard::NETMANAGER_SUCCESS, ret, CONN_WIFI_DIRECT, "add route failed ret=%{public}d", ret); + ret == NetManagerStandard::NETMANAGER_SUCCESS, ret, CONN_WIFI_DIRECT, "add route fail ret=%{public}d", ret); return SOFTBUS_OK; } @@ -209,18 +209,18 @@ int32_t WifiDirectIpManager::DeleteInterfaceAddress( { std::string gateWay; int32_t ret = GetNetworkGateWay(ipString, gateWay); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == 0, ret, CONN_WIFI_DIRECT, "get gate way failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == 0, ret, CONN_WIFI_DIRECT, "get gate way fail"); std::string destination; ret = GetNetworkDestination(ipString, destination); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == 0, ret, CONN_WIFI_DIRECT, "get destination failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == 0, ret, CONN_WIFI_DIRECT, "get destination fail"); ret = OHOS::NetManagerStandard::NetConnClient::GetInstance().RemoveNetworkRoute( LOCAL_NETWORK_ID, interface, destination, gateWay); if (ret != NetManagerStandard::NETMANAGER_SUCCESS) { - CONN_LOGE(CONN_WIFI_DIRECT, "remove route failed ret=%{public}d", ret); + CONN_LOGE(CONN_WIFI_DIRECT, "remove route fail ret=%{public}d", ret); } ret = OHOS::NetManagerStandard::NetConnClient::GetInstance().DelInterfaceAddress(interface, ipString, prefixLength); if (ret != NetManagerStandard::NETMANAGER_SUCCESS) { - CONN_LOGE(CONN_WIFI_DIRECT, "delete ip failed ret=%{public}d", ret); + CONN_LOGE(CONN_WIFI_DIRECT, "delete ip fail ret=%{public}d", ret); } return SOFTBUS_OK; } diff --git a/core/connection/wifi_direct_cpp/wifi_direct_manager.cpp b/core/connection/wifi_direct_cpp/wifi_direct_manager.cpp index c81b9ca279..f31f428dad 100644 --- a/core/connection/wifi_direct_cpp/wifi_direct_manager.cpp +++ b/core/connection/wifi_direct_cpp/wifi_direct_manager.cpp @@ -131,7 +131,7 @@ static int32_t ConnectDevice(struct WifiDirectConnectInfo *info, struct WifiDire int32_t ret = OHOS::SoftBus::WifiDirectRoleOption::GetInstance().GetExpectedRole( info->remoteNetworkId, info->connectType, info->expectApiRole, info->isStrict); - CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get expected role failed"); + CONN_CHECK_AND_RETURN_RET_LOGW(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "get expected role fail"); ret = OHOS::SoftBus::WifiDirectSchedulerFactory::GetInstance().GetScheduler().ConnectDevice(*info, *callback); extra.errcode = ret; @@ -563,7 +563,7 @@ static bool IsNegotiateChannelNeeded(const char *remoteNetworkId, enum WifiDirec CONN_LOGD(CONN_WIFI_DIRECT, "enter"); CONN_CHECK_AND_RETURN_RET_LOGE(remoteNetworkId != nullptr, true, CONN_WIFI_DIRECT, "remote networkid is null"); auto remoteUuid = OHOS::SoftBus::WifiDirectUtils::NetworkIdToUuid(remoteNetworkId); - CONN_CHECK_AND_RETURN_RET_LOGE(!remoteUuid.empty(), true, CONN_WIFI_DIRECT, "get remote uuid failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(!remoteUuid.empty(), true, CONN_WIFI_DIRECT, "get remote uuid fail"); auto link = OHOS::SoftBus::LinkManager::GetInstance().GetReuseLink(linkType, remoteUuid); if (link == nullptr) { diff --git a/core/connection/wifi_direct_cpp/wifi_direct_role_option.cpp b/core/connection/wifi_direct_cpp/wifi_direct_role_option.cpp index 14b1852d95..1ce9f73b98 100644 --- a/core/connection/wifi_direct_cpp/wifi_direct_role_option.cpp +++ b/core/connection/wifi_direct_cpp/wifi_direct_role_option.cpp @@ -68,7 +68,7 @@ WifiDirectRole WifiDirectRoleOption::GetExpectedP2pRole(const std::string &netWo int32_t localDevTypeId = 0; int32_t ret = DBinderSoftbusServer::GetInstance().LnnGetLocalNumInfo(NUM_KEY_DEV_TYPE_ID, &localDevTypeId); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, WIFI_DIRECT_ROLE_AUTO, CONN_WIFI_DIRECT, "get local dev type id failed"); + ret == SOFTBUS_OK, WIFI_DIRECT_ROLE_AUTO, CONN_WIFI_DIRECT, "get local dev type id fail"); CONN_LOGD(CONN_WIFI_DIRECT, "localDevTypeId=0x%{public}03X", localDevTypeId); if (IsPowerAlwaysOn(localDevTypeId)) { @@ -80,7 +80,7 @@ WifiDirectRole WifiDirectRoleOption::GetExpectedP2pRole(const std::string &netWo ret = DBinderSoftbusServer::GetInstance().LnnGetRemoteNumInfo(netWorkId.data(), NUM_KEY_DEV_TYPE_ID, &remoteDevTypeId); CONN_CHECK_AND_RETURN_RET_LOGW( - ret == SOFTBUS_OK, WIFI_DIRECT_ROLE_AUTO, CONN_WIFI_DIRECT, "get remote dev type id failed"); + ret == SOFTBUS_OK, WIFI_DIRECT_ROLE_AUTO, CONN_WIFI_DIRECT, "get remote dev type id fail"); CONN_LOGD(CONN_WIFI_DIRECT, "remoteDevTypeId=0x%{public}03X", remoteDevTypeId); if (IsPowerAlwaysOn(remoteDevTypeId)) { diff --git a/core/connection/wifi_direct_cpp/wifi_direct_scheduler.cpp b/core/connection/wifi_direct_cpp/wifi_direct_scheduler.cpp index 3865a5cd77..6ec2b63020 100644 --- a/core/connection/wifi_direct_cpp/wifi_direct_scheduler.cpp +++ b/core/connection/wifi_direct_cpp/wifi_direct_scheduler.cpp @@ -40,7 +40,7 @@ int WifiDirectScheduler::ConnectDevice(const WifiDirectConnectInfo &info, const std::shared_ptr executor; std::lock_guard executorLock(executorLock_); auto ret = ScheduleActiveCommand(command, executor); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "schedule active command failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "schedule active command fail"); if (executor != nullptr) { CONN_LOGI(CONN_WIFI_DIRECT, "commandId=%{public}u", command->GetId()); executor->SendEvent(command); @@ -82,7 +82,7 @@ int WifiDirectScheduler::DisconnectDevice(WifiDirectDisconnectInfo &info, WifiDi std::shared_ptr executor; std::lock_guard executorLock(executorLock_); auto ret = ScheduleActiveCommand(command, executor); - CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "schedule active command failed"); + CONN_CHECK_AND_RETURN_RET_LOGE(ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "schedule active command fail"); if (executor != nullptr) { CONN_LOGI(CONN_WIFI_DIRECT, "commandId=%{public}u", command->GetId()); executor->SendEvent(command); @@ -103,7 +103,7 @@ int WifiDirectScheduler::ForceDisconnectDevice( std::lock_guard executorLock(executorLock_); auto ret = ScheduleActiveCommand(command, executor); CONN_CHECK_AND_RETURN_RET_LOGE( - ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "schedule active command failed, ret=%{public}d", ret); + ret == SOFTBUS_OK, ret, CONN_WIFI_DIRECT, "schedule active command fail, ret=%{public}d", ret); if (executor != nullptr) { CONN_LOGI(CONN_WIFI_DIRECT, "commandId=%{public}u", command->GetId()); executor->SendEvent(command); @@ -175,7 +175,7 @@ int WifiDirectScheduler::ScheduleActiveCommand(const std::shared_ptrGetProcessor(); if (processor == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "get processor failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "get processor fail"); return SOFTBUS_CONN_GET_PROCESSOR_FAILED; } CONN_LOGI(CONN_WIFI_DIRECT, "create executor=%{public}s", WifiDirectAnonymizeDeviceId(remoteDeviceId).c_str()); diff --git a/core/connection/wifi_direct_cpp/wifi_direct_scheduler.h b/core/connection/wifi_direct_cpp/wifi_direct_scheduler.h index 73bb5c7d81..189bbeccd0 100644 --- a/core/connection/wifi_direct_cpp/wifi_direct_scheduler.h +++ b/core/connection/wifi_direct_cpp/wifi_direct_scheduler.h @@ -75,7 +75,7 @@ public: auto processor = command.GetProcessor(); if (processor == nullptr) { - CONN_LOGE(CONN_WIFI_DIRECT, "get processor failed"); + CONN_LOGE(CONN_WIFI_DIRECT, "get processor fail"); return; } executor = WifiDirectExecutorFactory::GetInstance().NewExecutor(remoteDeviceId, *this, processor, false); -- Gitee