public class DfuServiceListenerHelper
extends java.lang.Object
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(Context, DfuProgressListener)
or registerLogListener(Context, DfuLogListener)
to register your listeners. Remember about unregistering them
when your context is destroyed.
Constructor and Description |
---|
DfuServiceListenerHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
registerLogListener(android.content.Context context,
DfuLogListener listener)
Registers the
DfuLogListener . |
static void |
registerLogListener(android.content.Context context,
DfuLogListener listener,
java.lang.String deviceAddress)
Registers the
DfuLogListener . |
static void |
registerProgressListener(android.content.Context context,
DfuProgressListener listener)
Registers the
DfuProgressListener . |
static void |
registerProgressListener(android.content.Context context,
DfuProgressListener listener,
java.lang.String deviceAddress)
Registers the
DfuProgressListener . |
static void |
unregisterLogListener(android.content.Context context,
DfuLogListener listener)
Unregisters the previously registered log listener.
|
static void |
unregisterProgressListener(android.content.Context context,
DfuProgressListener listener)
Unregisters the previously registered progress listener.
|
public static void registerProgressListener(android.content.Context context, DfuProgressListener listener)
DfuProgressListener
. Registered listener will receive the progress events from the DFU service.context
- the application contextlistener
- the listener to registerpublic static void registerProgressListener(android.content.Context context, DfuProgressListener listener, java.lang.String deviceAddress)
DfuProgressListener
. Registered listener will receive the progress events from the DFU service.context
- the application contextlistener
- the listener to registerdeviceAddress
- the address of the device to receive updates from (or null if any device)public static void unregisterProgressListener(android.content.Context context, DfuProgressListener listener)
context
- the application contextlistener
- the listener to unregisterpublic static void registerLogListener(android.content.Context context, DfuLogListener listener)
DfuLogListener
. Registered listener will receive the log events from the DFU service.context
- the application contextlistener
- the listener to registerpublic static void registerLogListener(android.content.Context context, DfuLogListener listener, java.lang.String deviceAddress)
DfuLogListener
. Registered listener will receive the log events from the DFU service.context
- the application contextlistener
- the listener to registerdeviceAddress
- the address of the device to receive updates from (or null if any device)public static void unregisterLogListener(android.content.Context context, DfuLogListener listener)
context
- the application contextlistener
- the listener to unregister