Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
f8ba4bcf
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看板
提交
f8ba4bcf
编写于
6月 27, 2023
作者:
史
史晓晓
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改格式
Signed-off-by:
N
史晓晓
<
shixiaoxiao.30044129@huawei.com
>
上级
64602450
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
25 deletion
+25
-25
zh-cn/application-dev/reference/apis/js-apis-distributedDeviceManager.md
...on-dev/reference/apis/js-apis-distributedDeviceManager.md
+25
-25
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-distributedDeviceManager.md
浏览文件 @
f8ba4bcf
...
...
@@ -28,7 +28,7 @@ import deviceManager from '@ohos.distributedDeviceManager';
## deviceManager.createDeviceManager
createDeviceManager(bundleName: string, callback: AsyncCallback
<
DeviceManager
>
): void
createDeviceManager(bundleName: string, callback: AsyncCallback
<
DeviceManager
>
): void
;
创建一个设备管理器实例。
...
...
@@ -160,7 +160,7 @@ createDeviceManager(bundleName: string, callback: AsyncCallback<DeviceManager
### releaseDeviceManager
releaseDeviceManager(): void
releaseDeviceManager(): void
;
设备管理实例不再使用后,通过该方法释放DeviceManager实例。
...
...
@@ -186,7 +186,7 @@ releaseDeviceManager(): void
### getAvailableDeviceListSync
getAvailableDeviceListSync(): Array
<
DeviceBasicInfo
>
getAvailableDeviceListSync(): Array
<
DeviceBasicInfo
>
;
同步获取所有可信设备列表。
...
...
@@ -218,7 +218,7 @@ getAvailableDeviceListSync(): Array<DeviceBasicInfo>
### getAvailableDeviceList
getAvailableDeviceList(callback:AsyncCallback
<
Array
<
DeviceBasicInfo
>>
): void
getAvailableDeviceList(callback:AsyncCallback
<
Array
<
DeviceBasicInfo
>>
): void
;
获取所有可信设备列表。使用callback异步回调。
...
...
@@ -256,7 +256,7 @@ getAvailableDeviceList(callback:AsyncCallback<Array<DeviceBasicInfo>>
### getAvailableDeviceList
getAvailableDeviceList(): Promise
<
Array
<
DeviceBasicInfo
>>
getAvailableDeviceList(): Promise
<
Array
<
DeviceBasicInfo
>>
;
获取所有可信设备列表。使用Promise异步回调。
...
...
@@ -288,7 +288,7 @@ getAvailableDeviceList(): Promise<Array<DeviceBasicInfo>>
### getLocalDeviceNetworkIdSync
getLocalDeviceNetworkIdSync(): string
getLocalDeviceNetworkIdSync(): string
;
同步获取本地设备网络标识。
...
...
@@ -321,7 +321,7 @@ getLocalDeviceNetworkIdSync(): string
### getLocalDeviceNameSync
getLocalDeviceNameSync(): string
getLocalDeviceNameSync(): string
;
同步获取本地设备名称。
...
...
@@ -354,7 +354,7 @@ getLocalDeviceNameSync(): string
### getLocalDeviceTypeSync
getLocalDeviceTypeSync(): number
getLocalDeviceTypeSync(): number
;
同步获取本地设备类型。
...
...
@@ -387,7 +387,7 @@ getLocalDeviceTypeSync(): number
### getLocalDeviceIdSync
getLocalDeviceIdSync(): string
getLocalDeviceIdSync(): string
;
同步获取本地设备id。
...
...
@@ -547,7 +547,7 @@ startDeviceDiscovery(subscribeId: number, filterOptions?: string): void;
### stopDeviceDiscovery
stopDeviceDiscovery(subscribeId: number): void
stopDeviceDiscovery(subscribeId: number): void
;
停止发现周边设备。
...
...
@@ -581,7 +581,7 @@ stopDeviceDiscovery(subscribeId: number): void
### publishDeviceDiscovery
publishDeviceDiscovery(publishInfo: PublishInfo): void
publishDeviceDiscovery(publishInfo: PublishInfo): void
;
发布设备发现。发布状态持续两分钟,超过两分钟会停止发布。
...
...
@@ -624,7 +624,7 @@ publishDeviceDiscovery(publishInfo: PublishInfo): void
### unPublishDeviceDiscovery
unPublishDeviceDiscovery(publishId: number): void
unPublishDeviceDiscovery(publishId: number): void
;
停止发布设备发现。
...
...
@@ -746,7 +746,7 @@ unbindDevice(deviceId: string): void;
### verifyAuthInfo
verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback
<
{deviceId: string, level: number}
>
): void
verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback
<
{deviceId: string, level: number}
>
): void
;
验证认证信息。
...
...
@@ -1098,7 +1098,7 @@ on(type: 'discoverSuccess', callback: Callback<{ subscribeId: number, device:
off(type: 'discoverSuccess', callback?: Callback
<
{ subscribeId: number, device: DeviceBasicInfo }
>
): void;
取消注册设备发现回调。
取消注册设备发现
成功
回调。
**系统能力**
:SystemCapability.DistributedHardware.DeviceManager
...
...
@@ -1125,7 +1125,7 @@ off(type: 'discoverSuccess', callback?: Callback<{ subscribeId: number, devic
on(type: 'deviceNameChange', callback: Callback
<
{ deviceName: string }
>
): void;
注册设备名称
改变
回调监听。
注册设备名称
变更
回调监听。
**系统能力**
:SystemCapability.DistributedHardware.DeviceManager
...
...
@@ -1152,7 +1152,7 @@ on(type: 'deviceNameChange', callback: Callback<{ deviceName: string }>):
off(type: 'deviceNameChange', callback?: Callback
<
{ deviceName: string }
>
): void;
取消注册设备名称
改变
回调监听。
取消注册设备名称
变更
回调监听。
**系统能力**
:SystemCapability.DistributedHardware.DeviceManager
...
...
@@ -1177,7 +1177,7 @@ off(type: 'deviceNameChange', callback?: Callback<{ deviceName: string }>)
### on('discoverFail')
on(type: 'discoverFail', callback: Callback
<
{ subscribeId: number, reason: number }
>
): void
on(type: 'discoverFail', callback: Callback
<
{ subscribeId: number, reason: number }
>
): void
;
注册设备发现失败回调监听。
...
...
@@ -1204,7 +1204,7 @@ on(type: 'discoverFail', callback: Callback<{ subscribeId: number, reason: nu
### off('discoverFail')
off(type: 'discoverFail', callback?: Callback
<
{ subscribeId: number, reason: number }
>
): void
off(type: 'discoverFail', callback?: Callback
<
{ subscribeId: number, reason: number }
>
): void
;
取消注册设备发现失败回调。
...
...
@@ -1231,9 +1231,9 @@ off(type: 'discoverFail', callback?: Callback<{ subscribeId: number, reason:
### on('publishSuccess')
on(type: 'publishSuccess', callback: Callback
<
{ publishId: number }
>
): void
on(type: 'publishSuccess', callback: Callback
<
{ publishId: number }
>
): void
;
注册发布设备
发现
回调监听。
注册发布设备
成功
回调监听。
**系统能力**
:SystemCapability.DistributedHardware.DeviceManager
...
...
@@ -1260,7 +1260,7 @@ on(type: 'publishSuccess', callback: Callback<{ publishId: number }>): voi
### off('publishSuccess')
off(type: 'publishSuccess', callback?: Callback
<
{ publishId: number }
>
): void
off(type: 'publishSuccess', callback?: Callback
<
{ publishId: number }
>
): void
;
取消注册设备发布成功回调。
...
...
@@ -1289,7 +1289,7 @@ off(type: 'publishSuccess', callback?: Callback<{ publishId: number }>): v
### on('publishFail')
on(type: 'publishFail', callback: Callback
<
{ publishId: number, reason: number }
>
): void
on(type: 'publishFail', callback: Callback
<
{ publishId: number, reason: number }
>
): void
;
注册设备发布失败回调监听。
...
...
@@ -1318,7 +1318,7 @@ on(type: 'publishFail', callback: Callback<{ publishId: number, reason: numbe
### off('publishFail')
off(type: 'publishFail', callback?: Callback
<
{ publishId: number, reason: number }
>
): void
off(type: 'publishFail', callback?: Callback
<
{ publishId: number, reason: number }
>
): void
;
取消注册设备发布失败回调。
...
...
@@ -1347,7 +1347,7 @@ off(type: 'publishFail', callback?: Callback<{ publishId: number, reason: num
### on('serviceDie')
on(type: 'serviceDie', callback: () =
>
void): void
on(type: 'serviceDie', callback: () =
>
void): void
;
注册设备管理服务死亡监听。
...
...
@@ -1374,7 +1374,7 @@ on(type: 'serviceDie', callback: () => void): void
### off('serviceDie')
off(type: 'serviceDie', callback?: () =
>
void): void
off(type: 'serviceDie', callback?: () =
>
void): void
;
取消注册设备管理服务死亡监听。
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录