A wrapper class for talking to Axeda from MBED devices. Uses HTTPClient and MbedJSONValue classes.
Dependents: axeda_wrapper_dev MTS_Axeda_Example
AxedaWrapper simplifies pushing data to Axeda's cloud.
Uses HTTPClient and MbedJSONValue libs:
http://mbed.org/users/donatien/code/HTTPClient/
http://mbed.org/users/samux/code/MbedJSONValue/
HTTPJsonText.h@6:aa0594410aa9, 2014-01-04 (annotated)
- Committer:
- mfiore
- Date:
- Sat Jan 04 08:00:38 2014 +0000
- Revision:
- 6:aa0594410aa9
- Parent:
- 1:d42aaf6f2e19
shorten HTTPClient timeout to 5 seconds
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mfiore | 1:d42aaf6f2e19 | 1 | #ifndef HTTPJSONTEXT_H_ |
mfiore | 1:d42aaf6f2e19 | 2 | #define HTTPJSONTEXT_H_ |
mfiore | 1:d42aaf6f2e19 | 3 | |
mfiore | 1:d42aaf6f2e19 | 4 | #include "HTTPText.h" |
mfiore | 1:d42aaf6f2e19 | 5 | |
mfiore | 1:d42aaf6f2e19 | 6 | /** A data endpoint to store text |
mfiore | 1:d42aaf6f2e19 | 7 | */ |
mfiore | 1:d42aaf6f2e19 | 8 | class HTTPJsonText: public HTTPText |
mfiore | 1:d42aaf6f2e19 | 9 | { |
mfiore | 1:d42aaf6f2e19 | 10 | public: |
mfiore | 1:d42aaf6f2e19 | 11 | HTTPJsonText(char* arg); |
mfiore | 1:d42aaf6f2e19 | 12 | |
mfiore | 1:d42aaf6f2e19 | 13 | protected: |
mfiore | 1:d42aaf6f2e19 | 14 | virtual int getDataType(char* type, size_t maxTypeLen); //Internet media type for Content-Type header |
mfiore | 1:d42aaf6f2e19 | 15 | }; |
mfiore | 1:d42aaf6f2e19 | 16 | |
mfiore | 1:d42aaf6f2e19 | 17 | HTTPJsonText::HTTPJsonText(char* arg) : HTTPText(arg) {} |
mfiore | 1:d42aaf6f2e19 | 18 | |
mfiore | 1:d42aaf6f2e19 | 19 | /*virtual*/ int HTTPJsonText::getDataType(char* type, size_t maxTypeLen) //Internet media type for Content-Type header |
mfiore | 1:d42aaf6f2e19 | 20 | { |
mfiore | 1:d42aaf6f2e19 | 21 | strncpy(type, "application/json", maxTypeLen-1); |
mfiore | 1:d42aaf6f2e19 | 22 | type[maxTypeLen-1] = '\0'; |
mfiore | 1:d42aaf6f2e19 | 23 | return 0; |
mfiore | 1:d42aaf6f2e19 | 24 | } |
mfiore | 1:d42aaf6f2e19 | 25 | |
mfiore | 1:d42aaf6f2e19 | 26 | #endif /* HTTPJSONTEXT_H_ */ |