New function, execution order of functions
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?
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?
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.
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:
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.
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.
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.
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
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.