|
static int | mutex_lock (int *mx) |
|
static int | mutex_init (void) |
|
static void | mutex_unlock (int *mx) |
|
static int | get_http_headers (const char *fName, char *buff) |
|
int | GetHTTP_Header (const char *fName, char *buff) |
| Get HTTP header function.
|
|
struct fs_file * | fs_open_default (void) |
| Open default HTTP file function.
|
|
struct fs_file * | fs_open (const char *name) |
| Open a file from the Filesystem function.
|
|
void | fs_close (struct fs_file *file) |
| Closes/Frees a previously opened file function.
|
|
int | fs_read (struct fs_file *file, char *buffer, int count) |
| This reads the requested number of bytes from the file function.
|
|
int | fs_bytes_left (struct fs_file *file) |
| Get number of bytes yet to be read in a file function.
|
|
uint32_t | DFS_ReadSector (uint8_t unit, uint8_t *buffer, uint32_t sector, uint32_t count) |
| Function to read data from filesystem buffer.
|
|
uint32_t | DFS_WriteSector (uint8_t unit, uint8_t *buffer, uint32_t sector, uint32_t count) |
|
void | LWIP_Init (void) |
| lwIP dual core example initialisation function
|
|
void | lwip_tasks (void) |
| LWIP Task function.
|
|
The lwIP Filesystem implementation module implements the file system functions required for FAT file system.
The LWIP HTTP Server example demonstrates the HTTP Server example using LWIP ethernet stack. The HTTP server can be configured to run on any of the cores (M4 or M0). The user should connect the board to the network by using the ethernet cable. The board will get an IP address by using DHCP method. The use can access the HTTP Server by using a web browser from the host PC. If the USB Mass storage is compiled in the application (on either M0/M4 core), then it will read the HTTP contents from USB Mass storage disk & provided to the user. If the USB Mass storage is not compiled in the application (on either M0/M4 core), then the default HTTP page will be displayed. In FreeRTOS/uCOS-III configurations, the net_conn API interface will be used. In stand-alone configuration, HTTPD interface will be used
Build procedure: LPCOpen 18xx/43xx build instructions
Submit bug reports for LPCOpen code here.
Function to read data from filesystem buffer.
- Parameters
-
unit | : Unit number of the filesystem |
buffer | : Pointer to memory to which read data to be stored |
sector | : Starting sector from which the data to be read |
count | : Number of sections to be read |
- Returns
- 0 on success, non zero on failure This function is called by DOS Filesystem library to read sectors from the filesystem.
Definition at line 426 of file lwip_fs.c.
int fs_bytes_left |
( |
struct fs_file * |
file | ) |
|
Get number of bytes yet to be read in a file function.
- Parameters
-
file | : Pointer to File structure of opened file |
- Returns
- Number of byets yet to be read from the file The function will return the number bytes yet to be read from the file.
Definition at line 385 of file lwip_fs.c.
void fs_close |
( |
struct fs_file * |
file | ) |
|
Closes/Frees a previously opened file function.
- Parameters
-
file | : Pointer to File structure of opened file |
- Returns
- None The function will close the file & free the resources.
Definition at line 355 of file lwip_fs.c.
struct fs_file* fs_open |
( |
const char * |
name | ) |
|
|
read |
Open a file from the Filesystem function.
- Parameters
-
name | : Name of the file to be opened |
- Returns
- Pointer to File structure on success NULL on failure The function will open the file present on the file system.
Definition at line 297 of file lwip_fs.c.
struct fs_file* fs_open_default |
( |
void |
| ) |
|
|
read |
Open default HTTP file function.
- Returns
- Pointer to File structure of default file on success NULL on failure The function will open the default file. The default file will have the HTTP content pointed by http_index_html variable. This function will be called if the HTTP files are not present in the file system.
Definition at line 266 of file lwip_fs.c.
int fs_read |
( |
struct fs_file * |
file, |
|
|
char * |
buffer, |
|
|
int |
count |
|
) |
| |
This reads the requested number of bytes from the file function.
- Parameters
-
file | : Pointer to File structure of opened file |
buffer | : pointer to memroy, where the data be stored |
count | : Number of bytes to be read from the file |
- Returns
- Number of bytes successfully read The function will read the specified number of bytes from the file.
Definition at line 370 of file lwip_fs.c.
static int get_http_headers |
( |
const char * |
fName, |
|
|
char * |
buff |
|
) |
| |
|
static |
Generate the relevant HTTP headers for the given filename and write them into the supplied buffer.
Definition at line 167 of file lwip_fs.c.
int GetHTTP_Header |
( |
const char * |
fName, |
|
|
char * |
buff |
|
) |
| |
Get HTTP header function.
- Parameters
-
fName | : Filename for which the header be generated |
buff | : buffer to which the generated header be copied |
- Returns
- Number of bytes in header The function will read the HTTP header from the file & returns with No. of bytes read
Definition at line 252 of file lwip_fs.c.
lwIP dual core example initialisation function
This function initializes the lwIP interface (ethernet etc.). In stand-alone configuration, this function will enable the tick functionality. It will initialises the LWIP stack, initialises the network interface, initialises the DHCP & HTTPD functions. In FreeRTOS/uCOS-III configurations, it does nothing as the initialization is handed by the corresponding tasks. This function is called by main() only when EXAMPLE_LWIP is defined.
- Returns
- None
Definition at line 263 of file example_lwip_httpserver.c.
LWIP Task function.
Function that creates/performs the lwIP stack functionality. In stand-alone configuration, this function will monitor the link status and handles the packets. In FreeRTOS/uCOS-III configurations, it will create the network interface task. Called by dual core main() only when EXAMPLE_LWIP is defined.
- Returns
- None
Definition at line 350 of file example_lwip_httpserver.c.
static int mutex_init |
( |
void |
| ) |
|
|
static |
static int mutex_lock |
( |
int * |
mx | ) |
|
|
static |
static void mutex_unlock |
( |
int * |
mx | ) |
|
|
static |
const char http_index_html[] |
|
static |
Initial value:=
"<html><head><title>Congrats!</title></head>"
"<body><h1>Welcome to our lwIP HTTP server!</h1>"
"<p>This is a small test page, served by httpd of "
"lwip.</p></body></html>"
Definition at line 55 of file lwip_fs.c.