Instantiates a Puck.js. See EspruinoBleDevice for more info. Online demos
If opts.name is specified, this will the the Bluetooth device sought.
opts.name
import { Espruino } from 'https://unpkg.com/ixfx/dist/io.js'const e = await Espruino.puck({ name:`Puck.js a123` }); Copy
import { Espruino } from 'https://unpkg.com/ixfx/dist/io.js'const e = await Espruino.puck({ name:`Puck.js a123` });
If no name is specified, a list of all devices starting with Puck.js are shown.
Puck.js
To get more control over filtering, pass in opts.filter. opts.name is not used as a filter in this scenario.
opts.filter
import { Espruino } from 'https://unpkg.com/ixfx/dist/io.js'const filters = [ { namePrefix: `Puck.js` }, { namePrefix: `Pixl.js` }, {services: [NordicDefaults.service] }]const e = await Espruino.puck({ filters }); Copy
import { Espruino } from 'https://unpkg.com/ixfx/dist/io.js'const filters = [ { namePrefix: `Puck.js` }, { namePrefix: `Pixl.js` }, {services: [NordicDefaults.service] }]const e = await Espruino.puck({ filters });
Returns a connected instance, or throws exception if user cancelled or could not connect.
Instantiates a Puck.js. See EspruinoBleDevice for more info. Online demos
If
opts.name
is specified, this will the the Bluetooth device sought.If no name is specified, a list of all devices starting with
Puck.js
are shown.To get more control over filtering, pass in
opts.filter
.opts.name
is not used as a filter in this scenario.