ex
Fork of mbed-os-example-mbed5-blinky by
DuerOS-Light-SDK-v1.1.0/duer-os-light/src/iot-baidu-ota/baidu_ota_unpack/new_firmware_image_unpack_tool.h@47:9e361da97763, 2017-07-18 (annotated)
- Committer:
- TMBOY
- Date:
- Tue Jul 18 16:54:45 2017 +0800
- Revision:
- 47:9e361da97763
?
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| TMBOY | 47:9e361da97763 | 1 | /* |
| TMBOY | 47:9e361da97763 | 2 | * NewFirmwareImageUnpackTool.h |
| TMBOY | 47:9e361da97763 | 3 | * |
| TMBOY | 47:9e361da97763 | 4 | * Created on: 2016-7-12 |
| TMBOY | 47:9e361da97763 | 5 | * Author: duanlian01 |
| TMBOY | 47:9e361da97763 | 6 | */ |
| TMBOY | 47:9e361da97763 | 7 | |
| TMBOY | 47:9e361da97763 | 8 | #ifndef NEWFIRMWAREIMAGEUNPACKTOOL_H_ |
| TMBOY | 47:9e361da97763 | 9 | #define NEWFIRMWAREIMAGEUNPACKTOOL_H_ |
| TMBOY | 47:9e361da97763 | 10 | #include "IOtaUpdater.h" |
| TMBOY | 47:9e361da97763 | 11 | |
| TMBOY | 47:9e361da97763 | 12 | class OTAReporter; |
| TMBOY | 47:9e361da97763 | 13 | |
| TMBOY | 47:9e361da97763 | 14 | class NewFirmwareImageUnpackTool { |
| TMBOY | 47:9e361da97763 | 15 | public: |
| TMBOY | 47:9e361da97763 | 16 | NewFirmwareImageUnpackTool(unsigned int decompress_chunk_size, unsigned int resource_size, IOtaUpdater *updater, void *update_cxt, OTAReporter *reporter); |
| TMBOY | 47:9e361da97763 | 17 | virtual ~NewFirmwareImageUnpackTool(); |
| TMBOY | 47:9e361da97763 | 18 | virtual int unpack_ota_package_begin(); |
| TMBOY | 47:9e361da97763 | 19 | virtual int unpack_ota_package(unsigned char* data, unsigned int len); |
| TMBOY | 47:9e361da97763 | 20 | virtual int unpack_ota_package_end(); |
| TMBOY | 47:9e361da97763 | 21 | |
| TMBOY | 47:9e361da97763 | 22 | virtual int update_image_begin(); |
| TMBOY | 47:9e361da97763 | 23 | virtual int update_image(); |
| TMBOY | 47:9e361da97763 | 24 | virtual int update_image_end(); |
| TMBOY | 47:9e361da97763 | 25 | |
| TMBOY | 47:9e361da97763 | 26 | private: |
| TMBOY | 47:9e361da97763 | 27 | unsigned int resource_size; |
| TMBOY | 47:9e361da97763 | 28 | unsigned int resource_offset; |
| TMBOY | 47:9e361da97763 | 29 | double download_percent; |
| TMBOY | 47:9e361da97763 | 30 | unsigned int chunk_size; |
| TMBOY | 47:9e361da97763 | 31 | unsigned char *cache; |
| TMBOY | 47:9e361da97763 | 32 | unsigned int in_size; |
| TMBOY | 47:9e361da97763 | 33 | |
| TMBOY | 47:9e361da97763 | 34 | void* verification_cxt; |
| TMBOY | 47:9e361da97763 | 35 | void* decompress_ctx; |
| TMBOY | 47:9e361da97763 | 36 | |
| TMBOY | 47:9e361da97763 | 37 | IOtaUpdater *updater; |
| TMBOY | 47:9e361da97763 | 38 | void *update_cxt; |
| TMBOY | 47:9e361da97763 | 39 | |
| TMBOY | 47:9e361da97763 | 40 | OTAReporter *m_pReporter; |
| TMBOY | 47:9e361da97763 | 41 | }; |
| TMBOY | 47:9e361da97763 | 42 | |
| TMBOY | 47:9e361da97763 | 43 | #endif /* NEWFIRMWAREIMAGEUNPACKTOOL_H_ */ |
