Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of MbedSmartRest by
MbedClient.h@5:ab909221d22d, 2014-01-30 (annotated)
- Committer:
- vwochnik
- Date:
- Thu Jan 30 11:11:39 2014 +0000
- Revision:
- 5:ab909221d22d
- Parent:
- 3:ce2f116369bd
- Child:
- 13:e76920d5e1ec
fix
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| vwochnik | 3:ce2f116369bd | 1 | #ifndef MBEDCLIENT_H |
| vwochnik | 3:ce2f116369bd | 2 | #define MBEDCLIENT_H |
| vwochnik | 3:ce2f116369bd | 3 | |
| vwochnik | 3:ce2f116369bd | 4 | #include "AbstractClient.h" |
| vwochnik | 3:ce2f116369bd | 5 | #include "HTTPBuffer.h" |
| vwochnik | 3:ce2f116369bd | 6 | #include "HTTPGeneratorWrapper.h" |
| vwochnik | 3:ce2f116369bd | 7 | #include "HTTPClient.h" |
| vwochnik | 3:ce2f116369bd | 8 | |
| vwochnik | 3:ce2f116369bd | 9 | class MbedClient : public AbstractClient { |
| vwochnik | 3:ce2f116369bd | 10 | public: |
| vwochnik | 3:ce2f116369bd | 11 | MbedClient(const char*, const char*, const char*); |
| vwochnik | 5:ab909221d22d | 12 | ~MbedClient(); |
| vwochnik | 3:ce2f116369bd | 13 | |
| vwochnik | 3:ce2f116369bd | 14 | uint8_t beginRequest(); |
| vwochnik | 3:ce2f116369bd | 15 | uint8_t sendIdentifier(const char*); |
| vwochnik | 3:ce2f116369bd | 16 | uint8_t sendData(DataGenerator& generator); |
| vwochnik | 3:ce2f116369bd | 17 | uint8_t endRequest(); |
| vwochnik | 3:ce2f116369bd | 18 | uint8_t awaitResponse(); |
| vwochnik | 3:ce2f116369bd | 19 | AbstractDataSource& receiveData(); |
| vwochnik | 3:ce2f116369bd | 20 | void stop(); |
| vwochnik | 3:ce2f116369bd | 21 | |
| vwochnik | 3:ce2f116369bd | 22 | private: |
| vwochnik | 3:ce2f116369bd | 23 | const char *_url, *_username, *_password; |
| vwochnik | 3:ce2f116369bd | 24 | HTTPClient _client; |
| vwochnik | 5:ab909221d22d | 25 | HTTPGeneratorWrapper *_generator; |
| vwochnik | 3:ce2f116369bd | 26 | HTTPBuffer _buffer; |
| vwochnik | 3:ce2f116369bd | 27 | uint8_t _state; |
| vwochnik | 5:ab909221d22d | 28 | const char *_headers[2]; |
| vwochnik | 3:ce2f116369bd | 29 | }; |
| vwochnik | 3:ce2f116369bd | 30 | |
| vwochnik | 3:ce2f116369bd | 31 | #endif |
