提交 efe63882 编写于 作者: M marui

8.23 modify deviceID

Signed-off-by: Nmarui <marui83@huawei.com>
上级 72166ba6
......@@ -798,7 +798,7 @@ inDevices(devices: Array&lt;string&gt;): RdbPredicates
> **说明:**
>
> 其中devices通过调用[deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync)方法得到。deviceManager模块的接口均为系统接口,仅系统应用可用
> 其中devices通过调用[deviceManager.getAvailableDeviceListSync](js-apis-distributedDeviceManager.md#getAvailableDeviceListSync)方法得到。数据库同步时调用Sync接口,需要在入参谓词中调用inDevices接口选择设备。如果不调用inDevices接口即默认连接组网内所有的设备
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core
......@@ -827,9 +827,9 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
return;
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
let devices = dmInstance.getAvailableDeviceListSync();
for (var i = 0; i < devices.length; i++) {
deviceIds[i] = devices[i].deviceId;
deviceIds[i] = devices[i].networkId;
}
})
......@@ -844,6 +844,10 @@ inAllDevices(): RdbPredicates
同步分布式数据库时连接到组网内所有的远程设备。
> **说明:**
>
>如果不调用inAllDevices接口即默认连接组网内所有的远程设备。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core
**返回值**
......@@ -2733,7 +2737,7 @@ remoteQuery(device: string, table: string, predicates: RdbPredicates, columns: A
> **说明:**
>
> 其中device通过调用[deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync)方法得到。deviceManager模块的接口均为系统接口,仅系统应用可用
> 其中device通过调用[deviceManager.getAvailableDeviceListSync](js-apis-distributedDeviceManager.md#getAvailableDeviceListSync)方法得到
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core
......@@ -2768,8 +2772,8 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
return;
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
deviceId = devices[0].deviceId;
let devices = dmInstance.getAvailableDeviceListSync();
deviceId = devices[0].networkId;
})
let predicates = new relationalStore.RdbPredicates('EMPLOYEE');
......@@ -2803,7 +2807,7 @@ remoteQuery(device: string, table: string, predicates: RdbPredicates, columns: A
> **说明:**
>
> 其中device通过调用[deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync)方法得到。deviceManager模块的接口均为系统接口,仅系统应用可用
> 其中device通过调用[deviceManager.getAvailableDeviceListSync](js-apis-distributedDeviceManager.md#getAvailableDeviceListSync)方法得到
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core
......@@ -2843,8 +2847,8 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
return;
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
deviceId = devices[0].deviceId;
let devices = dmInstance.getAvailableDeviceListSync();
deviceId = devices[0].networkId;
})
let predicates = new relationalStore.RdbPredicates('EMPLOYEE');
......@@ -3684,7 +3688,7 @@ obtainDistributedTableName(device: string, table: string, callback: AsyncCallbac
> **说明:**
>
> 其中device通过调用[deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync)方法得到。deviceManager模块的接口均为系统接口,仅系统应用可用
> 其中device通过调用[deviceManager.getAvailableDeviceListSync](js-apis-distributedDeviceManager.md#getAvailableDeviceListSync)方法得到
**需要权限:** ohos.permission.DISTRIBUTED_DATASYNC
......@@ -3719,8 +3723,8 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
return;
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
deviceId = devices[0].deviceId;
let devices = dmInstance.getAvailableDeviceListSync();
deviceId = devices[0].networkId;
})
store.obtainDistributedTableName(deviceId, "EMPLOYEE", function (err, tableName) {
......@@ -3740,7 +3744,7 @@ store.obtainDistributedTableName(deviceId, "EMPLOYEE", function (err, tableName)
> **说明:**
>
> 其中device通过调用[deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync)方法得到。deviceManager模块的接口均为系统接口,仅系统应用可用
> 其中device通过调用[deviceManager.getAvailableDeviceListSync](js-apis-distributedDeviceManager.md#getAvailableDeviceListSync)方法得到
**需要权限:** ohos.permission.DISTRIBUTED_DATASYNC
......@@ -3780,8 +3784,8 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
return;
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
deviceId = devices[0].deviceId;
let devices = dmInstance.getAvailableDeviceListSync();
deviceId = devices[0].networkId;
})
let promise = store.obtainDistributedTableName(deviceId, "EMPLOYEE");
......@@ -3831,9 +3835,9 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
return;
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
let devices = dmInstance.getAvailableDeviceListSync();
for (var i = 0; i < devices.length; i++) {
deviceIds[i] = devices[i].deviceId;
deviceIds[i] = devices[i].networkId;
}
})
......@@ -3895,9 +3899,9 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
return;
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
let devices = dmInstance.getAvailableDeviceListSync();
for (var i = 0; i < devices.length; i++) {
deviceIds[i] = devices[i].deviceId;
deviceIds[i] = devices[i].networkId;
}
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册