mirror of
https://github.com/openharmony/device_manager.git
synced 2026-07-18 16:24:27 -04:00
@@ -73,6 +73,7 @@ enum {
|
||||
DM_IPC_SEND_REQUEST_FAILED,
|
||||
DM_IPC_NOT_REGISTER_FUNC,
|
||||
DM_IPC_RESPOND_ERROR,
|
||||
DM_IPC_WRITE_TOKEN_ERROR,
|
||||
DM_DISCOVERY_REPEATED,
|
||||
DM_AUTH_NOT_SUPPORT,
|
||||
DM_AUTH_BUSINESS_BUSY,
|
||||
|
||||
@@ -33,6 +33,10 @@ int32_t IpcClientServerProxy::SendCmd(int32_t cmdCode, std::shared_ptr<IpcReq> r
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
if (!data.WriteInterfaceToken(GetDescriptor())) {
|
||||
LOGE("WriteInterfaceToken fail!");
|
||||
return DM_IPC_WRITE_TOKEN_ERROR;
|
||||
}
|
||||
if (IpcCmdRegister::GetInstance().SetRequest(cmdCode, req, data) != DM_OK) {
|
||||
return DM_IPC_SEND_REQUEST_FAILED;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,12 @@ namespace DistributedHardware {
|
||||
int32_t IpcClientStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
|
||||
{
|
||||
LOGI("code = %d, flags= %d.", code, option.GetFlags());
|
||||
auto remoteDescriptor = data.ReadInterfaceToken();
|
||||
if (GetDescriptor() != remoteDescriptor) {
|
||||
LOGI("ReadInterfaceToken fail!");
|
||||
return ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (IpcCmdRegister::GetInstance().OnIpcCmd((int32_t)code, data, reply) == DM_OK) {
|
||||
LOGE("on ipc cmd success");
|
||||
return DM_OK;
|
||||
|
||||
@@ -81,6 +81,12 @@ void IpcServerStub::OnStop()
|
||||
int32_t IpcServerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
|
||||
{
|
||||
LOGI("code = %d, flags= %d.", code, option.GetFlags());
|
||||
auto remoteDescriptor = data.ReadInterfaceToken();
|
||||
if (GetDescriptor() != remoteDescriptor) {
|
||||
LOGI("ReadInterfaceToken fail!");
|
||||
return ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
int32_t ret = DM_OK;
|
||||
ret = IpcCmdRegister::GetInstance().OnIpcCmd((int32_t)code, data, reply);
|
||||
if (ret == DM_IPC_NOT_REGISTER_FUNC) {
|
||||
|
||||
Reference in New Issue
Block a user