RF24Ethernet - TCP/IP over RF24Network v2.0.1
TMRh20 - Pushing the practical limits of RF24 modules
Loading...
Searching...
No Matches
HTML.h File Reference

Go to the source code of this file.

Macros

#define strncpy_P   strncpy
#define OUTPUT_BUFFER_SIZE   MAX_PAYLOAD_SIZE

Functions

void sendPage (EthernetClient &_client, const char *_pointer, size_t size)
void main_page (EthernetClient &_client)
void credits_page (EthernetClient &_client)
void stats_page (EthernetClient &_client)

Variables

bool led_state = 0
static const PROGMEM char begin_html []
static const PROGMEM char main_html_p1 []
static const PROGMEM char main_html_p2 []
static const PROGMEM char credits_html []
static const PROGMEM char html_page []

Detailed Description

This file is used for html code in the InteractiveServer_Mesh example

Definition in file HTML.h.

Macro Definition Documentation

◆ strncpy_P

#define strncpy_P   strncpy

Definition at line 7 of file HTML.h.

Referenced by stats_page().

◆ OUTPUT_BUFFER_SIZE

#define OUTPUT_BUFFER_SIZE   MAX_PAYLOAD_SIZE

Definition at line 10 of file HTML.h.

Function Documentation

◆ sendPage()

void sendPage ( EthernetClient & _client,
const char * _pointer,
size_t size )

This function reads from a specified program memory buffer, and sends the data to the client in chunks equal to the max output buffer size or less This allows the HTML code to be modified as desired, with no need to change any other code

Definition at line 97 of file HTML.h.

References EthernetClient.

Referenced by credits_page(), and main_page().

◆ main_page()

◆ credits_page()

void credits_page ( EthernetClient & _client)

◆ stats_page()

void stats_page ( EthernetClient & _client)

Variable Documentation

◆ led_state

bool led_state = 0
Examples
InteractiveServer_Mesh.ino, and InteractiveServer_Mesh_Headless.ino.

Definition at line 12 of file HTML.h.

Referenced by main_page().

◆ begin_html

const PROGMEM char begin_html[]
static
Initial value:
= "HTTP/1.1 200 OK\r\n"
"Content-Type: text/html\r\n"
"Connection: close\r\n\n"
"<!DOCTYPE HTML>\n"
"<html><head>"
"<style>\n"
"body{background-color:linen; text-align: center}"
"table.center{margin-left:auto;margin-right:auto;}"
"</style>"
"</head>"

This page stores the actual HTML code that will be presented. The data is stored in program memory as a single long string, and is presented below in a manageable format

Definition at line 24 of file HTML.h.

Referenced by credits_page(), and main_page().

◆ main_html_p1

const PROGMEM char main_html_p1[]
static
Initial value:
=
"<body>"
"<img src='http://arduino.cc/en/uploads/Trademark/ArduinoCommunityLogo.png'"
"style='width:383px;height:162px'>"
"<br><b>Hello From Arduino!</b><br>\n"
"<br><br> LED/Digital Pin Control:"
"<br><br>\n<table class = 'center'>"

main html part 1

Definition at line 40 of file HTML.h.

Referenced by main_page().

◆ main_html_p2

const PROGMEM char main_html_p2[]
static
Initial value:
=
"<tr><td><a href='/ON'>Turn LED On</a>"
"<br></td><td><a href='/OF'>Turn LED Off</a>"
"<br></td></tr></table><br><a href='/ST'>"
"Stats</a> <a href='/CR'>Credits</a>"
"</body></html>"

main html part 2

Definition at line 51 of file HTML.h.

Referenced by main_page().

◆ credits_html

const PROGMEM char credits_html[]
static
Initial value:
= "<body>"
"<img src='http://arduino.cc/en/uploads/Trademark/ArduinoCommunityLogo.png'"
"style='width:383px;height:162px'>"
"<br><b>Credits:</b><br><table class='center'><tr>"
"<td>RF24Ethernet by </td>"
"<td><a href='https://github.com/tmrh20'> TMRh20</a></td>"
"</tr><tr>"
"<td>uIP by</td>"
"<td><a href='https://github.com/adamdunkels/uip'> Adam Dunkels</a></td>"
"</tr><tr>"
"<td>Based on</td>"
"<td><a href='https://github.com/ntruchsess/arduino_uip'> UIPEthernet</a></td>"
"</tr><tr>"
"<td>Documentation:</td><td> <a href='http://nRF24.github.io/RF24Ethernet/'>github.io</a></td>"
"</tr>"
"</tr><tr>"
"<td>RF24toTUN creator:</td><td> <a href='https://github.com/reixd/'>Reixd</a></td>"
"</tr>"
"</table>"
"<br>And everybody who contributed to RF24 and RF24Network"
"<br><br><a href='/'>Home</a>"
"</body>"
"</html>"

The HTML for the credits page

Definition at line 66 of file HTML.h.

Referenced by credits_page().

◆ html_page

const PROGMEM char html_page[]
static
Initial value:
= "HTTP/1.1 200 OK\r\n"
"Content-Type: text/html\r\n"
"Connection: close\r\n\n"
"<!DOCTYPE HTML>"
"<html>"
"<body>"
"<b>Hello From Arduino!</b>"
"</body>"
"</html>"

An example of a very basic HTML page

Definition at line 198 of file HTML.h.