Prusa MINI Firmware overview
|
Go to the documentation of this file.
33 #define MAX_HTTP_REQUEST 1024
36 #define METHOD_LENGTH 10
41 #define lwsapi_dbg _dbg
42 #define lwsapi_error _dbg
44 #define lwsapi_free(arg) \
45 if (arg != nullptr) { \
58 static void *
operator new(
size_t size) {
62 static void operator delete(
void *ptr) {
79 virtual size_t length()
const = 0;
80 virtual void snprintf(
char *buff)
const = 0;
81 virtual void dbg()
const = 0;
96 virtual size_t length()
const override {
110 virtual void dbg()
const override {
133 virtual void dbg()
const override {
146 this->value = reinterpret_cast<char *>(
148 if (this->value !=
nullptr) {
156 this->value = reinterpret_cast<char *>(
158 if (this->value !=
nullptr) {
175 virtual void dbg()
const override {
193 while (it !=
nullptr) {
251 typedef IHeader *(*header_factory_fn)(
const char *key,
252 const char *value,
size_t value_length);
256 const char *value,
size_t value_length);
260 const char *value,
size_t value_length);
264 const char *value,
size_t value_length);
276 const char *value,
size_t value_length);
279 const char *value,
size_t value_length);
const char * response
Definition: lwsapi_app.hpp:212
virtual ~LwIPClass()
Definition: lwsapi_app.hpp:66
virtual Message_t generator(const struct pbuf *input=nullptr)=0
WSAPI generator (called more time from WSAPI http server).
char request_uri[URI_LENGTH]
Definition: lwsapi_app.hpp:184
#define METHOD_LENGTH
maximum method length (PROPPATCH) from WebDAV + \0
Definition: lwsapi_app.hpp:36
IHeader * request_header(const char *key, size_t key_length, const char *value, size_t value_length)
request_header_fn callbacke, which is call from LwIP WSAPI http server
Definition: connect.cpp:289
Environment()
Definition: lwsapi_app.hpp:186
void * mem_calloc(mem_size_t count, mem_size_t size)
Definition: mem.c:765
IHeader * const_header_factory(const char *key, const char *value, size_t value_length)
Return new ConstHeader.
IResponse()
Definition: lwsapi_app.hpp:221
IResponse::unique_ptr_t() application_fn(Environment &env)
application_fn typedef, which is called in tcp_recv callback.
Definition: lwsapi_app.hpp:246
#define lwsapi_dbg
Definition: lwsapi_app.hpp:41
const IHeader * get_headers() const
Definition: lwsapi_app.hpp:201
Definition: lwsapi_app.hpp:218
int length
Definition: lwsapi_app.hpp:215
IHeader * dynamics_header_factory(const char *key, const char *value, size_t value_length)
Return new DynamicsHeader.
Definition: lwsapi.cpp:440
Definition: lwsapi_app.hpp:56
env
Definition: create_custom_upload_command_CDC.py:23
Environment struct like as WSGI environment as possible could be.
Definition: lwsapi_app.hpp:181
IHeader *() request_header_fn(const char *key, size_t key_length, const char *value, size_t value_length)
This factory is used for parsing input headers.
Definition: lwsapi_app.hpp:275
const uint8_t[]
Definition: 404_html.c:3
std::unique_ptr< IResponse > unique_ptr_t
Definition: lwsapi_app.hpp:237
Message which must be returned from coroutine generator.
Definition: lwsapi_app.hpp:211
IResponse::unique_ptr_t application(Environment &env)
Define of application functions.
Definition: connect.cpp:306
#define lwsapi_free(arg)
Definition: lwsapi_app.hpp:44
#define URI_LENGTH
maximum length of request uri
Definition: lwsapi_app.hpp:39
const uint8_t * payload
Definition: lwsapi_app.hpp:214
void * mem_malloc(mem_size_t size)
Definition: mem.c:603
void add_header(IHeader *header)
Definition: lwsapi.cpp:28
void mem_free(void *rmem)
Definition: mem.c:419
IHeader * number_header_factory(const char *key, const char *value, size_t value_length)
Response new NumberHeader.
Definition: lwsapi.cpp:445
~Environment()
Definition: lwsapi_app.hpp:190
char method[METHOD_LENGTH]
Definition: lwsapi_app.hpp:183
const IHeader * headers
Definition: lwsapi_app.hpp:213
static png_bytep size_t size
Definition: pngwrite.c:2170