Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
3e67c30b
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
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看板
提交
3e67c30b
编写于
6月 07, 2023
作者:
Z
zha wei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
description:code style fix
Signed-off-by:
N
zha wei
<
zhawei@kaihong.com
>
上级
1c07a8eb
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
174 addition
and
179 deletion
+174
-179
zh-cn/application-dev/reference/apis/js-apis-secureElement.md
...n/application-dev/reference/apis/js-apis-secureElement.md
+174
-179
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-secureElement.md
浏览文件 @
3e67c30b
...
...
@@ -62,16 +62,15 @@ import secureElement from '@ohos.secureElement';
@
State
nfcSEService
:
secureElement
.
SEService
=
null
;
this
.
result
=
"
获取SEService结果:
"
;
try
{
this
.
nfcSEService
=
secureElement
.
newSEService
(
"
serviceState
"
,
(
state
)
=>
{
try
{
this
.
nfcSEService
=
secureElement
.
newSEService
(
"
serviceState
"
,
(
state
)
=>
{
if
(
state
==
secureElement
.
ServiceState
.
DISCONNECTED
)
{
this
.
result
=
"
Service state is Disconnected
"
;
}
else
{
this
.
result
=
"
Service state is connected
"
;
}
}
);
});
}
catch
(
e
)
{
this
.
result
+=
"
newSEService出现异常:
"
+
e
.
message
;
}
...
...
@@ -109,16 +108,14 @@ import secureElement from '@ohos.secureElement';
@
State
nfcOmaReader
:
secureElement
.
Reader
=
null
;
// get SEService
try
{
try
{
this
.
nfcSEService
=
secureElement
.
newSEService
(
"
serviceState
"
,
(
state
)
=>
{
if
(
state
==
secureElement
.
ServiceState
.
DISCONNECTED
)
{
this
.
result
=
"
Service state is Disconnected
"
;
}
else
{
this
.
result
=
"
Service state is connected
"
;
}
}
);
});
}
catch
(
e
)
{
this
.
result
+=
"
newSEService出现异常:
"
+
e
.
message
;
}
...
...
@@ -418,9 +415,9 @@ try {
// this.nfcOmaReader有效的Reader,获取方式参考SEService.getReaders
this
.
nfcOmaReader
.
closeSessions
();
this
.
result
=
"
关闭Sessions成功
"
;
}
catch
(
e
)
{
}
catch
(
e
)
{
this
.
result
=
"
closeSessions 异常:
"
+
e
.
message
;
}
}
```
## Session.getReader
...
...
@@ -688,13 +685,13 @@ import secureElement from '@ohos.secureElement';
try
{
// this.nfcOmaSession:有效的Session,获取方式参考Reader.openSession
let
getPromise
=
this
.
nfcOmaSession
.
openBasicChannel
(
this
.
aidArray
)
let
getPromise
=
this
.
nfcOmaSession
.
openBasicChannel
(
this
.
aidArray
)
;
getPromise
.
then
((
channel
)
=>
{
this
.
nfcOmaChannel
=
channel
;
this
.
result
=
"
openBasicChannel1获取channel成功
"
;
}).
catch
((
err
)
=>
{
this
.
result
=
"
openBasicChannel1出现异常:
"
+
err
.
meesage
;
})
})
;
}
catch
(
e
)
{
this
.
result
=
"
OpenBasicChannel1出现异常:
"
+
e
.
message
;
}
...
...
@@ -754,8 +751,7 @@ try {
}
this
.
nfcOmaChannel
=
data
;
this
.
result
=
"
openBasicChannel2获取channel成功
"
;
}
)
});
}
catch
(
e
)
{
this
.
result
=
"
openBasicChannel2出现异常:
"
+
e
.
message
;
}
...
...
@@ -815,7 +811,7 @@ try {
this
.
result
=
"
openBasicChannel3 获取channel成功
"
;
}).
catch
((
err
)
=>
{
this
.
result
=
"
openBasicChannel3 出现异常
"
;
})
})
;
}
catch
(
e
)
{
this
.
result
=
"
openBasicChannel3出现异常:
"
+
e
.
message
;
}
...
...
@@ -877,7 +873,7 @@ try {
}
this
.
nfcOmaChannel
=
data
;
this
.
result
=
"
openBasicChannel4获取channel成功
"
;
})
});
}
catch
(
e
)
{
this
.
result
=
"
openBasicChannel4异常:
"
+
e
.
message
;
}
...
...
@@ -935,7 +931,7 @@ try {
this
.
result
=
"
openLogicChannel1获取channel成功
"
;
}).
catch
((
err
)
=>
{
this
.
result
=
"
openLogicChannel1出现异常:
"
+
err
.
code
;
})
});
}
catch
(
e
)
{
this
.
result
=
"
openLogicChannel1出现异常:
"
+
e
.
message
;
}
...
...
@@ -984,7 +980,7 @@ import secureElement from '@ohos.secureElement';
@
State
result
:
string
=
''
@
State
nfcOmaSession
:
secureElement
.
Session
=
null
;
@
State
nfcOmaChannel
:
secureElement
.
Channel
=
null
;
aidArray
:
number
[]
=
[
720
,
1080
]
aidArray
:
number
[]
=
[
720
,
1080
]
;
try
{
// this.nfcOmaSession:有效的Session,获取方式参考Reader.openSession
...
...
@@ -995,7 +991,7 @@ try {
}
this
.
nfcOmaChannel
=
data
;
this
.
result
=
"
openLogicChannel2获取channel成功
"
;
})
});
}
catch
(
e
)
{
this
.
result
=
"
openLogicChannel2 异常:
"
+
e
.
message
;
}
...
...
@@ -1062,7 +1058,7 @@ if (this.nfcOmaSession) {
this
.
result
=
"
openLogicChannel3获取channel成功
"
;
}).
catch
((
err
)
=>
{
this
.
result
=
"
openLogicChannel3 出现异常
"
;
})
})
;
}
catch
(
e
)
{
this
.
result
=
"
openLogicChannel3出现异常:
"
+
e
.
message
;
}
...
...
@@ -1213,8 +1209,7 @@ try {
// this.nfcOmaChannel:获取方式参考Session.openBasicChannel
this
.
nfcOmaChannel
.
close
();
this
.
result
=
"
channel close成功
"
;
}
catch
(
e
)
{
}
catch
(
e
)
{
this
.
result
=
"
channel close异常:
"
+
e
.
message
;
}
```
...
...
@@ -1292,7 +1287,7 @@ import secureElement from '@ohos.secureElement';
try
{
// this.nfcOmaChannel:获取方式参考Session.openBasicChannel
let
ret
=
this
.
nfcOmaChannel
.
isClosed
()
let
ret
=
this
.
nfcOmaChannel
.
isClosed
();
if
(
ret
)
{
this
.
result
=
"
channel isClosed TRUE
"
;
}
else
{
...
...
@@ -1402,7 +1397,7 @@ try {
this
.
result
+=
"
"
;
}
this
.
result
+=
"
]
"
;
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
this
.
result
=
"
transmit1出现异常:
"
+
err
.
code
;
})
}
catch
(
e
)
{
...
...
@@ -1466,7 +1461,7 @@ try {
this
.
result
+=
"
"
;
}
this
.
result
+=
"
]
"
;
})
})
;
}
catch
(
e
)
{
this
.
result
=
"
transit2 调用异常:
"
+
e
.
message
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录