diff options
| author | JF <jf@codingfield.com> | 2020-05-24 09:15:59 +0200 |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2020-05-24 09:15:59 +0200 |
| commit | 3cc76d7673f6a3b8b5253d04b358b440e550fdb4 (patch) | |
| tree | d21c4e3b54e13bdc9fdeaa28a2a5b8c8081f9f18 /src/Components/Ble/DfuService.h | |
| parent | ce328636935dbc580aad1245fdaff54d6ba947a3 (diff) | |
Working demo of OTA using MCUBoot https://github.com/lupyuen/pinetime-rust-mynewt/releases/tag/v4.1.4
Diffstat (limited to 'src/Components/Ble/DfuService.h')
| -rw-r--r-- | src/Components/Ble/DfuService.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Components/Ble/DfuService.h b/src/Components/Ble/DfuService.h index e22e09f0..c8351ede 100644 --- a/src/Components/Ble/DfuService.h +++ b/src/Components/Ble/DfuService.h @@ -18,6 +18,7 @@ namespace Pinetime { DfuService(Pinetime::System::SystemTask& systemTask, Pinetime::Controllers::Ble& bleController, Pinetime::Drivers::SpiNorFlash& spiNorFlash); void Init(); + void Validate(); int OnServiceData(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt *context); private: @@ -89,11 +90,12 @@ namespace Pinetime { uint8_t nbPacketsToNotify = 0; uint32_t nbPacketReceived = 0; uint32_t bytesReceived = 0; - uint32_t writeOffset = 0; //0x40000; + uint32_t writeOffset = 0x40000; uint32_t softdeviceSize = 0; uint32_t bootloaderSize = 0; - uint32_t applicationSize = 115200; + uint32_t applicationSize = 0; + static constexpr uint32_t maxImageSize = 475136; int SendDfuRevision(os_mbuf *om) const; void SendNotification(uint16_t connectionHandle, const uint8_t *data, const size_t size); @@ -103,9 +105,10 @@ namespace Pinetime { uint8_t tempBuffer[200]; uint16_t ComputeCrc(uint8_t const * p_data, uint32_t size, uint16_t const * p_crc); - void Validate(); bool firstCrc = true; uint16_t tempCrc = 0; + + void WriteMagicNumber(); }; } }
\ No newline at end of file |
