Constructor
new Dfu(transportType, transportParameters)
Initializes the Dfu controller.
Parameters:
Name | Type | Description |
---|---|---|
transportType |
string
|
TODO: is this used anywhere? |
transportParameters |
Object
|
Configuration parameters.
Available transport parameters:
|
Fires:
Methods
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
}
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.
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. |
Type:
-
Object
transferComplete
DFU transfer complete event.
Properties:
Name | Type | Description |
---|---|---|
file.name |
string
|
The name of the file that was transferred. |
Type:
-
Object