提交 001e99a2 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 5ea60895
...@@ -21,11 +21,11 @@ Enumerates the NFC card emulation types. ...@@ -21,11 +21,11 @@ Enumerates the NFC card emulation types.
**System capability**: SystemCapability.Communication.NFC.CardEmulation **System capability**: SystemCapability.Communication.NFC.CardEmulation
| Name| Value| Description| | Name | Value | Description |
| -------- | -------- | -------- | | ---- | ---- | -------- |
| HCE | 0 | HCE.| | HCE | 0 | HCE.|
| UICC | 1 | Subscriber identity module (SIM) card emulation.| | UICC | 1 | Subscriber identity module (SIM) card emulation.|
| ESE | 2 | embedded Secure Element (eSE) emulation.| | ESE | 2 | embedded Secure Element (eSE) emulation. |
## CardType<sup>9+</sup> ## CardType<sup>9+</sup>
...@@ -33,10 +33,10 @@ Enumerates the types of services used by the card emulation application. ...@@ -33,10 +33,10 @@ Enumerates the types of services used by the card emulation application.
**System capability**: SystemCapability.Communication.NFC.CardEmulation **System capability**: SystemCapability.Communication.NFC.CardEmulation
| Name| Value| Description| | Name | Value | Description |
| -------- | -------- | -------- | | ------- | --------- | ----------------- |
| PAYMENT | "payment" | Payment type.| | PAYMENT | "payment" | Payment type.|
| OTHER | "other" | Other types.| | OTHER | "other" | Other types.|
## isSupported ## isSupported
...@@ -51,14 +51,14 @@ Checks whether a certain type of card emulation is supported. ...@@ -51,14 +51,14 @@ Checks whether a certain type of card emulation is supported.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------- | -------- | ---- | ----------------------- | | ------- | ------ | ---- | ---------------------------------------- |
| feature | number | Yes | Card emulation type. For details, see [FeatureType](#featuretype).| | feature | number | Yes | Card emulation type. For details, see [FeatureType](#featuretype).|
**Return value** **Return value**
| **Type**| **Description**| | **Type** | **Description** |
| -------- | -------- | | ------- | -------------------------------------- |
| boolean | Returns **true** if the card emulation type is supported; returns **false** otherwise.| | boolean | Returns **true** if the card emulation type is supported; returns **false** otherwise.|
## hasHceCapability<sup>9+</sup> ## hasHceCapability<sup>9+</sup>
...@@ -73,8 +73,8 @@ Checks whether HCE is supported. ...@@ -73,8 +73,8 @@ Checks whether HCE is supported.
**Return value** **Return value**
| **Type**| **Description**| | **Type** | **Description** |
| -------- | -------- | | ------- | -------------------------------- |
| boolean | Returns **true** if HCE is supported; returns **false** otherwise.| | boolean | Returns **true** if HCE is supported; returns **false** otherwise.|
## isDefaultService<sup>9+</sup> ## isDefaultService<sup>9+</sup>
...@@ -89,15 +89,15 @@ Checks whether an application is the default application of the specified servic ...@@ -89,15 +89,15 @@ Checks whether an application is the default application of the specified servic
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------- | -------- | ---- | ----------------------- | | ----------- | ---------------------------------------- | ---- | ----------------------- |
| elementName | [ElementName](js-apis-bundleManager-elementName.md#elementname) | Yes| Application description, which consists of the bundle name and component name.| | elementName | [ElementName](js-apis-bundleManager-elementName.md#elementname) | Yes | Application description, which consists of the bundle name and component name.|
| type | [CardType](#cardtype9) | Yes| Card emulation service type.| | type | [CardType](#cardtype9) | Yes | Card emulation service type. |
**Return value** **Return value**
| **Type**| **Description**| | **Type** | **Description** |
| -------- | -------- | | ------- | ------------------------------------ |
| boolean | Returns **true** if the application is the default payment application; returns **false** otherwise.| | boolean | Returns **true** if the application is the default payment application; returns **false** otherwise.|
**Example** **Example**
...@@ -108,13 +108,11 @@ import cardEmulation from '@ohos.nfc.cardEmulation'; ...@@ -108,13 +108,11 @@ import cardEmulation from '@ohos.nfc.cardEmulation';
var isHceSupported = cardEmulation.isSupported(cardEmulation.FeatureType.HCE); var isHceSupported = cardEmulation.isSupported(cardEmulation.FeatureType.HCE);
if (!isHceSupported) { if (!isHceSupported) {
console.log('this device is not supported for HCE, ignore it.'); console.log('this device is not supported for HCE, ignore it.');
return;
} }
var hasHceCap = cardEmulation.hasHceCapability(); var hasHceCap = cardEmulation.hasHceCapability();
if (!hasHceCap) { if (!hasHceCap) {
console.log('this device hasHceCapability false, ignore it.'); console.log('this device hasHceCapability false, ignore it.');
return;
} }
var elementName = { var elementName = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册