Download picasa web albums photos automatically. This application requires mpod mother board. See also http://mbed.org/users/geodenx/notebook/mpod/

Dependencies:   BlinkLed HTTPClient EthernetInterface FatFileSystemCpp MSCFileSystem mbed-rtos mbed

Download picasa web albums photos automatically.
This application requires mpod mother board.

Picasaウェブアルバムから、自動的に写真をダウンロードして、ディジタルフォトフレームに表示します。
動作させるには mpod マザーボード が必要です。
プログラムの中で、ご自分のアルバムのRSSファイルへのURLを指定してからご利用下さい。

album description edit information description

Committer:
togayan
Date:
Sat Sep 01 04:28:20 2012 +0000
Revision:
6:83383116c88a
Parent:
0:dfd5cfea7112
HTTPFile was changed to follow the latest HTTPClient library.; BlinkLed was isolated as a library.; Change LED port from LED1,2 to LED3,4 for the specification of pwmout.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
togayan 0:dfd5cfea7112 1 /* HTTPFile.h */
togayan 0:dfd5cfea7112 2 #ifndef HTTPFILE_H_
togayan 0:dfd5cfea7112 3 #define HTTPFILE_H_
togayan 0:dfd5cfea7112 4
togayan 0:dfd5cfea7112 5 #include "IHTTPData.h"
togayan 0:dfd5cfea7112 6 #include "FATFileSystem.h"
togayan 0:dfd5cfea7112 7 #include <string>
togayan 0:dfd5cfea7112 8
togayan 0:dfd5cfea7112 9 using std::string;
togayan 0:dfd5cfea7112 10
togayan 0:dfd5cfea7112 11 /** A data endpoint to store file
togayan 0:dfd5cfea7112 12 */
togayan 0:dfd5cfea7112 13 class HTTPFile : public IHTTPDataIn, public IHTTPDataOut
togayan 0:dfd5cfea7112 14 {
togayan 0:dfd5cfea7112 15 public:
togayan 0:dfd5cfea7112 16 /** Create an HTTPFile instance for input
togayan 0:dfd5cfea7112 17 * @param path Path of file to store the incoming string
togayan 0:dfd5cfea7112 18 */
togayan 0:dfd5cfea7112 19 HTTPFile(const char* path);
togayan 0:dfd5cfea7112 20
togayan 0:dfd5cfea7112 21 ~HTTPFile();
togayan 0:dfd5cfea7112 22
togayan 0:dfd5cfea7112 23 /** Forces file closure
togayan 0:dfd5cfea7112 24 */
togayan 0:dfd5cfea7112 25 void clear();
togayan 0:dfd5cfea7112 26
togayan 0:dfd5cfea7112 27 protected:
togayan 6:83383116c88a 28 /** Reset stream to its beginning
togayan 6:83383116c88a 29 * Called by the HTTPClient on each new request
togayan 6:83383116c88a 30 */
togayan 6:83383116c88a 31 virtual void readReset();
togayan 6:83383116c88a 32
togayan 0:dfd5cfea7112 33 /** Read a piece of data to be transmitted
togayan 0:dfd5cfea7112 34 * @param buf Pointer to the buffer on which to copy the data
togayan 0:dfd5cfea7112 35 * @param len Length of the buffer
togayan 0:dfd5cfea7112 36 * @param pReadLen Pointer to the variable on which the actual copied data length will be stored
togayan 0:dfd5cfea7112 37 */
togayan 0:dfd5cfea7112 38 virtual int read(char* buf, size_t len, size_t* pReadLen);
togayan 0:dfd5cfea7112 39
togayan 6:83383116c88a 40 /** Reset stream to its beginning
togayan 6:83383116c88a 41 * Called by the HTTPClient on each new request
togayan 6:83383116c88a 42 */
togayan 6:83383116c88a 43 virtual void writeReset();
togayan 6:83383116c88a 44
togayan 0:dfd5cfea7112 45 /** Write a piece of data transmitted by the server
togayan 0:dfd5cfea7112 46 * @param buf Pointer to the buffer from which to copy the data
togayan 0:dfd5cfea7112 47 * @param len Length of the buffer
togayan 0:dfd5cfea7112 48 */
togayan 0:dfd5cfea7112 49 virtual int write(const char* buf, size_t len);
togayan 0:dfd5cfea7112 50
togayan 0:dfd5cfea7112 51 /** Get MIME type
togayan 0:dfd5cfea7112 52 * @param type Internet media type from Content-Type header
togayan 0:dfd5cfea7112 53 */
togayan 0:dfd5cfea7112 54 virtual int getDataType(char* type, size_t maxTypeLen); //Internet media type for Content-Type header
togayan 0:dfd5cfea7112 55
togayan 0:dfd5cfea7112 56 /** Set MIME type
togayan 0:dfd5cfea7112 57 * @param type Internet media type from Content-Type header
togayan 0:dfd5cfea7112 58 */
togayan 0:dfd5cfea7112 59 virtual void setDataType(const char* type);
togayan 0:dfd5cfea7112 60
togayan 0:dfd5cfea7112 61 /** Determine whether the HTTP client should chunk the data
togayan 0:dfd5cfea7112 62 * Used for Transfer-Encoding header
togayan 0:dfd5cfea7112 63 */
togayan 0:dfd5cfea7112 64 virtual bool getIsChunked();
togayan 0:dfd5cfea7112 65
togayan 0:dfd5cfea7112 66 /** Determine whether the data is chunked
togayan 0:dfd5cfea7112 67 * Recovered from Transfer-Encoding header
togayan 0:dfd5cfea7112 68 */
togayan 0:dfd5cfea7112 69 virtual void setIsChunked(bool chunked);
togayan 0:dfd5cfea7112 70
togayan 0:dfd5cfea7112 71 /** If the data is not chunked, get its size
togayan 0:dfd5cfea7112 72 * Used for Content-Length header
togayan 0:dfd5cfea7112 73 */
togayan 0:dfd5cfea7112 74 virtual size_t getDataLen();
togayan 0:dfd5cfea7112 75
togayan 0:dfd5cfea7112 76 /** If the data is not chunked, set its size
togayan 0:dfd5cfea7112 77 * From Content-Length header
togayan 0:dfd5cfea7112 78 */
togayan 0:dfd5cfea7112 79 virtual void setDataLen(size_t len);
togayan 0:dfd5cfea7112 80
togayan 0:dfd5cfea7112 81 private:
togayan 0:dfd5cfea7112 82 bool openFile(const char* mode); //true on success, false otherwise
togayan 0:dfd5cfea7112 83 void closeFile();
togayan 0:dfd5cfea7112 84
togayan 0:dfd5cfea7112 85 FILE* m_fp;
togayan 0:dfd5cfea7112 86 string m_path;
togayan 0:dfd5cfea7112 87 size_t m_len;
togayan 0:dfd5cfea7112 88 bool m_chunked;
togayan 0:dfd5cfea7112 89 };
togayan 0:dfd5cfea7112 90
togayan 0:dfd5cfea7112 91 #endif /* HTTPFILE_H_ */