public interface IGeneralFirmwareImplementation
In order to extend Cloud Connector firmware functionality, a class
implementing this interface must be passed as parameter in the Cloud
Connector constructor:
CloudConnector.CloudConnector(IGeneralFirmwareImplementation)
The parameter "firmware_file_notify"
must be defined in the connector_config.txt file:
To define the available targets follow the instructions described in
GeneralFirmwareManager.
| Modifier and Type | Method and Description |
|---|---|
int |
dataChunkDownloadComplete(byte[] checksum)
This method is called when the download of the firmware is complete, and
no more file chunks are going to be sent.
|
boolean |
dataChunkReceived(byte[] data)
This method is called whenever a new file chunk is received during
a firmware update.
|
boolean |
fileReceived(java.lang.String filePath)
This method is called whenever a full file is downloaded using the
firmware update service.
|
void |
firmwareDownloadAbort(int reason)
Notifies that the firmware update process was aborted by the server for
the given reason.
|
void |
firmwareUpdateError()
This method is called whenever an error occurs in the current firmware
update process.
|
int |
firmwareUpdateStart(FirmwareTarget target,
int size,
java.lang.String fileName)
This method is called whenever a firmware update process is about to
start.
|
int dataChunkDownloadComplete(byte[] checksum)
The parameter "firmware_file_notify" must be configured to "chunk_received" .
Handles a download complete event from the server indicating that the new firmware file has been completely transferred.
checksum - CRC-32 checksum value computed from offset 0 to
size (calculated by the server), 0 if no
checksum is required.FirmwareConstants.DOWNLOAD_COMPLETE_STATUS_OK,
FirmwareConstants.DOWNLOAD_COMPLETE_STATUS_ERROR,
FirmwareConstants.DOWNLOAD_COMPLETE_STATUS_CHECKSUM_ERROR,
GeneralFirmwareManager.PARAM_FIRMWARE_FILE_NOTIFY,
GeneralFirmwareManager.FIRMWARE_FILE_NOTIFY_CHUNK,
GeneralFirmwareManager.FIRMWARE_FILE_NOTIFY_FILEboolean dataChunkReceived(byte[] data)
The parameter "firmware_file_notify" must be configured to "chunk_received" .
data - Byte array with the data chunk received.true if data chunk is successfully handled, false
if an error occurs.GeneralFirmwareManager.PARAM_FIRMWARE_FILE_NOTIFY,
GeneralFirmwareManager.FIRMWARE_FILE_NOTIFY_CHUNK,
GeneralFirmwareManager.FIRMWARE_FILE_NOTIFY_FILEboolean fileReceived(java.lang.String filePath)
The parameter "firmware_file_notify" must be configured to "file_completed".
filePath - The downloaded firmware file path.true if the file is successfully handled, false
if an error occurs.GeneralFirmwareManager.PARAM_FIRMWARE_FILE_NOTIFY,
GeneralFirmwareManager.FIRMWARE_FILE_NOTIFY_FILE,
GeneralFirmwareManager.FIRMWARE_FILE_NOTIFY_CHUNKvoid firmwareDownloadAbort(int reason)
reason - Reason of the firmware update abort:
FirmwareConstants.ABORT_SERVER_CLIENT,
FirmwareConstants.ABORT_DOWNLOAD_ERRORvoid firmwareUpdateError()
int firmwareUpdateStart(FirmwareTarget target, int size, java.lang.String fileName)
target - The firmware target for which firmware update is about to
start.size - The size (in bytes) of the firmware file that will be sent
from Device Cloud.fileName - The name of the firmware file that will be sent.FirmwareConstants.DOWNLOAD_RESPONSE_TYPE_OK,
FirmwareConstants.DOWNLOAD_RESPONSE_TYPE_DOWNLOAD_DENIED,
FirmwareConstants.DOWNLOAD_RESPONSE_TYPE_FILE_TOO_LARGE,
FirmwareConstants.DOWNLOAD_RESPONSE_TYPE_INVALID_VERSION,
FirmwareConstants.DOWNLOAD_RESPONSE_TYPE_NOT_AUTHENTICATED,
FirmwareConstants.DOWNLOAD_RESPONSE_TYPE_NOT_ALLOWED,
FirmwareConstants.DOWNLOAD_RESPONSE_TYPE_REJECT,
FirmwareConstants.DOWNLOAD_RESPONSE_TYPE_ERROR© Copyright 2014 Etherios, Inc. All rights reserved. Etherios, Inc. is a Division of Digi International Inc.