MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / scan

Function scan

examples/js/networkpromises/main.js:50–61  ·  view source on GitHub ↗
(dictionary = {})

Source from the content-addressed store, hash-verified

48}
49
50function scan(dictionary = {}) {
51 return new Promise((resolve /*, reject */) => {
52 let result = [];
53 WiFi.scan(dictionary, item => {
54 if (!item)
55 resolve(result);
56 else if (!result.find(value => item.ssid == value))
57 result.push(item.ssid);
58
59 });
60 });
61}
62
63scan().then(result => result.forEach(name => trace(name, "\n")));
64

Callers 1

main.jsFile · 0.70

Calls 4

findMethod · 0.80
resolveFunction · 0.70
scanMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected