npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugin-bluenet-dfu

v0.0.2

Published

Upload bluenet code over DFU

Downloads

7

Readme

Cordova plugin for DFU upload (Android ONLY)

The plugin uses the Nordic Android DFU Library available here and provides an uploadFirmware function for Cordova.

The following functions are available:

  1. uploadFirmware(updateCallback, errorCallback, parameter) both callback functions return json objects
return: {
	'status': String, status, such as connecting, disconnecting, progress, completed, etc.
	'progress': Integer, percentage of current upload prograss, min 1, max 100, (only if status == progress)
	'speed': Float, upload speed in Mb/s (only if status == progress)
	'avg_speed': Float, average upload speed in Mb/s (only if status == progress)
}

the parameter object has to be a json with the following fields:

parameter: {
	'address': String, bluetooth address of the device (required)
	'name': String, name of the device (required)
	'filePath': String, absolut path of the file which should be uploaded (required*)
	'fileUri': String, absolut path as an Uri, has to be encoded with encodeUri() (required*)
	'fileType': Integer, type of uploaded file, see Android DFU Library for details (optional, default TYPE_APPLICATION)
	'initFilePath': String, absolut path of the init file (optional*, default null which means no init file used)
	'initFileUri': String, absolut path of the init file as an Uri, has to be encoded with encodeUri() (optional*)
	'keepBond': Boolean, see Android DFU Library for details (optional, default false)
}

fields with a * means they are mutually exclusive, with the path having the priority. E.g. only 1 of the filePath or fileUri has to be provided. If both are provided, the Path is used. Same for the init file which is optional and doesn't have to be provided.

Update Nordic Library

  1. Download nordic library from https://github.com/NordicSemiconductor/Android-DFU-Library
  2. Create an Eclipse Android library project as described on https://github.com/NordicSemiconductor/Android-DFU-Library/tree/release/documentation#eclipse (ignore step 6)
  3. Copy the content of the Eclipse Android Library to the folder src/android/LibraryProject
  4. copy file src/android/FakeR.java to src/android/LibraryProject/src/no/nordicsemi/android
  5. Update src/android/LibraryProject/src/no/nordicsemi/android/dfu/DfuBaseService.java:
    1. add import no.nordicsemi.android.FakeR;
    2. create field private FakeR fakeR;
    3. assign field in onCreate: fakeR = new FakeR(this);
    4. replace all occurrences of getString(R.id.string.xxx) by getString(fakeR.getId("string", "xxx"))
    5. replace all occurrences of getString(R.string.xxx, yyy) String.format(getString(fakeR.getId("string", "xxx")), yyy)
    6. replace all occurrences of BuildConfig.DEBUG by (Boolean)fakeR.getBuildConfigValue("DEBUG")

Copyrights

The copyrights (2014-2015) for the code belongs to the team of Distributed Organisms B.V. and are provided under an noncontagious open-source license:

  • Authors: Dominik Egger
  • Date: 27. Jul. 2015
  • License: LGPL v3+, Apache, or MIT, your choice
  • Almende B.V., http://www.almende.com and DoBots B.V., http://www.dobots.nl
  • Rotterdam, The Netherlands