particle-iot / particle-usb

A library for accessing Particle USB devices
Apache License 2.0
5 stars 1 forks source link

DFU upload #91

Closed keeramis closed 1 year ago

keeramis commented 1 year ago

Description

Adds support to read the contents of the device over DFU (upload from device to host)

How to test

A couple of ways as preferred:

Test from Particle-CLI

Use the instructions in this particle-cli PR where you will need to link this repo to the particle-cli local https://github.com/particle-iot/particle-cli/pull/674

Test independently

Implement the readOverDfu function with a usb device in dfu mode Example:

    async readOverDfu() {
        const device = await usbUtils.getOneUsbDevice({ ui: this.ui });
        const buffer = await device.readOverDfu({ altSetting: 1, startAddr: 3106, size: 192 });
                 return buffer;

    }