Dynamic website content {% .. %}, what am i missing? Topic is solved

If you have a simple question and just want an answer.
Post Reply
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

Dynamic website content {% .. %}, what am i missing?

Post by DemoniacMilk »

I am trying to make use of dynamic website content. I have checked the annotation notes and example, and created a small website for tests.

However, the project does not compile.
../.build/generated/lib_webserver/web_files.c:46:41: error: too few arguments to function call, single argument 'buf' was not specified
case 0: return webGetOutputGainValue();

.././src\web_server_conf.h:24:1: note: 'webGetOutputGainValue' declared here
int webGetOutputGainValue(char buf[]);
In my html file, the function call looks like this:

Code: Select all

<input id="sGainOut"	type="range" name="gainOutSlider" 	min="-30" max="0"	
value="{% webGetOutputGainValue(buf) %}">
with a function declaration in web_server_conf.h

Code: Select all

int webGetOutputGainValue(char buf[]);
and the function in web_page_functions.c

Code: Select all

int webGetOutputGainValue(char buf[]){
    unsigned uiLen = sprintf(buf, "%f", some_value);
    return uiLen;
}
I checked the generated file web_files.c the error occurs in, and the function call does not have any parameters, so I understand the compiler error. But I dont understand why the function call has no parameters. Checked the webserver example and didnt find any differences, but I must be missing something.
Also, where is buf declared? couldnt find any definition within the webserver example.


View Solution
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

Post by DemoniacMilk »

I went ahead and manually added the parameters. Worked.

Edit: wow, I realized I was working in a file in a backup directory. The file in the projects web folder was outdated and didnt have any parameters in the function call ...
Post Reply