hjkjhgfdfgh

Dependencies:   WizFi310Interface_Legacynew mbed

Fork of WizFi310_AP by ajeet prajapati

Committer:
ajeet3004
Date:
Mon Sep 18 03:29:44 2017 +0000
Revision:
0:8c36d001e470
Child:
1:abf832a04e02
WizFi_Station

Who changed what in which revision?

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