public interface DfuProgressListener
DfuServiceListenerHelper
Modifier and Type | Method and Description |
---|---|
void |
onDeviceConnected(java.lang.String deviceAddress)
Method called when the service has successfully connected, discovered services and found DFU service on the DFU target.
|
void |
onDeviceConnecting(java.lang.String deviceAddress)
Method called when the DFU service started connecting with the DFU target.
|
void |
onDeviceDisconnected(java.lang.String deviceAddress)
Method called when the service disconnected from the device.
|
void |
onDeviceDisconnecting(java.lang.String deviceAddress)
Method called when the service started to disconnect from the target device.
|
void |
onDfuAborted(java.lang.String deviceAddress)
Method called when the DFU process has been aborted.
|
void |
onDfuCompleted(java.lang.String deviceAddress)
Method called when the DFU process succeeded.
|
void |
onDfuProcessStarted(java.lang.String deviceAddress)
Method called when the DFU process was started and bytes about to be sent.
|
void |
onDfuProcessStarting(java.lang.String deviceAddress)
Method called when the DFU process is starting.
|
void |
onEnablingDfuMode(java.lang.String deviceAddress)
Method called when the service discovered that the DFU target is in the application mode and must be switched to DFU mode.
|
void |
onError(java.lang.String deviceAddress,
int error,
int errorType,
java.lang.String message)
Method called when an error occur.
|
void |
onFirmwareValidating(java.lang.String deviceAddress)
Method called when the new firmware is being validated on the target device.
|
void |
onProgressChanged(java.lang.String deviceAddress,
int percent,
float speed,
float avgSpeed,
int currentPart,
int partsTotal)
Method called during uploading the firmware.
|
void onDeviceConnecting(java.lang.String deviceAddress)
deviceAddress
- the target device addressvoid onDeviceConnected(java.lang.String deviceAddress)
deviceAddress
- the target device addressvoid onDfuProcessStarting(java.lang.String deviceAddress)
deviceAddress
- the target device addressvoid onDfuProcessStarted(java.lang.String deviceAddress)
deviceAddress
- the target device addressvoid onEnablingDfuMode(java.lang.String deviceAddress)
onDeviceDisconnected(String)
event following this call.deviceAddress
- the target device addressvoid onProgressChanged(java.lang.String deviceAddress, int percent, float speed, float avgSpeed, int currentPart, int partsTotal)
deviceAddress
- the target device addresspercent
- the current status of upload (0-99)speed
- the current speed in bytes per millisecondavgSpeed
- the average speed in bytes per millisecondcurrentPart
- the number pf part being sent. In case the ZIP file contains a Soft Device and/or a Bootloader together with the application the SD+BL are sent as part 1,
then the service starts again and send the application as part 2partsTotal
- total number of partsvoid onFirmwareValidating(java.lang.String deviceAddress)
deviceAddress
- the target device addressvoid onDeviceDisconnecting(java.lang.String deviceAddress)
deviceAddress
- the target device addressvoid onDeviceDisconnected(java.lang.String deviceAddress)
deviceAddress
- the target device addressvoid onDfuCompleted(java.lang.String deviceAddress)
deviceAddress
- the target device addressvoid onDfuAborted(java.lang.String deviceAddress)
deviceAddress
- the target device addressvoid onError(java.lang.String deviceAddress, int error, int errorType, java.lang.String message)
deviceAddress
- the target device addresserror
- error numbererrorType
- the error type, one of DfuBaseService.ERROR_TYPE_COMMUNICATION_STATE
, DfuBaseService.ERROR_TYPE_COMMUNICATION
,
DfuBaseService.ERROR_TYPE_DFU_REMOTE
, DfuBaseService.ERROR_TYPE_OTHER
.message
- the error message