libPocuter 1.0 Support library for programming the Pocuter

PocuterOTA.h
Go to the documentation of this file.
1 #ifndef POCUTEROTA_H
2 #define POCUTEROTA_H
3 #include <stdint.h>
4 #include <stddef.h>
5 #include <vector>
6
7 class PocuterOTA {
8 public:
9 enum POCUTER_PARTITION {
10 PART_APPLOADER,
11 PART_APP1,
12
13 PART_UNKNOWN
14 };
15 enum OTAERROR {
16 OTAERROR_OK = 0,
17 OTAERROR_PATITION_NOT_AVAILABLE,
18 OTAERROR_PATITION_IN_USE,
19 OTAERROR_FILE_NOT_FOUND,
20 OTAERROR_NO_SD_CARD,
21 OTAERROR_FLASHING_FAILED,
22 OTAERROR_MORE_STEPS,
23 OTAERROR_APP_READ_ERROR,
24
25 OTAERROR_UNKNOWN
26 };
27 virtual OTAERROR setNextAppID(uint64_t appID) = 0;
28 virtual OTAERROR getApps(std::vector<uint64_t>* apps, int maxLength, int offset) = 0;
29 virtual uint32_t getAppsCount() = 0;
30 virtual OTAERROR getAppVersion(uint64_t appID, uint8_t* major, uint8_t* minor, uint8_t* patch) = 0;
31 virtual OTAERROR flashFromSDCard(uint64_t appID, POCUTER_PARTITION partition, bool checkSigning = false, bool stepwise = false, uint8_t *percent = NULL) = 0;
32 virtual OTAERROR bootPartition(POCUTER_PARTITION partition) = 0;
33 virtual POCUTER_PARTITION getCurrentPartition() = 0;
34 virtual OTAERROR restart() = 0;
35
36 virtual OTAERROR verifyPartition(POCUTER_PARTITION partition) = 0;
37 virtual OTAERROR forceBootloaderToReflashApp() = 0;
38
39
40 private:
41
42 };
43
44
45 #endif /* POCUTEROTA_H */
46
PocuterOTA::forceBootloaderToReflashApp
virtual OTAERROR forceBootloaderToReflashApp()=0
PocuterOTA::OTAERROR_PATITION_IN_USE
@ OTAERROR_PATITION_IN_USE
Definition: PocuterOTA.h:18
PocuterOTA::OTAERROR_FLASHING_FAILED
@ OTAERROR_FLASHING_FAILED
Definition: PocuterOTA.h:21
PocuterOTA::OTAERROR_UNKNOWN
@ OTAERROR_UNKNOWN
Definition: PocuterOTA.h:25
PocuterOTA
Definition: PocuterOTA.h:7
PocuterOTA::getApps
virtual OTAERROR getApps(std::vector< uint64_t > *apps, int maxLength, int offset)=0
PocuterOTA::getAppsCount
virtual uint32_t getAppsCount()=0
PocuterOTA::OTAERROR
OTAERROR
Definition: PocuterOTA.h:15
PocuterOTA::POCUTER_PARTITION
POCUTER_PARTITION
Definition: PocuterOTA.h:9
PocuterOTA::OTAERROR_APP_READ_ERROR
@ OTAERROR_APP_READ_ERROR
Definition: PocuterOTA.h:23
PocuterOTA::PART_APPLOADER
@ PART_APPLOADER
Definition: PocuterOTA.h:10
PocuterOTA::verifyPartition
virtual OTAERROR verifyPartition(POCUTER_PARTITION partition)=0
PocuterOTA::OTAERROR_NO_SD_CARD
@ OTAERROR_NO_SD_CARD
Definition: PocuterOTA.h:20
PocuterOTA::getAppVersion
virtual OTAERROR getAppVersion(uint64_t appID, uint8_t *major, uint8_t *minor, uint8_t *patch)=0
PocuterOTA::OTAERROR_FILE_NOT_FOUND
@ OTAERROR_FILE_NOT_FOUND
Definition: PocuterOTA.h:19
PocuterOTA::setNextAppID
virtual OTAERROR setNextAppID(uint64_t appID)=0
PocuterOTA::OTAERROR_PATITION_NOT_AVAILABLE
@ OTAERROR_PATITION_NOT_AVAILABLE
Definition: PocuterOTA.h:17
PocuterOTA::PART_UNKNOWN
@ PART_UNKNOWN
Definition: PocuterOTA.h:13
PocuterOTA::OTAERROR_OK
@ OTAERROR_OK
Definition: PocuterOTA.h:16
PocuterOTA::bootPartition
virtual OTAERROR bootPartition(POCUTER_PARTITION partition)=0
PocuterOTA::PART_APP1
@ PART_APP1
Definition: PocuterOTA.h:11
PocuterOTA::OTAERROR_MORE_STEPS
@ OTAERROR_MORE_STEPS
Definition: PocuterOTA.h:22
PocuterOTA::restart
virtual OTAERROR restart()=0
PocuterOTA::getCurrentPartition
virtual POCUTER_PARTITION getCurrentPartition()=0
PocuterOTA::flashFromSDCard
virtual OTAERROR flashFromSDCard(uint64_t appID, POCUTER_PARTITION partition, bool checkSigning=false, bool stepwise=false, uint8_t *percent=NULL)=0