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.
BasicWeb.h@0:7fac52628f4e, 2013-03-06 (annotated)
- Committer:
- yaolu23
- Date:
- Wed Mar 06 16:13:02 2013 +0000
- Revision:
- 0:7fac52628f4e
- Child:
- 1:41f0491dcc4c
Project 3: Basic Web Browser
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 | 0:7fac52628f4e | 7 | |
| yaolu23 | 0:7fac52628f4e | 8 | EthernetInterface eth; |
| yaolu23 | 0:7fac52628f4e | 9 | HTTPClient http; |
| yaolu23 | 0:7fac52628f4e | 10 | TFT_4DGL vga; |
| yaolu23 | 0:7fac52628f4e | 11 | |
| yaolu23 | 0:7fac52628f4e | 12 | // current string element and its modifiers |
| yaolu23 | 0:7fac52628f4e | 13 | char* str; |
| yaolu23 | 0:7fac52628f4e | 14 | int strSize; |
| yaolu23 | 0:7fac52628f4e | 15 | bool bold; |
| yaolu23 | 0:7fac52628f4e | 16 | bool title; |
| yaolu23 | 0:7fac52628f4e | 17 | int font; |
| yaolu23 | 0:7fac52628f4e | 18 | int color; |
| yaolu23 | 0:7fac52628f4e | 19 | |
| yaolu23 | 0:7fac52628f4e | 20 | char urlStr[100]; |
| yaolu23 | 0:7fac52628f4e | 21 | char titleStr[30]; |
| yaolu23 | 0:7fac52628f4e | 22 | char text[10240]; // holds html text web pages |
| yaolu23 | 0:7fac52628f4e | 23 | int urlIndex; |
| yaolu23 | 0:7fac52628f4e | 24 | int lineIndex; // current row on screen to print at |
| yaolu23 | 0:7fac52628f4e | 25 | int index; // current index of text |
| yaolu23 | 0:7fac52628f4e | 26 | static const unsigned char table[160]; // PS2 scancode to ASCII table |
| yaolu23 | 0:7fac52628f4e | 27 | |
| yaolu23 | 0:7fac52628f4e | 28 | public: |
| yaolu23 | 0:7fac52628f4e | 29 | BasicWeb(PinName tx, PinName rx, PinName reset); |
| yaolu23 | 0:7fac52628f4e | 30 | void browser(); |
| yaolu23 | 0:7fac52628f4e | 31 | void displayUrl(); |
| yaolu23 | 0:7fac52628f4e | 32 | void displayPage(); |
| yaolu23 | 0:7fac52628f4e | 33 | void parseStr(); |
| yaolu23 | 0:7fac52628f4e | 34 | bool applyTag(); |
| yaolu23 | 0:7fac52628f4e | 35 | bool compareTag(char* s, char* tag); |
| yaolu23 | 0:7fac52628f4e | 36 | bool extractStr(); |
| yaolu23 | 0:7fac52628f4e | 37 | void newKey(char scancode); |
| yaolu23 | 0:7fac52628f4e | 38 | void modKey(char scancode1, char scancode2); |
| yaolu23 | 0:7fac52628f4e | 39 | bool printText(char* s); |
| yaolu23 | 0:7fac52628f4e | 40 | void removeRL(char* s, int size); |
| yaolu23 | 0:7fac52628f4e | 41 | void copyStr(char* s1, char* s2, int size); |
| yaolu23 | 0:7fac52628f4e | 42 | }; |