Skip to content

dfu-programmer, but with build scripts to make it buildable as a dynamic lib.

License

Notifications You must be signed in to change notification settings

EspoTek/libdfuprog

 
 

Repository files navigation

libdfuprog is a fork of dfu-programmer with a bunch of hacky build scripts added so you can build it as a dynamic library.

It also adds support for Android versions 4 and later (including 7 and I think 8), via Vianney le Clément de Saint-Marcq's libusb fork.

To build it, run bootstrap.sh, then libdfuprog_make_<your_platform_here>.
You might need some prerequisites; check the original dfu-programmer page as well as libdfuprog_instructions in this repo.

After building, rename main.h to libdfuprog.h (AFTER building), and then add it to your includes.  Also don't forget to add libdfuprog-0.9.so to your libs.  :)

You can then make dfu commands by treating libdfuprog_virtual_cmd() as if it were a terminal running dfu-programmer!
Implementation is  a bit hacky on Android, as it closes the llibusb handle before returning...
Fortunately it's easy to make another one!

Check out the androidUsbDriver.cpp and unixUsbDriver.cpp files in my other repo (Labrador) for an example of how to use it:
https://github.com/EspoTek/Labrador

About

dfu-programmer, but with build scripts to make it buildable as a dynamic lib.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 90.3%
  • Shell 9.0%
  • Other 0.7%