Knotenbindungen für Bossa, das Open Source Atmel Sam-Ba DFU-Dienstprogramm.
Derzeit nur an macOS arbeiten. Andere Plattformen kommen bald.
yarn add bossajs
Oder aus Quelle:
git submodule update --init
yarn rebuild
Nur win32 wird unterstützt.
Als Superuser installieren Sie Python- und MSVS -Build -Tools:
npm install --global --production windows-build-tools
Erstellen Sie dann die App als:
npm config set arch ia32
git submodule update --init
node-gyp configure --arch x86
node-gyp rebuild
import { Bossa } from 'bossaja' ;
const PORT = '/dev/tty.usb1' ;
const bossa = new Bossa ( ) ;
await bossa . connect ( PORT ) ;
try {
const buffer = Buffer . from ( [ 0xd , 0xe , 0xa , 0xd , 0xb , 0xe , 0xe , 0xf ] ) ;
await bossa . write ( buffer , 0x2000 ) ;
await bossa . verify ( buffer , 0x2000 ) ;
} finally {
await bossa . close ( ) ;
} Bossa() / Bossa(opts)
opts ist ein optionales Objekt von Optionen.
{
debug : boolean ,
} connect(port) -> Promise
Schließen Sie eine Verbindung zum Gerät an.
close() -> Promise
Schließen Sie die Verbindung.
info() -> Promise<Object>
Rückgeben Sie Informationen zum Gerät.
read(offset, size) -> Promise<Buffer>
Lesen Sie size ab offset .
write(buffer, offset) -> Promise
Schreiben Sie buffer in das Gerät ab offset .
verify(buffer, offset) -> Promise
Überprüfen Sie, ob die Daten zum offset für buffer entsprechen.
Erben von EventEmitter .
progress -> (progress, total)
Fortschrittsaktualisierung des aktuellen Vorgangs (auf Geräteseiten).
Auf einem Entwicklungsscheibe können der SAM-BA-Bootloader, z. B. dem Atmel SAMD21 Xplained Pro, möglich.
PORT=/dev/tty.usb1 yarn test
Bossa.js ist © 2019, Sports Performance Tracking. Es wird unter einer BSD-3-Klausel-Lizenz veröffentlicht, die Sie in LICENSE finden können.
Bossa ist © 2011-2016, Shumatech. Es wird auch unter einer BSD-3-Klausel-Lizenz veröffentlicht, die Sie in extern/bossa/LICENSE finden können.