XDK API  3.6.0
Documentation
Data Structures | Typedefs | Functions
Serval_Webserver.h File Reference

Web Server ModuleThe application interface of the Webserver. In normal use cases the application does not need to directly access this interface. The "Web" component which added by the code generator to the application contains the glue code between the application stack and provides the application with a simplified interface. More...

#include <Serval_Defines.h>
#include "Serval_Types.h"
#include "Serval_Http.h"
#include "Serval_Msg.h"
+ Include dependency graph for Serval_Webserver.h:

Data Structures

struct  Webserver_Resource_S
 
struct  Webserver_Website_S
 

Typedefs

typedef struct WebMsg_S WebMsg_T
 
typedef retcode_t(* Webserver_AppRequestHandler_T )(Msg_T *)
 
typedef struct Webserver_Resource_S Webserver_Resource_T
 
typedef struct Webserver_Website_S Webserver_Website_T
 

Functions

WebMsg_TMsg_getWebMsg (Msg_T *msg_ptr)
 
Webserver_Resource_T const * WebMsg_getResource (WebMsg_T *webMsg_ptr)
 
void WebMsg_setContentType (WebMsg_T *webMsg_ptr, char const *contentType_ptr)
 
void WebMsg_setResource (WebMsg_T *webMsg_ptr, Webserver_Resource_T const *wResource_ptr)
 
retcode_t Webserver_initialize (void)
 
Webserver_Resource_T const * Webserver_lookupUrl (Msg_T *msg_ptr)
 
retcode_t Webserver_start (Webserver_Website_T *websites_ptr)
 

Typedef Documentation

typedef struct WebMsg_S WebMsg_T

The data structure for Webserver messages.

See also
struct WebMsg_S
typedef retcode_t(* Webserver_AppRequestHandler_T)(Msg_T *)

A data type defining a function pointer for the application specific request handling. The application may provide such a request handling routine for POST requests as well as GET and POST requests to virtual URLs.

See also
Webserver_Website_S

A data type definition for website resources

See also
Webserver_Resource_S

A data type representing the website hosted by the device.

See also
Webserver_Website_S

Function Documentation

WebMsg_T* Msg_getWebMsg ( Msg_T msg_ptr)

This function provides a pointer to the structure holding web message in the given Msg_T object.

Parameters
[in]msg_ptrReference to a Msg_T object. It has to be a valid pointer.
Returns
a pointer of type WebMsg_T to the required web message structure.
Webserver_Resource_T const* WebMsg_getResource ( WebMsg_T webMsg_ptr)

It returns a reference to the webserver resource of the given web message.

Parameters
[in]webMsg_ptrReference to the WebMsg_t object. It has to be a valid pointer.
Returns
A reference to the webserver resource.
void WebMsg_setContentType ( WebMsg_T webMsg_ptr,
char const *  contentType_ptr 
)

This function is called to set the content type to be used in the response for the given web message.

Parameters
[in]webMsg_ptrReference to the WebMsg_t object to modify. It has to be a valid pointer.
[in]contentType_ptrThe content type to set.
See also
Http_ContentType_Text_Plain, Http_ContentType_Text_Html, Http_ContentType_Image_Gif, Http_ContentType_Image_Png, Http_ContentType_Image_Jpeg, Http_ContentType_Image_Bmp, Http_ContentType_Image_Ico, Http_ContentType_App_Pdf, Http_ContentType_App_Soap
void WebMsg_setResource ( WebMsg_T webMsg_ptr,
Webserver_Resource_T const *  wResource_ptr 
)

This function is called to set the webserver resource of the given web message. This resource will be used in the response for the given web message.

Parameters
[in]webMsg_ptrReference to the WebMsg_t object to modify. It has to be a valid pointer.
[in]wResource_ptrThe webserver resource to set in the web message.
retcode_t Webserver_initialize ( void  )

Initializes the webserver and all dependent components.

Returns
RC_OK or RC_WEBSERVER_INIT_ERROR
Webserver_Resource_T const* Webserver_lookupUrl ( Msg_T msg_ptr)

It looks up the resource identified by the URL given in the HTTP message.

Parameters
[in]msg_ptrA reference to the message including the HTTP message. It must be a valid pointer to a valid message.
Returns
A reference to the resource element. If the URL does not exist in the website resources, then NULL pointer is returned.
retcode_t Webserver_start ( Webserver_Website_T websites_ptr)

Starts the webserver with the given context.

Parameters
[in]websites_ptrA reference to the webserver context including the resources, and handling functions.
Returns
RC_OK or RC_WEBSERVER_START_ERROR

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:46 by doxygen 1.8.8