• Starts the Device Firmware Update (DFU) service for the Bluetooth device identified by the given target id.

    The target id may be the device system id or bluetooth address depending on the host OS. See its type DfuTargetId. Use the helper function getDfuTargetId to select the correct data in a generic way.

    Use the optional options.dfuStateListener parameter to get notified about the state changes of the DFU process.

    Parameters

    • targetId: DfuTargetId

      The target identifier of the device to update.

    • filePath: string

      The path of the DFU files to send to the device (can be a zip, hex or bin file).

    • Optionaloptions: StartDfuOptions

      Optional parameters, see StartDfuOptions.

    Returns Promise<void>

    An object of type descendant from DfuError.

    • The function returns without error if DFU was aborted by calling abortDfu and the state is updated to "aborted".
    • The Bluetooth address of the device when in DFU mode is the normal address + 1.
    • The device address is passed as "number" as a 48 bits Bluetooth MAC address fits into the 52 bits mantissa of a JavaScript number (64 bits floating point).