This library allows you to do a Device Firmware Update (DFU) of your nrf51 or nrf52 chip from Nordic Semiconductor. It works for both iOS and Android.
For more info about the DFU process, see: Resources
This is a fork from the main library!
If need the main documentation you can find it here.
This fork contains the latest verisons of iOSDFULibrary
& Android-BLE-Library
.
Install and link the NPM package per usual with
npm install --save https://github.com/Salt-PepperEngineering/react-native-nordic-dfu
or
yarn add https://github.com/Salt-PepperEngineering/react-native-nordic-dfu
For React Native below 60.0 version
react-native link react-native-nordic-dfu
Unfortunately, the ios project is written in Objective-C so you will need to use use_frameworks! :linkage => :static
.
Note: We are considering rewriting the ios module on Swift, but it depends very much on how much free time we have and how much we needed right now.
Podfile
:
target "YourApp" do
...
pod "react-native-nordic-dfu", path: "../node_modules/react-native-nordic-dfu"
...
use_frameworks! :linkage => :static
...
end
AppDelegate.mm
:
...
#import "RNNordicDfu.h"
...
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...
[RNNordicDfu setCentralManagerGetter:^() {
return [[CBCentralManager alloc] initWithDelegate:nil queue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0)];
}];
// Reset manager delegate since the Nordic DFU lib "steals" control over it
[RNNordicDfu setOnDFUComplete:^() {
NSLog(@"onDFUComplete");
}];
[RNNordicDfu setOnDFUError:^() {
NSLog(@"onDFUError");
}];
...
}
- DFU Introduction
- Secure DFU Introduction
- How to create init packet
- nRF51 Development Kit (DK) (compatible with Arduino Uno Revision 3)
- nRF52 Development Kit (DK) (compatible with Arduino Uno Revision 3)