The lib with which to make LPC1768 a simple HTTP server. This have not yet implemented. fopen() DOESN'T WORK after EthernetInterface::connect() is called as using mbed-os 5.4~. See also https://os.mbed.com/questions/80658/HardFault-occurs-when-fopen-is-called-af/ or https://github.com/ARMmbed/mbed-os/issues/6578 and https://github.com/ARMmbed/mbed-os/issues/6624

Fork of HTTP_SERVER by Akifumi Takahashi

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers FileHandler.h Source File

FileHandler.h

00001 /*FileHandler.h*/
00002 #ifndef FILE_HANDLER_H
00003 #define FILE_HANDLER_H
00004 #include "mbed.h"
00005 #include "string.h"
00006 #include <stdlib.h>
00007 extern LocalFileSystem local;
00008 using namespace std;
00009 class FileHandler
00010 {
00011 public:
00012     FileHandler();
00013     ~FileHandler();
00014     FILE* open(const char*, const char*);
00015     int  close();
00016     virtual int getc();
00017     bool arrival();
00018     bool atEOF();
00019     bool hasError();
00020     char *getFullpath();
00021     char *getFilename();
00022     char *getSuffix();
00023     int  getFileSize();
00024 private:
00025     FILE *fp;
00026     char *fullpath;
00027     char *filename;
00028     char *suffix;
00029     char content_buffer[1024];
00030     int  file_size;
00031 };
00032 #endif