ACKme
/
wiconnect-join_example
Simple app demonstrating network join feature of WiConnect Host Library.
Revision 11:d4a23c59b13d, committed 2014-09-07
- Comitter:
- dan_ackme
- Date:
- Sun Sep 07 02:15:17 2014 +0000
- Parent:
- 10:6055678da632
- Child:
- 12:e06ec86ee190
- Commit message:
- updated for STM32F411
Changed in this revision
--- a/WiConnect.lib Tue Aug 26 23:55:18 2014 +0000 +++ b/WiConnect.lib Sun Sep 07 02:15:17 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/ACKme/code/WiConnect/#2d7ef60a9f2a +http://mbed.org/teams/ACKme/code/WiConnect/#8cfc6fdce6b0
--- a/example.cpp Tue Aug 26 23:55:18 2014 +0000 +++ b/example.cpp Sun Sep 07 02:15:17 2014 +0000 @@ -22,11 +22,11 @@ // Look for this name in your WiFi settings // (e.g. your phone's list of WiFi networks in the WiFi settings menu) // tip: add double-quotes around SSID to add spaces to name -#define NETWORK_SSID "\"<YOUR NETWORK NAME HERE>\"" +#define NETWORK_SSID "hackathon" // This is the password of your WiFi network // Leave as empty string (e.g "") to connect to OPEN network -#define NETWORK_PASSWORD "\"<YOUR NETWORK PASSWORD HERE>\"" +#define NETWORK_PASSWORD "" @@ -61,6 +61,7 @@ */ int main(int argc, char **argv) { + WiconnectResult result; consoleSerial.baud(115200); // console terminal to 115200 baud //------------------------------------------------------------------------- @@ -99,9 +100,9 @@ printf("Joining network: %s....\r\n", NETWORK_SSID); - if(wiconnect.join(NETWORK_SSID, NETWORK_PASSWORD) != WICONNECT_SUCCESS) + if(WICONNECT_FAILED(result, wiconnect.join(NETWORK_SSID, NETWORK_PASSWORD))) { - printf("Failed to send join command\r\n"); + printf("Failed to send join command: %d\r\n", result); for(;;); // infinite loop }
--- a/target_config.h Tue Aug 26 23:55:18 2014 +0000 +++ b/target_config.h Sun Sep 07 02:15:17 2014 +0000 @@ -1,13 +1,31 @@ -/* - * Copyright 2014, ACKme Networks - * All Rights Reserved. - * - * This is UNPUBLISHED PROPRIETARY SOURCE CODE of ACKme Networks; - * the contents of this file may not be disclosed to third parties, copied - * or duplicated in any form, in whole or in part, without the prior - * written permission of ACKme Networks. +/** + * ACKme WiConnect Host Library is licensed under the BSD licence: + * + * Copyright (c)2014 ACKme Networks. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. */ - #pragma once @@ -55,7 +73,7 @@ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Nucleo F401RE Target Configuration -#ifdef TARGET_NUCLEO_F401RE +#if defined(TARGET_NUCLEO_F401RE) || defined(TARGET_NUCLEO_F411RE) #define WICONNECT_TX_PIN PA_9 #define WICONNECT_RX_PIN PA_10 @@ -71,3 +89,4 @@ #endif #endif +