Displays simple html web pages using the uVGA-II.
BasicWeb.h@3:5f688bcc92b9, 2013-03-06 (annotated)
- Committer:
- yaolu23
- Date:
- Wed Mar 06 18:17:39 2013 +0000
- Revision:
- 3:5f688bcc92b9
- Parent:
- 1:41f0491dcc4c
BasicWeb
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yaolu23 | 0:7fac52628f4e | 1 | #include "mbed.h" |
yaolu23 | 0:7fac52628f4e | 2 | #include "TFT_4DGL.h" |
yaolu23 | 0:7fac52628f4e | 3 | #include "HTTPClient.h" |
yaolu23 | 0:7fac52628f4e | 4 | #include "EthernetInterface.h" |
yaolu23 | 0:7fac52628f4e | 5 | |
yaolu23 | 0:7fac52628f4e | 6 | class BasicWeb{ |
yaolu23 | 1:41f0491dcc4c | 7 | |
yaolu23 | 1:41f0491dcc4c | 8 | public: |
yaolu23 | 1:41f0491dcc4c | 9 | |
yaolu23 | 1:41f0491dcc4c | 10 | BasicWeb(PinName tx, PinName rx, PinName reset); |
yaolu23 | 1:41f0491dcc4c | 11 | void browser(); |
yaolu23 | 1:41f0491dcc4c | 12 | void newKey(char scancode); |
yaolu23 | 1:41f0491dcc4c | 13 | void modKey(char scancode1, char scancode2); |
yaolu23 | 1:41f0491dcc4c | 14 | |
yaolu23 | 1:41f0491dcc4c | 15 | private: |
yaolu23 | 0:7fac52628f4e | 16 | |
yaolu23 | 0:7fac52628f4e | 17 | EthernetInterface eth; |
yaolu23 | 0:7fac52628f4e | 18 | HTTPClient http; |
yaolu23 | 0:7fac52628f4e | 19 | TFT_4DGL vga; |
yaolu23 | 0:7fac52628f4e | 20 | |
yaolu23 | 0:7fac52628f4e | 21 | // current string element and its modifiers |
yaolu23 | 0:7fac52628f4e | 22 | char* str; |
yaolu23 | 0:7fac52628f4e | 23 | int strSize; |
yaolu23 | 0:7fac52628f4e | 24 | bool bold; |
yaolu23 | 0:7fac52628f4e | 25 | bool title; |
yaolu23 | 0:7fac52628f4e | 26 | int font; |
yaolu23 | 0:7fac52628f4e | 27 | int color; |
yaolu23 | 0:7fac52628f4e | 28 | |
yaolu23 | 0:7fac52628f4e | 29 | char urlStr[100]; |
yaolu23 | 0:7fac52628f4e | 30 | char titleStr[30]; |
yaolu23 | 0:7fac52628f4e | 31 | char text[10240]; // holds html text web pages |
yaolu23 | 0:7fac52628f4e | 32 | int urlIndex; |
yaolu23 | 0:7fac52628f4e | 33 | int lineIndex; // current row on screen to print at |
yaolu23 | 0:7fac52628f4e | 34 | int index; // current index of text |
yaolu23 | 0:7fac52628f4e | 35 | static const unsigned char table[160]; // PS2 scancode to ASCII table |
yaolu23 | 0:7fac52628f4e | 36 | |
yaolu23 | 0:7fac52628f4e | 37 | void displayUrl(); |
yaolu23 | 0:7fac52628f4e | 38 | void displayPage(); |
yaolu23 | 0:7fac52628f4e | 39 | void parseStr(); |
yaolu23 | 0:7fac52628f4e | 40 | bool applyTag(); |
yaolu23 | 0:7fac52628f4e | 41 | bool compareTag(char* s, char* tag); |
yaolu23 | 0:7fac52628f4e | 42 | bool extractStr(); |
yaolu23 | 0:7fac52628f4e | 43 | bool printText(char* s); |
yaolu23 | 0:7fac52628f4e | 44 | void removeRL(char* s, int size); |
yaolu23 | 0:7fac52628f4e | 45 | void copyStr(char* s1, char* s2, int size); |
yaolu23 | 0:7fac52628f4e | 46 | }; |