hjkjhgfdfgh

Dependencies:   WizFi310Interface_Legacynew mbed

Fork of WizFi310_AP by ajeet prajapati

Committer:
wiznetw7500
Date:
Tue Feb 13 06:03:03 2018 +0000
Revision:
2:b7c66f67341b
Parent:
1:abf832a04e02
wertyujhgfd

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
wiznetw7500 2:b7c66f67341b 26 #define SSID "WIZFI310TEST"
wiznetw7500 2:b7c66f67341b 27 #define PASS "PASSWORD"
ajeet3004 0:8c36d001e470 28
ajeet3004 0:8c36d001e470 29 #if defined(TARGET_WIZwiki_W7500)
ajeet3004 0:8c36d001e470 30 WizFi310Interface wizfi310(D1, D0, D7, D6, D8, NC, 115200);
ajeet3004 0:8c36d001e470 31 Serial pc(USBTX, USBRX);
ajeet3004 0:8c36d001e470 32 #endif
ajeet3004 0:8c36d001e470 33
ajeet3004 0:8c36d001e470 34
ajeet3004 0:8c36d001e470 35 /**
ajeet3004 0:8c36d001e470 36 * \brief Hello World
ajeet3004 0:8c36d001e470 37 * \param none
ajeet3004 0:8c36d001e470 38 * \return int
ajeet3004 0:8c36d001e470 39 */
ajeet3004 0:8c36d001e470 40 int main()
ajeet3004 0:8c36d001e470 41 {
ajeet3004 0:8c36d001e470 42 pc.baud(115200);
ajeet3004 0:8c36d001e470 43
ajeet3004 1:abf832a04e02 44 printf("WizFi310 AP. \r\n");
ajeet3004 0:8c36d001e470 45 wizfi310.init();
ajeet3004 0:8c36d001e470 46 printf("After Initialisation. \r\n");
ajeet3004 0:8c36d001e470 47
ajeet3004 0:8c36d001e470 48 printf("After Set Address. \r\n");
ajeet3004 1:abf832a04e02 49 wizfi310.setAddress("192.168.100.1","255.255.255.0","192.168.100.1");
ajeet3004 1:abf832a04e02 50 if ( wizfi310.connect(SECURE, SSID, PASS, WizFi310::WM_AP)) return -1;
ajeet3004 0:8c36d001e470 51 printf("After Connect. \r\n");
ajeet3004 0:8c36d001e470 52 printf("IP Address is %s\r\n", wizfi310.getIPAddress());
ajeet3004 0:8c36d001e470 53 //wizfi310.test_weathermap();
ajeet3004 0:8c36d001e470 54
ajeet3004 0:8c36d001e470 55 //wizfi310.disconnect();
ajeet3004 0:8c36d001e470 56 }