Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
e03106ba
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
e03106ba
编写于
8月 25, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 25, 2023
浏览文件
操作
浏览文件
下载
差异文件
!22919 docs: 【nfc】dts与md文档扫描一致性-monthly
Merge pull request !22919 from wujie/monthly_20230815
上级
4b8c3fae
c8bf9ea8
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
240 addition
and
50 deletion
+240
-50
zh-cn/application-dev/reference/apis/js-apis-cardEmulation.md
...n/application-dev/reference/apis/js-apis-cardEmulation.md
+176
-0
zh-cn/application-dev/reference/apis/js-apis-nfcTag.md
zh-cn/application-dev/reference/apis/js-apis-nfcTag.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-nfctech.md
zh-cn/application-dev/reference/apis/js-apis-nfctech.md
+14
-0
zh-cn/application-dev/reference/apis/js-apis-secureElement.md
...n/application-dev/reference/apis/js-apis-secureElement.md
+45
-45
zh-cn/application-dev/reference/errorcodes/errorcode-se.md
zh-cn/application-dev/reference/errorcodes/errorcode-se.md
+4
-4
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-cardEmulation.md
浏览文件 @
e03106ba
...
...
@@ -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
...
...
zh-cn/application-dev/reference/apis/js-apis-nfcTag.md
浏览文件 @
e03106ba
...
...
@@ -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
,
tag
i
nfo
)
{
function
foregroundCb
(
err
,
tag
I
nfo
)
{
if
(
!
err
)
{
console
.
log
(
"
foreground callback: tag found tagInfo =
"
,
JSON
.
stringify
(
tagInfo
));
}
else
{
...
...
zh-cn/application-dev/reference/apis/js-apis-nfctech.md
浏览文件 @
e03106ba
...
...
@@ -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. |
**示例:**
...
...
zh-cn/application-dev/reference/apis/js-apis-secureElement.md
浏览文件 @
e03106ba
...
...
@@ -261,7 +261,7 @@ isSecureElementPresent(): boolean
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300101 | Illegal
StateError,
service state exception. |
**示例:**
...
...
@@ -302,8 +302,8 @@ try {
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300104 |
Secure element IO exception
. |
| 3300101 | Illegal
StateError,
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 | Illegal
StateError,
service state exception. |
**示例:**
...
...
@@ -413,7 +413,7 @@ getATR(): number[]
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300101 | Illegal
StateError,
service state exception. |
**示例:**
...
...
@@ -456,7 +456,7 @@ close(): void
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300101 | Illegal
StateError,
service state exception. |
**示例:**
...
...
@@ -526,7 +526,7 @@ closeChannels(): void
| 错误码ID | 错误信息 |
| -------- | -------------------------------- |
| 3300101 | Illegal service state exception. |
| 3300101 | Illegal
StateError,
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 except
ion. |
| 3300104 |
Secure element IO exception
. |
| 3300101 | Illegal
StateError,
service state exception. |
| 3300102 | No
SuchElementError, 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 sess
ion. |
| 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 except
ion. |
| 3300104 |
Secure element IO exception
. |
| 3300101 | Illegal
StateError,
service state exception. |
| 3300102 | No
SuchElementError, 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 sess
ion. |
| 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 except
ion. |
| 3300104 |
Secure element IO exception
. |
| 3300101 | Illegal
StateError,
service state exception. |
| 3300102 | No
SuchElementError, 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 sess
ion. |
| 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 except
ion. |
| 3300104 |
Secure element IO exception
. |
| 3300101 | Illegal
StateError,
service state exception. |
| 3300102 | No
SuchElementError, 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 sess
ion. |
| 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 except
ion. |
| 3300104 |
Secure element IO exception
. |
| 3300101 | Illegal
StateError,
service state exception. |
| 3300102 | No
SuchElementError, 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 sess
ion. |
| 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 except
ion. |
| 3300104 |
Secure element IO exception.
|
| 3300101 | Illegal
StateError,
service state exception. |
| 3300102 | No
SuchElementError, 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 sess
ion. |
| 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 except
ion. |
| 3300104 |
Secure element IO exception
. |
| 3300101 | Illegal
StateError,
service state exception. |
| 3300102 | No
SuchElementError, 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 sess
ion. |
| 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 except
ion. |
| 3300104 |
Secure element IO exception
. |
| 3300101 | Illegal
StateError,
service state exception. |
| 3300102 | No
SuchElementError, 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 sess
ion. |
| 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 except
ion. |
| 3300104 |
Secure element IO exception
. |
| 3300101 | Illegal
StateError,
service state exception. |
| 3300103 |
SecurityError, the calling application cannot be granted access to this AID or the default applet on this sess
ion. |
| 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 except
ion. |
| 3300104 |
Secure element IO exception
. |
| 3300101 | Illegal
StateError,
service state exception. |
| 3300103 |
SecurityError, the calling application cannot be granted access to this AID or the default applet on this sess
ion. |
| 3300104 |
IOError, there is a communication problem to the reader or the SE
. |
**示例:**
...
...
zh-cn/application-dev/reference/errorcodes/errorcode-se.md
浏览文件 @
e03106ba
...
...
@@ -8,7 +8,7 @@
**错误信息**
Illegal
service state exception
.
Illegal
StateError, an attempt is made to use an SE session that has been closed
.
**错误描述**
...
...
@@ -28,7 +28,7 @@ SE服务状态异常。
**错误信息**
No
such element exception
.
No
SuchElementError, the AID on the SE is not available or cannot be selected
.
**错误描述**
...
...
@@ -48,7 +48,7 @@ No such element exception.
**错误信息**
Illegal access rule except
ion.
SecurityError, the calling application cannot be granted access to this AID or the default applet on this sess
ion.
**错误描述**
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录