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:
Wed Aug 22 16:00:38 2012 +0000
Revision:
0:dfd5cfea7112
Child:
6:83383116c88a
1st version of mpod_picasa_photoframe

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 0:dfd5cfea7112 28 /** Read a piece of data to be transmitted
togayan 0:dfd5cfea7112 29 * @param buf Pointer to the buffer on which to copy the data
togayan 0:dfd5cfea7112 30 * @param len Length of the buffer
togayan 0:dfd5cfea7112 31 * @param pReadLen Pointer to the variable on which the actual copied data length will be stored
togayan 0:dfd5cfea7112 32 */
togayan 0:dfd5cfea7112 33 virtual int read(char* buf, size_t len, size_t* pReadLen);
togayan 0:dfd5cfea7112 34
togayan 0:dfd5cfea7112 35 /** Write a piece of data transmitted by the server
togayan 0:dfd5cfea7112 36 * @param buf Pointer to the buffer from which to copy the data
togayan 0:dfd5cfea7112 37 * @param len Length of the buffer
togayan 0:dfd5cfea7112 38 */
togayan 0:dfd5cfea7112 39 virtual int write(const char* buf, size_t len);
togayan 0:dfd5cfea7112 40
togayan 0:dfd5cfea7112 41 /** Get MIME type
togayan 0:dfd5cfea7112 42 * @param type Internet media type from Content-Type header
togayan 0:dfd5cfea7112 43 */
togayan 0:dfd5cfea7112 44 virtual int getDataType(char* type, size_t maxTypeLen); //Internet media type for Content-Type header
togayan 0:dfd5cfea7112 45
togayan 0:dfd5cfea7112 46 /** Set MIME type
togayan 0:dfd5cfea7112 47 * @param type Internet media type from Content-Type header
togayan 0:dfd5cfea7112 48 */
togayan 0:dfd5cfea7112 49 virtual void setDataType(const char* type);
togayan 0:dfd5cfea7112 50
togayan 0:dfd5cfea7112 51 /** Determine whether the HTTP client should chunk the data
togayan 0:dfd5cfea7112 52 * Used for Transfer-Encoding header
togayan 0:dfd5cfea7112 53 */
togayan 0:dfd5cfea7112 54 virtual bool getIsChunked();
togayan 0:dfd5cfea7112 55
togayan 0:dfd5cfea7112 56 /** Determine whether the data is chunked
togayan 0:dfd5cfea7112 57 * Recovered from Transfer-Encoding header
togayan 0:dfd5cfea7112 58 */
togayan 0:dfd5cfea7112 59 virtual void setIsChunked(bool chunked);
togayan 0:dfd5cfea7112 60
togayan 0:dfd5cfea7112 61 /** If the data is not chunked, get its size
togayan 0:dfd5cfea7112 62 * Used for Content-Length header
togayan 0:dfd5cfea7112 63 */
togayan 0:dfd5cfea7112 64 virtual size_t getDataLen();
togayan 0:dfd5cfea7112 65
togayan 0:dfd5cfea7112 66 /** If the data is not chunked, set its size
togayan 0:dfd5cfea7112 67 * From Content-Length header
togayan 0:dfd5cfea7112 68 */
togayan 0:dfd5cfea7112 69 virtual void setDataLen(size_t len);
togayan 0:dfd5cfea7112 70
togayan 0:dfd5cfea7112 71 private:
togayan 0:dfd5cfea7112 72 bool openFile(const char* mode); //true on success, false otherwise
togayan 0:dfd5cfea7112 73 void closeFile();
togayan 0:dfd5cfea7112 74
togayan 0:dfd5cfea7112 75 FILE* m_fp;
togayan 0:dfd5cfea7112 76 string m_path;
togayan 0:dfd5cfea7112 77 size_t m_len;
togayan 0:dfd5cfea7112 78 bool m_chunked;
togayan 0:dfd5cfea7112 79 };
togayan 0:dfd5cfea7112 80
togayan 0:dfd5cfea7112 81 #endif /* HTTPFILE_H_ */