Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
b2aefd2f
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b2aefd2f
编写于
3月 23, 2023
作者:
D
dingxiaochen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix docs.
Signed-off-by:
N
dingxiaochen
<
dingxiaochen@huawei.com
>
上级
bdd128ef
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
927 addition
and
368 deletion
+927
-368
zh-cn/application-dev/reference/apis/js-apis-call.md
zh-cn/application-dev/reference/apis/js-apis-call.md
+333
-177
zh-cn/application-dev/reference/apis/js-apis-observer.md
zh-cn/application-dev/reference/apis/js-apis-observer.md
+70
-36
zh-cn/application-dev/reference/apis/js-apis-radio.md
zh-cn/application-dev/reference/apis/js-apis-radio.md
+151
-41
zh-cn/application-dev/reference/apis/js-apis-sim.md
zh-cn/application-dev/reference/apis/js-apis-sim.md
+226
-62
zh-cn/application-dev/reference/apis/js-apis-sms.md
zh-cn/application-dev/reference/apis/js-apis-sms.md
+99
-32
zh-cn/application-dev/reference/apis/js-apis-telephony-data.md
.../application-dev/reference/apis/js-apis-telephony-data.md
+48
-20
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-call.md
浏览文件 @
b2aefd2f
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/apis/js-apis-observer.md
浏览文件 @
b2aefd2f
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/apis/js-apis-radio.md
浏览文件 @
b2aefd2f
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/apis/js-apis-sim.md
浏览文件 @
b2aefd2f
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/apis/js-apis-sms.md
浏览文件 @
b2aefd2f
...
@@ -91,6 +91,19 @@ sendMessage(options: SendMessageOptions): void
...
@@ -91,6 +91,19 @@ sendMessage(options: SendMessageOptions): void
| ------- | ----------------------------------------- | ---- | ------------------------------------------------------------ |
| ------- | ----------------------------------------- | ---- | ------------------------------------------------------------ |
| options |
[
SendMessageOptions
](
#sendmessageoptions
)
| 是 | 发送短信的参数和回调,参考
[
SendMessageOptions
](
#sendmessageoptions
)
。 |
| options |
[
SendMessageOptions
](
#sendmessageoptions
)
| 是 | 发送短信的参数和回调,参考
[
SendMessageOptions
](
#sendmessageoptions
)
。 |
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300003 | System internal error. |
| 8300999 | Unknown error code. |
**示例:**
**示例:**
```
js
```
js
...
@@ -179,6 +192,8 @@ setDefaultSmsSlotId\(slotId: number, callback: AsyncCallback<void>\): void
...
@@ -179,6 +192,8 @@ setDefaultSmsSlotId\(slotId: number, callback: AsyncCallback<void>\): void
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -192,8 +207,8 @@ setDefaultSmsSlotId\(slotId: number, callback: AsyncCallback<void>\): void
...
@@ -192,8 +207,8 @@ setDefaultSmsSlotId\(slotId: number, callback: AsyncCallback<void>\): void
**示例:**
**示例:**
```
js
```
js
sms
.
setDefaultSmsSlotId
(
0
,
(
err
,
data
)
=>
{
sms
.
setDefaultSmsSlotId
(
0
,
(
err
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
.
`
);
});
});
```
```
...
@@ -224,6 +239,8 @@ setDefaultSmsSlotId\(slotId: number\): Promise<void>
...
@@ -224,6 +239,8 @@ setDefaultSmsSlotId\(slotId: number\): Promise<void>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -238,9 +255,9 @@ setDefaultSmsSlotId\(slotId: number\): Promise<void>
...
@@ -238,9 +255,9 @@ setDefaultSmsSlotId\(slotId: number\): Promise<void>
```
js
```
js
let
promise
=
sms
.
setDefaultSmsSlotId
(
0
);
let
promise
=
sms
.
setDefaultSmsSlotId
(
0
);
promise
.
then
(
data
=>
{
promise
.
then
(
()
=>
{
console
.
log
(
`setDefaultSmsSlotId success
, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`setDefaultSmsSlotId success
.
`
);
}).
catch
(
err
=>
{
}).
catch
(
(
err
)
=>
{
console
.
error
(
`setDefaultSmsSlotId failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`setDefaultSmsSlotId failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -267,6 +284,8 @@ setSmscAddr\(slotId: number, smscAddr: string, callback: AsyncCallback<void\>\):
...
@@ -267,6 +284,8 @@ setSmscAddr\(slotId: number, smscAddr: string, callback: AsyncCallback<void\>\):
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -281,8 +300,8 @@ setSmscAddr\(slotId: number, smscAddr: string, callback: AsyncCallback<void\>\):
...
@@ -281,8 +300,8 @@ setSmscAddr\(slotId: number, smscAddr: string, callback: AsyncCallback<void\>\):
```
js
```
js
let
slotId
=
0
;
let
slotId
=
0
;
let
smscAddr
=
'
+861xxxxxxxxxx
'
;
let
smscAddr
=
'
+861xxxxxxxxxx
'
;
sms
.
setSmscAddr
(
slotId
,
smscAddr
,
(
err
,
data
)
=>
{
sms
.
setSmscAddr
(
slotId
,
smscAddr
,
(
err
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -314,6 +333,8 @@ setSmscAddr\(slotId: number, smscAddr: string\): Promise\<void\>
...
@@ -314,6 +333,8 @@ setSmscAddr\(slotId: number, smscAddr: string\): Promise\<void\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -329,9 +350,9 @@ setSmscAddr\(slotId: number, smscAddr: string\): Promise\<void\>
...
@@ -329,9 +350,9 @@ setSmscAddr\(slotId: number, smscAddr: string\): Promise\<void\>
let
slotId
=
0
;
let
slotId
=
0
;
let
smscAddr
=
'
+861xxxxxxxxxx
'
;
let
smscAddr
=
'
+861xxxxxxxxxx
'
;
let
promise
=
sms
.
setSmscAddr
(
slotId
,
smscAddr
);
let
promise
=
sms
.
setSmscAddr
(
slotId
,
smscAddr
);
promise
.
then
(
data
=>
{
promise
.
then
(
()
=>
{
console
.
log
(
`setSmscAddr success
, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`setSmscAddr success
.
`
);
}).
catch
(
err
=>
{
}).
catch
(
(
err
)
=>
{
console
.
error
(
`setSmscAddr failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`setSmscAddr failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -358,6 +379,8 @@ getSmscAddr\(slotId: number, callback: AsyncCallback<string\>\): void
...
@@ -358,6 +379,8 @@ getSmscAddr\(slotId: number, callback: AsyncCallback<string\>\): void
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -403,6 +426,8 @@ getSmscAddr\(slotId: number\): Promise<string\>
...
@@ -403,6 +426,8 @@ getSmscAddr\(slotId: number\): Promise<string\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -464,6 +489,8 @@ splitMessage(content: string, callback: AsyncCallback<Array<string\>>): void
...
@@ -464,6 +489,8 @@ splitMessage(content: string, callback: AsyncCallback<Array<string\>>): void
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -509,6 +536,8 @@ splitMessage(content: string): Promise<Array<string\>>
...
@@ -509,6 +536,8 @@ splitMessage(content: string): Promise<Array<string\>>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -551,6 +580,8 @@ addSimMessage(options: SimMessageOptions, callback: AsyncCallback<void\>): void
...
@@ -551,6 +580,8 @@ addSimMessage(options: SimMessageOptions, callback: AsyncCallback<void\>): void
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -569,8 +600,8 @@ let simMessageOptions = {
...
@@ -569,8 +600,8 @@ let simMessageOptions = {
pdu
:
"
xxxxxx
"
,
pdu
:
"
xxxxxx
"
,
status
:
sms
.
SimMessageStatus
.
SIM_MESSAGE_STATUS_READ
status
:
sms
.
SimMessageStatus
.
SIM_MESSAGE_STATUS_READ
};
};
sms
.
addSimMessage
(
simMessageOptions
,
(
err
,
data
)
=>
{
sms
.
addSimMessage
(
simMessageOptions
,
(
err
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -601,6 +632,8 @@ addSimMessage(options: SimMessageOptions): Promise<void\>
...
@@ -601,6 +632,8 @@ addSimMessage(options: SimMessageOptions): Promise<void\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -620,9 +653,9 @@ let simMessageOptions = {
...
@@ -620,9 +653,9 @@ let simMessageOptions = {
status
:
sms
.
SimMessageStatus
.
SIM_MESSAGE_STATUS_READ
status
:
sms
.
SimMessageStatus
.
SIM_MESSAGE_STATUS_READ
};
};
let
promise
=
sms
.
addSimMessage
(
simMessageOptions
);
let
promise
=
sms
.
addSimMessage
(
simMessageOptions
);
promise
.
then
(
data
=>
{
promise
.
then
(
()
=>
{
console
.
log
(
`addSimMessage success
, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`addSimMessage success
.
`
);
}).
catch
(
err
=>
{
}).
catch
(
(
err
)
=>
{
console
.
error
(
`addSimMessage failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`addSimMessage failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -649,6 +682,8 @@ delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void\>):
...
@@ -649,6 +682,8 @@ delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void\>):
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -663,8 +698,8 @@ delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void\>):
...
@@ -663,8 +698,8 @@ delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void\>):
```
js
```
js
let
slotId
=
0
;
let
slotId
=
0
;
let
msgIndex
=
1
;
let
msgIndex
=
1
;
sms
.
delSimMessage
(
slotId
,
msgIndex
,
(
err
,
data
)
=>
{
sms
.
delSimMessage
(
slotId
,
msgIndex
,
(
err
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -696,6 +731,8 @@ delSimMessage(slotId: number, msgIndex: number): Promise<void\>
...
@@ -696,6 +731,8 @@ delSimMessage(slotId: number, msgIndex: number): Promise<void\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -711,9 +748,9 @@ delSimMessage(slotId: number, msgIndex: number): Promise<void\>
...
@@ -711,9 +748,9 @@ delSimMessage(slotId: number, msgIndex: number): Promise<void\>
let
slotId
=
0
;
let
slotId
=
0
;
let
msgIndex
=
1
;
let
msgIndex
=
1
;
let
promise
=
sms
.
delSimMessage
(
slotId
,
msgIndex
);
let
promise
=
sms
.
delSimMessage
(
slotId
,
msgIndex
);
promise
.
then
(
data
=>
{
promise
.
then
(
()
=>
{
console
.
log
(
`delSimMessage success
, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`delSimMessage success
.
`
);
}).
catch
(
err
=>
{
}).
catch
(
(
err
)
=>
{
console
.
error
(
`delSimMessage failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`delSimMessage failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -739,6 +776,8 @@ updateSimMessage(options: UpdateSimMessageOptions, callback: AsyncCallback<void\
...
@@ -739,6 +776,8 @@ updateSimMessage(options: UpdateSimMessageOptions, callback: AsyncCallback<void\
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -758,8 +797,8 @@ let updateSimMessageOptions = {
...
@@ -758,8 +797,8 @@ let updateSimMessageOptions = {
pdu
:
"
xxxxxxx
"
,
pdu
:
"
xxxxxxx
"
,
smsc
:
"
test
"
smsc
:
"
test
"
};
};
sms
.
updateSimMessage
(
updateSimMessageOptions
,
(
err
,
data
)
=>
{
sms
.
updateSimMessage
(
updateSimMessageOptions
,
(
err
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -790,6 +829,8 @@ updateSimMessage(options: UpdateSimMessageOptions): Promise<void\>
...
@@ -790,6 +829,8 @@ updateSimMessage(options: UpdateSimMessageOptions): Promise<void\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -810,9 +851,9 @@ let updateSimMessageOptions = {
...
@@ -810,9 +851,9 @@ let updateSimMessageOptions = {
smsc
:
"
test
"
smsc
:
"
test
"
};
};
let
promise
=
sms
.
updateSimMessage
(
updateSimMessageOptions
);
let
promise
=
sms
.
updateSimMessage
(
updateSimMessageOptions
);
promise
.
then
(
data
=>
{
promise
.
then
(
()
=>
{
console
.
log
(
`updateSimMessage success
, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`updateSimMessage success
.
`
);
}).
catch
(
err
=>
{
}).
catch
(
(
err
)
=>
{
console
.
error
(
`updateSimMessage failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`updateSimMessage failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -838,6 +879,8 @@ getAllSimMessages(slotId: number, callback: AsyncCallback<Array<SimShortMessage\
...
@@ -838,6 +879,8 @@ getAllSimMessages(slotId: number, callback: AsyncCallback<Array<SimShortMessage\
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -883,6 +926,8 @@ getAllSimMessages(slotId: number): Promise<Array<SimShortMessage\>>
...
@@ -883,6 +926,8 @@ getAllSimMessages(slotId: number): Promise<Array<SimShortMessage\>>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -925,6 +970,8 @@ setCBConfig(options: CBConfigOptions, callback: AsyncCallback<void\>): void
...
@@ -925,6 +970,8 @@ setCBConfig(options: CBConfigOptions, callback: AsyncCallback<void\>): void
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -944,8 +991,8 @@ let cbConfigOptions = {
...
@@ -944,8 +991,8 @@ let cbConfigOptions = {
endMessageId
:
200
,
endMessageId
:
200
,
ranType
:
sms
.
RanType
.
TYPE_GSM
ranType
:
sms
.
RanType
.
TYPE_GSM
};
};
sms
.
setCBConfig
(
cbConfigOptions
,
(
err
,
data
)
=>
{
sms
.
setCBConfig
(
cbConfigOptions
,
(
err
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -976,6 +1023,8 @@ setCBConfig(options: CBConfigOptions): Promise<void\>
...
@@ -976,6 +1023,8 @@ setCBConfig(options: CBConfigOptions): Promise<void\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -996,9 +1045,9 @@ let cbConfigOptions = {
...
@@ -996,9 +1045,9 @@ let cbConfigOptions = {
ranType
:
sms
.
RanType
.
TYPE_GSM
ranType
:
sms
.
RanType
.
TYPE_GSM
};
};
let
promise
=
sms
.
setCBConfig
(
cbConfigOptions
);
let
promise
=
sms
.
setCBConfig
(
cbConfigOptions
);
promise
.
then
(
data
=>
{
promise
.
then
(
()
=>
{
console
.
log
(
`setCBConfig success
, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`setCBConfig success
.
`
);
}).
catch
(
err
=>
{
}).
catch
(
(
err
)
=>
{
console
.
error
(
`setCBConfig failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`setCBConfig failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -1024,6 +1073,8 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean, callback
...
@@ -1024,6 +1073,8 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean, callback
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 401 | Parameter error. |
...
@@ -1068,6 +1119,8 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean): Promise
...
@@ -1068,6 +1119,8 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean): Promise
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 401 | Parameter error. |
...
@@ -1107,6 +1160,8 @@ isImsSmsSupported(slotId: number, callback: AsyncCallback<boolean\>): void
...
@@ -1107,6 +1160,8 @@ isImsSmsSupported(slotId: number, callback: AsyncCallback<boolean\>): void
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 401 | Parameter error. |
...
@@ -1149,6 +1204,8 @@ isImsSmsSupported(slotId: number): Promise<boolean\>
...
@@ -1149,6 +1204,8 @@ isImsSmsSupported(slotId: number): Promise<boolean\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 401 | Parameter error. |
...
@@ -1187,9 +1244,10 @@ getImsShortMessageFormat(callback: AsyncCallback<string\>): void
...
@@ -1187,9 +1244,10 @@ getImsShortMessageFormat(callback: AsyncCallback<string\>): void
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300002 | Operation failed. Cannot connect to service. |
...
@@ -1223,9 +1281,10 @@ getImsShortMessageFormat(): Promise<string\>
...
@@ -1223,9 +1281,10 @@ getImsShortMessageFormat(): Promise<string\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 401 | Parameter error. |
| 401 | Parameter error. |
| 8300001 | Invalid parameter value. |
| 8300001 | Invalid parameter value. |
| 8300002 | Operation failed. Cannot connect to service. |
| 8300002 | Operation failed. Cannot connect to service. |
...
@@ -1262,6 +1321,8 @@ decodeMms(mmsFilePathName: string | Array<number\>, callback: AsyncCallback<MmsI
...
@@ -1262,6 +1321,8 @@ decodeMms(mmsFilePathName: string | Array<number\>, callback: AsyncCallback<MmsI
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 401 | Parameter error. |
...
@@ -1304,6 +1365,8 @@ decodeMms(mmsFilePathName: string | Array<number\>): Promise<MmsInformation\>
...
@@ -1304,6 +1365,8 @@ decodeMms(mmsFilePathName: string | Array<number\>): Promise<MmsInformation\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 401 | Parameter error. |
...
@@ -1343,6 +1406,8 @@ encodeMms(mms: MmsInformation, callback: AsyncCallback<Array<number\>>): void
...
@@ -1343,6 +1406,8 @@ encodeMms(mms: MmsInformation, callback: AsyncCallback<Array<number\>>): void
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 401 | Parameter error. |
...
@@ -1393,6 +1458,8 @@ encodeMms(mms: MmsInformation): Promise<Array<number\>>
...
@@ -1393,6 +1458,8 @@ encodeMms(mms: MmsInformation): Promise<Array<number\>>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 401 | Parameter error. |
| 401 | Parameter error. |
...
...
zh-cn/application-dev/reference/apis/js-apis-telephony-data.md
浏览文件 @
b2aefd2f
...
@@ -100,6 +100,8 @@ setDefaultCellularDataSlotId(slotId: number, callback: AsyncCallback\<void\>): v
...
@@ -100,6 +100,8 @@ setDefaultCellularDataSlotId(slotId: number, callback: AsyncCallback\<void\>): v
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -114,8 +116,8 @@ setDefaultCellularDataSlotId(slotId: number, callback: AsyncCallback\<void\>): v
...
@@ -114,8 +116,8 @@ setDefaultCellularDataSlotId(slotId: number, callback: AsyncCallback\<void\>): v
**示例:**
**示例:**
```
js
```
js
data
.
setDefaultCellularDataSlotId
(
0
,
(
err
,
data
)
=>
{
data
.
setDefaultCellularDataSlotId
(
0
,
(
err
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
.
`
);
});
});
```
```
...
@@ -145,6 +147,8 @@ setDefaultCellularDataSlotId(slotId: number): Promise\<void\>
...
@@ -145,6 +147,8 @@ setDefaultCellularDataSlotId(slotId: number): Promise\<void\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -160,8 +164,8 @@ setDefaultCellularDataSlotId(slotId: number): Promise\<void\>
...
@@ -160,8 +164,8 @@ setDefaultCellularDataSlotId(slotId: number): Promise\<void\>
```
js
```
js
let
promise
=
data
.
setDefaultCellularDataSlotId
(
0
);
let
promise
=
data
.
setDefaultCellularDataSlotId
(
0
);
promise
.
then
((
data
)
=>
{
promise
.
then
(()
=>
{
console
.
log
(
`setDefaultCellularDataSlotId success
, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`setDefaultCellularDataSlotId success
.
`
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
`setDefaultCellularDataSlotId fail, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`setDefaultCellularDataSlotId fail, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
...
@@ -279,6 +283,8 @@ isCellularDataEnabled(callback: AsyncCallback\<boolean\>): void
...
@@ -279,6 +283,8 @@ isCellularDataEnabled(callback: AsyncCallback\<boolean\>): void
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -314,6 +320,8 @@ isCellularDataEnabled(): Promise\<boolean\>
...
@@ -314,6 +320,8 @@ isCellularDataEnabled(): Promise\<boolean\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -353,6 +361,8 @@ isCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback\<boolean\>)
...
@@ -353,6 +361,8 @@ isCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback\<boolean\>)
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -394,6 +404,8 @@ isCellularDataRoamingEnabled(slotId: number): Promise\<boolean\>
...
@@ -394,6 +404,8 @@ isCellularDataRoamingEnabled(slotId: number): Promise\<boolean\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -434,6 +446,8 @@ enableCellularData(callback: AsyncCallback<void\>): void
...
@@ -434,6 +446,8 @@ enableCellularData(callback: AsyncCallback<void\>): void
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -446,8 +460,8 @@ enableCellularData(callback: AsyncCallback<void\>): void
...
@@ -446,8 +460,8 @@ enableCellularData(callback: AsyncCallback<void\>): void
**示例:**
**示例:**
```
js
```
js
data
.
enableCellularData
((
err
,
data
)
=>
{
data
.
enableCellularData
((
err
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -471,6 +485,8 @@ enableCellularData(): Promise<void\>
...
@@ -471,6 +485,8 @@ enableCellularData(): Promise<void\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -484,8 +500,8 @@ enableCellularData(): Promise<void\>
...
@@ -484,8 +500,8 @@ enableCellularData(): Promise<void\>
```
js
```
js
let
promise
=
data
.
enableCellularData
();
let
promise
=
data
.
enableCellularData
();
promise
.
then
((
data
)
=>
{
promise
.
then
(()
=>
{
console
.
log
(
`enableCellularData success
, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`enableCellularData success
.
`
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
`enableCellularData fail, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`enableCellularData fail, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
...
@@ -511,6 +527,8 @@ disableCellularData(callback: AsyncCallback<void\>): void
...
@@ -511,6 +527,8 @@ disableCellularData(callback: AsyncCallback<void\>): void
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -523,8 +541,8 @@ disableCellularData(callback: AsyncCallback<void\>): void
...
@@ -523,8 +541,8 @@ disableCellularData(callback: AsyncCallback<void\>): void
**示例:**
**示例:**
```
js
```
js
data
.
disableCellularData
((
err
,
data
)
=>
{
data
.
disableCellularData
((
err
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -548,6 +566,8 @@ disableCellularData(): Promise<void\>
...
@@ -548,6 +566,8 @@ disableCellularData(): Promise<void\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -561,8 +581,8 @@ disableCellularData(): Promise<void\>
...
@@ -561,8 +581,8 @@ disableCellularData(): Promise<void\>
```
js
```
js
let
promise
=
data
.
disableCellularData
();
let
promise
=
data
.
disableCellularData
();
promise
.
then
((
data
)
=>
{
promise
.
then
(()
=>
{
console
.
log
(
`disableCellularData success
, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`disableCellularData success
.
`
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
`disableCellularData fail, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`disableCellularData fail, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
...
@@ -589,6 +609,8 @@ enableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
...
@@ -589,6 +609,8 @@ enableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -601,8 +623,8 @@ enableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
...
@@ -601,8 +623,8 @@ enableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
**示例:**
**示例:**
```
js
```
js
data
.
enableCellularDataRoaming
(
0
,
(
err
,
data
)
=>
{
data
.
enableCellularDataRoaming
(
0
,
(
err
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -632,6 +654,8 @@ enableCellularDataRoaming(slotId: number): Promise<void\>
...
@@ -632,6 +654,8 @@ enableCellularDataRoaming(slotId: number): Promise<void\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -645,8 +669,8 @@ enableCellularDataRoaming(slotId: number): Promise<void\>
...
@@ -645,8 +669,8 @@ enableCellularDataRoaming(slotId: number): Promise<void\>
```
js
```
js
let
promise
=
data
.
enableCellularDataRoaming
(
0
);
let
promise
=
data
.
enableCellularDataRoaming
(
0
);
promise
.
then
((
data
)
=>
{
promise
.
then
(()
=>
{
console
.
log
(
`enableCellularDataRoaming success
, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`enableCellularDataRoaming success
.
`
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
`enableCellularDataRoaming fail, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`enableCellularDataRoaming fail, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
...
@@ -673,6 +697,8 @@ disableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
...
@@ -673,6 +697,8 @@ disableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -685,8 +711,8 @@ disableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
...
@@ -685,8 +711,8 @@ disableCellularDataRoaming(slotId: number, callback: AsyncCallback<void\>): void
**示例:**
**示例:**
```
js
```
js
data
.
disableCellularDataRoaming
(
0
,
(
err
,
data
)
=>
{
data
.
disableCellularDataRoaming
(
0
,
(
err
)
=>
{
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
, data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`callback: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
```
```
...
@@ -716,6 +742,8 @@ disableCellularDataRoaming(slotId: number): Promise<void\>
...
@@ -716,6 +742,8 @@ disableCellularDataRoaming(slotId: number): Promise<void\>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
ohos.telephony(电话子系统)错误码
](
../../reference/errorcodes/errorcode-telephony.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | -------------------------------------------- |
| -------- | -------------------------------------------- |
| 201 | Permission denied. |
| 201 | Permission denied. |
...
@@ -729,8 +757,8 @@ disableCellularDataRoaming(slotId: number): Promise<void\>
...
@@ -729,8 +757,8 @@ disableCellularDataRoaming(slotId: number): Promise<void\>
```
js
```
js
let
promise
=
data
.
disableCellularDataRoaming
(
0
);
let
promise
=
data
.
disableCellularDataRoaming
(
0
);
promise
.
then
((
data
)
=>
{
promise
.
then
(()
=>
{
console
.
log
(
`disableCellularDataRoaming success
, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`disableCellularDataRoaming success
.
`
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
`disableCellularDataRoaming fail, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
console
.
error
(
`disableCellularDataRoaming fail, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录