提交 9619dcbb 编写于 作者: W wangqinxiao

rpc表格格式规范

Signed-off-by: Nwangqinxiao <wangqinxiao@huawei.com>
上级 2b76bd29
......@@ -28,6 +28,7 @@ create(): MessageParcel
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| MessageParcel | 返回创建的MessageParcel对象。 |
......@@ -70,6 +71,7 @@ writeRemoteObject(object: [IRemoteObject](#iremoteobject)): boolean
| object | [IRemoteObject](#iremoteobject) | 是 | 要序列化并写入MessageParcel的远程对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果操作成功,则返回true;否则返回false。 |
......@@ -111,6 +113,7 @@ readRemoteObject(): IRemoteObject
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| [IRemoteObject](#iremoteobject) | 读取到的远程对象。 |
......@@ -158,6 +161,7 @@ writeInterfaceToken(token: string): boolean
| token | string | 是 | 字符串类型描述符。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果操作成功,则返回true;否则返回false。 |
......@@ -180,6 +184,7 @@ readInterfaceToken(): string
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 返回读取到的接口描述符。 |
......@@ -206,6 +211,7 @@ getSize(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 获取的MessageParcel的数据大小。以字节为单位。 |
......@@ -228,6 +234,7 @@ getCapacity(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 获取的MessageParcel的容量大小。以字节为单位。 |
......@@ -250,11 +257,13 @@ setSize(size: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| size | number | 是 | MessageParcel实例的数据大小。以字节为单位。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 设置成功返回true,否则返回false。 |
......@@ -277,11 +286,13 @@ setCapacity(size: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| size | number | 是 | MessageParcel实例的存储容量。以字节为单位。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 设置成功返回true,否则返回false。 |
......@@ -304,6 +315,7 @@ getWritableBytes(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 获取到的MessageParcel的可写字节空间。以字节为单位。 |
......@@ -330,6 +342,7 @@ getReadableBytes(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 获取到的MessageParcel的可读字节空间。以字节为单位。 |
......@@ -356,6 +369,7 @@ getReadPosition(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回MessageParcel实例中的当前读取位置。 |
......@@ -378,6 +392,7 @@ getWritePosition(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回MessageParcel实例中的当前写入位置。 |
......@@ -401,11 +416,13 @@ rewindRead(pos: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| pos | number | 是 | 开始读取数据的目标位置。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果读取位置发生更改,则返回true;否则返回false。 |
......@@ -433,11 +450,13 @@ rewindWrite(pos: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| pos | number | 是 | 开始写入数据的目标位置。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果写入位置更改,则返回true;否则返回false。 |
......@@ -463,11 +482,13 @@ writeByte(val: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| val | number | 是 | 要写入的字节值。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入返回成功,否则返回false。 |
......@@ -490,6 +511,7 @@ readByte(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回字节值。 |
......@@ -514,11 +536,13 @@ writeShort(val: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| val | number | 是 | 要写入的短整数值。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入返回true,否则返回false。 |
......@@ -541,6 +565,7 @@ readShort(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回短整数值。 |
......@@ -565,11 +590,13 @@ writeInt(val: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| val | number | 是 | 要写入的整数值。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入返回成功,否则返回false。 |
......@@ -592,6 +619,7 @@ readInt(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回整数值。 |
......@@ -616,11 +644,13 @@ writeLong(val: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| val | number | 是 | 要写入的长整数值 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入成功返回true,否则返回false。 |
......@@ -643,6 +673,7 @@ readLong(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回长整数值。 |
......@@ -667,11 +698,13 @@ writeFloat(val: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| val | number | 是 | 要写入的浮点值。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入成功返回true,否则返回false。 |
......@@ -694,6 +727,7 @@ readFloat(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回浮点值。 |
......@@ -718,11 +752,13 @@ writeDouble(val: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| val | number | 是 | 要写入的双精度浮点值。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入成功返回true,否则返回false。 |
......@@ -745,6 +781,7 @@ readDouble(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回双精度浮点值。 |
......@@ -769,11 +806,13 @@ writeBoolean(val: boolean): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| val | boolean | 是 | 要写入的布尔值。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入成功返回true,否则返回false。 |
......@@ -796,6 +835,7 @@ readBoolean(): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 返回读取到的布尔值。 |
......@@ -820,11 +860,13 @@ writeChar(val: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| val | number | 是 | 要写入的单个字符值。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入返回true,否则返回false。 |
......@@ -847,6 +889,7 @@ readChar(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回单个字符值。 |
......@@ -871,11 +914,13 @@ writeString(val: string): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| val | string | 是 | 要写入的字符串值,其长度应小于40960字节。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入成功返回true,否则返回false。 |
......@@ -898,6 +943,7 @@ readString(): string
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 返回字符串值。 |
......@@ -922,11 +968,13 @@ writeSequenceable(val: Sequenceable): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| val | [Sequenceable](#sequenceable) | 是 | 要写入的可序列对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入成功返回true,否则返回false。 |
......@@ -968,11 +1016,13 @@ readSequenceable(dataIn: Sequenceable) : boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| dataIn | [Sequenceable](#sequenceable) | 是 | 需要从MessageParcel读取成员变量的对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果反序列成功,则返回true;否则返回false。 |
......@@ -1017,11 +1067,13 @@ writeByteArray(byteArray: number[]): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| byteArray | number[] | 是 | 要写入的字节数组。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入成功返回true,否则返回false。 |
......@@ -1045,6 +1097,7 @@ readByteArray(dataIn: number[]) : void
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| dataIn | number[] | 是 | 要读取的字节数组。 |
......@@ -1070,6 +1123,7 @@ readByteArray(): number[]
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number[] | 返回字节数组。 |
......@@ -1095,11 +1149,13 @@ writeShortArray(shortArray: number[]): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| shortArray | number[] | 是 | 要写入的短整数数组。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入返回true,否则返回false。 |
......@@ -1122,6 +1178,7 @@ readShortArray(dataIn: number[]) : void
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| dataIn | number[] | 是 | 要读取的短整数数组。 |
......@@ -1146,6 +1203,7 @@ readShortArray(): number[]
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number[] | 返回短整数数组。 |
......@@ -1170,11 +1228,13 @@ writeIntArray(intArray: number[]): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| intArray | number[] | 是 | 要写入的整数数组。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入返回true,否则返回false。 |
......@@ -1197,6 +1257,7 @@ readIntArray(dataIn: number[]) : void
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| dataIn | number[] | 是 | 要读取的整数数组。 |
......@@ -1221,6 +1282,7 @@ readIntArray(): number[]
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number[] | 返回整数数组。 |
......@@ -1245,11 +1307,13 @@ writeLongArray(longArray: number[]): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| longArray | number[] | 是 | 要写入的长整数数组。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入返回true,否则返回false。 |
......@@ -1272,6 +1336,7 @@ readLongArray(dataIn: number[]) : void
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| dataIn | number[] | 是 | 要读取的长整数数组。 |
......@@ -1296,6 +1361,7 @@ readLongArray(): number[]
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number[] | 返回长整数数组。 |
......@@ -1320,11 +1386,13 @@ writeFloatArray(floatArray: number[]): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| floatArray | number[] | 是 | 要写入的浮点数组。由于系统内部对float类型的数据是按照double处理的,使用时对于数组所占的总字节数应按照double类型来计算。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入返回true,否则返回false。 |
......@@ -1347,6 +1415,7 @@ readFloatArray(dataIn: number[]) : void
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| dataIn | number[] | 是 | 要读取的浮点数组。由于系统内部对float类型的数据是按照double处理的,使用时对于数组所占的总字节数应按照double类型来计算。 |
......@@ -1372,6 +1441,7 @@ readFloatArray(): number[]
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number[] | 返回浮点数组。 |
......@@ -1396,11 +1466,13 @@ writeDoubleArray(doubleArray: number[]): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| doubleArray | number[] | 是 | 要写入的双精度浮点数组。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入返回true,否则返回false。 |
......@@ -1423,6 +1495,7 @@ readDoubleArray(dataIn: number[]) : void
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| dataIn | number[] | 是 | 要读取的双精度浮点数组。 |
......@@ -1447,6 +1520,7 @@ readDoubleArray(): number[]
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number[] | 返回双精度浮点数组。 |
......@@ -1471,11 +1545,13 @@ writeBooleanArray(booleanArray: boolean[]): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| booleanArray | boolean[] | 是 | 要写入的布尔数组。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入成功返回true,否则返回false。 |
......@@ -1498,6 +1574,7 @@ readBooleanArray(dataIn: boolean[]) : void
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| dataIn | boolean[] | 是 | 要读取的布尔数组。 |
......@@ -1522,6 +1599,7 @@ readBooleanArray(): boolean[]
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean[] | 返回布尔数组。 |
......@@ -1545,11 +1623,13 @@ writeCharArray(charArray: number[]): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| charArray | number[] | 是 | 要写入的单个字符数组。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入成功返回true,否则返回false。 |
......@@ -1572,6 +1652,7 @@ readCharArray(dataIn: number[]) : void
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| dataIn | number[] | 是 | 要读取的单个字符数组。 |
......@@ -1596,6 +1677,7 @@ readCharArray(): number[]
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number[] | 返回单个字符数组。 |
......@@ -1620,11 +1702,13 @@ writeStringArray(stringArray: string[]): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| stringArray | string[] | 是 | 要写入的字符串数组,数组单个元素的长度应小于40960字节。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入成功返回true,否则返回false。 |
......@@ -1647,6 +1731,7 @@ readStringArray(dataIn: string[]) : void
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| dataIn | string[] | 是 | 要读取的字符串数组。 |
......@@ -1671,6 +1756,7 @@ readStringArray(): string[]
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string[] | 返回字符串数组。 |
......@@ -1793,11 +1879,13 @@ writeSequenceableArray(sequenceableArray: Sequenceable[]): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| sequenceableArray | Sequenceable[] | 是 | 要写入的可序列化对象数组。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 写入成功返回true,否则返回false。 |
......@@ -1842,6 +1930,7 @@ readSequenceableArray(sequenceableArray: Sequenceable[]): void
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| sequenceableArray | Sequenceable[] | 是 | 要读取的可序列化对象数组。 |
......@@ -1888,11 +1977,13 @@ writeRemoteObjectArray(objectArray: IRemoteObject[]): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| objectArray | IRemoteObject[] | 是 | 要写入MessageParcel的IRemoteObject对象数组。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果IRemoteObject对象数组成功写入MessageParcel,则返回true;如果对象为null或数组写入MessageParcel失败,则返回false。 |
......@@ -1939,6 +2030,7 @@ readRemoteObjectArray(objects: IRemoteObject[]): void
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| objects | IRemoteObject[] | 是 | 从MessageParcel读取的IRemoteObject对象数组。 |
......@@ -1986,6 +2078,7 @@ readRemoteObjectArray(): IRemoteObject[]
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| IRemoteObject[] | 返回IRemoteObject对象数组。 |
......@@ -2034,6 +2127,7 @@ static closeFileDescriptor(fd: number): void
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| fd | number | 是 | 要关闭的文件描述符。 |
......@@ -2057,11 +2151,13 @@ static dupFileDescriptor(fd: number) :number
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| fd | number | 是 | 表示已存在的文件描述符。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回新的文件描述符。 |
......@@ -2085,6 +2181,7 @@ containFileDescriptors(): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果此MessageParcel对象包含文件描述符,则返回true;否则返回false。 |
......@@ -2113,11 +2210,13 @@ writeFileDescriptor(fd: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| fd | number | 是 | 文件描述符。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果操作成功,则返回true;否则返回false。 |
......@@ -2143,6 +2242,7 @@ readFileDescriptor(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回文件描述符。 |
......@@ -2169,11 +2269,13 @@ writeAshmem(ashmem: Ashmem): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| ashmem | Ashmem | 是 | 要写入MessageParcel的匿名共享对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果匿名共享对象成功写入此MessageParcel,则返回true;否则返回false。 |
......@@ -2197,6 +2299,7 @@ readAshmem(): Ashmem
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Ashmem | 返回匿名共享对象。 |
......@@ -2222,6 +2325,7 @@ getRawDataCapacity(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回MessageParcel可以容纳的最大原始数据量,即128&nbsp;Mb。 |
......@@ -2244,12 +2348,14 @@ writeRawData(rawData: number[], size: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| rawData | number[] | 是 | 要写入的原始数据。 |
| size | number | 是 | 发送的原始数据大小,以字节为单位。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果操作成功,则返回true;否则返回false。 |
......@@ -2273,11 +2379,13 @@ readRawData(size: number): number[]
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| size | number | 是 | 要读取的原始数据的大小。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number[] | 返回原始数据(以字节为单位)。 |
......@@ -2307,11 +2415,13 @@ marshalling(dataOut: MessageParcel): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| dataOut | [MessageParcel](#messageparcel) | 是 | 可序列对象将被封送到的MessageParcel对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果封送成功,则返回true;否则返回false。 |
......@@ -2356,11 +2466,13 @@ unmarshalling(dataIn: MessageParcel) : boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| dataIn | [MessageParcel](#messageparcel) | 是 | 已将可序列对象封送到其中的MessageParcel对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果可序列化成功,则返回true;否则返回false。 |
......@@ -2410,6 +2522,7 @@ asObject(): IRemoteObject
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| [IRemoteObject](#iremoteobject) | 如果调用者是[RemoteObject](#ashmem8)对象,则直接返回本身;如果调用者是[RemoteProxy](#remoteproxy)对象,则返回它的持有者[IRemoteObject](#iremoteobject)。 |
......@@ -2491,11 +2604,13 @@ queryLocalInterface(descriptor: string): IRemoteBroker
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| descriptor | string | 是 | 接口描述符的字符串。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| IRemoteBroker | 返回绑定到指定接口描述符的IRemoteBroker对象。 |
......@@ -2513,6 +2628,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| code | number | 是 | 本次请求调用的消息码,由通信双方确定。如果接口由IDL工具生成,则消息代码由IDL自动生成。 |
......@@ -2521,6 +2637,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
| options | [MessageOption](#messageoption) | 是 | 本次请求的同异步模式,默认同步调用。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 返回一个布尔值,true表示成功,false表示失败。|
......@@ -2538,6 +2655,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| code | number | 是 | 本次请求调用的消息码,由通信双方确定。如果接口由IDL工具生成,则消息代码由IDL自动生成。 |
......@@ -2546,6 +2664,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
| options | [MessageOption](#messageoption) | 是 | 本次请求的同异步模式,默认同步调用。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;SendRequestResult&gt; | 返回一个期约,兑现值是sendRequestResult实例。|
......@@ -2559,6 +2678,7 @@ sendRequestAsync(code : number, data : MessageParcel, reply : MessageParcel, opt
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| code | number | 是 | 本次请求调用的消息码,由通信双方确定。如果接口由IDL工具生成,则消息代码由IDL自动生成。 |
......@@ -2567,6 +2687,7 @@ sendRequestAsync(code : number, data : MessageParcel, reply : MessageParcel, opt
| options | [MessageOption](#messageoption) | 是 | 本次请求的同异步模式,默认同步调用。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;SendRequestResult&gt; | 返回一个期约,兑现值是sendRequestResult实例。|
......@@ -2580,6 +2701,7 @@ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: Me
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| code | number | 是 | 本次请求调用的消息码,由通信双方确定。如果接口由IDL工具生成,则消息代码由IDL自动生成。 |
......@@ -2598,12 +2720,14 @@ addDeathRecipient(recipient: DeathRecipient, flags: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| recipient | [DeathRecipient](#deathrecipient) | 是 | 要注册的回调。 |
| flags | number | 是 | 死亡通知标志。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果回调注册成功,则返回true;否则返回false。 |
......@@ -2618,12 +2742,14 @@ removeDeathRecipient(recipient: DeathRecipient, flags: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| recipient | [DeathRecipient](#deathrecipient) | 是 | 要注销的回调。 |
| flags | number | 是 | 死亡通知标志。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果回调成功注销,则返回true;否则返回false。 |
......@@ -2638,6 +2764,7 @@ getInterfaceDescriptor(): string
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 返回接口描述符。 |
......@@ -2652,6 +2779,7 @@ isObjectDead(): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果对象已死亡,则返回true;否则返回false。 |
......@@ -2686,6 +2814,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| code | number | 是 | 本次请求调用的消息码,由通信双方确定。如果接口由IDL工具生成,则消息代码由IDL自动生成。 |
......@@ -2694,6 +2823,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
| options | [MessageOption](#messageoption) | 是 | 本次请求的同异步模式,默认同步调用。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 返回一个布尔值,true表示成功,false表示失败。|
......@@ -2751,6 +2881,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| code | number | 是 | 本次请求调用的消息码,由通信双方确定。如果接口由IDL工具生成,则消息代码由IDL自动生成。 |
......@@ -2759,6 +2890,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
| options | [MessageOption](#messageoption) | 是 | 本次请求的同异步模式,默认同步调用。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;SendRequestResult&gt; | 返回一个期约,兑现值是sendRequestResult实例。|
......@@ -2818,6 +2950,7 @@ sendRequestAsync(code : number, data : MessageParcel, reply : MessageParcel, opt
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| code | number | 是 | 本次请求调用的消息码,由通信双方确定。如果接口由IDL工具生成,则消息代码由IDL自动生成。 |
......@@ -2826,6 +2959,7 @@ sendRequestAsync(code : number, data : MessageParcel, reply : MessageParcel, opt
| options | [MessageOption](#messageoption) | 是 | 本次请求的同异步模式,默认同步调用。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;SendRequestResult&gt; | 返回一个期约,兑现值是sendRequestResult实例。|
......@@ -2885,6 +3019,7 @@ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: Me
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| code | number | 是 | 本次请求调用的消息码,由通信双方确定。如果接口由IDL工具生成,则消息代码由IDL自动生成。 |
......@@ -2946,11 +3081,13 @@ queryLocalInterface(interface: string): IRemoteBroker
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| interface | string | 是 | 需要查询的接口描述符。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| IRemoteBroker | 默认返回Null,标识该接口是一个代理侧接口。 |
......@@ -2991,12 +3128,14 @@ addDeathRecipient(recipient : DeathRecipient, flags : number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| recipient | [DeathRecipient](#deathrecipient) | 是 | 收件人表示要注册的回调。 |
| flags | number | 是 | 死亡通知标志。保留参数。设置为0。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果回调注册成功,则返回true;否则返回false。 |
......@@ -3042,12 +3181,14 @@ removeDeathRecipient(recipient : DeathRecipient, flags : number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| recipient | [DeathRecipient](#deathrecipient) | 是 | 要注销的死亡回调。 |
| flags | number | 是 | 死亡通知标志。保留参数。设置为0。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果回调成功注销,则返回true;否则返回false。 |
......@@ -3094,6 +3235,7 @@ getInterfaceDescriptor(): string
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 当前的接口描述符。 |
......@@ -3134,6 +3276,7 @@ isObjectDead(): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果对应的RemoteObject已经死亡,返回true,否则返回false。 |
......@@ -3188,6 +3331,7 @@ MessageOption构造函数。
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| syncFlags | number | 否 | 同步调用或异步调用标志。默认同步调用。 |
......@@ -3203,6 +3347,7 @@ getFlags(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 调用成功返回同步调用或异步调用标志。 |
......@@ -3217,6 +3362,7 @@ setFlags(flags: number): void
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| flags | number | 是 | 同步调用或异步调用标志。 |
......@@ -3231,6 +3377,7 @@ getWaitTime(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | rpc最长等待时间。 |
......@@ -3245,6 +3392,7 @@ setWaitTime(waitTime: number): void
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| waitTime | number | 是 | rpc调用最长等待时间。 |
......@@ -3264,6 +3412,7 @@ static getContextObject(): IRemoteObject
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| [IRemoteObject](#iremoteobject) | 返回系统能力管理者。 |
......@@ -3285,6 +3434,7 @@ static getCallingPid(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回调用者的PID。 |
......@@ -3311,6 +3461,7 @@ static getCallingUid(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回调用者的UID。 |
......@@ -3363,6 +3514,7 @@ static getCallingDeviceID(): string
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 返回调用者进程所在的设备ID。 |
......@@ -3389,6 +3541,7 @@ static getLocalDeviceID(): string
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 返回本地设备的ID。 |
......@@ -3415,6 +3568,7 @@ static isLocalCalling(): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果调用是在同一设备上进行的,则返回true,否则返回false。 |
......@@ -3441,12 +3595,14 @@ static flushCommands(object : IRemoteObject): number
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| object | [IRemoteObject](#iremoteobject) | 是 | 指定的RemoteProxy。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 如果操作成功,返回0;如果输入对象为空或RemoteObject,或者操作失败,返回错误代码。 |
......@@ -3488,6 +3644,7 @@ static resetCallingIdentity(): string
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 返回包含远程用户的UID和PID的字符串。 |
......@@ -3514,11 +3671,13 @@ static setCallingIdentity(identity : string): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| identity | string | 是 | 标识表示包含远程用户UID和PID的字符串。由resetCallingIdentity返回。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果操作成功,则返回true;否则返回false。 |
......@@ -3556,6 +3715,7 @@ RemoteObject构造函数。
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| descriptor | string | 是 | 接口描述符。 |
......@@ -3573,6 +3733,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| code | number | 是 | 本次请求调用的消息码,由通信双方确定。如果接口由IDL工具生成,则消息代码由IDL自动生成。 |
......@@ -3581,6 +3742,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
| options | [MessageOption](#messageoption) | 是 | 本次请求的同异步模式,默认同步调用。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 返回一个布尔值,true表示成功,false表示失败。|
......@@ -3640,6 +3802,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| code | number | 是 | 本次请求调用的消息码,由通信双方确定。如果接口由IDL工具生成,则消息代码由IDL自动生成。 |
......@@ -3648,6 +3811,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
| options | [MessageOption](#messageoption) | 是 | 本次请求的同异步模式,默认同步调用。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;SendRequestResult&gt; | 返回一个期约,兑现值是sendRequestResult实例。|
......@@ -3709,6 +3873,7 @@ sendRequestAsync(code : number, data : MessageParcel, reply : MessageParcel, opt
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| code | number | 是 | 本次请求调用的消息码,由通信双方确定。如果接口由IDL工具生成,则消息代码由IDL自动生成。 |
......@@ -3717,6 +3882,7 @@ sendRequestAsync(code : number, data : MessageParcel, reply : MessageParcel, opt
| options | [MessageOption](#messageoption) | 是 | 本次请求的同异步模式,默认同步调用。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;SendRequestResult&gt; | 返回一个期约,兑现值是sendRequestResult实例。|
......@@ -3777,6 +3943,7 @@ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: Me
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| code | number | 是 | 本次请求调用的消息码,由通信双方确定。如果接口由IDL工具生成,则消息代码由IDL自动生成。 |
......@@ -3840,6 +4007,7 @@ sendRequestAsync请求的响应处理函数,服务端在该函数里处理请
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| code | number | 是 | 对端发送的服务请求码。 |
......@@ -3848,6 +4016,7 @@ sendRequestAsync请求的响应处理函数,服务端在该函数里处理请
| option | [MessageOption](#messageoption) | 是 | 指示操作是同步还是异步。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果操作成功,则返回true;否则返回false。 |
......@@ -3897,6 +4066,7 @@ getCallingUid(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回通信对端的进程Uid。 |
......@@ -3938,6 +4108,7 @@ getCallingPid(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回通信对端的进程Pid。 |
......@@ -3979,11 +4150,13 @@ queryLocalInterface(descriptor: string): IRemoteBroker
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| descriptor | string | 是 | 需要查询的接口描述符。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| IRemoteBroker | 如果接口描述符对应的远端对象存在,则返回该远端对象,否则返回Null。 |
......@@ -4025,6 +4198,7 @@ getInterfaceDescriptor(): string
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 返回接口描述符。 |
......@@ -4067,6 +4241,7 @@ attachLocalInterface(localInterface: IRemoteBroker, descriptor: string): void
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| localInterface | IRemoteBroker | 是 | 将与描述符绑定的IRemoteBroker对象。 |
......@@ -4128,12 +4303,14 @@ static createAshmem(name: string, size: number): Ashmem
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| name | string | 是 | 名称,用于查询Ashmem信息。 |
| size | number | 是 | Ashmem的大小,以字节为单位。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Ashmem | 返回创建的Ashmem对象;如果创建失败,返回null。 |
......@@ -4157,11 +4334,13 @@ static createAshmemFromExisting(ashmem: Ashmem): Ashmem
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| ashmem | Ashmem | 是 | 已存在的Ashmem对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Ashmem | 返回创建的Ashmem对象。 |
......@@ -4218,6 +4397,7 @@ getAshmemSize(): number
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回Ashmem对象的内存大小。 |
......@@ -4240,11 +4420,13 @@ mapAshmem(mapType: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| mapType | number | 是 | 指定映射的内存区域的保护等级。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果映射成功,则返回true;否则返回false。 |
......@@ -4267,6 +4449,7 @@ mapReadAndWriteAshmem(): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果映射成功,则返回true;否则返回false。 |
......@@ -4289,6 +4472,7 @@ mapReadOnlyAshmem(): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果映射成功,则返回true;否则返回false。 |
......@@ -4311,11 +4495,13 @@ setProtection(protectionType: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| protectionType | number | 是 | 要设置的保护类型。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果设置成功,则返回true;否则返回false。 |
......@@ -4338,6 +4524,7 @@ writeToAshmem(buf: number[], size: number, offset: number): boolean
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| buf | number[] | 是 | 写入Ashmem对象的数据。 |
......@@ -4345,6 +4532,7 @@ writeToAshmem(buf: number[], size: number, offset: number): boolean
| offset | number | 是 | 要写入的数据在此Ashmem对象关联的内存区间的起始位置 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果数据写入成功,则返回true;在其他情况下,如数据写入越界或未获得写入权限,则返回false。 |
......@@ -4370,12 +4558,14 @@ readFromAshmem(size: number, offset: number): number[]
**系统能力**:SystemCapability.Communication.IPC.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| size | number | 是 | 要读取的数据的大小。 |
| offset | number | 是 | 要读取的数据在此Ashmem对象关联的内存区间的起始位置 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number[] | 返回读取的数据。 |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册