Skip to content

Commit

Permalink
Update node examples
Browse files Browse the repository at this point in the history
  • Loading branch information
thegecko authored and arekzaluski committed Apr 18, 2019
1 parent c367792 commit 87f20dc
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions examples/daplink-flash/hid.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

const hid = require("node-hid");
const common = require("./common");
const DAPjs = require("../../");
const hidTransport = require("../../lib/transport/hid");

// Allow user to select a device
function selectDevice(vendorID) {
Expand Down Expand Up @@ -50,7 +50,7 @@ common.getFile()
common.setupEmitter();
return selectDevice(0xD28)
.then(device => {
const transport = new DAPjs.HID(device);
const transport = new hidTransport.HID(device);
return common.flash(transport, program);
});
})
Expand Down
4 changes: 2 additions & 2 deletions examples/daplink-flash/usb.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

const usb = require("usb");
const common = require("./common");
const DAPjs = require("../../");
const usbTransport = require("../../lib/transport/usb");

// Read USB device descriptor
function getStringDescriptor(device, index) {
Expand Down Expand Up @@ -69,7 +69,7 @@ common.getFile()
common.setupEmitter();
return selectDevice(0xD28)
.then(device => {
const transport = new DAPjs.USB(device);
const transport = new usbTransport.USB(device);
return common.flash(transport, program);
});
})
Expand Down
4 changes: 2 additions & 2 deletions examples/daplink-serial/hid.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

const hid = require("node-hid");
const common = require("./common");
const DAPjs = require("../../");
const hidTransport = require("../../lib/transport/hid");

// Allow user to select a device
function selectDevice(vendorID) {
Expand Down Expand Up @@ -56,7 +56,7 @@ function selectDevice(vendorID) {

selectDevice(0xD28)
.then(device => {
const transport = new DAPjs.HID(device);
const transport = new hidTransport.HID(device);
return common.listen(transport);
})
.catch(error => {
Expand Down
4 changes: 2 additions & 2 deletions examples/daplink-serial/usb.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

const usb = require("usb");
const common = require("./common");
const DAPjs = require("../../");
const usbTransport = require("../../lib/transport/usb");

// Read USB device descriptor
function getStringDescriptor(device, index) {
Expand Down Expand Up @@ -75,7 +75,7 @@ function selectDevice(vendorID) {

selectDevice(0xD28)
.then(device => {
const transport = new DAPjs.USB(device);
const transport = new usbTransport.USB(device);
return common.listen(transport);
})
.catch(error => {
Expand Down
4 changes: 2 additions & 2 deletions examples/read-registers/hid.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

const hid = require("node-hid");
const common = require("./common");
const DAPjs = require("../../");
const hidTransport = require("../../lib/transport/hid");

// Allow user to select a device
function selectDevice(vendorID) {
Expand All @@ -48,7 +48,7 @@ function selectDevice(vendorID) {

selectDevice(0xD28)
.then(device => {
const transport = new DAPjs.HID(device);
const transport = new hidTransport.HID(device);
return common.readRegisters(transport);
})
.then(() => {
Expand Down
4 changes: 2 additions & 2 deletions examples/read-registers/usb.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

const usb = require("usb");
const common = require("./common");
const DAPjs = require("../../");
const usbTransport = require("../../lib/transport/usb");

// Read USB device descriptor
function getStringDescriptor(device, index) {
Expand Down Expand Up @@ -66,7 +66,7 @@ function selectDevice(vendorID) {

selectDevice(0xD28)
.then(device => {
const transport = new DAPjs.USB(device);
const transport = new usbTransport.USB(device);
return common.readRegisters(transport);
})
.then(() => {
Expand Down
1 change: 0 additions & 1 deletion examples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"@types/node": "^10.12.26",
"browserify": "^16.2.3",
"dapjs": "^1.1.0",
"express": "^4.16.4",
"tsify": "^4.0.1",
"typescript": "^3.3.3",
"webusb": "^1.1.1"
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"typescript": "~3.3.3",
"usb": "^1.5.0",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0"
"vinyl-source-stream": "^2.0.0",
"webusb": "^1.1.1"
}
}

0 comments on commit 87f20dc

Please sign in to comment.