Web server based weather station using Sparkfun Weather Meters.

Dependencies:   FatFileSystem mbed WeatherMeters SDFileSystem

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers homepage.h Source File

homepage.h

00001 /* Copyright 2012 Adam Green (http://mbed.org/users/AdamGreen/)
00002 
00003    Licensed under the Apache License, Version 2.0 (the "License");
00004    you may not use this file except in compliance with the License.
00005    You may obtain a copy of the License at
00006 
00007        http://www.apache.org/licenses/LICENSE-2.0
00008 
00009    Unless required by applicable law or agreed to in writing, software
00010    distributed under the License is distributed on an "AS IS" BASIS,
00011    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012    See the License for the specific language governing permissions and
00013    limitations under the License.
00014 */
00015 /* HTML for content to be returned from wind meter. */
00016 #ifndef _HOMEPAGE_H_
00017 #define _HOMEPAGE_H_
00018 
00019 static const char g_HomePageHTML[] = 
00020     "<html>\n" \
00021     "<header>\n" \
00022     "    <title>Green's Weather Station</title>\n" \
00023     "</header>\n" \
00024     "<body>\n" \
00025     "<h1 align=\"center\"><font color=\"green\">Green's Weather Station</font></h1>\n" \
00026     "<p>\n" \
00027     "    <br>\n" \
00028     "    <table border=\"1\" align=\"center\" cellpadding=\"10\">\n" \
00029     "        <tr align=\"center\">\n" \
00030     "            <td><strong>Current Wind Speed</strong></td>\n" \
00031     "            <td>%.1f km/h</td>\n" \
00032     "        </tr>\n" \
00033     "        <tr align=\"center\">\n" \
00034     "            <td><strong>Maximum Wind Speed</strong></td>\n" \
00035     "            <td>%.1f km/h</td>\n" \
00036     "        </tr>\n" \
00037     "        <tr align=\"center\">\n" \
00038     "            <td><strong>Wind Direction</strong></td>\n" \
00039     "            <td>%s</td>\n" \
00040     "        </tr>\n" \
00041     "        <tr align=\"center\">\n" \
00042     "            <td><strong>Rain Gauge</strong></td>\n" \
00043     "            <td>%.4f mm</td>\n" \
00044     "        </tr>\n" \
00045     "    </table>\n" \
00046     "</p>\n" \
00047     "<p align=\"center\">\n" \
00048     "    Measurements last reset %s ago.\n" \
00049     "</p>\n" \
00050     "<form align=\"center\" method=\"post\" action=\"/reset.html\">\n" \
00051     "     <input type=\"submit\" value=\"Reset Measurements\">\n" \
00052     "</form>\n" \
00053     "</body>\n" \
00054     "</html>\n";
00055 
00056 static const char g_OkStatusLine[] = "HTTP/1.0 200 OK\r\n";
00057 static const char g_HTMLHeaders[] = "Content-type: text/html\r\n";
00058 
00059 #endif /* _HOMEPAGE_H_ */