本文整理汇总了TypeScript中buttplug.ButtplugClient.StopScanning方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ButtplugClient.StopScanning方法的具体用法?TypeScript ButtplugClient.StopScanning怎么用?TypeScript ButtplugClient.StopScanning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类buttplug.ButtplugClient
的用法示例。
在下文中一共展示了ButtplugClient.StopScanning方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("should connect insecurely to itself, scan, find test devices", async function() {
const deviceManager = new TestDeviceSubtypeManager();
_server.AddDeviceManager(deviceManager);
// Insecure hosting, on 127.0.0.1:_port
_server.StartInsecureServer(_port, "127.0.0.1");
const bpc = new ButtplugClient("test");
await bpc.Connect(_insecureConnector);
let res;
let rej;
let p = new Promise((resolve, reject) => { res = resolve; rej = reject; });
bpc.on("deviceadded", () => {
res();
});
await bpc.StartScanning();
await p;
await bpc.StopScanning();
p = new Promise((resolve, reject) => { res = resolve; rej = reject; });
bpc.on("scanningfinished", () => {
res();
});
await p;
p = new Promise((resolve, reject) => { res = resolve; rej = reject; });
bpc.on("deviceremoved", async () => {
await bpc.Disconnect();
res();
});
deviceManager.VibrationDevice.Disconnect();
return p;
});