DfuServiceListenerHelper
A helper class that should be used to register listeners for DFU Service broadcast events. The DfuProgressListener should be registered to listen for DFU status updates and errors, while the DfuLogListener listener receives the log updates. Listeners may be registered for a specified device (given with device address) or for any device. Keep in mind, that while updating the SoftDevice using the buttonless update the device may change its address in the bootloader mode.
Use registerProgressListener or registerLogListener to register your listeners. Remember about unregistering them when your context is destroyed.
Functions
Link copied to clipboard
open fun registerLogListener(@NonNull context: Context, @NonNull listener: DfuLogListener, @NonNull deviceAddress: String)
Registers the DfuLogListener.
Link copied to clipboard
open fun registerProgressListener(@NonNull context: Context, @NonNull listener: DfuProgressListener)
open fun registerProgressListener(@NonNull context: Context, @NonNull listener: DfuProgressListener, @NonNull deviceAddress: String)
Registers the DfuProgressListener.
Link copied to clipboard
Unregisters the previously registered log listener.
Link copied to clipboard
open fun unregisterProgressListener(@NonNull context: Context, @NonNull listener: DfuProgressListener)
Unregisters the previously registered progress listener.