Optional parameters for startDfu.

interface StartDfuOptions {
    alternativeAdvertisingName?: string;
    bootloaderScanTimeout?: number;
    connectionTimeout?: number;
    deviceName?: string;
    dfuProgressListener?: ((ev) => void);
    dfuStateListener?: ((ev) => void);
    disableButtonlessServiceInSecureDfu?: boolean;
    disableResume?: boolean;
    disallowForegroundService?: boolean;
    forceDfu?: boolean;
    forceScanningForNewAddressInLegacyDfu?: boolean;
    keepBond?: boolean;
    prepareDataObjectDelay?: number;
    rebootTime?: number;
    restoreBond?: boolean;
    retries?: number;
}

Properties

alternativeAdvertisingName?: string

Alternative name to use in Bootloader mode. If not specified then a random name is generated.

The maximum length of the alternative advertising name is 20 bytes. Longer name will be truncated. UTF-8 characters can be cut in the middle.

Default Value

undefined.

Remarks

iOS only.

bootloaderScanTimeout?: number

Scan duration (in milliseconds) when scanning for DFU Bootloader.

Default Value

5000 ms.

Remarks

Android only.

connectionTimeout?: number

When the DFU target does not connect before the time runs out, a timeout error is reported.

Default

10.

Remarks

iOS only.

deviceName?: string

The device named is used in user notifications.

Remarks

Android only.

dfuProgressListener?: ((ev) => void)

The callback that is repeatedly invoked during the upload, with information about the transfer progress.

Type declaration

    • (ev): void
    • The callback that is repeatedly invoked during the upload, with information about the transfer progress.

      Parameters

      Returns void

dfuStateListener?: ((ev) => void)

The callback that is invoked for each DFU event.

Type declaration

    • (ev): void
    • The callback that is invoked for each DFU event.

      Parameters

      Returns void

disableButtonlessServiceInSecureDfu?: boolean

When set to true, disable using the experimental buttonless feature in Secure DFU.

Default

false
disableResume?: boolean

Disable the ability for the Secure DFU process to resume from where it was.

Default

false.

Remarks

iOS only.

disallowForegroundService?: boolean

Whether the DFU service should be started as a foreground service.

Default

false.

Remarks

Android only.

forceDfu?: boolean

Setting force DFU to true will prevent from jumping to the DFU Bootloader mode in case there is no DFU Version characteristic (Legacy DFU only!). Use it if the DFU operation can be handled by your device running in the application mode.

Default

false
forceScanningForNewAddressInLegacyDfu?: boolean

When set to true, the Legacy Buttonless Service will scan for the device advertising with an incremented MAC address, instead of trying to reconnect to the same device.

Default

false
keepBond?: boolean

Whether the bond information should be preserver after flashing new application. This feature requires Legacy DFU Bootloader version 0.6 or newer (SDK 8.0.0+).

Default Value

false.

Remarks

This flag is ignored when Secure DFU button-less Service is used. Android only.

prepareDataObjectDelay?: number

Delay that the service will wait before sending each data object in Secure DFU. The delay will be done after a data object is created, and before any data byte is sent.

Default Value

0 (meaning 400 ms for the first packet and 0ms for the others).

Remarks

Android only.

rebootTime?: number

Time required by the device to reboot. The library will wait for this time before scanning for the device in bootloader mode.

Default Value

0 ms.

Remarks

Android only.

restoreBond?: boolean

Whether a new bond should be created after the DFU is complete. The old bond information will be removed before.

Default Value

false.

Remarks

This flag is ignored when Secure DFU button-less Service is used. Android only.

retries?: number

Number of retries that the DFU service will use to complete DFU.

Default Value

2 retries.

Remarks

Android only.

Generated using TypeDoc