Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- gauresh2798
- Date:
- 2016-05-28
- Revision:
- 1:52cad7057640
- Parent:
- 0:c359fee24b6c
- Child:
- 2:d5c9337fdce1
File content as of revision 1:52cad7057640:
/* NOTE: Devices or pins are added in the library[EDUVANCE_WIFI_SHIELD.cpp] HTML PART IS THERE IN sendpage() RESPONSE IS IN ReadWebData() */ #include "mbed.h" #include "EDUVANCE_WIFI_SHIELD.h" //All the initializations must be done in proper order for reliable functioning //connect pin 3 and 4 of ESP_COMM_CTRL HEADER TO SCL AND SDA respectively (ON THE SHIELD) /* ESP_COMM_CTRL (1) (2) (3) (4) (5) (6) (7) (8) */ //FOR STATION MODE SSID, PASSWORD ARE NEEDED char ssid_main[32]="@@@@@@@"; char pwd_main[32]="@@@@@@@@@@@@@"; int port_main=8266; //SELECT MODES: STATION=10 AND AP=20 int run1=1; int main() { //SET THE BAUD RATE OF UARTS TO DISPLAY MESSAGE ON COMPUTER AND TO INPUT TO AT COMMANDS TO ESP setbaudrate(115200); //SEND THE SSID, PASSWORD AND USER DEFINED PORT ADDRESS TO THE LIBRARY get_ssid_pass(ssid_main,pwd_main,port_main); /* START SERVER THE FUNCTION RETURNS THE VALUE 10 IF THE ABOVE GIVEN SSID IS ACTIVE NEARBY OR ELSE IT RETURNS 20. */ modeselector=startserver(); if(modeselector==10){ //CONFIGUR IN STATION MODE AND GET A VALID IP ADDRESS FROM SERVER StationConfig(); } else if(modeselector==20){ //CONFIGUR IN AP MODE AND GENERATE A WIFI ACCESS POINT (HOTSPOT) WITH VALID IP ADDRESS ApConfig(); } //DO THIS OPERATION CONTINUOUSLY while(1){ //DISPLAY A STATIC WEBPAGE AND GET THE VALUES SET BY USER ON IT. if(modeselector==10){ request_fetch_station(); } else if(modeselector==20){ request_fetch_ap(); } } }