diff --git a/README.md b/README.md index 30e1a38..c7154ca 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The compat library may be found on jcenter and Maven Central repository. Add it to your project by adding the following dependency: ```Groovy -compile 'no.nordicsemi.android:dfu:0.6.3' +compile 'no.nordicsemi.android:dfu:1.0.0' ``` If you use proguard, add the following line to your proguard rules: @@ -44,12 +44,13 @@ The library is compatible with nRF51 and nRF52 devices with S-Series Soft Device * **SDK 7.0.0** - The extended init packet is required. The init packet contains additional validation information: device type and revision, application version, compatible Soft Devices and the firmware CRC. * **SDK 8.0.0** - The bond information may be preserved after an application update. The new application, when first started, will send the Service Change indication to the phone to refresh the services. - Buttonless update support for bonded devices - sharing the LTK between an app and the bootloader. +* **SDK 12.0.0** - New Secure DFU has been released. This library is fully backwards compatible so supports both the new and legacy DFU. Check platform folders for mode details about compatibility for each library. ### Resources -- [DFU Introduction](http://developer.nordicsemi.com/nRF51_SDK/doc/7.2.0/s110/html/a00062.html "BLE Bootloader/DFU") -- [How to create init packet](https://github.com/NordicSemiconductor/nRF-Master-Control-Panel/tree/master/init%20packet%20handling "Init packet handling") +- [DFU Introduction](http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/examples_ble_dfu.html?cp=6_0_0_4_3_1 "BLE Bootloader/DFU") +- [How to create init packet](https://github.com/NordicSemiconductor/Android-nRF-Connect/tree/master/init%20packet%20handling "Init packet handling") - [nRF51 Development Kit (DK)](http://www.nordicsemi.com/eng/Products/nRF51-DK "nRF51 DK") (compatible with Arduino Uno Revision 3) - [nRF52 Development Kit (DK)](http://www.nordicsemi.com/eng/Products/Bluetooth-Smart-Bluetooth-low-energy/nRF52-DK "nRF52 DK") (compatible with Arduino Uno Revision 3) diff --git a/documentation/README.md b/documentation/README.md index 2505e55..54dfa5e 100644 --- a/documentation/README.md +++ b/documentation/README.md @@ -4,7 +4,8 @@ The DFU Library for Android 4.3+ adds the DFU feature to the Android project. ### Features: -* Allows to program Application, Soft Device and Bootloader Over-the-Air on the nRF51 Series SoC over Bluetooth Smart. +* DFU Library version 1.0.0+ supports **Secure DFU** introduced in SDK 12.0.0 and is fully backwards compatible with all versions of Legacy DFU. +* Allows to program Application, Soft Device and Bootloader Over-the-Air on the nRF5 Series SoC over Bluetooth Smart. * Supports HEX or BIN files. * Supports zip files with Soft Device, Bootloader and Application together. * Supports the Init packet (which has been required since Bootloader/DFU from SDK 7.0+). @@ -27,13 +28,13 @@ In case of any communication error the peripheral device will never be bricked. * **Android Studio IDE** or **Eclipse ADT** Projects are compatible with Android Studio and the Gradle build engine. It is possible to convert them to Eclipse ADT projects. See Integration for more details. -* **nRF51 device for testing.** +* **nRF5 device for testing.** - A nRF51 Series device is required to test the working solution. If your final product is not available, use the nRF51 DK, which you can find [here](http://www.nordicsemi.com/eng/Products/nRF51-DK "nRF51 DK"). + A nRF5 Series device is required to test the working solution. If your final product is not available, use the nRF51 DK, which you can find [here](http://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF52-DK "nRF52 DK"). ### Integration -The DFULibrary is compatible as such with Android Studio 1.0.2 IDE. If you are using Eclipse ADT, you will have to convert the project to match the Eclipse project structure. +The DFULibrary is compatible as such with Android Studio IDE. If you are using Eclipse ADT, you will have to convert the project to match the Eclipse project structure. #### Android Studio @@ -103,19 +104,19 @@ import android.os.Bundle; public class NotificationActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); + super.onCreate(savedInstanceState); - // If this activity is the root activity of the task, the app is not running - if (isTaskRoot()) { - // Start the app before finishing - final Intent intent = new Intent(this, MyActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - intent.putExtras(getIntent().getExtras()); // copy all extras - startActivity(intent); - } + // If this activity is the root activity of the task, the app is not running + if (isTaskRoot()) { + // Start the app before finishing + final Intent intent = new Intent(this, MyActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.putExtras(getIntent().getExtras()); // copy all extras + startActivity(intent); + } - // Now finish, which will drop you to the activity at which you were at the top of the task stack - finish(); + // Now finish, which will drop you to the activity at which you were at the top of the task stack + finish(); } } ``` @@ -125,55 +126,53 @@ Remember to add your service to the *AndroidManifest.xml*. Start the DFU service with the following code: ```java -final Intent service = new Intent(this, MyDfuService.class); - -service.putExtra(DfuService.EXTRA_DEVICE_ADDRESS, mSelectedDevice.getAddress()); -service.putExtra(DfuService.EXTRA_DEVICE_NAME, mSelectedDevice.getName()); -service.putExtra(DfuService.EXTRA_FILE_MIME_TYPE, - mFileType == DfuService.TYPE_AUTO ? DfuService.MIME_TYPE_ZIP : DfuService.MIME_TYPE_OCTET_STREAM); -service.putExtra(DfuService.EXTRA_FILE_TYPE, mFileType); -service.putExtra(DfuService.EXTRA_FILE_PATH, mFilePath); // a path or URI must be provided. -service.putExtra(DfuService.EXTRA_FILE_URI, mFileStreamUri); +final DfuServiceInitiator starter = new DfuServiceInitiator(mSelectedDevice.getAddress()) + .setDeviceName(mSelectedDevice.getName()) + .setKeepBond(keepBond); // Init packet is required by Bootloader/DFU from SDK 7.0+ if HEX or BIN file is given above. // In case of a ZIP file, the init packet (a DAT file) must be included inside the ZIP file. -service.putExtra(DfuService.EXTRA_INIT_FILE_PATH, mInitFilePath); -service.putExtra(DfuService.EXTRA_INIT_FILE_URI, mInitFileStreamUri); -service.putExtra(DfuService.EXTRA_KEEP_BOND, mKeepBond); - -startService(service); +if (mFileType == DfuService.TYPE_AUTO) + starter.setZip(mFileStreamUri, mFilePath); +else { + starter.setBinOrHex(mFileType, mFileStreamUri, mFilePath).setInitFile(mInitFileStreamUri, mInitFilePath); +} +starter.start(this, DfuService.class); ``` -Please, see [How to create init packet](https://github.com/NordicSemiconductor/nRF-Master-Control-Panel/tree/master/init%20packet%20handling "Init packet handling") document for more information about the init packet. +Please, see [How to create init packet](https://github.com/NordicSemiconductor/Android-nRF-Connect/tree/master/init%20packet%20handling "Init packet handling") document for more information about the init packet. The service will send local broadcast events using **LocalBroadcastManager**. ```java +private final DfuProgressListener mDfuProgressListener = new DfuProgressListenerAdapter() { @Override - protected void onResume() { - super.onResume(); - - // We are using LocalBroadcastReceiver instead of a normal BroadcastReceiver for - // optimization purposes - final LocalBroadcastManager broadcastManager = LocalBroadcastManager.getInstance(this); - broadcastManager.registerReceiver(mDfuUpdateReceiver, makeDfuUpdateIntentFilter()); + public void onDeviceConnecting(final String deviceAddress) { + mProgressBar.setIndeterminate(true); + mTextPercentage.setText(R.string.dfu_status_connecting); } @Override - protected void onPause() { - super.onPause(); - - final LocalBroadcastManager broadcastManager = LocalBroadcastManager.getInstance(this); - broadcastManager.unregisterReceiver(mDfuUpdateReceiver); + public void onDfuProcessStarting(final String deviceAddress) { + mProgressBar.setIndeterminate(true); + mTextPercentage.setText(R.string.dfu_status_starting); } + ///... +} - private static IntentFilter makeDfuUpdateIntentFilter() { - final IntentFilter intentFilter = new IntentFilter(); - intentFilter.addAction(DfuService.BROADCAST_PROGRESS); - intentFilter.addAction(DfuService.BROADCAST_ERROR); - intentFilter.addAction(DfuService.BROADCAST_LOG); - return intentFilter; - } +@Override +protected void onResume() { + super.onResume(); + + DfuServiceListenerHelper.registerProgressListener(this, mDfuProgressListener); +} + +@Override +protected void onPause() { + super.onPause(); + + DfuServiceListenerHelper.unregisterProgressListener(this, mDfuProgressListener); +} ``` ### Example diff --git a/documentation/javadoc/allclasses-frame.html b/documentation/javadoc/allclasses-frame.html index 23f6b2c..3343bbc 100644 --- a/documentation/javadoc/allclasses-frame.html +++ b/documentation/javadoc/allclasses-frame.html @@ -2,9 +2,9 @@
- +public static final int
VERSION_CODE
4
5
public static final java.lang.String
VERSION_NAME
"0.6.3"
"1.0.0"
32768
public static final int
ERROR_CRC_ERROR
4109
public static final int
ERROR_DEVICE_DISCONNECTED
4096
public static final int
ERROR_FILE_ERROR
4098
public static final int
ERROR_FILE_INVALID
4099
public static final int
ERROR_FILE_IO_EXCEPTION
4100
public static final int
ERROR_FILE_NOT_FOUND
4097
public static final int
ERROR_FILE_SIZE_INVALID
4108
public static final int
ERROR_FILE_TYPE_UNSUPPORTED
4105
public static final int
ERROR_INIT_PACKET_REQUIRED
4107
public static final int
ERROR_INVALID_RESPONSE
4104
public static final int
ERROR_MASK
4096
public static final int
ERROR_REMOTE_MASK
8192
public static final int
ERROR_SERVICE_DISCOVERY_NOT_STARTED
4101
public static final int
ERROR_SERVICE_NOT_FOUND
4102
public static final int
ERROR_TYPE_COMMUNICATION
2
public static final int
ERROR_TYPE_COMMUNICATION_STATE
1
public static final int
ERROR_TYPE_DFU_REMOTE
3
public static final int
ERROR_TYPE_OTHER
0
public static final java.lang.String
EXTRA_ACTION
"no.nordicsemi.android.dfu.extra.EXTRA_ACTION"
public static final java.lang.String
EXTRA_AVG_SPEED_B_PER_MS
"no.nordicsemi.android.dfu.extra.EXTRA_AVG_SPEED_B_PER_MS"
public static final java.lang.String
EXTRA_DATA
"no.nordicsemi.android.dfu.extra.EXTRA_DATA"
public static final java.lang.String
EXTRA_DEVICE_ADDRESS
"no.nordicsemi.android.dfu.extra.EXTRA_DEVICE_ADDRESS"
public static final java.lang.String
EXTRA_DEVICE_NAME
"no.nordicsemi.android.dfu.extra.EXTRA_DEVICE_NAME"
public static final java.lang.String
EXTRA_DISABLE_NOTIFICATION
"no.nordicsemi.android.dfu.extra.EXTRA_DISABLE_NOTIFICATION"
public static final java.lang.String
EXTRA_ERROR_TYPE
"no.nordicsemi.android.dfu.extra.EXTRA_ERROR_TYPE"
public static final java.lang.String
EXTRA_FILE_MIME_TYPE
"no.nordicsemi.android.dfu.extra.EXTRA_MIME_TYPE"
public static final java.lang.String
EXTRA_FILE_PATH
"no.nordicsemi.android.dfu.extra.EXTRA_FILE_PATH"
public static final java.lang.String
EXTRA_FILE_RES_ID
"no.nordicsemi.android.dfu.extra.EXTRA_FILE_RES_ID"
public static final java.lang.String
EXTRA_FILE_TYPE
"no.nordicsemi.android.dfu.extra.EXTRA_FILE_TYPE"
public static final java.lang.String
EXTRA_FILE_URI
"no.nordicsemi.android.dfu.extra.EXTRA_FILE_URI"
public static final java.lang.String
EXTRA_INIT_FILE_PATH
"no.nordicsemi.android.dfu.extra.EXTRA_INIT_FILE_PATH"
public static final java.lang.String
EXTRA_INIT_FILE_RES_ID
"no.nordicsemi.android.dfu.extra.EXTRA_INIT_FILE_RES_ID"
public static final java.lang.String
EXTRA_INIT_FILE_URI
"no.nordicsemi.android.dfu.extra.EXTRA_INIT_FILE_URI"
public static final java.lang.String
EXTRA_KEEP_BOND
"no.nordicsemi.android.dfu.extra.EXTRA_KEEP_BOND"
public static final java.lang.String
EXTRA_LOG_LEVEL
"no.nordicsemi.android.dfu.extra.EXTRA_LOG_LEVEL"
public static final java.lang.String
EXTRA_LOG_MESSAGE
"no.nordicsemi.android.dfu.extra.EXTRA_LOG_INFO"
public static final java.lang.String
EXTRA_PART_CURRENT
"no.nordicsemi.android.dfu.extra.EXTRA_PART_CURRENT"
public static final java.lang.String
EXTRA_PARTS_TOTAL
"no.nordicsemi.android.dfu.extra.EXTRA_PARTS_TOTAL"
public static final java.lang.String
EXTRA_PROGRESS
"no.nordicsemi.android.dfu.extra.EXTRA_PROGRESS"
public static final java.lang.String
EXTRA_RESTORE_BOND
"no.nordicsemi.android.dfu.extra.EXTRA_RESTORE_BOND"
public static final java.lang.String
EXTRA_SPEED_B_PER_MS
"no.nordicsemi.android.dfu.extra.EXTRA_SPEED_B_PER_MS"
public static final int
LOG_LEVEL_APPLICATION
10
public static final int
LOG_LEVEL_DEBUG
0
public static final int
LOG_LEVEL_ERROR
20
public static final int
LOG_LEVEL_INFO
5
public static final int
LOG_LEVEL_VERBOSE
1
public static final int
LOG_LEVEL_WARNING
15
public static final java.lang.String
MIME_TYPE_OCTET_STREAM
"application/octet-stream"
public static final java.lang.String
MIME_TYPE_ZIP
"application/zip"
public static final int
NOTIFICATION_ID
283
public static final int
PROGRESS_ABORTED
-7
public static final int
PROGRESS_COMPLETED
-6
public static final int
PROGRESS_CONNECTING
-1
public static final int
PROGRESS_DISCONNECTING
-5
public static final int
PROGRESS_ENABLING_DFU_MODE
-3
public static final int
PROGRESS_STARTING
-2
public static final int
PROGRESS_VALIDATING
-4
protected static final int
STATE_CLOSED
-5
protected static final int
STATE_CONNECTED
-2
protected static final int
STATE_CONNECTED_AND_READY
-3
protected static final int
STATE_CONNECTING
-1
protected static final int
STATE_DISCONNECTED
0
protected static final int
STATE_DISCONNECTING
-4
public static final int
TYPE_APPLICATION
4
public static final int
TYPE_AUTO
0
public static final int
TYPE_BOOTLOADER
2
public static final int
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final int |
+CRC_ERROR |
+5 |
+
+
+public static final int |
+DATA_SIZE_EXCEEDS_LIMIT |
+4 |
+
+
+public static final int |
+INVALID_STATE |
+2 |
+
+
+public static final int |
+NOT_SUPPORTED |
+3 |
+
+
+public static final int |
+OPERATION_FAILED |
+6 |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final int |
+EXTENDED_ERROR |
+11 |
+
+
+public static final int |
+INSUFFICIENT_RESOURCES |
+4 |
+
+
+public static final int |
+INVALID_OBJECT |
+5 |
+
+
+public static final int |
+INVALID_PARAM |
+3 |
+
+
+public static final int |
+OP_CODE_NOT_SUPPORTED |
+2 |
+
+
+public static final int |
+OPERATION_FAILED |
+10 |
+
+
+public static final int |
+OPERATION_NOT_PERMITTED |
+8 |
+
+
+public static final int |
+UNSUPPORTED_TYPE |
+7 |
+
android.bluetooth.BluetoothGattCallback#onConnectionStateChange(android.bluetooth.BluetoothGatt, int, int)
to error name.DfuLogListener
.DfuBaseService.STATE_DISCONNECTED
or until an error occurs.android.bluetooth.BluetoothGattCallback#onConnectionStateChange(android.bluetooth.BluetoothGatt, int, int)
method was called with
status other than android.bluetooth.BluetoothGatt#GATT_SUCCESS
.public class ApplicationTest
-extends <any>
-
-Constructor and Description | -
---|
ApplicationTest() |
-
static int
DFU_STATUS_CRC_ERROR
DFU_STATUS_CRC_ERROR
+static int
DFU_STATUS_DATA_SIZE_EXCEEDS_LIMIT
DFU_STATUS_DATA_SIZE_EXCEEDS_LIMIT
+static int
DFU_STATUS_INVALID_STATE
DFU_STATUS_INVALID_STATE
+static int
DFU_STATUS_NOT_SUPPORTED
DFU_STATUS_NOT_SUPPORTED
+static int
DFU_STATUS_OPERATION_FAILED
DFU_STATUS_OPERATION_FAILED
+static int
DFU_STATUS_SUCCESS
DFU_STATUS_SUCCESS
+static int
static int
ERROR_DEVICE_DISCONNECTED
ERROR_CRC_ERROR
+static int
ERROR_DEVICE_DISCONNECTED
static int
ERROR_FILE_ERROR
IOException
has been thrown).static int
ERROR_FILE_INVALID
static int
ERROR_FILE_IO_EXCEPTION
IOException
occurred when reading from file.static int
ERROR_FILE_NOT_FOUND
static int
ERROR_FILE_SIZE_INVALID
static int
ERROR_FILE_TYPE_UNSUPPORTED
static int
ERROR_INIT_PACKET_REQUIRED
static int
ERROR_INVALID_RESPONSE
static int
ERROR_MASK
static int
ERROR_REMOTE_MASK
-static int
ERROR_SERVICE_DISCOVERY_NOT_STARTED
gatt.discoverServices();
returns false.static int
ERROR_SERVICE_NOT_FOUND
static int
ERROR_TYPE_COMMUNICATION
static int
ERROR_TYPE_COMMUNICATION_STATE
static int
ERROR_TYPE_DFU_REMOTE
static int
ERROR_TYPE_OTHER
static java.lang.String
EXTRA_ACTION
static java.lang.String
EXTRA_AVG_SPEED_B_PER_MS
static java.lang.String
EXTRA_DATA
static java.lang.String
EXTRA_DEVICE_ADDRESS
static java.lang.String
EXTRA_DEVICE_NAME
static java.lang.String
EXTRA_DISABLE_NOTIFICATION
static java.lang.String
EXTRA_ERROR_TYPE
static java.lang.String
EXTRA_FILE_MIME_TYPE
static java.lang.String
EXTRA_FILE_PATH
static java.lang.String
EXTRA_FILE_RES_ID
EXTRA_FILE_PATH
for details.static java.lang.String
EXTRA_FILE_TYPE
static java.lang.String
EXTRA_FILE_URI
EXTRA_FILE_PATH
for details.static java.lang.String
EXTRA_INIT_FILE_PATH
static java.lang.String
EXTRA_INIT_FILE_RES_ID
static java.lang.String
EXTRA_INIT_FILE_URI
static java.lang.String
EXTRA_KEEP_BOND
static java.lang.String
EXTRA_LOG_LEVEL
static java.lang.String
EXTRA_LOG_MESSAGE
static java.lang.String
EXTRA_PART_CURRENT
static java.lang.String
EXTRA_PARTS_TOTAL
static java.lang.String
EXTRA_PROGRESS
static java.lang.String
EXTRA_RESTORE_BOND
static java.lang.String
EXTRA_SPEED_B_PER_MS
static int
LOG_LEVEL_APPLICATION
static int
LOG_LEVEL_DEBUG
static int
LOG_LEVEL_ERROR
static int
LOG_LEVEL_INFO
static int
LOG_LEVEL_VERBOSE
static int
LOG_LEVEL_WARNING
protected int
mConnectionState
+static java.lang.String
MIME_TYPE_OCTET_STREAM
protected static int
STATE_CLOSED
protected static int
STATE_CONNECTED
protected static int
STATE_CONNECTED_AND_READY
protected static int
STATE_CONNECTING
protected static int
STATE_DISCONNECTED
protected static int
STATE_DISCONNECTING
static int
TYPE_APPLICATION
protected void
close(BluetoothGatt gatt)
+protected BluetoothGatt
connect(java.lang.String address)
+protected void
disconnect(BluetoothGatt gatt)
+protected abstract java.lang.Class<? extends Activity>
getNotificationTarget()
void
onCreate()
void
onDestroy()
protected void
onHandleIntent(Intent intent)
protected void
refreshDeviceCache(BluetoothGatt gatt,
+ boolean force)
+protected void
terminateConnection(BluetoothGatt gatt,
+ int error)
+void
updateProgressNotification()
+protected void
waitFor(int millis)
+protected void
waitUntilDisconnected()
+STATE_DISCONNECTED
or until an error occurs.public static final int NOTIFICATION_ID+
true
.
By default the DFU Bootloader clears the whole application's memory. It may be however configured in the \Nordic\nrf51\components\libraries\bootloader_dfu\dfu_types.h
- file (line 56: #define DFU_APP_DATA_RESERVED 0x0000
) to preserve some pages. The BLE_APP_HRM_DFU sample app stores the LTK and System Attributes in the first
+ file (sdk 11, line 76: #define DFU_APP_DATA_RESERVED 0x0000
) to preserve some pages. The BLE_APP_HRM_DFU sample app stores the LTK and System Attributes in the first
two pages, so in order to preserve the bond information this value should be changed to 0x0800 or more.
When those data are preserved, the new Application will notify the app with the Service Changed indication when launched for the first time. Otherwise this
service will remove the bond information from the phone and force to refresh the device cache (see #refreshDeviceCache(android.bluetooth.BluetoothGatt, boolean)
).
public static final int ERROR_CRC_ERROR+
public static final int ERROR_REMOTE_MASK-
public static final int DFU_STATUS_SUCCESS+
@Deprecated +public static final int DFU_STATUS_SUCCESS+
public static final int DFU_STATUS_INVALID_STATE+
@Deprecated +public static final int DFU_STATUS_INVALID_STATE+
public static final int DFU_STATUS_NOT_SUPPORTED+
@Deprecated +public static final int DFU_STATUS_NOT_SUPPORTED+
public static final int DFU_STATUS_DATA_SIZE_EXCEEDS_LIMIT+
@Deprecated +public static final int DFU_STATUS_DATA_SIZE_EXCEEDS_LIMIT+
public static final int DFU_STATUS_CRC_ERROR+
@Deprecated +public static final int DFU_STATUS_CRC_ERROR+
public static final int DFU_STATUS_OPERATION_FAILED+
@Deprecated +public static final int DFU_STATUS_OPERATION_FAILED+
protected int mConnectionState+
protected static final int STATE_DISCONNECTED+
protected static final int STATE_CONNECTING+
protected static final int STATE_CONNECTED+
protected static final int STATE_CONNECTED_AND_READY+
protected static final int STATE_DISCONNECTING+
public static final int NOTIFICATION_ID+
protected static final int STATE_CLOSED
protected void onHandleIntent(Intent intent)
protected BluetoothGatt connect(java.lang.String address)+
STATE_CONNECTING
to STATE_CONNECTED_AND_READY
or an
+ error occurs. This method returns null
if Bluetooth adapter is disabled.address
- the device addressnull
if Bluetooth adapter is disabled.protected void terminateConnection(BluetoothGatt gatt, + int error)+
gatt
- the GATT device to be disconnectederror
- error numberprotected void disconnect(BluetoothGatt gatt)+
#terminateConnection(android.bluetooth.BluetoothGatt, int)
instead.gatt
- the GATT device that has to be disconnectedprotected void waitUntilDisconnected()+
STATE_DISCONNECTED
or until an error occurs.protected void waitFor(int millis)+
millis
- waiting periodprotected void close(BluetoothGatt gatt)+
gatt
- the GATT device to be closedprotected void refreshDeviceCache(BluetoothGatt gatt, + boolean force)+
gatt
- the GATT device to be refreshedforce
- true
to force the refreshpublic void updateProgressNotification()+
static int
dfu_status_uploading_components_msg
static int
dfu_status_uploading_msg
static int
dfu_status_uploading_part
static int
dfu_status_validating
static int
dfu_status_validating_msg
static int
dfu_unknown_name
public static int dfu_status_uploading
public static int dfu_status_uploading_components_msg-
int
available()
available()
+int
long
getCrc32()
+Manifest
getManifest()
byte[]
getSystemInit()
void
mark(int readlimit)
+boolean
markSupported()
int
read(byte[] buffer)
void
reset()
int
setContentType(int type)
int
softDeviceImageSize()
fill, mark, markSupported, read, reset
+fill, read
public int read(byte[] buffer) +public int read(@NonNull + byte[] buffer) throws java.io.IOException
public boolean markSupported()+
markSupported
in class java.util.zip.InflaterInputStream
public void mark(int readlimit)+
mark
in class java.util.zip.InflaterInputStream
readlimit
- this parameter is ignored, can be anythingpublic void reset() + throws java.io.IOException+
reset
in class java.util.zip.InflaterInputStream
java.io.IOException
public long getCrc32()+
public int available()+
setContentType(int)
method.available
in class java.util.zip.ZipInputStream
DeviceDisconnectedException(java.lang.String message,
- int state)
DeviceDisconnectedException(java.lang.String message)
Modifier and Type | -Method and Description | -
---|---|
int |
-getConnectionState() |
-
java.lang.String |
-getMessage() |
-
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public DeviceDisconnectedException(java.lang.String message, - int state)-
public int getConnectionState()-
public java.lang.String getMessage()-
getMessage
in class java.lang.Throwable
public DeviceDisconnectedException(java.lang.String message)
UnknownResponseException(java.lang.String message,
+UnknownResponseException(java.lang.String message,
byte[] response,
+ int expectedReturnCode,
int expectedOpCode)
public UnknownResponseException(java.lang.String message, byte[] response, + int expectedReturnCode, int expectedOpCode)diff --git a/documentation/javadoc/no/nordicsemi/android/dfu/internal/exception/UploadAbortedException.html b/documentation/javadoc/no/nordicsemi/android/dfu/internal/exception/UploadAbortedException.html index 9af6a5a..e9bb5fb 100644 --- a/documentation/javadoc/no/nordicsemi/android/dfu/internal/exception/UploadAbortedException.html +++ b/documentation/javadoc/no/nordicsemi/android/dfu/internal/exception/UploadAbortedException.html @@ -2,9 +2,9 @@ - +
int mState-
byte[] mResponse
int mExpectedReturnCode+
int mExpectedOpCode