WizFi250 AP mode example

Dependencies:   WizFi250Interface mbed

Committer:
kaizen
Date:
Tue Oct 20 11:47:51 2015 +0000
Revision:
2:7d1e5a26cb49
Parent:
0:87d959d6a3f3
change to mbed library;

Who changed what in which revision?

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