libPocuter 1.0 Support library for programming the Pocuter

PocuterHTTP.h
Go to the documentation of this file.
1
2 #ifndef POCUTERHTTP_H
3 #define POCUTERHTTP_H
4
9 class PocuterHTTP {
10 public:
11 enum HTTPERROR {
12 HTTPERROR_OK = 0,
13 HTTPERROR_CONNECT_FAILED,
14 HTTPERROR_NO_MEMORY,
15 HTTPERROR_FILE_OPEN_FAILED,
16 HTTPERROR_DOWNLOAD_FAILED,
17 HTTPERROR_MORE_STEPS,
18 HTTPERROR_UNKNOWN
19
20
21 };
22
32 virtual HTTPERROR downloadFile(const uint8_t* url, const uint8_t* destination, bool stepwise, uint8_t *percent, const uint8_t* PEMcert = NULL) = 0;
33
43 virtual HTTPERROR getResponse(const uint8_t* url, uint8_t* response, size_t maxSize, uint16_t timeout = 5000, const uint8_t* PEMcert = NULL) = 0;
44 private:
45
46 };
47
48 #endif /* POCUTERHTTP_H */
49
PocuterHTTP
HTTP(S) download.
Definition: PocuterHTTP.h:9
PocuterHTTP::HTTPERROR_UNKNOWN
@ HTTPERROR_UNKNOWN
Definition: PocuterHTTP.h:18
PocuterHTTP::HTTPERROR_FILE_OPEN_FAILED
@ HTTPERROR_FILE_OPEN_FAILED
Definition: PocuterHTTP.h:15
PocuterHTTP::HTTPERROR_CONNECT_FAILED
@ HTTPERROR_CONNECT_FAILED
Definition: PocuterHTTP.h:13
PocuterHTTP::getResponse
virtual HTTPERROR getResponse(const uint8_t *url, uint8_t *response, size_t maxSize, uint16_t timeout=5000, const uint8_t *PEMcert=NULL)=0
sends a get request to a server
PocuterHTTP::HTTPERROR_DOWNLOAD_FAILED
@ HTTPERROR_DOWNLOAD_FAILED
Definition: PocuterHTTP.h:16
PocuterHTTP::HTTPERROR
HTTPERROR
Definition: PocuterHTTP.h:11
PocuterHTTP::HTTPERROR_NO_MEMORY
@ HTTPERROR_NO_MEMORY
Definition: PocuterHTTP.h:14
PocuterHTTP::HTTPERROR_OK
@ HTTPERROR_OK
Definition: PocuterHTTP.h:12
PocuterHTTP::downloadFile
virtual HTTPERROR downloadFile(const uint8_t *url, const uint8_t *destination, bool stepwise, uint8_t *percent, const uint8_t *PEMcert=NULL)=0
download a file from web
PocuterHTTP::HTTPERROR_MORE_STEPS
@ HTTPERROR_MORE_STEPS
Definition: PocuterHTTP.h:17