Definition in file BasicWEB.h.
#include "portmacro.h"
#include "shell.h"
#include "supervisor.h"
Go to the source code of this file.
Functions | |
eExecStatus | e_webserver_cmd_get_config (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply) |
The get webserver config command: get the config fields value of http port Takes no parameter. | |
eExecStatus | e_webserver_cmd_set_config (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply) |
The set webserver config command: set the http port. Takes one parameter : port=ppppp. | |
portTASK_FUNCTION_PROTO (vBasicWEBServer, pvParameters) | |
WEB server main task. |
eExecStatus e_webserver_cmd_get_config | ( | eModId | xModId, | |
signed short | FsNavId, | |||
int | ac, | |||
signed portCHAR * | av[], | |||
signed portCHAR ** | ppcStringReply | |||
) |
The get webserver config command: get the config fields value of http port Takes no parameter.
xModId | Input. The module that is calling this function. | |
FsNavId | Ignored. | |
ac | Input. The argument counter. For this command, should be 1. | |
av | Input. The argument vector. | |
ppcStringReply | Input/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string. |
Definition at line 404 of file BasicWEB.c.
References SHELL_ERRMSG_MEMALLOC, SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, sprintf(), and webHttpPort.
Referenced by e_syscmds_cmd_get_config().
00407 { 00408 if(ppcStringReply != NULL) 00409 { 00410 /* allocate a buffer for answer */ 00411 *ppcStringReply = (signed portCHAR *)pvPortMalloc(15); 00412 if( NULL == *ppcStringReply ) 00413 { 00414 *ppcStringReply = (signed portCHAR *)SHELL_ERRMSG_MEMALLOC; 00415 return( SHELL_EXECSTATUS_KO ); 00416 } 00417 /* get HTTP port and add it to the buffer */ 00418 sprintf((char *)*ppcStringReply,"port=%u\r\n", webHttpPort); 00419 /* no error, return */ 00420 return( SHELL_EXECSTATUS_OK ); 00421 } 00422 return( SHELL_EXECSTATUS_KO ); 00423 }
eExecStatus e_webserver_cmd_set_config | ( | eModId | xModId, | |
signed short | FsNavId, | |||
int | ac, | |||
signed portCHAR * | av[], | |||
signed portCHAR ** | ppcStringReply | |||
) |
The set webserver config command: set the http port. Takes one parameter : port=ppppp.
xModId | Input. The module that is calling this function. | |
FsNavId | Ignored. | |
ac | Input. The argument counter. For this command, should be 1. | |
av | Input. The argument vector. | |
ppcStringReply | Input/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string. |
Definition at line 364 of file BasicWEB.c.
References config_file_set_value(), HTTP_CONFIG_FILE, SHELL_ERRMSG_CONFIGERROR, SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, and SHELL_MSG_REBOOT.
Referenced by e_syscmds_cmd_set_config().
00367 { 00368 if (config_file_set_value(HTTP_CONFIG_FILE, ac, av) != 0) 00369 { 00370 if(ppcStringReply != NULL) 00371 { 00372 *ppcStringReply = (signed portCHAR *)SHELL_ERRMSG_CONFIGERROR; 00373 } 00374 return( SHELL_EXECSTATUS_KO ); 00375 } 00376 if(ppcStringReply != NULL) 00377 { 00378 /* allocate a buffer for answer */ 00379 *ppcStringReply = (signed portCHAR *)pvPortMalloc( strlen( SHELL_MSG_REBOOT ) +1 ); // Alloc 00380 if( NULL != *ppcStringReply ) 00381 { 00382 strcpy( (char *)*ppcStringReply, SHELL_MSG_REBOOT ); 00383 } 00384 } 00385 return( SHELL_EXECSTATUS_OK ); 00386 }
portTASK_FUNCTION_PROTO | ( | vBasicWEBServer | , | |
pvParameters | ||||
) |
WEB server main task.