Atmel Software Framework

config_file.c File Reference
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "fsaccess.h"
#include "config_file.h"
#include "cptime.h"
#include "shell.h"
#include "compiler.h"


signed short config_file_get_value (char *filename, char *pcField, char *pcValue)
 get module config, by parsing config file. More...
signed short config_file_set_value (char *filename, int ac, signed char *av[])
 This function replace a (or many) line(s) in a file. More...

signed short config_file_get_value ( char *  filename,
char *  pcField,
char *  pcValue 

get module config, by parsing config file.

filenameInput. file to read into.
pcFieldInput. field to find in file.
pcValueOutput. value read for this field, as string.
short 0 if success, -1 otherwise.

References close(), end, fsaccess_file_get_size(), MAX_CONFIG_FILE_SIZE, NULL, O_RDONLY, open(), pvPortMalloc(), read(), and vPortFree().

Referenced by b_joystick_init(), b_light_init(), b_potentiometer_init(), b_pushb1_init(), b_pushb2_init(), b_pushb3_init(), b_temperature_init(), and prvEthernetConfigureInterface().

signed short config_file_set_value ( char *  filename,
int  ac,
signed char *  av[] 

This function replace a (or many) line(s) in a file.

   Syntax of the line should be :@verbatim field=value\r\n 
filenameInput. The filename to write into.
acInput. The argument counter. For this command, should be 1.
avInput. The argument vector.
short : 0 if success or -1 else

References close(), CRLF, FS_DATE_LAST_WRITE, fsaccess_file_get_size(), i, MAX_CONFIG_FILE_SIZE, nav_file_dateset(), NULL, O_RDONLY, O_WRONLY, open(), pcTempoDate, pvPortMalloc(), read(), v_cptime_GetDateInFatStringFormat(), vPortFree(), and write().

Referenced by e_ethernet_cmd_set_config(), e_joystick_set_config(), e_light_set_config(), e_potentiometer_set_config(), e_smtpclient_cmd_set_config(), e_temperature_set_config(), and prv_e_pushb_set_config().