New function, execution order of functions

trojek
Posts: 15
Joined: Mon Sep 26, 2016 4:18 am

New function, execution order of functions

Postby trojek » Sat Oct 08, 2016 10:13 pm

I want to add new function to "mesh device", for example I want to add functionality to print available AP with their RSSI?
1) In which file should I do it: mesh_demo.c or mesh_device.c or other, maybe new?
2) What is order of execution functions? Is there something like "main function" which is responsible for program workflow?

ESP_Alen

Re: New function, execution order of functions

Postby ESP_Alen » Mon Oct 10, 2016 6:21 pm

trojek wrote:I want to add new function to "mesh device", for example I want to add functionality to print available AP with their RSSI?
1) In which file should I do it: mesh_demo.c or mesh_device.c or other, maybe new?
2) What is order of execution functions? Is there something like "main function" which is responsible for program workflow?


You can use espconn_mesh_scan to get AP list, and print RSSI of AP.

trojek
Posts: 15
Joined: Mon Sep 26, 2016 4:18 am

Re: New function, execution order of functions

Postby trojek » Mon Oct 10, 2016 9:10 pm

I understand that to print AP with their RSSI I should use espconn_mesh_scan function. I found it in documentation. I don't understand which functions execute from which files and in which order. For example I added to mesh_device.c new function:

Code: Select all

void ICACHE_FLASH_ATTR mesh_device_disp_string() {
MESH_DEMO_PRINT("test");
}


and it doesn't execute. If I add "MESH_DEMO_PRINT("test");" to "mesh_device_disp_mac_list()" function I can see printed string. I don't understand which functions executes, which not and why. That is why I asked about "main function" which is responsible for program workflow.

ESP_Alen

Re: New function, execution order of functions

Postby ESP_Alen » Thu Oct 13, 2016 1:08 pm

trojek wrote:I understand that to print AP with their RSSI I should use espconn_mesh_scan function. I found it in documentation. I don't understand which functions execute from which files and in which order. For example I added to mesh_device.c new function:

Code: Select all

void ICACHE_FLASH_ATTR mesh_device_disp_string() {
MESH_DEMO_PRINT("test");
}


and it doesn't execute. If I add "MESH_DEMO_PRINT("test");" to "mesh_device_disp_mac_list()" function I can see printed string. I don't understand which functions executes, which not and why. That is why I asked about "main function" which is responsible for program workflow.


user_init in mesh_demo.c is the entrance of demo.

please add scan in mesh_enable_cb.

trojek
Posts: 15
Joined: Mon Sep 26, 2016 4:18 am

Re: New function, execution order of functions

Postby trojek » Thu Oct 13, 2016 9:44 pm

Thank you Alen - that is what I asked for.

ESP_Alen

Re: New function, execution order of functions

Postby ESP_Alen » Fri Oct 14, 2016 10:15 am

trojek wrote:Thank you Alen - that is what I asked for.


welcome.

Who is online

Users browsing this forum: No registered users and 59 guests