public interface DfuSettingsConstants
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SETTINGS_ASSUME_DFU_NODE
Deprecated.
|
static int |
SETTINGS_DEFAULT_MBR_SIZE
The default value of the MBR size.
|
static java.lang.String |
SETTINGS_MBR_SIZE
This property must contain an integer value.
|
static java.lang.String |
SETTINGS_NUMBER_OF_PACKETS
Deprecated.
|
static int |
SETTINGS_NUMBER_OF_PACKETS_DEFAULT
Deprecated.
|
static java.lang.String |
SETTINGS_PACKET_RECEIPT_NOTIFICATION_ENABLED
Deprecated.
|
@Deprecated static final java.lang.String SETTINGS_PACKET_RECEIPT_NOTIFICATION_ENABLED
If true (default) the Packet Receipt Notification procedure will be enabled. See DFU documentation on http://infocenter.nordicsemi.com for more details.
The number of packets before receiving a Packet Receipt Notification is set with property SETTINGS_NUMBER_OF_PACKETS
.
This constant is now deprecated. Please, use DfuServiceInitiator.setPacketsReceiptNotificationsEnabled(boolean)
to set it.
@Deprecated static final java.lang.String SETTINGS_NUMBER_OF_PACKETS
The default value is 12. Setting it to 0 will disable the Packet Receipt Notification procedure.
When sending a firmware using the DFU procedure the service will send this number of packets before waiting for a notification.
Packet Receipt Notifications are used to synchronize the sender with receiver. On Android, calling BluetoothGatt.writeCharacteristic(BluetoothGattCharacteristic)
will simply add the packet to outgoing queue before returning the callback. Adding the next packet in the callback is much faster than the real transmission (also the speed depends on
the device chip manufacturer) and the queue may reach its limit. When does, the transmission stops and Android Bluetooth hangs. Using PRN procedure eliminates this problem as
the notification is send when all packets were delivered the queue is empty.
Note: this bug has been fixed on Android 6.0 Marshmallow and now no notifications are required. The onCharacteristicWrite callback will be
postponed until half of the queue is empty.
This constant is now deprecated. Please, use DfuServiceInitiator.setPacketsReceiptNotificationsValue(int)
to set it.
@Deprecated static final int SETTINGS_NUMBER_OF_PACKETS_DEFAULT
SETTINGS_NUMBER_OF_PACKETS
property. Different phones sent a different number of packets each connection interval. The values are (for tested phones):
DfuServiceInitiator.setPacketsReceiptNotificationsValue(int)
to set it.static final java.lang.String SETTINGS_MBR_SIZE
Size of the MBR (Master Boot Record) for the target chip. This applies only if you are using HEX files. The HEX_to_BIN parser included in the library will skip the addresses from 0 to this value. By default for nRF51 and the SoftDevice S110 this value is equal 4096 (0x1000 HEX) and for nRF52 has to be changed to 12288 (0x3000). If you want to send a firmware in HEX onto another MCU via nRF chip, set this value to 0.
If you are using the PC nrf util tool to create a ZIP Distribution Packet with the firmware and Init Packet this option does not apply as the nrf tool will convert HEX to BIN itself.
static final int SETTINGS_DEFAULT_MBR_SIZE
SETTINGS_DEFAULT_MBR_SIZE
,
Constant Field Values@Deprecated static final java.lang.String SETTINGS_ASSUME_DFU_NODE
The DfuBaseService
, when connected to a DFU target will check whether it is in application or in DFU bootloader mode. For DFU implementations from SDK 7.0 or newer
this is done by reading the value of DFU Version characteristic. If the returned value is equal to 0x0100 (major = 0, minor = 1) it means that we are in the application mode and
jump to the bootloader mode is required.
However, for DFU implementations from older SDKs, where there was no DFU Version characteristic, the service must guess. If this option is set to false (default) it will count number of device's services. If the count is equal to 3 (Generic Access, Generic Attribute, DFU Service) it will assume that it's in DFU mode. If greater than 3 - in app mode. This guessing may not be always correct. One situation may be when the nRF chip is used to flash update on external MCU using DFU. The DFU procedure may be implemented in the application, which may (and usually does) have more services. In such case set the value of this property to true.