Created
September 11, 2017 12:19
-
-
Save mrodem/7d277d32704de5a16ecba10bdf8ee45a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const PythonShell = require('python-shell'); | |
// Assumes that pc-nrfutil exists in $CWD/python/pc-nrfutil | |
const options = { | |
mode: 'text', | |
cwd: `${__dirname}/python/pc-nrfutil`, | |
args: [ | |
'-v', | |
'dfu', | |
'ble', | |
'-f', | |
'--package', | |
'/path/to/sdk13/examples/dfu/ble_dfu_send_hex/test_images_update_nrf52832/dfu_test_softdevice_bootloader_s132.zip', | |
'-ic', | |
'NRF52', | |
'--port', | |
'/dev/ttyACM1' | |
] | |
}; | |
const script = 'nordicsemi/__main__.py'; | |
const shell = new PythonShell(script, options); | |
shell.on('message', function (message) { | |
console.log(message); | |
}); | |
shell.on('error', function (error) { | |
console.log(error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment