ex

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers new_firmware_image_unpack_tool.h Source File

new_firmware_image_unpack_tool.h

00001 /*
00002  * NewFirmwareImageUnpackTool.h
00003  *
00004  *  Created on: 2016-7-12
00005  *      Author: duanlian01
00006  */
00007 
00008 #ifndef NEWFIRMWAREIMAGEUNPACKTOOL_H_
00009 #define NEWFIRMWAREIMAGEUNPACKTOOL_H_
00010 #include "IOtaUpdater.h"
00011 
00012 class OTAReporter;
00013 
00014 class NewFirmwareImageUnpackTool {
00015 public:
00016     NewFirmwareImageUnpackTool(unsigned int decompress_chunk_size, unsigned int resource_size, IOtaUpdater *updater, void *update_cxt, OTAReporter *reporter);
00017     virtual ~NewFirmwareImageUnpackTool();
00018     virtual int unpack_ota_package_begin();
00019     virtual int unpack_ota_package(unsigned char* data, unsigned int len);
00020   virtual int unpack_ota_package_end();
00021 
00022   virtual int update_image_begin();
00023     virtual int update_image();
00024   virtual int update_image_end();
00025 
00026 private:
00027     unsigned int resource_size;
00028   unsigned int resource_offset;
00029   double download_percent;
00030     unsigned int chunk_size;
00031     unsigned char *cache;
00032     unsigned int  in_size;
00033 
00034     void* verification_cxt;
00035   void* decompress_ctx;
00036 
00037   IOtaUpdater *updater;
00038   void *update_cxt;
00039 
00040   OTAReporter *m_pReporter;
00041 };
00042 
00043 #endif /* NEWFIRMWAREIMAGEUNPACKTOOL_H_ */