This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Extend the DFU library

Hi, in want to extend the DFU library (Android and iOS) with a function similar to setBinOrHex(). But instead of a filename, i want to give a byte array with the init packet and a 2nd byte array with the application, bootloader and/or softdevice (or 3 byte arrays for each part of code). An other way might by to provide the ZIP file as a byte array. What is the best way or where is the best place to insert such a function. Thanks!

Parents
  • Hi Aleksander! Sure, it would be easier so store the file temporairly. But for security reasons this is not an option. I have added a function "setZip(byte[] zipBuffer), extended the "start()" - function and "onHandleIntend()" with a additional EXTRA... and take care if the zipBuffer is provided in the intent handler. Finally, i open the InputStream() in this way: is = new ArchiveInputStream(new ByteArrayInputStream(zipBuffer), mbrSize, fileType); So far it works. I know i must merge my functions to a new library version by myelf. Thanks!

Reply
  • Hi Aleksander! Sure, it would be easier so store the file temporairly. But for security reasons this is not an option. I have added a function "setZip(byte[] zipBuffer), extended the "start()" - function and "onHandleIntend()" with a additional EXTRA... and take care if the zipBuffer is provided in the intent handler. Finally, i open the InputStream() in this way: is = new ArchiveInputStream(new ByteArrayInputStream(zipBuffer), mbrSize, fileType); So far it works. I know i must merge my functions to a new library version by myelf. Thanks!

Children
No Data
Related