The library with which to configure a Web Socket Server on a Mbed. This lib was coded by a day at least one year before when this description is written. It will be updated adopting mbed os 5.

Dependencies:   mbedTLSLibrary

Dependents:   SIMPLE_WSS

handlers/FileHandler.h

Committer:
aktk
Date:
2018-03-03
Revision:
2:ccaae77f91b8

File content as of revision 2:ccaae77f91b8:

/*FileHandler.h*/
#ifndef FILE_HANDLER_H
#define FILE_HANDLER_H
#include "mbed.h"
#include "string.h"
#include <stdlib.h>

using namespace std;
class FileHandler
{
public:
    FileHandler();
    ~FileHandler();
    FILE* open(const char*, const char*);
    int  close();
    virtual int getc();
    bool arrival();
    bool atEOF();
    bool hasError();
    char *getFullpath();
    char *getFilename();
    char *getSuffix();
    int  getFileSize();
private:
    FILE *fp;
    char *fullpath;
    char *filename;
    char *suffix;
    char content_buffer[1024];
    int  file_size;
};
#endif