1 Star 0 Fork 11

s_c_c/distributedhardware_device_manager

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0007-add-some-logs.patch 31.46 KB
一键复制 编辑 原始数据 按行查看 历史
s_c_c 提交于 2024-09-02 16:19 . add some logs
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
From cb2558b5e8fe8aefebdc4126a501ee1e546499f7 Mon Sep 17 00:00:00 2001
From: s_c_c <[email protected]>
Date: Mon, 2 Sep 2024 16:19:16 +0800
Subject: [PATCH] add some logs
---
.../ipc/standard/ipc_client_server_proxy.cpp | 1 +
.../src/ipc/standard/ipc_cmd_parser.cpp | 35 +++++++++++++++----
.../src/ipc/standard/ipc_cmd_parser.cpp | 28 ++++++++++++---
.../ipc/standard/ipc_server_client_proxy.cpp | 1 +
.../src/ipc/standard/ipc_server_listener.cpp | 2 ++
.../src/ipc/standard/ipc_server_stub.cpp | 2 ++
.../service/src/softbus/softbus_listener.cpp | 7 +++-
7 files changed, 64 insertions(+), 12 deletions(-)
diff --git a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_server_proxy.cpp b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_server_proxy.cpp
index 0433754..4a183cd 100644
--- a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_server_proxy.cpp
+++ b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_server_proxy.cpp
@@ -36,6 +36,7 @@ int32_t IpcClientServerProxy::SendCmd(int32_t cmdCode, std::shared_ptr<IpcReq> r
MessageParcel data;
MessageParcel reply;
MessageOption option;
+ LOGE("[IpcClientServerProxy::SendCmd] cmdCode = %d", cmdCode);
if (!data.WriteInterfaceToken(GetDescriptor())) {
LOGE("WriteInterfaceToken fail!");
return ERR_DM_IPC_WRITE_FAILED;
diff --git a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp
index f51c145..517491d 100644
--- a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp
+++ b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp
@@ -50,6 +50,7 @@ ON_IPC_SET_REQUEST(REGISTER_DEVICE_MANAGER_LISTENER, std::shared_ptr<IpcReq> pBa
std::shared_ptr<IpcRegisterListenerReq> pReq = std::static_pointer_cast<IpcRegisterListenerReq>(pBaseReq);
std::string pkgName = pReq->GetPkgName();
sptr<IRemoteObject> listener = pReq->GetListener();
+ LOGE("[ON_IPC_SET_REQUEST(REGISTER_DEVICE_MANAGER_LISTENER)] pkgName = %s", pkgName.c_str());
if (!data.WriteString(pkgName)) {
LOGE("write pkgName failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -67,6 +68,7 @@ ON_IPC_READ_RESPONSE(REGISTER_DEVICE_MANAGER_LISTENER, MessageParcel &reply, std
LOGE("pBaseRsp is null");
return ERR_DM_FAILED;
}
+ LOGE("[ON_IPC_READ_RESPONSE(REGISTER_DEVICE_MANAGER_LISTENER)] reply.ReadInt32() = %d", reply.ReadInt32());
pBaseRsp->SetErrCode(reply.ReadInt32());
return DM_OK;
}
@@ -92,6 +94,7 @@ ON_IPC_SET_REQUEST(GET_TRUST_DEVICE_LIST, std::shared_ptr<IpcReq> pBaseReq, Mess
std::shared_ptr<IpcGetTrustDeviceReq> pReq = std::static_pointer_cast<IpcGetTrustDeviceReq>(pBaseReq);
std::string pkgName = pReq->GetPkgName();
std::string extra = pReq->GetExtra();
+ LOGE("[ON_IPC_SET_REQUEST(GET_TRUST_DEVICE_LIST)] pkgName = %s", pkgName.c_str());
if (!data.WriteString(pkgName)) {
LOGE("write pkg failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -107,6 +110,7 @@ ON_IPC_READ_RESPONSE(GET_TRUST_DEVICE_LIST, MessageParcel &reply, std::shared_pt
{
std::shared_ptr<IpcGetTrustDeviceRsp> pRsp = std::static_pointer_cast<IpcGetTrustDeviceRsp>(pBaseRsp);
int32_t deviceNum = reply.ReadInt32();
+ LOGE("[ON_IPC_READ_RESPONSE(GET_TRUST_DEVICE_LIST)] deviceNum = %d", deviceNum);
if (deviceNum > 0) {
std::vector<DmDeviceInfo> deviceInfoVec;
DmDeviceInfo *pDmDeviceinfo = nullptr;
@@ -122,6 +126,7 @@ ON_IPC_READ_RESPONSE(GET_TRUST_DEVICE_LIST, MessageParcel &reply, std::shared_pt
pRsp->SetErrCode(ERR_DM_IPC_WRITE_FAILED);
return ERR_DM_IPC_WRITE_FAILED;
}
+ LOGE("[ON_IPC_READ_RESPONSE(GET_TRUST_DEVICE_LIST)] deviceId = %s", pDmDeviceinfo->deviceId);
deviceInfoVec.emplace_back(*pDmDeviceinfo);
}
pRsp->SetDeviceVec(deviceInfoVec);
@@ -134,6 +139,7 @@ ON_IPC_SET_REQUEST(GET_LOCAL_DEVICE_INFO, std::shared_ptr<IpcReq> pBaseReq, Mess
{
std::shared_ptr<IpcReq> pReq = std::static_pointer_cast<IpcReq>(pBaseReq);
std::string pkgName = pReq->GetPkgName();
+ LOGE("[ON_IPC_SET_REQUEST(GET_LOCAL_DEVICE_INFO)] pkgName = %s", pkgName.c_str());
if (!data.WriteString(pkgName)) {
return ERR_DM_IPC_WRITE_FAILED;
}
@@ -144,6 +150,7 @@ ON_IPC_READ_RESPONSE(GET_LOCAL_DEVICE_INFO, MessageParcel &reply, std::shared_pt
{
std::shared_ptr<IpcGetLocalDeviceInfoRsp> pRsp = std::static_pointer_cast<IpcGetLocalDeviceInfoRsp>(pBaseRsp);
DmDeviceInfo *localDeviceInfo = (DmDeviceInfo *)reply.ReadRawData(sizeof(DmDeviceInfo));
+ LOGE("[ON_IPC_READ_RESPONSE(GET_LOCAL_DEVICE_INFO)] localDeviceInfo = %p", localDeviceInfo);
if (localDeviceInfo != nullptr) {
pRsp->SetLocalDeviceInfo(*localDeviceInfo);
}
@@ -156,6 +163,7 @@ ON_IPC_SET_REQUEST(GET_UDID_BY_NETWORK, std::shared_ptr<IpcReq> pBaseReq, Messag
std::shared_ptr<IpcGetInfoByNetWorkReq> pReq = std::static_pointer_cast<IpcGetInfoByNetWorkReq>(pBaseReq);
std::string pkgName = pReq->GetPkgName();
std::string netWorkId = pReq->GetNetWorkId();
+ LOGE("[ON_IPC_SET_REQUEST(GET_UDID_BY_NETWORK)] pkgName = %s, netWorkId=%s", pkgName.c_str(), netWorkId.c_str());
if (!data.WriteString(pkgName)) {
return ERR_DM_IPC_WRITE_FAILED;
}
@@ -170,6 +178,7 @@ ON_IPC_READ_RESPONSE(GET_UDID_BY_NETWORK, MessageParcel &reply, std::shared_ptr<
std::shared_ptr<IpcGetInfoByNetWorkRsp> pRsp = std::static_pointer_cast<IpcGetInfoByNetWorkRsp>(pBaseRsp);
pRsp->SetErrCode(reply.ReadInt32());
pRsp->SetUdid(reply.ReadString());
+ LOGE("[ON_IPC_READ_RESPONSE(GET_UDID_BY_NETWORK)] GetUdid() = %s", pRsp->GetUdid().c_str());
return DM_OK;
}
@@ -178,6 +187,7 @@ ON_IPC_SET_REQUEST(GET_UUID_BY_NETWORK, std::shared_ptr<IpcReq> pBaseReq, Messag
std::shared_ptr<IpcGetInfoByNetWorkReq> pReq = std::static_pointer_cast<IpcGetInfoByNetWorkReq>(pBaseReq);
std::string pkgName = pReq->GetPkgName();
std::string netWorkId = pReq->GetNetWorkId();
+ LOGE("[ON_IPC_SET_REQUEST(GET_UUID_BY_NETWORK)] pkgName = %s, netWorkId=%s", pkgName.c_str(), netWorkId.c_str());
if (!data.WriteString(pkgName)) {
return ERR_DM_IPC_WRITE_FAILED;
}
@@ -192,6 +202,7 @@ ON_IPC_READ_RESPONSE(GET_UUID_BY_NETWORK, MessageParcel &reply, std::shared_ptr<
std::shared_ptr<IpcGetInfoByNetWorkRsp> pRsp = std::static_pointer_cast<IpcGetInfoByNetWorkRsp>(pBaseRsp);
pRsp->SetErrCode(reply.ReadInt32());
pRsp->SetUuid(reply.ReadString());
+ LOGE("[ON_IPC_READ_RESPONSE(GET_UUID_BY_NETWORK)] GetUuid() = %s", pRsp->GetUuid().c_str());
return DM_OK;
}
@@ -201,6 +212,7 @@ ON_IPC_SET_REQUEST(START_DEVICE_DISCOVER, std::shared_ptr<IpcReq> pBaseReq, Mess
std::string pkgName = pReq->GetPkgName();
std::string extra = pReq->GetExtra();
const DmSubscribeInfo dmSubscribeInfo = pReq->GetSubscribeInfo();
+ LOGE("[ON_IPC_SET_REQUEST(START_DEVICE_DISCOVER)] pkgName = %s", pkgName.c_str());
if (!data.WriteString(pkgName)) {
LOGE("write pkgName failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -253,6 +265,7 @@ ON_IPC_SET_REQUEST(PUBLISH_DEVICE_DISCOVER, std::shared_ptr<IpcReq> pBaseReq, Me
std::shared_ptr<IpcPublishReq> pReq = std::static_pointer_cast<IpcPublishReq>(pBaseReq);
std::string pkgName = pReq->GetPkgName();
const DmPublishInfo dmPublishInfo = pReq->GetPublishInfo();
+ LOGE("[ON_IPC_SET_REQUEST(PUBLISH_DEVICE_DISCOVER)] pkgName = %s", pkgName.c_str());
if (!data.WriteString(pkgName)) {
LOGE("write pkgName failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -267,6 +280,7 @@ ON_IPC_SET_REQUEST(PUBLISH_DEVICE_DISCOVER, std::shared_ptr<IpcReq> pBaseReq, Me
ON_IPC_READ_RESPONSE(PUBLISH_DEVICE_DISCOVER, MessageParcel &reply, std::shared_ptr<IpcRsp> pBaseRsp)
{
pBaseRsp->SetErrCode(reply.ReadInt32());
+ LOGE("[ON_IPC_READ_RESPONSE(PUBLISH_DEVICE_DISCOVER)] reply.ReadInt32() = %d", reply.ReadInt32());
return DM_OK;
}
@@ -304,7 +318,7 @@ ON_IPC_SET_REQUEST(AUTHENTICATE_DEVICE, std::shared_ptr<IpcReq> pBaseReq, Messag
int32_t authType = pReq->GetAuthType();
DmDeviceInfo deviceInfo = pReq->GetDeviceInfo();
std::string deviceId = deviceInfo.deviceId;
-
+ LOGE("[ON_IPC_SET_REQUEST(AUTHENTICATE_DEVICE)] pkgName = %s", pkgName.c_str());
if (!data.WriteString(pkgName)) {
LOGE("write pkgName failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -361,6 +375,7 @@ ON_IPC_SET_REQUEST(VERIFY_AUTHENTICATION, std::shared_ptr<IpcReq> pBaseReq, Mess
{
std::shared_ptr<IpcVerifyAuthenticateReq> pReq = std::static_pointer_cast<IpcVerifyAuthenticateReq>(pBaseReq);
std::string authPara = pReq->GetAuthPara();
+ LOGE("[ON_IPC_SET_REQUEST(VERIFY_AUTHENTICATION)] authPara = %s", authPara.c_str());
if (!data.WriteString(authPara)) {
return ERR_DM_IPC_WRITE_FAILED;
}
@@ -406,7 +421,7 @@ ON_IPC_SET_REQUEST(SERVER_USER_AUTH_OPERATION, std::shared_ptr<IpcReq> pBaseReq,
std::string pkgName = pReq->GetPkgName();
int32_t action = pReq->GetOperation();
std::string params = pReq->GetParams();
-
+ LOGE("[ON_IPC_SET_REQUEST(SERVER_USER_AUTH_OPERATION)] pkgName = %s", pkgName.c_str());
if (!data.WriteString(pkgName)) {
LOGE("write pkgName failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -435,7 +450,7 @@ ON_IPC_SET_REQUEST(REGISTER_DEV_STATE_CALLBACK, std::shared_ptr<IpcReq> pBaseReq
std::static_pointer_cast<IpcRegisterDevStateCallbackReq>(pBaseReq);
std::string pkgName = pReq->GetPkgName();
std::string extra = pReq->GetExtra();
-
+ LOGE("[ON_IPC_SET_REQUEST(REGISTER_DEV_STATE_CALLBACK)] pkgName = %s", pkgName.c_str());
if (!data.WriteString(pkgName)) {
LOGE("write pkgName failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -483,6 +498,7 @@ ON_IPC_CMD(SERVER_DEVICE_STATE_NOTIFY, MessageParcel &data, MessageParcel &reply
{
std::string pkgName = data.ReadString();
DmDeviceState deviceState = static_cast<DmDeviceState>(data.ReadInt32());
+ LOGE("[ON_IPC_CMD(SERVER_DEVICE_STATE_NOTIFY)] pkgName=%s, deviceState = %d", pkgName.c_str(), (int)deviceState);
DmDeviceInfo dmDeviceInfo;
size_t deviceSize = sizeof(DmDeviceInfo);
void *deviceInfo = (void *)data.ReadRawData(deviceSize);
@@ -515,6 +531,7 @@ ON_IPC_CMD(SERVER_DEVICE_FOUND, MessageParcel &data, MessageParcel &reply)
{
std::string pkgName = data.ReadString();
int16_t subscribeId = data.ReadInt16();
+ LOGE("[ON_IPC_CMD(SERVER_DEVICE_FOUND)] pkgName=%s, subscribeId = %d", pkgName.c_str(), subscribeId);
DmDeviceInfo dmDeviceInfo;
size_t deviceSize = sizeof(DmDeviceInfo);
void *deviceInfo = (void *)data.ReadRawData(deviceSize);
@@ -532,7 +549,7 @@ ON_IPC_CMD(SERVER_DISCOVER_FINISH, MessageParcel &data, MessageParcel &reply)
std::string pkgName = data.ReadString();
int16_t subscribeId = data.ReadInt16();
int32_t failedReason = data.ReadInt32();
-
+ LOGE("[ON_IPC_CMD(SERVER_DISCOVER_FINISH)] pkgName=%s, subscribeId = %d", pkgName.c_str(), subscribeId);
if (failedReason == DM_OK) {
DeviceManagerNotify::GetInstance().OnDiscoverySuccess(pkgName, subscribeId);
} else {
@@ -547,7 +564,7 @@ ON_IPC_CMD(SERVER_PUBLISH_FINISH, MessageParcel &data, MessageParcel &reply)
std::string pkgName = data.ReadString();
int32_t publishId = data.ReadInt32();
int32_t publishResult = data.ReadInt32();
-
+ LOGE("[ON_IPC_CMD(SERVER_PUBLISH_FINISH)] pkgName=%s, publishId = %d", pkgName.c_str(), publishId);
DeviceManagerNotify::GetInstance().OnPublishResult(pkgName, publishId, publishResult);
if (!reply.WriteInt32(DM_OK)) {
LOGE("write return failed");
@@ -563,6 +580,7 @@ ON_IPC_CMD(SERVER_AUTH_RESULT, MessageParcel &data, MessageParcel &reply)
std::string token = data.ReadString();
int32_t status = data.ReadInt32();
int32_t reason = data.ReadInt32();
+ LOGE("[ON_IPC_CMD(SERVER_AUTH_RESULT)] pkgName=%s, deviceId = %s, token = %s", pkgName.c_str(), deviceId.c_str(), token.c_str());
DeviceManagerNotify::GetInstance().OnAuthResult(pkgName, deviceId, token, (uint32_t)status, reason);
reply.WriteInt32(DM_OK);
return DM_OK;
@@ -574,6 +592,7 @@ ON_IPC_CMD(SERVER_VERIFY_AUTH_RESULT, MessageParcel &data, MessageParcel &reply)
std::string deviceId = data.ReadString();
int32_t resultCode = data.ReadInt32();
int32_t flag = data.ReadInt32();
+ LOGE("[ON_IPC_CMD(SERVER_VERIFY_AUTH_RESULT)] pkgName=%s, deviceId = %s, resultCode = %d", pkgName.c_str(), deviceId.c_str(), resultCode);
DeviceManagerNotify::GetInstance().OnVerifyAuthResult(pkgName, deviceId, resultCode, flag);
reply.WriteInt32(DM_OK);
return DM_OK;
@@ -583,6 +602,7 @@ ON_IPC_CMD(SERVER_DEVICE_FA_NOTIFY, MessageParcel &data, MessageParcel &reply)
{
std::string packagename = data.ReadString();
std::string paramJson = data.ReadString();
+ LOGE("[ON_IPC_CMD(SERVER_DEVICE_FA_NOTIFY)] packagename=%s, paramJson = %s", packagename.c_str(), paramJson.c_str());
DeviceManagerNotify::GetInstance().OnUiCall(packagename, paramJson);
if (!reply.WriteInt32(DM_OK)) {
LOGE("write return failed");
@@ -596,7 +616,7 @@ ON_IPC_SET_REQUEST(REQUEST_CREDENTIAL, std::shared_ptr<IpcReq> pBaseReq, Message
std::shared_ptr<IpcSetCredentialReq> pReq = std::static_pointer_cast<IpcSetCredentialReq>(pBaseReq);
std::string pkgName = pReq->GetPkgName();
std::string requestJsonStr = pReq->GetCredentialParam();
-
+ LOGE("[ON_IPC_SET_REQUEST(REQUEST_CREDENTIAL)] pkgName=%s, requestJsonStr = %s", pkgName.c_str(), requestJsonStr.c_str());
if (!data.WriteString(pkgName)) {
LOGE("write pkg failed.");
return ERR_DM_IPC_WRITE_FAILED;
@@ -668,7 +688,7 @@ ON_IPC_SET_REQUEST(REGISTER_CREDENTIAL_CALLBACK, std::shared_ptr<IpcReq> pBaseRe
{
std::shared_ptr<IpcReq> pReq = std::static_pointer_cast<IpcReq>(pBaseReq);
std::string pkgName = pReq->GetPkgName();
-
+ LOGE("[ON_IPC_SET_REQUEST(REGISTER_CREDENTIAL_CALLBACK)] pkgName=%s, ", pkgName.c_str());
if (!data.WriteString(pkgName)) {
LOGE("write pkgName failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -719,6 +739,7 @@ ON_IPC_SET_REQUEST(NOTIFY_EVENT, std::shared_ptr<IpcReq> pBaseReq, MessageParcel
std::string pkgName = pReq->GetPkgName();
int32_t eventId = pReq->GetEventId();
std::string event = pReq->GetEvent();
+ LOGE("[ON_IPC_SET_REQUEST(NOTIFY_EVENT)] pkgName=%s, eventId=%d, event=%s", pkgName.c_str(), eventId, event.c_str());
if (!data.WriteString(pkgName)) {
LOGE("write pkgName failed");
return ERR_DM_IPC_WRITE_FAILED;
diff --git a/services/service/src/ipc/standard/ipc_cmd_parser.cpp b/services/service/src/ipc/standard/ipc_cmd_parser.cpp
index 66ccd01..4fc309b 100644
--- a/services/service/src/ipc/standard/ipc_cmd_parser.cpp
+++ b/services/service/src/ipc/standard/ipc_cmd_parser.cpp
@@ -43,6 +43,7 @@ ON_IPC_SET_REQUEST(SERVER_DEVICE_STATE_NOTIFY, std::shared_ptr<IpcReq> pBaseReq,
std::shared_ptr<IpcNotifyDeviceStateReq> pReq = std::static_pointer_cast<IpcNotifyDeviceStateReq>(pBaseReq);
std::string pkgName = pReq->GetPkgName();
int32_t deviceState = pReq->GetDeviceState();
+ LOGE("[ON_IPC_SET_REQUEST(SERVER_DEVICE_STATE_NOTIFY)] pkgName=%s, deviceState=%d", pkgName.c_str(), deviceState);
DmDeviceInfo deviceInfo = pReq->GetDeviceInfo();
if (!data.WriteString(pkgName)) {
LOGE("write pkgName failed");
@@ -65,6 +66,7 @@ ON_IPC_READ_RESPONSE(SERVER_DEVICE_STATE_NOTIFY, MessageParcel &reply, std::shar
LOGE("pBaseRsp is null");
return ERR_DM_FAILED;
}
+ LOGE("[ON_IPC_READ_RESPONSE(SERVER_DEVICE_STATE_NOTIFY)] reply.ReadInt32()=%d", reply.ReadInt32());
pBaseRsp->SetErrCode(reply.ReadInt32());
return DM_OK;
}
@@ -79,6 +81,7 @@ ON_IPC_SET_REQUEST(SERVER_DEVICE_FOUND, std::shared_ptr<IpcReq> pBaseReq, Messag
std::string pkgName = pReq->GetPkgName();
uint16_t subscribeId = pReq->GetSubscribeId();
DmDeviceInfo deviceInfo = pReq->GetDeviceInfo();
+ LOGE("[ON_IPC_SET_REQUEST(SERVER_DEVICE_FOUND)] pkgName=%s, subscribeId=%u", pkgName.c_str(), subscribeId);
if (!data.WriteString(pkgName)) {
LOGE("write pkgName failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -100,6 +103,7 @@ ON_IPC_READ_RESPONSE(SERVER_DEVICE_FOUND, MessageParcel &reply, std::shared_ptr<
LOGE("pBaseRsp is null");
return ERR_DM_FAILED;
}
+ LOGE("[ON_IPC_READ_RESPONSE(SERVER_DEVICE_FOUND)] reply.ReadInt32()=%d", reply.ReadInt32());
pBaseRsp->SetErrCode(reply.ReadInt32());
return DM_OK;
}
@@ -113,6 +117,7 @@ ON_IPC_SET_REQUEST(SERVER_DISCOVER_FINISH, std::shared_ptr<IpcReq> pBaseReq, Mes
std::string pkgName = pReq->GetPkgName();
uint16_t subscribeId = pReq->GetSubscribeId();
int32_t result = pReq->GetResult();
+ LOGE("[ON_IPC_SET_REQUEST(SERVER_DISCOVER_FINISH)] pkgName=%s, subscribeId=%u", pkgName.c_str(), subscribeId);
if (!data.WriteString(pkgName)) {
LOGE("write pkgName failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -134,6 +139,7 @@ ON_IPC_READ_RESPONSE(SERVER_DISCOVER_FINISH, MessageParcel &reply, std::shared_p
LOGE("pBaseRsp is null");
return ERR_DM_FAILED;
}
+ LOGE("[ON_IPC_READ_RESPONSE(SERVER_DISCOVER_FINISH)] reply.ReadInt32()=%d", reply.ReadInt32());
pBaseRsp->SetErrCode(reply.ReadInt32());
return DM_OK;
}
@@ -146,6 +152,7 @@ ON_IPC_SET_REQUEST(SERVER_PUBLISH_FINISH, std::shared_ptr<IpcReq> pBaseReq, Mess
std::shared_ptr<IpcNotifyPublishResultReq> pReq = std::static_pointer_cast<IpcNotifyPublishResultReq>(pBaseReq);
std::string pkgName = pReq->GetPkgName();
int32_t publishId = pReq->GetPublishId();
+ LOGE("[ON_IPC_SET_REQUEST(SERVER_PUBLISH_FINISH)] pkgName=%s, publishId=%u", pkgName.c_str(), publishId);
int32_t result = pReq->GetResult();
if (!data.WriteString(pkgName)) {
LOGE("write pkgName failed");
@@ -168,6 +175,7 @@ ON_IPC_READ_RESPONSE(SERVER_PUBLISH_FINISH, MessageParcel &reply, std::shared_pt
LOGE("pBaseRsp is null");
return ERR_DM_FAILED;
}
+ LOGE("[ON_IPC_READ_RESPONSE(SERVER_DISCOVER_FINISH)] reply.ReadInt32()=%d", reply.ReadInt32());
pBaseRsp->SetErrCode(reply.ReadInt32());
return DM_OK;
}
@@ -184,6 +192,7 @@ ON_IPC_SET_REQUEST(SERVER_AUTH_RESULT, std::shared_ptr<IpcReq> pBaseReq, Message
std::string token = pReq->GetPinToken();
int32_t status = pReq->GetStatus();
int32_t reason = pReq->GetReason();
+ LOGE("[ON_IPC_SET_REQUEST(SERVER_AUTH_RESULT)] pkgName=%s, deviceId=%s, token=%s", pkgName.c_str(), deviceId.c_str(), token.c_str());
if (!data.WriteString(pkgName)) {
LOGE("write pkgName failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -213,6 +222,7 @@ ON_IPC_READ_RESPONSE(SERVER_AUTH_RESULT, MessageParcel &reply, std::shared_ptr<I
LOGE("pBaseRsp is null");
return ERR_DM_FAILED;
}
+ LOGE("[ON_IPC_READ_RESPONSE(SERVER_AUTH_RESULT)] reply.ReadInt32()=%d", reply.ReadInt32());
pBaseRsp->SetErrCode(reply.ReadInt32());
return DM_OK;
}
@@ -229,6 +239,7 @@ ON_IPC_SET_REQUEST(SERVER_VERIFY_AUTH_RESULT, std::shared_ptr<IpcReq> pBaseReq,
std::string deviceId = pReq->GetDeviceId();
int32_t result = pReq->GetResult();
int32_t flag = pReq->GetFlag();
+ LOGE("[ON_IPC_READ_RESPONSE(SERVER_VERIFY_AUTH_RESULT)] pkgName=%s, deviceId=%s", pkgName.c_str(), deviceId.c_str());
if (!data.WriteString(pkgName)) {
LOGE("write pkgName failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -296,6 +307,7 @@ ON_IPC_CMD(GET_TRUST_DEVICE_LIST, MessageParcel &data, MessageParcel &reply)
std::vector<DmDeviceInfo> deviceList;
int32_t result = DeviceManagerService::GetInstance().GetTrustedDeviceList(pkgName, extra, deviceList);
int32_t infoNum =(int32_t)(deviceList.size());
+ LOGE("[ON_IPC_CMD(GET_TRUST_DEVICE_LIST)] infoNum=%d", infoNum);
DmDeviceInfo deviceInfo;
if (!reply.WriteInt32(infoNum)) {
LOGE("write infoNum failed");
@@ -305,7 +317,7 @@ ON_IPC_CMD(GET_TRUST_DEVICE_LIST, MessageParcel &data, MessageParcel &reply)
for (; !deviceList.empty();) {
deviceInfo = deviceList.back();
deviceList.pop_back();
-
+ LOGE("[ON_IPC_CMD(GET_TRUST_DEVICE_LIST)] deviceId=%s, deviceName=%s, networkId=%s", deviceInfo.deviceId, deviceInfo.deviceName, deviceInfo.networkId);
if (!reply.WriteRawData(&deviceInfo, sizeof(DmDeviceInfo))) {
LOGE("write subscribeInfo failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -324,6 +336,7 @@ ON_IPC_CMD(REGISTER_DEVICE_MANAGER_LISTENER, MessageParcel &data, MessageParcel
std::string pkgName = data.ReadString();
sptr<IRemoteObject> listener = data.ReadRemoteObject();
int32_t result = IpcServerStub::GetInstance().RegisterDeviceManagerListener(pkgName, listener);
+ LOGE("[ON_IPC_CMD(REGISTER_DEVICE_MANAGER_LISTENER)] pkgName=%s", pkgName.c_str());
if (!reply.WriteInt32(result)) {
LOGE("write result failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -335,6 +348,7 @@ ON_IPC_CMD(UNREGISTER_DEVICE_MANAGER_LISTENER, MessageParcel &data, MessageParce
{
std::string pkgName = data.ReadString();
int32_t result = IpcServerStub::GetInstance().UnRegisterDeviceManagerListener(pkgName);
+ LOGE("[ON_IPC_CMD(UNREGISTER_DEVICE_MANAGER_LISTENER)] pkgName=%s", pkgName.c_str());
if (!reply.WriteInt32(result)) {
LOGE("write result failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -352,6 +366,7 @@ ON_IPC_CMD(START_DEVICE_DISCOVER, MessageParcel &data, MessageParcel &reply)
if (subscribeInfo != nullptr) {
result = DeviceManagerService::GetInstance().StartDeviceDiscovery(pkgName, *subscribeInfo, extra);
}
+ LOGE("[ON_IPC_CMD(START_DEVICE_DISCOVER)] pkgName=%s, result=%d", pkgName.c_str(), result);
if (!reply.WriteInt32(result)) {
LOGE("write result failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -380,6 +395,7 @@ ON_IPC_CMD(PUBLISH_DEVICE_DISCOVER, MessageParcel &data, MessageParcel &reply)
if (publishInfo != nullptr) {
result = DeviceManagerService::GetInstance().PublishDeviceDiscovery(pkgName, *publishInfo);
}
+ LOGE("[ON_IPC_CMD(PUBLISH_DEVICE_DISCOVER)] pkgName=%s, result=%d", pkgName.c_str(), result);
if (!reply.WriteInt32(result)) {
LOGE("write result failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -407,6 +423,7 @@ ON_IPC_CMD(AUTHENTICATE_DEVICE, MessageParcel &data, MessageParcel &reply)
int32_t authType = data.ReadInt32();
int32_t result = DM_OK;
result = DeviceManagerService::GetInstance().AuthenticateDevice(pkgName, authType, deviceId, extra);
+ LOGE("[ON_IPC_CMD(AUTHENTICATE_DEVICE)] deviceId=%s, result=%d", deviceId.c_str(), result);
if (!reply.WriteInt32(result)) {
LOGE("write result failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -430,6 +447,7 @@ ON_IPC_CMD(VERIFY_AUTHENTICATION, MessageParcel &data, MessageParcel &reply)
{
std::string authPara = data.ReadString();
int32_t result = DeviceManagerService::GetInstance().VerifyAuthentication(authPara);
+ LOGE("[ON_IPC_CMD(VERIFY_AUTHENTICATION)] authPara=%s", authPara.c_str());
if (!reply.WriteInt32(result)) {
LOGE("write result failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -442,7 +460,7 @@ ON_IPC_CMD(GET_LOCAL_DEVICE_INFO, MessageParcel &data, MessageParcel &reply)
DmDeviceInfo localDeviceInfo;
int32_t result = 0;
result = DeviceManagerService::GetInstance().GetLocalDeviceInfo(localDeviceInfo);
-
+ LOGE("[ON_IPC_CMD(GET_LOCAL_DEVICE_INFO)] deviceId=%s, deviceName=%s, networkId=%s", localDeviceInfo.deviceId, localDeviceInfo.deviceName, localDeviceInfo.networkId);
if (!reply.WriteRawData(&localDeviceInfo, sizeof(DmDeviceInfo))) {
LOGE("write subscribeInfo failed");
}
@@ -460,7 +478,7 @@ ON_IPC_CMD(GET_UDID_BY_NETWORK, MessageParcel &data, MessageParcel &reply)
std::string netWorkId = data.ReadString();
std::string udid;
int32_t result = DeviceManagerService::GetInstance().GetUdidByNetworkId(pkgName, netWorkId, udid);
-
+ LOGE("[ON_IPC_CMD(GET_UDID_BY_NETWORK)] pkgName=%s, netWorkId=%s, udid=%s", pkgName.c_str(), netWorkId.c_str(), udid.c_str());
if (!reply.WriteInt32(result)) {
LOGE("write result failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -478,7 +496,7 @@ ON_IPC_CMD(GET_UUID_BY_NETWORK, MessageParcel &data, MessageParcel &reply)
std::string netWorkId = data.ReadString();
std::string uuid;
int32_t result = DeviceManagerService::GetInstance().GetUuidByNetworkId(pkgName, netWorkId, uuid);
-
+ LOGE("[ON_IPC_CMD(GET_UUID_BY_NETWORK)] pkgName=%s, netWorkId=%s, udid=%s", pkgName.c_str(), netWorkId.c_str(), uuid.c_str());
if (!reply.WriteInt32(result)) {
LOGE("write result failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -544,6 +562,7 @@ ON_IPC_CMD(REGISTER_DEV_STATE_CALLBACK, MessageParcel &data, MessageParcel &repl
std::string packageName = data.ReadString();
std::string extra = data.ReadString();
int result = DeviceManagerService::GetInstance().RegisterDevStateCallback(packageName, extra);
+ LOGE("[ON_IPC_CMD(REGISTER_DEV_STATE_CALLBACK)] packageName=%s, result=%d", packageName.c_str(), result);
if (!reply.WriteInt32(result)) {
LOGE("write result failed");
return ERR_DM_IPC_WRITE_FAILED;
@@ -635,6 +654,7 @@ ON_IPC_CMD(NOTIFY_EVENT, MessageParcel &data, MessageParcel &reply)
int32_t eventId = data.ReadInt32();
std::string event = data.ReadString();
int32_t result = DeviceManagerService::GetInstance().NotifyEvent(pkgName, eventId, event);
+ LOGE("[ON_IPC_CMD(NOTIFY_EVENT)] packageName=%s, eventId=%d, event=%s", pkgName.c_str(), eventId, event.c_str());
if (!reply.WriteInt32(result)) {
LOGE("write result failed");
return ERR_DM_IPC_WRITE_FAILED;
diff --git a/services/service/src/ipc/standard/ipc_server_client_proxy.cpp b/services/service/src/ipc/standard/ipc_server_client_proxy.cpp
index 86ff2b3..03648ea 100644
--- a/services/service/src/ipc/standard/ipc_server_client_proxy.cpp
+++ b/services/service/src/ipc/standard/ipc_server_client_proxy.cpp
@@ -37,6 +37,7 @@ int32_t IpcServerClientProxy::SendCmd(int32_t cmdCode, std::shared_ptr<IpcReq> r
}
MessageParcel reply;
MessageOption option = { MessageOption::TF_ASYNC };
+ LOGE("[IpcServerClientProxy::SendCmd] cmdCode = %u", cmdCode);
if (IpcCmdRegister::GetInstance().SetRequest(cmdCode, req, data) != DM_OK) {
return ERR_DM_IPC_SEND_REQUEST_FAILED;
}
diff --git a/services/service/src/ipc/standard/ipc_server_listener.cpp b/services/service/src/ipc/standard/ipc_server_listener.cpp
index 513b1fd..6a800ec 100644
--- a/services/service/src/ipc/standard/ipc_server_listener.cpp
+++ b/services/service/src/ipc/standard/ipc_server_listener.cpp
@@ -32,6 +32,7 @@ int32_t IpcServerListener::SendRequest(int32_t cmdCode, std::shared_ptr<IpcReq>
LOGE("Invalid parameter, pkgName is empty.");
return ERR_DM_INPUT_PARA_INVALID;
}
+ LOGE("[IpcServerListener::SendRequest] cmdCode = %d, pkgName=%s", cmdCode, pkgName.c_str());
sptr<IpcRemoteBroker> listener = IpcServerStub::GetInstance().GetDmListener(pkgName);
if (listener == nullptr) {
LOGI("cannot get listener for package:%s.", pkgName.c_str());
@@ -52,6 +53,7 @@ int32_t IpcServerListener::SendAll(int32_t cmdCode, std::shared_ptr<IpcReq> req,
auto remote = iter.second;
req->SetPkgName(pkgName);
sptr<IpcRemoteBroker> listener = iface_cast<IpcRemoteBroker>(remote);
+ LOGE("[IpcServerListener::SendAll] cmdCode = %d, pkgName=%s", cmdCode, pkgName.c_str());
if (listener == nullptr) {
LOGE("cannot get listener for package:%s.", pkgName.c_str());
return ERR_DM_FAILED;
diff --git a/services/service/src/ipc/standard/ipc_server_stub.cpp b/services/service/src/ipc/standard/ipc_server_stub.cpp
index 16c114e..e61ad17 100644
--- a/services/service/src/ipc/standard/ipc_server_stub.cpp
+++ b/services/service/src/ipc/standard/ipc_server_stub.cpp
@@ -105,6 +105,7 @@ int32_t IpcServerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Messa
LOGI("ReadInterfaceToken fail!");
return ERR_DM_IPC_READ_FAILED;
}
+ LOGI("[IpcServerStub::OnRemoteRequest] code = %u", code);
int32_t ret = IpcCmdRegister::GetInstance().OnIpcCmd((int32_t)code, data, reply);
if (ret == ERR_DM_UNSUPPORTED_IPC_COMMAND) {
LOGW("unsupported code: %d", code);
@@ -122,6 +123,7 @@ int32_t IpcServerStub::SendCmd(int32_t cmdCode, std::shared_ptr<IpcReq> req, std
MessageParcel data;
MessageParcel reply;
MessageOption option;
+ LOGI("SendCmd cmdCode = %u", cmdCode);
if (IpcCmdRegister::GetInstance().SetRequest(cmdCode, req, data) != DM_OK) {
LOGE("set request cmd failed");
return ERR_DM_IPC_SEND_REQUEST_FAILED;
diff --git a/services/service/src/softbus/softbus_listener.cpp b/services/service/src/softbus/softbus_listener.cpp
index b4d36b5..7aaa08b 100644
--- a/services/service/src/softbus/softbus_listener.cpp
+++ b/services/service/src/softbus/softbus_listener.cpp
@@ -163,6 +163,7 @@ int32_t SoftbusListener::GetTrustedDeviceList(std::vector<DmDeviceInfo> &deviceI
{
int32_t infoNum = 0;
NodeBasicInfo *nodeInfo = nullptr;
+ LOGE("{SoftbusListener::GetTrustedDeviceList}");
int32_t ret = GetAllNodeDeviceInfo(DM_PKG_NAME, &nodeInfo, &infoNum);
if (ret != 0) {
LOGE("GetAllNodeDeviceInfo failed with ret %d", ret);
@@ -178,11 +179,12 @@ int32_t SoftbusListener::GetTrustedDeviceList(std::vector<DmDeviceInfo> &deviceI
NodeBasicInfo *nodeBasicInfo = nodeInfo + i;
DmDeviceInfo *deviceInfo = *pInfoList + i;
ConvertNodeBasicInfoToDmDevice(*nodeBasicInfo, *deviceInfo);
+ LOGE("{SoftbusListener::GetTrustedDeviceList} networkId=%s, devName=%s", nodeBasicInfo->networkId, nodeBasicInfo->deviceName);
deviceInfoList.push_back(*deviceInfo);
}
FreeNodeInfo(nodeInfo);
free(info);
- LOGI("SoftbusListener::GetTrustDevices success, deviceCount %d", infoNum);
+ LOGI("{SoftbusListener::GetTrustDevices} success, deviceCount %d", infoNum);
return DM_OK;
}
@@ -190,6 +192,7 @@ int32_t SoftbusListener::GetLocalDeviceInfo(DmDeviceInfo &deviceInfo)
{
NodeBasicInfo nodeBasicInfo;
int32_t ret = GetLocalNodeDeviceInfo(DM_PKG_NAME, &nodeBasicInfo);
+ LOGE("{SoftbusListener::GetLocalDeviceInfo} networkId=%s, devname=%s", nodeBasicInfo.networkId, nodeBasicInfo.deviceName);
if (ret != 0) {
LOGE("GetLocalNodeDeviceInfo failed with ret %d", ret);
return ERR_DM_FAILED;
@@ -203,6 +206,7 @@ int32_t SoftbusListener::GetUdidByNetworkId(const char *networkId, std::string &
uint8_t mUdid[UDID_BUF_LEN] = {0};
int32_t ret =
GetNodeKeyInfo(DM_PKG_NAME, networkId, NodeDeviceInfoKey::NODE_KEY_UDID, mUdid, sizeof(mUdid));
+ LOGE("{SoftbusListener::GetUdidByNetworkId} networkId=%s, udid=%s", networkId, udid.c_str());
if (ret != DM_OK) {
LOGE("GetUdidByNetworkId GetNodeKeyInfo failed");
return ERR_DM_FAILED;
@@ -216,6 +220,7 @@ int32_t SoftbusListener::GetUuidByNetworkId(const char *networkId, std::string &
uint8_t mUuid[UUID_BUF_LEN] = {0};
int32_t ret =
GetNodeKeyInfo(DM_PKG_NAME, networkId, NodeDeviceInfoKey::NODE_KEY_UUID, mUuid, sizeof(mUuid));
+ LOGE("{SoftbusListener::GetUuidByNetworkId} networkId=%s, uuid=%s", networkId, uuid.c_str());
if (ret != DM_OK) {
LOGE("GetUuidByNetworkId GetNodeKeyInfo failed");
return ERR_DM_FAILED;
--
2.45.2.windows.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/s-c-c/distributedhardware_device_manager.git
[email protected]:s-c-c/distributedhardware_device_manager.git
s-c-c
distributedhardware_device_manager
distributedhardware_device_manager
master

搜索帮助