dbytrderf

Dependencies:   WizFi310Interface_Legacy45566 mbed

Committer:
ajeet3004
Date:
Mon Nov 27 05:30:42 2017 +0000
Revision:
0:9058d73cfb76
ggf

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ajeet3004 0:9058d73cfb76 1 /*
ajeet3004 0:9058d73cfb76 2 * Copyright (C) 2015 Wiznet, MIT License
ajeet3004 0:9058d73cfb76 3 *
ajeet3004 0:9058d73cfb76 4 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
ajeet3004 0:9058d73cfb76 5 * and associated documentation files (the "Software"), to deal in the Software without restriction,
ajeet3004 0:9058d73cfb76 6 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
ajeet3004 0:9058d73cfb76 7 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
ajeet3004 0:9058d73cfb76 8 * furnished to do so, subject to the following conditions:
ajeet3004 0:9058d73cfb76 9 *
ajeet3004 0:9058d73cfb76 10 * The above copyright notice and this permission notice shall be included in all copies or
ajeet3004 0:9058d73cfb76 11 * substantial portions of the Software.
ajeet3004 0:9058d73cfb76 12 *
ajeet3004 0:9058d73cfb76 13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
ajeet3004 0:9058d73cfb76 14 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
ajeet3004 0:9058d73cfb76 15 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
ajeet3004 0:9058d73cfb76 16 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
ajeet3004 0:9058d73cfb76 17 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ajeet3004 0:9058d73cfb76 18 */
ajeet3004 0:9058d73cfb76 19
ajeet3004 0:9058d73cfb76 20 #include <stdio.h>
ajeet3004 0:9058d73cfb76 21 #include "mbed.h"
ajeet3004 0:9058d73cfb76 22 #include "WizFi310Interface.h"
ajeet3004 0:9058d73cfb76 23 #include "TCPSocketServer.h"
ajeet3004 0:9058d73cfb76 24
ajeet3004 0:9058d73cfb76 25
ajeet3004 0:9058d73cfb76 26 #define SECURE WizFi310::SEC_WPA2_MIXED
ajeet3004 0:9058d73cfb76 27 //#define SSID "CDI"
ajeet3004 0:9058d73cfb76 28 //#define PASS "Cdi*1717"
ajeet3004 0:9058d73cfb76 29 #define SSID "CDIWIZFI310TEST"
ajeet3004 0:9058d73cfb76 30 #define PASS "1234567890"
ajeet3004 0:9058d73cfb76 31
ajeet3004 0:9058d73cfb76 32
ajeet3004 0:9058d73cfb76 33 #if defined(TARGET_WIZwiki_W7500)
ajeet3004 0:9058d73cfb76 34 WizFi310Interface wizfi310(D1, D0, D7, D6, D8, NC, 115200);
ajeet3004 0:9058d73cfb76 35 Serial pc(USBTX, USBRX);
ajeet3004 0:9058d73cfb76 36 #endif
ajeet3004 0:9058d73cfb76 37
ajeet3004 0:9058d73cfb76 38
ajeet3004 0:9058d73cfb76 39 /**
ajeet3004 0:9058d73cfb76 40 * \brief Hello World
ajeet3004 0:9058d73cfb76 41 * \param none
ajeet3004 0:9058d73cfb76 42 * \return int
ajeet3004 0:9058d73cfb76 43 */
ajeet3004 0:9058d73cfb76 44 int main()
ajeet3004 0:9058d73cfb76 45 {
ajeet3004 0:9058d73cfb76 46 pc.baud(115200);
ajeet3004 0:9058d73cfb76 47
ajeet3004 0:9058d73cfb76 48 printf("WizFi310 AP. \r\n");
ajeet3004 0:9058d73cfb76 49 wizfi310.init();
ajeet3004 0:9058d73cfb76 50 printf("After Initialisation. \r\n");
ajeet3004 0:9058d73cfb76 51 wizfi310.setAddress("192.168.200.1","255.255.255.0","192.168.200.1");
ajeet3004 0:9058d73cfb76 52 printf("After Set Address. \r\n");
ajeet3004 0:9058d73cfb76 53 if ( wizfi310.connect(SECURE, SSID, PASS, WizFi310::WM_AP)) return -1;
ajeet3004 0:9058d73cfb76 54 printf("After Connect. \r\n");
ajeet3004 0:9058d73cfb76 55 printf("IP Address is %s\r\n", wizfi310.getIPAddress());
ajeet3004 0:9058d73cfb76 56
ajeet3004 0:9058d73cfb76 57 //wizfi310.test1();
ajeet3004 0:9058d73cfb76 58 // wizfi310.test2();
ajeet3004 0:9058d73cfb76 59 // wizfi310.test3();
ajeet3004 0:9058d73cfb76 60 //int a=TCPSocketServer::bind(80);
ajeet3004 0:9058d73cfb76 61 wizfi310.bind();
ajeet3004 0:9058d73cfb76 62
ajeet3004 0:9058d73cfb76 63 //wizfi310.disconnect();
ajeet3004 0:9058d73cfb76 64 }