Dfu

Dfu

Class that provides Dfu controller functionality.

Constructor

new Dfu(transportType, transportParameters)

Initializes the Dfu controller.
Source:
Parameters:
Name Type Description
transportType string TODO: is this used anywhere?
transportParameters Object Configuration parameters. Available transport parameters:
  • {Object} adapter: An instance of adapter.
  • {string} targetAddress: The target address to connect to.
  • {string} targetAddressType: The target address type.
  • {number} [prnValue]: Packet receipt notification number.
  • {number} [mtuSize]: Maximum transmission unit number.
Fires:

Methods

abort() → {void}

Abort the Dfu procedure.
Source:
Returns:
Type:
void

getManifest(zipFilePath, callback) → {void}

Get and return manifest object from the given zip file. The manifest object has one or more of the following properties: { application: {}, bootloader: {}, softdevice: {}, softdevice_bootloader: {}, } Each of the above properties have the following: { bin_file: , // Firmware filename dat_file: , // Init packet filename } The softdevice_bootloader property also has: info_read_only_metadata: { bl_size: , // Bootloader size sd_size: , // Softdevice size }
Source:
Parameters:
Name Type Description
zipFilePath string Path to the zip file.
callback function Signature: (err, manifest) => {}.
Returns:
Type:
void

performDFU(zipFilePath, callback) → {void}

Perform DFU with the given zip file. Successful when callback is invoked with no arguments.
Source:
Parameters:
Name Type Description
zipFilePath string Path to zip file containing data for Dfu.
callback function Signature: (err, abort) => {}.
Returns:
Type:
void

Events

progressUpdate

DFU progress update event.
Properties:
Name Type Description
_ Object Progress meta-data.
Source:
Type:
  • Object

transferComplete

DFU transfer complete event.
Properties:
Name Type Description
file.name string The name of the file that was transferred.
Source:
Type:
  • Object

transferStart

DFU transfer start event.
Properties:
Name Type Description
file.name string The name of the file being transferred.
Source:
Type:
  • Object