Download Print this page

NETGEAR KWGR614 User Manual page 6

Open source wireless-g router
Hide thumbs Also See for KWGR614:

Advertisement

user/boa/src/rtl865x/board.h
#define MAX_QUESTION_LENGTH 64
typedef struct exampleParam_s
{
char question[MAX_QUESTION_LENGTH];
int answer;
} exampleParam_t;
Add the new parameter to the main parameter structure to include it in the configuration set.
user/boa/src/rtl865x/board.h
typedef struct romeCfgParam_s
{
. . .
exampleParam_t exampleParam;
} romeCfgParam_t;
Create get/set functions for the parameter.
user/dniutil/nvram_realtek.c
char *
nvram_get_example_question (char *name)
{
DPRINTF("nvram_get(\"%s\")\n", name);
sprintf(str, "%s", pRomeCfgParam->exampleParam.question);
return (str);
}
int
nvram_set_example_question(char *name, char *value)
{
DPRINTF("nvram_set(\"%s\", \"%s\")\n", name, value);
strncpy(pRomeCfgParam->exampleParam.question, value, \
return 1;
}
char *
nvram_get_example_answer (char *name)
{
DPRINTF("nvram_get(\"%s\")\n", name);
sprintf(str, "%d", pRomeCfgParam->exampleParam.answer);
return (str);
}
int
nvram_set_example_question(char *name, char *value)
{
DPRINTF("nvram_set(\"%s\", \"%s\")\n", name, value);
pRomeCfgParam->exampleParam.answer = atoi(value);
return 1;
}
Add the get/set handlers to the NVRAM handler table.
sizeof(pRomeCfgParam->exampleParam.question));
KWGR Open Source Guide (Rev 2.0)

Advertisement

loading