DfuServiceInitiator methods instead.@Deprecated public interface DfuSettingsConstants
PreferenceManager in previous versions of DFU Library.| Modifier and Type | Field and Description |
|---|---|
static String |
SETTINGS_ASSUME_DFU_NODE
Deprecated.
Use
DfuServiceInitiator.setForceDfu(boolean) instead. |
static String |
SETTINGS_MBR_SIZE
Deprecated.
Use
DfuServiceInitiator.setMbrSize(int) instead. |
static String |
SETTINGS_NUMBER_OF_PACKETS
Deprecated.
Use
DfuServiceInitiator.setPacketsReceiptNotificationsValue(int) to set it. |
static int |
SETTINGS_NUMBER_OF_PACKETS_DEFAULT
Deprecated.
Use
DfuServiceInitiator.setPacketsReceiptNotificationsValue(int) to set it. |
static String |
SETTINGS_PACKET_RECEIPT_NOTIFICATION_ENABLED
Deprecated.
|
@Deprecated static final String SETTINGS_PACKET_RECEIPT_NOTIFICATION_ENABLED
DfuServiceInitiator.setPacketsReceiptNotificationsEnabled(boolean) to set it.
If true (default) the Packet Receipt Notification procedure will be enabled.
See DFU documentation on
NordicSemi/DocLib
for more details. The number of packets before receiving a Packet Receipt Notification
is set with property SETTINGS_NUMBER_OF_PACKETS.
@Deprecated static final String SETTINGS_NUMBER_OF_PACKETS
DfuServiceInitiator.setPacketsReceiptNotificationsValue(int) to set it.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.
@Deprecated static final int SETTINGS_NUMBER_OF_PACKETS_DEFAULT
DfuServiceInitiator.setPacketsReceiptNotificationsValue(int) to set it.SETTINGS_NUMBER_OF_PACKETS property.
Different phones sent a different number of packets each connection interval.
The values are (for tested phones):
@Deprecated static final String SETTINGS_MBR_SIZE
DfuServiceInitiator.setMbrSize(int) instead.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.
@Deprecated static final String SETTINGS_ASSUME_DFU_NODE
DfuServiceInitiator.setForceDfu(boolean) instead.
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.