hjkjhgfdfgh

Dependencies:   WizFi310Interface_Legacynew mbed

Fork of WizFi310_AP by ajeet prajapati

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /*
00002  * Copyright (C) 2015 Wiznet, MIT License
00003  *
00004  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
00005  * and associated documentation files (the "Software"), to deal in the Software without restriction,
00006  * including without limitation the rights to use, copy, modify, merge, publish, distribute,
00007  * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
00008  * furnished to do so, subject to the following conditions:
00009  *
00010  * The above copyright notice and this permission notice shall be included in all copies or
00011  * substantial portions of the Software.
00012  *
00013  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
00014  * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00015  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
00016  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00017  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00018  */
00019 
00020 #include <stdio.h>
00021 #include "mbed.h"
00022 #include "WizFi310Interface.h"
00023 
00024 
00025 #define SECURE WizFi310::SEC_WPA2_MIXED
00026 #define SSID "WIZFI310TEST"
00027 #define PASS "PASSWORD"
00028 
00029 #if defined(TARGET_WIZwiki_W7500)
00030     WizFi310Interface wizfi310(D1, D0, D7, D6, D8, NC, 115200);
00031     Serial pc(USBTX, USBRX);
00032 #endif
00033 
00034 
00035 /**
00036  *  \brief Hello World
00037  *  \param none
00038  *  \return int
00039  */
00040 int main()
00041 {
00042     pc.baud(115200);
00043  
00044     printf("WizFi310  AP. \r\n");
00045     wizfi310.init();
00046     printf("After Initialisation. \r\n");
00047 
00048     printf("After Set Address. \r\n");
00049     wizfi310.setAddress("192.168.100.1","255.255.255.0","192.168.100.1");
00050     if ( wizfi310.connect(SECURE, SSID, PASS, WizFi310::WM_AP))      return -1;
00051     printf("After Connect. \r\n");
00052     printf("IP Address is %s\r\n", wizfi310.getIPAddress());
00053     //wizfi310.test_weathermap();
00054     
00055     //wizfi310.disconnect();
00056 }