How to open the webpage?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to open the webpage?

Jump to solution
1,614 Views
winmaxi
Contributor I

Hi, I'm currently reading the code of LAB 4.

 

How does the code link to the webpage it opens?

 

In the code there is <server = httpd_server_init((HTTPD_ROOT_DIR_STRUCT*)root_dir, "\\mqx.html");>   I can't locate mqx.html.

 

Also, could you please tell me how does it go to the root directory of the webpage without spelling out the webpage's address?

 

Thank you.

Labels (1)
Tags (1)
0 Kudos
1 Solution
644 Views
M_ttferrari
Contributor III

HI, 

 

Are you installed the tfs? 

 

You need convert your web pages to tfs with mktfs.exe (it is located in somewhere at mqx folder, I don't remember now). This application converts your web pages into a c file (tfs_data.c) then you need to declare a HTTP_ROOT_DIR_STRUCT 

 

const HTTP_ROOT_DIR_STRUCT root_dir[] = {

 { "", "tfs:"},

 { 0, 0}

};

 

then before to install your server, install the tfs where the server will find your web pages (and images if you web page has ones).

 

io_tfs_anstall("tfs", tfs_data);

 

Please, take a sight to MQX RTCS user guide you will find some examples about how initialize a web server.

 

Matt

View solution in original post

0 Kudos
3 Replies
644 Views
winmaxi
Contributor I

Now I know where the mqx.html locate. But I still don't know how the program indicate where the folder is without spelling out the directory.

 

Could anyone answer my question?

 

Thank you

0 Kudos
645 Views
M_ttferrari
Contributor III

HI, 

 

Are you installed the tfs? 

 

You need convert your web pages to tfs with mktfs.exe (it is located in somewhere at mqx folder, I don't remember now). This application converts your web pages into a c file (tfs_data.c) then you need to declare a HTTP_ROOT_DIR_STRUCT 

 

const HTTP_ROOT_DIR_STRUCT root_dir[] = {

 { "", "tfs:"},

 { 0, 0}

};

 

then before to install your server, install the tfs where the server will find your web pages (and images if you web page has ones).

 

io_tfs_anstall("tfs", tfs_data);

 

Please, take a sight to MQX RTCS user guide you will find some examples about how initialize a web server.

 

Matt

0 Kudos
644 Views
winmaxi
Contributor I

Thank you very much.

 

I have question about using mktfs.exe.

When I double click it directly, it will close in about 2 seconds.

When I run it using windows command prompt, what the format is like?

In using MQXlibraries document, 

it asks us to input like the following:

 

mktfs.exe <Folder to be converted> <Output source file name>

for example:

C:\mktfs.exe web_pages tfs_data_file.c

 

I put mktfs.exe C:.../webpages(the directory of the webpage folder) tfs_data_file.c

it asks me to input [-s <separate file>] <input_directory>

I don't know what it means, so I input as the folliowing:

 

mktfs.exe C:.../webpages(the directory of the webpage folder) C:..../tfs_data_file.c(where I want to save the translated C document)

it shows the same message.

 

What exactly the format should be like? Could anyone help me?

0 Kudos