未验证 提交 e03106ba 编写于 作者: O openharmony_ci 提交者: Gitee

!22919 docs: 【nfc】dts与md文档扫描一致性-monthly

Merge pull request !22919 from wujie/monthly_20230815
......@@ -100,6 +100,182 @@ isDefaultService(elementName: ElementName, type: CardType): boolean
| ------- | ------------------------------------ |
| boolean | true: 是默认支付应用, false: 不是默认支付应用。 |
## HceService<sup>8+</sup>
提供HCE卡模拟的实现,主要包括接收对端读卡设备的APDU数据,并响应APDU数据到对端读卡设备。使用HCE相关接口前,必须先判断设备是否支持HCE卡模拟能力。暂不支持使用,仅做接口声明。
### startHCE<sup>8+</sup>
startHCE(aidList: string[]): boolean
启动HCE业务功能。包括设置当前应用为前台优先,动态注册AID列表。暂不支持使用,仅做接口声明。
> **说明:**
> 从 API version 8 开始支持,从 API version 9 开始废弃,建议使用[start](#start9)替代。
**需要权限:** ohos.permission.NFC_CARD_EMULATION
**系统能力:** SystemCapability.Communication.NFC.CardEmulation
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | -------- | ---- | ----------------------- |
| aidList | string[] | 是 | 动态注册卡模拟的AID列表。 |
### start<sup>9+</sup>
start(elementName: ElementName, aidList: string[]): void
启动HCE业务功能。包括设置当前应用为前台优先,动态注册AID列表。暂不支持使用,仅做接口声明。
**需要权限:** ohos.permission.NFC_CARD_EMULATION
**系统能力:** SystemCapability.Communication.NFC.CardEmulation
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | -------- | ---- | ----------------------- |
| elementName | ElementName | 是 | 服务能力的元素名称。 |
| aidList | string[] | 是 | 动态注册卡模拟的AID列表。 |
**错误码:**
以下错误码的详细介绍请参见[NFC错误码](../errorcodes/errorcode-nfc.md)
| 错误码ID | 错误信息|
| ------- | -------|
| 3100301 | Card emulation running state is abnormal in service. |
### stopHCE<sup>8+</sup>
stopHCE(): boolean
停止HCE业务功能。包括退出当前应用前台优先,释放动态注册的AID列表。暂不支持使用,仅做接口声明。
> **说明:**
> 从 API version 8 开始支持,从 API version 9 开始废弃,建议使用[stop](#stop)替代。
**需要权限:** ohos.permission.NFC_CARD_EMULATION
**系统能力:** SystemCapability.Communication.NFC.CardEmulation
### stop<sup>9+</sup>
stop(elementName: ElementName): void;
停止HCE业务功能。包括退出当前应用前台优先,释放动态注册的AID列表。暂不支持使用,仅做接口声明。
**需要权限:** ohos.permission.NFC_CARD_EMULATION
**系统能力:** SystemCapability.Communication.NFC.CardEmulation
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | -------- | ---- | ----------------------- |
| elementName | ElementName | 是 | 服务能力的元素名称。 |
**错误码:**
以下错误码的详细介绍请参见[NFC错误码](../errorcodes/errorcode-nfc.md)
| 错误码ID | 错误信息|
| ------- | -------|
| 3100301 | Card emulation running state is abnormal in service. |
### on<sup>8+</sup>
on(type: "hceCmd", callback: AsyncCallback<number[]>): void;
订阅回调,用于接收对端读卡设备发送的APDU数据。暂不支持使用,仅做接口声明。
**需要权限:** ohos.permission.NFC_CARD_EMULATION
**系统能力:** SystemCapability.Communication.NFC.CardEmulation
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------- | ---- | -------------------------------------------- |
| type | string | 是 | 固定填"hceCmd"字符串。 |
| callback | AsyncCallback<number[]> | 是 | 订阅的事件回调,入参是符合APDU协议的数据,每个number十六进制表示,范围是0x00~0xFF。 |
### sendResponse<sup>8+</sup>
sendResponse(responseApdu: number[]): void;
发送APDU数据到对端读卡设备。暂不支持使用,仅做接口声明。
> **说明:**
> 从 API version 8 开始支持,从 API version 9 开始废弃,建议使用[transmit](#transmit9)替代。
**需要权限:** ohos.permission.NFC_CARD_EMULATION
**系统能力:** SystemCapability.Communication.NFC.CardEmulation
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------------ | -------- | ---- | -------------------------------------------------- |
| responseApdu | number[] | 是 | 发送到对端读卡设备的符合APDU协议的数据,每个number十六进制表示,范围是0x00~0xFF。 |
### transmit<sup>9+</sup>
transmit(response: number[]): Promise<void>;
发送APDU数据到对端读卡设备。暂不支持使用,仅做接口声明。
**需要权限:** ohos.permission.NFC_CARD_EMULATION
**系统能力:** SystemCapability.Communication.NFC.CardEmulation
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------------ | -------- | ---- | -------------------------------------------------- |
| responseApdu | number[] | 是 | 发送到对端读卡设备的符合APDU协议的数据,每个number十六进制表示,范围是0x00~0xFF。 |
**返回值:**
| **类型** | **说明** |
| ------- | -------------------------------------- |
| Promise<void> | 表示异步回调完成。 |
**错误码:**
以下错误码的详细介绍请参见[NFC错误码](../errorcodes/errorcode-nfc.md)
| 错误码ID | 错误信息|
| ------- | -------|
| 3100301 | Card emulation running state is abnormal in service. |
### transmit<sup>9+</sup>
transmit(response: number[], callback: AsyncCallback<void>): void;
发送APDU数据到对端读卡设备。暂不支持使用,仅做接口声明。
**需要权限:** ohos.permission.NFC_CARD_EMULATION
**系统能力:** SystemCapability.Communication.NFC.CardEmulation
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | -------- | ---- | ----------------------- |
| responseApdu | number[] | 是 | 发送到对端读卡设备的符合APDU协议的数据,每个number十六进制表示,范围是0x00~0xFF。 |
| callback | AsyncCallback<void> | 是 | 回调函数void |
**错误码:**
以下错误码的详细介绍请参见[NFC错误码](../errorcodes/errorcode-nfc.md)
| 错误码ID | 错误信息|
| ------- | -------|
| 3100301 | Card emulation running state is abnormal in service. |
**示例:**
```js
......
......@@ -525,7 +525,7 @@ import tag from '@ohos.nfc.tag';
let elementName = null;
let discTech = [tag.NFC_A, tag.NFC_B]; // replace with the tech(s) that is needed by foreground ability
function foregroundCb(err, taginfo) {
function foregroundCb(err, tagInfo) {
if (!err) {
console.log("foreground callback: tag found tagInfo = ", JSON.stringify(tagInfo));
} else {
......
......@@ -2188,6 +2188,13 @@ format(message: [NdefMessage](#ndefmessage9), callback: AsyncCallback\<void>): v
| ------------------ | --------------------------|
| callback: AsyncCallback\<void> | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[NFC错误码](../errorcodes/errorcode-nfc.md)
| 错误码ID | 错误信息|
| ------- | -------|
| 3100201 | Tag running state is abnormal in service. |
**示例:**
......@@ -2297,6 +2304,13 @@ formatReadOnly(message: [NdefMessage](#ndefmessage9), callback: AsyncCallback\<v
| ------------------ | --------------------------|
| callback: AsyncCallback\<void> | 回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[NFC错误码](../errorcodes/errorcode-nfc.md)
| 错误码ID | 错误信息|
| ------- | -------|
| 3100201 | Tag running state is abnormal in service. |
**示例:**
......
......@@ -261,7 +261,7 @@ isSecureElementPresent(): boolean
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300101 | IllegalStateError, service state exception. |
**示例:**
......@@ -302,8 +302,8 @@ try {
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300104 | Secure element IO exception. |
| 3300101 | IllegalStateError, service state exception. |
| 3300104 | IOError, there is a communication problem to the reader or the SE. |
**示例:**
......@@ -340,7 +340,7 @@ try {
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300101 | IllegalStateError, service state exception. |
**示例:**
......@@ -413,7 +413,7 @@ getATR(): number[]
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300101 | IllegalStateError, service state exception. |
**示例:**
......@@ -456,7 +456,7 @@ close(): void
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300101 | IllegalStateError, service state exception. |
**示例:**
......@@ -526,7 +526,7 @@ closeChannels(): void
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300101 | IllegalStateError, service state exception. |
**示例:**
......@@ -570,10 +570,10 @@ openBasicChannel(aid: number[]): Promise\<Channel>
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300102 | No such element exception. |
| 3300103 | Illegal access rule exception. |
| 3300104 | Secure element IO exception. |
| 3300101 | IllegalStateError, service state exception. |
| 3300102 | NoSuchElementError, the AID on the SE is not available or cannot be selected. |
| 3300103 | SecurityError, the calling application cannot be granted access to this AID or the default applet on this session. |
| 3300104 | IOError, there is a communication problem to the reader or the SE. |
**示例:**
......@@ -619,10 +619,10 @@ try {
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300102 | No such element exception. |
| 3300103 | Illegal access rule exception. |
| 3300104 | Secure element IO exception. |
| 3300101 | IllegalStateError, service state exception. |
| 3300102 | NoSuchElementError, the AID on the SE is not available or cannot be selected. |
| 3300103 | SecurityError, the calling application cannot be granted access to this AID or the default applet on this session. |
| 3300104 | IOError, there is a communication problem to the reader or the SE. |
**示例:**
......@@ -675,10 +675,10 @@ openBasicChannel(aid: number[], p2: number): Promise\<Channel>
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300102 | No such element exception. |
| 3300103 | Illegal access rule exception. |
| 3300104 | Secure element IO exception. |
| 3300101 | IllegalStateError, service state exception. |
| 3300102 | NoSuchElementError, the AID on the SE is not available or cannot be selected. |
| 3300103 | SecurityError, the calling application cannot be granted access to this AID or the default applet on this session. |
| 3300104 | IOError, there is a communication problem to the reader or the SE. |
**示例:**
......@@ -726,10 +726,10 @@ openBasicChannel(aid: number[], p2:number, callback: AsyncCallback\<Channel>): v
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300102 | No such element exception. |
| 3300103 | Illegal access rule exception. |
| 3300104 | Secure element IO exception. |
| 3300101 | IllegalStateError, service state exception. |
| 3300102 | NoSuchElementError, the AID on the SE is not available or cannot be selected. |
| 3300103 | SecurityError, the calling application cannot be granted access to this AID or the default applet on this session. |
| 3300104 | IOError, there is a communication problem to the reader or the SE. |
**示例:**
......@@ -782,10 +782,10 @@ openLogicalChannel(aid: number[]): Promise\<Channel>
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300102 | No such element exception. |
| 3300103 | Illegal access rule exception. |
| 3300104 | Secure element IO exception. |
| 3300101 | IllegalStateError, service state exception. |
| 3300102 | NoSuchElementError, the AID on the SE is not available or cannot be selected. |
| 3300103 | SecurityError, the calling application cannot be granted access to this AID or the default applet on this session. |
| 3300104 | IOError, there is a communication problem to the reader or the SE. |
**示例:**
......@@ -831,10 +831,10 @@ try {
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300102 | No such element exception. |
| 3300103 | Illegal access rule exception. |
| 3300104 | Secure element IO exception. |
| 3300101 | IllegalStateError, service state exception. |
| 3300102 | NoSuchElementError, the AID on the SE is not available or cannot be selected. |
| 3300103 | SecurityError, the calling application cannot be granted access to this AID or the default applet on this session. |
| 3300104 | IOError, there is a communication problem to the reader or the SE. |
**示例:**
......@@ -887,10 +887,10 @@ P2通常为0x00。设备应允许P2的任何值,并且应允许以下值: 0x
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300102 | No such element exception. |
| 3300103 | Illegal access rule exception. |
| 3300104 | Secure element IO exception. |
| 3300101 | IllegalStateError, service state exception. |
| 3300102 | NoSuchElementError, the AID on the SE is not available or cannot be selected. |
| 3300103 | SecurityError, the calling application cannot be granted access to this AID or the default applet on this session. |
| 3300104 | IOError, there is a communication problem to the reader or the SE. |
**示例:**
......@@ -947,10 +947,10 @@ P2通常为0x00。设备应允许P2的任何值,并且应允许以下值: 0x
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300102 | No such element exception. |
| 3300103 | Illegal access rule exception. |
| 3300104 | Secure element IO exception. |
| 3300101 | IllegalStateError, service state exception. |
| 3300102 | NoSuchElementError, the AID on the SE is not available or cannot be selected. |
| 3300103 | SecurityError, the calling application cannot be granted access to this AID or the default applet on this session. |
| 3300104 | IOError, there is a communication problem to the reader or the SE. |
**示例:**
......@@ -1176,9 +1176,9 @@ transmit(command: number[]): Promise<number[]>
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300103 | Illegal access rule exception. |
| 3300104 | Secure element IO exception. |
| 3300101 | IllegalStateError, service state exception. |
| 3300103 | SecurityError, the calling application cannot be granted access to this AID or the default applet on this session. |
| 3300104 | IOError, there is a communication problem to the reader or the SE. |
**示例:**
......@@ -1228,9 +1228,9 @@ transmit(command: number[], callback: AsyncCallback<number[]>): void
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300103 | Illegal access rule exception. |
| 3300104 | Secure element IO exception. |
| 3300101 | IllegalStateError, service state exception. |
| 3300103 | SecurityError, the calling application cannot be granted access to this AID or the default applet on this session. |
| 3300104 | IOError, there is a communication problem to the reader or the SE. |
**示例:**
......
......@@ -8,7 +8,7 @@
**错误信息**
Illegal service state exception.
IllegalStateError, an attempt is made to use an SE session that has been closed.
**错误描述**
......@@ -28,7 +28,7 @@ SE服务状态异常。
**错误信息**
No such element exception.
NoSuchElementError, the AID on the SE is not available or cannot be selected.
**错误描述**
......@@ -48,7 +48,7 @@ No such element exception.
**错误信息**
Illegal access rule exception.
SecurityError, the calling application cannot be granted access to this AID or the default applet on this session.
**错误描述**
......@@ -67,7 +67,7 @@ Illegal access rule exception.
**错误信息**
Secure element IO exception.
IOError, there is a communication problem to the reader or the SE.
**错误描述**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册