EspoTek/libdfuprog
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
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