harmony 鸿蒙ipc_cremote_object.h

2025-06-12 浏览 (1)

ipc_cremote_object.h

Overview

Provides C interfaces for creating and destroying a remote object, transferring data, and observing the dead status of a remote object.

Library: libipc_capi.so

System capability: SystemCapability.Communication.IPC.Core

Since: 12

Related module: OHIPCRemoteObject

Summary

Structs

NameDescription
struct  OH_IPC_MessageOptionDefines an IPC message.

Types

NameDescription
typedef int(* OH_OnRemoteRequestCallback) (uint32_t code, const OHIPCParcel *data, OHIPCParcel *reply, void *userData)Defines a callback used to process the remote data request at the stub.
typedef void(* OH_OnRemoteDestroyCallback) (void *userData)Defines a callback to be invoked when an observed object of the stub is destroyed.
typedef void(* OH_OnDeathRecipientCallback) (void *userData)Defines a callback to be invoked when the remote OHIPCRemoteStub object dies unexpectedly.
typedef void(* OH_OnDeathRecipientDestroyCallback) (void *userData)Defines a callback to be invoked when the OHIPCDeathRecipient object is destroyed.

Enums

NameDescription
OH_IPC_RequestMode {
OH_IPC_REQUEST_MODE_SYNC = 0,
OH_IPC_REQUEST_MODE_ASYNC = 1
}
Enumerates the IPC request modes.

Functions

NameDescription
OHIPCRemoteStub * OH_IPCRemoteStub_Create (const char *descriptor, OH_OnRemoteRequestCallback requestCallback, OH_OnRemoteDestroyCallback destroyCallback, void *userData)Creates an OHIPCRemoteStub object.
void OH_IPCRemoteStub_Destroy (OHIPCRemoteStub *stub)Destroys an OHIPCRemoteStub object.
void OH_IPCRemoteProxy_Destroy (OHIPCRemoteProxy *proxy)Destroys an OHIPCRemoteProxy object.
int OH_IPCRemoteProxy_SendRequest (const OHIPCRemoteProxy *proxy, uint32_t code, const OHIPCParcel *data, OHIPCParcel *reply, const OH_IPC_MessageOption *option)Sends an IPC message.
int OH_IPCRemoteProxy_GetInterfaceDescriptor (OHIPCRemoteProxy *proxy, char **descriptor, int32_t *len, OH_IPC_MemAllocator allocator)Obtains the interface descriptor from the stub.
OHIPCDeathRecipient * OH_IPCDeathRecipient_Create (OH_OnDeathRecipientCallback deathRecipientCallback, OH_OnDeathRecipientDestroyCallback destroyCallback, void *userData)Creates an OHIPCDeathRecipient object, which triggers a notification when the OHIPCRemoteStub object dies unexpectedly.
void OH_IPCDeathRecipient_Destroy (OHIPCDeathRecipient *recipient)Destroys an OHIPCDeathRecipient object.
int OH_IPCRemoteProxy_AddDeathRecipient (OHIPCRemoteProxy *proxy, OHIPCDeathRecipient *recipient)Subscribes to the death of an OHIPCRemoteStub object for an OHIPCRemoteProxy object.
int OH_IPCRemoteProxy_RemoveDeathRecipient (OHIPCRemoteProxy *proxy, OHIPCDeathRecipient *recipient)Unsubscribes from the death of the OHIPCRemoteStub object for an OHIPCRemoteProxy object.
int OH_IPCRemoteProxy_IsRemoteDead (const OHIPCRemoteProxy *proxy)Checks whether the OHIPCRemoteStub object corresponding to the OHIPCRemoteProxy object is dead.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙IPC Kit

harmony 鸿蒙IPC Kit

harmony 鸿蒙OH_IPC_MessageOption

harmony 鸿蒙OH_IPC_ErrorCode

harmony 鸿蒙OHIPCParcel

harmony 鸿蒙OHIPCRemoteObject

harmony 鸿蒙OHIPCSkeleton

harmony 鸿蒙RPC Error Codes

harmony 鸿蒙ipc_cparcel.h

harmony 鸿蒙ipc_cskeleton.h

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/3mXlda