@@ -41,7 +41,6 @@ The APIs of this module return exceptions since API version 9. The following tab
...
@@ -41,7 +41,6 @@ The APIs of this module return exceptions since API version 9. The following tab
## MessageSequence<sup>9+</sup>
## MessageSequence<sup>9+</sup>
Provides APIs for reading and writing data in specific format.
Provides APIs for reading and writing data in specific format.
During RPC or IPC, the sender can use the **write()** method provided by **MessageSequence** to write data in specific format to a **MessageSequence** object. The receiver can use the **read()** method provided by **MessageSequence** to read data in specific format from a **MessageSequence** object. The data formats include basic data types and arrays, IPC objects, interface tokens, and custom sequenceable objects.
During RPC or IPC, the sender can use the **write()** method provided by **MessageSequence** to write data in specific format to a **MessageSequence** object. The receiver can use the **read()** method provided by **MessageSequence** to read data in specific format from a **MessageSequence** object. The data formats include basic data types and arrays, IPC objects, interface tokens, and custom sequenceable objects.
### create
### create
...
@@ -99,7 +98,7 @@ Serializes a remote object and writes it to this **MessageSequence** object.
...
@@ -99,7 +98,7 @@ Serializes a remote object and writes it to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| -------- | ------- |
| -------- | -------- |
| 1900008 | proxy or remote object is invalid |
| 1900008 | proxy or remote object is invalid |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
...
@@ -140,7 +139,7 @@ Reads the remote object from **MessageSequence**. You can use this API to deseri
...
@@ -140,7 +139,7 @@ Reads the remote object from **MessageSequence**. You can use this API to deseri
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900008 | proxy or remote object is invalid |
| 1900008 | proxy or remote object is invalid |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
...
@@ -182,7 +181,7 @@ Writes an interface token to this **MessageSequence** object. The remote object
...
@@ -182,7 +181,7 @@ Writes an interface token to this **MessageSequence** object. The remote object
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -216,7 +215,7 @@ Reads the interface token from this **MessageSequence** object. The interface to
...
@@ -216,7 +215,7 @@ Reads the interface token from this **MessageSequence** object. The interface to
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | ----- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -268,7 +267,7 @@ Obtains the capacity of this **MessageSequence** object.
...
@@ -268,7 +267,7 @@ Obtains the capacity of this **MessageSequence** object.
**Return value**
**Return value**
| Type | Description|
| Type | Description|
| ------ | ----- |
| ------ | ----- |
| number | **MessageSequence** capacity obtained, in bytes.|
| number | **MessageSequence** capacity obtained, in bytes.|
...
@@ -290,7 +289,7 @@ Sets the size of the data contained in this **MessageSequence** object.
...
@@ -290,7 +289,7 @@ Sets the size of the data contained in this **MessageSequence** object.
**Parameters**
**Parameters**
| Name| Type | Mandatory| Description|
| Name| Type | Mandatory| Description|
| ------ | ------ | ---- | ------ |
| ------ | ------ | ---- | ------ |
| size | number | Yes | Data size to set, in bytes.|
| size | number | Yes | Data size to set, in bytes.|
...
@@ -326,7 +325,7 @@ Sets the storage capacity of this **MessageSequence** object.
...
@@ -326,7 +325,7 @@ Sets the storage capacity of this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| -------- | ------ |
| -------- | -------- |
| 1900011 | parcel memory alloc failed |
| 1900011 | parcel memory alloc failed |
**Example**
**Example**
...
@@ -352,7 +351,7 @@ Obtains the writable capacity (in bytes) of this **MessageSequence** object.
...
@@ -352,7 +351,7 @@ Obtains the writable capacity (in bytes) of this **MessageSequence** object.
**Return value**
**Return value**
| Type| Description|
| Type | Description |
| ------ | ------ |
| ------ | ------ |
| number | Writable capacity of the **MessageSequence** instance, in bytes.|
| number | Writable capacity of the **MessageSequence** instance, in bytes.|
...
@@ -378,7 +377,7 @@ Obtains the readable capacity of this **MessageSequence** object.
...
@@ -378,7 +377,7 @@ Obtains the readable capacity of this **MessageSequence** object.
**Return value**
**Return value**
| Type| Description|
| Type | Description |
| ------ | ------- |
| ------ | ------- |
| number | Readable capacity of the **MessageSequence** instance, in bytes.|
| number | Readable capacity of the **MessageSequence** instance, in bytes.|
...
@@ -404,7 +403,7 @@ Obtains the read position of this **MessageSequence** object.
...
@@ -404,7 +403,7 @@ Obtains the read position of this **MessageSequence** object.
**Return value**
**Return value**
| Type| Description|
| Type | Description |
| ------ | ------ |
| ------ | ------ |
| number | Read position obtained.|
| number | Read position obtained.|
...
@@ -426,7 +425,7 @@ Obtains the write position of this **MessageSequence** object.
...
@@ -426,7 +425,7 @@ Obtains the write position of this **MessageSequence** object.
**Return value**
**Return value**
| Type| Description|
| Type | Description |
| ------ | ----- |
| ------ | ----- |
| number | Write position obtained.|
| number | Write position obtained.|
...
@@ -449,7 +448,7 @@ Moves the read pointer to the specified position.
...
@@ -449,7 +448,7 @@ Moves the read pointer to the specified position.
**Parameters**
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------- |
| ------ | ------ | ---- | ------- |
| pos | number | Yes | Position from which data is to read.|
| pos | number | Yes | Position from which data is to read.|
...
@@ -481,7 +480,7 @@ Moves the write pointer to the specified position.
...
@@ -481,7 +480,7 @@ Moves the write pointer to the specified position.
**Parameters**
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ----- |
| ------ | ------ | ---- | ----- |
| pos | number | Yes | Position from which data is to write.|
| pos | number | Yes | Position from which data is to write.|
...
@@ -511,9 +510,9 @@ Writes a byte value to this **MessageSequence** object.
...
@@ -511,9 +510,9 @@ Writes a byte value to this **MessageSequence** object.
**Parameters**
**Parameters**
| Name| Type | Mandatory| Description|
| Name| Type | Mandatory| Description|
| ----- | ------ | ---- | ----- |
| ------ | ------ | ---- | ----- |
| val | number | Yes| Byte value to write.|
| val | number | Yes | Byte value to write.|
**Error codes**
**Error codes**
...
@@ -545,7 +544,7 @@ Reads the byte value from this **MessageSequence** object.
...
@@ -545,7 +544,7 @@ Reads the byte value from this **MessageSequence** object.
**Return value**
**Return value**
| Type | Description|
| Type | Description|
| ------ | ----- |
| ------ | ----- |
| number | Byte value read.|
| number | Byte value read.|
...
@@ -588,14 +587,14 @@ Writes a short integer to this **MessageSequence** object.
...
@@ -588,14 +587,14 @@ Writes a short integer to this **MessageSequence** object.
| Name| Type | Mandatory| Description|
| Name| Type | Mandatory| Description|
| ------ | ------ | --- | --- |
| ------ | ------ | --- | --- |
| val | number | Yes| Short integer to write.|
| val | number | Yes | Short integer to write.|
**Error codes**
**Error codes**
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | ------ |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -629,7 +628,7 @@ Reads the short integer from this **MessageSequence** object.
...
@@ -629,7 +628,7 @@ Reads the short integer from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -670,7 +669,7 @@ Writes an integer to this **MessageSequence** object.
...
@@ -670,7 +669,7 @@ Writes an integer to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| -------- | ------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -704,7 +703,7 @@ Reads the integer from this **MessageSequence** object.
...
@@ -704,7 +703,7 @@ Reads the integer from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | ------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -745,7 +744,7 @@ Writes a long integer to this **MessageSequence** object.
...
@@ -745,7 +744,7 @@ Writes a long integer to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | ------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -779,7 +778,7 @@ Reads the long integer from this **MessageSequence** object.
...
@@ -779,7 +778,7 @@ Reads the long integer from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -811,16 +810,16 @@ Writes a floating-point number to this **MessageSequence** object.
...
@@ -811,16 +810,16 @@ Writes a floating-point number to this **MessageSequence** object.
**Parameters**
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type | Mandatory| Description |
| ----- | ---- | ---- | ----- |
| ------ | ------ | ---- | ----- |
| val | number | Yes| Floating-point number to write.|
| val | number | Yes | Floating-point number to write.|
**Error codes**
**Error codes**
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | ------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -854,7 +853,7 @@ Reads the floating-pointer number from this **MessageSequence** object.
...
@@ -854,7 +853,7 @@ Reads the floating-pointer number from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -895,7 +894,7 @@ Writes a double-precision floating-point number to this **MessageSequence** obje
...
@@ -895,7 +894,7 @@ Writes a double-precision floating-point number to this **MessageSequence** obje
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -929,7 +928,7 @@ Reads the double-precision floating-point number from this **MessageSequence** o
...
@@ -929,7 +928,7 @@ Reads the double-precision floating-point number from this **MessageSequence** o
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -970,7 +969,7 @@ Writes a Boolean value to this **MessageSequence** object.
...
@@ -970,7 +969,7 @@ Writes a Boolean value to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | ------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -1004,7 +1003,7 @@ Reads the Boolean value from this **MessageSequence** object.
...
@@ -1004,7 +1003,7 @@ Reads the Boolean value from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| -------- | ------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -1045,7 +1044,7 @@ Writes a character to this **MessageSequence** object.
...
@@ -1045,7 +1044,7 @@ Writes a character to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -1079,7 +1078,7 @@ Reads the character from this **MessageSequence** object.
...
@@ -1079,7 +1078,7 @@ Reads the character from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------ | --------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -1120,7 +1119,7 @@ Writes a string to this **MessageSequence** object.
...
@@ -1120,7 +1119,7 @@ Writes a string to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -1154,7 +1153,7 @@ Reads the string from this **MessageSequence** object.
...
@@ -1154,7 +1153,7 @@ Reads the string from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -1195,7 +1194,7 @@ Writes a **Parcelable** object to this **MessageSequence** object.
...
@@ -1195,7 +1194,7 @@ Writes a **Parcelable** object to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -1248,7 +1247,7 @@ Reads a **Parcelable** object from this **MessageSequence** object to the specif
...
@@ -1248,7 +1247,7 @@ Reads a **Parcelable** object from this **MessageSequence** object to the specif
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| -------- | ------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
| 1900012 | call js callback function failed |
| 1900012 | call js callback function failed |
...
@@ -1304,7 +1303,7 @@ Writes a byte array to this **MessageSequence** object.
...
@@ -1304,7 +1303,7 @@ Writes a byte array to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -1339,7 +1338,7 @@ Reads a byte array from this **MessageSequence** object.
...
@@ -1339,7 +1338,7 @@ Reads a byte array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -1381,7 +1380,7 @@ Reads the byte array from this **MessageSequence** object.
...
@@ -1381,7 +1380,7 @@ Reads the byte array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| -------- | ------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -1423,7 +1422,7 @@ Writes a short array to this **MessageSequence** object.
...
@@ -1423,7 +1422,7 @@ Writes a short array to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ----- | ----- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -1457,7 +1456,7 @@ Reads a short array from this **MessageSequence** object.
...
@@ -1457,7 +1456,7 @@ Reads a short array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------ | ------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -1498,7 +1497,7 @@ Reads the short array from this **MessageSequence** object.
...
@@ -1498,7 +1497,7 @@ Reads the short array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| -------- | ------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -1539,7 +1538,7 @@ Writes an integer array to this **MessageSequence** object.
...
@@ -1539,7 +1538,7 @@ Writes an integer array to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ----- | --------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -1573,7 +1572,7 @@ Reads an integer array from this **MessageSequence** object.
...
@@ -1573,7 +1572,7 @@ Reads an integer array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -1614,7 +1613,7 @@ Reads the integer array from this **MessageSequence** object.
...
@@ -1614,7 +1613,7 @@ Reads the integer array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ----- | ------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -1655,7 +1654,7 @@ Writes a long array to this **MessageSequence** object.
...
@@ -1655,7 +1654,7 @@ Writes a long array to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | ----- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -1689,7 +1688,7 @@ Reads a long array from this **MessageSequence** object.
...
@@ -1689,7 +1688,7 @@ Reads a long array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | ------ |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -1730,7 +1729,7 @@ Reads the long array from this **MessageSequence** object.
...
@@ -1730,7 +1729,7 @@ Reads the long array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -1771,7 +1770,7 @@ Writes a floating-point array to this **MessageSequence** object.
...
@@ -1771,7 +1770,7 @@ Writes a floating-point array to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -1805,7 +1804,7 @@ Reads a floating-point array from this **MessageSequence** object.
...
@@ -1805,7 +1804,7 @@ Reads a floating-point array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -1846,7 +1845,7 @@ Reads the floating-point array from this **MessageSequence** object.
...
@@ -1846,7 +1845,7 @@ Reads the floating-point array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -1887,7 +1886,7 @@ Writes a double-precision floating-point array to this **MessageSequence** objec
...
@@ -1887,7 +1886,7 @@ Writes a double-precision floating-point array to this **MessageSequence** objec
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -1921,7 +1920,7 @@ Reads a double-precision floating-point array from this **MessageSequence** obje
...
@@ -1921,7 +1920,7 @@ Reads a double-precision floating-point array from this **MessageSequence** obje
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -1962,7 +1961,7 @@ Reads the double-precision floating-point array from this **MessageSequence** ob
...
@@ -1962,7 +1961,7 @@ Reads the double-precision floating-point array from this **MessageSequence** ob
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -2003,7 +2002,7 @@ Writes a Boolean array to this **MessageSequence** object.
...
@@ -2003,7 +2002,7 @@ Writes a Boolean array to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -2037,7 +2036,7 @@ Reads a Boolean array from this **MessageSequence** object.
...
@@ -2037,7 +2036,7 @@ Reads a Boolean array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -2078,7 +2077,7 @@ Reads the Boolean array from this **MessageSequence** object.
...
@@ -2078,7 +2077,7 @@ Reads the Boolean array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -2119,7 +2118,7 @@ Writes a character array to this **MessageSequence** object.
...
@@ -2119,7 +2118,7 @@ Writes a character array to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| -------- | ------ |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -2153,7 +2152,7 @@ Reads a character array from this **MessageSequence** object.
...
@@ -2153,7 +2152,7 @@ Reads a character array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -2194,7 +2193,7 @@ Reads the character array from this **MessageSequence** object.
...
@@ -2194,7 +2193,7 @@ Reads the character array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -2236,7 +2235,7 @@ Writes a string array to this **MessageSequence** object.
...
@@ -2236,7 +2235,7 @@ Writes a string array to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -2270,7 +2269,7 @@ Reads a string array from this **MessageSequence** object.
...
@@ -2270,7 +2269,7 @@ Reads a string array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -2311,7 +2310,7 @@ Reads the string array from this **MessageSequence** object.
...
@@ -2311,7 +2310,7 @@ Reads the string array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -2346,7 +2345,7 @@ Writes information to this **MessageSequence** object indicating that no excepti
...
@@ -2346,7 +2345,7 @@ Writes information to this **MessageSequence** object indicating that no excepti
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -2388,15 +2387,17 @@ Reads the exception information from this **MessageSequence** object.
...
@@ -2388,15 +2387,17 @@ Reads the exception information from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
...
@@ -2414,7 +2415,11 @@ For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode
...
@@ -2414,7 +2415,11 @@ For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode
"bundleName":"com.ohos.server",
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
"abilityName":"com.ohos.server.EntryAbility",
};
};
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **sendMessageRequest()** of the proxy object is called to send a message.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **sendMessageRequest()** of the proxy object is called to send a message.
...
@@ -2468,7 +2473,7 @@ Writes a **Parcelable** array to this **MessageSequence** object.
...
@@ -2468,7 +2473,7 @@ Writes a **Parcelable** array to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -2524,7 +2529,7 @@ Reads a **Parcelable** array from this **MessageSequence** object.
...
@@ -2524,7 +2529,7 @@ Reads a **Parcelable** array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
| 1900012 | call js callback function failed |
| 1900012 | call js callback function failed |
...
@@ -2585,7 +2590,7 @@ Writes an array of **IRemoteObject** objects to this **MessageSequence** object.
...
@@ -2585,7 +2590,7 @@ Writes an array of **IRemoteObject** objects to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | ------- |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -2632,7 +2637,7 @@ Reads an array of **IRemoteObject** objects from this **MessageSequence** object
...
@@ -2632,7 +2637,7 @@ Reads an array of **IRemoteObject** objects from this **MessageSequence** object
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -2685,7 +2690,7 @@ Reads the **IRemoteObject** object array from this **MessageSequence** object.
...
@@ -2685,7 +2690,7 @@ Reads the **IRemoteObject** object array from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -2731,11 +2736,11 @@ Closes a file descriptor. This API is a static method.
...
@@ -2731,11 +2736,11 @@ Closes a file descriptor. This API is a static method.
@@ -2921,7 +2926,7 @@ Writes an anonymous shared object to this **MessageSequence** object.
...
@@ -2921,7 +2926,7 @@ Writes an anonymous shared object to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | ------- |
| -------- | ------- |
| 1900003 | write to ashmem failed |
| 1900003 | write to ashmem failed |
**Example**
**Example**
...
@@ -2963,7 +2968,7 @@ Reads the anonymous shared object from this **MessageSequence** object.
...
@@ -2963,7 +2968,7 @@ Reads the anonymous shared object from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900004 | read from ashmem failed |
| 1900004 | read from ashmem failed |
**Example**
**Example**
...
@@ -3034,7 +3039,7 @@ Writes raw data to this **MessageSequence** object.
...
@@ -3034,7 +3039,7 @@ Writes raw data to this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | ------ |
| -------- | -------- |
| 1900009 | write data to message sequence failed |
| 1900009 | write data to message sequence failed |
**Example**
**Example**
...
@@ -3075,7 +3080,7 @@ Reads raw data from this **MessageSequence** object.
...
@@ -3075,7 +3080,7 @@ Reads raw data from this **MessageSequence** object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900010 | read data from message sequence failed |
| 1900010 | read data from message sequence failed |
**Example**
**Example**
...
@@ -3103,7 +3108,6 @@ For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode
...
@@ -3103,7 +3108,6 @@ For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode
>This class is no longer maintained since API version 9. You are advised to use [MessageSequence](#messagesequence9).
>This class is no longer maintained since API version 9. You are advised to use [MessageSequence](#messagesequence9).
Provides APIs for reading and writing data in specific format.
Provides APIs for reading and writing data in specific format.
During RPC, the sender can use the **write()** method provided by **MessageParcel** to write data in specific format to a **MessageParcel** object. The receiver can use the **read()** method provided by **MessageParcel** to read data in specific format from a **MessageParcel** object. The data formats include basic data types and arrays, IPC objects, interface tokens, and custom sequenceable objects.
During RPC, the sender can use the **write()** method provided by **MessageParcel** to write data in specific format to a **MessageParcel** object. The receiver can use the **read()** method provided by **MessageParcel** to read data in specific format from a **MessageParcel** object. The data formats include basic data types and arrays, IPC objects, interface tokens, and custom sequenceable objects.
### create
### create
...
@@ -4032,7 +4036,7 @@ Writes a sequenceable object to this **MessageParcel** object.
...
@@ -4032,7 +4036,7 @@ Writes a sequenceable object to this **MessageParcel** object.
**Return value**
**Return value**
| Type | Description |
| Type | Description |
| ------- | --------------------------------- |
| ------- | -------------------------------- |
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
**Example**
**Example**
...
@@ -4072,14 +4076,14 @@ Reads member variables from this **MessageParcel** object.
...
@@ -4072,14 +4076,14 @@ Reads member variables from this **MessageParcel** object.
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example**
**Example**
...
@@ -4129,7 +4133,7 @@ Writes a byte array to this **MessageParcel** object.
...
@@ -4129,7 +4133,7 @@ Writes a byte array to this **MessageParcel** object.
**Return value**
**Return value**
| Type | Description |
| Type | Description |
| ------- | --------------------------------- |
| ------- | -------------------------------- |
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
**Example**
**Example**
...
@@ -4208,7 +4212,7 @@ Writes a short array to this **MessageParcel** object.
...
@@ -4208,7 +4212,7 @@ Writes a short array to this **MessageParcel** object.
**Return value**
**Return value**
| Type | Description |
| Type | Description |
| ------- | ----------------------------- |
| ------- | -------------------------------- |
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
**Example**
**Example**
...
@@ -4284,7 +4288,7 @@ Writes an integer array to this **MessageParcel** object.
...
@@ -4284,7 +4288,7 @@ Writes an integer array to this **MessageParcel** object.
**Return value**
**Return value**
| Type | Description |
| Type | Description |
| ------- | ----------------------------- |
| ------- | -------------------------------- |
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
**Example**
**Example**
...
@@ -4429,14 +4433,14 @@ Writes a FloatArray to this **MessageParcel** object.
...
@@ -4429,14 +4433,14 @@ Writes a FloatArray to this **MessageParcel** object.
**Parameters**
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| ---------- | -------- | ---- | --- |
| ---------- | -------- | ---- | --- |
| floatArray | number[] | Yes | Floating-point array to write. The system processes Float data as that of the Double type. Therefore, the total number of bytes occupied by a FloatArray must be calculated as the Double type.|
| floatArray | number[] | Yes | Floating-point array to write. The system processes Float data as that of the Double type. Therefore, the total number of bytes occupied by a FloatArray must be calculated as the Double type.|
**Return value**
**Return value**
| Type | Description |
| Type | Description |
| ------- | ----------------------------- |
| ------- | -------------------------------- |
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
**Example**
**Example**
...
@@ -4457,7 +4461,7 @@ Reads a FloatArray from this **MessageParcel** object.
...
@@ -4457,7 +4461,7 @@ Reads a FloatArray from this **MessageParcel** object.
**Parameters**
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type | Mandatory| Description |
| ------ | -------- | ---- | ------ |
| ------ | -------- | ---- | ------ |
| dataIn | number[] | Yes | Floating-point array to read. The system processes Float data as that of the Double type. Therefore, the total number of bytes occupied by a FloatArray must be calculated as the Double type.|
| dataIn | number[] | Yes | Floating-point array to read. The system processes Float data as that of the Double type. Therefore, the total number of bytes occupied by a FloatArray must be calculated as the Double type.|
...
@@ -4512,7 +4516,7 @@ Writes a DoubleArray to this **MessageParcel** object.
...
@@ -4512,7 +4516,7 @@ Writes a DoubleArray to this **MessageParcel** object.
**Return value**
**Return value**
| Type | Description |
| Type | Description |
| ------- | ----------------------------- |
| ------- | -------------------------------- |
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
**Example**
**Example**
...
@@ -4588,7 +4592,7 @@ Writes a Boolean array to this **MessageParcel** object.
...
@@ -4588,7 +4592,7 @@ Writes a Boolean array to this **MessageParcel** object.
**Return value**
**Return value**
| Type | Description |
| Type | Description |
| ------- | --------------------------------- |
| ------- | -------------------------------- |
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
**Example**
**Example**
...
@@ -4664,7 +4668,7 @@ Writes a character array to this **MessageParcel** object.
...
@@ -4664,7 +4668,7 @@ Writes a character array to this **MessageParcel** object.
**Return value**
**Return value**
| Type | Description |
| Type | Description |
| ------- | --------------------------------- |
| ------- | -------------------------------- |
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
**Example**
**Example**
...
@@ -4733,14 +4737,14 @@ Writes a string array to this **MessageParcel** object.
...
@@ -4733,14 +4737,14 @@ Writes a string array to this **MessageParcel** object.
| stringArray | string[] | Yes | String array to write. The length of a single element in the array must be less than 40960 bytes.|
| stringArray | string[] | Yes | String array to write. The length of a single element in the array must be less than 40960 bytes.|
**Return value**
**Return value**
| Type | Description|
| Type | Description|
| ------- | --------------------------------- |
| ------- | -------------------------------- |
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
**Example**
**Example**
...
@@ -4851,10 +4855,12 @@ Reads the exception information from this **MessageParcel** object.
...
@@ -4851,10 +4855,12 @@ Reads the exception information from this **MessageParcel** object.
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
...
@@ -4872,7 +4878,11 @@ Reads the exception information from this **MessageParcel** object.
...
@@ -4872,7 +4878,11 @@ Reads the exception information from this **MessageParcel** object.
"bundleName":"com.ohos.server",
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
"abilityName":"com.ohos.server.EntryAbility",
};
};
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **sendMessageRequest()** of the proxy object is called to send a message.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **sendMessageRequest()** of the proxy object is called to send a message.
...
@@ -4919,7 +4929,7 @@ Writes a sequenceable array to this **MessageParcel** object.
...
@@ -4919,7 +4929,7 @@ Writes a sequenceable array to this **MessageParcel** object.
**Return value**
**Return value**
| Type | Description |
| Type | Description |
| ------- | --------------------------------- |
| ------- | -------------------------------- |
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
| boolean | Returns **true** if the data is written successfully; returns **false** otherwise.|
**Example**
**Example**
...
@@ -5008,14 +5018,14 @@ Writes an array of **IRemoteObject** objects to this **MessageParcel** object.
...
@@ -5008,14 +5018,14 @@ Writes an array of **IRemoteObject** objects to this **MessageParcel** object.
**Parameters**
**Parameters**
| Name | Type | Mandatory| Description|
| Name | Type | Mandatory| Description|
| ----------- | --------------- | ---- | ----- |
| ----------- | --------------- | ---- | ----- |
| objectArray | IRemoteObject[] | Yes | Array of **IRemoteObject** objects to write.|
| objectArray | IRemoteObject[] | Yes | Array of **IRemoteObject** objects to write.|
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example**
**Example**
...
@@ -5641,8 +5651,8 @@ Obtains a proxy or remote object. This API must be implemented by its derived cl
...
@@ -5641,8 +5651,8 @@ Obtains a proxy or remote object. This API must be implemented by its derived cl
**Return value**
**Return value**
| Type | Description|
| Type | Description|
| ---- | ----- |
| ----- | ----- |
| [IRemoteObject](#iremoteobject) | Returns the **RemoteObject** if it is the caller; returns the [IRemoteObject](#iremoteobject), the holder of this **RemoteProxy** object, if the caller is a [RemoteProxy](#remoteproxy) object.|
| [IRemoteObject](#iremoteobject) | Returns the **RemoteObject** if it is the caller; returns the [IRemoteObject](#iremoteobject), the holder of this **RemoteProxy** object, if the caller is a [RemoteProxy](#remoteproxy) object.|
**Example**
**Example**
...
@@ -5658,20 +5668,22 @@ Obtains a proxy or remote object. This API must be implemented by its derived cl
...
@@ -5658,20 +5668,22 @@ Obtains a proxy or remote object. This API must be implemented by its derived cl
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
console.log("RpcClient: js onConnect called.");
console.log("RpcClient: js onConnect called.");
proxy=remoteProxy;
proxy=remoteProxy;
},
},
onDisconnect:function(elementName){
onDisconnect:function(elementName){
console.log("RpcClient: onDisconnect");
console.log("RpcClient: onDisconnect");
},
},
onFailed:function(){
onFailed:function(){
console.log("RpcClient: onFailed");
console.log("RpcClient: onFailed");
}
}
};
};
...
@@ -5679,7 +5691,11 @@ Obtains a proxy or remote object. This API must be implemented by its derived cl
...
@@ -5679,7 +5691,11 @@ Obtains a proxy or remote object. This API must be implemented by its derived cl
"bundleName":"com.ohos.server",
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
"abilityName":"com.ohos.server.EntryAbility",
};
};
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **asObject()** of the proxy object is called to obtain the proxy or remote object.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **asObject()** of the proxy object is called to obtain the proxy or remote object.
...
@@ -5695,7 +5711,6 @@ Obtains a proxy or remote object. This API must be implemented by its derived cl
...
@@ -5695,7 +5711,6 @@ Obtains a proxy or remote object. This API must be implemented by its derived cl
}
}
}
}
letiRemoteObject=newTestProxy(proxy).asObject();
letiRemoteObject=newTestProxy(proxy).asObject();
```
```
## DeathRecipient
## DeathRecipient
...
@@ -5806,8 +5821,8 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
...
@@ -5806,8 +5821,8 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
...
@@ -5816,7 +5831,7 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
...
@@ -5816,7 +5831,7 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
...
@@ -5857,7 +5872,7 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
...
@@ -5857,7 +5872,7 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| data | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object holding the data to send. |
| data | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object holding the data to send. |
| reply | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object that receives the response. |
| reply | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object that receives the response. |
...
@@ -5881,7 +5896,7 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
...
@@ -5881,7 +5896,7 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| data | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object holding the data to send. |
| data | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object holding the data to send. |
| reply | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object that receives the response. |
| reply | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object that receives the response. |
...
@@ -5901,7 +5916,7 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
...
@@ -5901,7 +5916,7 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
...
@@ -5928,7 +5943,7 @@ Registers a callback for receiving death notifications of the remote object. The
...
@@ -5928,7 +5943,7 @@ Registers a callback for receiving death notifications of the remote object. The
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900008 | proxy or remote object is invalid |
| 1900008 | proxy or remote object is invalid |
### addDeathrecipient<sup>(deprecated)</sup>
### addDeathrecipient<sup>(deprecated)</sup>
...
@@ -5951,7 +5966,7 @@ Adds a callback for receiving death notifications of the remote object. This met
...
@@ -5951,7 +5966,7 @@ Adds a callback for receiving death notifications of the remote object. This met
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
...
@@ -6092,15 +6107,17 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
...
@@ -6092,15 +6107,17 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
| boolean | Returns **true** if the message is sent successfully; returns **false** otherwise.|
| boolean | Returns **true** if the message is sent successfully; returns **false** otherwise.|
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
...
@@ -6118,7 +6135,11 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
...
@@ -6118,7 +6135,11 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
"bundleName":"com.ohos.server",
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
"abilityName":"com.ohos.server.EntryAbility",
};
};
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **sendMessageRequest()** of the proxy object is called to send a message.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **sendMessageRequest()** of the proxy object is called to send a message.
...
@@ -6153,7 +6174,7 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
...
@@ -6153,7 +6174,7 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| data | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object holding the data to send. |
| data | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object holding the data to send. |
| reply | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object that receives the response. |
| reply | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object that receives the response. |
...
@@ -6167,10 +6188,12 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
...
@@ -6167,10 +6188,12 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
...
@@ -6188,7 +6211,11 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
...
@@ -6188,7 +6211,11 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
"bundleName":"com.ohos.server",
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
"abilityName":"com.ohos.server.EntryAbility",
};
};
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **sendMessageRequest()** of the proxy object is called to send a message.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **sendMessageRequest()** of the proxy object is called to send a message.
...
@@ -6231,7 +6258,7 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
...
@@ -6231,7 +6258,7 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
...
@@ -6245,10 +6272,12 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
...
@@ -6245,10 +6272,12 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
...
@@ -6266,7 +6295,11 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
...
@@ -6266,7 +6295,11 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
"bundleName":"com.ohos.server",
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
"abilityName":"com.ohos.server.EntryAbility",
};
};
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **sendMessageRequest()** of the proxy object is called to send a message.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **sendMessageRequest()** of the proxy object is called to send a message.
...
@@ -6307,7 +6340,7 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
...
@@ -6307,7 +6340,7 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| data | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object holding the data to send. |
| data | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object holding the data to send. |
| reply | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object that receives the response. |
| reply | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object that receives the response. |
...
@@ -6316,10 +6349,12 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
...
@@ -6316,10 +6349,12 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
...
@@ -6350,7 +6385,11 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
...
@@ -6350,7 +6385,11 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
result.data.reclaim();
result.data.reclaim();
result.reply.reclaim();
result.reply.reclaim();
}
}
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **sendMessageRequest()** of the proxy object is called to send a message.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **sendMessageRequest()** of the proxy object is called to send a message.
...
@@ -6362,7 +6401,7 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
...
@@ -6362,7 +6401,7 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
...
@@ -6391,10 +6430,12 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
...
@@ -6391,10 +6430,12 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
...
@@ -6425,7 +6466,11 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
...
@@ -6425,7 +6466,11 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
result.data.reclaim();
result.data.reclaim();
result.reply.reclaim();
result.reply.reclaim();
}
}
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **sendMessageRequest()** of the proxy object is called to send a message.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **sendMessageRequest()** of the proxy object is called to send a message.
...
@@ -6464,22 +6509,24 @@ Obtains the **LocalInterface** object of an interface token.
...
@@ -6464,22 +6509,24 @@ Obtains the **LocalInterface** object of an interface token.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900006 | only remote object permitted |
| 1900006 | only remote object permitted |
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
console.log("RpcClient: js onConnect called.");
console.log("RpcClient: js onConnect called.");
proxy=remoteProxy;
proxy=remoteProxy;
},
},
onDisconnect:function(elementName){
onDisconnect:function(elementName){
console.log("RpcClient: onDisconnect");
console.log("RpcClient: onDisconnect");
},
},
onFailed:function(){
onFailed:function(){
...
@@ -6487,10 +6534,14 @@ For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode
...
@@ -6487,10 +6534,14 @@ For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode
}
}
};
};
letwant={
letwant={
"bundleName":"com.ohos.server",
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
"abilityName":"com.ohos.server.EntryAbility",
};
};
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **getLocalInterface()** of the proxy object is called to obtain the interface descriptor.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **getLocalInterface()** of the proxy object is called to obtain the interface descriptor.
...
@@ -6529,17 +6580,19 @@ Obtains the **LocalInterface** object of an interface token.
...
@@ -6529,17 +6580,19 @@ Obtains the **LocalInterface** object of an interface token.
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
console.log("RpcClient: js onConnect called.");
console.log("RpcClient: js onConnect called.");
proxy=remoteProxy;
proxy=remoteProxy;
},
},
onDisconnect:function(elementName){
onDisconnect:function(elementName){
console.log("RpcClient: onDisconnect");
console.log("RpcClient: onDisconnect");
},
},
onFailed:function(){
onFailed:function(){
...
@@ -6547,10 +6600,14 @@ Obtains the **LocalInterface** object of an interface token.
...
@@ -6547,10 +6600,14 @@ Obtains the **LocalInterface** object of an interface token.
}
}
};
};
letwant={
letwant={
"bundleName":"com.ohos.server",
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
"abilityName":"com.ohos.server.EntryAbility",
};
};
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **queryLocalInterface()** of the proxy object is called to obtain the interface descriptor.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **queryLocalInterface()** of the proxy object is called to obtain the interface descriptor.
...
@@ -6580,15 +6637,17 @@ Registers a callback for receiving death notifications of the remote object. The
...
@@ -6580,15 +6637,17 @@ Registers a callback for receiving death notifications of the remote object. The
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900008 | proxy or remote object is invalid |
| 1900008 | proxy or remote object is invalid |
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
...
@@ -6606,7 +6665,11 @@ For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode
...
@@ -6606,7 +6665,11 @@ For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode
"bundleName":"com.ohos.server",
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
"abilityName":"com.ohos.server.EntryAbility",
};
};
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **registerDeathRecipient()** of the proxy object is called to register a callback for receiving the death notification of the remote object.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **registerDeathRecipient()** of the proxy object is called to register a callback for receiving the death notification of the remote object.
...
@@ -6646,15 +6709,17 @@ Adds a callback for receiving the death notifications of the remote object, incl
...
@@ -6646,15 +6709,17 @@ Adds a callback for receiving the death notifications of the remote object, incl
| boolean | Returns **true** if the callback is added successfully; returns **false** otherwise.|
| boolean | Returns **true** if the callback is added successfully; returns **false** otherwise.|
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
...
@@ -6672,7 +6737,11 @@ Adds a callback for receiving the death notifications of the remote object, incl
...
@@ -6672,7 +6737,11 @@ Adds a callback for receiving the death notifications of the remote object, incl
"bundleName":"com.ohos.server",
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
"abilityName":"com.ohos.server.EntryAbility",
};
};
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **addDeathRecippient()** of the proxy object is called to add a callback for receiving the death notification of the remove object.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **addDeathRecippient()** of the proxy object is called to add a callback for receiving the death notification of the remove object.
...
@@ -6707,15 +6776,17 @@ Unregisters the callback used to receive death notifications of the remote objec
...
@@ -6707,15 +6776,17 @@ Unregisters the callback used to receive death notifications of the remote objec
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900008 | proxy or remote object is invalid |
| 1900008 | proxy or remote object is invalid |
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
...
@@ -6733,7 +6804,11 @@ For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode
...
@@ -6733,7 +6804,11 @@ For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode
"bundleName":"com.ohos.server",
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
"abilityName":"com.ohos.server.EntryAbility",
};
};
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **unregisterDeathRecipient()** of the proxy object is called to unregister the callback for receiving the death notification of the remote object.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **unregisterDeathRecipient()** of the proxy object is called to unregister the callback for receiving the death notification of the remote object.
...
@@ -6774,15 +6849,17 @@ Removes the callback used to receive death notifications of the remote object.
...
@@ -6774,15 +6849,17 @@ Removes the callback used to receive death notifications of the remote object.
| boolean | Returns **true** if the callback is removed; returns **false** otherwise.|
| boolean | Returns **true** if the callback is removed; returns **false** otherwise.|
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
...
@@ -6800,7 +6877,11 @@ Removes the callback used to receive death notifications of the remote object.
...
@@ -6800,7 +6877,11 @@ Removes the callback used to receive death notifications of the remote object.
"bundleName":"com.ohos.server",
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
"abilityName":"com.ohos.server.EntryAbility",
};
};
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **removeDeathRecipient()** of the proxy object is called to remove the callback used to receive the death notification of the remote object.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **removeDeathRecipient()** of the proxy object is called to remove the callback used to receive the death notification of the remote object.
...
@@ -6835,16 +6916,18 @@ Obtains the interface descriptor (which is a string) of this proxy object.
...
@@ -6835,16 +6916,18 @@ Obtains the interface descriptor (which is a string) of this proxy object.
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| -------- | ------- |
| -------- | -------- |
| 1900008 | proxy or remote object is invalid |
| 1900008 | proxy or remote object is invalid |
| 1900007 | communication failed |
| 1900007 | communication failed |
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
...
@@ -6862,7 +6945,11 @@ For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode
...
@@ -6862,7 +6945,11 @@ For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode
"bundleName":"com.ohos.server",
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
"abilityName":"com.ohos.server.EntryAbility",
};
};
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **getDescriptor()** of the proxy object is called to obtain the interface descriptor of the object.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **getDescriptor()** of the proxy object is called to obtain the interface descriptor of the object.
...
@@ -6894,10 +6981,12 @@ Obtains the interface descriptor of this proxy object.
...
@@ -6894,10 +6981,12 @@ Obtains the interface descriptor of this proxy object.
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
...
@@ -6915,7 +7004,11 @@ Obtains the interface descriptor of this proxy object.
...
@@ -6915,7 +7004,11 @@ Obtains the interface descriptor of this proxy object.
"bundleName":"com.ohos.server",
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
"abilityName":"com.ohos.server.EntryAbility",
};
};
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **getInterfaceDescriptor()** of the proxy object is called to obtain the interface descriptor of the current proxy object.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **getInterfaceDescriptor()** of the proxy object is called to obtain the interface descriptor of the current proxy object.
...
@@ -6936,15 +7029,17 @@ Checks whether the **RemoteObject** is dead.
...
@@ -6936,15 +7029,17 @@ Checks whether the **RemoteObject** is dead.
| boolean | Returns **true** if the **RemoteObject** is dead; returns **false** otherwise.|
| boolean | Returns **true** if the **RemoteObject** is dead; returns **false** otherwise.|
**Example**
**Example**
Obtain the service.
Before obtaining the ability for the application developed based on the stage model, obtain the context. For details, see [Obtaining the Context](#obtaining-the-context).
```ts
```ts
importFAfrom"@ohos.ability.featureAbility";
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letproxy;
letconnect={
letconnect={
onConnect:function(elementName,remoteProxy){
onConnect:function(elementName,remoteProxy){
...
@@ -6962,7 +7057,11 @@ Checks whether the **RemoteObject** is dead.
...
@@ -6962,7 +7057,11 @@ Checks whether the **RemoteObject** is dead.
"bundleName":"com.ohos.server",
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
"abilityName":"com.ohos.server.EntryAbility",
};
};
FA.connectAbility(want,connect);
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **isObjectDead()** of the proxy object is called to check whether this object is dead.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **isObjectDead()** of the proxy object is called to check whether this object is dead.
...
@@ -7046,7 +7145,7 @@ Checks whether **SendMessageRequest** is called synchronously or asynchronously.
...
@@ -7046,7 +7145,7 @@ Checks whether **SendMessageRequest** is called synchronously or asynchronously.
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
...
@@ -7589,7 +7688,7 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
...
@@ -7589,7 +7688,7 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
...
@@ -7716,7 +7815,7 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
...
@@ -7716,7 +7815,7 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| data | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object holding the data to send. |
| data | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object holding the data to send. |
| reply | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object that receives the response. |
| reply | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object that receives the response. |
...
@@ -7772,7 +7871,7 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
...
@@ -7772,7 +7871,7 @@ Sends a **MessageSequence** message to the remote process in synchronous or asyn
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| data | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object holding the data to send. |
| data | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object holding the data to send. |
| reply | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object that receives the response. |
| reply | [MessageSequence](#messagesequence9) | Yes | **MessageSequence** object that receives the response. |
...
@@ -7822,7 +7921,7 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
...
@@ -7822,7 +7921,7 @@ Sends a **MessageParcel** message to the remote process in synchronous or asynch
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| code | number | Yes | Message code called by the request, which is determined by the client and server. If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool.|
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| data | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object holding the data to send. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
| reply | [MessageParcel](#messageparceldeprecated) | Yes | **MessageParcel** object that receives the response. |
...
@@ -7886,7 +7985,7 @@ Provides a response to **sendMessageRequest()**. The server processes the reques
...
@@ -7886,7 +7985,7 @@ Provides a response to **sendMessageRequest()**. The server processes the reques
| boolean | Returns a Boolean value if the request is processed synchronously in **onRemoteMessageRequest**. The value **true** means the operation is successful; the value **false** means the opposite.|
| boolean | Returns a Boolean value if the request is processed synchronously in **onRemoteMessageRequest**. The value **true** means the operation is successful; the value **false** means the opposite.|
| Promise\<boolean> | Returns a promise object if the request is processed asynchronously in **onRemoteMessageRequest**. |
| Promise\<boolean> | Returns a promise object if the request is processed asynchronously in **onRemoteMessageRequest**. |
...
@@ -8237,7 +8336,7 @@ Obtains the interface descriptor of this object. The interface descriptor is a s
...
@@ -8237,7 +8336,7 @@ Obtains the interface descriptor of this object. The interface descriptor is a s
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | -------- |
| -------- | -------- |
| 1900008 | proxy or remote object is invalid |
| 1900008 | proxy or remote object is invalid |
**Example**
**Example**
...
@@ -8629,7 +8728,7 @@ Creates the shared file mapping on the virtual address space of this process. Th
...
@@ -8629,7 +8728,7 @@ Creates the shared file mapping on the virtual address space of this process. Th
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode-rpc.md).
| ID| Error Message|
| ID| Error Message|
| ------- | ------ |
| -------- | -------- |
| 1900001 | call mmap function failed |
| 1900001 | call mmap function failed |
**Example**
**Example**
...
@@ -8663,7 +8762,7 @@ Creates the shared file mapping on the virtual address space of this process. Th
...
@@ -8663,7 +8762,7 @@ Creates the shared file mapping on the virtual address space of this process. Th